[gnome-flashback/wip/segeiger/inputmethods: 6/6] input-sources: implement gf-input-source-manager stubs



commit 97656bd5a5ecccfeeb3a6f6a6c516f9eda86efdf
Author: Sebastian Geiger <sbastig gmx net>
Date:   Fri Sep 18 02:59:59 2015 +0200

    input-sources: implement gf-input-source-manager stubs

 .../libinput-sources/gf-input-source-manager.c     |  215 ++++++++++++++++++++
 .../libinput-sources/gf-input-source-manager.h     |   29 +++
 2 files changed, 244 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-input-source-manager.c 
b/gnome-flashback/libinput-sources/gf-input-source-manager.c
new file mode 100644
index 0000000..3dac238
--- /dev/null
+++ b/gnome-flashback/libinput-sources/gf-input-source-manager.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2015 Sebastian Geiger
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "gf-input-source-manager.h"
+#include "gf-ibus-manager.h"
+#include "gf-input-source.h"
+
+G_DEFINE_TYPE (GfInputSourceManager, gf_input_source_manager, G_TYPE_OBJECT)
+
+struct _GfInputSourceManager
+{
+    GObject parent;
+
+    /**
+     * 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;
+};
+
+
+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
+gf_input_source_manager_class_init (GfInputSourceManagerClass *managerClass)
+{
+
+}
+
+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);
+
+    manager->ibusManager = gf_ibus_manager_get_ibus_manager ();
+    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 (void)
+{
+    g_object_new (GF_TYPE_INPUT_SOURCE_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
diff --git a/gnome-flashback/libinput-sources/gf-input-source-manager.h 
b/gnome-flashback/libinput-sources/gf-input-source-manager.h
new file mode 100644
index 0000000..b673456
--- /dev/null
+++ b/gnome-flashback/libinput-sources/gf-input-source-manager.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2015 Sebastian Geiger
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GF_INPUT_SOURCE_MANAGER_H
+#define GF_INPUT_SOURCE_MANAGER_H
+
+#include <glib-object.h>
+
+#define GF_TYPE_INPUT_SOURCE_MANAGER gf_input_source_manager_get_type ()
+G_DECLARE_FINAL_TYPE (GfInputSourceManager, gf_input_source_manager,
+                      GF, INPUT_SOURCE_MANAGER, GObject)
+
+GfInputSourceManager *gf_input_source_manager_new (void);
+
+#endif


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