[gnome-games/wip/abhinavsingh/gamepad-config: 18/25] gamepad: Add GamepadMapping vapi



commit 9e1435604c78816cbffcbeeadc91a2bd16c1a086
Author: theawless <theawless gmail com>
Date:   Wed Jun 21 01:57:16 2017 +0530

    gamepad: Add GamepadMapping vapi
    
    This will be used by set_mapping() in Gamepad.

 src/Makefile.am                  |    2 ++
 src/gamepad/gamepad-mapping.vapi |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 672dc76..a81093a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,6 +28,7 @@ EXTRA_DIST = \
        gamepad/gamepad.vapi \
        gamepad/gamepad-dpad.vapi \
        gamepad/gamepad-input.vapi \
+       gamepad/gamepad-mapping.vapi \
        gamepad/gamepad-monitor.vapi \
        gamepad/raw-gamepad.vapi \
        $(NULL)
@@ -203,6 +204,7 @@ gnome_games_VALAFLAGS = \
        --pkg gamepad \
        --pkg gamepad-dpad \
        --pkg gamepad-input \
+       --pkg gamepad-mapping \
        --pkg gamepad-monitor \
        --pkg raw-gamepad \
        --gresources $(gresource_file) \
diff --git a/src/gamepad/gamepad-mapping.vapi b/src/gamepad/gamepad-mapping.vapi
new file mode 100644
index 0000000..4bcf883
--- /dev/null
+++ b/src/gamepad/gamepad-mapping.vapi
@@ -0,0 +1,9 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+[CCode (cheader_filename = "gamepad-mapping.h")]
+private class Games.GamepadMapping : GLib.Object {
+       public GamepadMapping.from_sdl_string (string? mapping_string) throws GLib.Error;
+       public void get_dpad_mapping (int dpad_index, int dpad_axis, int dpad_value, ref GamepadInput 
destination);
+       public void get_axis_mapping (int axis_number, ref GamepadInput destination);
+       public void get_button_mapping (int button_number, ref GamepadInput destination);
+}


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