[retro-gtk/wip/aplazas/c-port: 6/36] Port AnalogId to C
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/c-port: 6/36] Port AnalogId to C
- Date: Thu, 5 Oct 2017 07:35:17 +0000 (UTC)
commit 6e420cb5961d81dc40a96dfb7cf70294c0eb5e47
Author: Adrien Plazas <kekun plazas laposte net>
Date: Tue Sep 5 14:40:23 2017 +0200
Port AnalogId to C
retro-gtk/Makefile.am | 1 +
retro-gtk/input/device.vala | 8 --------
retro-gtk/retro-analog-id.h | 29 +++++++++++++++++++++++++++++
retro-gtk/retro-gtk.h | 1 +
4 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index cbbe95f..934d0ec 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -30,6 +30,7 @@ dist_vapi_DATA = retro-gtk-0.12.deps
BUILT_SOURCES = retro-gtk-internal.h
retro_gtk_public_h_sources = \
+ retro-analog-id.h \
retro-analog-index.h \
retro-device-type.h \
retro-gtk.h \
diff --git a/retro-gtk/input/device.vala b/retro-gtk/input/device.vala
index c94dac8..bc98db7 100644
--- a/retro-gtk/input/device.vala
+++ b/retro-gtk/input/device.vala
@@ -3,14 +3,6 @@
namespace Retro {
/**
- * The axes of an analog stick.
- */
-public enum AnalogId {
- X,
- Y
-}
-
-/**
* The input types of a mouse.
*/
private enum MouseId {
diff --git a/retro-gtk/retro-analog-id.h b/retro-gtk/retro-analog-id.h
new file mode 100644
index 0000000..db1c490
--- /dev/null
+++ b/retro-gtk/retro-analog-id.h
@@ -0,0 +1,29 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_ANALOG_ID_H
+#define RETRO_ANALOG_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
+
+/**
+ * RetroAnalogId:
+ * @RETRO_ANALOG_ID_X: The X axis of an analog stick.
+ * @RETRO_ANALOG_ID_Y: The Y axis of an analog stick.
+ *
+ * Represents the axes of the analog sticks for the Libretro gamepad.
+ */
+typedef enum
+{
+ RETRO_ANALOG_ID_X,
+ RETRO_ANALOG_ID_Y,
+} RetroAnalogId;
+
+G_END_DECLS
+
+#endif /* RETRO_ANALOG_ID_H */
diff --git a/retro-gtk/retro-gtk.h b/retro-gtk/retro-gtk.h
index 970f1f2..be8b24f 100644
--- a/retro-gtk/retro-gtk.h
+++ b/retro-gtk/retro-gtk.h
@@ -9,6 +9,7 @@
#error retro-gtk is unstable API. You must define RETRO_GTK_USE_UNSTABLE_API before including retro-gtk.h
#endif
+#include "retro-analog-id.h"
#include "retro-analog-index.h"
#include "retro-device-type.h"
#include "retro-gtk-vala.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]