[retro-gtk/c-port: 11/42] Port AnalogIndex to C



commit 53a2b4fb609f9db2b6ac4fe0434a02c57ce0e1a4
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Sep 5 14:37:31 2017 +0200

    Port AnalogIndex to C

 retro-gtk/Makefile.am          |    1 +
 retro-gtk/input/device.vala    |    8 --------
 retro-gtk/retro-analog-index.h |   29 +++++++++++++++++++++++++++++
 retro-gtk/retro-gtk.h          |    1 +
 4 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index 6b3995b..735699b 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -30,6 +30,7 @@ dist_vapi_DATA = retro-gtk-0.12.deps
 BUILT_SOURCES = retro-gtk-internal.h
 
 retro_gtk_public_h_sources = \
+       retro-analog-index.h \
        retro-device-type.h \
        retro-gtk.h \
        retro-gtk-vala.h \
diff --git a/retro-gtk/input/device.vala b/retro-gtk/input/device.vala
index 180630b..c94dac8 100644
--- a/retro-gtk/input/device.vala
+++ b/retro-gtk/input/device.vala
@@ -3,14 +3,6 @@
 namespace Retro {
 
 /**
- * The analog sticks of an analog joypad.
- */
-public enum AnalogIndex {
-       LEFT,
-       RIGHT
-}
-
-/**
  * The axes of an analog stick.
  */
 public enum AnalogId {
diff --git a/retro-gtk/retro-analog-index.h b/retro-gtk/retro-analog-index.h
new file mode 100644
index 0000000..00d6c65
--- /dev/null
+++ b/retro-gtk/retro-analog-index.h
@@ -0,0 +1,29 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_ANALOG_INDEX_H
+#define RETRO_ANALOG_INDEX_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
+
+/**
+ * RetroAnalogIndex:
+ * @RETRO_ANALOG_INDEX_LEFT: The left analog stick.
+ * @RETRO_ANALOG_INDEX_RIGHT: The right analog stick.
+ *
+ * Represents the analog sticks for the Libretro gamepad.
+ */
+typedef enum
+{
+  RETRO_ANALOG_INDEX_LEFT,
+  RETRO_ANALOG_INDEX_RIGHT,
+} RetroAnalogIndex;
+
+G_END_DECLS
+
+#endif /* RETRO_ANALOG_INDEX_H */
diff --git a/retro-gtk/retro-gtk.h b/retro-gtk/retro-gtk.h
index 2be93f4..970f1f2 100644
--- a/retro-gtk/retro-gtk.h
+++ b/retro-gtk/retro-gtk.h
@@ -9,6 +9,7 @@
 #error    retro-gtk is unstable API. You must define RETRO_GTK_USE_UNSTABLE_API before including retro-gtk.h
 #endif
 
+#include "retro-analog-index.h"
 #include "retro-device-type.h"
 #include "retro-gtk-vala.h"
 #include "retro-joypad-id.h"


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