[retro-gtk/c-port: 13/42] Port MouseId to C
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/c-port: 13/42] Port MouseId to C
- Date: Wed, 4 Oct 2017 05:23:29 +0000 (UTC)
commit 55b2ce7548d5ae4ad2b17b4f380bacd5c7da77e7
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 | 43 ++++++++++++++++++++++++++++++++++++
5 files changed, 46 insertions(+), 15 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index b508c97..9fed61c 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-mouse-id.h \
$(NULL)
retro_gtk_private_h_sources = \
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 8377168..a7c6843 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 be8b24f..82b5ba9 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-mouse-id.h"
#undef __RETRO_GTK_INSIDE__
diff --git a/retro-gtk/retro-mouse-id.h b/retro-gtk/retro-mouse-id.h
new file mode 100644
index 0000000..d30b07c
--- /dev/null
+++ b/retro-gtk/retro-mouse-id.h
@@ -0,0 +1,43 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_MOUSE_ID_H
+#define RETRO_MOUSE_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
+
+/**
+ * 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]