[gnome-flashback/wip/segeiger/inputmethods: 8/8] input-sources: Partial implementation for GfInputSourceManager



commit 5f90afc17965ec2a7681b23961ecf59628e32c8b
Author: Sebastian Geiger <sbastig gmx net>
Date:   Sat Sep 19 18:37:18 2015 +0200

    input-sources: Partial implementation for GfInputSourceManager

 .../libinput-sources/gf-input-source-manager.c     |  173 +++++++++++++++++++-
 1 files changed, 172 insertions(+), 1 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-input-source-manager.c 
b/gnome-flashback/libinput-sources/gf-input-source-manager.c
index 1429e99..2e9c570 100644
--- a/gnome-flashback/libinput-sources/gf-input-source-manager.c
+++ b/gnome-flashback/libinput-sources/gf-input-source-manager.c
@@ -17,14 +17,38 @@
 
 #include "config.h"
 
-#include "gf-input-source-manager.h"
 #include "gf-ibus-manager.h"
+#include "gf-input-source.h"
+#include "gf-input-source-manager.h"
+
 
 struct _GfInputSourceManager
 {
   GObject parent;
 
   GfIBusManager *ibus_manager;
+
+  /**
+     * All valid input sources currently in the GSettings KEY_INPUT_SOURCES list indexed by their index there
+     */
+  GHashTable *inputSources;
+
+  /**
+   * All valid input sources currently in the GSettings KEY_INPUT_SOURCES list of type INPUT_SOURCE_TYPE_IBUS
+   * indexed by their IBus ID.
+   */
+  GHashTable *ibusSources;
+
+  /**
+   * All valid input sources currently in the GSettings KEY_INPUT_SOURCES list ordered
+   */
+  GList *mruSources;
+
+  //FIXME: InputSourceManager depends on KeyboardManager which is not ported to C yet.
+  GfIBusManager *ibusManager;
+  gboolean ibusReady;
+
+  GfInputSource *currentSource;
 };
 
 G_DEFINE_TYPE (GfInputSourceManager, gf_input_source_manager, G_TYPE_OBJECT)
@@ -40,6 +64,113 @@ enum {
 static GParamSpec *properties[LAST_PROP] = {NULL};
 
 static void
+gf_input_source_manager_reload (void)
+{
+
+}
+
+static void
+gf_input_source_manager_ibus_ready_callback (GfIBusManager* iBusManager, gboolean ready)
+{
+}
+
+static void
+gf_input_source_manager_modifiers_switch ()
+{
+
+}
+
+static void
+gf_input_source_manager_switch_input_source (void)
+{
+
+}
+
+static void
+gf_input_source_manager_keyboard_options_changed (void)
+{
+
+}
+
+static void
+gf_input_source_manager_current_input_source_changed (void)
+{
+
+}
+
+static void
+gf_input_source_manager_activate_input_source (void)
+{
+
+}
+
+static void
+gf_input_source_manager_input_sources_changed (void)
+{
+
+}
+
+static void
+gf_input_source_manager_make_engine_short_name (void)
+{
+
+}
+
+static void
+gf_input_source_manager_ibus_properties_registered (void)
+{
+
+}
+
+static void
+gf_input_source_manager_ibus_property_updated (void)
+{
+
+}
+
+static void
+gf_input_source_manager_update_sub_property (void)
+{
+
+}
+
+static void
+gf_input_source_manager_ibus_set_content_type (void)
+{
+
+}
+
+static void
+gf_input_source_manager_get_new_input_source (void)
+{
+
+}
+
+static void
+gf_input_source_manager_get_current_window (void)
+{
+
+}
+
+static void
+gf_input_source_manager_set_per_window_input_source (void)
+{
+
+}
+
+static void
+gf_input_source_manager_sources_per_window_changed (void)
+{
+
+}
+
+static void
+gf_input_source_manager_change_per_window_source (void)
+{
+
+}
+
+static void
 set_property (GObject        *object,
               guint           property_id,
               const GValue   *value,
@@ -107,8 +238,33 @@ gf_input_source_manager_class_init (GfInputSourceManagerClass *manager_class)
 static void
 gf_input_source_manager_init (GfInputSourceManager *manager)
 {
+    manager->inputSources = g_hash_table_new (g_str_hash, g_str_equal);
+    manager->ibusSources = g_hash_table_new (g_str_hash, g_str_equal);
+
+    g_signal_connect (manager->ibusManager,
+                      "ready",
+                      G_CALLBACK (gf_input_source_manager_ibus_ready_callback),
+                      manager);
+
+    g_signal_connect (manager->ibusManager,
+                      "properties-registered",
+                      G_CALLBACK (gf_input_source_manager_ibus_properties_registered),
+                      manager);
+
+    g_signal_connect (manager->ibusManager,
+                      "property-updated",
+                      G_CALLBACK (gf_input_source_manager_ibus_property_updated),
+                      manager);
+
+    g_signal_connect (manager->ibusManager,
+                      "set-content-type",
+                      G_CALLBACK (gf_input_source_manager_ibus_set_content_type),
+                      manager);
+
+    //global.display.connect ('modifiers-accelerator-activated', Lang.bind (this, this._modifiersSwitcher);
 }
 
+
 GfInputSourceManager *
 gf_input_source_manager_new (GfIBusManager *ibus_manager)
 {
@@ -116,3 +272,18 @@ gf_input_source_manager_new (GfIBusManager *ibus_manager)
                        "ibus-manager", ibus_manager,
                        NULL);
 }
+
+GfInputSource *
+gf_input_source_manager_get_current_source (GfInputSourceManager *manager)
+{
+    return manager->currentSource;
+}
+
+/**
+ * Returns: A #GHashTable of #GfInputSource objects
+ */
+GHashTable *
+gf_input_source_manager_input_sources (GfInputSourceManager *manager)
+{
+    return manager->inputSources;
+}
\ No newline at end of file


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