[gnome-games/wip/abhinavsingh/gamepad-config] gamepad: Make 'raw_gamepad' public in Gamepad



commit 3df52d4b7b37271c01bbd5824973fb403a4eb835
Author: theawless <theawless gmail com>
Date:   Fri May 12 12:58:45 2017 +0530

    gamepad: Make 'raw_gamepad' public in Gamepad
    
    This will be used by GamepadMapper to connect to raw signals and
    generate mappings for gamepads.

 src/gamepad/gamepad.c    |    6 ++++++
 src/gamepad/gamepad.h    |    1 +
 src/gamepad/gamepad.vapi |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gamepad/gamepad.c b/src/gamepad/gamepad.c
index 6183acb..00b6222 100644
--- a/src/gamepad/gamepad.c
+++ b/src/gamepad/gamepad.c
@@ -201,6 +201,12 @@ on_unplugged (GamesRawGamepad *sender,
 
 /* Public */
 
+GamesRawGamepad *
+games_gamepad_get_raw_gamepad (GamesGamepad *self)
+{
+  return self->raw_gamepad;
+}
+
 // FIXME
 GamesGamepad *
 games_gamepad_new (GamesRawGamepad  *raw_gamepad,
diff --git a/src/gamepad/gamepad.h b/src/gamepad/gamepad.h
index cb8c1a0..051385c 100644
--- a/src/gamepad/gamepad.h
+++ b/src/gamepad/gamepad.h
@@ -12,6 +12,7 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (GamesGamepad, games_gamepad, GAMES, GAMEPAD, GObject)
 
+GamesRawGamepad *games_gamepad_get_raw_gamepad (GamesGamepad *self);
 GamesGamepad *games_gamepad_new (GamesRawGamepad  *raw_gamepad,
                                  GError          **error);
 
diff --git a/src/gamepad/gamepad.vapi b/src/gamepad/gamepad.vapi
index 42e7aa7..eb3caf1 100644
--- a/src/gamepad/gamepad.vapi
+++ b/src/gamepad/gamepad.vapi
@@ -5,5 +5,6 @@ private class Games.Gamepad : GLib.Object {
        public signal void button_event (StandardGamepadButton button, bool value);
        public signal void axis_event (StandardGamepadAxis axis, double value);
        public signal void unplugged ();
+       public RawGamepad raw_gamepad { get; }
        public Gamepad (RawGamepad raw_gamepad) throws GLib.Error;
 }


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