[retro-gtk] retro-keyboard-key: Split into RetroKeyboard



commit beb81b4c78b96fd198391a73ac75b8cbda98f4dd
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Jan 8 00:04:14 2020 +0500

    retro-keyboard-key: Split into RetroKeyboard
    
    Move key conversion functions into retro-keyboard.[ch]. This will allow to
    avoid GDK dependency for runner process later, by only having it depend on
    retro-keyboard-key.h, without the functions.

 retro-gtk/meson.build                                |  2 +-
 retro-gtk/retro-core-view.c                          |  1 +
 retro-gtk/retro-core.c                               |  2 +-
 retro-gtk/retro-keyboard-key.h                       |  7 +------
 retro-gtk/{retro-keyboard-key.c => retro-keyboard.c} |  2 +-
 retro-gtk/retro-keyboard.h                           | 19 +++++++++++++++++++
 6 files changed, 24 insertions(+), 9 deletions(-)
---
diff --git a/retro-gtk/meson.build b/retro-gtk/meson.build
index 28bab3a..7502e3a 100644
--- a/retro-gtk/meson.build
+++ b/retro-gtk/meson.build
@@ -22,7 +22,7 @@ retro_gtk_sources = [
   'retro-glsl-filter.c',
   'retro-input.c',
   'retro-input-descriptor.c',
-  'retro-keyboard-key.c',
+  'retro-keyboard.c',
   'retro-key-joypad-mapping.c',
   'retro-log.c',
   'retro-main-loop.c',
diff --git a/retro-gtk/retro-core-view.c b/retro-gtk/retro-core-view.c
index 682c9f9..e94eca7 100644
--- a/retro-gtk/retro-core-view.c
+++ b/retro-gtk/retro-core-view.c
@@ -7,6 +7,7 @@
 #include "retro-controller-codes.h"
 #include "retro-core-view-controller.h"
 #include "retro-input-private.h"
+#include "retro-keyboard.h"
 #include "retro-pa-player.h"
 
 struct _RetroCoreView
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index d2e7ba7..b89d290 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -4,7 +4,7 @@
 
 #include <string.h>
 #include "retro-controller-iterator-private.h"
-#include "retro-keyboard-key.h"
+#include "retro-keyboard.h"
 #include "retro-option-iterator-private.h"
 #include "retro-pixdata.h"
 
diff --git a/retro-gtk/retro-keyboard-key.h b/retro-gtk/retro-keyboard-key.h
index 09df16a..14dcb08 100644
--- a/retro-gtk/retro-keyboard-key.h
+++ b/retro-gtk/retro-keyboard-key.h
@@ -6,7 +6,7 @@
 # error "Only <retro-gtk.h> can be included directly."
 #endif
 
-#include <gdk/gdk.h>
+#include <glib.h>
 
 G_BEGIN_DECLS
 
@@ -166,9 +166,4 @@ typedef enum {
   RETRO_KEYBOARD_MODIFIER_KEY_SCROLLOCK = 0x40
 } RetroKeyboardModifierKey;
 
-RetroKeyboardModifierKey retro_keyboard_modifier_key_converter (guint keyval,
-                                                                GdkModifierType modifiers);
-RetroKeyboardKey retro_keyboard_key_converter (guint keyval);
-guint retro_keyboard_key_to_val_converter (RetroKeyboardKey key);
-
 G_END_DECLS
diff --git a/retro-gtk/retro-keyboard-key.c b/retro-gtk/retro-keyboard.c
similarity index 99%
rename from retro-gtk/retro-keyboard-key.c
rename to retro-gtk/retro-keyboard.c
index d78c936..7f6679b 100644
--- a/retro-gtk/retro-keyboard-key.c
+++ b/retro-gtk/retro-keyboard.c
@@ -1,6 +1,6 @@
 // This file is part of retro-gtk. License: GPL-3.0+.
 
-#include "retro-keyboard-key.h"
+#include "retro-keyboard.h"
 
 RetroKeyboardModifierKey
 retro_keyboard_modifier_key_converter (guint           keyval,
diff --git a/retro-gtk/retro-keyboard.h b/retro-gtk/retro-keyboard.h
new file mode 100644
index 0000000..c23ec44
--- /dev/null
+++ b/retro-gtk/retro-keyboard.h
@@ -0,0 +1,19 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#pragma once
+
+#if !defined(__RETRO_GTK_INSIDE__) && !defined(RETRO_GTK_COMPILATION)
+# error "Only <retro-gtk.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
+#include "retro-keyboard-key.h"
+
+G_BEGIN_DECLS
+
+RetroKeyboardModifierKey retro_keyboard_modifier_key_converter (guint keyval,
+                                                                GdkModifierType modifiers);
+RetroKeyboardKey retro_keyboard_key_converter (guint keyval);
+guint retro_keyboard_key_to_val_converter (RetroKeyboardKey key);
+
+G_END_DECLS


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