[gnome-games] gamepad: Add RawGamepadMonitor interface
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gamepad: Add RawGamepadMonitor interface
- Date: Mon, 18 Jul 2016 18:52:40 +0000 (UTC)
commit 6459adeec22ebdb2fa5e5f1d4a3539e40c40cc17
Author: Megh Parikh <meghprkh gmail com>
Date: Mon Jul 18 20:02:14 2016 +0530
gamepad: Add RawGamepadMonitor interface
This is the interface implemented by a driver that acts as a monitor to
the currently plugged in RawGamepads.
This is part of a series of commits to add gamepad support.
src/Makefile.am | 1 +
src/gamepad/raw-gamepad-monitor.vala | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 19fcfac..08ee53b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -55,6 +55,7 @@ gnome_games_SOURCES = \
\
gamepad/gamepad-callbacks.vala \
gamepad/raw-gamepad.vala \
+ gamepad/raw-gamepad-monitor.vala \
\
grilo/grilo-cover.vala \
grilo/grilo-media.vala \
diff --git a/src/gamepad/raw-gamepad-monitor.vala b/src/gamepad/raw-gamepad-monitor.vala
new file mode 100644
index 0000000..2aab186
--- /dev/null
+++ b/src/gamepad/raw-gamepad-monitor.vala
@@ -0,0 +1,18 @@
+// This file is part of GNOME Games. License: GPLv3
+
+/**
+ * This is one of the interfaces that needs to be implemented by the driver.
+ */
+private interface Games.RawGamepadMonitor : Object {
+ /**
+ * This signal should be emmited when a gamepad is plugged in.
+ * @param raw_gamepad The raw gamepad
+ */
+ public abstract signal void gamepad_plugged (RawGamepad raw_gamepad);
+
+ /**
+ * This function allows to iterate over all gamepads
+ * @param callback The callback
+ */
+ public abstract void foreach_gamepad (RawGamepadCallback callback);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]