[gnome-flashback] input-sources: add GfInputSourceManager, unimplemented



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

    input-sources: add GfInputSourceManager, unimplemented

 gnome-flashback/libinput-sources/Makefile.am       |    2 +
 .../libinput-sources/gf-input-source-manager.c     |  118 ++++++++++++++++++++
 .../libinput-sources/gf-input-source-manager.h     |   30 +++++
 .../libinput-sources/gf-input-sources.c            |    8 +-
 4 files changed, 156 insertions(+), 2 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/Makefile.am b/gnome-flashback/libinput-sources/Makefile.am
index d454529..cd589b8 100644
--- a/gnome-flashback/libinput-sources/Makefile.am
+++ b/gnome-flashback/libinput-sources/Makefile.am
@@ -18,6 +18,8 @@ libinput_sources_la_SOURCES = \
        gf-ibus-manager.h \
        gf-input-sources.c \
        gf-input-sources.h \
+       gf-input-source-manager.c \
+       gf-input-source-manager.h \
        $(NULL)
 
 libinput_sources_la_LDFLAGS = \
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..89d0687
--- /dev/null
+++ b/gnome-flashback/libinput-sources/gf-input-source-manager.c
@@ -0,0 +1,118 @@
+/*
+ * 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 "config.h"
+
+#include "gf-input-source-manager.h"
+#include "gf-ibus-manager.h"
+
+struct _GfInputSourceManager
+{
+  GObject        parent;
+
+  GfIBusManager *ibus_manager;
+};
+
+G_DEFINE_TYPE (GfInputSourceManager, gf_input_source_manager, G_TYPE_OBJECT)
+
+enum
+{
+  PROP_0,
+
+  PROP_IBUS_MANAGER,
+
+  LAST_PROP
+};
+
+static GParamSpec *properties[LAST_PROP] = { NULL };
+
+static void
+gf_input_source_manager_set_property (GObject      *object,
+                                      guint         property_id,
+                                      const GValue *value,
+                                      GParamSpec   *pspec)
+{
+  GfInputSourceManager *manager;
+
+  manager = GF_INPUT_SOURCE_MANAGER (object);
+
+  switch (property_id)
+    {
+      case PROP_IBUS_MANAGER:
+        manager->ibus_manager = g_value_get_object (value);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+        break;
+    }
+}
+
+static void
+gf_input_source_manager_get_property (GObject    *object,
+                                      guint       property_id,
+                                      GValue     *value,
+                                      GParamSpec *pspec)
+{
+  GfInputSourceManager *manager;
+
+  manager = GF_INPUT_SOURCE_MANAGER (object);
+
+  switch (property_id)
+    {
+      case PROP_IBUS_MANAGER:
+        g_value_set_object (value, manager->ibus_manager);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+        break;
+    }
+}
+
+static void
+gf_input_source_manager_class_init (GfInputSourceManagerClass *manager_class)
+{
+  GObjectClass *object_class;
+
+  object_class = G_OBJECT_CLASS (manager_class);
+
+  object_class->get_property = gf_input_source_manager_get_property;
+  object_class->set_property = gf_input_source_manager_set_property;
+
+  properties[PROP_IBUS_MANAGER] =
+    g_param_spec_object ("ibus-manager", "IBus Manager",
+                         "An instance of GfIBusManager",
+                         GF_TYPE_IBUS_MANAGER,
+                         G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+                         G_PARAM_STATIC_STRINGS);
+
+  g_object_class_install_properties (object_class, LAST_PROP, properties);
+}
+
+static void
+gf_input_source_manager_init (GfInputSourceManager *manager)
+{
+}
+
+GfInputSourceManager *
+gf_input_source_manager_new (GfIBusManager *ibus_manager)
+{
+  return g_object_new (GF_TYPE_INPUT_SOURCE_MANAGER,
+                       "ibus-manager", ibus_manager,
+                       NULL);
+}
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..c8bcfe9
--- /dev/null
+++ b/gnome-flashback/libinput-sources/gf-input-source-manager.h
@@ -0,0 +1,30 @@
+/*
+ * 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>
+#include "gf-ibus-manager.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 (GfIBusManager *manager);
+
+#endif
diff --git a/gnome-flashback/libinput-sources/gf-input-sources.c 
b/gnome-flashback/libinput-sources/gf-input-sources.c
index 7d96a6d..66e68e6 100644
--- a/gnome-flashback/libinput-sources/gf-input-sources.c
+++ b/gnome-flashback/libinput-sources/gf-input-sources.c
@@ -19,12 +19,14 @@
 
 #include "gf-ibus-manager.h"
 #include "gf-input-sources.h"
+#include "gf-input-source-manager.h"
 
 struct _GfInputSources
 {
-  GObject        parent;
+  GObject               parent;
 
-  GfIBusManager *ibus_manager;
+  GfIBusManager        *ibus_manager;
+  GfInputSourceManager *input_source_manager;
 };
 
 G_DEFINE_TYPE (GfInputSources, gf_input_sources, G_TYPE_OBJECT)
@@ -37,6 +39,7 @@ gf_input_sources_dispose (GObject *object)
   sources = GF_INPUT_SOURCES (object);
 
   g_clear_object (&sources->ibus_manager);
+  g_clear_object (&sources->input_source_manager);
 
   G_OBJECT_CLASS (gf_input_sources_parent_class)->dispose (object);
 }
@@ -55,6 +58,7 @@ static void
 gf_input_sources_init (GfInputSources *sources)
 {
   sources->ibus_manager = gf_ibus_manager_new ();
+  sources->input_source_manager = gf_input_source_manager_new (sources->ibus_manager);
 }
 
 GfInputSources *


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