[retro-gtk/wip/aplazas/0.13: 13/25] Port PointerId to C



commit 34cf10db7a2b76a157a6a42497022980b1eefc8e
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Sep 5 14:59:50 2017 +0200

    Port PointerId to C

 retro-gtk/Makefile.am              |    1 +
 retro-gtk/input/device.vala        |    9 ---------
 retro-gtk/retro-core-view-extern.c |    1 +
 retro-gtk/retro-gtk.h              |    1 +
 retro-gtk/retro-pointer-id.h       |   27 +++++++++++++++++++++++++++
 5 files changed, 30 insertions(+), 9 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index bf5649c..f5e8f7e 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -114,6 +114,7 @@ retro_gtkinclude_HEADERS = \
        retro-joypad-id.h \
        retro-lightgun-id.h \
        retro-mouse-id.h \
+       retro-pointer-id.h \
        $(NULL)
 
 # Add unstable API guard
diff --git a/retro-gtk/input/device.vala b/retro-gtk/input/device.vala
index 04f6f3a..9bcf1bf 100644
--- a/retro-gtk/input/device.vala
+++ b/retro-gtk/input/device.vala
@@ -3,15 +3,6 @@
 namespace Retro {
 
 /**
- * The input types of a pointer.
- */
-private enum PointerId {
-       X,
-       Y,
-       PRESSED
-}
-
-/**
  * Describes an input source.
  */
 public struct InputDescriptor {
diff --git a/retro-gtk/retro-core-view-extern.c b/retro-gtk/retro-core-view-extern.c
index 5d5074d..ff16940 100644
--- a/retro-gtk/retro-core-view-extern.c
+++ b/retro-gtk/retro-core-view-extern.c
@@ -5,6 +5,7 @@
 #include "retro-core-view-input-device.h"
 #include "retro-joypad-id.h"
 #include "retro-mouse-id.h"
+#include "retro-pointer-id.h"
 
 static guint16 DEFAULT_KEY_JOYPAD_BUTTON_MAPPING[RETRO_JOYPAD_ID_COUNT] = {
   KEY_S,
diff --git a/retro-gtk/retro-gtk.h b/retro-gtk/retro-gtk.h
index fbec775..1f44cb2 100644
--- a/retro-gtk/retro-gtk.h
+++ b/retro-gtk/retro-gtk.h
@@ -10,5 +10,6 @@
 #include "retro-joypad-id.h"
 #include "retro-lightgun-id.h"
 #include "retro-mouse-id.h"
+#include "retro-pointer-id.h"
 
 #endif
diff --git a/retro-gtk/retro-pointer-id.h b/retro-gtk/retro-pointer-id.h
new file mode 100644
index 0000000..b039ec3
--- /dev/null
+++ b/retro-gtk/retro-pointer-id.h
@@ -0,0 +1,27 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_POINTER_ID_H
+#define RETRO_POINTER_ID_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * RetroPointerId:
+ * @RETRO_POINTER_ID_X: The X axis of a pointer.
+ * @RETRO_POINTER_ID_Y: The Y axis of a pointer.
+ * @RETRO_POINTER_ID_PRESSED: The pression of a pointer.
+ *
+ * Represents the inputs for the Libretro pointer.
+ */
+typedef enum
+{
+  RETRO_POINTER_ID_X,
+  RETRO_POINTER_ID_Y,
+  RETRO_POINTER_ID_PRESSED,
+} RetroPointerId;
+
+G_END_DECLS
+
+#endif /* RETRO_POINTER_ID_H */


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