diff --git a/docs/reference/eekboard/eekboard-docs.sgml b/docs/reference/eekboard/eekboard-docs.sgml index a03be16b..cf5dbfeb 100644 --- a/docs/reference/eekboard/eekboard-docs.sgml +++ b/docs/reference/eekboard/eekboard-docs.sgml @@ -35,10 +35,15 @@ API Manual - D-Bus client interface to eekboard-server - + Client interface to eekboard-server + + + Server interface to implement custom eekboard-server + + + Object Hierarchy diff --git a/docs/reference/eekboard/eekboard-sections.txt b/docs/reference/eekboard/eekboard-sections.txt index 26464ca0..6dfa42e1 100644 --- a/docs/reference/eekboard/eekboard-sections.txt +++ b/docs/reference/eekboard/eekboard-sections.txt @@ -1,22 +1,41 @@
-eekboard-eekboard -EekboardEekboard -EekboardEekboard -EekboardEekboardClass -EekboardEekboardPrivate -eekboard_eekboard_new -eekboard_eekboard_create_context -eekboard_eekboard_push_context -eekboard_eekboard_pop_context -eekboard_eekboard_destroy_context +eekboard-client +EekboardClient +EEKBOARD_TYPE_CLIENT +EEKBOARD_CLIENT +EEKBOARD_CLIENT_CLASS +EEKBOARD_CLIENT_GET_CLASS +EekboardClient +EekboardClientClass +eekboard_client_new +eekboard_client_create_context +eekboard_client_push_context +eekboard_client_pop_context +eekboard_client_destroy_context +EekboardClientPrivate -EEKBOARD_EEKBOARD EEKBOARD_IS_EEKBOARD -EEKBOARD_TYPE_EEKBOARD -eekboard_eekboard_get_type -EEKBOARD_EEKBOARD_CLASS +eekboard_client_get_type EEKBOARD_IS_EEKBOARD_CLASS -EEKBOARD_EEKBOARD_GET_CLASS +
+ +
+eekboard-service +EekboardService +EEKBOARD_SERVICE_PATH +EEKBOARD_SERVICE_INTERFACE +EekboardService +EekboardServiceClass +eekboard_service_new +EekboardServicePrivate + +EEKBOARD_SERVICE +EEKBOARD_IS_SERVICE +EEKBOARD_TYPE_SERVICE +eekboard_service_get_type +EEKBOARD_SERVICE_CLASS +EEKBOARD_IS_SERVICE_CLASS +EEKBOARD_SERVICE_GET_CLASS
@@ -24,17 +43,21 @@ EEKBOARD_EEKBOARD_GET_CLASS EekboardContext EekboardContext EekboardContextClass -EekboardContextPrivate eekboard_context_new +eekboard_context_add_keyboard +eekboard_context_remove_keyboard eekboard_context_set_keyboard eekboard_context_show_keyboard eekboard_context_hide_keyboard eekboard_context_set_group -eekboard_context_press_key -eekboard_context_release_key +eekboard_context_get_group +eekboard_context_press_keycode +eekboard_context_release_keycode eekboard_context_is_keyboard_visible eekboard_context_set_enabled eekboard_context_is_enabled +eekboard_context_set_fullscreen +EekboardContextPrivate EEKBOARD_CONTEXT EEKBOARD_IS_CONTEXT @@ -45,3 +68,37 @@ EEKBOARD_IS_CONTEXT_CLASS EEKBOARD_CONTEXT_GET_CLASS
+
+eekboard-context-service +EekboardContextService +EEKBOARD_CONTEXT_SERVICE_PATH +EEKBOARD_CONTEXT_SERVICE_INTERFACE +EekboardContextService +EekboardContextServiceClass +eekboard_context_service_enable +eekboard_context_service_disable +eekboard_context_service_get_keyboard +eekboard_context_service_get_fullscreen +eekboard_context_service_get_client_name +EekboardContextServicePrivate + +EEKBOARD_CONTEXT_SERVICE +EEKBOARD_IS_CONTEXT_SERVICE +EEKBOARD_TYPE_CONTEXT_SERVICE +eekboard_context_service_get_type +EEKBOARD_CONTEXT_SERVICE_CLASS +EEKBOARD_IS_CONTEXT_SERVICE_CLASS +EEKBOARD_CONTEXT_SERVICE_GET_CLASS +
+ +
+eekboard-xklutil +eekboard_xkl_config_rec_from_string +eekboard_xkl_config_rec_to_string +eekboard_xkl_list_models +eekboard_xkl_list_layouts +eekboard_xkl_list_option_groups +eekboard_xkl_list_layout_variants +eekboard_xkl_list_options +
+ diff --git a/docs/reference/eekboard/eekboard.types b/docs/reference/eekboard/eekboard.types index b2b7e970..12bd79e3 100644 --- a/docs/reference/eekboard/eekboard.types +++ b/docs/reference/eekboard/eekboard.types @@ -1,2 +1,4 @@ +eekboard_client_get_type eekboard_context_get_type -eekboard_eekboard_get_type +eekboard_context_service_get_type +eekboard_service_get_type diff --git a/eekboard/eekboard-client.c b/eekboard/eekboard-client.c index 234165c2..2595d79b 100644 --- a/eekboard/eekboard-client.c +++ b/eekboard/eekboard-client.c @@ -18,7 +18,7 @@ /** * SECTION:eekboard-client - * @short_description: D-Bus proxy of eekboard-server + * @short_description: client interface of eekboard service * * The #EekboardClient class provides a client side access to eekboard-server. */ @@ -126,7 +126,7 @@ eekboard_name_vanished_callback (GDBusConnection *connection, * @connection: a #GDBusConnection * @cancellable: a #GCancellable * - * Create a D-Bus proxy of eekboard-eekboard. + * Create a client. */ EekboardClient * eekboard_client_new (GDBusConnection *connection, diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index 8b57f3cd..fec9eac7 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -15,6 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +/** + * SECTION:eekboard-context-service + * @short_description: base server implementation of eekboard input + * context service + * + * The #EekboardService class provides a base server side + * implementation of eekboard input context service. + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ @@ -171,10 +181,9 @@ eekboard_context_service_real_create_keyboard (EekboardContextService *self, error = NULL; input = g_file_read (file, NULL, &error); - if (input == NULL) { - g_object_unref (file); + g_object_unref (file); + if (input == NULL) return NULL; - } layout = eek_xml_layout_new (G_INPUT_STREAM(input)); } keyboard = eek_keyboard_new (layout, CSW, CSH); diff --git a/eekboard/eekboard-context.c b/eekboard/eekboard-context.c index 11be2446..3f5832bd 100644 --- a/eekboard/eekboard-context.c +++ b/eekboard/eekboard-context.c @@ -18,7 +18,7 @@ /** * SECTION:eekboard-context - * @short_description: input context maintained by #EekboardServer. + * @short_description: client interface of eekboard input context service * * The #EekboardContext class provides a client access to remote input * context. @@ -91,10 +91,13 @@ eekboard_context_real_g_signal (GDBusProxy *self, g_return_if_fail (variant != NULL); serializable = eek_serializable_deserialize (variant); + g_variant_unref (variant); + g_return_if_fail (EEK_IS_SYMBOL(serializable)); g_signal_emit_by_name (context, "key-pressed", keyname, EEK_SYMBOL(serializable), modifiers); + g_object_unref (serializable); return; } diff --git a/eekboard/eekboard-service.c b/eekboard/eekboard-service.c index d891d093..22be1906 100644 --- a/eekboard/eekboard-service.c +++ b/eekboard/eekboard-service.c @@ -15,6 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +/** + * SECTION:eekboard-service + * @short_description: base server implementation of eekboard service + * + * The #EekboardService class provides a base server side + * implementation of eekboard service. + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ @@ -221,6 +230,12 @@ eekboard_service_class_init (EekboardServiceClass *klass) gobject_class->dispose = eekboard_service_dispose; gobject_class->finalize = eekboard_service_finalize; + /** + * EekboardService::destroyed: + * @service: an #EekboardService + * + * The ::destroyed signal is emitted when the service is vanished. + */ signals[DESTROYED] = g_signal_new (I_("destroyed"), G_TYPE_FROM_CLASS(gobject_class), @@ -348,7 +363,9 @@ handle_method_call (GDBusConnection *connection, object_path = g_strdup_printf (EEKBOARD_CONTEXT_SERVICE_PATH, context_id++); g_assert (klass->create_context); context = klass->create_context (service, client_name, object_path); - g_object_set_data (G_OBJECT(context), "owner", g_strdup (sender)); + g_object_set_data_full (G_OBJECT(context), + "owner", g_strdup (sender), + (GDestroyNotify)g_free); g_hash_table_insert (priv->context_hash, object_path, context); diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 6250e561..d65f4171 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -3,5 +3,5 @@ eek/eek-container.c eek/eek-key.c eek/eek-keyboard.c eek/eek-section.c -eekboard/eekboard-eekboard.c +eekboard/eekboard-client.c eekboard/eekboard-context.c diff --git a/src/client.c b/src/client.c index 2f9264db..9a2a4d83 100644 --- a/src/client.c +++ b/src/client.c @@ -239,6 +239,21 @@ client_dispose (GObject *object) G_OBJECT_CLASS (client_parent_class)->dispose (object); } +static void +client_finalize (GObject *object) +{ + Client *client = CLIENT(object); + + if (client->keyboards) { + GSList *next = client->keyboards->next; + /* client->keyboards is a ring; break it before free */ + client->keyboards->next = NULL; + g_slist_free (next); + } + + G_OBJECT_CLASS (client_parent_class)->finalize (object); +} + static void client_class_init (ClientClass *klass) { @@ -248,6 +263,7 @@ client_class_init (ClientClass *klass) gobject_class->set_property = client_set_property; gobject_class->get_property = client_get_property; gobject_class->dispose = client_dispose; + gobject_class->finalize = client_finalize; pspec = g_param_spec_object ("connection", "Connection", diff --git a/src/server-context-service.c b/src/server-context-service.c index 11d2d55a..a351e07d 100644 --- a/src/server-context-service.c +++ b/src/server-context-service.c @@ -292,8 +292,8 @@ update_widget (ServerContextService *context) stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED(context->widget)); actor = eek_clutter_keyboard_new (context->keyboard); clutter_actor_set_name (actor, "keyboard"); - if (theme) - eek_clutter_keyboard_set_theme (EEK_CLUTTER_KEYBOARD(actor), theme); + eek_clutter_keyboard_set_theme (EEK_CLUTTER_KEYBOARD(actor), theme); + g_object_unref (theme); clutter_container_add_actor (CLUTTER_CONTAINER(stage), actor); clutter_stage_set_color (CLUTTER_STAGE(stage), &stage_color); @@ -302,9 +302,8 @@ update_widget (ServerContextService *context) #endif } else { context->widget = eek_gtk_keyboard_new (keyboard); - if (theme) - eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget), - theme); + eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget), theme); + g_object_unref (theme); } if (!context->window) {