From 4d44129b049c0254de519685014293080296fe74 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 9 Jul 2019 00:24:57 +0200 Subject: [PATCH 1/4] Prevent compiler warnings by commenting out unused code --- eekboard/eekboard-context-service.c | 22 +++++++++++----------- eekboard/key-emitter.c | 5 +++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index dce47228..d935a282 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -84,7 +84,7 @@ struct _EekboardContextServicePrivate { G_DEFINE_TYPE (EekboardContextService, eekboard_context_service, G_TYPE_OBJECT); -static Display *display = NULL; +/*static Display *display = NULL; */ static EekKeyboard * eekboard_context_service_real_create_keyboard (EekboardContextService *self, @@ -483,7 +483,7 @@ eekboard_context_service_init (EekboardContextService *self) } } -static gboolean on_repeat_timeout (EekboardContextService *context); +/*static gboolean on_repeat_timeout (EekboardContextService *context); static gboolean on_repeat_timeout (EekboardContextService *context) @@ -505,15 +505,15 @@ on_repeat_timeout (EekboardContextService *context) static gboolean on_repeat_timeout_init (EekboardContextService *context) { - /* FIXME: clear modifiers for further key repeat; better not - depend on modifier behavior is LATCH */ + // FIXME: clear modifiers for further key repeat; better not + // depend on modifier behavior is LATCH eek_keyboard_set_modifiers (context->priv->keyboard, 0); - /* reschedule repeat timeout only when "repeat" option is set */ - /* TODO: org.gnome.desktop.input-sources doesn't have repeat info. - * In addition, repeat is only useful when the keyboard is not in text - * input mode */ - /* + // reschedule repeat timeout only when "repeat" option is set + // TODO: org.gnome.desktop.input-sources doesn't have repeat info. + // In addition, repeat is only useful when the keyboard is not in text + // input mode + if (g_settings_get_boolean (context->priv->settings, "repeat")) { guint delay; @@ -522,11 +522,11 @@ on_repeat_timeout_init (EekboardContextService *context) g_timeout_add (delay, (GSourceFunc)on_repeat_timeout, context); - } else */ + //} else context->priv->repeat_timeout_id = 0; return FALSE; -} +}*/ /** * eekboard_context_service_enable: diff --git a/eekboard/key-emitter.c b/eekboard/key-emitter.c index 344c2ed7..539c2331 100644 --- a/eekboard/key-emitter.c +++ b/eekboard/key-emitter.c @@ -78,11 +78,12 @@ replace_keycode (SeatEmitter *emitter, guint keycode, guint *keysym) { - GdkDisplay *display = gdk_display_get_default (); - //Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); +/* GdkDisplay *display = gdk_display_get_default (); + Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); guint old_keysym; int keysyms_per_keycode; KeySym *syms; +*/ return TRUE; // FIXME: no xkb allocated at the moment, pretending all is fine g_return_val_if_fail (emitter->xkb->min_key_code <= keycode && keycode <= emitter->xkb->max_key_code, From f79b5dadbb3389c3cb3a0f1b578d817faee3746d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 9 Jul 2019 00:41:25 +0200 Subject: [PATCH 2/4] Use a macro to declare a type with private data --- eek/eek-keyboard.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eek/eek-keyboard.c b/eek/eek-keyboard.c index cbfca496..d67a13da 100644 --- a/eek/eek-keyboard.c +++ b/eek/eek-keyboard.c @@ -55,8 +55,6 @@ enum { static guint signals[LAST_SIGNAL] = { 0, }; -G_DEFINE_TYPE (EekKeyboard, eek_keyboard, EEK_TYPE_CONTAINER); - #define EEK_KEYBOARD_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EEK_TYPE_KEYBOARD, EekKeyboardPrivate)) @@ -75,6 +73,8 @@ struct _EekKeyboardPrivate EekModifierType alt_gr_mask; }; +G_DEFINE_TYPE_WITH_PRIVATE (EekKeyboard, eek_keyboard, EEK_TYPE_CONTAINER); + G_DEFINE_BOXED_TYPE(EekModifierKey, eek_modifier_key, eek_modifier_key_copy, eek_modifier_key_free); @@ -390,9 +390,6 @@ eek_keyboard_class_init (EekKeyboardClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *pspec; - g_type_class_add_private (gobject_class, - sizeof (EekKeyboardPrivate)); - klass->create_section = eek_keyboard_real_create_section; /* signals */ From e2944ff4a7b998c43f051ccd3dba818940700d13 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 9 Jul 2019 00:46:03 +0200 Subject: [PATCH 3/4] Use a macro to declare a type with private data --- eekboard/eekboard-context-service.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index d935a282..121c9974 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -82,7 +82,7 @@ struct _EekboardContextServicePrivate { GSettings *settings; }; -G_DEFINE_TYPE (EekboardContextService, eekboard_context_service, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (EekboardContextService, eekboard_context_service, G_TYPE_OBJECT); /*static Display *display = NULL; */ @@ -356,9 +356,6 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *pspec; - g_type_class_add_private (gobject_class, - sizeof (EekboardContextServicePrivate)); - klass->create_keyboard = eekboard_context_service_real_create_keyboard; klass->show_keyboard = eekboard_context_service_real_show_keyboard; klass->hide_keyboard = eekboard_context_service_real_hide_keyboard; From 83b36d07d06b36ae3c65645157f15319925fafae Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 9 Jul 2019 15:28:02 +0200 Subject: [PATCH 4/4] Add note about unused code --- eekboard/eekboard-context-service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index 121c9974..9688012f 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -480,6 +480,7 @@ eekboard_context_service_init (EekboardContextService *self) } } +/* FIXME These functions should either be implemented or removed. */ /*static gboolean on_repeat_timeout (EekboardContextService *context); static gboolean