[gnome-games: 12/20] gamepad: Port GamepadMappingError to C
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games: 12/20] gamepad: Port GamepadMappingError to C
- Date: Wed, 3 May 2017 08:21:48 +0000 (UTC)
commit 19b861da5d0080609c6e26655f4ce82ed53eefa0
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Apr 28 12:57:58 2017 +0200
gamepad: Port GamepadMappingError to C
This will help to port part of the gamepad handling to C to avoid using
the Vala preprocessor.
https://bugzilla.gnome.org/show_bug.cgi?id=781572
src/Makefile.am | 4 +++-
src/gamepad/gamepad-mapping-error.c | 9 +++++++++
src/gamepad/gamepad-mapping-error.h | 20 ++++++++++++++++++++
...pping-error.vala => gamepad-mapping-error.vapi} | 1 +
4 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 59e9101..72058e2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,6 +24,7 @@ BUILT_SOURCES = \
EXTRA_DIST = \
$(gresource_file) \
gamepad/gamepad-input-type.vapi \
+ gamepad/gamepad-mapping-error.vapi \
gamepad/linux/libevdev.vapi \
gamepad/linux/linux-raw-gamepad.vapi \
gamepad/linux/linux-raw-gamepad-monitor.vapi \
@@ -79,7 +80,7 @@ gnome_games_SOURCES = \
gamepad/gamepad-input-type.c \
gamepad/gamepad-mapped-event.vala \
gamepad/gamepad-mapping.vala \
- gamepad/gamepad-mapping-error.vala \
+ gamepad/gamepad-mapping-error.c \
gamepad/gamepad-mappings-manager.vala \
gamepad/gamepad-monitor.vala \
gamepad/raw-gamepad.c \
@@ -186,6 +187,7 @@ gnome_games_VALAFLAGS = \
--pkg linux \
--pkg posix \
--pkg gamepad-input-type \
+ --pkg gamepad-mapping-error \
--pkg raw-gamepad \
--pkg raw-gamepad-monitor \
--pkg standard-gamepad-axis \
diff --git a/src/gamepad/gamepad-mapping-error.c b/src/gamepad/gamepad-mapping-error.c
new file mode 100644
index 0000000..8c034b8
--- /dev/null
+++ b/src/gamepad/gamepad-mapping-error.c
@@ -0,0 +1,9 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+#include "gamepad-mapping-error.h"
+
+GQuark
+games_gamepad_mapping_error_quark (void)
+{
+ return g_quark_from_static_string ("games-gamepad-mapping-error-quark");
+}
diff --git a/src/gamepad/gamepad-mapping-error.h b/src/gamepad/gamepad-mapping-error.h
new file mode 100644
index 0000000..b345620
--- /dev/null
+++ b/src/gamepad/gamepad-mapping-error.h
@@ -0,0 +1,20 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+#ifndef GAMES_GAMEPAD_MAPPING_ERROR_H
+#define GAMES_GAMEPAD_MAPPING_ERROR_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define GAMES_GAMEPAD_MAPPING_ERROR games_gamepad_mapping_error_quark ()
+
+typedef enum {
+ GAMES_GAMEPAD_MAPPING_ERROR_NOT_A_MAPPING,
+} GamesGamepadMappingError;
+
+GQuark games_gamepad_mapping_error_quark (void);
+
+G_END_DECLS
+
+#endif /* GAMES_GAMEPAD_MAPPING_ERROR_H */
diff --git a/src/gamepad/gamepad-mapping-error.vala b/src/gamepad/gamepad-mapping-error.vapi
similarity index 69%
rename from src/gamepad/gamepad-mapping-error.vala
rename to src/gamepad/gamepad-mapping-error.vapi
index 7ad9f46..5427ccf 100644
--- a/src/gamepad/gamepad-mapping-error.vala
+++ b/src/gamepad/gamepad-mapping-error.vapi
@@ -1,5 +1,6 @@
// This file is part of GNOME Games. License: GPL-3.0+.
+[CCode (cheader_filename = "gamepad-mapping-error.h")]
private errordomain Games.GamepadMappingError {
NOT_A_MAPPING,
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]