From 069aa90e810512b61a807f026b921fa5bccc0325 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Jan 26 2011 08:27:03 +0000 Subject: Updated to 1.3.99.20110117 - Updated ibus-HEAD.patch from upstream. - Fixed Bug 666427 - ibus requires dbus-x11 - Fixed Bug 670137 - QT_IM_MODULE=xim in ibus.conf without ibus-qt --- diff --git a/.gitignore b/.gitignore index 94fa823..d20b7c1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ibus-1.3.6.tar.gz /ibus-1.3.99.20101028.tar.gz /ibus-1.3.99.20101118.tar.gz /ibus-1.3.99.20101202.tar.gz +/ibus-1.3.99.20110117.tar.gz diff --git a/ibus-435880-surrounding-text.patch b/ibus-435880-surrounding-text.patch index fb5df0c..758b12a 100644 --- a/ibus-435880-surrounding-text.patch +++ b/ibus-435880-surrounding-text.patch @@ -1,6 +1,6 @@ -From 3ac76032c89fc3062a84fd824b4e53a7ae023841 Mon Sep 17 00:00:00 2001 +From 2284f5ada37ff8f13a802bd652e2b71b68db1b10 Mon Sep 17 00:00:00 2001 From: Daiki Ueno -Date: Thu, 9 Dec 2010 15:03:54 +0900 +Date: Wed, 26 Jan 2011 15:42:44 +0900 Subject: [PATCH] Support surrounding-text retrieval. This change adds a new API function ibus_engine_get_surrounding_text(). @@ -22,25 +22,25 @@ Also, - destroy resets the current surrounding-text. --- - bus/engineproxy.c | 43 +++++++++++++ + bus/engineproxy.c | 43 ++++++++++++ bus/engineproxy.h | 11 +++ - bus/inputcontext.c | 32 +++++++++ - client/gtk2/ibusimcontext.c | 93 ++++++++++++++++++++++++--- + bus/inputcontext.c | 36 ++++++++++ + client/gtk2/ibusimcontext.c | 138 ++++++++++++++++++++++++++++++++++----- configure.ac | 14 ++++ ibus/engine.py | 6 ++ ibus/interface/iengine.py | 3 + - ibus/interface/iinputcontext.py | 3 + - src/ibusengine.c | 138 +++++++++++++++++++++++++++++++++++++++++ + ibus/interface/iinputcontext.py | 5 ++ + src/ibusengine.c | 138 +++++++++++++++++++++++++++++++++++++++ src/ibusengine.h | 21 ++++++- - src/ibusinputcontext.c | 61 ++++++++++++++++++ - src/ibusinputcontext.h | 11 +++ - src/ibusenginedesc.c | 91 +++++++++++++++++++++++++ + src/ibusenginedesc.c | 132 +++++++++++++++++++++++++++++++++++++ src/ibusenginedesc.h | 11 +++ + src/ibusinputcontext.c | 91 +++++++++++++++++++++++++ + src/ibusinputcontext.h | 11 +++ src/ibusmarshalers.list | 1 + - 15 files changed, 421 insertions(+), 12 deletions(-) + 15 files changed, 644 insertions(+), 17 deletions(-) diff --git a/bus/engineproxy.c b/bus/engineproxy.c -index 59d495d..01116c2 100644 +index f808727..b35933f 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c @@ -47,6 +47,10 @@ struct _BusEngineProxy { @@ -92,7 +92,7 @@ index 59d495d..01116c2 100644 IBUS_PROXY_CLASS (bus_engine_proxy_parent_class)->destroy ((IBusProxy *)engine); } -@@ -926,6 +942,33 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, +@@ -950,6 +966,33 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, NULL); } @@ -127,10 +127,10 @@ index 59d495d..01116c2 100644 #define DEFINE_FUNCTION(Name, name) \ void \ diff --git a/bus/engineproxy.h b/bus/engineproxy.h -index 5e658a4..2ad6ed4 100644 +index 2a82fc6..0680917 100644 --- a/bus/engineproxy.h +++ b/bus/engineproxy.h -@@ -210,5 +210,16 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, +@@ -212,5 +212,16 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, */ gboolean bus_engine_proxy_is_enabled (BusEngineProxy *engine); @@ -148,7 +148,7 @@ index 5e658a4..2ad6ed4 100644 G_END_DECLS #endif diff --git a/bus/inputcontext.c b/bus/inputcontext.c -index 7e522f3..de9f31f 100644 +index 32d51e8..20f561c 100644 --- a/bus/inputcontext.c +++ b/bus/inputcontext.c @@ -247,6 +247,11 @@ static const gchar introspection_xml[] = @@ -163,7 +163,7 @@ index 7e522f3..de9f31f 100644 /* signals */ " " " " -@@ -961,6 +966,32 @@ _ic_get_engine (BusInputContext *c +@@ -961,6 +966,32 @@ _ic_get_engine (BusInputContext *context, * Handle a D-Bus method call whose destination and interface name are both "org.freedesktop.IBus.InputContext" */ static void @@ -196,7 +196,7 @@ index 7e522f3..de9f31f 100644 bus_input_context_service_method_call (IBusService *service, GDBusConnection *connection, const gchar *sender, -@@ -999,6 +1030,7 @@ bus_input_context_service_method_call (I +@@ -999,6 +1030,7 @@ bus_input_context_service_method_call (IBusService *service, { "IsEnabled", _ic_is_enabled }, { "SetEngine", _ic_set_engine }, { "GetEngine", _ic_get_engine }, @@ -204,7 +204,7 @@ index 7e522f3..de9f31f 100644 }; gint i; -@@ -2059,6 +2091,10 @@ bus_input_context_set_engine (BusInputCo +@@ -2059,6 +2091,10 @@ bus_input_context_set_engine (BusInputContext *context, bus_engine_proxy_set_cursor_location (context->engine, context->x, context->y, context->w, context->h); } } @@ -216,21 +216,28 @@ index 7e522f3..de9f31f 100644 context_signals[ENGINE_CHANGED], 0); diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index a6a11b4..0c15df9 100644 +index 009d05d..22d1e46 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c -@@ -59,8 +59,8 @@ struct _IBusIMContext { - GdkRectangle cursor_area; +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include "ibusimcontext.h" + + #if !GTK_CHECK_VERSION (2, 91, 0) +@@ -60,7 +61,8 @@ struct _IBusIMContext { gboolean has_focus; + guint32 time; - gint caps; -- + guint supported_caps; + guint caps; }; struct _IBusIMContextClass { -@@ -106,11 +106,18 @@ static void ibus_im_context_set_curs +@@ -108,11 +110,18 @@ static void ibus_im_context_set_cursor_location static void ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit); @@ -249,7 +256,7 @@ index a6a11b4..0c15df9 100644 static void _bus_connected_cb (IBusBus *bus, IBusIMContext *context); -@@ -124,14 +131,15 @@ static void _slave_preedit_start_cb +@@ -126,14 +135,15 @@ static void _slave_preedit_start_cb (GtkIMContext *slave, IBusIMContext *context); static void _slave_preedit_end_cb (GtkIMContext *slave, IBusIMContext *context); @@ -268,11 +275,11 @@ index a6a11b4..0c15df9 100644 + guint nchars, + IBusIMContext *context); +static void _request_surrounding_text (IBusIMContext *context); + static void _create_fake_input_context (void); + - static GType _ibus_type_im_context = 0; - static GtkIMContextClass *parent_class = NULL; -@@ -196,6 +204,17 @@ ibus_im_context_new (void) - return IBUS_IM_CONTEXT (obj); +@@ -221,6 +231,17 @@ _focus_out_cb (GtkWidget *widget, + return FALSE; } +static void @@ -289,16 +296,16 @@ index a6a11b4..0c15df9 100644 static gint _key_snooper_cb (GtkWidget *widget, GdkEventKey *event, -@@ -223,6 +242,8 @@ _key_snooper_cb (GtkWidget *widget, - if (G_UNLIKELY (event->state & IBUS_IGNORED_MASK)) - return FALSE; +@@ -311,6 +332,8 @@ _key_snooper_cb (GtkWidget *widget, + ibusimcontext->time = event->time; + } + _request_surrounding_text (ibusimcontext); + switch (event->type) { case GDK_KEY_RELEASE: retval = ibus_input_context_process_key_event (ibuscontext, -@@ -269,6 +290,7 @@ ibus_im_context_class_init (IBusIMCo +@@ -357,6 +380,7 @@ ibus_im_context_class_init (IBusIMContextClass *class) im_context_class->set_client_window = ibus_im_context_set_client_window; im_context_class->set_cursor_location = ibus_im_context_set_cursor_location; im_context_class->set_use_preedit = ibus_im_context_set_use_preedit; @@ -306,10 +313,10 @@ index a6a11b4..0c15df9 100644 gobject_class->finalize = ibus_im_context_finalize; _signal_commit_id = -@@ -367,7 +389,12 @@ ibus_im_context_init (GObject *obj) - +@@ -463,7 +487,12 @@ ibus_im_context_init (GObject *obj) ibusimcontext->ibuscontext = NULL; ibusimcontext->has_focus = FALSE; + ibusimcontext->time = GDK_CURRENT_TIME; - ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS | IBUS_CAP_SURROUNDING_TEXT; +#ifdef ENABLE_SURROUNDING + ibusimcontext->supported_caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS | IBUS_CAP_SURROUNDING_TEXT; @@ -320,16 +327,16 @@ index a6a11b4..0c15df9 100644 // Create slave im context -@@ -459,6 +486,8 @@ ibus_im_context_filter_keypress (GtkIMCo - if (ibusimcontext->client_window == NULL && event->window != NULL) - gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext, event->window); +@@ -559,6 +588,8 @@ ibus_im_context_filter_keypress (GtkIMContext *context, + ibusimcontext->time = event->time; + } + _request_surrounding_text (ibusimcontext); + switch (event->type) { case GDK_KEY_RELEASE: retval = ibus_input_context_process_key_event (ibusimcontext->ibuscontext, -@@ -516,6 +545,8 @@ ibus_im_context_focus_in (GtkIMContext * +@@ -623,6 +654,8 @@ ibus_im_context_focus_in (GtkIMContext *context) (gpointer *) &_focus_im_context); _focus_im_context = context; } @@ -338,7 +345,7 @@ index a6a11b4..0c15df9 100644 } static void -@@ -670,6 +701,25 @@ ibus_im_context_set_cursor_location (Gtk +@@ -780,6 +813,25 @@ ibus_im_context_set_cursor_location (GtkIMContext *context, GdkRectangle *area) } static void @@ -364,7 +371,7 @@ index a6a11b4..0c15df9 100644 ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) { IDEBUG ("%s", __FUNCTION__); -@@ -678,17 +728,50 @@ ibus_im_context_set_use_preedit (GtkIMCo +@@ -788,17 +840,50 @@ ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) if(ibusimcontext->ibuscontext) { if (use_preedit) { @@ -418,7 +425,7 @@ index a6a11b4..0c15df9 100644 _bus_connected_cb (IBusBus *bus, IBusIMContext *ibusimcontext) { -@@ -704,6 +787,8 @@ _ibus_context_commit_text_cb (IBusInputC +@@ -817,6 +902,8 @@ _ibus_context_commit_text_cb (IBusInputContext *ibuscontext, IDEBUG ("%s", __FUNCTION__); g_signal_emit (ibusimcontext, _signal_commit_id, 0, text->text); @@ -427,7 +434,7 @@ index a6a11b4..0c15df9 100644 } static gboolean -@@ -976,6 +1061,8 @@ _ibus_context_show_preedit_text_cb (IBus +@@ -1111,6 +1198,8 @@ _ibus_context_show_preedit_text_cb (IBusInputContext *ibuscontext, ibusimcontext->preedit_visible = TRUE; g_signal_emit (ibusimcontext, _signal_preedit_start_id, 0); g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); @@ -436,7 +443,7 @@ index a6a11b4..0c15df9 100644 } static void -@@ -1041,6 +1128,14 @@ _ibus_context_destroy_cb (IBusInputConte +@@ -1176,6 +1265,14 @@ _ibus_context_destroy_cb (IBusInputContext *ibuscontext, } static void @@ -451,7 +458,7 @@ index a6a11b4..0c15df9 100644 _create_input_context (IBusIMContext *ibusimcontext) { IDEBUG ("%s", __FUNCTION__); -@@ -1083,6 +1178,10 @@ _create_input_context (IBusIMContext *ib +@@ -1218,6 +1315,10 @@ _create_input_context (IBusIMContext *ibusimcontext) "disabled", G_CALLBACK (_ibus_context_disabled_cb), ibusimcontext); @@ -462,7 +469,7 @@ index a6a11b4..0c15df9 100644 g_signal_connect (ibusimcontext->ibuscontext, "destroy", G_CALLBACK (_ibus_context_destroy_cb), ibusimcontext); -@@ -1139,17 +1238,21 @@ _slave_preedit_end_cb (GtkIMContext *sl +@@ -1274,17 +1375,21 @@ _slave_preedit_end_cb (GtkIMContext *slave, g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); } @@ -488,7 +495,7 @@ index a6a11b4..0c15df9 100644 _slave_delete_surrounding_cb (GtkIMContext *slave, gint offset_from_cursor, guint nchars, -@@ -1158,8 +1261,9 @@ _slave_delete_surrounding_cb (GtkIMConte +@@ -1293,9 +1398,10 @@ _slave_delete_surrounding_cb (GtkIMContext *slave, gboolean return_value; if (ibusimcontext->enable && ibusimcontext->ibuscontext) { @@ -499,11 +506,12 @@ index a6a11b4..0c15df9 100644 + return return_value; } + #ifdef OS_CHROMEOS diff --git a/configure.ac b/configure.ac -index ea0d32b..1347991 100644 +index 1a1e663..def1986 100644 --- a/configure.ac +++ b/configure.ac -@@ -405,6 +405,19 @@ AC_ARG_WITH(no-snooper-apps, +@@ -354,6 +354,19 @@ AC_ARG_WITH(no-snooper-apps, AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS", [Does not enbale keyboard snooper in those applications]) @@ -523,7 +531,7 @@ index ea0d32b..1347991 100644 # check iso-codes PKG_CHECK_MODULES(ISOCODES, [ iso-codes -@@ -477,5 +490,6 @@ Build options: +@@ -424,5 +437,6 @@ Build options: Build document $enable_gtk_doc Enable key snooper $enable_key_snooper No snooper regexes "$NO_SNOOPER_APPS" @@ -569,10 +577,10 @@ index 2386c0f..5db2012 100644 def SetCapabilities(self, cap): pass diff --git a/ibus/interface/iinputcontext.py b/ibus/interface/iinputcontext.py -index 89f6dbd..2db1c9b 100644 +index 89f6dbd..bb25c5a 100644 --- a/ibus/interface/iinputcontext.py +++ b/ibus/interface/iinputcontext.py -@@ -49,6 +49,9 @@ class IInputContext(dbus.service.Object) +@@ -49,6 +49,9 @@ class IInputContext(dbus.service.Object): @method(in_signature="iiii") def SetCursorLocation(self, x, y, w, h): pass @@ -582,7 +590,7 @@ index 89f6dbd..2db1c9b 100644 @method() def FocusIn(self): pass -@@ -137,4 +140,6 @@ class IInputContext(dbus.service.Object) +@@ -137,4 +140,6 @@ class IInputContext(dbus.service.Object): @signal(signature="v") def UpdateProperty(self, prop): pass @@ -590,7 +598,7 @@ index 89f6dbd..2db1c9b 100644 + def EngineChanged(self): pass diff --git a/src/ibusengine.c b/src/ibusengine.c -index ae07393..777d404 100644 +index ae07393..f284af6 100644 --- a/src/ibusengine.c +++ b/src/ibusengine.c @@ -45,6 +45,7 @@ enum { @@ -861,198 +869,8 @@ index 46d0a04..a5f5aea 100644 * ibus_engine_get_name: * @engine: An IBusEngine. * @returns: Name of IBusEngine. -diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c -index fc26a7c..4f08401 100644 ---- a/src/ibusinputcontext.c -+++ b/src/ibusinputcontext.c -@@ -52,6 +52,7 @@ enum { - CURSOR_DOWN_LOOKUP_TABLE, - REGISTER_PROPERTIES, - UPDATE_PROPERTY, -+ ENGINE_CHANGED, - LAST_SIGNAL, - }; - -@@ -59,13 +60,20 @@ enum { - /* BusInputContextPriv */ - struct _IBusInputContextPrivate { - gboolean own; -+ -+ /* surrounding text */ -+ IBusText *surrounding_text; -+ guint surrounding_cursor_pos; - }; - typedef struct _IBusInputContextPrivate IBusInputContextPrivate; - - static guint context_signals[LAST_SIGNAL] = { 0 }; - // static guint context_signals[LAST_SIGNAL] = { 0 }; - -+static IBusText *text_empty = NULL; -+ - /* functions prototype */ -+static void ibus_input_context_real_destroy (IBusProxy *context); - static void ibus_input_context_g_signal (GDBusProxy *proxy, - const gchar *sender_name, - const gchar *signal_name, -@@ -76,10 +84,13 @@ G_DEFINE_TYPE (IBusInputContext, ibus_in - static void - ibus_input_context_class_init (IBusInputContextClass *class) - { -+ IBusProxyClass *ibus_proxy_class = IBUS_PROXY_CLASS (class); - GDBusProxyClass *g_dbus_proxy_class = G_DBUS_PROXY_CLASS (class); - - g_type_class_add_private (class, sizeof (IBusInputContextPrivate)); - -+ ibus_proxy_class->destroy = ibus_input_context_real_destroy; -+ - g_dbus_proxy_class->g_signal = ibus_input_context_g_signal; - - /* install signals */ -@@ -114,6 +125,21 @@ ibus_input_context_class_init (IBusInput - G_TYPE_NONE, 0); - - /** -+ * IBusInputContext::engine-changed: -+ * @context: An IBusInputContext. -+ * -+ * Emitted when an IME is changed. -+ */ -+ context_signals[ENGINE_CHANGED] = -+ g_signal_new (I_("engine-changed"), -+ G_TYPE_FROM_CLASS (class), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, -+ _ibus_marshal_VOID__VOID, -+ G_TYPE_NONE, 0); -+ -+ /** - * IBusInputContext::commit-text: - * @context: An IBusInputContext. - * @text: Text to be committed. -@@ -442,6 +468,9 @@ ibus_input_context_class_init (IBusInput - G_TYPE_NONE, - 1, - IBUS_TYPE_PROPERTY); -+ -+ text_empty = ibus_text_new_from_static_string (""); -+ g_object_ref_sink (text_empty); - } - - static void -@@ -450,6 +479,22 @@ ibus_input_context_init (IBusInputContex - IBusInputContextPrivate *priv; - priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context); - priv->own = TRUE; -+ priv->surrounding_text = g_object_ref_sink (text_empty); -+ priv->surrounding_cursor_pos = 0; -+} -+ -+static void -+ibus_input_context_real_destroy (IBusProxy *context) -+{ -+ IBusInputContextPrivate *priv; -+ priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (IBUS_INPUT_CONTEXT (context)); -+ -+ if (priv->surrounding_text) { -+ g_object_unref (priv->surrounding_text); -+ priv->surrounding_text = NULL; -+ } -+ -+ IBUS_PROXY_CLASS(ibus_input_context_parent_class)->destroy (context); - } - - static void -@@ -479,6 +524,7 @@ ibus_input_context_g_signal (GDBusProxy - { "PageDownLookupTable", PAGE_DOWN_LOOKUP_TABLE }, - { "CursorUpLookupTable", CURSOR_UP_LOOKUP_TABLE }, - { "CursorDownLookupTable", CURSOR_DOWN_LOOKUP_TABLE }, -+ { "EngineChanged", ENGINE_CHANGED }, - }; - - if (g_strcmp0 (signal_name, "CommitText") == 0) { -@@ -821,6 +867,38 @@ ibus_input_context_property_hide (IBusIn - ); - } - -+void -+ibus_input_context_set_surrounding_text (IBusInputContext *context, -+ IBusText *text, -+ guint32 cursor_pos) -+{ -+ g_assert (IBUS_IS_INPUT_CONTEXT (context)); -+ g_assert (IBUS_IS_TEXT (text)); -+ -+ IBusInputContextPrivate *priv; -+ priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context); -+ -+ if (priv->surrounding_text == NULL || -+ g_strcmp0 (text->text, priv->surrounding_text->text) != 0 || -+ cursor_pos != priv->surrounding_cursor_pos) { -+ GVariant *variant = ibus_serializable_serialize ((IBusSerializable *)text); -+ if (priv->surrounding_text) -+ g_object_unref (priv->surrounding_text); -+ priv->surrounding_text = (IBusText *) g_object_ref_sink (text); -+ priv->surrounding_cursor_pos = cursor_pos; -+ -+ g_dbus_proxy_call ((GDBusProxy *) context, -+ "SetSurroundingText", /* method_name */ -+ g_variant_new ("(vu)", variant, cursor_pos), /* parameters */ -+ G_DBUS_CALL_FLAGS_NONE, /* flags */ -+ -1, /* timeout */ -+ NULL, /* cancellable */ -+ NULL, /* callback */ -+ NULL /* user_data */ -+ ); -+ } -+} -+ - gboolean - ibus_input_context_is_enabled (IBusInputContext *context) - { -diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h -index 8b1f16c..fb65348 100644 ---- a/src/ibusinputcontext.h -+++ b/src/ibusinputcontext.h -@@ -41,6 +41,7 @@ - - #include "ibusproxy.h" - #include "ibusenginedesc.h" -+#include "ibustext.h" - - /* - * Type macros. -@@ -279,6 +280,16 @@ IBusEngineDesc - void ibus_input_context_set_engine (IBusInputContext *context, - const gchar *name); - -+/** -+ * ibus_input_context_set_surrounding_text: -+ * @context: An IBusInputContext. -+ * @text: An IBusText surrounding the current cursor on the application. -+ * @cursor_po: Current cursor position in characters in @text. -+*/ -+void ibus_input_context_set_surrounding_text -+ (IBusInputContext *context, -+ IBusText *text, -+ guint32 cursor_pos); - - G_END_DECLS - #endif -diff --git a/src/ibusmarshalers.list b/src/ibusmarshalers.list -index 5184278..5dc7fc2 100644 ---- a/src/ibusmarshalers.list -+++ b/src/ibusmarshalers.list -@@ -13,6 +13,7 @@ VOID:INT,INT,INT,INT - VOID:UINT,UINT - VOID:INT,UINT - VOID:UINT,UINT,UINT -+VOID:OBJECT,UINT - VOID:OBJECT,UINT,BOOL - VOID:OBJECT,UINT,BOOL,UINT - VOID:OBJECT,BOOL diff --git a/src/ibusenginedesc.c b/src/ibusenginedesc.c -index 5184278..5dc7fc2 100644 +index ca5ef60..956ce73 100644 --- a/src/ibusenginedesc.c +++ b/src/ibusenginedesc.c @@ -22,6 +22,7 @@ @@ -1079,7 +897,7 @@ index 5184278..5dc7fc2 100644 }; #define IBUS_ENGINE_DESC_GET_PRIVATE(o) \ -@@ -79,9 +82,20 @@ static gboolean ibus_engine_desc_cop +@@ -79,9 +82,20 @@ static gboolean ibus_engine_desc_copy (IBusEngineDesc *des const IBusEngineDesc *src); static gboolean ibus_engine_desc_parse_xml_node (IBusEngineDesc *desc, XMLNode *node); @@ -1100,7 +918,7 @@ index 5184278..5dc7fc2 100644 static void ibus_engine_desc_class_init (IBusEngineDescClass *class) -@@ -232,6 +246,21 @@ ibus_engine_desc_class_init (IBusEngineD +@@ -232,6 +246,21 @@ ibus_engine_desc_class_init (IBusEngineDescClass *class) "The hotkeys of engine description", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); @@ -1122,7 +940,7 @@ index 5184278..5dc7fc2 100644 } static void -@@ -249,6 +278,7 @@ ibus_engine_desc_init (IBusEngineDesc *d +@@ -249,6 +278,7 @@ ibus_engine_desc_init (IBusEngineDesc *desc) desc->priv->layout = NULL; desc->priv->rank = 0; desc->priv->hotkeys = NULL; @@ -1130,7 +948,7 @@ index 5184278..5dc7fc2 100644 } static void -@@ -313,6 +343,9 @@ ibus_engine_desc_set_property (IBusEngin +@@ -313,6 +343,9 @@ ibus_engine_desc_set_property (IBusEngineDesc *desc, g_assert (desc->priv->hotkeys == NULL); desc->priv->hotkeys = g_value_dup_string (value); break; @@ -1140,7 +958,7 @@ index 5184278..5dc7fc2 100644 default: G_OBJECT_WARN_INVALID_PROPERTY_ID (desc, prop_id, pspec); } -@@ -355,6 +388,9 @@ ibus_engine_desc_get_property (IBusEngin +@@ -355,6 +388,9 @@ ibus_engine_desc_get_property (IBusEngineDesc *desc, case PROP_HOTKEYS: g_value_set_string (value, ibus_engine_desc_get_hotkeys (desc)); break; @@ -1150,7 +968,7 @@ index 5184278..5dc7fc2 100644 default: G_OBJECT_WARN_INVALID_PROPERTY_ID (desc, prop_id, pspec); } -@@ -382,9 +418,28 @@ ibus_engine_desc_serialize (IBusEngineDe +@@ -382,9 +418,28 @@ ibus_engine_desc_serialize (IBusEngineDesc *desc, g_variant_builder_add (builder, "u", desc->priv->rank); g_variant_builder_add (builder, "s", NOTNULL (desc->priv->hotkeys)); #undef NOTNULL @@ -1179,7 +997,7 @@ index 5184278..5dc7fc2 100644 static gint ibus_engine_desc_deserialize (IBusEngineDesc *desc, GVariant *variant) -@@ -405,6 +460,23 @@ ibus_engine_desc_deserialize (IBusEngine +@@ -405,6 +460,23 @@ ibus_engine_desc_deserialize (IBusEngineDesc *desc, g_variant_get_child (variant, retval++, "u", &desc->priv->rank); g_variant_get_child (variant, retval++, "s", &desc->priv->hotkeys); @@ -1203,7 +1021,7 @@ index 5184278..5dc7fc2 100644 return retval; } -@@ -428,6 +500,7 @@ ibus_engine_desc_copy (IBusEngineDesc +@@ -428,6 +500,7 @@ ibus_engine_desc_copy (IBusEngineDesc *dest, dest->priv->layout = g_strdup (src->priv->layout); dest->priv->rank = src->priv->rank; dest->priv->hotkeys = g_strdup (src->priv->hotkeys); @@ -1211,7 +1029,7 @@ index 5184278..5dc7fc2 100644 return TRUE; } -@@ -439,6 +512,52 @@ ibus_engine_desc_copy (IBusEngineDesc +@@ -439,6 +512,52 @@ ibus_engine_desc_copy (IBusEngineDesc *dest, } \ } @@ -1264,7 +1082,7 @@ index 5184278..5dc7fc2 100644 void ibus_engine_desc_output (IBusEngineDesc *desc, GString *output, -@@ -467,6 +586,13 @@ ibus_engine_desc_output (IBusEngineDesc +@@ -467,6 +586,13 @@ ibus_engine_desc_output (IBusEngineDesc *desc, OUTPUT_ENTRY_1(hotkeys); g_string_append_indent (output, indent + 1); g_string_append_printf (output, "%u\n", desc->priv->rank); @@ -1278,7 +1096,7 @@ index 5184278..5dc7fc2 100644 #undef OUTPUT_ENTRY #undef OUTPUT_ENTRY_1 g_string_append_indent (output, indent); -@@ -504,6 +630,11 @@ ibus_engine_desc_parse_xml_node (IBusEng +@@ -504,6 +630,11 @@ ibus_engine_desc_parse_xml_node (IBusEngineDesc *desc, desc->priv->rank = atoi (sub_node->text); continue; } @@ -1290,7 +1108,7 @@ index 5184278..5dc7fc2 100644 g_warning (" element contains invalidate element <%s>", sub_node->name); } return TRUE; -@@ -526,6 +657,7 @@ IBUS_ENGINE_DESC_GET_PROPERTY (icon, con +@@ -526,6 +657,7 @@ IBUS_ENGINE_DESC_GET_PROPERTY (icon, const gchar *) IBUS_ENGINE_DESC_GET_PROPERTY (layout, const gchar *) IBUS_ENGINE_DESC_GET_PROPERTY (rank, guint) IBUS_ENGINE_DESC_GET_PROPERTY (hotkeys, const gchar *) @@ -1299,10 +1117,10 @@ index 5184278..5dc7fc2 100644 IBusEngineDesc * diff --git a/src/ibusenginedesc.h b/src/ibusenginedesc.h -index 5184278..5dc7fc2 100644 +index 9718b15..209d460 100644 --- a/src/ibusenginedesc.h +++ b/src/ibusenginedesc.h -@@ -90,6 +90,8 @@ typedef struct _IBusEngineDescClass IBus +@@ -90,6 +90,8 @@ typedef struct _IBusEngineDescClass IBusEngineDescClass; * the front. * hotkeys: One or more hotkeys for switching to this engine, separated by * semi-colon. @@ -1311,7 +1129,7 @@ index 5184278..5dc7fc2 100644 */ struct _IBusEngineDesc { IBusSerializable parent; -@@ -249,6 +251,15 @@ guint ibus_engine_desc_get_ra +@@ -249,6 +251,15 @@ guint ibus_engine_desc_get_rank (IBusEngineDesc *info); const gchar *ibus_engine_desc_get_hotkeys (IBusEngineDesc *info); /** @@ -1327,6 +1145,204 @@ index 5184278..5dc7fc2 100644 * ibus_engine_desc_output: * @info: An IBusEngineDesc * @output: XML-formatted Input method engine description. +diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c +index 3d25f68..097f203 100644 +--- a/src/ibusinputcontext.c ++++ b/src/ibusinputcontext.c +@@ -28,6 +28,9 @@ + #include "ibuslookuptable.h" + #include "ibusproplist.h" + ++#define IBUS_INPUT_CONTEXT_GET_PRIVATE(o) \ ++ (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_INPUT_CONTEXT, IBusInputContextPrivate)) ++ + enum { + ENABLED, + DISABLED, +@@ -49,12 +52,25 @@ enum { + CURSOR_DOWN_LOOKUP_TABLE, + REGISTER_PROPERTIES, + UPDATE_PROPERTY, ++ ENGINE_CHANGED, + LAST_SIGNAL, + }; + ++/* BusInputContextPrivate */ ++struct _IBusInputContextPrivate { ++ /* surrounding text */ ++ IBusText *surrounding_text; ++ guint surrounding_cursor_pos; ++}; ++ ++typedef struct _IBusInputContextPrivate IBusInputContextPrivate; ++ + static guint context_signals[LAST_SIGNAL] = { 0 }; + ++static IBusText *text_empty = NULL; ++ + /* functions prototype */ ++static void ibus_input_context_real_destroy (IBusProxy *context); + static void ibus_input_context_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, +@@ -65,8 +81,13 @@ G_DEFINE_TYPE (IBusInputContext, ibus_input_context, IBUS_TYPE_PROXY) + static void + ibus_input_context_class_init (IBusInputContextClass *class) + { ++ IBusProxyClass *ibus_proxy_class = IBUS_PROXY_CLASS (class); + GDBusProxyClass *g_dbus_proxy_class = G_DBUS_PROXY_CLASS (class); + ++ g_type_class_add_private (class, sizeof (IBusInputContextPrivate)); ++ ++ ibus_proxy_class->destroy = ibus_input_context_real_destroy; ++ + g_dbus_proxy_class->g_signal = ibus_input_context_g_signal; + + /* install signals */ +@@ -101,6 +122,21 @@ ibus_input_context_class_init (IBusInputContextClass *class) + G_TYPE_NONE, 0); + + /** ++ * IBusInputContext::engine-changed: ++ * @context: An IBusInputContext. ++ * ++ * Emitted when an IME is changed. ++ */ ++ context_signals[ENGINE_CHANGED] = ++ g_signal_new (I_("engine-changed"), ++ G_TYPE_FROM_CLASS (class), ++ G_SIGNAL_RUN_LAST, ++ 0, ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** + * IBusInputContext::commit-text: + * @context: An IBusInputContext. + * @text: Text to be committed. +@@ -429,11 +465,33 @@ ibus_input_context_class_init (IBusInputContextClass *class) + G_TYPE_NONE, + 1, + IBUS_TYPE_PROPERTY); ++ ++ text_empty = ibus_text_new_from_static_string (""); ++ g_object_ref_sink (text_empty); + } + + static void + ibus_input_context_init (IBusInputContext *context) + { ++ IBusInputContextPrivate *priv; ++ ++ priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context); ++ priv->surrounding_text = g_object_ref_sink (text_empty); ++ priv->surrounding_cursor_pos = 0; ++} ++ ++static void ++ibus_input_context_real_destroy (IBusProxy *context) ++{ ++ IBusInputContextPrivate *priv; ++ priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (IBUS_INPUT_CONTEXT (context)); ++ ++ if (priv->surrounding_text) { ++ g_object_unref (priv->surrounding_text); ++ priv->surrounding_text = NULL; ++ } ++ ++ IBUS_PROXY_CLASS(ibus_input_context_parent_class)->destroy (context); + } + + static void +@@ -463,6 +521,7 @@ ibus_input_context_g_signal (GDBusProxy *proxy, + { "PageDownLookupTable", PAGE_DOWN_LOOKUP_TABLE }, + { "CursorUpLookupTable", CURSOR_UP_LOOKUP_TABLE }, + { "CursorDownLookupTable", CURSOR_DOWN_LOOKUP_TABLE }, ++ { "EngineChanged", ENGINE_CHANGED }, + }; + + if (g_strcmp0 (signal_name, "CommitText") == 0) { +@@ -805,6 +864,38 @@ ibus_input_context_property_hide (IBusInputContext *context, + ); + } + ++void ++ibus_input_context_set_surrounding_text (IBusInputContext *context, ++ IBusText *text, ++ guint32 cursor_pos) ++{ ++ g_assert (IBUS_IS_INPUT_CONTEXT (context)); ++ g_assert (IBUS_IS_TEXT (text)); ++ ++ IBusInputContextPrivate *priv; ++ priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context); ++ ++ if (priv->surrounding_text == NULL || ++ g_strcmp0 (text->text, priv->surrounding_text->text) != 0 || ++ cursor_pos != priv->surrounding_cursor_pos) { ++ GVariant *variant = ibus_serializable_serialize ((IBusSerializable *)text); ++ if (priv->surrounding_text) ++ g_object_unref (priv->surrounding_text); ++ priv->surrounding_text = (IBusText *) g_object_ref_sink (text); ++ priv->surrounding_cursor_pos = cursor_pos; ++ ++ g_dbus_proxy_call ((GDBusProxy *) context, ++ "SetSurroundingText", /* method_name */ ++ g_variant_new ("(vu)", variant, cursor_pos), /* parameters */ ++ G_DBUS_CALL_FLAGS_NONE, /* flags */ ++ -1, /* timeout */ ++ NULL, /* cancellable */ ++ NULL, /* callback */ ++ NULL /* user_data */ ++ ); ++ } ++} ++ + gboolean + ibus_input_context_is_enabled (IBusInputContext *context) + { +diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h +index fa7d976..b3e8c96 100644 +--- a/src/ibusinputcontext.h ++++ b/src/ibusinputcontext.h +@@ -41,6 +41,7 @@ + + #include "ibusproxy.h" + #include "ibusenginedesc.h" ++#include "ibustext.h" + + /* + * Type macros. +@@ -279,6 +280,16 @@ IBusEngineDesc + void ibus_input_context_set_engine (IBusInputContext *context, + const gchar *name); + ++/** ++ * ibus_input_context_set_surrounding_text: ++ * @context: An IBusInputContext. ++ * @text: An IBusText surrounding the current cursor on the application. ++ * @cursor_po: Current cursor position in characters in @text. ++*/ ++void ibus_input_context_set_surrounding_text ++ (IBusInputContext *context, ++ IBusText *text, ++ guint32 cursor_pos); + + G_END_DECLS + #endif +diff --git a/src/ibusmarshalers.list b/src/ibusmarshalers.list +index 5184278..5dc7fc2 100644 +--- a/src/ibusmarshalers.list ++++ b/src/ibusmarshalers.list +@@ -13,6 +13,7 @@ VOID:INT,INT,INT,INT + VOID:UINT,UINT + VOID:INT,UINT + VOID:UINT,UINT,UINT ++VOID:OBJECT,UINT + VOID:OBJECT,UINT,BOOL + VOID:OBJECT,UINT,BOOL,UINT + VOID:OBJECT,BOOL -- 1.7.3.2 diff --git a/ibus-530711-preload-sys.patch b/ibus-530711-preload-sys.patch index 20b4b6e..d1fea0a 100644 --- a/ibus-530711-preload-sys.patch +++ b/ibus-530711-preload-sys.patch @@ -1,6 +1,6 @@ -From 6819ae6b980d0c22e498aa367b8d9c0791acf9be Mon Sep 17 00:00:00 2001 +From aef8d6fa4118336f562f74580f0f1986d8054be5 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Thu, 9 Dec 2010 15:03:08 +0900 +Date: Wed, 26 Jan 2011 15:42:56 +0900 Subject: [PATCH] Reload preload engines until users customize the list. The idea is, if users don't customize the preload_engines with ibus-setup, @@ -18,19 +18,19 @@ IBUS_PRELOAD_ENGINE_MODE_USER and users can customize the value Loading system default may spend the startup time. If you mind it, your dist may like to put TRUE in 'use_local_preload_engines' value. --- - bus/ibusimpl.c | 229 +++++++++++++++++++++++++++++++++++-------------- + bus/ibusimpl.c | 241 ++++++++++++++++++++++++++++++++++---------------- data/ibus.schemas.in | 13 +++ ibus/common.py | 6 ++ setup/main.py | 37 +++++++- setup/setup.ui | 21 ++++- src/ibustypes.h | 10 ++ - 6 files changed, 242 insertions(+), 74 deletions(-) + 6 files changed, 242 insertions(+), 86 deletions(-) diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c -index d7e496d..6f39fac 100644 +index cbcf7f4..1bb159e 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c -@@ -144,6 +144,9 @@ static void bus_ibus_impl_set_previous_engine +@@ -144,6 +144,9 @@ static void bus_ibus_impl_set_previo static void bus_ibus_impl_set_preload_engines (BusIBusImpl *ibus, GVariant *value); @@ -40,7 +40,7 @@ index d7e496d..6f39fac 100644 static void bus_ibus_impl_set_use_sys_layout (BusIBusImpl *ibus, GVariant *value); -@@ -264,6 +267,123 @@ _panel_destroy_cb (BusPanelProxy *panel, +@@ -270,6 +273,123 @@ _panel_destroy_cb (BusPanelProxy *panel, g_object_unref (panel); } @@ -164,16 +164,16 @@ index d7e496d..6f39fac 100644 static void bus_ibus_impl_set_hotkey (BusIBusImpl *ibus, GQuark hotkey, -@@ -347,34 +467,32 @@ static void +@@ -354,34 +474,32 @@ static void bus_ibus_impl_set_preload_engines (BusIBusImpl *ibus, GVariant *value) { - GList *engine_list = NULL; -- -- g_list_foreach (ibus->engine_list, (GFunc) g_object_unref, NULL); -- g_list_free (ibus->engine_list); + gint preload_engine_mode = _get_config_preload_engine_mode (ibus); +- g_list_foreach (ibus->engine_list, (GFunc) g_object_unref, NULL); +- g_list_free (ibus->engine_list); +- - if (value != NULL && g_variant_classify (value) == G_VARIANT_CLASS_ARRAY) { - GVariantIter iter; - g_variant_iter_init (&iter, value); @@ -218,7 +218,7 @@ index d7e496d..6f39fac 100644 } /** -@@ -452,69 +570,47 @@ bus_ibus_impl_set_use_global_engine (BusIBusImpl *ibus, +@@ -459,79 +577,47 @@ bus_ibus_impl_set_use_global_engine (Bus } } @@ -304,14 +304,24 @@ index d7e496d..6f39fac 100644 - if (ibus_engine_desc_get_rank (desc) > 0) - g_variant_builder_add (&builder, "s", ibus_engine_desc_get_name (desc)); - } -- ibus_config_set_value (ibus->config, -- "general", "preload_engines", g_variant_builder_end (&builder)); +- +- GVariant *value = g_variant_builder_end (&builder); +- if (value != NULL) { +- if (g_variant_n_children (value) > 0) { +- ibus_config_set_value (ibus->config, +- "general", "preload_engines", value); +- } else { +- /* We don't update preload_engines with an empty string for safety. +- * Just unref the floating value. */ +- g_variant_unref (value); +- } +- } - g_list_free (engines); + _set_language_relative_preload_engines (ibus); } /* The list of config entries that are related to ibus-daemon. */ -@@ -527,6 +623,7 @@ const static struct { +@@ -544,6 +630,7 @@ const static struct { { "general/hotkey", "next_engine_in_menu", bus_ibus_impl_set_next_engine_in_menu }, { "general/hotkey", "previous_engine", bus_ibus_impl_set_previous_engine }, { "general", "preload_engines", bus_ibus_impl_set_preload_engines }, @@ -320,7 +330,7 @@ index d7e496d..6f39fac 100644 { "general", "use_global_engine", bus_ibus_impl_set_use_global_engine }, { "general", "embed_preedit_text", bus_ibus_impl_set_embed_preedit_text }, diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index aa66aa5..9b82857 100644 +index 54709ce..2ed0321 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in @@ -13,6 +13,19 @@ @@ -344,7 +354,7 @@ index aa66aa5..9b82857 100644 /desktop/ibus/general/hotkey/trigger ibus diff --git a/ibus/common.py b/ibus/common.py -index cbc8d56..db881fc 100644 +index 763ed1c..1264787 100644 --- a/ibus/common.py +++ b/ibus/common.py @@ -33,6 +33,8 @@ __all__ = ( @@ -368,10 +378,10 @@ index cbc8d56..db881fc 100644 pass diff --git a/setup/main.py b/setup/main.py -index 96e9456..215670d 100644 +index 8bac900..c855b86 100644 --- a/setup/main.py +++ b/setup/main.py -@@ -190,15 +190,22 @@ class Setup(object): +@@ -191,15 +191,22 @@ class Setup(object): self.__checkbutton_use_global_engine.connect("toggled", self.__checkbutton_use_global_engine_toggled_cb) # init engine page @@ -399,7 +409,7 @@ index 96e9456..215670d 100644 self.__treeview = self.__builder.get_object("treeview_engines") self.__treeview.set_engines(engines) -@@ -240,6 +247,13 @@ class Setup(object): +@@ -243,6 +250,13 @@ class Setup(object): engine_names = map(lambda e: e.name, engines) self.__config.set_list("general", "preload_engines", engine_names, "s") @@ -413,7 +423,7 @@ index 96e9456..215670d 100644 def __button_engine_add_cb(self, button): engine = self.__combobox.get_active_engine() self.__treeview.append_engine(engine) -@@ -251,6 +265,19 @@ class Setup(object): +@@ -254,6 +268,19 @@ class Setup(object): about.run() about.destroy() @@ -434,10 +444,10 @@ index 96e9456..215670d 100644 try: self.__bus = ibus.Bus() diff --git a/setup/setup.ui b/setup/setup.ui -index 0e31a78..ef841a0 100644 +index de58446..71f723d 100644 --- a/setup/setup.ui +++ b/setup/setup.ui -@@ -489,7 +489,22 @@ +@@ -486,7 +486,22 @@ True vertical @@ -461,7 +471,7 @@ index 0e31a78..ef841a0 100644 True -@@ -640,7 +655,7 @@ +@@ -637,7 +652,7 @@ @@ -470,7 +480,7 @@ index 0e31a78..ef841a0 100644 -@@ -679,7 +694,7 @@ You may use up/down buttons to change it.</i></small> +@@ -676,7 +691,7 @@ You may use up/down buttons to change it.</i></small> False diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch index 587a8e5..7694d4a 100644 --- a/ibus-541492-xkb.patch +++ b/ibus-541492-xkb.patch @@ -1,6 +1,6 @@ -From 715f102611ac16ebc8f66f4fc3b4547c983105ea Mon Sep 17 00:00:00 2001 +From 836f4375531307a4abac4cdbd3cd091413de2b51 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Thu, 9 Dec 2010 15:03:14 +0900 +Date: Wed, 26 Jan 2011 15:42:49 +0900 Subject: [PATCH] Add XKB layouts --- @@ -72,7 +72,7 @@ index 02b7163..6cbe82a 100644 $(NULL) diff --git a/configure.ac b/configure.ac -index 1a1e663..ea0d32b 100644 +index def1986..1347991 100644 --- a/configure.ac +++ b/configure.ac @@ -185,6 +185,57 @@ else @@ -133,7 +133,7 @@ index 1a1e663..ea0d32b 100644 # GObject introspection GOBJECT_INTROSPECTION_CHECK([0.6.8]) -@@ -400,6 +451,7 @@ gconf/Makefile +@@ -413,6 +464,7 @@ gconf/Makefile gconf/gconf.xml.in bindings/Makefile bindings/vala/Makefile @@ -141,7 +141,7 @@ index 1a1e663..ea0d32b 100644 ]) AC_OUTPUT -@@ -415,6 +467,7 @@ Build options: +@@ -428,6 +480,7 @@ Build options: Build gtk2 immodule $enable_gtk2 Build gtk3 immodule $enable_gtk3 Build XIM agent server $enable_xim @@ -150,10 +150,10 @@ index 1a1e663..ea0d32b 100644 Build gconf modules $enable_gconf Build memconf modules $enable_memconf diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index 9b82857..3007e08 100644 +index aa66aa5..54709ce 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in -@@ -180,6 +180,42 @@ +@@ -167,6 +167,42 @@ @@ -971,7 +971,7 @@ index 2fd8876..7383177 100644 + self.__title = title diff --git a/setup/main.py b/setup/main.py -index 215670d..c855b86 100644 +index 96e9456..8bac900 100644 --- a/setup/main.py +++ b/setup/main.py @@ -37,6 +37,7 @@ from gtk import gdk @@ -982,7 +982,7 @@ index 215670d..c855b86 100644 from i18n import DOMAINNAME, _, N_, init as i18n_init ( -@@ -226,6 +227,8 @@ class Setup(object): +@@ -219,6 +220,8 @@ class Setup(object): self.__combobox.connect("notify::active-engine", self.__combobox_notify_active_engine_cb) self.__treeview.connect("notify", self.__treeview_notify_cb) @@ -992,7 +992,7 @@ index 215670d..c855b86 100644 engine = self.__combobox.get_active_engine() button = self.__builder.get_object("button_engine_add") diff --git a/setup/setup.ui b/setup/setup.ui -index ef841a0..71f723d 100644 +index 0e31a78..de58446 100644 --- a/setup/setup.ui +++ b/setup/setup.ui @@ -129,7 +129,6 @@ @@ -1019,7 +1019,7 @@ index ef841a0..71f723d 100644 True False True -@@ -744,6 +741,7 @@ You may use up/down buttons to change it.</i></small> +@@ -729,6 +726,7 @@ You may use up/down buttons to change it.</i></small> True vertical 6 @@ -1027,7 +1027,7 @@ index ef841a0..71f723d 100644 Use system keyboard layout -@@ -812,6 +810,57 @@ You may use up/down buttons to change it.</i></small> +@@ -797,6 +795,57 @@ You may use up/down buttons to change it.</i></small> 0 @@ -1085,7 +1085,7 @@ index ef841a0..71f723d 100644 -@@ -957,4 +1006,558 @@ Homepage: http://code.google.com/p/ibus +@@ -942,4 +991,558 @@ Homepage: http://code.google.com/p/ibus diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index 54fcce5..dc0d12a 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -1,114 +1,947 @@ -From 98419a4133f6358ec2e8ad56c62aacf3e3754c3e Mon Sep 17 00:00:00 2001 -From: Peng Huang -Date: Wed, 8 Dec 2010 16:37:42 +0800 -Subject: [PATCH] Fix GI transfer mode annotation in ibus_bus_list_*engines() comment. +From d26f418a3df4a9ad78dd952d997e028ba24c88f9 Mon Sep 17 00:00:00 2001 +From: Yusuke Sato +Date: Mon, 24 Jan 2011 10:56:05 +0900 +Subject: [PATCH] Add to introspection_xml in src/ibusconfigservice.c. -See https://bugzilla.gnome.org/show_bug.cgi?id=635248. Also, do not mark those -functions as "not implemented", since they are apparently implemented. +I don't think that GDBus library in glib-2.26.[01] uses the information to filter out undefined signals, but just in case. BUG=none -TEST=manual +TEST=manually -Review URL: http://codereview.appspot.com/3274044 +Review URL: http://codereview.appspot.com/4015043 --- - src/ibusbus.h | 7 ++----- - 1 files changed, 2 insertions(+), 5 deletions(-) + src/ibusconfigservice.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) -diff --git a/src/ibusbus.h b/src/ibusbus.h -index 2e288f5..fb56b76 100644 ---- a/src/ibusbus.h -+++ b/src/ibusbus.h -@@ -246,21 +246,18 @@ gboolean ibus_bus_register_component(IBusBus *bus, - /** - * ibus_bus_list_engines: - * @bus: An IBusBus. -- * @returns: (transfer full) (element-type IBusEngineDesc): A List of engines. -+ * @returns: (transfer container) (element-type IBusEngineDesc): A List of engines. - * - * List engines. -- * Note that this function is not yet implemented. - */ - GList *ibus_bus_list_engines (IBusBus *bus); +diff --git a/src/ibusconfigservice.c b/src/ibusconfigservice.c +index 5374a76..6420730 100644 +--- a/src/ibusconfigservice.c ++++ b/src/ibusconfigservice.c +@@ -103,6 +103,11 @@ static const gchar introspection_xml[] = + " " + " " + " " ++ " " ++ " " ++ " " ++ " " ++ " " + " " + ""; - /** - * ibus_bus_list_active_engines: - * @bus: An IBusBus. -- * @returns: (transfer full) (element-type IBusEngineDesc): A List of active engines. -+ * @returns: (transfer container) (element-type IBusEngineDesc): A List of active engines. - * - * List active engines. -- * Note that this function is not yet implemented. -- * Not yet implemented. - */ - GList *ibus_bus_list_active_engines - (IBusBus *bus); -- 1.7.3.2 ---- a/src/ibusinputcontext.c -+++ b/src/ibusinputcontext.c -@@ -732,7 +732,7 @@ ibus_input_context_get_input_context (co - GDBusConnection *connection) +From f28d3e30cb04dc0eee5a657469f2c8d49d7056e0 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Mon, 24 Jan 2011 12:25:48 +0900 +Subject: [PATCH] Set GdkEventKey time for gdk_event_put with IBUS_FORWARD_MASK. + +--- + client/gtk2/ibusimcontext.c | 35 +++++++++++++++++++++++++++++++++-- + 1 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c +index fb6fb2d..009d05d 100644 +--- a/client/gtk2/ibusimcontext.c ++++ b/client/gtk2/ibusimcontext.c +@@ -59,8 +59,8 @@ struct _IBusIMContext { + GdkRectangle cursor_area; + gboolean has_focus; + ++ guint32 time; + gint caps; +- + }; + + struct _IBusIMContextClass { +@@ -307,6 +307,10 @@ _key_snooper_cb (GtkWidget *widget, + + } while (0); + ++ if (ibusimcontext != NULL) { ++ ibusimcontext->time = event->time; ++ } ++ + switch (event->type) { + case GDK_KEY_RELEASE: + retval = ibus_input_context_process_key_event (ibuscontext, +@@ -458,6 +462,7 @@ ibus_im_context_init (GObject *obj) + + ibusimcontext->ibuscontext = NULL; + ibusimcontext->has_focus = FALSE; ++ ibusimcontext->time = GDK_CURRENT_TIME; + ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS | IBUS_CAP_SURROUNDING_TEXT; + + +@@ -550,6 +555,10 @@ ibus_im_context_filter_keypress (GtkIMContext *context, + if (ibusimcontext->client_window == NULL && event->window != NULL) + gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext, event->window); + ++ if (ibusimcontext != NULL) { ++ ibusimcontext->time = event->time; ++ } ++ + switch (event->type) { + case GDK_KEY_RELEASE: + retval = ibus_input_context_process_key_event (ibusimcontext->ibuscontext, +@@ -892,7 +901,29 @@ _create_gdk_event (IBusIMContext *ibusimcontext, + event->window = g_object_ref (ibusimcontext->client_window); + else if (_input_window) + event->window = g_object_ref (_input_window); +- event->time = GDK_CURRENT_TIME; ++ ++ /* The time is copied the latest value from the previous ++ * GdkKeyEvent in filter_keypress(). ++ * ++ * We understand the best way would be to pass the all time value ++ * to IBus functions process_key_event() and IBus DBus functions ++ * ProcessKeyEvent() in IM clients and IM engines so that the ++ * _create_gdk_event() could get the correct time values. ++ * However it would causes to change many functions and the time value ++ * would not provide the useful meanings for each IBus engines but just ++ * pass the original value to ForwardKeyEvent(). ++ * We use the saved value at the moment. ++ * ++ * Another idea might be to have the time implementation in X servers ++ * but some Xorg uses clock_gettime() and others use gettimeofday() ++ * and the values would be different in each implementation and ++ * locale/remote X server. So probably that idea would not work. */ ++ if (ibusimcontext) { ++ event->time = ibusimcontext->time; ++ } else { ++ event->time = GDK_CURRENT_TIME; ++ } ++ + event->send_event = FALSE; + event->state = state; + event->keyval = keyval; +-- +1.7.3.2 + +From 73135d06d2195cee5630918e48003347315eb653 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 26 Jan 2011 14:01:17 +0900 +Subject: [PATCH] Add signals in IBusPanelService for non-C classes. + +--- + src/ibuspanelservice.c | 525 ++++++++++++++++++++++++++++++++++++++++++++---- + src/ibuspanelservice.h | 4 +- + 2 files changed, 492 insertions(+), 37 deletions(-) + +diff --git a/src/ibuspanelservice.c b/src/ibuspanelservice.c +index df949c5..f027390 100644 +--- a/src/ibuspanelservice.c ++++ b/src/ibuspanelservice.c +@@ -21,8 +21,33 @@ + */ + #include "ibusshare.h" + #include "ibuspanelservice.h" ++#include "ibusmarshalers.h" ++#include "ibusinternal.h" + + enum { ++ UPDATE_PREEDIT_TEXT, ++ UPDATE_AUXILIARY_TEXT, ++ UPDATE_LOOKUP_TABLE, ++ FOCUS_IN, ++ FOCUS_OUT, ++ REGISTER_PROPERTIES, ++ UPDATE_PROPERTY, ++ SET_CURSOR_LOCATION, ++ CURSOR_UP_LOOKUP_TABLE, ++ CURSOR_DOWN_LOOKUP_TABLE, ++ HIDE_AUXILIARY_TEXT, ++ HIDE_LANGUAGE_BAR, ++ HIDE_LOOKUP_TABLE, ++ HIDE_PREEDIT_TEXT, ++ PAGE_UP_LOOKUP_TABLE, ++ PAGE_DOWN_LOOKUP_TABLE, ++ RESET, ++ SHOW_AUXILIARY_TEXT, ++ SHOW_LANGUAGE_BAR, ++ SHOW_LOOKUP_TABLE, ++ SHOW_PREEDIT_TEXT, ++ START_SETUP, ++ STATE_CHANGED, + LAST_SIGNAL, + }; + +@@ -30,6 +55,8 @@ enum { + PROP_0, + }; + ++static guint panel_signals[LAST_SIGNAL] = { 0 }; ++ + /* functions prototype */ + static void ibus_panel_service_set_property (IBusPanelService *panel, + guint prop_id, +@@ -167,6 +194,7 @@ static void + ibus_panel_service_class_init (IBusPanelServiceClass *class) { - IBusInputContext *context; -- GError *error; -+ GError *error = NULL; + GObjectClass *gobject_class = G_OBJECT_CLASS (class); ++ ibus_panel_service_parent_class = IBUS_SERVICE_CLASS (g_type_class_peek_parent (class)); + + gobject_class->set_property = (GObjectSetPropertyFunc) ibus_panel_service_set_property; + gobject_class->get_property = (GObjectGetPropertyFunc) ibus_panel_service_get_property; +@@ -203,6 +231,436 @@ ibus_panel_service_class_init (IBusPanelServiceClass *class) + class->show_preedit_text = ibus_panel_service_not_implemented; + class->start_setup = ibus_panel_service_not_implemented; + class->state_changed = ibus_panel_service_not_implemented; ++ ++ /* install signals */ ++ /** ++ * IBusPanelService::update-preedit-text: ++ * @text: A preedit text to be updated. ++ * @cursor_pos: The cursor position of the text. ++ * @visible: Whether the update is visible. ++ * ++ * Emitted when the client application get the update-preedit-text. ++ * Implement the member function update_preedit_text() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[UPDATE_PREEDIT_TEXT] = ++ g_signal_new (I_("update-preedit-text"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, update_preedit_text), ++ NULL, NULL, ++ _ibus_marshal_VOID__OBJECT_UINT_BOOLEAN, ++ G_TYPE_NONE, ++ 3, ++ IBUS_TYPE_TEXT, ++ G_TYPE_UINT, ++ G_TYPE_BOOLEAN); ++ ++ /** ++ * IBusPanelService::update-auxiliary-text: ++ * @text: A preedit text to be updated. ++ * @visible: Whether the update is visible. ++ * ++ * Emitted when the client application get the update-auxiliary-text. ++ * Implement the member function update_auxiliary_text() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[UPDATE_AUXILIARY_TEXT] = ++ g_signal_new (I_("update-auxiliary-text"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, update_auxiliary_text), ++ NULL, NULL, ++ _ibus_marshal_VOID__OBJECT_BOOLEAN, ++ G_TYPE_NONE, ++ 2, ++ IBUS_TYPE_TEXT, ++ G_TYPE_BOOLEAN); ++ ++ /** ++ * IBusPanelService::update-lookup-table: ++ * @lookup_table: A lookup table to be updated. ++ * @visible: Whether the update is visible. ++ * ++ * Emitted when the client application get the update-lookup-table. ++ * Implement the member function update_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[UPDATE_LOOKUP_TABLE] = ++ g_signal_new (I_("update-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, update_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__OBJECT_BOOLEAN, ++ G_TYPE_NONE, ++ 2, ++ IBUS_TYPE_LOOKUP_TABLE, ++ G_TYPE_BOOLEAN); ++ ++ /** ++ * IBusPanelService::focus-in: ++ * @input_context_path: Object path of InputContext. ++ * ++ * Emitted when the client application get the focus-in. ++ * Implement the member function focus_in() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[FOCUS_IN] = ++ g_signal_new (I_("focus-in"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, focus_in), ++ NULL, NULL, ++ _ibus_marshal_VOID__STRING, ++ G_TYPE_NONE, ++ 1, ++ G_TYPE_STRING); ++ ++ /** ++ * IBusPanelService::focus-out: ++ * @input_context_path: Object path of InputContext. ++ * ++ * Emitted when the client application get the focus-out. ++ * Implement the member function focus_out() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[FOCUS_OUT] = ++ g_signal_new (I_("focus-out"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, focus_out), ++ NULL, NULL, ++ _ibus_marshal_VOID__STRING, ++ G_TYPE_NONE, ++ 1, ++ G_TYPE_STRING); ++ ++ /** ++ * IBusPanelService::register-properties: ++ * @prop_list: An IBusPropList that contains properties. ++ * ++ * Emitted when the client application get the register-properties. ++ * Implement the member function register_properties() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[REGISTER_PROPERTIES] = ++ g_signal_new (I_("register-properties"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, register_properties), ++ NULL, NULL, ++ _ibus_marshal_VOID__OBJECT, ++ G_TYPE_NONE, ++ 1, ++ IBUS_TYPE_PROP_LIST); ++ ++ /** ++ * IBusPanelService::update-property: ++ * @prop: The IBusProperty to be updated. ++ * ++ * Emitted when the client application get the update-property. ++ * Implement the member function update_property() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[UPDATE_PROPERTY] = ++ g_signal_new (I_("update-property"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, update_property), ++ NULL, NULL, ++ _ibus_marshal_VOID__OBJECT, ++ G_TYPE_NONE, ++ 1, ++ IBUS_TYPE_PROPERTY); ++ ++ /** ++ * IBusPanelService::set-cursor-location: ++ * @x: X coordinate of the cursor. ++ * @y: Y coordinate of the cursor. ++ * @w: Width of the cursor. ++ * @h: Height of the cursor. ++ * ++ * Emitted when the client application get the set-cursor-location. ++ * Implement the member function set_cursor_location() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[SET_CURSOR_LOCATION] = ++ g_signal_new (I_("set-cursor-location"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, set_cursor_location), ++ NULL, NULL, ++ _ibus_marshal_VOID__INT_INT_INT_INT, ++ G_TYPE_NONE, ++ 4, ++ G_TYPE_INT, ++ G_TYPE_INT, ++ G_TYPE_INT, ++ G_TYPE_INT); ++ ++ /** ++ * IBusPanelService::cursor-up-lookup-table: ++ * ++ * Emitted when the client application get the cursor-up-lookup-table. ++ * Implement the member function cursor_up_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[CURSOR_UP_LOOKUP_TABLE] = ++ g_signal_new (I_("cursor-up-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, cursor_up_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::cursor-down-lookup-table: ++ * ++ * Emitted when the client application get the cursor-down-lookup-table. ++ * Implement the member function cursor_down_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[CURSOR_DOWN_LOOKUP_TABLE] = ++ g_signal_new (I_("cursor-down-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, cursor_down_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::hide-auxiliary-text: ++ * ++ * Emitted when the client application get the hide-auxiliary-text. ++ * Implement the member function hide_auxiliary_text() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[HIDE_AUXILIARY_TEXT] = ++ g_signal_new (I_("hide-auxiliary-text"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, hide_auxiliary_text), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::hide-language-bar: ++ * ++ * Emitted when the client application get the hide-language-bar. ++ * Implement the member function hide_language_bar() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[HIDE_LANGUAGE_BAR] = ++ g_signal_new (I_("hide-language-bar"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, hide_language_bar), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::hide-lookup-table: ++ * ++ * Emitted when the client application get the hide-lookup-table. ++ * Implement the member function hide_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[HIDE_LOOKUP_TABLE] = ++ g_signal_new (I_("hide-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, hide_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::hide-preedit-text: ++ * ++ * Emitted when the client application get the hide-preedit-text. ++ * Implement the member function hide_preedit_text() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[HIDE_PREEDIT_TEXT] = ++ g_signal_new (I_("hide-preedit-text"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, hide_preedit_text), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::page-up-lookup-table: ++ * ++ * Emitted when the client application get the page-up-lookup-table. ++ * Implement the member function page_up_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[PAGE_UP_LOOKUP_TABLE] = ++ g_signal_new (I_("page-up-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, page_up_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::page-down-lookup-table: ++ * ++ * Emitted when the client application get the page-down-lookup-table. ++ * Implement the member function page_down_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[PAGE_DOWN_LOOKUP_TABLE] = ++ g_signal_new (I_("page-down-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, page_down_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::reset: ++ * ++ * Emitted when the client application get the reset. ++ * Implement the member function reset() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[RESET] = ++ g_signal_new (I_("reset"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, reset), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::show-auxiliary-text: ++ * ++ * Emitted when the client application get the show-auxiliary-text. ++ * Implement the member function show_auxiliary_text() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[SHOW_AUXILIARY_TEXT] = ++ g_signal_new (I_("show-auxiliary-text"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, show_auxiliary_text), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::show-language-bar: ++ * ++ * Emitted when the client application get the show-language-bar. ++ * Implement the member function show_language_bar() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[SHOW_LANGUAGE_BAR] = ++ g_signal_new (I_("show-language-bar"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, show_language_bar), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::show-lookup-table: ++ * ++ * Emitted when the client application get the show-lookup-table. ++ * Implement the member function show_lookup_table() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[SHOW_LOOKUP_TABLE] = ++ g_signal_new (I_("show-lookup-table"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, show_lookup_table), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::show-preedit-text: ++ * ++ * Emitted when the client application get the show-preedit-text. ++ * Implement the member function show_preedit_text() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[SHOW_PREEDIT_TEXT] = ++ g_signal_new (I_("show-preedit-text"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, show_preedit_text), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::start-setup: ++ * ++ * Emitted when the client application get the start-setup. ++ * Implement the member function start_setup() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[START_SETUP] = ++ g_signal_new (I_("start-setup"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, start_setup), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); ++ ++ /** ++ * IBusPanelService::state-changed: ++ * ++ * Emitted when the client application get the state-changed. ++ * Implement the member function state_changed() in extended class to receive this signal. ++ * ++ * Argument @user_data is ignored in this function. ++ */ ++ panel_signals[STATE_CHANGED] = ++ g_signal_new (I_("state-changed"), ++ G_TYPE_FROM_CLASS (gobject_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (IBusPanelServiceClass, state_changed), ++ NULL, NULL, ++ _ibus_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); + } + + static void +@@ -282,7 +740,7 @@ ibus_panel_service_service_method_call (IBusService *service, + IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant)); + g_variant_unref (variant); + +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->update_preedit_text (panel, text, cursor, visible); ++ g_signal_emit (panel, panel_signals[UPDATE_PREEDIT_TEXT], 0, text, cursor, visible); + _g_object_unref_if_floating (text); + g_dbus_method_invocation_return_value (invocation, NULL); + return; +@@ -296,7 +754,7 @@ ibus_panel_service_service_method_call (IBusService *service, + IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant)); + g_variant_unref (variant); + +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->update_auxiliary_text (panel, text, visible); ++ g_signal_emit (panel, panel_signals[UPDATE_AUXILIARY_TEXT], 0, text, visible); + _g_object_unref_if_floating (text); + g_dbus_method_invocation_return_value (invocation, NULL); + return; +@@ -310,7 +768,7 @@ ibus_panel_service_service_method_call (IBusService *service, + IBusLookupTable *table = IBUS_LOOKUP_TABLE (ibus_serializable_deserialize (variant)); + g_variant_unref (variant); - context = ibus_input_context_new (path, connection, NULL, &error); - if (!context) { -@@ -904,7 +904,7 @@ ibus_input_context_is_enabled (IBusInput +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->update_lookup_table (panel, table, visible); ++ g_signal_emit (panel, panel_signals[UPDATE_LOOKUP_TABLE], 0, table, visible); + _g_object_unref_if_floating (table); + g_dbus_method_invocation_return_value (invocation, NULL); + return; +@@ -319,7 +777,7 @@ ibus_panel_service_service_method_call (IBusService *service, + if (g_strcmp0 (method_name, "FocusIn") == 0) { + const gchar *path; + g_variant_get (parameters, "(&o)", &path); +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->focus_in (panel, path); ++ g_signal_emit (panel, panel_signals[FOCUS_IN], 0, path); + g_dbus_method_invocation_return_value (invocation, NULL); + return; + } +@@ -327,7 +785,7 @@ ibus_panel_service_service_method_call (IBusService *service, + if (g_strcmp0 (method_name, "FocusOut") == 0) { + const gchar *path; + g_variant_get (parameters, "(&o)", &path); +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->focus_out (panel, path); ++ g_signal_emit (panel, panel_signals[FOCUS_OUT], 0, path); + g_dbus_method_invocation_return_value (invocation, NULL); + return; + } +@@ -337,7 +795,7 @@ ibus_panel_service_service_method_call (IBusService *service, + IBusPropList *prop_list = IBUS_PROP_LIST (ibus_serializable_deserialize (variant)); + g_variant_unref (variant); + +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->register_properties (panel, prop_list); ++ g_signal_emit (panel, panel_signals[REGISTER_PROPERTIES], 0, prop_list); + _g_object_unref_if_floating (prop_list); + g_dbus_method_invocation_return_value (invocation, NULL); + return; +@@ -348,7 +806,7 @@ ibus_panel_service_service_method_call (IBusService *service, + IBusProperty *property = IBUS_PROPERTY (ibus_serializable_deserialize (variant)); + g_variant_unref (variant); + +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->update_property (panel, property); ++ g_signal_emit (panel, panel_signals[UPDATE_PROPERTY], 0, property); + _g_object_unref_if_floating (property); + g_dbus_method_invocation_return_value (invocation, NULL); + return; +@@ -357,41 +815,38 @@ ibus_panel_service_service_method_call (IBusService *service, + if (g_strcmp0 (method_name, "SetCursorLocation") == 0) { + gint x, y, w, h; + g_variant_get (parameters, "(iiii)", &x, &y, &w, &h); +- IBUS_PANEL_SERVICE_GET_CLASS (panel)->set_cursor_location (panel, x, y, w, h); ++ g_signal_emit (panel, panel_signals[SET_CURSOR_LOCATION], 0, x, y, w, h); + g_dbus_method_invocation_return_value (invocation, NULL); + return; + } + + const static struct { + const gchar *name; +- const gint offset; ++ const gint signal_id; + } no_arg_methods [] = { +- { "CursorUpLookupTable" , G_STRUCT_OFFSET (IBusPanelServiceClass, cursor_down_lookup_table) }, +- { "CursorDownLookupTable", G_STRUCT_OFFSET (IBusPanelServiceClass, cursor_up_lookup_table) }, +- { "HideAuxiliaryText", G_STRUCT_OFFSET (IBusPanelServiceClass, hide_auxiliary_text) }, +- { "HideLanguageBar", G_STRUCT_OFFSET (IBusPanelServiceClass, hide_language_bar) }, +- { "HideLookupTable", G_STRUCT_OFFSET (IBusPanelServiceClass, hide_lookup_table) }, +- { "HidePreeditText", G_STRUCT_OFFSET (IBusPanelServiceClass, hide_preedit_text) }, +- { "PageDownLookupTable", G_STRUCT_OFFSET (IBusPanelServiceClass, page_down_lookup_table) }, +- { "PageUpLookupTable", G_STRUCT_OFFSET (IBusPanelServiceClass, page_up_lookup_table) }, +- { "Reset", G_STRUCT_OFFSET (IBusPanelServiceClass, reset) }, +- { "ShowAuxiliaryText", G_STRUCT_OFFSET (IBusPanelServiceClass, show_auxiliary_text) }, +- { "ShowLanguageBar", G_STRUCT_OFFSET (IBusPanelServiceClass, show_language_bar) }, +- { "ShowLookupTable", G_STRUCT_OFFSET (IBusPanelServiceClass, show_lookup_table) }, +- { "ShowPreeditText", G_STRUCT_OFFSET (IBusPanelServiceClass, show_preedit_text) }, +- { "StartSetup", G_STRUCT_OFFSET (IBusPanelServiceClass, start_setup) }, +- { "StateChanged", G_STRUCT_OFFSET (IBusPanelServiceClass, state_changed) }, ++ { "CursorUpLookupTable", CURSOR_UP_LOOKUP_TABLE }, ++ { "CursorDownLookupTable", CURSOR_DOWN_LOOKUP_TABLE }, ++ { "HideAuxiliaryText", HIDE_AUXILIARY_TEXT }, ++ { "HideLanguageBar", HIDE_LANGUAGE_BAR }, ++ { "HideLookupTable", HIDE_LOOKUP_TABLE }, ++ { "HidePreeditText", HIDE_PREEDIT_TEXT }, ++ { "PageUpLookupTable", PAGE_UP_LOOKUP_TABLE }, ++ { "PageDownLookupTable", PAGE_DOWN_LOOKUP_TABLE }, ++ { "Reset", RESET }, ++ { "ShowAuxiliaryText", SHOW_AUXILIARY_TEXT }, ++ { "ShowLanguageBar", SHOW_LANGUAGE_BAR }, ++ { "ShowLookupTable", SHOW_LOOKUP_TABLE }, ++ { "ShowPreeditText", SHOW_PREEDIT_TEXT }, ++ { "StartSetup", START_SETUP }, ++ { "StateChanged", STATE_CHANGED }, + }; + + gint i; + for (i = 0; i < G_N_ELEMENTS (no_arg_methods); i++) { + if (g_strcmp0 (method_name, no_arg_methods[i].name) == 0) { +- typedef gboolean (* NoArgFunc) (IBusPanelService *); +- NoArgFunc func; +- func = G_STRUCT_MEMBER (NoArgFunc, +- IBUS_PANEL_SERVICE_GET_CLASS (panel), +- no_arg_methods[i].offset); +- func (panel); ++ if (no_arg_methods[i].signal_id >= 0) { ++ g_signal_emit (panel, panel_signals[no_arg_methods[i].signal_id], 0); ++ } + g_dbus_method_invocation_return_value (invocation, NULL); + return; + } +@@ -490,7 +945,7 @@ ibus_panel_service_update_auxiliary_text (IBusPanelService *panel, + static void + ibus_panel_service_update_lookup_table (IBusPanelService *panel, + IBusLookupTable *lookup_table, +- gboolean visibl) ++ gboolean visible) { - g_assert (IBUS_IS_INPUT_CONTEXT (context)); - GVariant *result; -- GError *error; -+ GError *error = NULL; - result = g_dbus_proxy_call_sync ((GDBusProxy *) context, - "IsEnabled", /* method_name */ - NULL, /* parameters */ -@@ -932,7 +932,7 @@ ibus_input_context_get_engine (IBusInput + ibus_panel_service_not_implemented(panel); + } +@@ -540,15 +995,15 @@ ibus_panel_service_candidate_clicked (IBusPanelService *panel, + } + + void +-ibus_panel_service_property_active (IBusPanelService *panel, +- const gchar *prop_name, +- guint prop_state) ++ibus_panel_service_property_activate (IBusPanelService *panel, ++ const gchar *prop_name, ++ guint prop_state) { - g_assert (IBUS_IS_INPUT_CONTEXT (context)); - GVariant *result; -- GError *error; -+ GError *error = NULL; - result = g_dbus_proxy_call_sync ((GDBusProxy *) context, - "GetEngine", /* method_name */ - NULL, /* parameters */ -From 017077ceb9ec2f26a8c524f3794a832164f21768 Mon Sep 17 00:00:00 2001 -From: Daiki Ueno -Date: Tue, 28 Dec 2010 12:46:25 +0900 -Subject: [PATCH] Fix g_variant_get() call in DeleteSurroundingText signal handler. + g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel)); + ibus_service_emit_signal ((IBusService *) panel, + NULL, + IBUS_INTERFACE_PANEL, +- "PropertyActive", ++ "PropertyActivate", + g_variant_new ("(su)", prop_name, prop_state), + NULL); + } +diff --git a/src/ibuspanelservice.h b/src/ibuspanelservice.h +index 505fb7f..7678922 100644 +--- a/src/ibuspanelservice.h ++++ b/src/ibuspanelservice.h +@@ -182,7 +182,7 @@ void ibus_panel_service_page_down (IBusPanelService *panel); + void ibus_panel_service_page_up (IBusPanelService *panel); + + /** +- * ibus_panel_service_property_active ++ * ibus_panel_service_property_activate + * @panel: An IBusPanelService + * @prop_name: A property name + * @prop_state: State of the property +@@ -190,7 +190,7 @@ void ibus_panel_service_page_up (IBusPanelService *panel); + * Notify that a property is active + * by sending a "PropertyActivate" message to IBus service. + */ +-void ibus_panel_service_property_active (IBusPanelService *panel, ++void ibus_panel_service_property_activate (IBusPanelService *panel, + const gchar *prop_name, + guint prop_state); + /** +-- +1.7.3.2 -BUG=none -TEST=manual +From cc1d776aeb65b481b1bd93e1f7acfbe4fea8e1f2 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 26 Jan 2011 14:01:25 +0900 +Subject: [PATCH] Set QT_IM_MODULE=xim in case of no ibus-qt. -Review URL: http://codereview.appspot.com/3820042 --- - src/ibusinputcontext.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c -index 88afc22..7bbf8a2 100644 ---- a/src/ibusinputcontext.c -+++ b/src/ibusinputcontext.c -@@ -578,7 +578,7 @@ ibus_input_context_g_signal (GDBusProxy *proxy, - guint32 keycode; - guint32 state; - -- g_variant_get (parameters, 0, "(uuu)", &keyval, &keycode, &state); -+ g_variant_get (parameters, "(uuu)", &keyval, &keycode, &state); - - /* Forward key event back with IBUS_FORWARD_MASK. And process_key_event will - * not process key event with IBUS_FORWARD_MASK again. */ -@@ -595,7 +595,7 @@ ibus_input_context_g_signal (GDBusProxy *proxy, - gint offset_from_cursor; - guint nchars; - -- g_variant_get (parameters, 0, "(iu)", &offset_from_cursor, &nchars); -+ g_variant_get (parameters, "(iu)", &offset_from_cursor, &nchars); - - g_signal_emit (context, - context_signals[DELETE_SURROUNDING_TEXT], + xinput-ibus.in | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/xinput-ibus.in b/xinput-ibus.in +index f10d003..8e5818b 100644 +--- a/xinput-ibus.in ++++ b/xinput-ibus.in +@@ -13,6 +13,8 @@ if test -f /usr/lib64/qt4/plugins/inputmethods/libqtim-ibus.so || \ + test -f /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so; + then + QT_IM_MODULE=ibus ++else ++ QT_IM_MODULE=xim + fi + + # if [ -z "$IBUS_SESSION_ID" ]; then +-- +1.7.3.2 + +From ea3917659bb7be5ee93ced938d5b522a468f7677 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 26 Jan 2011 13:15:08 +0900 +Subject: [PATCH] Fix introspection definitions. + +--- + src/ibusbus.h | 2 +- + src/ibusinputcontext.h | 20 ++++++++++---------- + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/ibusbus.h b/src/ibusbus.h +index a2cd1db..3ea3cde 100644 +--- a/src/ibusbus.h ++++ b/src/ibusbus.h +@@ -101,7 +101,7 @@ gboolean ibus_bus_is_connected (IBusBus *bus); + /** + * ibus_bus_get_connection: + * @bus: An IBusBus. +- * @returns: TRUE if @bus is connected, FALSE otherwise. ++ * @returns: (transfer none): A GDBusConnection of an IBusIBus instance. + * + * Return GDBusConnection of an IBusIBus instance. + */ +diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h +index 4be9160..fa7d976 100644 +--- a/src/ibusinputcontext.h ++++ b/src/ibusinputcontext.h +@@ -107,7 +107,7 @@ IBusInputContext + * ibus_input_context_get_input_context: + * @path: The path to the object that emitting the signal. + * @connection: An GDBusConnection. +- * @returns: An existing IBusInputContext. ++ * @returns: (transfer none): An existing IBusInputContext. + * + * Gets an existing IBusInputContext. + */ +@@ -142,7 +142,7 @@ IBusInputContext + * + * Use ibus_keymap_lookup_keysym() to convert keycode to keysym in given keyboard layout. + * +- * @see_also: #IBusEngine::process-key-event ++ * see_also: #IBusEngine::process-key-event + */ + gboolean ibus_input_context_process_key_event + (IBusInputContext *context, +@@ -160,7 +160,7 @@ gboolean ibus_input_context_process_key_event + * + * Set the cursor location of IBus input context. + * +- * @see_also: #IBusEngine::set-cursor-location ++ * see_also: #IBusEngine::set-cursor-location + */ + void ibus_input_context_set_cursor_location + (IBusInputContext *context, +@@ -177,7 +177,7 @@ void ibus_input_context_set_cursor_location + * When IBUS_CAP_FOCUS is not set, IBUS_CAP_PREEDIT_TEXT, IBUS_CAP_AUXILIARY_TEXT, IBUS_CAP_LOOKUP_TABLE, and IBUS_CAP_PROPERTY have to be all set. + * The panel component does nothing for an application that doesn't support focus. + * +- * @see_also: #IBusEngine::set-capabilities ++ * see_also: #IBusEngine::set-capabilities + */ + void ibus_input_context_set_capabilities + (IBusInputContext *context, +@@ -204,7 +204,7 @@ void ibus_input_context_property_activate + * + * Invoked when the client application get focus. + * +- * @see_also: #IBusEngine::focus_in. ++ * see_also: #IBusEngine::focus_in. + */ + void ibus_input_context_focus_in (IBusInputContext *context); + +@@ -214,7 +214,7 @@ void ibus_input_context_focus_in (IBusInputContext *context); + * + * Invoked when the client application get focus. + * +- * @see_also: #IBusEngine::focus_out. ++ * see_also: #IBusEngine::focus_out. + */ + void ibus_input_context_focus_out (IBusInputContext *context); + +@@ -225,7 +225,7 @@ void ibus_input_context_focus_out (IBusInputContext *context); + * + * Invoked when the IME is reset. + * +- * @see_also: #IBusEngine::reset ++ * see_also: #IBusEngine::reset + */ + void ibus_input_context_reset (IBusInputContext *context); + +@@ -235,7 +235,7 @@ void ibus_input_context_reset (IBusInputContext *context); + * + * Invoked when the IME is enabled, either by IME switch hotkey or select from the menu. + * +- * @see_also: #IBusEngine::enable ++ * see_also: #IBusEngine::enable + */ + void ibus_input_context_enable (IBusInputContext *context); + +@@ -245,7 +245,7 @@ void ibus_input_context_enable (IBusInputContext *context); + * + * Invoked when the IME is disabled, either by IME switch hotkey or select from the menu. + * +- * @see_also: #IBusEngine::disable ++ * see_also: #IBusEngine::disable + */ + void ibus_input_context_disable (IBusInputContext *context); + +@@ -262,7 +262,7 @@ gboolean ibus_input_context_is_enabled (IBusInputContext *context); + /** + * ibus_input_context_get_engine: + * @context: An IBusInputContext. +- * @returns: An IME engine description for the context ++ * @returns: (transfer none): An IME engine description for the context + * + * Returns an IME engine description for the context. + */ -- 1.7.3.2 diff --git a/ibus.spec b/ibus.spec index 6bc9942..853246c 100644 --- a/ibus.spec +++ b/ibus.spec @@ -11,8 +11,8 @@ %define im_chooser_version 1.2.5 Name: ibus -Version: 1.3.99.20101202 -Release: 5%{?dist} +Version: 1.3.99.20110117 +Release: 1%{?dist} Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ Group: System Environment/Libraries @@ -298,14 +298,11 @@ fi %{_datadir}/gtk-doc/html/* %changelog -* Sun Jan 9 2011 Matthias Clasen - 1.3.99.20101202-5 -- Rebuild against newer gtk3 - -* Tue Jan 04 2011 Takao Fujiwara - 1.3.99.20101202-4 -- Updated ibus-435880-surrounding-text.patch to support the xml setting. -- Updated ibus-530711-preload-sys.patch to set the default lang base. +* Wed Jan 26 2011 Takao Fujiwara - 1.3.99.20110117-1 +- Updated to 1.3.99.20110117 - Updated ibus-HEAD.patch from upstream. - Fixed Bug 666427 - ibus requires dbus-x11 +- Fixed Bug 670137 - QT_IM_MODULE=xim in ibus.conf without ibus-qt * Thu Dec 09 2010 Takao Fujiwara - 1.3.99.20101202-1 - Updated to 1.3.99.20101202 diff --git a/sources b/sources index f9a0b07..3e5e558 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -02ca4012ac92aeaba97568591d4d9844 ibus-1.3.99.20101202.tar.gz +3720d477051e575918a1694e0e468624 ibus-1.3.99.20110117.tar.gz diff --git a/xinput-ibus b/xinput-ibus index 3eec7fd..760f86f 100644 --- a/xinput-ibus +++ b/xinput-ibus @@ -10,4 +10,6 @@ if test -f /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so || \ test -f /usr/lib64/qt4/plugins/inputmethods/libqtim-ibus.so; then QT_IM_MODULE=ibus +else + QT_IM_MODULE=xim fi