diff --git a/.gitignore b/.gitignore index da4714a..d744fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,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 +/ibus-1.3.99.20101118.tar.gz diff --git a/ibus-435880-surrounding-text.patch b/ibus-435880-surrounding-text.patch index a1fcaa0..841068c 100644 --- a/ibus-435880-surrounding-text.patch +++ b/ibus-435880-surrounding-text.patch @@ -1,6 +1,6 @@ -From d396da77a9174df65f42e5ebe5bb723cf3fd47ef Mon Sep 17 00:00:00 2001 +From e1316c38ca1b20c51c02d22517c54fcdcd42898e Mon Sep 17 00:00:00 2001 From: Daiki Ueno -Date: Mon, 22 Nov 2010 11:49:47 +0900 +Date: Mon, 22 Nov 2010 12:48:51 +0900 Subject: [PATCH] Support surrounding-text retrieval. This change adds a new API function ibus_engine_get_surrounding_text(). @@ -26,7 +26,7 @@ resets the current surrounding-text. bus/engineproxy.h | 4 + bus/inputcontext.c | 32 +++++++++ client/gtk2/ibusimcontext.c | 93 ++++++++++++++++++++++++--- - configure.ac | 15 +++++ + configure.ac | 14 ++++ ibus/engine.py | 6 ++ ibus/interface/iengine.py | 3 + ibus/interface/iinputcontext.py | 3 + @@ -35,15 +35,15 @@ resets the current surrounding-text. src/ibusinputcontext.c | 61 ++++++++++++++++++ src/ibusinputcontext.h | 11 +++ src/ibusmarshalers.list | 1 + - 13 files changed, 415 insertions(+), 12 deletions(-) + 13 files changed, 414 insertions(+), 12 deletions(-) diff --git a/bus/engineproxy.c b/bus/engineproxy.c index eb9412c..2955f71 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c -@@ -42,6 +42,10 @@ struct _BusEngineProxy { +@@ -41,6 +41,10 @@ struct _BusEngineProxy { + IBusKeymap *keymap; IBusPropList *prop_list; - /* private member */ + + /* surrounding text */ @@ -52,19 +52,20 @@ index eb9412c..2955f71 100644 }; struct _BusEngineProxyClass { -@@ -74,6 +78,8 @@ enum { +@@ -78,6 +82,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 (IBusProxy *proxy); - -@@ -287,11 +293,15 @@ bus_engine_proxy_class_init (BusEnginePr + static void bus_engine_proxy_set_property (BusEngineProxy *engine, + guint prop_id, +@@ -325,11 +331,16 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class) + G_TYPE_NONE, 1, IBUS_TYPE_PROPERTY); - ++ + text_empty = ibus_text_new_from_static_string (""); + g_object_ref_sink (text_empty); } @@ -77,7 +78,7 @@ index eb9412c..2955f71 100644 } static void -@@ -318,6 +328,11 @@ bus_engine_proxy_real_destroy (IBusProxy +@@ -388,6 +399,11 @@ bus_engine_proxy_real_destroy (IBusProxy *proxy) engine->keymap = NULL; } @@ -86,10 +87,10 @@ index eb9412c..2955f71 100644 + engine->surrounding_text = NULL; + } + - IBUS_PROXY_CLASS(bus_engine_proxy_parent_class)->destroy ((IBusProxy *)engine); + IBUS_PROXY_CLASS (bus_engine_proxy_parent_class)->destroy ((IBusProxy *)engine); } -@@ -641,6 +656,33 @@ void bus_engine_proxy_property_hide (Bus +@@ -861,6 +877,33 @@ void bus_engine_proxy_property_hide (BusEngineProxy *engine, NULL); } @@ -195,10 +196,10 @@ index b006ed4..7e425c7 100644 gint i; diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index 63d66c9..04ba818 100644 +index 63d66c9..f1f0d6e 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c -@@ -113,6 +113,12 @@ static void ibus_im_context_set_curs +@@ -106,6 +106,12 @@ static void ibus_im_context_set_cursor_location static void ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit); @@ -211,7 +212,7 @@ index 63d66c9..04ba818 100644 /* static methods*/ static void _create_input_context (IBusIMContext *context); -@@ -131,16 +137,16 @@ static void _slave_preedit_start_cb +@@ -124,14 +130,15 @@ static void _slave_preedit_start_cb (GtkIMContext *slave, IBusIMContext *context); static void _slave_preedit_end_cb (GtkIMContext *slave, IBusIMContext *context); @@ -229,13 +230,11 @@ index 63d66c9..04ba818 100644 + gint offset_from_cursor, + guint nchars, + IBusIMContext *context); - static void _create_fake_input_context (void); -- +static void _request_surrounding_text (IBusIMContext *context); - static GType _ibus_type_im_context = 0; -@@ -206,6 +212,17 @@ ibus_im_context_new (void) + static GtkIMContextClass *parent_class = NULL; +@@ -196,6 +203,17 @@ ibus_im_context_new (void) return IBUS_IM_CONTEXT (obj); } @@ -253,16 +252,16 @@ index 63d66c9..04ba818 100644 static gint _key_snooper_cb (GtkWidget *widget, GdkEventKey *event, -@@ -245,6 +262,8 @@ _key_snooper_cb (GtkWidget *widget, - _input_window = event->window; - } +@@ -223,6 +241,8 @@ _key_snooper_cb (GtkWidget *widget, + if (G_UNLIKELY (event->state & IBUS_IGNORED_MASK)) + return FALSE; + _request_surrounding_text (ibusimcontext); + switch (event->type) { case GDK_KEY_RELEASE: retval = ibus_input_context_process_key_event (ibuscontext, -@@ -291,6 +310,7 @@ ibus_im_context_class_init (IBusIMCo +@@ -269,6 +289,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; @@ -270,7 +269,7 @@ index 63d66c9..04ba818 100644 gobject_class->finalize = ibus_im_context_finalize; _signal_commit_id = -@@ -396,7 +416,11 @@ ibus_im_context_init (GObject *obj) +@@ -367,7 +388,11 @@ ibus_im_context_init (GObject *obj) ibusimcontext->ibuscontext = NULL; ibusimcontext->has_focus = FALSE; @@ -282,7 +281,7 @@ index 63d66c9..04ba818 100644 // Create slave im context -@@ -488,6 +512,8 @@ ibus_im_context_filter_keypress (GtkIMCo +@@ -459,6 +484,8 @@ 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); @@ -291,7 +290,7 @@ index 63d66c9..04ba818 100644 switch (event->type) { case GDK_KEY_RELEASE: retval = ibus_input_context_process_key_event (ibusimcontext->ibuscontext, -@@ -552,6 +578,8 @@ ibus_im_context_focus_in (GtkIMContext * +@@ -523,6 +550,8 @@ ibus_im_context_focus_in (GtkIMContext *context) g_object_weak_ref ((GObject *) context, _weak_notify_cb, NULL); _focus_im_context = context; } @@ -300,7 +299,7 @@ index 63d66c9..04ba818 100644 } static void -@@ -723,6 +751,39 @@ ibus_im_context_set_use_preedit (GtkIMCo +@@ -695,6 +724,39 @@ ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) } static void @@ -340,7 +339,7 @@ index 63d66c9..04ba818 100644 _bus_connected_cb (IBusBus *bus, IBusIMContext *ibusimcontext) { -@@ -741,6 +802,8 @@ _ibus_context_commit_text_cb (IBusInputC +@@ -710,6 +772,8 @@ _ibus_context_commit_text_cb (IBusInputContext *ibuscontext, IDEBUG ("%s", __FUNCTION__); g_signal_emit (ibusimcontext, _signal_commit_id, 0, text->text); @@ -349,7 +348,7 @@ index 63d66c9..04ba818 100644 } static gboolean -@@ -1013,6 +1076,8 @@ _ibus_context_show_preedit_text_cb (IBus +@@ -982,6 +1046,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); @@ -358,7 +357,7 @@ index 63d66c9..04ba818 100644 } static void -@@ -1178,17 +1243,21 @@ _slave_preedit_end_cb (GtkIMContext *sl +@@ -1146,17 +1212,21 @@ _slave_preedit_end_cb (GtkIMContext *slave, g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); } @@ -384,7 +383,7 @@ index 63d66c9..04ba818 100644 _slave_delete_surrounding_cb (GtkIMContext *slave, gint offset_from_cursor, guint nchars, -@@ -1197,9 +1266,10 @@ _slave_delete_surrounding_cb (GtkIMConte +@@ -1165,8 +1235,9 @@ _slave_delete_surrounding_cb (GtkIMContext *slave, gboolean return_value; if (ibusimcontext->enable && ibusimcontext->ibuscontext) { @@ -395,9 +394,8 @@ index 63d66c9..04ba818 100644 + return return_value; } - #ifdef OS_CHROMEOS diff --git a/configure.ac b/configure.ac -index ea0d32b..60776df 100644 +index ea0d32b..1347991 100644 --- a/configure.ac +++ b/configure.ac @@ -405,6 +405,19 @@ AC_ARG_WITH(no-snooper-apps, diff --git a/ibus-530711-preload-sys.patch b/ibus-530711-preload-sys.patch index 20a766c..7945daa 100644 --- a/ibus-530711-preload-sys.patch +++ b/ibus-530711-preload-sys.patch @@ -1,12 +1,12 @@ -From 8d29b30a2ad09a1e7cf840655e23018d41201436 Mon Sep 17 00:00:00 2001 +From 154582485a21da5c8ecf09ca500fc58f7400c7d4 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Fri, 12 Nov 2010 18:03:42 +0900 +Date: Fri, 26 Nov 2010 14:13:17 +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, users would prefer to load the system default engines again by login. The gconf value 'preload_engine_mode' is -IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE by default. +IBUS_PRELOAD_ENGINE_MODE_USER by default. If preload_engine_mode is IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE, ibus-daemon loads the system preload engines by langs. If preload_engine_mode is IBUS_PRELOAD_ENGINE_MODE_USER, @@ -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 | 80 +++++++++++++++++++++++++++++++++++++++++++------- - data/ibus.schemas.in | 13 ++++++++ - ibus/common.py | 4 ++ - setup/main.py | 47 ++++++++++++++++++++++++++--- - setup/setup.ui | 21 +++++++++++-- - src/ibustypes.h | 10 ++++++ - 6 files changed, 156 insertions(+), 19 deletions(-) + bus/ibusimpl.c | 228 +++++++++++++++++++++++++++++++++++--------------- + data/ibus.schemas.in | 13 +++ + ibus/common.py | 6 ++ + setup/main.py | 37 +++++++- + setup/setup.ui | 21 ++++- + src/ibustypes.h | 10 ++ + 6 files changed, 241 insertions(+), 74 deletions(-) diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c -index 80f0bf0..c0c1a8a 100644 +index b045d7f..eb353c2 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c -@@ -133,6 +133,9 @@ static void bus_ibus_impl_set_previous_engine +@@ -144,6 +144,9 @@ static void bus_ibus_impl_set_previous_engine static void bus_ibus_impl_set_preload_engines (BusIBusImpl *ibus, GVariant *value); @@ -40,50 +40,205 @@ index 80f0bf0..c0c1a8a 100644 static void bus_ibus_impl_set_use_sys_layout (BusIBusImpl *ibus, GVariant *value); -@@ -145,6 +148,9 @@ static void bus_ibus_impl_set_enable_by_default - static void bus_ibus_impl_set_use_global_engine - (BusIBusImpl *ibus, - GVariant *value); -+static void bus_ibus_impl_set_default_preload_engines -+ (BusIBusImpl *ibus, -+ gboolean force); - static void bus_ibus_impl_set_global_engine (BusIBusImpl *ibus, - BusEngineProxy *engine); - -@@ -343,6 +349,23 @@ bus_ibus_impl_set_preload_engines (BusIBusImpl *ibus, +@@ -264,6 +267,122 @@ _panel_destroy_cb (BusPanelProxy *panel, + g_object_unref (panel); } ++static gint ++_engine_desc_cmp (IBusEngineDesc *desc1, ++ IBusEngineDesc *desc2) ++{ ++ return - ((gint) ibus_engine_desc_get_rank (desc1)) + ++ ((gint) ibus_engine_desc_get_rank (desc2)); ++} ++ ++static gint ++_get_config_preload_engine_mode (BusIBusImpl *ibus) ++{ ++ GVariant *variant = NULL; ++ gint preload_engine_mode = IBUS_PRELOAD_ENGINE_MODE_USER; ++ ++ g_assert (BUS_IS_IBUS_IMPL (ibus)); ++ ++ if (ibus->config == NULL) { ++ return preload_engine_mode; ++ } ++ ++ variant = ibus_config_get_value (ibus->config, "general", ++ "preload_engine_mode"); ++ if (variant != NULL) { ++ if (g_variant_classify (variant) == G_VARIANT_CLASS_INT32) { ++ preload_engine_mode = g_variant_get_int32 (variant); ++ } ++ g_variant_unref (variant); ++ } ++ ++ return preload_engine_mode; ++} ++ ++static void ++_set_preload_engines (BusIBusImpl *ibus, ++ GVariant *value) ++{ ++ GList *engine_list = NULL; ++ ++ g_assert (BUS_IS_IBUS_IMPL (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); ++ const gchar *engine_name = NULL; ++ while (g_variant_iter_loop (&iter, "&s", &engine_name)) { ++ IBusEngineDesc *engine = bus_registry_find_engine_by_name (ibus->registry, engine_name); ++ if (engine == NULL || g_list_find (engine_list, engine) != NULL) ++ continue; ++ engine_list = g_list_append (engine_list, engine); ++ } ++ ++ if (engine_list != NULL && ++ ibus_config_get_value (ibus->config, "general", ++ "preload_engines") == NULL) { ++ ibus_config_set_value (ibus->config, "general", ++ "preload_engines", value); ++ } ++ } ++ ++ g_list_foreach (engine_list, (GFunc) g_object_ref, NULL); ++ ibus->engine_list = engine_list; ++ ++ if (ibus->engine_list) { ++ BusComponent *component = bus_component_from_engine_desc ((IBusEngineDesc *) ibus->engine_list->data); ++ if (component && !bus_component_is_running (component)) { ++ bus_component_start (component, g_verbose); ++ } ++ } ++ ++ bus_ibus_impl_update_engines_hotkey_profile (ibus); ++} ++ ++static void ++_set_language_relative_preload_engines (BusIBusImpl *ibus) ++{ ++ gchar *lang = NULL; ++ gchar *p = NULL; ++ GList *engines = NULL; ++ GList *list; ++ GVariantBuilder builder; ++ ++ g_assert (BUS_IS_IBUS_IMPL (ibus)); ++ ++ lang = g_strdup (setlocale (LC_ALL, NULL)); ++ p = index (lang, '.'); ++ if (p) { ++ *p = '\0'; ++ } ++ ++ engines = bus_registry_get_engines_by_language (ibus->registry, lang); ++ if (engines == NULL) { ++ p = index (lang, '_'); ++ if (p) { ++ *p = '\0'; ++ engines = bus_registry_get_engines_by_language (ibus->registry, lang); ++ } ++ } ++ g_free (lang); ++ ++ /* sort engines by rank */ ++ engines = g_list_sort (engines, (GCompareFunc) _engine_desc_cmp); ++ ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("as")); ++ for (list = engines; list != NULL; list = list->next) { ++ IBusEngineDesc *desc = (IBusEngineDesc *)list->data; ++ /* ignore engines with rank <== 0 */ ++ if (ibus_engine_desc_get_rank (desc) > 0) ++ g_variant_builder_add (&builder, "s", ibus_engine_desc_get_name (desc)); ++ } ++ _set_preload_engines (ibus, g_variant_builder_end (&builder)); ++ g_list_free (engines); ++} ++ static void + bus_ibus_impl_set_hotkey (BusIBusImpl *ibus, + GQuark hotkey, +@@ -347,34 +466,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); + +- if (value != NULL && g_variant_classify (value) == G_VARIANT_CLASS_ARRAY) { +- GVariantIter iter; +- g_variant_iter_init (&iter, value); +- const gchar *engine_name = NULL; +- while (g_variant_iter_loop (&iter, "&s", &engine_name)) { +- IBusEngineDesc *engine = bus_registry_find_engine_by_name (ibus->registry, engine_name); +- if (engine == NULL || g_list_find (engine_list, engine) != NULL) +- continue; +- engine_list = g_list_append (engine_list, engine); ++ if (preload_engine_mode == IBUS_PRELOAD_ENGINE_MODE_USER) { ++ if (value == NULL) { ++ _set_language_relative_preload_engines (ibus); ++ } else { ++ _set_preload_engines (ibus, value); + } + } ++} + +- g_list_foreach (engine_list, (GFunc) g_object_ref, NULL); +- ibus->engine_list = engine_list; ++static void +bus_ibus_impl_set_preload_engine_mode (BusIBusImpl *ibus, + GVariant *value) +{ -+ gint preload_engine_mode = IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE; -+ ++ gint preload_engine_mode = IBUS_PRELOAD_ENGINE_MODE_USER; + +- if (ibus->engine_list) { +- BusComponent *component = bus_component_from_engine_desc ((IBusEngineDesc *) ibus->engine_list->data); +- if (component && !bus_component_is_running (component)) { +- bus_component_start (component, g_verbose); +- } + if (value != NULL && g_variant_classify (value) == G_VARIANT_CLASS_INT32) { -+ preload_engine_mode = g_variant_get_int16 (value); -+ } -+ ++ preload_engine_mode = g_variant_get_int32 (value); + } + +- bus_ibus_impl_update_engines_hotkey_profile (ibus); + if (preload_engine_mode == IBUS_PRELOAD_ENGINE_MODE_USER) { + return; + } + -+ bus_ibus_impl_set_default_preload_engines (ibus, TRUE); -+} -+ -+static void - bus_ibus_impl_set_use_sys_layout (BusIBusImpl *ibus, - GVariant *value) - { -@@ -405,22 +428,48 @@ _engine_desc_cmp (IBusEngineDesc *desc1, - ((gint) ibus_engine_desc_get_rank (desc2)); ++ _set_language_relative_preload_engines (ibus); } -+/* bus_ibus_impl_set_use_sys_layout handles the gconf value + /** +@@ -452,69 +569,47 @@ bus_ibus_impl_set_use_global_engine (BusIBusImpl *ibus, + } + } + +-static gint +-_engine_desc_cmp (IBusEngineDesc *desc1, +- IBusEngineDesc *desc2) +-{ +- return - ((gint) ibus_engine_desc_get_rank (desc1)) + +- ((gint) ibus_engine_desc_get_rank (desc2)); +-} +- + /** + * bus_ibus_impl_set_default_preload_engines: + * +- * If the "preload_engines" config variable is not set yet, set the default value which is determined based on a current locale (LC_ALL). ++ * bus_ibus_impl_set_default_preload_engines handles the gconf value + * /desktop/ibus/general/preload_engines and preload_engine_mode. + * The idea is, if users don't customize the preload_engines with ibus-setup, + * users would prefer to load the system default engines again by login. + * The gconf value 'preload_engine_mode' is -+ * IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE by default. ++ * IBUS_PRELOAD_ENGINE_MODE_USER by default. + * If preload_engine_mode is IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE, + * ibus-daemon loads the system preload engines by langs. + * If preload_engine_mode is IBUS_PRELOAD_ENGINE_MODE_USER, @@ -94,45 +249,68 @@ index 80f0bf0..c0c1a8a 100644 + * 'preload_engines'. + * 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. -+ */ + */ static void --bus_ibus_impl_set_default_preload_engines (BusIBusImpl *ibus) -+bus_ibus_impl_set_default_preload_engines (BusIBusImpl *ibus, gboolean force) + bus_ibus_impl_set_default_preload_engines (BusIBusImpl *ibus) { - g_assert (BUS_IS_IBUS_IMPL (ibus)); - -+ GVariant *variant = NULL; +- g_assert (BUS_IS_IBUS_IMPL (ibus)); +- static gboolean done = FALSE; -+ gint preload_engine_mode = IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE; ++ gint preload_engine_mode = IBUS_PRELOAD_ENGINE_MODE_USER; ++ ++ g_assert (BUS_IS_IBUS_IMPL (ibus)); -- if (done || ibus->config == NULL) { -- return; -- } -+ if (!force) { -+ if (done || ibus->config == NULL) { -+ return; -+ } + if (done || ibus->config == NULL) { + return; + } - GVariant *variant = ibus_config_get_value (ibus->config, "general", "preload_engines"); - if (variant != NULL) { -- done = TRUE; -- g_variant_unref (variant); -- return; -+ variant = ibus_config_get_value (ibus->config, "general", -+ "preload_engine_mode"); -+ if (variant != NULL) { -+ preload_engine_mode = g_variant_get_int32 (variant); -+ g_variant_unref (variant); -+ } ++ preload_engine_mode = _get_config_preload_engine_mode (ibus); + -+ if (preload_engine_mode == IBUS_PRELOAD_ENGINE_MODE_USER) { -+ done = TRUE; -+ return; -+ } ++ if (preload_engine_mode == IBUS_PRELOAD_ENGINE_MODE_USER) { + done = TRUE; +- g_variant_unref (variant); + return; } done = TRUE; -@@ -466,6 +515,7 @@ const static struct { +- gchar *lang = g_strdup (setlocale (LC_ALL, NULL)); +- gchar *p = index (lang, '.'); +- if (p) { +- *p = '\0'; +- } +- +- GList *engines = bus_registry_get_engines_by_language (ibus->registry, lang); +- if (engines == NULL) { +- p = index (lang, '_'); +- if (p) { +- *p = '\0'; +- engines = bus_registry_get_engines_by_language (ibus->registry, lang); +- } +- } +- g_free (lang); +- +- /* sort engines by rank */ +- engines = g_list_sort (engines, (GCompareFunc) _engine_desc_cmp); +- +- GVariantBuilder builder; +- g_variant_builder_init (&builder, G_VARIANT_TYPE ("as")); +- GList *list; +- for (list = engines; list != NULL; list = list->next) { +- IBusEngineDesc *desc = (IBusEngineDesc *) list->data; +- /* ignore engines with rank <= 0 */ +- 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)); +- g_list_free (engines); ++ _set_language_relative_preload_engines (ibus); + } + + /* The list of config entries that are related to ibus-daemon. */ +@@ -527,6 +622,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 }, @@ -140,37 +318,8 @@ index 80f0bf0..c0c1a8a 100644 { "general", "use_system_keyboard_layout", bus_ibus_impl_set_use_sys_layout }, { "general", "use_global_engine", bus_ibus_impl_set_use_global_engine }, { "general", "embed_preedit_text", bus_ibus_impl_set_embed_preedit_text }, -@@ -480,10 +530,18 @@ bus_ibus_impl_reload_config (BusIBusImpl *ibus) - gint i; - for (i = 0; i < G_N_ELEMENTS (bus_ibus_impl_config_items); i++) { - GVariant *variant = NULL; -- if (ibus->config != NULL) -+ -+ if (g_strcmp0 (bus_ibus_impl_config_items[i].section, "general") == 0 && -+ g_strcmp0 (bus_ibus_impl_config_items[i].key, "preload_engine_mode") == 0) { -+ continue; -+ } -+ -+ if (ibus->config != NULL) { - variant = ibus_config_get_value (ibus->config, - bus_ibus_impl_config_items[i].section, - bus_ibus_impl_config_items[i].key); -+ } -+ - bus_ibus_impl_config_items[i].func (ibus, variant); - if (variant) g_variant_unref (variant); - } -@@ -603,7 +661,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, - G_CALLBACK (_config_destroy_cb), - ibus); - -- bus_ibus_impl_set_default_preload_engines (ibus); -+ bus_ibus_impl_set_default_preload_engines (ibus, FALSE); - bus_ibus_impl_reload_config (ibus); - } - } diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index aa66aa5..5956171 100644 +index aa66aa5..9b82857 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in @@ -13,6 +13,19 @@ @@ -185,8 +334,8 @@ index aa66aa5..5956171 100644 + + Preload engine mode + Preload engines are loaded with this mode. -+ 0 = language related engines. -+ 1 = user customized engines. ++ 0 = user customized engines. ++ 1 = language related engines. + + + @@ -194,39 +343,40 @@ index aa66aa5..5956171 100644 /desktop/ibus/general/hotkey/trigger ibus diff --git a/ibus/common.py b/ibus/common.py -index cbc8d56..3598546 100644 +index cbc8d56..db881fc 100644 --- a/ibus/common.py +++ b/ibus/common.py -@@ -133,6 +133,10 @@ ORIENTATION_HORIZONTAL = 0 +@@ -33,6 +33,8 @@ __all__ = ( + "ORIENTATION_HORIZONTAL", + "ORIENTATION_VERTICAL", + "ORIENTATION_SYSTEM", ++ "PRELOAD_ENGINE_MODE_USER", ++ "PRELOAD_ENGINE_MODE_LANG_RELATIVE", + "default_reply_handler", + "default_error_handler", + "DEFAULT_ASYNC_HANDLERS", +@@ -133,6 +135,10 @@ ORIENTATION_HORIZONTAL = 0 ORIENTATION_VERTICAL = 1 ORIENTATION_SYSTEM = 2 +# define preload engine mode -+PRELOAD_ENGINE_MODE_LANG_RELATIVE = 0 -+PRELOAD_ENGINE_MODE_USER = 1 ++PRELOAD_ENGINE_MODE_USER = 0 ++PRELOAD_ENGINE_MODE_LANG_RELATIVE = 1 + def default_reply_handler( *args): pass diff --git a/setup/main.py b/setup/main.py -index 98fa1d1..77fdfb3 100644 +index 96e9456..215670d 100644 --- a/setup/main.py +++ b/setup/main.py -@@ -91,6 +91,7 @@ class Setup(object): - # keyboard shortcut - # trigger - self.__config = self.__bus.get_config() -+ self.__config.connect("value-changed", self.__config_value_changed_cb) - shortcuts = self.__config.get_value( - "general/hotkey", "trigger", - ibus.CONFIG_GENERAL_SHORTCUT_TRIGGER_DEFAULT) -@@ -190,15 +191,25 @@ class Setup(object): +@@ -190,15 +190,22 @@ class Setup(object): self.__checkbutton_use_global_engine.connect("toggled", self.__checkbutton_use_global_engine_toggled_cb) # init engine page + preload_engine_mode = self.__config.get_value("general", + "preload_engine_mode", -+ ibus.common.PRELOAD_ENGINE_MODE_LANG_RELATIVE) ++ ibus.common.PRELOAD_ENGINE_MODE_USER) + button = self.__builder.get_object("checkbutton_preload_engine_mode") + if preload_engine_mode == ibus.common.PRELOAD_ENGINE_MODE_USER: + button.set_active(True) @@ -235,8 +385,6 @@ index 98fa1d1..77fdfb3 100644 + button.set_active(False) + self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(False) + button.connect("toggled", self.__checkbutton_preload_engine_mode_toggled_cb) -+ self.__wait_update_preload_engines = False -+ self.__engines = self.__bus.list_engines() self.__combobox = self.__builder.get_object("combobox_engines") self.__combobox.set_engines(self.__engines) @@ -244,13 +392,13 @@ index 98fa1d1..77fdfb3 100644 - tmp_dict = {} - for e in self.__engines: - tmp_dict[e.name] = e - engine_names = self.__config.get_value("general", "preload_engines", []) +- engine_names = self.__config.get_value("general", "preload_engines", []) - engines = [tmp_dict[name] for name in engine_names if name in tmp_dict] -+ engines = self.__get_engine_descs_from_names(engine_names) ++ engines = self.__bus.list_active_engines() self.__treeview = self.__builder.get_object("treeview_engines") self.__treeview.set_engines(engines) -@@ -240,6 +251,13 @@ class Setup(object): +@@ -240,6 +247,13 @@ class Setup(object): engine_names = map(lambda e: e.name, engines) self.__config.set_list("general", "preload_engines", engine_names, "s") @@ -264,7 +412,7 @@ index 98fa1d1..77fdfb3 100644 def __button_engine_add_cb(self, button): engine = self.__combobox.get_active_engine() self.__treeview.append_engine(engine) -@@ -251,6 +269,19 @@ class Setup(object): +@@ -251,6 +265,19 @@ class Setup(object): about.run() about.destroy() @@ -274,31 +422,16 @@ index 98fa1d1..77fdfb3 100644 + "preload_engine_mode", + ibus.common.PRELOAD_ENGINE_MODE_USER) + self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(True) ++ self.__treeview.notify("engines") + else: + self.__config.set_value("general", + "preload_engine_mode", + ibus.common.PRELOAD_ENGINE_MODE_LANG_RELATIVE) + self.__builder.get_object("hbox_customize_active_input_methods").set_sensitive(False) -+ self.__wait_update_preload_engines = True + def __init_bus(self): try: self.__bus = ibus.Bus() -@@ -441,7 +472,13 @@ class Setup(object): - self.__config.set_value("general", "use_global_engine", value) - - def __config_value_changed_cb(self, bus, section, name, value): -- pass -+ if section == "general": -+ if name == "preload_engines": -+ if self.__wait_update_preload_engines: -+ engines = self.__get_engine_descs_from_names(value) -+ self.__treeview.set_engines(engines) -+ # treeview update gconf value again -+ self.__wait_update_preload_engines = False - - def __config_reloaded_cb(self, bus): - pass diff --git a/setup/setup.ui b/setup/setup.ui index 0e31a78..ef841a0 100644 --- a/setup/setup.ui @@ -346,7 +479,7 @@ index 0e31a78..ef841a0 100644 diff --git a/src/ibustypes.h b/src/ibustypes.h -index 035d124..dd3806d 100644 +index 035d124..0a9d7b2 100644 --- a/src/ibustypes.h +++ b/src/ibustypes.h @@ -144,6 +144,16 @@ typedef enum { @@ -354,12 +487,12 @@ index 035d124..dd3806d 100644 /** + * IBusPreloadEngineMode: -+ * @IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE: language related engines. + * @IBUS_PRELOAD_ENGINE_MODE_USER: user custimized engines ++ * @IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE: language related engines. + */ +typedef enum { -+ IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE = 0, -+ IBUS_PRELOAD_ENGINE_MODE_USER = 1, ++ IBUS_PRELOAD_ENGINE_MODE_USER = 0, ++ IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE = 1, +} IBusPreloadEngineMode; + +/** diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch index 57e3e58..e2d10fd 100644 --- a/ibus-541492-xkb.patch +++ b/ibus-541492-xkb.patch @@ -1,6 +1,6 @@ -From cfe234ad9bd771efaa1ba5a52e31a68b3d25e477 Mon Sep 17 00:00:00 2001 +From 4bac7696cf277414eba7b166fcd8dbfabe8f9e6f Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Thu, 4 Nov 2010 17:40:30 +0900 +Date: Mon, 22 Nov 2010 11:39:27 +0900 Subject: [PATCH] Add XKB layouts --- @@ -11,7 +11,7 @@ Subject: [PATCH] Add XKB layouts ibus/__init__.py | 2 + ibus/bus.py | 3 + ibus/interface/iibus.py | 3 + - ibus/xkblayout.py.in | 185 ++++++++++++ + ibus/xkblayout.py.in | 190 ++++++++++++ ibus/xkbxml.py.in | 412 ++++++++++++++++++++++++++ setup/Makefile.am | 1 + setup/enginecombobox.py | 7 +- @@ -24,14 +24,14 @@ Subject: [PATCH] Add XKB layouts xkb/Makefile.am | 104 +++++++ xkb/ibus-engine-xkb-main.c | 397 +++++++++++++++++++++++++ xkb/ibus-engine-xkb-main.h | 46 +++ - xkb/ibus-xkb-main.c | 101 +++++++ + xkb/ibus-xkb-main.c | 105 +++++++ xkb/xkblayout.xml.in | 16 + xkb/xkblayoutconfig.xml.in | 6 + xkb/xkblib.c | 297 +++++++++++++++++++ xkb/xkblib.h | 40 +++ xkb/xkbxml.c | 696 ++++++++++++++++++++++++++++++++++++++++++++ xkb/xkbxml.h | 189 ++++++++++++ - 27 files changed, 3749 insertions(+), 6 deletions(-) + 27 files changed, 3758 insertions(+), 6 deletions(-) create mode 100644 ibus/xkblayout.py.in create mode 100644 ibus/xkbxml.py.in create mode 100644 setup/xkbsetup.py @@ -72,7 +72,7 @@ index 02b7163..6cbe82a 100644 $(NULL) diff --git a/configure.ac b/configure.ac -index 2c330fa..181490c 100644 +index 1a1e663..ea0d32b 100644 --- a/configure.ac +++ b/configure.ac @@ -185,6 +185,57 @@ else @@ -150,10 +150,10 @@ index 2c330fa..181490c 100644 Build gconf modules $enable_gconf Build memconf modules $enable_memconf diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index f818635..f3f567b 100644 +index 5956171..322f831 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in -@@ -184,6 +184,42 @@ +@@ -180,6 +180,42 @@ @@ -280,7 +280,7 @@ index e63caa3..8b7b6f7 100644 diff --git a/ibus/xkblayout.py.in b/ibus/xkblayout.py.in new file mode 100644 -index 0000000..0503f35 +index 0000000..63d4327 --- /dev/null +++ b/ibus/xkblayout.py.in @@ -0,0 +1,190 @@ @@ -936,7 +936,7 @@ index 2fd8876..7383177 100644 + self.__title = title diff --git a/setup/main.py b/setup/main.py -index 8191282..afc4ca1 100644 +index 92a2398..1912e20 100644 --- a/setup/main.py +++ b/setup/main.py @@ -37,6 +37,7 @@ from gtk import gdk @@ -944,10 +944,10 @@ index 8191282..afc4ca1 100644 from enginetreeview import EngineTreeView from engineabout import EngineAbout +from xkbsetup import XKBSetup - from i18n import _, N_, init + from i18n import DOMAINNAME, _, N_, init as i18n_init ( -@@ -224,6 +225,8 @@ class Setup(object): +@@ -229,6 +230,8 @@ class Setup(object): self.__combobox.connect("notify::active-engine", self.__combobox_notify_active_engine_cb) self.__treeview.connect("notify", self.__treeview_notify_cb) @@ -957,7 +957,7 @@ index 8191282..afc4ca1 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 82a2101..19f36c8 100644 +index ef841a0..71f723d 100644 --- a/setup/setup.ui +++ b/setup/setup.ui @@ -129,7 +129,6 @@ @@ -984,7 +984,7 @@ index 82a2101..19f36c8 100644 True False True -@@ -780,6 +777,7 @@ You may use up/down buttons to change it.</i></small> +@@ -744,6 +741,7 @@ You may use up/down buttons to change it.</i></small> True vertical 6 @@ -992,7 +992,7 @@ index 82a2101..19f36c8 100644 Use system keyboard layout -@@ -795,6 +793,57 @@ You may use up/down buttons to change it.</i></small> +@@ -812,6 +810,57 @@ You may use up/down buttons to change it.</i></small> 0 @@ -1050,7 +1050,7 @@ index 82a2101..19f36c8 100644 -@@ -993,4 +1042,558 @@ Homepage: http://code.google.com/p/ibus +@@ -957,4 +1006,558 @@ Homepage: http://code.google.com/p/ibus @@ -2804,7 +2804,7 @@ index 0000000..8007631 +#endif diff --git a/xkb/ibus-xkb-main.c b/xkb/ibus-xkb-main.c new file mode 100644 -index 0000000..0919913 +index 0000000..9db7d0a --- /dev/null +++ b/xkb/ibus-xkb-main.c @@ -0,0 +1,105 @@ diff --git a/ibus-652157-x11-ppc64.patch b/ibus-652157-x11-ppc64.patch deleted file mode 100644 index 4f1b0c0..0000000 --- a/ibus-652157-x11-ppc64.patch +++ /dev/null @@ -1,29 +0,0 @@ -From cd7385f4cc1e729891bd878db12dfafad397b098 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 11 Nov 2010 18:09:52 +0900 -Subject: [PATCH] Always read Window as 32 bits integer to fix problem in ppc64. - ---- - client/x11/main.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/client/x11/main.c b/client/x11/main.c -index c91a6d7..be9cb0e 100644 ---- a/client/x11/main.c -+++ b/client/x11/main.c -@@ -277,10 +277,10 @@ _xim_store_ic_values (X11IC *x11ic, IMChangeICStruct *call_data) - x11ic->input_style = *(gint32 *) ic_attr->value; - } - else if (g_strcmp0 (XNClientWindow, ic_attr->name) == 0) { -- x11ic->client_window = *(Window *) call_data->ic_attr[i].value; -+ x11ic->client_window = (Window)(*(CARD32 *) call_data->ic_attr[i].value); - } - else if (g_strcmp0 (XNFocusWindow, ic_attr->name) == 0) { -- x11ic->focus_window = *(Window *) call_data->ic_attr[i].value; -+ x11ic->focus_window = (Window)(*(CARD32 *) call_data->ic_attr[i].value); - } - else { - LOG (1, "Unknown ic attribute: %s", ic_attr->name); --- -1.7.2.1 - diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index 6106f3b..8b13789 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -1,415 +1 @@ ---- 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 -+++ b/client/gtk3/ibusimcontext.c -@@ -669,10 +669,15 @@ _set_cursor_location_internal (GtkIMContext *context) - - area = ibusimcontext->cursor_area; - if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { -+#if GTK_CHECK_VERSION (2, 91, 0) -+ area.x = 0; -+ area.y += gdk_window_get_height (ibusimcontext->client_window); -+#else - gint w, h; - gdk_drawable_get_size (ibusimcontext->client_window, &w, &h); - area.y += h; - area.x = 0; -+#endif - } - - gdk_window_get_origin (ibusimcontext->client_window, &x, &y); -diff --git a/configure.ac b/configure.ac -index 2c330fa..a9cd908 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -21,10 +21,6 @@ - # Boston, MA 02111-1307 USA - AC_PREFEQ([2.62]) - --AC_INIT([ibus], [ibus_version], -- [http://code.google.com/p/ibus/issues/entry], -- [ibus]) -- - AC_CONFIG_HEADERS([config.h]) - AC_CONFIG_MACRO_DIR([m4]) - -@@ -46,6 +42,10 @@ m4_define([ibus_api_version], [1.0]) - m4_define([glib_required_version], [2.26.0]) - - -+AC_INIT([ibus], [ibus_version], -+ [http://code.google.com/p/ibus/issues/entry], -+ [ibus]) -+ - # Init automake - AM_INIT_AUTOMAKE([1.10]) - AM_MAINTAINER_MODE([enable]) -diff --git a/setup/main.py b/setup/main.py -index 978b467..98fa1d1 100644 ---- a/setup/main.py -+++ b/setup/main.py -@@ -69,7 +69,7 @@ class Setup(object): - super(Setup, self).__init__() - gtk_builder_file = path.join(path.dirname(__file__), "./setup.ui") - self.__builder = gtk.Builder() -- self.__builder.set_translation_domain("ibus") -+ self.__builder.set_translation_domain("ibus10") - self.__builder.add_from_file(gtk_builder_file); - self.__bus = None - self.__init_bus() ---- ibus/setup/engineabout.py.orig 2010-11-16 17:53:20.970390287 +0900 -+++ ibus/setup/engineabout.py 2010-11-16 17:53:44.781344317 +0900 -@@ -25,7 +25,7 @@ from gtk import gdk - import pango - import ibus - --from i18n import * -+from i18n import _, N_ - - class EngineAbout(gtk.Dialog): - def __init__(self, enginedesc): -diff --git a/ui/gtk/engineabout.py b/ui/gtk/engineabout.py -index 3ac853a..a34e930 100644 ---- a/ui/gtk/engineabout.py -+++ b/ui/gtk/engineabout.py -@@ -25,7 +25,7 @@ from gtk import gdk - import pango - import ibus - --from i18n import * -+from i18n import _, N_ - - class EngineAbout(gtk.Dialog): - def __init__(self, enginedesc): -diff --git a/bus/inputcontext.c b/bus/inputcontext.c -index ec72dd1..87fa162 100644 ---- a/bus/inputcontext.c -+++ b/bus/inputcontext.c -@@ -698,7 +698,7 @@ _ic_process_key_event (BusInputContext *context, - if (G_UNLIKELY (!context->has_focus)) { - /* workaround: set focus if context does not have focus */ - BusInputContext *focused_context = bus_ibus_impl_get_focused_input_context (BUS_DEFAULT_IBUS); -- if (context == NULL || -+ if (focused_context == NULL || - focused_context->fake == TRUE || - context->fake == FALSE) { - /* grab focus, if context is a real IC or current focused IC is fake */ + diff --git a/ibus-xx-workaround-gtk3.patch b/ibus-xx-workaround-gtk3.patch deleted file mode 100644 index fde6229..0000000 --- a/ibus-xx-workaround-gtk3.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ibus-1.3.7/client/gtk3/ibusim.c.orig 2010-10-07 15:26:58.572225337 +0900 -+++ ibus-1.3.7/client/gtk3/ibusim.c 2010-10-07 15:33:04.881225883 +0900 -@@ -20,6 +20,12 @@ - */ - - #include -+#define WORKAROUND_GTK3_BUILD_FAILURE 1 -+#ifdef WORKAROUND_GTK3_BUILD_FAILURE -+#include -+typedef struct _GObject GApplication; -+typedef struct _GObjectClass GApplicationClass; -+#endif - #include - #include - #include ---- ibus-1.3.7/client/gtk3/ibusimcontext.c.gtk3 2010-10-07 15:33:47.128225657 +0900 -+++ ibus-1.3.7/client/gtk3/ibusimcontext.c 2010-10-07 15:35:00.708225606 +0900 -@@ -23,6 +23,12 @@ - # include - #endif - -+#define WORKAROUND_GTK3_BUILD_FAILURE 1 -+#ifdef WORKAROUND_GTK3_BUILD_FAILURE -+#include -+typedef struct _GObject GApplication; -+typedef struct _GObjectClass GApplicationClass; -+#endif - #include - #include - #include diff --git a/ibus.spec b/ibus.spec index bae5bec..a48282c 100644 --- a/ibus.spec +++ b/ibus.spec @@ -11,21 +11,18 @@ %define im_chooser_version 1.2.5 Name: ibus -Version: 1.3.99.20101028 -Release: 6%{?dist} +Version: 1.3.99.20101118 +Release: 1%{?dist} Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ Group: System Environment/Libraries 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-652157-x11-ppc64.patch -Patch2: ibus-530711-preload-sys.patch -Patch3: ibus-541492-xkb.patch -Patch4: ibus-435880-surrounding-text.patch -# WORKAROUND_GTK3_BUILD_FAILURE @ fedora14 -Patch99: ibus-xx-workaround-gtk3.patch +# Patch0: ibus-HEAD.patch +Patch1: ibus-530711-preload-sys.patch +Patch2: ibus-541492-xkb.patch +Patch3: ibus-435880-surrounding-text.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -131,29 +128,12 @@ The ibus-devel-docs package contains developer documentation for ibus %prep %setup -q -%patch0 -p1 -%patch1 -p1 -b .ppc64 -%patch2 -p1 -b .preload-sys +# %patch0 -p1 +%patch1 -p1 -b .preload-sys %if %have_libxkbfile -%patch3 -p1 -b .xkb +%patch2 -p1 -b .xkb %endif -%patch4 -p1 -b .surrounding - -#### start WORKAROUND_GTK3_BUILD_FAILURE -WORKAROUND_GTK3_BUILD_FAILURE=0 -pkg-config --print-requires gtk+-3.0 | grep -q gio-2.0 -if test $? -eq 0; then - if test -f /usr/include/gtk-3.0/gtk/gtkapplication.h -a \ - ! -f /usr/include/glib-2.0/gio/gapplication.h ; then - WORKAROUND_GTK3_BUILD_FAILURE=1 - fi -fi -if test $WORKAROUND_GTK3_BUILD_FAILURE -eq 1 ; then - printf "#### ERROR: glib2 is old against gtk3\n" - printf "#### Applying a workaround\n" -%patch99 -p1 -b .ugly-hack -fi -#### end WORKAROUND_GTK3_BUILD_FAILURE +%patch3 -p1 -b .surrounding %build %if %have_libxkbfile @@ -311,20 +291,10 @@ fi %{_datadir}/gtk-doc/html/* %changelog -* Mon Nov 22 2010 Takao Fujiwara - 1.3.99.20101028-6 -- Added ibus-652157-x11-ppc64.patch - Fixed Bug 652157 - Window position of ibus-x11 in ppc64 +* Fri Nov 26 2010 Takao Fujiwara - 1.3.99.20101118-1 +- Updated to 1.3.99.20101118 - Added ibus-530711-preload-sys.patch Fixed Bug 530711 - Reload preloaded engines by login -- Updated ibus-HEAD.patch - Fixed ibus.get_version & gettext domain for gtkbuilder - Fixed undefined '_' in EngineAbout - Fixed Bug 654260 - NULL of focused input context -- Applied no-snooper for 'gnome-do,Do.*,firefox.*,.*chrome.*,.*chromium.*' -- Updated ibus-541492-xkb.patch - Fixed Bug 653806 - ibus-xkb SEGV -- Updated ibus-435880-surrounding-text.patch - Fixed Bug 639253 - ibus_engine_delete_surrounding_text with offset. * Fri Oct 29 2010 Takao Fujiwara - 1.3.99.20101028-1 - Updated to 1.3.99.20101028 diff --git a/sources b/sources index ab7c645..5e971ee 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0e66622e7d5a35c0df96676322753f18 ibus-1.3.99.20101028.tar.gz +b8a7fb91ae719e9b0bfdb2a09d5d1691 ibus-1.3.99.20101118.tar.gz