From f0777a3be15d1d6a97c23feb92de2443874f73b3 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Thu, 4 Nov 2010 23:32:23 +0900 Subject: [PATCH] Updated to 1.3.99.20101028 Integrated gdbus Merged notify.patch into ibus-HEAD.patch --- .gitignore | 1 + ibus-435880-surrounding-text.patch | 404 ++++++++++++++--------------- ibus-541492-xkb.patch | 143 +++++----- ibus-HEAD.patch | 331 ++++++++++++++++++++++- ibus.spec | 57 ++-- notify.patch | 11 - sources | 2 +- 7 files changed, 632 insertions(+), 317 deletions(-) delete mode 100644 notify.patch diff --git a/.gitignore b/.gitignore index 9ccf52a..da4714a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ ibus-1.3.6.tar.gz /ibus-1.3.7.tar.gz /ibus-1.3.8.tar.gz +/ibus-1.3.99.20101028.tar.gz diff --git a/ibus-435880-surrounding-text.patch b/ibus-435880-surrounding-text.patch index 744f1a9..dc47332 100644 --- a/ibus-435880-surrounding-text.patch +++ b/ibus-435880-surrounding-text.patch @@ -1,6 +1,6 @@ -From de91361ea502c63e54ceb23389b3c88b234f40a0 Mon Sep 17 00:00:00 2001 +From 2a368335194eccd22d605d93532ce6e914089599 Mon Sep 17 00:00:00 2001 From: Daiki Ueno -Date: Thu, 21 Oct 2010 18:48:51 +0900 +Date: Thu, 4 Nov 2010 17:40:35 +0900 Subject: [PATCH] Support surrounding-text retrieval. This change adds a new API function ibus_engine_get_surrounding_text(). @@ -22,34 +22,45 @@ Also, - destroy resets the current surrounding-text. --- - bus/engineproxy.c | 34 +++++++++++ - bus/engineproxy.h | 7 ++ - bus/inputcontext.c | 48 ++++++++++++++++ - client/gtk2/ibusimcontext.c | 80 ++++++++++++++++++++++++-- + bus/engineproxy.c | 42 +++++++++++++++ + bus/engineproxy.h | 4 ++ + bus/inputcontext.c | 32 +++++++++++ + client/gtk2/ibusimcontext.c | 80 ++++++++++++++++++++++++++--- ibus/engine.py | 6 ++ ibus/interface/iengine.py | 3 + ibus/interface/iinputcontext.py | 3 + - src/ibusengine.c | 119 +++++++++++++++++++++++++++++++++++++++ + src/ibusengine.c | 110 +++++++++++++++++++++++++++++++++++++++ src/ibusengine.h | 21 +++++++- - src/ibusinputcontext.c | 43 ++++++++++++++ + src/ibusinputcontext.c | 61 +++++++++++++++++++++ src/ibusinputcontext.h | 11 ++++ src/ibusmarshalers.list | 1 + - 12 files changed, 368 insertions(+), 8 deletions(-) + 12 files changed, 366 insertions(+), 8 deletions(-) diff --git a/bus/engineproxy.c b/bus/engineproxy.c -index 03592d7..915f999 100644 +index f0ddd28..e04661a 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c -@@ -52,6 +52,8 @@ enum { +@@ -42,6 +42,10 @@ struct _BusEngineProxy { + IBusPropList *prop_list; + + /* private member */ ++ ++ /* surrounding text */ ++ IBusText *surrounding_text; ++ guint surrounding_cursor_pos; + }; + + struct _BusEngineProxyClass { +@@ -74,6 +78,8 @@ enum { static guint engine_signals[LAST_SIGNAL] = { 0 }; // static guint engine_signals[LAST_SIGNAL] = { 0 }; +static IBusText *text_empty = NULL; + /* functions prototype */ - static void bus_engine_proxy_real_destroy (BusEngineProxy *engine); + static void bus_engine_proxy_real_destroy (IBusProxy *proxy); -@@ -302,6 +304,8 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass) +@@ -287,11 +293,15 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class) 1, IBUS_TYPE_PROPERTY); @@ -58,16 +69,14 @@ index 03592d7..915f999 100644 } static void -@@ -316,6 +320,8 @@ bus_engine_proxy_init (BusEngineProxy *engine) - engine->enabled = FALSE; - engine->desc = NULL; - engine->keymap = NULL; + bus_engine_proxy_init (BusEngineProxy *engine) + { + engine->surrounding_text = g_object_ref_sink (text_empty); + engine->surrounding_cursor_pos = 0; } static void -@@ -337,6 +343,11 @@ bus_engine_proxy_real_destroy (BusEngineProxy *engine) +@@ -318,6 +328,11 @@ bus_engine_proxy_real_destroy (IBusProxy *proxy) engine->keymap = NULL; } @@ -76,11 +85,11 @@ index 03592d7..915f999 100644 + engine->surrounding_text = NULL; + } + - IBUS_OBJECT_CLASS(bus_engine_proxy_parent_class)->destroy (IBUS_OBJECT (engine)); + IBUS_PROXY_CLASS(bus_engine_proxy_parent_class)->destroy ((IBusProxy *)engine); } -@@ -733,6 +744,29 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, - G_TYPE_INVALID); +@@ -641,6 +656,33 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, + NULL); } +void bus_engine_proxy_set_surrounding_text (BusEngineProxy *engine, @@ -93,16 +102,20 @@ index 03592d7..915f999 100644 + if (!engine->surrounding_text || + g_strcmp0 (text->text, engine->surrounding_text->text) != 0 || + cursor_pos != engine->surrounding_cursor_pos) { ++ GVariant *variant = ibus_serializable_serialize ((IBusSerializable *)text); + if (engine->surrounding_text) + g_object_unref (engine->surrounding_text); + engine->surrounding_text = (IBusText *) g_object_ref_sink (text); + engine->surrounding_cursor_pos = cursor_pos; + -+ ibus_proxy_call ((IBusProxy *) engine, -+ "SetSurroundingText", -+ IBUS_TYPE_TEXT, &text, -+ G_TYPE_UINT, &cursor_pos, -+ G_TYPE_INVALID); ++ g_dbus_proxy_call ((GDBusProxy *)engine, ++ "SetSurroundingText", ++ g_variant_new ("(vu)", variant, cursor_pos), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ NULL, ++ NULL); + } +} + @@ -110,20 +123,10 @@ index 03592d7..915f999 100644 void \ bus_engine_proxy_##name (BusEngineProxy *engine) \ diff --git a/bus/engineproxy.h b/bus/engineproxy.h -index 254b00c..b0e211d 100644 +index 83c72da..da887eb 100644 --- a/bus/engineproxy.h +++ b/bus/engineproxy.h -@@ -59,6 +59,9 @@ struct _BusEngineProxy { - gint y; - gint w; - gint h; -+ /* surrounding text */ -+ IBusText *surrounding_text; -+ guint surrounding_cursor_pos; - - IBusEngineDesc *desc; - IBusKeymap *keymap; -@@ -112,5 +115,9 @@ void bus_engine_proxy_property_show (BusEngineProxy *engine, +@@ -89,5 +89,9 @@ void bus_engine_proxy_property_show (BusEngineProxy *engi void bus_engine_proxy_property_hide (BusEngineProxy *engine, const gchar *prop_name); gboolean bus_engine_proxy_is_enabled (BusEngineProxy *engine); @@ -134,55 +137,39 @@ index 254b00c..b0e211d 100644 G_END_DECLS #endif diff --git a/bus/inputcontext.c b/bus/inputcontext.c -index b5ab201..1aa9f21 100644 +index 56fc27f..09cc2ba 100644 --- a/bus/inputcontext.c +++ b/bus/inputcontext.c -@@ -569,6 +569,10 @@ _ibus_introspect (BusInputContext *context, - " \n" - " \n" - " \n" -+ " \n" -+ " \n" -+ " \n" -+ " \n" - - /* signals */ - " \n" -@@ -1098,6 +1102,49 @@ _ic_destroy (BusInputContext *context, - return NULL; +@@ -235,6 +235,11 @@ static const gchar introspection_xml[] = + " " + " " + " " ++ " " ++ " " ++ " " ++ " " ++ + /* signals */ + " " + " " +@@ -906,6 +911,32 @@ _ic_get_engine (BusInputContext *context, } -+static IBusMessage * -+_ic_set_surrounding_text (BusInputContext *context, -+ IBusMessage *message, -+ BusConnection *connection) + static void ++_ic_set_surrounding_text (BusInputContext *context, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation) +{ -+ g_assert (BUS_IS_INPUT_CONTEXT (context)); -+ g_assert (message != NULL); -+ g_assert (BUS_IS_CONNECTION (connection)); -+ -+ IBusMessage *reply; ++ GVariant *variant = NULL; + IBusText *text; + guint cursor_pos = 0; -+ gboolean retval; -+ IBusError *error; + -+ retval = ibus_message_get_args (message, -+ &error, -+ IBUS_TYPE_TEXT, &text, -+ G_TYPE_UINT, &cursor_pos, -+ G_TYPE_INVALID); -+ -+ if (!retval) { -+ reply = ibus_message_new_error (message, -+ error->name, -+ error->message); -+ ibus_error_free (error); -+ return reply; -+ } ++ g_variant_get (parameters, "(vu)", &variant, &cursor_pos); ++ text = IBUS_TEXT (ibus_serializable_deserialize (variant)); ++ g_variant_unref (variant); + + if ((context->capabilities & IBUS_CAP_SURROUNDING_TEXT) && -+ context->has_focus && context->enabled && context->engine) { ++ context->has_focus && context->enabled && context->engine) { + bus_engine_proxy_set_surrounding_text (context->engine, + text, + cursor_pos); @@ -191,23 +178,23 @@ index b5ab201..1aa9f21 100644 + if (g_object_is_floating (text)) + g_object_unref (text); + -+ reply = ibus_message_new_method_return (message); -+ return reply; ++ g_dbus_method_invocation_return_value (invocation, NULL); +} + - static gboolean - bus_input_context_ibus_message (BusInputContext *context, - BusConnection *connection, -@@ -1132,6 +1179,7 @@ bus_input_context_ibus_message (BusInputContext *context, - { IBUS_INTERFACE_INPUT_CONTEXT, "SetEngine", _ic_set_engine }, - { IBUS_INTERFACE_INPUT_CONTEXT, "GetEngine", _ic_get_engine }, - { IBUS_INTERFACE_INPUT_CONTEXT, "Destroy", _ic_destroy }, -+ { IBUS_INTERFACE_INPUT_CONTEXT, "SetSurroundingText",_ic_set_surrounding_text }, ++static void + bus_input_context_service_method_call (IBusService *service, + GDBusConnection *connection, + const gchar *sender, +@@ -944,6 +975,7 @@ bus_input_context_service_method_call (IBusService *service, + { "IsEnabled", _ic_is_enabled }, + { "SetEngine", _ic_set_engine }, + { "GetEngine", _ic_get_engine }, ++ { "SetSurroundingText", _ic_set_surrounding_text}, }; - ibus_message_set_sender (message, bus_connection_get_unique_name (connection)); + gint i; diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index 0bb71b5..eaa4a54 100644 +index 6570473..ca8db35 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -113,6 +113,12 @@ static void ibus_im_context_set_cursor_location @@ -268,7 +255,7 @@ index 0bb71b5..eaa4a54 100644 switch (event->type) { case GDK_KEY_RELEASE: retval = ibus_input_context_process_key_event (ibuscontext, -@@ -291,6 +310,7 @@ ibus_im_context_class_init (IBusIMContextClass *klass) +@@ -291,6 +310,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; @@ -294,7 +281,7 @@ index 0bb71b5..eaa4a54 100644 } static void -@@ -723,6 +747,39 @@ ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) +@@ -728,6 +752,39 @@ ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) } static void @@ -334,7 +321,7 @@ index 0bb71b5..eaa4a54 100644 _bus_connected_cb (IBusBus *bus, IBusIMContext *ibusimcontext) { -@@ -741,6 +798,8 @@ _ibus_context_commit_text_cb (IBusInputContext *ibuscontext, +@@ -746,6 +803,8 @@ _ibus_context_commit_text_cb (IBusInputContext *ibuscontext, IDEBUG ("%s", __FUNCTION__); g_signal_emit (ibusimcontext, _signal_commit_id, 0, text->text); @@ -343,7 +330,7 @@ index 0bb71b5..eaa4a54 100644 } static gboolean -@@ -1013,6 +1072,8 @@ _ibus_context_show_preedit_text_cb (IBusInputContext *ibuscontext, +@@ -1018,6 +1077,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); @@ -352,7 +339,7 @@ index 0bb71b5..eaa4a54 100644 } static void -@@ -1177,17 +1238,21 @@ _slave_preedit_end_cb (GtkIMContext *slave, +@@ -1183,17 +1244,21 @@ _slave_preedit_end_cb (GtkIMContext *slave, g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); } @@ -378,7 +365,7 @@ index 0bb71b5..eaa4a54 100644 _slave_delete_surrounding_cb (GtkIMContext *slave, gint offset_from_cursor, guint nchars, -@@ -1196,9 +1261,10 @@ _slave_delete_surrounding_cb (GtkIMContext *slave, +@@ -1202,9 +1267,10 @@ _slave_delete_surrounding_cb (GtkIMContext *slave, gboolean return_value; if (ibusimcontext->enable && ibusimcontext->ibuscontext) { @@ -415,7 +402,7 @@ index b1df2fe..ec42fa4 100644 return self.__engine.set_capabilities(caps) diff --git a/ibus/interface/iengine.py b/ibus/interface/iengine.py -index 4d42c2d..ee23efe 100644 +index 2386c0f..5db2012 100644 --- a/ibus/interface/iengine.py +++ b/ibus/interface/iengine.py @@ -50,6 +50,9 @@ class IEngine(dbus.service.Object): @@ -443,7 +430,7 @@ index 89f6dbd..2db1c9b 100644 def FocusIn(self): pass diff --git a/src/ibusengine.c b/src/ibusengine.c -index b5f53d4..da1e643 100644 +index ae07393..87ea7c2 100644 --- a/src/ibusengine.c +++ b/src/ibusengine.c @@ -45,6 +45,7 @@ enum { @@ -454,46 +441,46 @@ index b5f53d4..da1e643 100644 LAST_SIGNAL, }; -@@ -59,11 +60,16 @@ enum { +@@ -58,10 +59,15 @@ enum { struct _IBusEnginePrivate { - gchar *name; - IBusConnection *connection; + gchar *engine_name; + GDBusConnection *connection; + + IBusText *surrounding_text; + guint surrounding_cursor_pos; }; - typedef struct _IBusEnginePrivate IBusEnginePrivate; static guint engine_signals[LAST_SIGNAL] = { 0 }; +static IBusText *text_empty = NULL; + /* functions prototype */ - static void ibus_engine_destroy (IBusEngine *engine); - static void ibus_engine_set_property (IBusEngine *engine, -@@ -113,6 +119,10 @@ static void ibus_engine_property_show (IBusEngine *engine, - const gchar *prop_name); - static void ibus_engine_property_hide (IBusEngine *engine, - const gchar *prop_name); -+static void ibus_engine_set_surrounding_text + static void ibus_engine_destroy (IBusEngine *engine); + static void ibus_engine_set_property (IBusEngine *engine, +@@ -135,6 +141,10 @@ static void ibus_engine_property_show (IBusEngine *engine, + const gchar *prop_name); + static void ibus_engine_property_hide (IBusEngine *engine, + const gchar *prop_name); ++static void ibus_engine_set_surrounding_text + (IBusEngine *engine, + IBusText *text, + guint cursor_pos); - - - G_DEFINE_TYPE (IBusEngine, ibus_engine, IBUS_TYPE_SERVICE) -@@ -167,6 +177,7 @@ ibus_engine_class_init (IBusEngineClass *klass) - klass->property_hide = ibus_engine_property_hide; - klass->set_cursor_location = ibus_engine_set_cursor_location; - klass->set_capabilities = ibus_engine_set_capabilities; -+ klass->set_surrounding_text = ibus_engine_set_surrounding_text; - + static void ibus_engine_emit_signal (IBusEngine *engine, + const gchar *signal_name, + GVariant *parameters); +@@ -245,6 +255,7 @@ ibus_engine_class_init (IBusEngineClass *class) + class->property_hide = ibus_engine_property_hide; + class->set_cursor_location = ibus_engine_set_cursor_location; + class->set_capabilities = ibus_engine_set_capabilities; ++ class->set_surrounding_text = ibus_engine_set_surrounding_text; /* install properties */ -@@ -544,6 +555,29 @@ ibus_engine_class_init (IBusEngineClass *klass) - 1, + /** +@@ -611,12 +622,39 @@ ibus_engine_class_init (IBusEngineClass *class) G_TYPE_STRING); + g_type_class_add_private (class, sizeof (IBusEnginePrivate)); ++ + /** + * IBusEngine::set-surrounding-text: + * @engine: An IBusEngine. @@ -509,7 +496,7 @@ index b5f53d4..da1e643 100644 + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IBusEngineClass, set_surrounding_text), + NULL, NULL, -+ ibus_marshal_VOID__OBJECT_UINT, ++ _ibus_marshal_VOID__OBJECT_UINT, + G_TYPE_NONE, + 2, + G_TYPE_OBJECT, @@ -520,63 +507,54 @@ index b5f53d4..da1e643 100644 } static void -@@ -554,6 +588,9 @@ ibus_engine_init (IBusEngine *engine) - - priv->name = NULL; - priv->connection = NULL; + ibus_engine_init (IBusEngine *engine) + { + engine->priv = IBUS_ENGINE_GET_PRIVATE (engine); + -+ priv->surrounding_text = g_object_ref_sink (text_empty); -+ priv->surrounding_cursor_pos = 0; ++ engine->priv->surrounding_text = g_object_ref_sink (text_empty); ++ engine->priv->surrounding_cursor_pos = 0; } static void -@@ -569,6 +606,11 @@ ibus_engine_destroy (IBusEngine *engine) - priv->connection = NULL; - } +@@ -625,6 +663,11 @@ ibus_engine_destroy (IBusEngine *engine) + g_free (engine->priv->engine_name); + engine->priv->engine_name = NULL; -+ if (priv->surrounding_text) { -+ g_object_unref (priv->surrounding_text); -+ priv->surrounding_text = NULL; ++ if (engine->priv->surrounding_text) { ++ g_object_unref (engine->priv->surrounding_text); ++ engine->priv->surrounding_text = NULL; + } + IBUS_OBJECT_CLASS(ibus_engine_parent_class)->destroy (IBUS_OBJECT (engine)); } -@@ -879,6 +921,33 @@ ibus_engine_ibus_message (IBusEngine *engine, - ibus_object_destroy ((IBusObject *) engine); - return TRUE; - } -+ else if (g_strcmp0 (name, "SetSurroundingText") == 0) { -+ IBusText *text; -+ guint cursor_pos; +@@ -796,6 +839,25 @@ ibus_engine_service_method_call (IBusService *service, + return; + } + ++ if (g_strcmp0 (method_name, "SetSurroundingText") == 0) { ++ GVariant *variant = NULL; ++ IBusText *text; ++ guint cursor_pos; + -+ retval = ibus_message_get_args (message, -+ &error, -+ IBUS_TYPE_TEXT, &text, -+ G_TYPE_UINT, &cursor_pos, -+ G_TYPE_INVALID); ++ g_variant_get (parameters, "(vu)", &variant, &cursor_pos); ++ text = IBUS_TEXT (ibus_serializable_deserialize (variant)); ++ g_variant_unref (variant); + -+ if (!retval) { -+ reply = ibus_message_new_error_printf (message, -+ DBUS_ERROR_INVALID_ARGS, -+ "%s.%s: Can not match signature (u) of method", -+ IBUS_INTERFACE_ENGINE, "SetSurroundingText"); -+ ibus_error_free (error); -+ } -+ else { -+ g_signal_emit (engine, engine_signals[SET_SURROUNDING_TEXT], 0, -+ text, -+ cursor_pos); -+ if (g_object_is_floating (text)) { -+ g_object_unref (text); -+ } -+ reply = ibus_message_new_method_return (message); -+ } ++ g_signal_emit (engine, engine_signals[SET_SURROUNDING_TEXT], 0, ++ text, ++ cursor_pos); ++ if (g_object_is_floating (text)) { ++ g_object_unref (text); + } - else { - reply = ibus_message_new_error_printf (message, - DBUS_ERROR_UNKNOWN_METHOD, -@@ -1003,6 +1072,26 @@ ibus_engine_property_hide (IBusEngine *engine, const gchar *prop_name) ++ g_dbus_method_invocation_return_value (invocation, NULL); ++ return; ++ } ++ + /* should not be reached */ + g_return_if_reached (); + } +@@ -950,6 +1012,26 @@ ibus_engine_property_hide (IBusEngine *engine, const gchar *prop_name) } static void @@ -600,17 +578,17 @@ index b5f53d4..da1e643 100644 +} + +static void - _send_signal (IBusEngine *engine, - const gchar *name, - GType first_arg_type, -@@ -1203,6 +1292,19 @@ void ibus_engine_delete_surrounding_text (IBusEngine *engine, + ibus_engine_emit_signal (IBusEngine *engine, + const gchar *signal_name, + GVariant *parameters) +@@ -1133,14 +1215,42 @@ void ibus_engine_delete_surrounding_text (IBusEngine *engine, gint offset_from_cursor, guint nchars) { -+ g_assert (IBUS_IS_ENGINE (engine)); -+ + IBusEnginePrivate *priv; + + g_return_if_fail (IBUS_IS_ENGINE (engine)); + + priv = IBUS_ENGINE_GET_PRIVATE (engine); + + /* Clear the current surrounding-text buffer. */ @@ -620,10 +598,9 @@ index b5f53d4..da1e643 100644 + priv->surrounding_cursor_pos = 0; + } + - _send_signal (engine, - "DeleteSurroundingText", - G_TYPE_INT, &offset_from_cursor, -@@ -1211,6 +1313,23 @@ void ibus_engine_delete_surrounding_text (IBusEngine *engine, + ibus_engine_emit_signal (engine, + "DeleteSurroundingText", + g_variant_new ("(iu)", offset_from_cursor, nchars)); } void @@ -648,10 +625,10 @@ index b5f53d4..da1e643 100644 IBusPropList *prop_list) { diff --git a/src/ibusengine.h b/src/ibusengine.h -index 95be408..2c6e1d3 100644 +index 46d0a04..a5f5aea 100644 --- a/src/ibusengine.h +++ b/src/ibusengine.h -@@ -124,10 +124,14 @@ struct _IBusEngineClass { +@@ -136,10 +136,14 @@ struct _IBusEngineClass { guint index, guint button, guint state); @@ -667,7 +644,7 @@ index 95be408..2c6e1d3 100644 }; GType ibus_engine_get_type (void); -@@ -367,6 +371,21 @@ void ibus_engine_delete_surrounding_text(IBusEngine *engine, +@@ -394,6 +398,21 @@ void ibus_engine_delete_surrounding_text(IBusEngine *engine, guint nchars); /** @@ -690,10 +667,10 @@ index 95be408..2c6e1d3 100644 * @engine: An IBusEngine. * @returns: Name of IBusEngine. diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c -index b00ad3b..158979e 100644 +index f2977fc..55de905 100644 --- a/src/ibusinputcontext.c +++ b/src/ibusinputcontext.c -@@ -58,12 +58,18 @@ enum { +@@ -59,13 +59,20 @@ enum { /* BusInputContextPriv */ struct _IBusInputContextPrivate { gboolean own; @@ -710,9 +687,25 @@ index b00ad3b..158979e 100644 +static IBusText *text_empty = NULL; + /* functions prototype */ - static void ibus_input_context_real_destroy (IBusInputContext *context); - static gboolean ibus_input_context_ibus_signal (IBusProxy *proxy, -@@ -474,6 +480,9 @@ ibus_input_context_class_init (IBusInputContextClass *klass) ++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 +83,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 */ +@@ -442,6 +452,9 @@ ibus_input_context_class_init (IBusInputContextClass *class) G_TYPE_NONE, 1, IBUS_TYPE_PROPERTY); @@ -722,29 +715,31 @@ index b00ad3b..158979e 100644 } static void -@@ -482,6 +491,8 @@ ibus_input_context_init (IBusInputContext *context) +@@ -450,6 +463,22 @@ ibus_input_context_init (IBusInputContext *context) 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 -@@ -496,6 +507,11 @@ ibus_input_context_real_destroy (IBusInputContext *context) - G_TYPE_INVALID); - } - ++} ++ ++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_OBJECT_CLASS(ibus_input_context_parent_class)->destroy (IBUS_OBJECT (context)); ++ IBUS_PROXY_CLASS(ibus_input_context_parent_class)->destroy (context); } -@@ -914,6 +930,33 @@ ibus_input_context_property_hide (IBusInputContext *context, - G_TYPE_INVALID); + static void +@@ -821,6 +850,38 @@ ibus_input_context_property_hide (IBusInputContext *context, + ); } +void @@ -761,16 +756,21 @@ index b00ad3b..158979e 100644 + 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; + -+ ibus_proxy_call ((IBusProxy *) context, -+ "SetSurroundingText", -+ IBUS_TYPE_TEXT, &text, -+ G_TYPE_UINT, &cursor_pos, -+ G_TYPE_INVALID); ++ 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 */ ++ ); + } +} + @@ -778,10 +778,10 @@ index b00ad3b..158979e 100644 ibus_input_context_is_enabled (IBusInputContext *context) { diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h -index 0d508a1..7f3d3f6 100644 +index 671b7ce..8f20e2d 100644 --- a/src/ibusinputcontext.h +++ b/src/ibusinputcontext.h -@@ -36,6 +36,7 @@ +@@ -41,6 +41,7 @@ #include "ibusproxy.h" #include "ibusenginedesc.h" @@ -789,7 +789,7 @@ index 0d508a1..7f3d3f6 100644 /* * Type macros. -@@ -267,6 +268,16 @@ IBusEngineDesc +@@ -277,6 +278,16 @@ IBusEngineDesc void ibus_input_context_set_engine (IBusInputContext *context, const gchar *name); @@ -807,7 +807,7 @@ index 0d508a1..7f3d3f6 100644 G_END_DECLS #endif diff --git a/src/ibusmarshalers.list b/src/ibusmarshalers.list -index 4473dab..6f80970 100644 +index 5184278..5dc7fc2 100644 --- a/src/ibusmarshalers.list +++ b/src/ibusmarshalers.list @@ -13,6 +13,7 @@ VOID:INT,INT,INT,INT diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch index 3425853..6254432 100644 --- a/ibus-541492-xkb.patch +++ b/ibus-541492-xkb.patch @@ -1,6 +1,6 @@ -From d969e258fc925d16799e34f5b959a15c4c3cb7c3 Mon Sep 17 00:00:00 2001 +From cfe234ad9bd771efaa1ba5a52e31a68b3d25e477 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Thu, 21 Oct 2010 18:48:45 +0900 +Date: Thu, 4 Nov 2010 17:40:30 +0900 Subject: [PATCH] Add XKB layouts --- @@ -18,7 +18,7 @@ Subject: [PATCH] Add XKB layouts setup/main.py | 3 + setup/setup.ui | 609 ++++++++++++++++++++++++++++++++++++++- setup/xkbsetup.py | 451 ++++++++++++++++++++++++++++ - src/ibusfactory.c | 17 +- + src/ibusfactory.c | 21 ++- src/ibusfactory.h | 5 +- ui/gtk/panel.py | 39 +++ xkb/Makefile.am | 104 +++++++ @@ -31,7 +31,7 @@ Subject: [PATCH] Add XKB layouts xkb/xkblib.h | 40 +++ xkb/xkbxml.c | 696 ++++++++++++++++++++++++++++++++++++++++++++ xkb/xkbxml.h | 189 ++++++++++++ - 27 files changed, 3745 insertions(+), 6 deletions(-) + 27 files changed, 3749 insertions(+), 6 deletions(-) create mode 100644 ibus/xkblayout.py.in create mode 100644 ibus/xkbxml.py.in create mode 100644 setup/xkbsetup.py @@ -47,35 +47,35 @@ Subject: [PATCH] Add XKB layouts create mode 100644 xkb/xkbxml.h diff --git a/Makefile.am b/Makefile.am -index 7895940..9f534a4 100644 +index 02b7163..6cbe82a 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -39,6 +39,12 @@ MEMCONF_DIRS = \ +@@ -42,6 +42,12 @@ DAEMON_DIRS = \ $(NULL) endif +if ENABLE_XKB -+XKB_DIRS = \ -+ xkb \ ++XKB_DIRS = \ ++ xkb \ + $(NULL) +endif + - SUBDIRS = \ - src \ - bus \ -@@ -53,6 +59,7 @@ SUBDIRS = \ - $(PYTHON_DIRS) \ - $(GCONF_DIRS) \ + if ENABLE_MEMCONF + MEMCONF_DIRS = \ + memconf \ +@@ -60,6 +66,7 @@ SUBDIRS = \ + $(DAEMON_DIRS) \ + $(PYTHON_DIRS) \ + $(GCONF_DIRS) \ ++ $(XKB_DIRS) \ $(MEMCONF_DIRS) \ -+ $(XKB_DIRS) \ $(NULL) - ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac -index 03b7c03..94e6eab 100644 +index 2c330fa..181490c 100644 --- a/configure.ac +++ b/configure.ac -@@ -168,6 +168,57 @@ else +@@ -185,6 +185,57 @@ else enable_xim="no (disabled, use --enable-xim to enable)" fi @@ -133,7 +133,7 @@ index 03b7c03..94e6eab 100644 # GObject introspection GOBJECT_INTROSPECTION_CHECK([0.6.8]) -@@ -380,6 +431,7 @@ gconf/Makefile +@@ -400,6 +451,7 @@ gconf/Makefile gconf/gconf.xml.in bindings/Makefile bindings/vala/Makefile @@ -141,7 +141,7 @@ index 03b7c03..94e6eab 100644 ]) AC_OUTPUT -@@ -394,6 +446,7 @@ Build options: +@@ -415,6 +467,7 @@ Build options: Build gtk2 immodule $enable_gtk2 Build gtk3 immodule $enable_gtk3 Build XIM agent server $enable_xim @@ -150,10 +150,10 @@ index 03b7c03..94e6eab 100644 Build gconf modules $enable_gconf Build memconf modules $enable_memconf diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index 9e92181..26ee970 100644 +index f818635..f3f567b 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in -@@ -194,6 +194,42 @@ +@@ -184,6 +184,42 @@ @@ -888,10 +888,10 @@ index 0000000..5f0a3ea + test() + test2() diff --git a/setup/Makefile.am b/setup/Makefile.am -index 0b81bf3..ade2791 100644 +index 1730ec0..249856d 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am -@@ -27,6 +27,7 @@ ibussetup_PYTHON = \ +@@ -28,6 +28,7 @@ ibussetup_PYTHON = \ enginetreeview.py \ engineabout.py \ keyboardshortcut.py \ @@ -900,10 +900,10 @@ index 0b81bf3..ade2791 100644 ibussetup_DATA = \ diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py -index 90b6f6c..6822c04 100644 +index 2fd8876..7383177 100644 --- a/setup/enginecombobox.py +++ b/setup/enginecombobox.py -@@ -44,6 +44,7 @@ class EngineComboBox(gtk.ComboBox): +@@ -43,6 +43,7 @@ class EngineComboBox(gtk.ComboBox): self.connect("notify::active", self.__notify_active_cb) self.__model = None @@ -931,18 +931,18 @@ index 90b6f6c..6822c04 100644 + self.__title = title diff --git a/setup/main.py b/setup/main.py -index c6612d2..228b030 100644 +index 8191282..afc4ca1 100644 --- a/setup/main.py +++ b/setup/main.py -@@ -36,6 +36,7 @@ from gtk import gdk +@@ -37,6 +37,7 @@ from gtk import gdk from enginecombobox import EngineComboBox from enginetreeview import EngineTreeView from engineabout import EngineAbout +from xkbsetup import XKBSetup + from i18n import _, N_, init - _ = lambda a : gettext.dgettext("ibus", a) - N_ = lambda a : a -@@ -233,6 +234,8 @@ class Setup(object): + ( +@@ -224,6 +225,8 @@ class Setup(object): self.__combobox.connect("notify::active-engine", self.__combobox_notify_active_engine_cb) self.__treeview.connect("notify", self.__treeview_notify_cb) @@ -952,7 +952,7 @@ index c6612d2..228b030 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 703b4d8..a758bc7 100644 +index 82a2101..19f36c8 100644 --- a/setup/setup.ui +++ b/setup/setup.ui @@ -129,7 +129,6 @@ @@ -979,7 +979,7 @@ index 703b4d8..a758bc7 100644 True False True -@@ -745,6 +742,7 @@ You may use up/down buttons to change it.</i></small> +@@ -780,6 +777,7 @@ You may use up/down buttons to change it.</i></small> True vertical 6 @@ -987,7 +987,7 @@ index 703b4d8..a758bc7 100644 Use system keyboard layout -@@ -760,6 +758,57 @@ You may use up/down buttons to change it.</i></small> +@@ -795,6 +793,57 @@ You may use up/down buttons to change it.</i></small> 0 @@ -1045,7 +1045,7 @@ index 703b4d8..a758bc7 100644 -@@ -958,4 +1007,558 @@ Homepage: http://code.google.com/p/ibus +@@ -993,4 +1042,558 @@ Homepage: http://code.google.com/p/ibus @@ -2062,10 +2062,18 @@ index 0000000..0d57a1a + expander.set_data("checked", checked) + diff --git a/src/ibusfactory.c b/src/ibusfactory.c -index 0a95108..3acd6a6 100644 +index 11d9a6d..7770216 100644 --- a/src/ibusfactory.c +++ b/src/ibusfactory.c -@@ -29,6 +29,7 @@ +@@ -21,6 +21,7 @@ + */ + #include "ibusfactory.h" + #include "ibusengine.h" ++#include "ibusmarshalers.h" + #include "ibusshare.h" + #include "ibusinternal.h" + +@@ -28,6 +29,7 @@ (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_FACTORY, IBusFactoryPrivate)) enum { @@ -2073,48 +2081,52 @@ index 0a95108..3acd6a6 100644 LAST_SIGNAL, }; -@@ -46,6 +47,8 @@ struct _IBusFactoryPrivate { +@@ -42,6 +44,8 @@ struct _IBusFactoryPrivate { + GHashTable *engine_table; }; - typedef struct _IBusFactoryPrivate IBusFactoryPrivate; +static guint factory_signals[LAST_SIGNAL] = { 0 }; + /* functions prototype */ - static void ibus_factory_destroy (IBusFactory *factory); - static void ibus_factory_set_property (IBusFactory *engine, -@@ -112,7 +115,16 @@ ibus_factory_class_init (IBusFactoryClass *klass) - IBUS_TYPE_CONNECTION, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + static void ibus_factory_destroy (IBusFactory *factory); + static void ibus_factory_set_property (IBusFactory *engine, +@@ -113,6 +117,17 @@ ibus_factory_class_init (IBusFactoryClass *class) + ibus_service_class_add_interfaces (IBUS_SERVICE_CLASS (class), introspection_xml); -- + g_type_class_add_private (class, sizeof (IBusFactoryPrivate)); ++ + factory_signals[LOOKUP_ENGINE_NAME] = + g_signal_new (I_("lookup-engine-name"), + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IBusFactoryClass, lookup_engine_name), + NULL, NULL, -+ ibus_marshal_VOID__STRING, ++ _ibus_marshal_VOID__STRING, + G_TYPE_NONE, + 1, + G_TYPE_STRING); } static void -@@ -246,6 +258,9 @@ ibus_factory_ibus_message (IBusFactory *factory, - return TRUE; - } +@@ -190,8 +205,12 @@ ibus_factory_service_method_call (IBusService *service, + if (g_strcmp0 (method_name, "CreateEngine") == 0) { + gchar *engine_name = NULL; ++ GType engine_type; ++ + g_variant_get (parameters, "(&s)", &engine_name); +- GType engine_type = (GType )g_hash_table_lookup (factory->priv->engine_table, engine_name); + g_signal_emit (factory, factory_signals[LOOKUP_ENGINE_NAME], + 0, engine_name); -+ - engine_type = (GType )g_hash_table_lookup (priv->engine_table, engine_name); ++ engine_type = (GType) g_hash_table_lookup (factory->priv->engine_table, engine_name); if (engine_type == G_TYPE_INVALID) { + gchar *error_message = g_strdup_printf ("Can not fond engine %s", engine_name); diff --git a/src/ibusfactory.h b/src/ibusfactory.h -index 515083d..42c29b9 100644 +index 47c06e0..102081c 100644 --- a/src/ibusfactory.h +++ b/src/ibusfactory.h -@@ -118,10 +118,13 @@ struct _IBusFactoryClass { +@@ -127,10 +127,13 @@ struct _IBusFactoryClass { IBusServiceClass parent; /* signals */ @@ -2130,10 +2142,10 @@ index 515083d..42c29b9 100644 /** diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py -index e1efd54..159e8aa 100644 +index 07b0fa2..d058b4e 100644 --- a/ui/gtk/panel.py +++ b/ui/gtk/panel.py -@@ -120,6 +120,22 @@ class Panel(ibus.PanelBase): +@@ -117,6 +117,22 @@ class Panel(ibus.PanelBase): self.__config_load_show_im_name() # self.__bus.request_name(ibus.panel.IBUS_SERVICE_PANEL, 0) @@ -2156,7 +2168,7 @@ index e1efd54..159e8aa 100644 def set_cursor_location(self, x, y, w, h): self.__candidate_panel.set_cursor_location(x, y, w, h) -@@ -204,14 +220,20 @@ class Panel(ibus.PanelBase): +@@ -201,14 +217,20 @@ class Panel(ibus.PanelBase): if not enabled: self.__set_im_icon(ICON_KEYBOARD) self.__set_im_name(None) @@ -2177,7 +2189,7 @@ index e1efd54..159e8aa 100644 self.__language_bar.focus_in() def focus_out(self, ic): -@@ -221,6 +243,8 @@ class Panel(ibus.PanelBase): +@@ -218,6 +240,8 @@ class Panel(ibus.PanelBase): self.__language_bar.focus_out() self.__set_im_icon(ICON_KEYBOARD) self.__set_im_name(None) @@ -2186,7 +2198,7 @@ index e1efd54..159e8aa 100644 def state_changed(self): if not self.__focus_ic: -@@ -233,14 +257,20 @@ class Panel(ibus.PanelBase): +@@ -230,14 +254,20 @@ class Panel(ibus.PanelBase): self.reset() self.__set_im_icon(ICON_KEYBOARD) self.__set_im_name(None) @@ -2207,7 +2219,8 @@ index e1efd54..159e8aa 100644 def reset(self): -@@ -516,2 +546,11 @@ class Panel(ibus.PanelBase): +@@ -517,3 +547,12 @@ class Panel(ibus.PanelBase): + flags=glib.SPAWN_DO_NOT_REAP_CHILD)[0] self.__setup_pid = pid glib.child_watch_add(self.__setup_pid, self.__child_watch_cb) + @@ -2221,7 +2234,7 @@ index e1efd54..159e8aa 100644 + return "default" diff --git a/xkb/Makefile.am b/xkb/Makefile.am new file mode 100644 -index 0000000..49b82eb +index 0000000..64b1fc8 --- /dev/null +++ b/xkb/Makefile.am @@ -0,0 +1,104 @@ @@ -2248,7 +2261,7 @@ index 0000000..49b82eb +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA + -+libibus = $(top_builddir)/src/libibus.la ++libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la + +INCLUDES = \ + -I$(top_srcdir) \ @@ -3276,7 +3289,7 @@ index 0000000..09d506d +#endif diff --git a/xkb/xkbxml.c b/xkb/xkbxml.c new file mode 100644 -index 0000000..ed60c8a +index 0000000..5e9885c --- /dev/null +++ b/xkb/xkbxml.c @@ -0,0 +1,696 @@ @@ -3309,7 +3322,7 @@ index 0000000..ed60c8a +#include + +#include "xkbxml.h" -+#include "ibuscomponent.h" ++#include "ibus.h" + +#ifndef XKB_RULES_XML_FILE +#define XKB_RULES_XML_FILE "/usr/share/X11/xkb/rules/evdev.xml" @@ -3978,7 +3991,7 @@ index 0000000..ed60c8a +} diff --git a/xkb/xkbxml.h b/xkb/xkbxml.h new file mode 100644 -index 0000000..1138b9b +index 0000000..f4858fa --- /dev/null +++ b/xkb/xkbxml.h @@ -0,0 +1,189 @@ @@ -4007,7 +4020,7 @@ index 0000000..1138b9b +#ifndef __IBUS_XKB_H_ +#define __IBUS_XKB_H_ + -+#include "ibuscomponent.h" ++#include "ibus.h" + +/* + * Type macros. diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index b64021e..1acf357 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -1,12 +1,322 @@ -From 843c9e13f3363cf7f4ee131b13270e55cb9a2778 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 2 Nov 2010 11:21:24 +0900 -Subject: [PATCH] Replace s/gdk_drawable_get_size/gdk_window_get_height/ for GTK3. - ---- - client/gtk2/ibusimcontext.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - +--- ibus-1.3.99.20101028/client/gtk3/Makefile.am.orig 2010-10-29 17:23:56.706717818 +0900 ++++ ibus-1.3.99.20101028/client/gtk3/Makefile.am 2010-10-29 17:24:18.236715894 +0900 +@@ -20,7 +20,7 @@ + # Free Software Foundation, Inc., 59 Temple Place, Suite 330, + # Boston, MA 02111-1307 USA + +-libibus = $(top_builddir)/src/libibus-2.0.la ++libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la + + INCLUDES = \ + -I$(top_srcdir)/src \ +--- ibus-1.3.99.20101028/src/ibusenginedesc.c.orig 2010-10-29 19:27:09.522715859 +0900 ++++ ibus-1.3.99.20101028/src/ibusenginedesc.c 2010-10-29 19:28:11.539716134 +0900 +@@ -379,8 +379,8 @@ ibus_engine_desc_serialize (IBusEngineDe + g_variant_builder_add (builder, "s", NOTNULL (desc->priv->author)); + g_variant_builder_add (builder, "s", NOTNULL (desc->priv->icon)); + g_variant_builder_add (builder, "s", NOTNULL (desc->priv->layout)); +- g_variant_builder_add (builder, "s", NOTNULL (desc->priv->hotkeys)); + g_variant_builder_add (builder, "u", desc->priv->rank); ++ g_variant_builder_add (builder, "s", NOTNULL (desc->priv->hotkeys)); + #undef NOTNULL + return TRUE; + } +@@ -402,8 +402,8 @@ ibus_engine_desc_deserialize (IBusEngine + g_variant_get_child (variant, retval++, "s", &desc->priv->author); + g_variant_get_child (variant, retval++, "s", &desc->priv->icon); + g_variant_get_child (variant, retval++, "s", &desc->priv->layout); +- g_variant_get_child (variant, retval++, "s", &desc->priv->hotkeys); + g_variant_get_child (variant, retval++, "u", &desc->priv->rank); ++ g_variant_get_child (variant, retval++, "s", &desc->priv->hotkeys); + + return retval; + } +--- ibus-1.3.99.20101028/ibus/common.py.orig 2010-11-01 14:06:59.222958549 +0900 ++++ ibus-1.3.99.20101028/ibus/common.py 2010-11-01 14:07:09.253716200 +0900 +@@ -120,7 +120,7 @@ IBUS_SERVICE_IBUS = "org.freedesktop.I + IBUS_IFACE_PANEL = "org.freedesktop.IBus.Panel" + IBUS_IFACE_CONFIG = "org.freedesktop.IBus.Config" + IBUS_IFACE_ENGINE = "org.freedesktop.IBus.Engine" +-IBUS_IFACE_ENGINE_FACTORY = "org.freedesktop.IBus.EngineFactory" ++IBUS_IFACE_ENGINE_FACTORY = "org.freedesktop.IBus.Factory" + IBUS_IFACE_INPUT_CONTEXT = "org.freedesktop.IBus.InputContext" + IBUS_IFACE_NOTIFICATIONS = "org.freedesktop.IBus.Notifications" + +--- ibus-1.3.99.20101028/ibus/config.py.orig 2010-11-01 17:47:11.241780699 +0900 ++++ ibus-1.3.99.20101028/ibus/config.py 2010-11-01 17:47:24.946715350 +0900 +@@ -46,7 +46,7 @@ class ConfigBase(object.Object): + def set_value(self, section, name, value): + pass + +- def unset(self, section, name): ++ def unset_value(self, section, name): + pass + + def value_changed(self, section, name, value): +@@ -65,8 +65,8 @@ class ConfigProxy(interface.IConfig): + def SetValue(self, section, name, value): + return self.__config.set_value(section, name, value) + +- def Unset(self, section, name): +- return self.__config.unset(section, name) ++ def UnsetValue(self, section, name): ++ return self.__config.unset_value(section, name) + + def Destroy(self): + self.__config.destroy() +@@ -148,8 +148,8 @@ class Config(object.Object): + def set_list(self, section, name, value, signature): + return self.set_value(section, name, dbus.Array(value, signature=signature)) + +- def unset(self, section, name): ++ def unset_value(self, section, name): + try: +- return self.__config.Unset(section, name) ++ return self.__config.UnsetValue(section, name) + except: + return +--- ibus-1.3.99.20101028/ibus/interface/iconfig.py.orig 2010-11-01 18:08:49.704715614 +0900 ++++ ibus-1.3.99.20101028/ibus/interface/iconfig.py 2010-11-01 18:09:10.036715669 +0900 +@@ -49,6 +49,9 @@ class IConfig(dbus.service.Object): + @method(in_signature="ssv") + def SetValue(self, section, name, value): pass + ++ @method(in_signature="ss") ++ def UnsetValue(self, section, name): pass ++ + @method() + def Destroy(self): pass + +diff --git a/src/ibuscomponent.c b/src/ibuscomponent.c +index df05727..d016698 100644 +--- a/src/ibuscomponent.c ++++ b/src/ibuscomponent.c +@@ -713,20 +713,20 @@ ibus_component_new (const gchar *name, + const gchar *exec, + const gchar *textdomain) + { +- return ibus_component_new2 ("name", name, +- "description", description, +- "version", version, +- "license", license, +- "author", author, +- "homepage", homepage, +- "exec", exec, +- "textdomain", textdomain, +- NULL); ++ return ibus_component_new_varargs ("name", name, ++ "description", description, ++ "version", version, ++ "license", license, ++ "author", author, ++ "homepage", homepage, ++ "exec", exec, ++ "textdomain", textdomain, ++ NULL); + } + + + IBusComponent * +-ibus_component_new2 (const gchar *first_property_name, ...) ++ibus_component_new_varargs (const gchar *first_property_name, ...) + { + va_list var_args; + IBusComponent *component; +diff --git a/src/ibuscomponent.h b/src/ibuscomponent.h +index 2383de9..c8da80e 100644 +--- a/src/ibuscomponent.h ++++ b/src/ibuscomponent.h +@@ -141,18 +141,18 @@ IBusComponent *ibus_component_new (const gchar *name, + const gchar *textdomain); + + /** +- * ibus_component_new2: ++ * ibus_component_new_varargs: + * @first_property_name: Name of the first property. + * @Varargs: the NULL-terminated arguments of the properties and values. + * + * New an IBusComponent. +- * ibus_component_new2() supports the va_list format. ++ * ibus_component_new_varargs() supports the va_list format. + * name property is required. e.g. +- * IBusComponent *component = ibus_component_new2 ("name", "ibus-foo", +- * "exec", "/usr/libexec/ibus-engine-foo --ibus", +- * NULL) ++ * IBusComponent *component = ibus_component_new_varargs ("name", "ibus-foo", ++ * "exec", "/usr/libexec/ibus-engine-foo --ibus", ++ * NULL) + */ +-IBusComponent *ibus_component_new2 (const gchar *first_property_name, ++IBusComponent *ibus_component_new_varargs (const gchar *first_property_name, + ...); + + /** +diff --git a/src/ibusenginedesc.c b/src/ibusenginedesc.c +index 8bcef34..1e6954c 100644 +--- a/src/ibusenginedesc.c ++++ b/src/ibusenginedesc.c +@@ -538,19 +538,19 @@ ibus_engine_desc_new (const gchar *name, + const gchar *icon, + const gchar *layout) + { +- return ibus_engine_desc_new2 ("name", name, +- "longname", longname, +- "description", description, +- "language", language, +- "license", license, +- "author", author, +- "icon", icon, +- "layout", layout, +- NULL); ++ return ibus_engine_desc_new_varargs ("name", name, ++ "longname", longname, ++ "description", description, ++ "language", language, ++ "license", license, ++ "author", author, ++ "icon", icon, ++ "layout", layout, ++ NULL); + } + + IBusEngineDesc * +-ibus_engine_desc_new2 (const gchar *first_property_name, ...) ++ibus_engine_desc_new_varargs (const gchar *first_property_name, ...) + { + va_list var_args; + IBusEngineDesc *desc; +diff --git a/src/ibusenginedesc.h b/src/ibusenginedesc.h +index d88b35a..c9dd1c2 100644 +--- a/src/ibusenginedesc.h ++++ b/src/ibusenginedesc.h +@@ -132,16 +132,16 @@ IBusEngineDesc *ibus_engine_desc_new (const gchar *name, + const gchar *layout); + + /** +- * ibus_engine_desc_new2: ++ * ibus_engine_desc_new_varargs: + * @first_property_name: Name of the first property. + * @Varargs: the NULL-terminated arguments of the properties and values. + * + * New a IBusEngineDesc. +- * ibus_engine_desc_new2() supports the va_list format. ++ * ibus_engine_desc_new_varargs() supports the va_list format. + * name property is required. e.g. +- * ibus_engine_desc_new2("name", "ibus-foo", "language", "us", NULL) ++ * ibus_engine_desc_new_varargs("name", "ibus-foo", "language", "us", NULL) + */ +-IBusEngineDesc *ibus_engine_desc_new2 (const gchar *first_property_name, ++IBusEngineDesc *ibus_engine_desc_new_varargs (const gchar *first_property_name, + ...); + + +diff --git a/bus/factoryproxy.c b/bus/factoryproxy.c +index f4e739d..130b881 100644 +--- a/bus/factoryproxy.c ++++ b/bus/factoryproxy.c +@@ -176,7 +176,8 @@ bus_factory_proxy_create_engine (BusFactoryProxy *factory, + g_variant_get (retval, "(&o)", &object_path); + GDBusConnection *connection = g_dbus_proxy_get_connection ((GDBusProxy *) factory); + BusEngineProxy *engine = bus_engine_proxy_new (object_path, +- desc, bus_connection_lookup (connection)); ++ desc, ++ bus_connection_lookup (connection)); + g_variant_unref (retval); + return engine; + } +diff --git a/src/ibusproperty.c b/src/ibusproperty.c +index 52a8210..bb9cc21 100644 +--- a/src/ibusproperty.c ++++ b/src/ibusproperty.c +@@ -243,7 +243,7 @@ ibus_property_set_icon (IBusProperty *prop, + g_assert (IBUS_IS_PROPERTY (prop)); + + g_free (prop->icon); +- prop->icon = g_strdup (icon); ++ prop->icon = g_strdup (icon != NULL ? icon : ""); + } + + void +diff --git a/ui/gtk/main.py b/ui/gtk/main.py +index 18bb12e..f4c901d 100644 +--- a/ui/gtk/main.py ++++ b/ui/gtk/main.py +@@ -56,7 +56,6 @@ class UIApplication: + "Please restart ibus input platform."), \ + "ibus") + self.__notify.set_timeout(10 * 1000) +- self.__notify.attach_to_status_icon (self.__panel.get_status_icon()) + self.__notify.add_action("restart", _("Restart Now"), self.__restart_cb, None) + self.__notify.add_action("ignore", _("Later"), lambda *args: None, None) + +diff --git a/client/x11/main.c b/client/x11/main.c +index c91a6d7..f3c835b 100644 +--- a/client/x11/main.c ++++ b/client/x11/main.c +@@ -245,7 +245,9 @@ _xim_preedit_callback_draw (XIMS xims, X11IC *x11ic, const gchar *preedit_string + text.feedback = feedback; + + if (len > 0) { +- Xutf8TextListToTextProperty (GDK_DISPLAY (), (char **)&preedit_string, 1, XCompoundTextStyle, &tp); ++ Xutf8TextListToTextProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), ++ (char **)&preedit_string, ++ 1, XCompoundTextStyle, &tp); + text.encoding_is_wchar = 0; + text.length = strlen ((char*)tp.value); + text.string.multi_byte = (char*)tp.value; +@@ -583,9 +585,9 @@ _xim_set_cursor_location (X11IC *x11ic) + XWindowAttributes xwa; + Window child; + +- XGetWindowAttributes (GDK_DISPLAY(), w, &xwa); ++ XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), w, &xwa); + if (preedit_area.x <= 0 && preedit_area.y <= 0) { +- XTranslateCoordinates (GDK_DISPLAY(), w, ++ XTranslateCoordinates (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), w, + xwa.root, + 0, + xwa.height, +@@ -594,7 +596,7 @@ _xim_set_cursor_location (X11IC *x11ic) + &child); + } + else { +- XTranslateCoordinates (GDK_DISPLAY(), w, ++ XTranslateCoordinates (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), w, + xwa.root, + preedit_area.x, + preedit_area.y, +@@ -739,11 +741,11 @@ _xim_forward_key_event (X11IC *x11ic, + xkp.xkey.serial = 0L; + xkp.xkey.send_event = False; + xkp.xkey.same_screen = True; +- xkp.xkey.display = GDK_DISPLAY(); ++ xkp.xkey.display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); + xkp.xkey.window = + x11ic->focus_window ? x11ic->focus_window : x11ic->client_window; + xkp.xkey.subwindow = None; +- xkp.xkey.root = DefaultRootWindow (GDK_DISPLAY()); ++ xkp.xkey.root = DefaultRootWindow (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); + + xkp.xkey.time = 0; + xkp.xkey.state = state; +@@ -781,7 +783,7 @@ _context_commit_text_cb (IBusInputContext *context, + XTextProperty tp; + IMCommitStruct cms = {0}; + +- Xutf8TextListToTextProperty (GDK_DISPLAY (), ++ Xutf8TextListToTextProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), + (gchar **)&(text->text), 1, XCompoundTextStyle, &tp); + + cms.major_code = XIM_COMMIT; +@@ -961,7 +963,7 @@ _xim_init_IMdkit () + sizeof (ims_encodings)/sizeof (XIMEncoding) - 1; + encodings.supported_encodings = ims_encodings; + +- _xims = IMOpenIM(GDK_DISPLAY(), ++ _xims = IMOpenIM(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), + IMModifiers, "Xi18n", + IMServerWindow, GDK_WINDOW_XWINDOW(win), + IMServerName, _server_name != NULL ? _server_name : "ibus", diff --git a/client/gtk3/ibusimcontext.c b/client/gtk3/ibusimcontext.c index 0bb71b5..c06faaa 100644 --- a/client/gtk3/ibusimcontext.c @@ -27,6 +337,3 @@ index 0bb71b5..c06faaa 100644 } gdk_window_get_origin (ibusimcontext->client_window, &x, &y); --- -1.7.2.1 - diff --git a/ibus.spec b/ibus.spec index d1e1e2e..93f8244 100644 --- a/ibus.spec +++ b/ibus.spec @@ -3,6 +3,7 @@ %{!?gtk3_binary_version: %define gtk3_binary_version %(pkg-config --variable=gtk_binary_version gtk+-3.0)} %define have_libxkbfile 1 +%define ibus_api_version 1.0 %define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999") %define gconf2_version 2.12.0 @@ -10,8 +11,8 @@ %define im_chooser_version 1.2.5 Name: ibus -Version: 1.3.8 -Release: 3%{?dist} +Version: 1.3.99.20101028 +Release: 1%{?dist} Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ Group: System Environment/Libraries @@ -19,14 +20,9 @@ URL: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz Source1: xinput-ibus Patch0: ibus-HEAD.patch -# Patch1: ibus-xx-va_list.patch -# Patch2: ibus-530711-preload-sys.patch -Patch3: ibus-541492-xkb.patch -Patch4: ibus-435880-surrounding-text.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=649058 -Patch5: notify.patch - +# Patch1: ibus-530711-preload-sys.patch +Patch2: ibus-541492-xkb.patch +Patch3: ibus-435880-surrounding-text.patch # WORKAROUND_GTK3_BUILD_FAILURE @ fedora14 Patch99: ibus-xx-workaround-gtk3.patch @@ -135,13 +131,11 @@ The ibus-devel-docs package contains developer documentation for ibus %prep %setup -q %patch0 -p1 -# %patch1 -p1 -b .valist -# %patch2 -p1 -b .preload-sys +# %patch1 -p1 -b .preload-sys %if %have_libxkbfile -%patch3 -p1 -b .xkb +%patch2 -p1 -b .xkb %endif -%patch4 -p1 -b .surrounding -%patch5 -p1 -b .notify +%patch3 -p1 -b .surrounding #### start WORKAROUND_GTK3_BUILD_FAILURE WORKAROUND_GTK3_BUILD_FAILURE=0 @@ -180,7 +174,7 @@ make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install -rm -f $RPM_BUILD_ROOT%{_libdir}/libibus.la +rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-%{ibus_api_version}.la rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.la rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.la @@ -188,15 +182,26 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf} # install .desktop files -echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus.desktop +# correct location in upstream. +if test ! -f $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop -a \ + -f $RPM_BUILD_ROOT%{_datadir}/applications/ibus.desktop ; then + mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart + mv $RPM_BUILD_ROOT%{_datadir}/applications/ibus.desktop \ + $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop +fi echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop echo "X-GNOME-Autostart-enabled=false" >> $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop +rm -rf $RPM_BUILD_ROOT%{_datadir}/applications/ibus.desktop +# workaround for desktop-file-install +sed -i -e 's|Comment\[ja\]=IBus |& |' \ + $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop desktop-file-install --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/* -%find_lang %{name} +# FIXME: no version number +%find_lang %{name}10 %clean rm -rf $RPM_BUILD_ROOT @@ -252,7 +257,8 @@ fi %postun gtk3 %{_bindir}/gtk-query-immodules-3.0-%{__isa_bits} --update-cache -%files -f %{name}.lang +# FIXME: no version number +%files -f %{name}10.lang %defattr(-,root,root,-) %doc AUTHORS COPYING README %dir %{python_sitelib}/ibus @@ -276,7 +282,7 @@ fi %files libs %defattr(-,root,root,-) -%{_libdir}/libibus.so.* +%{_libdir}/libibus-%{ibus_api_version}.so.* %{_libdir}/girepository-1.0/IBus-1.0.typelib %files gtk2 @@ -294,18 +300,17 @@ fi %{_includedir}/* %{_datadir}/gir-1.0/IBus-1.0.gir %{_datadir}/vala/vapi/ibus-1.0.vapi +%{_datadir}/vala/vapi/ibus-1.0.deps %files devel-docs %defattr(-,root,root,-) %{_datadir}/gtk-doc/html/* %changelog -* Wed Nov 3 2010 Matthias Clasen - 1.3.8-3 -- Rebuild against libnotify 0.7.0 - -* Tue Nov 02 2010 Takao Fujiwara - 1.3.8-2 -- Added ibus-HEAD.patch. - Fix Bug 640038 - unresolved reference to symbol gdk_drawable_get_size +* Fri Oct 29 2010 Takao Fujiwara - 1.3.99.20101028-1 +- Updated to 1.3.99.20101028 +- Integrated gdbus +- Merged notify.patch into ibus-HEAD.patch * Fri Oct 22 2010 Takao Fujiwara - 1.3.8-1 - Updated to 1.3.8 diff --git a/notify.patch b/notify.patch deleted file mode 100644 index f935f86..0000000 --- a/notify.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up ibus-1.3.8/ui/gtk/main.py.notify ibus-1.3.8/ui/gtk/main.py ---- ibus-1.3.8/ui/gtk/main.py.notify 2010-11-02 16:35:17.339180001 -0400 -+++ ibus-1.3.8/ui/gtk/main.py 2010-11-02 16:35:26.780180001 -0400 -@@ -58,7 +58,6 @@ class UIApplication: - "Please restart ibus input platform."), \ - "ibus") - self.__notify.set_timeout(10 * 1000) -- self.__notify.attach_to_status_icon (self.__panel.get_status_icon()) - self.__notify.add_action("restart", _("Restart Now"), self.__restart_cb, None) - self.__notify.add_action("ignore", _("Later"), lambda *args: None, None) - diff --git a/sources b/sources index 6e43bdb..ab7c645 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6d345268e3496f2e6be3a6f3a3ba19ea ibus-1.3.8.tar.gz +0e66622e7d5a35c0df96676322753f18 ibus-1.3.99.20101028.tar.gz