[retro-gtk/wip/aplazas/0.13: 12/26] Port MouseId to C



commit d23dc2377366c5f8c26ad7baf79d44c20f72e14f
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Sep 5 14:52:10 2017 +0200

    Port MouseId to C

 retro-gtk/Makefile.am              |    1 +
 retro-gtk/input/device.vala        |   15 -------------
 retro-gtk/retro-core-view-extern.c |    1 +
 retro-gtk/retro-gtk.h              |    1 +
 retro-gtk/retro-mouse-id.h         |   39 ++++++++++++++++++++++++++++++++++++
 5 files changed, 42 insertions(+), 15 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index a795936..f15cdb1 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -112,6 +112,7 @@ retro_gtkinclude_HEADERS = \
        retro-gtk.h \
        retro-gtk-vala.h \
        retro-joypad-id.h \
+       retro-mouse-id.h \
        $(NULL)
 
 # Add unstable API guard
diff --git a/retro-gtk/input/device.vala b/retro-gtk/input/device.vala
index bc98db7..a8165eb 100644
--- a/retro-gtk/input/device.vala
+++ b/retro-gtk/input/device.vala
@@ -3,21 +3,6 @@
 namespace Retro {
 
 /**
- * The input types of a mouse.
- */
-private enum MouseId {
-       X,
-       Y,
-       LEFT,
-       RIGHT,
-       WHEELUP,
-       WHEELDOWN,
-       MIDDLE,
-       HORIZ_WHEELUP,
-       HORIZ_WHEELDOWN,
-}
-
-/**
  * The input types of a lightgun.
  */
 private enum LightgunId {
diff --git a/retro-gtk/retro-core-view-extern.c b/retro-gtk/retro-core-view-extern.c
index 49a2248..5d5074d 100644
--- a/retro-gtk/retro-core-view-extern.c
+++ b/retro-gtk/retro-core-view-extern.c
@@ -4,6 +4,7 @@
 #include "retro-gtk-internal.h"
 #include "retro-core-view-input-device.h"
 #include "retro-joypad-id.h"
+#include "retro-mouse-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 a1de0f7..c3c4db7 100644
--- a/retro-gtk/retro-gtk.h
+++ b/retro-gtk/retro-gtk.h
@@ -8,5 +8,6 @@
 #include "retro-device-type.h"
 #include "retro-gtk-vala.h"
 #include "retro-joypad-id.h"
+#include "retro-mouse-id.h"
 
 #endif
diff --git a/retro-gtk/retro-mouse-id.h b/retro-gtk/retro-mouse-id.h
new file mode 100644
index 0000000..a78b582
--- /dev/null
+++ b/retro-gtk/retro-mouse-id.h
@@ -0,0 +1,39 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_MOUSE_ID_H
+#define RETRO_MOUSE_ID_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * RetroMouseId:
+ * @RETRO_MOUSE_ID_X: The X axis of a mouse.
+ * @RETRO_MOUSE_ID_Y: The Y axis of a mouse.
+ * @RETRO_MOUSE_ID_LEFT: The left button of a mouse.
+ * @RETRO_MOUSE_ID_RIGHT: The right button of a mouse.
+ * @RETRO_MOUSE_ID_WHEELUP: The up direction of a mouse wheel.
+ * @RETRO_MOUSE_ID_WHEELDOWN: The down direction of a mouse wheel.
+ * @RETRO_MOUSE_ID_MIDDLE: The middle button of a mouse.
+ * @RETRO_MOUSE_ID_HORIZ_WHEELUP: The horizontal up direction of a mouse wheel.
+ * @RETRO_MOUSE_ID_HORIZ_WHEELDOWN: The horizontal down direction of a mouse wheel.
+ *
+ * Represents the inputs for the Libretro mouse.
+ */
+typedef enum
+{
+  RETRO_MOUSE_ID_X,
+  RETRO_MOUSE_ID_Y,
+  RETRO_MOUSE_ID_LEFT,
+  RETRO_MOUSE_ID_RIGHT,
+  RETRO_MOUSE_ID_WHEELUP,
+  RETRO_MOUSE_ID_WHEELDOWN,
+  RETRO_MOUSE_ID_MIDDLE,
+  RETRO_MOUSE_ID_HORIZ_WHEELUP,
+  RETRO_MOUSE_ID_HORIZ_WHEELDOWN,
+} RetroMouseId;
+
+G_END_DECLS
+
+#endif /* RETRO_MOUSE_ID_H */


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