[retro-gtk/c-port: 14/42] Port LightgunId to C



commit 33d3ae45aa0d3e6a2f791f4dcba81e42bdfb8272
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Sep 5 14:57:40 2017 +0200

    Port LightgunId to C

 retro-gtk/Makefile.am         |    1 +
 retro-gtk/input/device.vala   |   13 -------------
 retro-gtk/retro-gtk.h         |    1 +
 retro-gtk/retro-lightgun-id.h |   39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 41 insertions(+), 13 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index 9fed61c..98734f0 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -36,6 +36,7 @@ retro_gtk_public_h_sources = \
        retro-gtk.h \
        retro-gtk-vala.h \
        retro-joypad-id.h \
+       retro-lightgun-id.h \
        retro-mouse-id.h \
        $(NULL)
 
diff --git a/retro-gtk/input/device.vala b/retro-gtk/input/device.vala
index a8165eb..04f6f3a 100644
--- a/retro-gtk/input/device.vala
+++ b/retro-gtk/input/device.vala
@@ -3,19 +3,6 @@
 namespace Retro {
 
 /**
- * The input types of a lightgun.
- */
-private enum LightgunId {
-       X,
-       Y,
-       TRIGGER,
-       CURSOR,
-       TURBO,
-       PAUSE,
-       START
-}
-
-/**
  * The input types of a pointer.
  */
 private enum PointerId {
diff --git a/retro-gtk/retro-gtk.h b/retro-gtk/retro-gtk.h
index 82b5ba9..78b13d2 100644
--- a/retro-gtk/retro-gtk.h
+++ b/retro-gtk/retro-gtk.h
@@ -14,6 +14,7 @@
 #include "retro-device-type.h"
 #include "retro-gtk-vala.h"
 #include "retro-joypad-id.h"
+#include "retro-lightgun-id.h"
 #include "retro-mouse-id.h"
 
 #undef __RETRO_GTK_INSIDE__
diff --git a/retro-gtk/retro-lightgun-id.h b/retro-gtk/retro-lightgun-id.h
new file mode 100644
index 0000000..b561c8e
--- /dev/null
+++ b/retro-gtk/retro-lightgun-id.h
@@ -0,0 +1,39 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_LIGHTGUN_ID_H
+#define RETRO_LIGHTGUN_ID_H
+
+#if !defined(__RETRO_GTK_INSIDE__) && !defined(RETRO_GTK_COMPILATION)
+# error "Only <retro-gtk.h> can be included directly."
+#endif
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * RetroLightgunId:
+ * @RETRO_LIGHTGUN_ID_X: The X axis of a lightgun.
+ * @RETRO_LIGHTGUN_ID_Y: The Y axis of a lightgun.
+ * @RETRO_LIGHTGUN_ID_TRIGGER: The trigger of a lightgun.
+ * @RETRO_LIGHTGUN_ID_CURSOR: The cursor of a lightgun.
+ * @RETRO_LIGHTGUN_ID_TURBO: The turbo button of a lightgun.
+ * @RETRO_LIGHTGUN_ID_PAUSE: The pause button of a lightgun.
+ * @RETRO_LIGHTGUN_ID_START: The start button of a lightgun.
+ *
+ * Represents the inputs for the Libretro lightgun.
+ */
+typedef enum
+{
+  RETRO_LIGHTGUN_ID_X,
+  RETRO_LIGHTGUN_ID_Y,
+  RETRO_LIGHTGUN_ID_TRIGGER,
+  RETRO_LIGHTGUN_ID_CURSOR,
+  RETRO_LIGHTGUN_ID_TURBO,
+  RETRO_LIGHTGUN_ID_PAUSE,
+  RETRO_LIGHTGUN_ID_START,
+} RetroLightgunId;
+
+G_END_DECLS
+
+#endif /* RETRO_LIGHTGUN_ID_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]