[gnome-flashback] input-sources: add prop_list to GfInputSource
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] input-sources: add prop_list to GfInputSource
- Date: Thu, 15 Oct 2015 03:53:36 +0000 (UTC)
commit 6208c9b9a976f28aeaa0b3d26eca13288cdc3014
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Oct 15 06:01:44 2015 +0300
input-sources: add prop_list to GfInputSource
gnome-flashback/libinput-sources/gf-input-source.c | 33 ++++++++++++++++++-
gnome-flashback/libinput-sources/gf-input-source.h | 7 ++++
2 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-input-source.c
b/gnome-flashback/libinput-sources/gf-input-source.c
index d2aff34..d249cd4 100644
--- a/gnome-flashback/libinput-sources/gf-input-source.c
+++ b/gnome-flashback/libinput-sources/gf-input-source.c
@@ -17,7 +17,6 @@
#include "config.h"
-#include <ibus-1.0/ibus.h>
#include <string.h>
#include "gf-ibus-manager.h"
@@ -36,6 +35,8 @@ struct _GfInputSource
guint index;
gchar *xkb_id;
+
+ IBusPropList *prop_list;
};
enum
@@ -174,6 +175,18 @@ gf_input_source_set_property (GObject *object,
}
static void
+gf_input_source_dispose (GObject *object)
+{
+ GfInputSource *source;
+
+ source = GF_INPUT_SOURCE (object);
+
+ g_clear_object (&source->prop_list);
+
+ G_OBJECT_CLASS (gf_input_source_parent_class)->dispose (object);
+}
+
+static void
gf_input_source_finalize (GObject *object)
{
GfInputSource *source;
@@ -209,6 +222,7 @@ gf_input_source_class_init (GfInputSourceClass *source_class)
object_class = G_OBJECT_CLASS (source_class);
object_class->constructed = gf_input_source_constructed;
+ object_class->dispose = gf_input_source_dispose;
object_class->finalize = gf_input_source_finalize;
object_class->get_property = gf_input_source_get_property;
object_class->set_property = gf_input_source_set_property;
@@ -262,7 +276,6 @@ gf_input_source_class_init (GfInputSourceClass *source_class)
static void
gf_input_source_init (GfInputSource *source)
{
-
}
GfInputSource *
@@ -337,3 +350,19 @@ gf_input_source_activate (GfInputSource *source)
{
g_signal_emit (source, signals[SIGNAL_ACTIVATE], 0);
}
+
+IBusPropList *
+gf_input_source_get_properties (GfInputSource *source)
+{
+ return source->prop_list;
+}
+
+void
+gf_input_source_set_properties (GfInputSource *source,
+ IBusPropList *prop_list)
+{
+ g_clear_object (&source->prop_list);
+
+ if (prop_list != NULL)
+ source->prop_list = g_object_ref (prop_list);
+}
diff --git a/gnome-flashback/libinput-sources/gf-input-source.h
b/gnome-flashback/libinput-sources/gf-input-source.h
index 2635566..a42359f 100644
--- a/gnome-flashback/libinput-sources/gf-input-source.h
+++ b/gnome-flashback/libinput-sources/gf-input-source.h
@@ -19,6 +19,8 @@
#define GF_INPUT_SOURCE_H
#include <glib-object.h>
+#include <ibus-1.0/ibus.h>
+
#include "gf-ibus-manager.h"
#define GF_TYPE_INPUT_SOURCE gf_input_source_get_type ()
@@ -49,4 +51,9 @@ const gchar *gf_input_source_get_xkb_id (GfInputSource *source);
void gf_input_source_activate (GfInputSource *source);
+IBusPropList *gf_input_source_get_properties (GfInputSource *source);
+
+void gf_input_source_set_properties (GfInputSource *source,
+ IBusPropList *prop_list);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]