[retro-gtk/wip/aplazas/c-port: 7/36] Port MouseId to C
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/c-port: 7/36] Port MouseId to C
- Date: Thu, 5 Oct 2017 07:35:22 +0000 (UTC)
commit 90b6bc8b0aa03dd09010111c146d5bb42cfec754
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 934d0ec..dc6ca4d 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]