[retro-gtk] retro-gobject: Move retro-environment-input.h into retro-environment.c
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] retro-gobject: Move retro-environment-input.h into retro-environment.c
- Date: Sat, 27 Aug 2016 20:31:31 +0000 (UTC)
commit 9a86bcbbd44c5556975a3509dfdf29420a68542e
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Aug 1 13:38:25 2016 +0200
retro-gobject: Move retro-environment-input.h into retro-environment.c
This helps making the code cleaner.
https://bugzilla.gnome.org/show_bug.cgi?id=769880
retro-gobject/Makefile.am | 1 -
retro-gobject/retro-environment-input.h | 37 -------------------------------
retro-gobject/retro-environment.c | 31 +++++++++++++++++++++++++-
3 files changed, 30 insertions(+), 39 deletions(-)
---
diff --git a/retro-gobject/Makefile.am b/retro-gobject/Makefile.am
index 8041864..5818c66 100644
--- a/retro-gobject/Makefile.am
+++ b/retro-gobject/Makefile.am
@@ -67,7 +67,6 @@ libretro_gobject_la_SOURCES = \
retro-environment.c \
retro-environment-interfaces.c \
libretro-environment.h \
- retro-environment-input.h \
retro-environment-interfaces.h \
retro-environment-variables.h \
$(NULL)
diff --git a/retro-gobject/retro-environment.c b/retro-gobject/retro-environment.c
index 32e718e..62cc54a 100644
--- a/retro-gobject/retro-environment.c
+++ b/retro-gobject/retro-environment.c
@@ -3,7 +3,6 @@
#include "retro-gobject-internal.h"
#include "libretro-environment.h"
-#include "retro-environment-input.h"
#include "retro-environment-variables.h"
#include "retro-environment-interfaces.h"
@@ -24,6 +23,12 @@ static gboolean get_content_directory (RetroCore *self, const gchar* *content_di
return TRUE;
}
+static gboolean get_input_device_capabilities (RetroInput *self, guint64 *capabilities) {
+ *capabilities = retro_input_get_device_capabilities (self);
+
+ return TRUE;
+}
+
static gboolean get_libretro_path (RetroCore *self, const gchar* *libretro_directory) {
*(libretro_directory) = retro_core_get_libretro_path (self);
@@ -66,6 +71,14 @@ static gboolean set_frame_time_callback (RetroCore *self, RetroCoreFrameTimeCall
return TRUE;
}
+static gboolean set_input_descriptors (RetroInput *self, RetroInputDescriptor *descriptors) {
+ int length;
+ for (length = 0 ; descriptors[length].description ; length++);
+ retro_input_set_descriptors (self, descriptors, length);
+
+ return TRUE;
+}
+
static gboolean set_keyboard_callback (RetroCore *self, RetroKeyboardCallback *callback) {
retro_core_set_keyboard_callback (self, callback);
@@ -195,6 +208,22 @@ static gboolean environment_video_command (RetroVideo *self, unsigned cmd, gpoin
}
}
+static gboolean environment_input_command (RetroInput *self, unsigned cmd, gpointer data) {
+ if (!self)
+ return FALSE;
+
+ switch (cmd) {
+ case RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES:
+ return get_input_device_capabilities (self, (guint64 *) data);
+
+ case RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS:
+ return set_input_descriptors (self, (RetroInputDescriptor *) data);
+
+ default:
+ return FALSE;
+ }
+}
+
gpointer retro_core_get_module_environment_interface (RetroCore *self) {
gboolean real_cb (unsigned cmd, gpointer data) {
RetroCore *cb_data = retro_core_get_cb_data ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]