[gnome-flashback/wip/segeiger/inputmethods] input-source: add gf_ibus_manager_get_ibus_manager



commit e3f844423c339a749e212fdd2a754c9dd681a62f
Author: Sebastian Geiger <sbastig gmx net>
Date:   Fri Sep 18 02:57:43 2015 +0200

    input-source: add gf_ibus_manager_get_ibus_manager
    
    This is a singleton function to retrive the ibus manager

 gnome-flashback/libinput-sources/gf-ibus-manager.c |    9 +++++++++
 gnome-flashback/libinput-sources/gf-ibus-manager.h |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-ibus-manager.c 
b/gnome-flashback/libinput-sources/gf-ibus-manager.c
index b4b4416..2187270 100644
--- a/gnome-flashback/libinput-sources/gf-ibus-manager.c
+++ b/gnome-flashback/libinput-sources/gf-ibus-manager.c
@@ -338,6 +338,15 @@ gf_ibus_manager_new (void)
   return g_object_new (GF_TYPE_IBUS_MANAGER, NULL);
 }
 
+GfIBusManager *gf_ibus_manager_get_ibus_manager (void)
+{
+  static GfIBusManager* manager = NULL;
+  if (manager == NULL) {
+    manager = gf_ibus_manager_new ();
+  }
+  return manager;
+}
+
 void
 gf_ibus_manager_preload_engines (GfIBusManager  *manager,
                                  gchar         **ids)
diff --git a/gnome-flashback/libinput-sources/gf-ibus-manager.h 
b/gnome-flashback/libinput-sources/gf-ibus-manager.h
index ff7a6d9..f59e0f9 100644
--- a/gnome-flashback/libinput-sources/gf-ibus-manager.h
+++ b/gnome-flashback/libinput-sources/gf-ibus-manager.h
@@ -27,6 +27,8 @@ G_DECLARE_FINAL_TYPE (GfIBusManager, gf_ibus_manager,
 
 GfIBusManager  *gf_ibus_manager_new                    (void);
 
+GfIBusManager  *gf_ibus_manager_get_ibus_manager       (void);
+
 void            gf_ibus_manager_preload_engines        (GfIBusManager        *manager,
                                                         gchar               **ids);
 


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