[retro-gtk/wip/aplazas/0.13: 8/14] Port PointerId to C



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

    Port PointerId to C

 retro-gtk/Makefile.am              |    3 +++
 retro-gtk/input/device.vala        |    9 ---------
 retro-gtk/retro-core-view-extern.c |    1 +
 retro-gtk/retro-pointer-id.h       |   27 +++++++++++++++++++++++++++
 4 files changed, 31 insertions(+), 9 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index 823a3ea..fe13c6f 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -113,6 +113,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
@@ -148,6 +149,7 @@ Retro_0_12_gir_SCANNERFLAGS = \
        --c-include=retro-joypad-id.h \
        --c-include=retro-lightgun-id.h \
        --c-include=retro-mouse-id.h \
+       --c-include=retro-pointer-id.h \
        --pkg-export=retro-gtk-0.12 \
        $(NULL)
 Retro_0_12_gir_CFLAGS = -DRETRO_GTK_USE_UNSTABLE_API $(retro_gtk_CFLAGS)
@@ -187,6 +189,7 @@ EXTRA_DIST = \
        retro-module.h \
        retro-lightgun-id.h \
        retro-mouse-id.h \
+       retro-pointer-id.h \
        retro-rotation.h \
        retro-system-av-info.h \
        retro-system-info.h \
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 ce877e7..0a4f7c4 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-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]