<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>bindings/Makefile.am</filename>
    </added>
    <added>
      <filename>bindings/python/Makefile.am</filename>
    </added>
    <added>
      <filename>bindings/python/common.h</filename>
    </added>
    <added>
      <filename>bindings/python/gendefs.sh</filename>
    </added>
    <added>
      <filename>bindings/python/ibus-types.defs</filename>
    </added>
    <added>
      <filename>bindings/python/ibus-virtual-methods.defs</filename>
    </added>
    <added>
      <filename>bindings/python/ibus.defs</filename>
    </added>
    <added>
      <filename>bindings/python/ibus.override</filename>
    </added>
    <added>
      <filename>bindings/python/ibusmodule.c</filename>
    </added>
    <added>
      <filename>bus/.gitignore</filename>
    </added>
    <added>
      <filename>bus/Makefile.am</filename>
    </added>
    <added>
      <filename>bus/connection.c</filename>
    </added>
    <added>
      <filename>bus/connection.h</filename>
    </added>
    <added>
      <filename>bus/dbusimpl.c</filename>
    </added>
    <added>
      <filename>bus/dbusimpl.h</filename>
    </added>
    <added>
      <filename>bus/engineproxy.c</filename>
    </added>
    <added>
      <filename>bus/engineproxy.h</filename>
    </added>
    <added>
      <filename>bus/factoryproxy.c</filename>
    </added>
    <added>
      <filename>bus/factoryproxy.h</filename>
    </added>
    <added>
      <filename>bus/ibusimpl.c</filename>
    </added>
    <added>
      <filename>bus/ibusimpl.h</filename>
    </added>
    <added>
      <filename>bus/inputcontext.c</filename>
    </added>
    <added>
      <filename>bus/inputcontext.h</filename>
    </added>
    <added>
      <filename>bus/main.c</filename>
    </added>
    <added>
      <filename>bus/matchrule.c</filename>
    </added>
    <added>
      <filename>bus/matchrule.h</filename>
    </added>
    <added>
      <filename>bus/panelproxy.c</filename>
    </added>
    <added>
      <filename>bus/panelproxy.h</filename>
    </added>
    <added>
      <filename>bus/registry.c</filename>
    </added>
    <added>
      <filename>bus/registry.h</filename>
    </added>
    <added>
      <filename>bus/server.c</filename>
    </added>
    <added>
      <filename>bus/server.h</filename>
    </added>
    <added>
      <filename>bus/test-matchrule.c</filename>
    </added>
    <added>
      <filename>bus/test-registry.c</filename>
    </added>
    <added>
      <filename>client/x11/.gitignore</filename>
    </added>
    <added>
      <filename>docs/Makefile.am</filename>
    </added>
    <added>
      <filename>docs/reference/Makefile.am</filename>
    </added>
    <added>
      <filename>docs/reference/ibus/.gitignore</filename>
    </added>
    <added>
      <filename>docs/reference/ibus/Makefile.am</filename>
    </added>
    <added>
      <filename>docs/reference/ibus/ibus.types</filename>
    </added>
    <added>
      <filename>gconf/.gitignore</filename>
    </added>
    <added>
      <filename>gconf/config.c</filename>
    </added>
    <added>
      <filename>gconf/gconf.xml.in</filename>
    </added>
    <added>
      <filename>gconf/main.c</filename>
    </added>
    <added>
      <filename>ibus-1.0.pc.in</filename>
    </added>
    <added>
      <filename>ibus/.gitignore</filename>
    </added>
    <added>
      <filename>ibus/_gtk.py</filename>
    </added>
    <added>
      <filename>ibus/component.py</filename>
    </added>
    <added>
      <filename>ibus/enginedesc.py</filename>
    </added>
    <added>
      <filename>ibus/inputcontext.py</filename>
    </added>
    <added>
      <filename>ibus/interface/iinputcontext.py</filename>
    </added>
    <added>
      <filename>ibus/observedpath.py</filename>
    </added>
    <added>
      <filename>ibus/serializable.py</filename>
    </added>
    <added>
      <filename>ibus/text.py</filename>
    </added>
    <added>
      <filename>setup/enginecombobox.py</filename>
    </added>
    <added>
      <filename>setup/enginetreeview.py</filename>
    </added>
    <added>
      <filename>setup/icon.py</filename>
    </added>
    <added>
      <filename>src/.gitignore</filename>
    </added>
    <added>
      <filename>src/Makefile.am</filename>
    </added>
    <added>
      <filename>src/ibus.h</filename>
    </added>
    <added>
      <filename>src/ibusattribute.c</filename>
    </added>
    <added>
      <filename>src/ibusattribute.h</filename>
    </added>
    <added>
      <filename>src/ibusbus.c</filename>
    </added>
    <added>
      <filename>src/ibusbus.h</filename>
    </added>
    <added>
      <filename>src/ibuscomponent.c</filename>
    </added>
    <added>
      <filename>src/ibuscomponent.h</filename>
    </added>
    <added>
      <filename>src/ibusconfig.c</filename>
    </added>
    <added>
      <filename>src/ibusconfig.h</filename>
    </added>
    <added>
      <filename>src/ibusconfigprivate.h</filename>
    </added>
    <added>
      <filename>src/ibusconfigservice.c</filename>
    </added>
    <added>
      <filename>src/ibusconfigservice.h</filename>
    </added>
    <added>
      <filename>src/ibusconnection.c</filename>
    </added>
    <added>
      <filename>src/ibusconnection.h</filename>
    </added>
    <added>
      <filename>src/ibusdebug.h</filename>
    </added>
    <added>
      <filename>src/ibusengine.c</filename>
    </added>
    <added>
      <filename>src/ibusengine.h</filename>
    </added>
    <added>
      <filename>src/ibusenginedesc.c</filename>
    </added>
    <added>
      <filename>src/ibusenginedesc.h</filename>
    </added>
    <added>
      <filename>src/ibusenumtypes.c</filename>
    </added>
    <added>
      <filename>src/ibusenumtypes.c.template</filename>
    </added>
    <added>
      <filename>src/ibusenumtypes.h</filename>
    </added>
    <added>
      <filename>src/ibusenumtypes.h.template</filename>
    </added>
    <added>
      <filename>src/ibuserror.c</filename>
    </added>
    <added>
      <filename>src/ibuserror.h</filename>
    </added>
    <added>
      <filename>src/ibusfactory.c</filename>
    </added>
    <added>
      <filename>src/ibusfactory.h</filename>
    </added>
    <added>
      <filename>src/ibushotkey.c</filename>
    </added>
    <added>
      <filename>src/ibushotkey.h</filename>
    </added>
    <added>
      <filename>src/ibusinputcontext.c</filename>
    </added>
    <added>
      <filename>src/ibusinputcontext.h</filename>
    </added>
    <added>
      <filename>src/ibusinternal.c</filename>
    </added>
    <added>
      <filename>src/ibusinternal.h</filename>
    </added>
    <added>
      <filename>src/ibuskeynames.c</filename>
    </added>
    <added>
      <filename>src/ibuskeysyms-update.pl</filename>
    </added>
    <added>
      <filename>src/ibuskeysyms.h</filename>
    </added>
    <added>
      <filename>src/ibuslookuptable.c</filename>
    </added>
    <added>
      <filename>src/ibuslookuptable.h</filename>
    </added>
    <added>
      <filename>src/ibusmarshalers.list</filename>
    </added>
    <added>
      <filename>src/ibusmessage.c</filename>
    </added>
    <added>
      <filename>src/ibusmessage.h</filename>
    </added>
    <added>
      <filename>src/ibusobject.c</filename>
    </added>
    <added>
      <filename>src/ibusobject.h</filename>
    </added>
    <added>
      <filename>src/ibusobservedpath.c</filename>
    </added>
    <added>
      <filename>src/ibusobservedpath.h</filename>
    </added>
    <added>
      <filename>src/ibuspendingcall.c</filename>
    </added>
    <added>
      <filename>src/ibuspendingcall.h</filename>
    </added>
    <added>
      <filename>src/ibusproperty.c</filename>
    </added>
    <added>
      <filename>src/ibusproperty.h</filename>
    </added>
    <added>
      <filename>src/ibusproxy.c</filename>
    </added>
    <added>
      <filename>src/ibusproxy.h</filename>
    </added>
    <added>
      <filename>src/ibusserializable.c</filename>
    </added>
    <added>
      <filename>src/ibusserializable.h</filename>
    </added>
    <added>
      <filename>src/ibusserver.c</filename>
    </added>
    <added>
      <filename>src/ibusserver.h</filename>
    </added>
    <added>
      <filename>src/ibusservice.c</filename>
    </added>
    <added>
      <filename>src/ibusservice.h</filename>
    </added>
    <added>
      <filename>src/ibusshare.c</filename>
    </added>
    <added>
      <filename>src/ibusshare.h</filename>
    </added>
    <added>
      <filename>src/ibustext.c</filename>
    </added>
    <added>
      <filename>src/ibustext.h</filename>
    </added>
    <added>
      <filename>src/ibustypes.h</filename>
    </added>
    <added>
      <filename>src/ibusxml.c</filename>
    </added>
    <added>
      <filename>src/ibusxml.h</filename>
    </added>
    <added>
      <filename>src/keyname-table.h</filename>
    </added>
    <added>
      <filename>src/test-attribute.c</filename>
    </added>
    <added>
      <filename>src/test-bus.c</filename>
    </added>
    <added>
      <filename>src/test-engine.c</filename>
    </added>
    <added>
      <filename>src/test-keynames.c</filename>
    </added>
    <added>
      <filename>src/test-lookuptable.c</filename>
    </added>
    <added>
      <filename>src/test-proxy.c</filename>
    </added>
    <added>
      <filename>src/test-server.c</filename>
    </added>
    <added>
      <filename>src/test-text.c</filename>
    </added>
    <added>
      <filename>ui/gtk/gtkpanel.xml.in</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,7 @@
 *.so
 *~
 tags
+TAGS
 Makefile.qmake
 Makefile
 Makefile.in
@@ -34,3 +35,4 @@ stamp-h1
 py-compile
 ibus-*.tar.*
 ibus.spec
+ibus-1.0.pc</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -19,25 +19,30 @@
 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 # Boston, MA  02111-1307  USA
 
-SUBDIRS = \
-	daemon \
-	gconf \
-	ibus \
-	launcher \
-	ui \
-	lib \
-	util \
-	client \
-	setup \
-	icons \
-	m4 \
-	po \
+SUBDIRS = 		\
+	src 		\
+	bindings	\
+	gconf 		\
+	ibus 		\
+	ui 			\
+	util 		\
+	client 		\
+	setup 		\
+	bus 		\
+	icons 		\
+	m4 			\
+	po 			\
+	docs 		\
 	$(NULL)
 
 ACLOCAL_AMFLAGS = -I m4
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ibus-1.0.pc
+
 EXTRA_DIST = \
 	autogen.sh \
+	ibus-1.0.pc.in \
 	ibus.spec.in \
 	python-config.py \
 	$(NULL)
@@ -55,6 +60,7 @@ install-data-hook:
 
 DISTCHECK_CONFIGURE_FLAGS = \
 	--enable-pygconf \
+	--enable-gtk-doc \
 	$(NULL)
 
 rpm: dist @PACKAGE_NAME@.spec</diff>
      <filename>Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ set -x
 
 autopoint  --force
 libtoolize --automake --copy --force
+gtkdocize  #--flavour=no-tmpl
 aclocal -I m4 --force
 autoheader --force
 automake --add-missing --copy --force</diff>
      <filename>autogen.sh</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,6 @@
 
 SUBDIRS = \
 	gtk2 \
-	qt4 \
 	x11 \
+	qt4 \
 	$(NULL)</diff>
      <filename>client/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -19,10 +19,10 @@
 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 # Boston, MA  02111-1307  USA
 
-libibus_gtk = $(top_builddir)/lib/gtk2/libibus-gtk.la
+libibus = $(top_builddir)/src/libibus.la
 
 INCLUDES = \
-	-I$(top_srcdir)/lib/gtk2 \
+	-I$(top_srcdir)/src \
 	$(NULL)
 
 immoduledir = @GTK_IM_MODULEDIR@
@@ -34,8 +34,8 @@ im_ibus_la_SOURCES = \
 	ibusimcontext.h \
 	$(NULL)
 
-im_ibus_la_DEPENDENCIES = $(libibus_gtk)
-im_ibus_la_LIBADD = $(libibus_gtk)
+im_ibus_la_DEPENDENCIES = $(libibus)
+im_ibus_la_LIBADD = $(libibus)
 
 im_ibus_la_CFLAGS = \
 	@GTK2_CFLAGS@ \
@@ -50,8 +50,8 @@ im_ibus_la_LDFLAGS = \
 	-module \
 	$(NULL)
 
-$(libibus_gtk):
-	(cd $(top_builddir)/lib/gtk2; make )
+$(libibus):
+	(cd $(top_builddir)/src; make )
 
 EXTRA_DIST = \
 	$(NULL)</diff>
      <filename>client/gtk2/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 #include &lt;glib/gprintf.h&gt;
 #include &lt;gtk/gtk.h&gt;
 #include &lt;gtk/gtkimmodule.h&gt;
-#include &quot;ibusimclient.h&quot;
+#include &lt;ibus.h&gt;
 #include &quot;ibusimcontext.h&quot;
 
 #define IBUS_LOCALDIR &quot;&quot;
@@ -38,19 +38,22 @@ static const GtkIMContextInfo * info_list[] = {
 };
 
 
+G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
+const gchar*
+g_module_check_init (GModule *module)
+{
+    return glib_check_version (GLIB_MAJOR_VERSION,
+                               GLIB_MINOR_VERSION,
+                               GLIB_MICRO_VERSION);
+}
+
 void
 im_module_init (GTypeModule *type_module)
 {
-    ibus_im_client_register_type(type_module);
-    ibus_im_context_register_type(type_module);
-#if 0
-    gchar **p = environ;
-    extern gchar **environ;
-    while (*p != NULL) {
-        g_fprintf (stderr, &quot;%s\n&quot;, *p);
-        p ++;
-    }
-#endif
+    /* make module resident */
+    g_type_module_use (type_module);
+
+    ibus_im_context_register_type (type_module);
 }
 
 void</diff>
      <filename>client/gtk2/ibusim.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,9 +23,8 @@
 #include &lt;sys/socket.h&gt;
 #include &lt;sys/time.h&gt;
 #include &lt;sys/un.h&gt;
+#include &lt;ibus.h&gt;
 #include &quot;ibusimcontext.h&quot;
-#include &quot;ibusattribute.h&quot;
-#include &quot;ibusimclient.h&quot;
 
 /* IBusIMContextPriv */
 struct _IBusIMContextPrivate {
@@ -34,7 +33,7 @@ struct _IBusIMContextPrivate {
 
     /* enabled */
     gboolean        enable;
-    gchar           *ic;
+    IBusInputContext *ibus_context;
 
     /* preedit status */
     gchar           *preedit_string;
@@ -56,35 +55,37 @@ static guint    _signal_delete_surrounding_id = 0;
 static guint    _signal_retrieve_surrounding_id = 0;
 
 /* functions prototype */
-static void     ibus_im_context_class_init   (IBusIMContextClass  *klass);
-static void     ibus_im_context_init         (IBusIMContext       *obj);
-static void     ibus_im_context_finalize     (GObject            *obj);
-static void     ibus_im_context_reset        (GtkIMContext       *context);
+static void     ibus_im_context_class_init   (IBusIMContextClass    *klass);
+static void     ibus_im_context_init         (GObject               *obj);
+static void     ibus_im_context_finalize     (GObject               *obj);
+static void     ibus_im_context_reset        (GtkIMContext          *context);
 static gboolean ibus_im_context_filter_keypress
-                                            (GtkIMContext       *context,
-                                             GdkEventKey        *key);
-static void     ibus_im_context_focus_in     (GtkIMContext       *context);
-static void     ibus_im_context_focus_out    (GtkIMContext       *context);
+                                            (GtkIMContext           *context,
+                                             GdkEventKey            *key);
+static void     ibus_im_context_focus_in     (GtkIMContext          *context);
+static void     ibus_im_context_focus_out    (GtkIMContext          *context);
 static void     ibus_im_context_get_preedit_string
-                                            (GtkIMContext       *context,
-                                             gchar              **str,
-                                             PangoAttrList      **attrs,
-                                             gint               *cursor_pos);
+                                            (GtkIMContext           *context,
+                                             gchar                  **str,
+                                             PangoAttrList          **attrs,
+                                             gint                   *cursor_pos);
 static void     ibus_im_context_set_client_window
-                                            (GtkIMContext       *context,
-                                             GdkWindow          *client);
+                                            (GtkIMContext           *context,
+                                             GdkWindow              *client);
 static void     ibus_im_context_set_cursor_location
-                                            (GtkIMContext       *context,
-                                             GdkRectangle       *area);
+                                            (GtkIMContext           *context,
+                                             GdkRectangle           *area);
 static void     ibus_im_context_set_use_preedit
-                                            (GtkIMContext       *context,
-                                             gboolean           use_preedit);
+                                            (GtkIMContext           *context,
+                                             gboolean               use_preedit);
 
 /* static methods*/
-static void    _init_ibus_client            (void);
-static void    _set_cursor_location_internal
+static void     _create_input_context       (IBusIMContext      *context);
+static void     _set_cursor_location_internal
                                             (GtkIMContext       *context);
 
+static void     _bus_connected_cb           (IBusBus            *bus,
+                                             IBusIMContext      *context);
 /* callback functions for slave context */
 static void     _slave_commit_cb            (GtkIMContext       *slave,
                                              gchar              *string,
@@ -109,9 +110,7 @@ static void     _slave_delete_surrounding_cb
 static GType                _ibus_type_im_context = 0;
 static GtkIMContextClass    *parent_class = NULL;
 
-static IBusIMClient         *_client = NULL;
-static GHashTable           *_ic_table = NULL;
-static GArray               *_im_context_array = NULL;
+static IBusBus              *_bus = NULL;
 
 void
 ibus_im_context_register_type (GTypeModule *type_module)
@@ -210,16 +209,16 @@ ibus_im_context_class_init     (IBusIMContextClass *klass)
     _signal_retrieve_surrounding_id =
         g_signal_lookup (&quot;retrieve-surrounding&quot;, G_TYPE_FROM_CLASS (klass));
     g_assert (_signal_retrieve_surrounding_id != 0);
+
 }
 
 static void
-ibus_im_context_init     (IBusIMContext *obj)
+ibus_im_context_init (GObject *obj)
 {
-    _init_ibus_client ();
 
-    IBusIMContext *ibus = IBUS_IM_CONTEXT (obj);
-    IBusIMContextPrivate *priv = ibus-&gt;priv =
-        G_TYPE_INSTANCE_GET_PRIVATE (ibus, IBUS_TYPE_IM_CONTEXT, IBusIMContextPrivate);
+    IBusIMContext *ibuscontext = IBUS_IM_CONTEXT (obj);
+    IBusIMContextPrivate *priv = ibuscontext-&gt;priv =
+        G_TYPE_INSTANCE_GET_PRIVATE (ibuscontext, IBUS_TYPE_IM_CONTEXT, IBusIMContextPrivate);
 
     priv-&gt;client_window = NULL;
 
@@ -238,34 +237,47 @@ ibus_im_context_init     (IBusIMContext *obj)
     priv-&gt;cursor_area.width = 0;
     priv-&gt;cursor_area.height = 0;
 
-    priv-&gt;ic = NULL;
+    priv-&gt;ibus_context = NULL;
     priv-&gt;has_focus = FALSE;
-    priv-&gt;caps = IBUS_CAP_PREEDIT | IBUS_CAP_FOCUS;
+    priv-&gt;caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS;
 
 
     // Create slave im context
-    ibus-&gt;priv-&gt;slave = gtk_im_context_simple_new ();
-    g_signal_connect (ibus-&gt;priv-&gt;slave,
-                &quot;commit&quot;, G_CALLBACK (_slave_commit_cb), obj);
-    g_signal_connect (ibus-&gt;priv-&gt;slave,
-                &quot;preedit-start&quot;, G_CALLBACK (_slave_preedit_start_cb), obj);
-    g_signal_connect (ibus-&gt;priv-&gt;slave,
-                &quot;preedit-end&quot;, G_CALLBACK (_slave_preedit_end_cb), obj);
-    g_signal_connect (ibus-&gt;priv-&gt;slave,
-                &quot;preedit-changed&quot;, G_CALLBACK (_slave_preedit_changed_cb), obj);
-    g_signal_connect (ibus-&gt;priv-&gt;slave,
-                &quot;retrieve-surrounding&quot;, G_CALLBACK (_slave_retrieve_surrounding_cb), obj);
-    g_signal_connect (ibus-&gt;priv-&gt;slave,
-                &quot;delete-surrounding&quot;, G_CALLBACK (_slave_delete_surrounding_cb), obj);
-
-    g_array_append_val (_im_context_array, obj);
-
-    if (ibus_im_client_get_connected (_client)) {
-        const gchar *ic = ibus_im_client_create_input_context (_client);
-        ibus_im_context_set_ic (ibus, ic);
-        g_hash_table_insert (_ic_table,
-            (gpointer) ibus_im_context_get_ic (ibus), (gpointer) ibus);
-    }
+    priv-&gt;slave = gtk_im_context_simple_new ();
+    g_signal_connect (priv-&gt;slave,
+                      &quot;commit&quot;,
+                      G_CALLBACK (_slave_commit_cb),
+                      ibuscontext);
+    g_signal_connect (priv-&gt;slave,
+                      &quot;preedit-start&quot;,
+                      G_CALLBACK (_slave_preedit_start_cb),
+                      ibuscontext);
+    g_signal_connect (priv-&gt;slave,
+                      &quot;preedit-end&quot;,
+                      G_CALLBACK (_slave_preedit_end_cb),
+                      ibuscontext);
+    g_signal_connect (priv-&gt;slave,
+                      &quot;preedit-changed&quot;,
+                      G_CALLBACK (_slave_preedit_changed_cb),
+                      ibuscontext);
+    g_signal_connect (priv-&gt;slave,
+                      &quot;retrieve-surrounding&quot;,
+                      G_CALLBACK (_slave_retrieve_surrounding_cb),
+                      ibuscontext);
+    g_signal_connect (priv-&gt;slave,
+                      &quot;delete-surrounding&quot;,
+                      G_CALLBACK (_slave_delete_surrounding_cb),
+                      ibuscontext);
+
+    /* init bus object */
+    if (_bus == NULL)
+        _bus = ibus_bus_new();
+
+    if (ibus_bus_is_connected (_bus)) {
+        _create_input_context (ibuscontext);
+    }
+
+    g_signal_connect (_bus, &quot;connected&quot;, G_CALLBACK (_bus_connected_cb), obj);
 }
 
 static void
@@ -277,18 +289,10 @@ ibus_im_context_finalize (GObject *obj)
     IBusIMContext *ibus = IBUS_IM_CONTEXT (obj);
     IBusIMContextPrivate *priv = ibus-&gt;priv;
 
-    gint i;
-    for (i = 0; i &lt; _im_context_array-&gt;len; i++) {
-        if (obj == g_array_index (_im_context_array, GObject *, i)) {
-            g_array_remove_index_fast (_im_context_array, i);
-            break;
-        }
-    }
+    g_signal_handlers_disconnect_by_func (_bus, G_CALLBACK (_bus_connected_cb), obj);
 
-    if (priv-&gt;ic) {
-        ibus_im_client_release_input_context (_client, priv-&gt;ic);
-        g_hash_table_remove (_ic_table, priv-&gt;ic);
-        g_free (priv-&gt;ic);
+    if (priv-&gt;ibus_context) {
+        ibus_object_destroy (priv-&gt;ibus_context);
     }
 
     g_object_unref (priv-&gt;slave);
@@ -318,12 +322,26 @@ ibus_im_context_filter_keypress (GtkIMContext *context,
     IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
     IBusIMContextPrivate *priv = ibus-&gt;priv;
 
-    if (priv-&gt;ic &amp;&amp; priv-&gt;has_focus) {
+    if (priv-&gt;ibus_context &amp;&amp; priv-&gt;has_focus) {
         /* If context does not have focus, ibus will process key event in sync mode.
          * It is a workaround for increase search in treeview.
          */
-        gboolean retval = ibus_im_client_filter_keypress (_client,
-                            priv-&gt;ic, event, FALSE);
+        gboolean retval;
+        switch (event-&gt;type) {
+        case GDK_KEY_RELEASE:
+            retval = ibus_input_context_process_key_event (priv-&gt;ibus_context,
+                                                           event-&gt;keyval,
+                                                           event-&gt;state | IBUS_RELEASE_MASK);
+            break;
+        case GDK_KEY_PRESS:
+            retval = ibus_input_context_process_key_event (priv-&gt;ibus_context,
+                                                           event-&gt;keyval,
+                                                           event-&gt;state);
+            break;
+        default:
+            retval = FALSE;
+        }
+
         if (retval) {
             return TRUE;
         }
@@ -337,15 +355,17 @@ ibus_im_context_filter_keypress (GtkIMContext *context,
 static void
 ibus_im_context_focus_in (GtkIMContext *context)
 {
-    g_return_if_fail (context != NULL);
-    g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
-    IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
-    IBusIMContextPrivate *priv = ibus-&gt;priv;
+    IBusIMContext *ibuscontext;
+    IBusIMContextPrivate *priv;
+
+    ibuscontext = IBUS_IM_CONTEXT (context);
+    priv = ibuscontext-&gt;priv;
 
     priv-&gt;has_focus = TRUE;
-    if (priv-&gt;ic) {
-        ibus_im_client_focus_in (_client, priv-&gt;ic);
+    if (priv-&gt;ibus_context) {
+        ibus_input_context_focus_in (priv-&gt;ibus_context);
     }
 
     gtk_im_context_focus_in (priv-&gt;slave);
@@ -356,15 +376,18 @@ ibus_im_context_focus_in (GtkIMContext *context)
 static void
 ibus_im_context_focus_out (GtkIMContext *context)
 {
-    g_return_if_fail (context != NULL);
-    g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
 
-    IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
-    IBusIMContextPrivate *priv = ibus-&gt;priv;
+    g_assert (IBUS_IS_IM_CONTEXT (context));
+
+    IBusIMContext *ibuscontext;
+    IBusIMContextPrivate *priv;
+
+    ibuscontext = IBUS_IM_CONTEXT (context);
+    priv = ibuscontext-&gt;priv;
 
     priv-&gt;has_focus = FALSE;
-    if (priv-&gt;ic) {
-        ibus_im_client_focus_out (_client, priv-&gt;ic);
+    if (priv-&gt;ibus_context) {
+        ibus_input_context_focus_out (priv-&gt;ibus_context);
     }
     gtk_im_context_focus_out (priv-&gt;slave);
 }
@@ -372,14 +395,16 @@ ibus_im_context_focus_out (GtkIMContext *context)
 static void
 ibus_im_context_reset (GtkIMContext *context)
 {
-    g_return_if_fail (context != NULL);
-    g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
-    IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
-    IBusIMContextPrivate *priv = ibus-&gt;priv;
+    IBusIMContext *ibuscontext;
+    IBusIMContextPrivate *priv;
 
-    if (priv-&gt;ic) {
-        ibus_im_client_reset (_client, priv-&gt;ic);
+    ibuscontext = IBUS_IM_CONTEXT (context);
+    priv = ibuscontext-&gt;priv;
+
+    if (priv-&gt;ibus_context) {
+        ibus_input_context_reset (priv-&gt;ibus_context);
     }
     gtk_im_context_reset (priv-&gt;slave);
 }
@@ -387,15 +412,17 @@ ibus_im_context_reset (GtkIMContext *context)
 
 static void
 ibus_im_context_get_preedit_string (GtkIMContext   *context,
-                   gchar         **str,
-                   PangoAttrList **attrs,
-                   gint           *cursor_pos)
+                                    gchar         **str,
+                                    PangoAttrList **attrs,
+                                    gint           *cursor_pos)
 {
-    g_return_if_fail (context != NULL);
-    g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
-    IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
-    IBusIMContextPrivate *priv = ibus-&gt;priv;
+    IBusIMContext *ibuscontext;
+    IBusIMContextPrivate *priv;
+
+    ibuscontext = IBUS_IM_CONTEXT (context);
+    priv = ibuscontext-&gt;priv;
 
     if (priv-&gt;enable) {
         if (priv-&gt;preedit_visible) {
@@ -460,7 +487,7 @@ _set_cursor_location_internal (GtkIMContext *context)
     GdkRectangle area;
     gint x, y;
 
-    if(priv-&gt;client_window == NULL || priv-&gt;ic == NULL) {
+    if(priv-&gt;client_window == NULL || priv-&gt;ibus_context == NULL) {
         return;
     }
 
@@ -475,7 +502,11 @@ _set_cursor_location_internal (GtkIMContext *context)
     gdk_window_get_origin (priv-&gt;client_window, &amp;x, &amp;y);
     area.x += x;
     area.y += y;
-    ibus_im_client_set_cursor_location (_client, priv-&gt;ic, &amp;area);
+    ibus_input_context_set_cursor_location (priv-&gt;ibus_context,
+                                            area.x,
+                                            area.y,
+                                            area.width,
+                                            area.height);
 }
 
 static void
@@ -501,96 +532,84 @@ ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit)
     IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
     IBusIMContextPrivate *priv = ibus-&gt;priv;
 
-    if(priv-&gt;ic) {
+    if(priv-&gt;ibus_context) {
         if (use_preedit) {
-            priv-&gt;caps |= IBUS_CAP_PREEDIT;
+            priv-&gt;caps |= IBUS_CAP_PREEDIT_TEXT;
         }
         else {
-            priv-&gt;caps &amp;= ~IBUS_CAP_PREEDIT;
+            priv-&gt;caps &amp;= ~IBUS_CAP_PREEDIT_TEXT;
         }
-        ibus_im_client_set_capabilities (_client, priv-&gt;ic, priv-&gt;caps);
+        ibus_input_context_set_capabilities (priv-&gt;ibus_context, priv-&gt;caps);
     }
     gtk_im_context_set_use_preedit (priv-&gt;slave, use_preedit);
 }
 
 static void
-_client_connected_cb (IBusIMClient *client, gpointer user_data)
-{
-    gint i;
-    const gchar *ic;
-    IBusIMContext *context;
-
-    for (i = 0; i &lt; _im_context_array-&gt;len; i++) {
-        context = g_array_index (_im_context_array, IBusIMContext *, i);
-        ic = ibus_im_client_create_input_context (client);
-        ibus_im_context_set_ic (context, ic);
-        if (ic == NULL) {
-            continue;
-        }
-        g_hash_table_insert (_ic_table,
-            (gpointer) ibus_im_context_get_ic (context), (gpointer) context);
-    }
-}
-
-static void
-_client_disconnected_cb (IBusIMClient *client, gpointer user_data)
+_bus_connected_cb (IBusBus          *bus,
+                   IBusIMContext    *context)
 {
-    gint i;
-    IBusIMContext *context;
-
-    g_hash_table_remove_all (_ic_table);
-    for (i = 0; i &lt; _im_context_array-&gt;len; i++) {
-        context = g_array_index (_im_context_array, IBusIMContext *, i);
-        ibus_im_context_set_ic (context, NULL);
-    }
+    g_assert (IBUS_IS_IM_CONTEXT (context));
+    g_assert (context-&gt;priv-&gt;ibus_context == NULL);
 
+    _create_input_context (context);
 }
 
 static void
-_client_commit_string_cb (IBusIMClient *client, const gchar *ic, const gchar *string, gpointer user_data)
+_ibus_context_commit_text_cb (IBusInputContext *ibus_context,
+                              IBusText         *text,
+                              IBusIMContext    *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
-
-    g_signal_emit (context, _signal_commit_id, 0, string);
+    g_assert (IBUS_IS_INPUT_CONTEXT (ibus_context));
+    g_assert (IBUS_IS_TEXT (text));
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
+    g_signal_emit (context, _signal_commit_id, 0, text-&gt;text);
 }
 
 static void
-_client_forward_event_cb (IBusIMClient *client, const gchar *ic, GdkEvent *event, gpointer user_data)
+_ibus_context_forward_key_event_cb (IBusInputContext  *ibus_context,
+                                    guint              keyval,
+                                    gboolean           is_press,
+                                    guint              state,
+                                    IBusIMContext     *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
-    if (event-&gt;type == GDK_KEY_PRESS ||
-        event-&gt;type == GDK_KEY_RELEASE) {
-    /*
-        GTimeVal time;
-        event-&gt;key.time = time.tv_sec * 1000 + time.tv_usec / 1000;
-     */
-        event-&gt;key.time = GDK_CURRENT_TIME;
-    }
+    GdkEventKey *event;
+    IBusIMContextPrivate *priv;
 
-#if 0
-    if (event-&gt;any.window != context-&gt;priv-&gt;client_window) {
-        GdkWindow *old_window = event-&gt;any.window;
-        event-&gt;any.window = context-&gt;priv-&gt;client_window;
-        gdk_event_put (event);
-        event-&gt;any.window = old_window;
-    }
-    else
-#endif
-    gdk_event_put (event);
+    priv = context-&gt;priv;
+    event = (GdkEventKey *)gdk_event_new (is_press ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
+
+    event-&gt;time = GDK_CURRENT_TIME;
+    event-&gt;window = g_object_ref (priv-&gt;client_window);
+    event-&gt;send_event = FALSE;
+    event-&gt;state = state;
+    event-&gt;keyval = keyval;
+    event-&gt;string = gdk_keyval_name (keyval);
+    event-&gt;length = strlen (event-&gt;string);
+    event-&gt;hardware_keycode = 0;
+    event-&gt;group = 0;
+    event-&gt;is_modifier = 0;
+
+    gdk_event_put ((GdkEvent *)event);
+    gdk_event_free ((GdkEvent *)event);
 }
 
 static void
-_client_update_preedit_cb (IBusIMClient *client, const gchar *ic, const gchar *string,
-    IBusAttrList *attr_list, gint cursor_pos, gboolean visible, gpointer user_data)
+_ibus_context_update_preedit_text_cb (IBusInputContext  *ibus_context,
+                                      IBusText          *text,
+                                      gint               cursor_pos,
+                                      gboolean           visible,
+                                      IBusIMContext     *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (ibus_context));
+    g_assert (IBUS_IS_TEXT (text));
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
-    IBusIMContextPrivate *priv = context-&gt;priv;
+    IBusIMContextPrivate *priv;
+    priv = context-&gt;priv;
+    const gchar *str;
 
     if (priv-&gt;preedit_string) {
         g_free (priv-&gt;preedit_string);
@@ -600,12 +619,13 @@ _client_update_preedit_cb (IBusIMClient *client, const gchar *ic, const gchar *s
         priv-&gt;preedit_attrs = NULL;
     }
 
-    priv-&gt;preedit_string = g_strdup (string);
-    if (attr_list) {
+    str = text-&gt;text;
+    priv-&gt;preedit_string = g_strdup (str);
+    if (text-&gt;attrs) {
         guint i;
         priv-&gt;preedit_attrs = pango_attr_list_new ();
         for (i = 0; ; i++) {
-            IBusAttribute *attr = ibus_attr_list_get (attr_list, i);
+            IBusAttribute *attr = ibus_attr_list_get (text-&gt;attrs, i);
             if (attr == NULL) {
                 break;
             }
@@ -630,8 +650,8 @@ _client_update_preedit_cb (IBusIMClient *client, const gchar *ic, const gchar *s
             default:
                 continue;
             }
-            pango_attr-&gt;start_index = g_utf8_offset_to_pointer (string, attr-&gt;start_index) - string;
-            pango_attr-&gt;end_index = g_utf8_offset_to_pointer (string, attr-&gt;end_index) - string;
+            pango_attr-&gt;start_index = g_utf8_offset_to_pointer (str, attr-&gt;start_index) - str;
+            pango_attr-&gt;end_index = g_utf8_offset_to_pointer (str, attr-&gt;end_index) - str;
             pango_attr_list_insert (priv-&gt;preedit_attrs, pango_attr);
         }
     }
@@ -641,11 +661,10 @@ _client_update_preedit_cb (IBusIMClient *client, const gchar *ic, const gchar *s
 }
 
 static void
-_client_show_preedit_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_ibus_context_show_preedit_text_cb (IBusInputContext   *ibus_context,
+                                    IBusIMContext      *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
-
+    g_assert (IBUS_IS_IM_CONTEXT (context));
     IBusIMContextPrivate *priv = context-&gt;priv;
 
     if (priv-&gt;preedit_visible == FALSE) {
@@ -655,11 +674,10 @@ _client_show_preedit_cb (IBusIMClient *client, const gchar *ic, gpointer user_da
 }
 
 static void
-_client_hide_preedit_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_ibus_context_hide_preedit_text_cb (IBusInputContext   *ibus_context,
+                                    IBusIMContext      *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
-
+    g_assert (IBUS_IS_IM_CONTEXT (context));
     IBusIMContextPrivate *priv = context-&gt;priv;
 
     if (priv-&gt;preedit_visible == TRUE) {
@@ -669,62 +687,88 @@ _client_hide_preedit_cb (IBusIMClient *client, const gchar *ic, gpointer user_da
 }
 
 static void
-_client_enabled_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_ibus_context_enabled_cb (IBusInputContext    *ibus_context,
+                IBusIMContext       *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
-
+    g_assert (IBUS_IS_IM_CONTEXT (context));
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable == FALSE) {
-        priv-&gt;enable = TRUE;
-    }
+    priv-&gt;enable = TRUE;
 }
 
 static void
-_client_disabled_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_ibus_context_disabled_cb (IBusInputContext   *ibus_context,
+                 IBusIMContext      *context)
 {
-    IBusIMContext *context = g_hash_table_lookup (_ic_table, ic);
-    g_return_if_fail (context != NULL);
-
+    g_assert (IBUS_IS_IM_CONTEXT (context));
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable == TRUE) {
-        priv-&gt;enable = FALSE;
-    }
+    priv-&gt;enable = FALSE;
 }
 
 static void
-_init_ibus_client (void)
+_ibus_context_destroy_cb (IBusInputContext    *ibus_context,
+                IBusIMContext       *context)
 {
-    if (_client != NULL) {
-        return;
-    }
+    g_assert (IBUS_IS_IM_CONTEXT (context));
 
-    _im_context_array = g_array_new (TRUE, TRUE, sizeof (IBusIMContext *));
-    _ic_table = g_hash_table_new (g_str_hash, g_str_equal);
+    IBusIMContextPrivate *priv = context-&gt;priv;
 
-    _client = ibus_im_client_new ();
+    g_assert (priv-&gt;ibus_context == ibus_context);
 
-    g_signal_connect (_client, &quot;connected&quot;,
-                        G_CALLBACK (_client_connected_cb), NULL);
-    g_signal_connect (_client, &quot;disconnected&quot;,
-                        G_CALLBACK (_client_disconnected_cb), NULL);
-    g_signal_connect (_client, &quot;commit-string&quot;,
-                        G_CALLBACK (_client_commit_string_cb), NULL);
-    g_signal_connect (_client, &quot;forward-event&quot;,
-                        G_CALLBACK (_client_forward_event_cb), NULL);
-    g_signal_connect (_client, &quot;update-preedit&quot;,
-                        G_CALLBACK (_client_update_preedit_cb), NULL);
-    g_signal_connect (_client, &quot;show-preedit&quot;,
-                        G_CALLBACK (_client_show_preedit_cb), NULL);
-    g_signal_connect (_client, &quot;hide-preedit&quot;,
-                        G_CALLBACK (_client_hide_preedit_cb), NULL);
-    g_signal_connect (_client, &quot;enabled&quot;,
-                        G_CALLBACK (_client_enabled_cb), NULL);
-    g_signal_connect (_client, &quot;disabled&quot;,
-                        G_CALLBACK (_client_disabled_cb), NULL);
+    g_object_unref (priv-&gt;ibus_context);
+    priv-&gt;ibus_context = NULL;
+    priv-&gt;enable = FALSE;
+}
 
+static void
+_create_input_context (IBusIMContext *context)
+{
+    g_assert (IBUS_IS_IM_CONTEXT (context));
+    g_assert (context-&gt;priv-&gt;ibus_context == NULL);
+
+    IBusIMContextPrivate *priv;
+    priv = context-&gt;priv;
+
+    priv-&gt;ibus_context = ibus_bus_create_input_context (_bus, &quot;test&quot;);
+
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;commit-text&quot;,
+                      G_CALLBACK (_ibus_context_commit_text_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;forward-key-event&quot;,
+                      G_CALLBACK (_ibus_context_forward_key_event_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;update-preedit-text&quot;,
+                      G_CALLBACK (_ibus_context_update_preedit_text_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;show-preedit-text&quot;,
+                      G_CALLBACK (_ibus_context_show_preedit_text_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;hide-preedit-text&quot;,
+                      G_CALLBACK (_ibus_context_hide_preedit_text_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;enabled&quot;,
+                      G_CALLBACK (_ibus_context_enabled_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context,
+                      &quot;disabled&quot;,
+                      G_CALLBACK (_ibus_context_disabled_cb),
+                      context);
+    g_signal_connect (priv-&gt;ibus_context, &quot;destroy&quot;,
+                      G_CALLBACK (_ibus_context_destroy_cb),
+                      context);
+
+    ibus_input_context_set_capabilities (priv-&gt;ibus_context, priv-&gt;caps);
+
+    if (priv-&gt;has_focus) {
+        ibus_input_context_focus_in (priv-&gt;ibus_context);
+    }
 }
 
 /* Callback functions for slave context */
@@ -750,7 +794,7 @@ _slave_preedit_changed_cb (GtkIMContext *slave, IBusIMContext *context)
 
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable &amp;&amp; priv-&gt;ic) {
+    if (priv-&gt;enable &amp;&amp; priv-&gt;ibus_context) {
         return;
     }
 
@@ -765,7 +809,7 @@ _slave_preedit_start_cb (GtkIMContext *slave, IBusIMContext *context)
 
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable &amp;&amp; priv-&gt;ic) {
+    if (priv-&gt;enable &amp;&amp; priv-&gt;ibus_context) {
         return;
     }
     g_signal_emit (context, _signal_preedit_start_id, 0);
@@ -779,7 +823,7 @@ _slave_preedit_end_cb (GtkIMContext *slave, IBusIMContext *context)
 
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable &amp;&amp; priv-&gt;ic) {
+    if (priv-&gt;enable &amp;&amp; priv-&gt;ibus_context) {
         return;
     }
     g_signal_emit (context, _signal_preedit_end_id, 0);
@@ -793,7 +837,7 @@ _slave_retrieve_surrounding_cb (GtkIMContext *slave, IBusIMContext *context)
 
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable &amp;&amp; priv-&gt;ic) {
+    if (priv-&gt;enable &amp;&amp; priv-&gt;ibus_context) {
         return;
     }
     g_signal_emit (context, _signal_retrieve_surrounding_id, 0);
@@ -807,44 +851,12 @@ _slave_delete_surrounding_cb (GtkIMContext *slave, gint a1, gint a2, IBusIMConte
 
     IBusIMContextPrivate *priv = context-&gt;priv;
 
-    if (priv-&gt;enable &amp;&amp; priv-&gt;ic) {
+    if (priv-&gt;enable &amp;&amp; priv-&gt;ibus_context) {
         return;
     }
     g_signal_emit (context, _signal_delete_surrounding_id, 0, a1, a2);
 }
 
-const gchar *
-ibus_im_context_get_ic (IBusIMContext *context)
-{
-    g_return_val_if_fail (context != NULL, NULL);
-    g_return_val_if_fail (IBUS_IS_IM_CONTEXT (context), NULL);
-
-    IBusIMContextPrivate *priv = context-&gt;priv;
-    return priv-&gt;ic;
-}
-
-void
-ibus_im_context_set_ic (IBusIMContext *context, const gchar *ic)
-{
-    g_return_if_fail (context != NULL);
-    g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
-
-    IBusIMContextPrivate *priv = context-&gt;priv;
-
-    g_free (priv-&gt;ic);
-    priv-&gt;ic = g_strdup (ic);
-
-    if (priv-&gt;ic == NULL) {
-        priv-&gt;enable = FALSE;
-    }
-    else {
-        ibus_im_client_set_capabilities (_client, priv-&gt;ic, priv-&gt;caps);
-        if (priv-&gt;has_focus) {
-            ibus_im_context_focus_in (GTK_IM_CONTEXT (context));
-        }
-    }
-}
-
 void
 ibus_im_context_show_preedit (IBusIMContext *context)
 {</diff>
      <filename>client/gtk2/ibusimcontext.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,9 +21,9 @@
 
 
 libIMdkit = $(top_builddir)/util/IMdkit/libIMdkit.la
-libibus_gtk = $(top_builddir)/lib/gtk2/libibus-gtk.la
+libibus = $(top_builddir)/src/libibus.la
 
-bin_PROGRAMS = ibus-x11
+libexec_PROGRAMS = ibus-x11
 
 ibus_x11_SOURCES = \
 	main.c \
@@ -32,12 +32,12 @@ ibus_x11_SOURCES = \
 
 ibus_x11_DEPENDENCIES = \
 	$(libIMdkit) \
-	$(libibus_gtk) \
+	$(libibus) \
 	$(NULL)
 
 ibus_x11_LDADD = \
 	$(libIMdkit) \
-	$(libibus_gtk) \
+	$(libibus) \
 	$(NULL)
 
 ibus_x11_LDFLAGS = \
@@ -48,7 +48,7 @@ ibus_x11_CFLAGS = \
 	@GTK2_CFLAGS@ \
 	@DBUS_CFLAGS@ \
 	-I$(top_srcdir)/util/IMdkit \
-	-I$(top_srcdir)/lib/gtk2 \
+	-I$(top_srcdir)/src \
 	$(NULL)
 
 noinst_HEADERS = \
@@ -58,6 +58,6 @@ noinst_HEADERS = \
 $(IMdkit):
 	(cd $(top_builddir)/util/IMdkit; make)
 
-$(libibus_gtk):
-	(cd $(top_builddir)/lib/gtk2; make)
+$(libibus):
+	(cd $(top_builddir)/src; make)
 </diff>
      <filename>client/x11/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -44,8 +44,7 @@
         g_debug (fmt_args); \
     }
 
-#include &lt;ibusattribute.h&gt;
-#include &lt;ibusimclient.h&gt;
+#include &lt;ibus.h&gt;
 #include &quot;gdk-private.h&quot;
 
 struct _X11ICONN {
@@ -53,32 +52,53 @@ struct _X11ICONN {
 };
 typedef struct _X11ICONN    X11ICONN;
 
+typedef struct _X11IC    X11IC;
 struct _X11IC {
-    gchar       *ibus_ic;
-    Window      client_window;
-    Window      focus_window;
-    gint32      input_style;
-    X11ICONN    *conn;
-    gint        icid;
-    gint        connect_id;
-    gchar       *lang;
-    gboolean        has_preedit_area;
-    GdkRectangle    preedit_area;
+    IBusInputContext *context;
+    Window           client_window;
+    Window           focus_window;
+    gint32           input_style;
+    X11ICONN        *conn;
+    gint             icid;
+    gint             connect_id;
+    gchar           *lang;
+    gboolean         has_preedit_area;
+    GdkRectangle     preedit_area;
 
     gchar           *preedit_string;
     IBusAttrList    *preedit_attrs;
-    gint            preedit_cursor;
-    gboolean        preedit_visible;
-    gboolean        preedit_started;
-    gint            onspot_preedit_length;
+    gint             preedit_cursor;
+    gboolean         preedit_visible;
+    gboolean         preedit_started;
+    gint             onspot_preedit_length;
 };
 
-typedef struct _X11IC    X11IC;
-
-static void _xim_set_cursor_location (X11IC *x11ic);
+static void     _xim_set_cursor_location    (X11IC              *x11ic);
+static void     _context_commit_text_cb     (IBusInputContext   *context,
+                                             IBusText           *text,
+                                             X11IC              *x11ic);
+static void     _context_forward_key_event_cb
+                                            (IBusInputContext   *context,
+                                             X11IC              *x11ic);
+
+static void     _context_update_preedit_text_cb
+                                            (IBusInputContext   *context,
+                                             IBusText           *text,
+                                             gint                cursor_pos,
+                                             gboolean            visible,
+                                             X11IC              *x11ic);
+static void     _context_show_preedit_text_cb
+                                            (IBusInputContext   *context,
+                                             X11IC              *x11ic);
+static void     _context_hide_preedit_text_cb
+                                            (IBusInputContext   *context,
+                                             X11IC              *x11ic);
+static void     _context_enabled_cb         (IBusInputContext   *context,
+                                             X11IC              *x11ic);
+static void     _context_disabled_cb        (IBusInputContext   *context,
+                                             X11IC              *x11ic);
 
 static GHashTable     *_x11_ic_table = NULL;
-static GHashTable     *_ibus_ic_table = NULL;
 static GHashTable     *_connections = NULL;
 static XIMS _xims = NULL;
 static gchar _server_name[128] = &quot;ibus&quot;;
@@ -95,9 +115,9 @@ static gchar _locale[1024] =
     &quot;uk,ur,uz,ve,vi,wa,xh,yi,zh,zu&quot;;
 
 static gboolean _kill_daemon = FALSE;
-static gint        g_debug_level = 0;
+static gint     g_debug_level = 0;
 
-static IBusIMClient *_client = NULL;
+static IBusBus *_bus = NULL;
 
 static void
 _xim_preedit_start (XIMS xims, const X11IC *x11ic)
@@ -315,21 +335,35 @@ xim_create_ic (XIMS xims, IMChangeICStruct *call_data)
 
     i = _xim_store_ic_values (x11ic, call_data);
 
-    x11ic-&gt;ibus_ic = g_strdup (ibus_im_client_create_input_context (_client));
-    if (x11ic-&gt;ibus_ic == NULL) {
+    x11ic-&gt;context = ibus_bus_create_input_context (_bus, &quot;xim&quot;);
+
+    if (x11ic-&gt;context == NULL) {
         g_slice_free (X11IC, x11ic);
         g_return_val_if_reached (0);
     }
 
-    g_hash_table_insert (_ibus_ic_table, x11ic-&gt;ibus_ic, (gpointer)x11ic);
+    g_signal_connect (x11ic-&gt;context, &quot;commit-text&quot;,
+                        G_CALLBACK (_context_commit_text_cb), x11ic);
+    g_signal_connect (x11ic-&gt;context, &quot;forward-key-event&quot;,
+                        G_CALLBACK (_context_forward_key_event_cb), x11ic);
+
+    g_signal_connect (x11ic-&gt;context, &quot;update-preedit-text&quot;,
+                        G_CALLBACK (_context_update_preedit_text_cb), x11ic);
+    g_signal_connect (x11ic-&gt;context, &quot;show-preedit-text&quot;,
+                        G_CALLBACK (_context_show_preedit_text_cb), x11ic);
+    g_signal_connect (x11ic-&gt;context, &quot;hide-preedit-text&quot;,
+                        G_CALLBACK (_context_hide_preedit_text_cb), x11ic);
+    g_signal_connect (x11ic-&gt;context, &quot;enabled&quot;,
+                        G_CALLBACK (_context_enabled_cb), x11ic);
+    g_signal_connect (x11ic-&gt;context, &quot;disabled&quot;,
+                        G_CALLBACK (_context_disabled_cb), x11ic);
+
 
     if (x11ic-&gt;input_style &amp; XIMPreeditCallbacks) {
-        ibus_im_client_set_capabilities (_client, x11ic-&gt;ibus_ic,
-                IBUS_CAP_FOCUS | IBUS_CAP_PREEDIT);
+        ibus_input_context_set_capabilities (x11ic-&gt;context, IBUS_CAP_FOCUS | IBUS_CAP_PREEDIT_TEXT);
     }
     else {
-        ibus_im_client_set_capabilities (_client, x11ic-&gt;ibus_ic,
-                IBUS_CAP_FOCUS);
+        ibus_input_context_set_capabilities (x11ic-&gt;context, IBUS_CAP_FOCUS);
     }
 
     g_hash_table_insert (_x11_ic_table,
@@ -352,16 +386,23 @@ xim_destroy_ic (XIMS xims, IMChangeICStruct *call_data)
                 (gconstpointer)(unsigned long)call_data-&gt;icid);
     g_return_val_if_fail (x11ic != NULL, 0);
 
-    ibus_im_client_release_input_context (_client, x11ic-&gt;ibus_ic);
+    if (x11ic-&gt;context) {
+        ibus_object_destroy ((IBusObject *)x11ic-&gt;context);
+        g_object_unref (x11ic-&gt;context);
+        x11ic-&gt;context = NULL;
+    }
 
-    g_hash_table_remove (_ibus_ic_table, x11ic-&gt;ibus_ic);
     g_hash_table_remove (_x11_ic_table,
                 (gconstpointer)(unsigned long)call_data-&gt;icid);
     x11ic-&gt;conn-&gt;clients = g_list_remove (x11ic-&gt;conn-&gt;clients, (gconstpointer)x11ic);
 
     g_free (x11ic-&gt;preedit_string);
-    ibus_attr_list_unref (x11ic-&gt;preedit_attrs);
-    g_free (x11ic-&gt;ibus_ic);
+    x11ic-&gt;preedit_string = NULL;
+
+    if (x11ic-&gt;preedit_attrs) {
+        g_object_unref (x11ic-&gt;preedit_attrs);
+        x11ic-&gt;preedit_attrs = NULL;
+    }
 
     g_slice_free (X11IC, x11ic);
 
@@ -380,7 +421,7 @@ xim_set_ic_focus (XIMS xims, IMChangeFocusStruct *call_data)
                 (gconstpointer)(unsigned long)call_data-&gt;icid);
     g_return_val_if_fail (x11ic != NULL, 0);
 
-    ibus_im_client_focus_in (_client, x11ic-&gt;ibus_ic);
+    ibus_input_context_focus_in (x11ic-&gt;context);
     _xim_set_cursor_location (x11ic);
 
     return 1;
@@ -398,7 +439,7 @@ xim_unset_ic_focus (XIMS xims, IMChangeFocusStruct *call_data)
             (gconstpointer)(unsigned long)call_data-&gt;icid);
     g_return_val_if_fail (x11ic != NULL, 0);
 
-    ibus_im_client_focus_out (_client, x11ic-&gt;ibus_ic);
+    ibus_input_context_focus_out (x11ic-&gt;context);
 
     return 1;
 
@@ -426,8 +467,12 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
     event.send_event = xevent-&gt;send_event;
     event.window = NULL;
 
-    if (ibus_im_client_filter_keypress (_client,
-                    x11ic-&gt;ibus_ic, &amp;event, False)) {
+    if (event.type == GDK_KEY_RELEASE) {
+        event.state |= IBUS_RELEASE_MASK;
+    }
+
+    if (ibus_input_context_process_key_event (x11ic-&gt;context,
+                event.keyval, event.state)) {
         if (! x11ic-&gt;has_preedit_area) {
             _xim_set_cursor_location (x11ic);
         }
@@ -479,12 +524,19 @@ _free_ic (gpointer data, gpointer user_data)
     g_return_if_fail (x11ic != NULL);
 
     g_free (x11ic-&gt;preedit_string);
-    ibus_attr_list_unref (x11ic-&gt;preedit_attrs);
-    g_free (x11ic-&gt;ibus_ic);
+
+    if (x11ic-&gt;preedit_attrs) {
+        g_object_unref (x11ic-&gt;preedit_attrs);
+        x11ic-&gt;preedit_attrs = NULL;
+    }
+
+    if (x11ic-&gt;context) {
+        ibus_object_destroy ((IBusObject *)x11ic-&gt;context);
+        g_object_unref (x11ic-&gt;context);
+        x11ic-&gt;context = NULL;
+    }
 
     /* Remove the IC from g_client dictionary */
-    g_hash_table_remove (_ibus_ic_table,
-                (gconstpointer)(unsigned long)x11ic-&gt;ibus_ic);
     g_hash_table_remove (_x11_ic_table,
                 (gconstpointer)(unsigned long)x11ic-&gt;icid);
 
@@ -551,8 +603,11 @@ _xim_set_cursor_location (X11IC *x11ic)
         }
     }
 
-    ibus_im_client_set_cursor_location (_client,
-            x11ic-&gt;ibus_ic, &amp;preedit_area);
+    ibus_input_context_set_cursor_location (x11ic-&gt;context,
+            preedit_area.x,
+            preedit_area.y,
+            preedit_area.width,
+            preedit_area.height);
 }
 
 
@@ -618,7 +673,7 @@ xim_reset_ic (XIMS xims, IMResetICStruct *call_data)
                 (gconstpointer)(unsigned long)call_data-&gt;icid);
     g_return_val_if_fail (x11ic != NULL, 0);
 
-    ibus_im_client_reset (_client, x11ic-&gt;ibus_ic);
+    ibus_input_context_reset (x11ic-&gt;context);
 
     return 1;
 }
@@ -702,23 +757,29 @@ _xim_forward_gdk_event (GdkEventKey *event, X11IC *x11ic)
 }
 
 static void
-_client_disconnected_cb (IBusIMClient *client, gpointer user_data)
+_bus_disconnected_cb (IBusBus  *bus,
+                      gpointer  user_data)
 {
     g_warning (&quot;Connection closed by ibus-daemon&quot;);
+    g_object_unref (_bus);
+    _bus = NULL;
     exit(EXIT_SUCCESS);
 }
 
 static void
-_client_commit_string_cb (IBusIMClient *client, const gchar *ic, const gchar *string, gpointer user_data)
+_context_commit_text_cb (IBusInputContext *context,
+                         IBusText         *text,
+                         X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
+    g_assert (IBUS_IS_TEXT (text));
+    g_assert (x11ic != NULL);
 
     XTextProperty tp;
     IMCommitStruct cms = {0};
 
     Xutf8TextListToTextProperty (GDK_DISPLAY (),
-        (gchar **)&amp;string, 1, XCompoundTextStyle, &amp;tp);
+        (gchar **)&amp;(text-&gt;text), 1, XCompoundTextStyle, &amp;tp);
 
     cms.major_code = XIM_COMMIT;
     cms.icid = x11ic-&gt;icid;
@@ -731,12 +792,12 @@ _client_commit_string_cb (IBusIMClient *client, const gchar *ic, const gchar *st
 }
 
 static void
-_client_forward_event_cb (IBusIMClient *client, const gchar *ic, GdkEvent *event, gpointer user_data)
+_context_forward_key_event_cb (IBusInputContext *context,
+                               X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (x11ic);
 
-    _xim_forward_gdk_event (&amp;(event-&gt;key), x11ic);
+    // _xim_forward_gdk_event (&amp;(event-&gt;key), x11ic);
 }
 
 static void
@@ -759,21 +820,27 @@ _update_preedit (X11IC *x11ic)
 }
 
 static void
-_client_update_preedit_cb (IBusIMClient *client, const gchar *ic, const gchar *string,
-    IBusAttrList *attrs, gint cursor_pos, gboolean visible, gpointer user_data)
+_context_update_preedit_text_cb (IBusInputContext *context,
+                                 IBusText         *text,
+                                 gint              cursor_pos,
+                                 gboolean          visible,
+                                 X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
+    g_assert (IBUS_IS_TEXT (text));
+    g_assert (x11ic);
 
     if (x11ic-&gt;preedit_string) {
         g_free(x11ic-&gt;preedit_string);
     }
-    x11ic-&gt;preedit_string = g_strdup(string);
+    x11ic-&gt;preedit_string = g_strdup(text-&gt;text);
 
     if (x11ic-&gt;preedit_attrs) {
-        ibus_attr_list_unref (x11ic-&gt;preedit_attrs);
+        g_object_unref (x11ic-&gt;preedit_attrs);
     }
-    x11ic-&gt;preedit_attrs = ibus_attr_list_ref(attrs);
+
+    g_object_ref(text-&gt;attrs);
+    x11ic-&gt;preedit_attrs = text-&gt;attrs;
 
     x11ic-&gt;preedit_cursor = cursor_pos;
     x11ic-&gt;preedit_visible = visible;
@@ -782,74 +849,62 @@ _client_update_preedit_cb (IBusIMClient *client, const gchar *ic, const gchar *s
 }
 
 static void
-_client_show_preedit_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_context_show_preedit_text_cb (IBusInputContext *context,
+                               X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
+    g_assert (x11ic);
 
     x11ic-&gt;preedit_visible = TRUE;
     _update_preedit (x11ic);
 }
 
 static void
-_client_hide_preedit_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_context_hide_preedit_text_cb (IBusInputContext *context,
+                               X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
+    g_assert (x11ic);
 
     x11ic-&gt;preedit_visible = FALSE;
     _update_preedit (x11ic);
 }
 
 static void
-_client_enabled_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_context_enabled_cb (IBusInputContext *context,
+                    X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
+    g_assert (x11ic);
 
     _xim_preedit_start (_xims, x11ic);
 }
 
 static void
-_client_disabled_cb (IBusIMClient *client, const gchar *ic, gpointer user_data)
+_context_disabled_cb (IBusInputContext *context,
+                    X11IC            *x11ic)
 {
-    X11IC *x11ic = g_hash_table_lookup (_ibus_ic_table, ic);
-    g_return_if_fail (x11ic != NULL);
+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
+    g_assert (x11ic);
 
     _xim_preedit_end (_xims, x11ic);
 }
 
 static void
-_init_ibus_client (void)
+_init_ibus (void)
 {
-    if (_client != NULL)
+    if (_bus != NULL)
         return;
+    ibus_init ();
 
-    ibus_im_client_register_type (NULL);
-
-    _client = ibus_im_client_new ();
+    _bus = ibus_bus_new ();
 
-    if (!ibus_im_client_get_connected (_client)) {
+    if (!ibus_bus_is_connected (_bus)) {
         g_error (&quot;Can not connect to ibus-daemon!&quot;);
     }
 
-    g_signal_connect (_client, &quot;disconnected&quot;,
-                        G_CALLBACK (_client_disconnected_cb), NULL);
-    g_signal_connect (_client, &quot;commit-string&quot;,
-                        G_CALLBACK (_client_commit_string_cb), NULL);
-    g_signal_connect (_client, &quot;forward-event&quot;,
-                        G_CALLBACK (_client_forward_event_cb), NULL);
-
-    g_signal_connect (_client, &quot;update-preedit&quot;,
-                        G_CALLBACK (_client_update_preedit_cb), NULL);
-    g_signal_connect (_client, &quot;show-preedit&quot;,
-                        G_CALLBACK (_client_show_preedit_cb), NULL);
-    g_signal_connect (_client, &quot;hide-preedit&quot;,
-                        G_CALLBACK (_client_hide_preedit_cb), NULL);
-    g_signal_connect (_client, &quot;enabled&quot;,
-                        G_CALLBACK (_client_enabled_cb), NULL);
-    g_signal_connect (_client, &quot;disabled&quot;,
-                        G_CALLBACK (_client_disabled_cb), NULL);
+    g_signal_connect (_bus, &quot;disconnected&quot;,
+                        G_CALLBACK (_bus_disconnected_cb), NULL);
 }
 
 static void
@@ -915,9 +970,9 @@ _xim_init_IMdkit ()
         IMFilterEventMask, KeyPressMask | KeyReleaseMask,
         NULL);
 
-    _init_ibus_client ();
+    _init_ibus ();
 
-    if (!ibus_im_client_get_connected (_client)) {
+    if (!ibus_bus_is_connected (_bus)) {
         g_warning (&quot;Can not connect to ibus daemon&quot;);
         exit (1);
     }
@@ -926,7 +981,9 @@ _xim_init_IMdkit ()
 static void
 _atexit_cb ()
 {
-    ibus_im_client_kill_daemon(_client);
+    if (_bus) {
+        ibus_bus_kill(_bus);
+    }
 }
 
 static void
@@ -1021,7 +1078,6 @@ main (int argc, char **argv)
     }
 
     _x11_ic_table = g_hash_table_new (g_direct_hash, g_direct_equal);
-    _ibus_ic_table = g_hash_table_new (g_str_hash, g_str_equal);
     _connections = g_hash_table_new (g_direct_hash, g_direct_equal);
 
     signal (SIGINT, _sighandler);</diff>
      <filename>client/x11/main.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,9 +21,9 @@
 
 # if not 1, append datestamp to the version number.
 m4_define([ibus_released], [0])
-m4_define([ibus_major_version], [0])
+m4_define([ibus_major_version], [1])
 m4_define([ibus_minor_version], [1])
-m4_define([ibus_micro_version], [1])
+m4_define([ibus_micro_version], [0])
 m4_define(ibus_maybe_datestamp,
     m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
 
@@ -49,20 +49,34 @@ AC_ISC_POSIX
 AC_HEADER_STDC
 AM_PROG_LIBTOOL
 
+# If only source code changed, lt_revision + 1
+# If any interface added, lt_age + 1
+# If any interfaces changed or removed, lt_current + 1
+m4_define([lt_current], [0])
+m4_define([lt_revision], [0])
+m4_define([lt_age], [0])
+LT_VERSION_INFO=&quot;lt_current:lt_revision:lt_age&quot;
+AC_SUBST(LT_VERSION_INFO)
+
 # check inotify
 AC_CHECK_HEADERS([sys/inotify.h])
 
 # check glib2
 AM_PATH_GLIB_2_0
 PKG_CHECK_MODULES(GLIB2, [
-    glib-2.0 &gt;= 2.16
+    glib-2.0 &gt;= 2.18
 ])
 PKG_CHECK_MODULES(GOBJECT2, [
-    gobject-2.0
+    gobject-2.0 &gt;= 2.18
+])
+PKG_CHECK_MODULES(GIO2, [
+    gio-2.0 &gt;= 2.18
+])
+PKG_CHECK_MODULES(PYGOBJECT2, [
+    pygobject-2.0 &gt;= 2.15
 ])
 
-
-# check gtk, gdk &amp; pygtk
+# check for gtk, gdk &amp; pygtk
 PKG_CHECK_MODULES(GTK2, [
     gtk+-2.0
 ])
@@ -74,9 +88,11 @@ PKG_CHECK_MODULES(GDK2, [
     gdk-2.0
 ])
 
-# check dbus-glib
+# check for gtk-doc
+GTK_DOC_CHECK(1.9)
+# check for dbus-glib
 PKG_CHECK_MODULES(DBUS, [
-    dbus-glib-1
+    dbus-1
 ])
 
 # Check for Qt4
@@ -131,6 +147,9 @@ AC_SUBST(PYTHON_CFLAGS)
 AC_SUBST(PYTHON_INCLUDES)
 AC_SUBST(PYTHON_LIBS)
 
+#
+REBUILD = #
+AC_SUBST(REBUILD)
 
 # define GETTEXT_* variables
 GETTEXT_PACKAGE=ibus
@@ -158,32 +177,9 @@ AC_ARG_ENABLE(qt4-immodule,
 if test x&quot;$IBUS_HAS_QT4&quot; != x&quot;yes&quot;; then
     enable_qt4=no
 fi
+enable_qt=no
 AM_CONDITIONAL(IBUS_BUILD_QT4, [test x&quot;$enable_qt4&quot; = x&quot;yes&quot; ])
 
-# check pygtk gconf for pygconf
-AC_ARG_ENABLE(pygconf,
-    AS_HELP_STRING([--enable-pygconf],
-        [Build python gconf binding, with it ibus will not depend on gnome-python]),
-    [enable_pygconf=$enableval],
-    [enable_pygconf=no],
-)
-
-PKG_CHECK_MODULES(PYGTK,
-    pygtk-2.0 &gt;= 2.10.3,
-    [IBUS_HAS_PYGTK=yes],
-    [IBUS_HAS_PYGTK=no]
-)
-AC_SUBST(PYGTK_CFLAGS)
-AC_SUBST(PYGTK_LIBS)
-if test x&quot;$IBUS_HAS_PYGTK&quot; != x&quot;yes&quot; -a x&quot;$enable_pygconf&quot; = x&quot;yes&quot;; then
-  AC_MSG_ERROR(can not build python gconf binding without pygtk-2.0)
-fi
-
-AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
-if test x&quot;$PYGTK_CODEGEN&quot; = x&quot;no&quot; -a x&quot;$enable_pygconf&quot; = x&quot;yes&quot;; then
-  AC_MSG_ERROR(can not build python gconf binding without pygtk-codegen-2.0)
-fi
-
 PKG_CHECK_MODULES(GCONF,
     [gconf-2.0 &gt;= 2.11.1],
     [IBUS_HAS_GCONF=yes],
@@ -191,11 +187,6 @@ PKG_CHECK_MODULES(GCONF,
 )
 AC_SUBST(GCONF_CFLAGS)
 AC_SUBST(GCONF_LIBS)
-if test x&quot;$IBUS_HAS_GCONF&quot; != x&quot;yes&quot; -a x&quot;$enable_pygconf&quot; = x&quot;yes&quot;; then
-  AC_MSG_ERROR(can not build python gconf binding without gconf-2.0)
-fi
-
-AM_CONDITIONAL(IBUS_BUILD_PYGCONF, [test x&quot;$enable_pygconf&quot; = x&quot;yes&quot; ])
 
 # check iso-codes
 AC_ARG_ENABLE(iso-codes-check,
@@ -220,22 +211,17 @@ fi
 # OUTPUT files
 AC_CONFIG_FILES([ po/Makefile.in
 Makefile
+ibus-1.0.pc
 ibus.spec
 ibus/_config.py
 ibus/Makefile
 ibus/interface/Makefile
-daemon/Makefile
-daemon/ibus-daemon
-launcher/ibus
-launcher/ibus.desktop
-launcher/Makefile
 ui/Makefile
 ui/gtk/Makefile
 ui/gtk/ibus-ui-gtk
+ui/gtk/gtkpanel.xml
 gconf/Makefile
-gconf/ibus-gconf
-lib/Makefile
-lib/gtk2/Makefile
+gconf/gconf.xml
 client/Makefile
 client/gtk2/Makefile
 client/qt4/Makefile
@@ -243,10 +229,16 @@ client/x11/Makefile
 setup/Makefile
 setup/ibus-setup
 setup/ibus-setup.desktop
+src/Makefile
+bus/Makefile
+bindings/Makefile
+bindings/python/Makefile
 util/Makefile
 util/IMdkit/Makefile
-util/gconf/Makefile
 icons/Makefile
+docs/Makefile
+docs/reference/Makefile
+docs/reference/ibus/Makefile
 m4/Makefile
 ])
 
@@ -259,6 +251,6 @@ Build options:
   Build static libs        $enable_static
   Gtk immodule dir         $GTK_IM_MODULEDIR
   Enable Qt4 IM module     $enable_qt4
-  Build pygconf            $enable_pygconf
+  Build document           $enable_gtk_doc
 ])
 </diff>
      <filename>configure.ac</filename>
    </modified>
    <modified>
      <diff>@@ -19,22 +19,54 @@
 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 # Boston, MA  02111-1307  USA
 
-gconf_PYTHON = \
-	config.py \
-	main.py \
+libibus = $(top_builddir)/src/libibus.la
+
+INCLUDES = \
+	-I$(top_srcdir)/src \
+	$(NULL)
+
+AM_CFLAGS = \
+	@GLIB2_CFLAGS@ \
+	@GCONF_CFLAGS@ \
+	@DBUS_CFLAGS@ \
+	-DG_LOG_DOMAIN=\&quot;IBUS\&quot; \
+	$(INCLUDES) \
+	$(NULL)
+AM_LDFLAGS = \
+	@GLIB2_LIBS@ \
+	@GCONF_LIBS@ \
+	@DBUS_LIBS@ \
+	$(libibus) \
+	$(NULL)
+
+libexec_PROGRAMS = \
+	ibus-gconf \
 	$(NULL)
 
-gconfdir = $(pkgdatadir)/gconf
+ibus_gconf_SOURCES = \
+	main.c \
+	config.c \
+	config.h \
+	$(NULL)
+ibus_gconf_CFLAGS = \
+	$(AM_CFLAGS) \
+	$(NULL)
+ibus_gconf_LDFLAGS = \
+	$(AM_LDFLAGS) \
+	$(NULL)
 
-bin_SCRIPTS = ibus-gconf
+component_DATA = \
+	gconf.xml \
+	$(NULL)
+componentdir = $(pkgdatadir)/component
 
 CLEANFILES = \
 	*.pyc \
 	$(NULL)
 
 EXTRA_DIST = \
-	ibus-gconf.in \
+	gconf.xml.in \
 	$(NULL)
 
-test:
-	$(ENV) PYTHONPATH=$(top_srcdir) $(PYTHON) $(srcdir)/main.py
+$(libibus):
+	$(MAKE) -C $(top_builddir)/src</diff>
      <filename>gconf/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -13,10 +13,13 @@ Source1:    xinput-ibus
 
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+%define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] &amp;&amp; pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n &quot;999&quot;)
+
 BuildRequires:  gettext-devel
 BuildRequires:  libtool
 BuildRequires:  python
 BuildRequires:  gtk2-devel
+BuildRequires:  dbus-devel
 BuildRequires:  qt-devel
 BuildRequires:  dbus-glib-devel
 BuildRequires:  desktop-file-utils
@@ -26,6 +29,7 @@ Requires(post):  %{_sbindir}/alternatives
 Requires(postun):  desktop-file-utils
 Requires(postun):  %{_sbindir}/alternatives
 
+Requires:   glib2 &gt;= %{glib_ver}
 Requires:   pygtk2
 Requires:   dbus-python &gt;= 0.83.0
 Requires:   gnome-python2-gconf
@@ -33,6 +37,8 @@ Requires:   notification-daemon
 Requires:   pyxdg
 Requires:   iso-codes
 
+%define _xinputconf %{_sysconfdir}/X11/xinit/xinput.d/ibus.conf
+
 %description
 IBus means Intelligent Input Bus. It is a new input framework for Linux OS. It provides
 full featured and user friendly input method user interface. It also may help
@@ -55,7 +61,16 @@ Requires:   qt &gt;= 4.4.2
 %description qt
 This package contains ibus im module for qt4
 
-%define _xinputconf %{_sysconfdir}/X11/xinit/xinput.d/ibus.conf
+%package devel
+Summary:    Development tools for ibus
+Group:      Development/Libraries
+Requires:   %{name} = %{version}-%{release}
+Requires:   glib2-devel
+Requires:   dbus-devel
+
+%description devel
+The ibus-devel package contains the header files and developer
+docs for ibus.
 
 %prep
 %setup -q
@@ -68,8 +83,7 @@ make %{?_smp_mflags}
 %install
 rm -rf $RPM_BUILD_ROOT
 make DESTDIR=${RPM_BUILD_ROOT} install
-rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-gtk.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-gtk.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/libibus.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ibus.la
 
 # install xinput config file
@@ -112,26 +126,15 @@ fi
 %dir %{python_sitelib}/ibus
 %{python_sitelib}/ibus/*
 %dir %{_datadir}/ibus/
-%dir %{_datadir}/ibus/daemon/
-%dir %{_datadir}/ibus/gconf/
-%dir %{_datadir}/ibus/ui
-%dir %{_datadir}/ibus/setup/
-%dir %{_datadir}/ibus/engine/
-%dir %{_datadir}/ibus/icons/
-%{_bindir}/ibus
+%{_bindir}/ibus-daemon
 %{_bindir}/ibus-setup
-%{_libdir}/libibus-gtk.so*
-%{_datadir}/ibus/daemon/*
-%{_datadir}/ibus/gconf/*
-%{_datadir}/ibus/ui/*
-%{_datadir}/ibus/setup/*
-%{_datadir}/ibus/icons/*
+%{_libdir}/libibus.so*
+%{_datadir}/ibus/*
 %{_datadir}/applications/*
 %{_datadir}/pixmaps/*
-%{_bindir}/ibus-daemon
-%{_bindir}/ibus-gconf
-%{_bindir}/ibus-ui-gtk
-%{_bindir}/ibus-x11
+%{_libexecdir}/ibus-gconf
+%{_libexecdir}/ibus-ui-gtk
+%{_libexecdir}/ibus-x11
 %config %{_xinputconf}
 
 %files gtk
@@ -142,6 +145,13 @@ fi
 %defattr(-,root,root,-)
 %{_libdir}/qt4/plugins/inputmethods/libibus.so
 
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/lib*.so
+%{_includedir}/*
+%{_datadir}/gtk-doc/html/*
+%{_libdir}/pkgconfig/*
+
 %changelog
 * Thu Aug 07 2008 Huang Peng &lt;shawn.p.huang@gmail.com&gt; - @VERSION@-1
 - The first version.</diff>
      <filename>ibus.spec.in</filename>
    </modified>
    <modified>
      <diff>@@ -28,10 +28,11 @@ ibus_PYTHON = \
 	attribute.py \
 	common.py \
 	bus.py \
+	inputcontext.py \
 	engine.py \
 	exception.py \
 	factory.py \
-	gtk.py \
+	_gtk.py \
 	__init__.py \
 	keysyms.py \
 	lang.py \
@@ -41,6 +42,11 @@ ibus_PYTHON = \
 	panel.py \
 	notifications.py \
 	property.py \
+	serializable.py \
+	text.py \
+	component.py \
+	enginedesc.py \
+	observedpath.py \
 	utility.py \
 	config.py \
 	_config.py \</diff>
      <filename>ibus/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ from interface import *
 from exception import *
 from lookuptable import *
 from bus import *
+from inputcontext import *
 from lang import *
 from utility import *
 from engine import *
@@ -34,4 +35,9 @@ from factory import *
 from panel import *
 from notifications import *
 from config import *
+from serializable import *
+from text import *
+from observedpath import *
+from enginedesc import *
+from component import *
 from _config import *</diff>
      <filename>ibus/__init__.py</filename>
    </modified>
    <modified>
      <diff>@@ -32,12 +32,12 @@ __all__ = (
         &quot;AttributeForeground&quot;,
         &quot;AttributeBackground&quot;,
         &quot;AttrList&quot;,
-        &quot;attribute_from_dbus_value&quot;,
-        &quot;attr_list_from_dbus_value&quot;,
         &quot;ARGB&quot;, &quot;RGB&quot;
     )
 
 import dbus
+from exception import IBusException
+from serializable import *
 
 ATTR_TYPE_UNDERLINE = 1
 ATTR_TYPE_FOREGROUND = 2
@@ -48,8 +48,10 @@ ATTR_UNDERLINE_SINGLE = 1
 ATTR_UNDERLINE_DOUBLE = 2
 ATTR_UNDERLINE_LOW = 3
 
-class Attribute:
-    def __init__ (self, type, value, start_index, end_index):
+class Attribute(Serializable):
+    __NAME__ = &quot;IBusAttribute&quot;
+    def __init__ (self, type=0, value=0, start_index=0, end_index=0):
+        super(Attribute, self).__init__()
         self.__type = type
         self.__value = value
         self.__start_index = start_index
@@ -72,30 +74,25 @@ class Attribute:
     start_index = property(get_start_index)
     end_index   = property(get_end_index)
 
-    def to_dbus_value (self):
-        values = [dbus.UInt32 (self.__type),
-                dbus.UInt32 (self.__value),
-                dbus.UInt32 (self.__start_index),
-                dbus.UInt32 (self.__end_index)]
-        return dbus.Struct (values, signature=&quot;uuuu&quot;)
-
-    def from_dbus_value (self, value):
-        if not isinstance (value, dbus.Struct):
-            raise dbus.Exception (&quot;Attribute must be dbus.Struct uuuu&quot;)
-
-        if len (value) != 4 or not all (map (lambda x: isinstance (x, dbus.UInt32), value)):
-            raise dbus.Exception (&quot;Attribute must be dbus.Struct uuuu&quot;)
-
-        self.__type = value[0]
-        self.__value = value[1]
-        self.__start_index = value[2]
-        self.__end_index = value[3]
-
-def attribute_from_dbus_value (value):
-    attribute = Attribute (0, 0, 0, 0)
-    attribute.from_dbus_value (value)
-    return attribute
-        
+    def serialize(self, struct):
+        super(Attribute, self).serialize(struct)
+        struct.append (dbus.UInt32(self.__type))
+        struct.append (dbus.UInt32(self.__value))
+        struct.append (dbus.UInt32(self.__start_index))
+        struct.append (dbus.UInt32(self.__end_index))
+
+    def deserialize(self, struct):
+        super(Attribute, self).deserialize(struct)
+        if len(struct) &lt; 4:
+            raise IBusException (&quot;Can not deserialize IBusAttribute&quot;)
+
+        self.__type = struct.pop(0)
+        self.__value = struct.pop(0)
+        self.__start_index = struct.pop(0)
+        self.__end_index = struct.pop(0)
+
+serializable_register(Attribute)
+
 class AttributeUnderline (Attribute):
     def __init__(self, value, start_index, end_index):
         Attribute.__init__ (self, ATTR_TYPE_UNDERLINE, value, start_index, end_index)
@@ -114,8 +111,10 @@ def ARGB (a, r, g, b):
 def RGB (r, g, b):
     return ARGB (255, r, g, b)
 
-class AttrList:
+class AttrList(Serializable):
+    __NAME__ = &quot;IBusAttrList&quot;
     def __init__ (self, attrs = []):
+        super(AttrList, self).__init__()
         self._attrs = []
         for attr in attrs:
             self.append (attr)
@@ -124,29 +123,31 @@ class AttrList:
         assert isinstance (attr, Attribute)
         self._attrs.append (attr)
 
-    def to_dbus_value (self):
-        array = dbus.Array (signature = &quot;v&quot;)
-        for attr in self._attrs:
-            array.append (attr.to_dbus_value ())
-        return array
-
-    def from_dbus_value (self, value):
-        attrs = []
-        if not isinstance (value, dbus.Array):
-            raise IBusException (&quot;AttrList must from dbus.Array (uuuu)&quot;)
-
-        for v in value:
-            attr = attribute_from_dbus_value (v)
-            attrs.append (attr)
+    def serialize (self, struct):
+        super(AttrList, self).serialize (struct)
+        array = map (lambda a: serialize_object(a), self._attrs)
+        array = dbus.Array (array, signature = &quot;v&quot;)
+        struct.append(array)
 
+    def deserialize (self, struct):
+        super(AttrList, self).deserialize(struct)
+        attrs = map(lambda v: deserialize_object(v), struct.pop(0))
         self._attrs = attrs
 
     def __iter__ (self):
         return self._attrs.__iter__ ()
 
-def attr_list_from_dbus_value (value):
-    if len(value) == 0:
-        return None
-    attrs = AttrList ()
-    attrs.from_dbus_value (value)
-    return attrs
+serializable_register(AttrList)
+
+def test():
+    attr_list = AttrList()
+    attr_list.append (Attribute())
+    attr_list.append (Attribute())
+    attr_list.append (Attribute())
+    attr_list.append (Attribute())
+    attr_list.append (Attribute())
+    value = serialize_object(attr_list)
+    attr_list = deserialize_object(value)
+
+if __name__ == &quot;__main__&quot;:
+    test()</diff>
      <filename>ibus/attribute.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,95 +23,27 @@ __all__ = (
         &quot;Bus&quot;,
     )
 
-import sys
-import gobject
 import dbus
 import dbus.lowlevel
 import dbus.connection
 import dbus.mainloop.glib
-import ibus
+import gobject
+import common
+import object
+import serializable
+import config
 
 dbus.mainloop.glib.DBusGMainLoop(set_as_default = True)
 
-class Bus(ibus.Object):
+class Bus(object.Object):
     __gsignals__ = {
-        &quot;commit-string&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, gobject.TYPE_STRING)
-        ),
-        &quot;update-preedit&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_INT, gobject.TYPE_BOOLEAN)
-        ),
-        &quot;show-preedit&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;hide-preedit&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;update-aux-string&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)
-        ),
-        &quot;show-aux-string&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;hide-aux-string&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;update-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)
-        ),
-        &quot;show-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;hide-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;page-up-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;page-down-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;cursor-up-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;cursor-down-lookup-table&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
-            gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, )
-        ),
-        &quot;config-value-changed&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
+        &quot;disconnected&quot; : (
+            gobject.SIGNAL_RUN_LAST,
             gobject.TYPE_NONE,
-            (gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
+            ()
         ),
         &quot;config-reloaded&quot; : (
-            gobject.SIGNAL_RUN_FIRST,
+            gobject.SIGNAL_RUN_LAST,
             gobject.TYPE_NONE,
             ()
         ),
@@ -119,29 +51,36 @@ class Bus(ibus.Object):
 
     def __init__(self):
         super(Bus, self).__init__()
-        self.__dbusconn = dbus.connection.Connection(ibus.IBUS_ADDR)
-        self.__ibus = self.__dbusconn.get_object(ibus.IBUS_NAME,
-                                            ibus.IBUS_PATH)
+        self.__dbusconn = dbus.connection.Connection(common.IBUS_ADDR)
         self.__dbus = self.__dbusconn.get_object(dbus.BUS_DAEMON_NAME,
-                                            dbus.BUS_DAEMON_PATH)
-        self.__dbusconn.add_message_filter(self.__dbus_message_cb)
+                                                 dbus.BUS_DAEMON_PATH)
         self.__unique_name = self.hello()
+        self.__ibus = self.__dbusconn.get_object(common.IBUS_SERVICE_IBUS,
+                                                 common.IBUS_PATH_IBUS)
 
-        try:
-            unique_name = self.get_name_owner(ibus.IBUS_CONFIG_NAME)
-            self.__config = self.__dbusconn.get_object(unique_name,
-                                            ibus.IBUS_CONFIG_PATH)
-        except:
-            self.__config = None
-        self.add_match(
-            &quot;type='signal',&quot;
-            &quot;interface='&quot; + dbus.BUS_DAEMON_IFACE + &quot;',&quot;
-            &quot;member='NameOwnerChanged',&quot;
-            &quot;arg0='&quot; + ibus.IBUS_CONFIG_NAME + &quot;'&quot;)
+        self.__dbusconn.call_on_disconnection(self.__dbusconn_disconnected_cb)
+        # self.__dbusconn.add_message_filter(self.__filter_cb)
+
+    def __filter_cb(self, conn, message):
+        if message.get_type() == 4:
+            print &quot;Signal %s&quot; % message.get_member()
+            print &quot; sender = %s&quot; % message.get_sender()
+            print &quot; path = %s&quot; % message.get_path()
+        return dbus.lowlevel.HANDLER_RESULT_NOT_YET_HANDLED
+
+    def __dbusconn_disconnected_cb(self, dbusconn):
+        assert self.__dbusconn == dbusconn
+        self.__dbusconn = None
+        self.emit(&quot;disconnected&quot;)
 
     def get_name(self):
         return self.__unique_name
 
+    def get_is_connected(self):
+        if self.__dbusconn == None:
+            return False
+        return self.__dbusconn.get_is_connected()
+
     # define dbus methods
     def get_dbus(self):
         return self.__dbus
@@ -150,7 +89,7 @@ class Bus(ibus.Object):
         return self.__dbus.Hello()
 
     def request_name(self, name, flags):
-        return self.__dbus.RequestName(name, flags)
+        return self.__dbus.RequestName(name, dbus.UInt32 (flags))
 
     def release_name(self, name):
         return self.__dbus.ReleaseName(name)
@@ -168,209 +107,56 @@ class Bus(ibus.Object):
         return self.__dbusconn
 
     def get_address(self):
-        return ibus.IBUS_ADDR
-
-    def create_input_context(self, client_name):
-        return self.__ibus.CreateInputContext(client_name)
-
-    def release_input_context(self, ic):
-        return self.__ibus.ReleaseInputContext(ic)
-
-    def process_key_event(self, ic, keyval, is_press, state):
-        return self.__ibus.ProcessKeyEvent(ic, keyval, is_press, state)
-
-    def set_cursor_location(self, ic, x, y, w, h):
-        return self.__ibus.SetCursorLocation(ic, x, y, w, h)
-
-    def foucs_in(self, ic):
-        return self.__ibus.FocusIn(ic)
-
-    def foucs_out(self, ic):
-        return self.__ibus.FocusOut(ic)
-
-    def reset(self, ic):
-        return self.__ibus.Reset(ic)
+        return common.IBUS_ADDR
 
-    def is_enabled(self, ic):
-        return self.__ibus.IsEnabled(ic)
+    # define ibus methods
+    def register_component(self, component):
+        component = serializable.serialize_object(component)
+        return self.__ibus.RegisterComponent(component)
 
-    def set_capabilities(self, ic, caps):
-        return self.__ibus.SetCapabilities(ic, caps)
+    def list_engines(self):
+        engines = self.__ibus.ListEngines()
+        return map(serializable.deserialize_object, engines)
 
-    def register_factories(self, object_paths):
-        object_paths = dbus.Array(object_paths, signature=&quot;o&quot;)
-        return self.__ibus.RegisterFactories(object_paths, **ibus.DEFAULT_ASYNC_HANDLERS)
+    def list_active_engines(self):
+        engines = self.__ibus.ListActiveEngines()
+        return map(serializable.deserialize_object, engines)
 
-    def unregister_factories(self, object_paths):
-        return self.__ibus.UnregisterFactories(object_paths)
-
-    def register_config(self, object_path, replace = False):
-        return self.__ibus.RegisterConfig(object_path, replace)
-
-    def get_factories(self):
-        return self.__ibus.GetFactories()
-
-    def get_factory_info(self, factory_path):
-        return self.__ibus.GetFactoryInfo(factory_path)
-
-    def set_factory(self, factory_path):
-        return self.__ibus.SetFactory(factory_path)
-
-    def get_input_context_states(self, ic):
-        return self.__ibus.GetInputContextStates(ic)
-
-    def config_add_watch(self, section):
-        return self.add_match(
-                    &quot;type='signal',&quot;
-                    &quot;interface='&quot; + ibus.IBUS_CONFIG_NAME + &quot;',&quot;
-                    &quot;member='ValueChanged',&quot;
-                    &quot;arg0='&quot; + section + &quot;'&quot;
-                    )
+    def create_input_context(self, client_name):
+        return self.__ibus.CreateInputContext(client_name)
 
-    def config_remove_watch(self, section):
-        return self.remove_match(
-                    &quot;type='signal',&quot;
-                    &quot;interface='&quot; + ibus.IBUS_CONFIG_NAME + &quot;',&quot;
-                    &quot;member='ValueChanged',&quot;
-                    &quot;arg0='&quot; + section + &quot;'&quot;
-                    )
+    def kill(self):
+        return self.__ibus.Kill()
 
-    def config_set_value(self, section, name, value):
-        return self.__config.SetValue(section, name, value)
+    def get_config(self):
+        try:
+            return self.__config
+        except:
+            self.__config = config.Config(self)
+            return self.__config
 
-    def config_set_list(self, section, name, value, list_type):
-        value = dbus.Array(value, signature = list_type)
-        return self.__config.SetValue(section, name, value)
+def test():
+    import glib
+    import factory
+    import text
 
-    def config_get_value(self, section, name, default_value = None):
-        try:
-            return self.__config.GetValue(section, name)
-        except Exception, e:
-            return default_value
+    mainloop = glib.MainLoop()
 
-    def register_list_engines(self):
-        return self.__ibus.RegisterListEngines()
+    def __disconnected_cb(*args):
+        print &quot;Disconnected&quot;, args
+        mainloop.quit()
 
-    def register_reload_engines(self):
-        return self.__ibus.RegisterReloadEngines()
+    b = Bus()
+    b.connect(&quot;disconnected&quot;, __disconnected_cb)
 
-    def register_start_engine(self, lang, name):
-        return self.__ibus.RegisterStartEngine(lang, name)
+    print &quot;unique_name =&quot;, b.get_name()
 
-    def register_restart_engine(self, lang, name):
-        return self.__ibus.RegisterRestartEngine(lang, name)
+    for i in b.list_factories():
+        print i.name
 
-    def register_stop_engine(self, lang, name):
-        return self.__ibus.RegisterStopEngine(lang, name)
+    mainloop.run()
+    print &quot;Exit&quot;
 
-    def kill(self):
-        return self.__ibus.Kill()
 
-    def __dbus_message_cb(self, conn, message):
-        # name owner changed signal
-        if message.is_signal(dbus.BUS_DAEMON_IFACE, &quot;NameOwnerChanged&quot;):
-            args = message.get_args_list()
-            if args[0] == ibus.IBUS_CONFIG_NAME:
-                if args[2] != &quot;&quot;:
-                    self.__config = self.__dbusconn.get_object(args[2], ibus.IBUS_CONFIG_PATH)
-                else:
-                    self.__config = None
-                self.emit(&quot;config-reloaded&quot;)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        # commit string signal
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;CommitString&quot;):
-            args = message.get_args_list()
-            ic, string = args[0:2]
-            self.emit(&quot;commit-string&quot;, ic, string.encode(&quot;utf-8&quot;))
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-
-        # preedit signals
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;UpdatePreedit&quot;):
-            args = message.get_args_list()
-            ic, preedit, attrs, cursor_pos, visible = args[0:5]
-            attrs = ibus.attr_list_from_dbus_value(attrs)
-            self.emit(&quot;update-preedit&quot;, ic, preedit.encode(&quot;utf-8&quot;),
-                        attrs, cursor_pos, visible)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;ShowPreedit&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;show-preedit&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;HidePreedit&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;hide-preedit&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-
-        # aux string signals
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;UpdateAuxString&quot;):
-            args = message.get_args_list()
-            ic, aux_string, attrs, visible = args[0:4]
-            attrs = ibus.attr_list_from_dbus_value(attrs)
-            self.emit(&quot;update-aux-string&quot;, ic, aux_string.encode(&quot;utf-8&quot;),
-                        attrs, visible)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;ShowAuxString&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;show-aux-string&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;HideAuxString&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;hide-aux-string&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-
-        # lookup table signals
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;UpdateLookupTable&quot;):
-            args = message.get_args_list()
-            ic, lookup_table, visible = args[0:3]
-            lookup_table = ibus.lookup_table_from_dbus_value(lookup_table)
-            self.emit(&quot;update-lookup-table&quot;, ic, lookup_table, visible)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;ShowLookupTable&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;show-lookup-table&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;HideLookupTable&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;hide-lookup-table&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;PageUpLookupTable&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;page-up-lookup-table&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;PageDownLookupTable&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;page-down-lookup-table&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;CursorUpLookupTable&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;cursor-up-lookup-table&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        elif message.is_signal(ibus.IBUS_IFACE, &quot;CursorDownLookupTable&quot;):
-            args = message.get_args_list()
-            ic = args[0]
-            self.emit(&quot;cursor-down-lookup-table&quot;, ic)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-
-        # Config signals
-        elif message.is_signal(ibus.IBUS_CONFIG_IFACE, &quot;ValueChanged&quot;):
-            args = message.get_args_list()
-            section, name, value = args[0:3]
-            self.emit(&quot;config-value-changed&quot;, section, name, value)
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-
-        # DBUS Disconnected signal
-        elif message.is_signal(dbus.LOCAL_IFACE, &quot;Disconnected&quot;):
-            self.destroy()
-            retval = dbus.lowlevel.HANDLER_RESULT_HANDLED
-        else:
-            retval = dbus.lowlevel.HANDLER_RESULT_NOT_YET_HANDLED
-        return retval
+if __name__ == &quot;__main__&quot;:
+    test()</diff>
      <filename>ibus/bus.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,14 +21,15 @@
 
 __all__ = (
         &quot;IBUS_ADDR&quot;,
-        &quot;IBUS_IFACE&quot;,
-        &quot;IBUS_NAME&quot;,
-        &quot;IBUS_PATH&quot;,
-        &quot;IBUS_CONFIG_IFACE&quot;,
-        &quot;IBUS_ENGINE_FACTORY_IFACE&quot;,
-        &quot;IBUS_ENGINE_IFACE&quot;,
-        &quot;IBUS_PANEL_IFACE&quot;,
-        &quot;IBUS_NOTIFICATIONS_IFACE&quot;,
+        &quot;IBUS_IFACE_IBUS&quot;,
+        &quot;IBUS_SERVICE_IBUS&quot;,
+        &quot;IBUS_PATH_IBUS&quot;,
+        &quot;IBUS_IFACE_CONFIG&quot;,
+        &quot;IBUS_IFACE_PANEL&quot;,
+        &quot;IBUS_IFACE_ENGINE&quot;,
+        &quot;IBUS_IFACE_ENGINE_FACTORY&quot;,
+        &quot;IBUS_IFACE_INPUT_CONTEXT&quot;,
+        &quot;IBUS_IFACE_NOTIFICATIONS&quot;,
         &quot;default_reply_handler&quot;,
         &quot;default_error_handler&quot;,
         &quot;DEFAULT_ASYNC_HANDLERS&quot;,
@@ -67,15 +68,16 @@ if not __username:
 IBUS_ADDR = &quot;unix:path=/tmp/ibus-%s/ibus-%s&quot; % (__username, display.replace(&quot;:&quot;, &quot;-&quot;))
 # IBUS_ADDR  = &quot;tcp:host=localhost,port=7799&quot;
 
-IBUS_IFACE = &quot;org.freedesktop.IBus&quot;
-IBUS_PATH  = &quot;/org/freedesktop/IBus&quot;
-IBUS_NAME  = &quot;org.freedesktop.IBus&quot;
+IBUS_IFACE_IBUS     = &quot;org.freedesktop.IBus&quot;
+IBUS_PATH_IBUS      = &quot;/org/freedesktop/IBus&quot;
+IBUS_SERVICE_IBUS   = &quot;org.freedesktop.IBus&quot;
 
-IBUS_CONFIG_IFACE = &quot;org.freedesktop.ibus.Config&quot;
-IBUS_ENGINE_FACTORY_IFACE = &quot;org.freedesktop.ibus.EngineFactory&quot;
-IBUS_ENGINE_IFACE = &quot;org.freedesktop.ibus.Engine&quot;
-IBUS_PANEL_IFACE = &quot;org.freedesktop.ibus.Panel&quot;
-IBUS_NOTIFICATIONS_IFACE = &quot;org.freedesktop.ibus.Notifications&quot;
+IBUS_IFACE_PANEL            = &quot;org.freedesktop.IBus.Panel&quot;
+IBUS_IFACE_CONFIG           = &quot;org.freedesktop.IBus.Config&quot;
+IBUS_IFACE_ENGINE           = &quot;org.freedesktop.IBus.Engine&quot;
+IBUS_IFACE_ENGINE_FACTORY   = &quot;org.freedesktop.IBus.EngineFactory&quot;
+IBUS_IFACE_INPUT_CONTEXT    = &quot;org.freedesktop.IBus.InputContext&quot;
+IBUS_IFACE_NOTIFICATIONS    = &quot;org.freedesktop.IBus.Notifications&quot;
 
 def default_reply_handler( *args):
     pass</diff>
      <filename>ibus/common.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,17 +21,20 @@
 
 __all__ = (
         &quot;ConfigBase&quot;,
-        &quot;IBUS_CONFIG_NAME&quot;,
-        &quot;IBUS_CONFIG_PATH&quot;
+        &quot;IBUS_SERVICE_CONFIG&quot;,
+        &quot;IBUS_PATH_CONFIG&quot;
     )
 
-IBUS_CONFIG_NAME = &quot;org.freedesktop.ibus.Config&quot;
-IBUS_CONFIG_PATH = &quot;/org/freedesktop/ibus/Config&quot;
+IBUS_SERVICE_CONFIG = &quot;org.freedesktop.IBus.Config&quot;
+IBUS_PATH_CONFIG = &quot;/org/freedesktop/IBus/Config&quot;
 
-import ibus
-from ibus import interface
+import gobject
+import object
+import interface
+import dbus
+from dbus.proxies import ProxyObject
 
-class ConfigBase(ibus.Object):
+class ConfigBase(object.Object):
     def __init__(self, bus):
         super(ConfigBase, self).__init__()
         self.__proxy = ConfigProxy(self, bus.get_dbusconn())
@@ -48,7 +51,7 @@ class ConfigBase(ibus.Object):
 
 class ConfigProxy(interface.IConfig):
     def __init__ (self, config, dbusconn):
-        super(ConfigProxy, self).__init__(dbusconn, IBUS_CONFIG_PATH)
+        super(ConfigProxy, self).__init__(dbusconn, IBUS_PATH_CONFIG)
         self.__dbusconn = dbusconn
         self.__config = config
 
@@ -60,3 +63,80 @@ class ConfigProxy(interface.IConfig):
 
     def Destroy(self):
         self.__config.destroy()
+
+class Config(object.Object):
+    __gsignals__ = {
+        &quot;reloaded&quot; : (
+            gobject.SIGNAL_RUN_LAST,
+            gobject.TYPE_NONE,
+            ()
+        ),
+        &quot;value-changed&quot; : (
+            gobject.SIGNAL_RUN_LAST,
+            gobject.TYPE_NONE,
+            (gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
+        ),
+    }
+
+    def __init__(self, bus):
+        super(Config, self).__init__()
+        self.__bus = bus
+        self.__bus_name = None
+
+        self.__bus.add_match(&quot;type='signal',\
+                              sender='org.freedesktop.DBus',\
+                              member='NameOwnerChanged',\
+                              arg0='org.freedesktop.IBus.Config'&quot;)
+        self.__bus.get_dbusconn().add_signal_receiver(self.__name_owner_changed_cb, signal_name=&quot;NameOwnerChanged&quot;)
+
+        try:
+            self.__init_config()
+        except:
+            self.__config = None
+
+    def __name_owner_changed_cb(self, name, old_name, new_name):
+        if name == &quot;org.freedesktop.IBus.Config&quot;:
+            if new_name == &quot;&quot;:
+                self.__config = None
+            else:
+                self.__init_config(new_name)
+
+    def __init_config(self, bus_name=None):
+        if bus_name == None:
+            bus_name = self.__bus.get_name_owner(IBUS_SERVICE_CONFIG)
+
+        match_rule = &quot;type='signal',\
+                      sender='%s',\
+                      member='ValueChanged',\
+                      path='/org/freedesktop/IBus/Config'&quot;
+
+        if self.__bus_name:
+            self.__bus.remove_match(match_rule % self.__bus_name)
+            self.__bus_name = None
+
+        self.__config = self.__bus.get_dbusconn().get_object(bus_name, IBUS_PATH_CONFIG)
+        self.__config.connect_to_signal(&quot;ValueChanged&quot;, self.__value_changed_cb)
+
+        self.__bus_name = bus_name
+        self.__bus.add_match(match_rule % self.__bus_name)
+        self.emit(&quot;reloaded&quot;)
+
+    def __value_changed_cb(self, section, name, value):
+        self.emit(&quot;value-changed&quot;, section, name, value)
+
+    def get_value(self, section, name, default_value):
+        try:
+            return self.__config.GetValue(section, name)
+        except:
+            return default_value
+
+    def set_value(self, section, name, value):
+        try:
+            return self.__config.SetValue(section, name, value)
+        except:
+            return
+
+    def set_list(self, section, name, value, signature):
+        return self.set_value(section, name, dbus.Array(value, signature=signature))
+
+gobject.type_register(Config)</diff>
      <filename>ibus/config.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,15 +23,16 @@ __all__ = (
         &quot;EngineBase&quot;,
     )
 
-import ibus
-from ibus import interface
+import object
+import serializable
+import interface
 
-class EngineBase(ibus.Object):
+class EngineBase(object.Object):
     def __init__(self, bus, object_path):
         super(EngineBase, self).__init__()
         self.__proxy = EngineProxy (self, bus.get_dbusconn(), object_path)
 
-    def process_key_event(self, keyval, is_press, state):
+    def process_key_event(self, keyval, state):
         return False
 
     def focus_in(self):
@@ -73,39 +74,37 @@ class EngineBase(ibus.Object):
     def property_hide(self, prop_name):
         pass
 
-    def commit_string(self, text):
-        return self.__proxy.CommitString(text)
+    def commit_text(self, text):
+        text = serializable.serialize_object(text)
+        return self.__proxy.CommitText(text)
 
-    def forward_key_event(self, keyval, is_press, state):
-        return self.__proxy.ForwardKeyEvent(keyval, is_press, state)
+    def forward_key_event(self, keyval, state):
+        return self.__proxy.ForwardKeyEvent(keyval, state)
 
-    def update_preedit(self, text, attrs, cursor_pos, visible):
-        if attrs == None:
-            attrs = ibus.AttrList()
-        return self.__proxy.UpdatePreedit(text, attrs.to_dbus_value(), cursor_pos, visible)
+    def update_preedit_text(self, text, cursor_pos, visible):
+        text = serializable.serialize_object(text)
+        return self.__proxy.UpdatePreeditText(text, cursor_pos, visible)
 
-    def show_preedit(self):
-        return self.__proxy.ShowPreedit()
+    def show_preedit_text(self):
+        return self.__proxy.ShowPreeditText()
 
-    def hide_preedit(self):
-        return self.__proxy.HidePreedit()
+    def hide_preedit_text(self):
+        return self.__proxy.HidePreeditText()
 
-    def update_aux_string(self, text, attrs, visible):
-        if attrs == None:
-            attrs = ibus.AttrList()
-        return self.__proxy.UpdateAuxString(text, attrs.to_dbus_value(), visible)
+    def update_auxiliary_text(self, text, visible):
+        text = serializable.serialize_object(text)
+        return self.__proxy.UpdateAuxiliaryText(text, visible)
 
-    def show_aux_string(self):
-        return self.__proxy.ShowAuxString()
+    def show_auxiliary_text(self):
+        return self.__proxy.ShowAuxiliaryText()
 
-    def hide_aux_string(self):
-        return self.__proxy.HideAuxString()
+    def hide_auxiliary_text(self):
+        return self.__proxy.HideAuxiliaryText()
 
     def update_lookup_table(self, lookup_table, visible, just_current_page = False):
         if just_current_page:
-            dbus_values = lookup_table.current_page_to_dbus_value()
-        else:
-            dbus_values = lookup_table.to_dbus_value()
+            lookup_table = lookup_table.get_current_page_as_lookup_table()
+        dbus_values = serializable.serialize_object(lookup_table)
         return self.__proxy.UpdateLookupTable(dbus_values, visible)
 
     def show_lookup_table(self):
@@ -127,10 +126,12 @@ class EngineBase(ibus.Object):
         return self.__proxy.CursorDownLookupTable()
 
     def register_properties(self, props):
-        return self.__proxy.RegisterProperties(props.to_dbus_value())
+        dbus_values = serializable.serialize_object(props)
+        return self.__proxy.RegisterProperties(dbus_values)
 
     def update_property(self, prop):
-        return self.__proxy.UpdateProperty(prop.to_dbus_value())
+        dbus_values = serializable.serialize_object(prop)
+        return self.__proxy.UpdateProperty(dbus_values)
 
     def get_dbus_object(self):
         return self.__proxy
@@ -145,8 +146,8 @@ class EngineProxy(interface.IEngine):
         super(EngineProxy, self).__init__(conn, object_path)
         self.__engine = engine
 
-    def ProcessKeyEvent(self, keyval, is_press, state):
-        return self.__engine.process_key_event(keyval, is_press, state)
+    def ProcessKeyEvent(self, keyval, state):
+        return self.__engine.process_key_event(keyval, state)
 
     def FocusIn(self):
         return self.__engine.focus_in()</diff>
      <filename>ibus/engine.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,24 +21,19 @@
 
 __all__ = (
         &quot;EngineFactoryBase&quot;,
+        &quot;FactoryInfo&quot;
     )
-
-import ibus
-from ibus import interface
-
-class EngineFactoryBase(ibus.Object):
-    def __init__(self, info, engine_class, engine_path, bus, object_path):
+import dbus
+import object
+import interface
+from serializable import *
+from exception import *
+
+class EngineFactoryBase(object.Object):
+    def __init__(self, bus):
         super(EngineFactoryBase, self).__init__()
-        self.__proxy = EngineFactoryProxy (self, bus.get_dbusconn(), object_path)
-        self.__info = info
+        self.__proxy = EngineFactoryProxy (self, bus.get_dbusconn(), &quot;/org/freedesktop/IBus/Factory&quot;)
         self.__bus = bus
-        self.__engine_class = engine_class
-        self.__engine_path = engine_path
-        self.__engine_id = 1
-        self.__object_path = object_path
-
-    def get_info(self):
-        return self.__info
 
     def initialize(self):
         pass
@@ -46,21 +41,13 @@ class EngineFactoryBase(ibus.Object):
     def uninitialize(self):
         pass
 
-    def register(self):
-        self.__bus.register_factories([self.__object_path])
-
-    def create_engine(self):
-        engine = self.__engine_class(self.__bus, self.__engine_path + str(self.__engine_id))
-        self.__engine_id += 1
-        return engine.get_dbus_object()
+    def create_engine(self, engine_name):
+        raise IBusException(&quot;Can not create engine %s&quot; % engine_name)
 
     def do_destroy(self):
         self.__proxy = None
         self.__bus = None
-        self.__info = None
-        self.__engine_class = None
-        self.__engine_path = None
-        super(EngineFactoryBase,self).do_destroy()
+        super(EngineFactoryBase, self).do_destroy()
 
 
 class EngineFactoryProxy(interface.IEngineFactory):
@@ -77,11 +64,70 @@ class EngineFactoryProxy(interface.IEngineFactory):
     def Uninitialize(self):
         return self.__factory.uninitialize()
 
-    def CreateEngine(self):
-        return self.__factory.create_engine()
+    def CreateEngine(self, engine_name):
+        engine = self.__factory.create_engine(engine_name)
+        return engine.get_dbus_object()
 
     def Destroy(self):
         self.__factory.destroy()
         self.__factory = None
         self.remove_from_connection ()
 
+class FactoryInfo(Serializable):
+    __NAME__ = &quot;IBusFactoryInfo&quot;
+    def __init__ (self, path=None, name=None, lang=None, icon=None, authors=None, credits=None):
+        super(FactoryInfo, self).__init__()
+        self.__path = path
+        self.__name = name
+        self.__lang = lang
+        self.__icon = icon
+        self.__authors = authors
+        self.__credits = credits
+
+    def get_path(self):
+        return self.__path
+
+    def get_name(self):
+        return self.__name
+
+    def get_lang(self):
+        return self.__lang
+
+    def get_icon(self):
+        return self.__icon
+    def get_authors(self):
+        return self.__authors
+
+    def get_credits(self):
+        return self.__credits
+
+    path = property(get_path)
+    name = property(get_name)
+    lang = property(get_lang)
+    icon = property(get_icon)
+    authors = property(get_authors)
+    credits = property(get_credits)
+
+    def serialize(self, struct):
+        super(FactoryInfo, self).serialize(struct)
+        struct.append (dbus.ObjectPath(self.__path))
+        struct.append (dbus.String(self.__name))
+        struct.append (dbus.String(self.__lang))
+        struct.append (dbus.String(self.__icon))
+        struct.append (dbus.String(self.__authors))
+        struct.append (dbus.String(self.__credits))
+
+    def deserialize(self, struct):
+        super(FactoryInfo, self).deserialize(struct)
+        if len(struct) &lt; 5:
+            raise IBusException (&quot;Can not deserialize IBusFactoryInfo&quot;)
+
+        self.__path = struct.pop(0)
+        self.__name = struct.pop(0)
+        self.__lang = struct.pop(0)
+        self.__icon = struct.pop(0)
+        self.__authors = struct.pop(0)
+        self.__credits = struct.pop(0)
+
+serializable_register(FactoryInfo)
+</diff>
      <filename>ibus/factory.py</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,7 @@ ibus_interface_PYTHON = \
 	ienginefactory.py \
 	iengine.py \
 	iibus.py \
+	iinputcontext.py \
 	ipanel.py \
 	inotifications.py \
 	__init__.py \</diff>
      <filename>ibus/interface/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@
 # Boston, MA  02111-1307  USA
 
 from iibus import *
+from iinputcontext import *
 from iengine import *
 from ienginefactory import *
 from ipanel import *</diff>
      <filename>ibus/interface/__init__.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,22 +23,22 @@ __all__ = (&quot;IConfig&quot;, )
 
 import dbus.service
 from ibus.common import \
-    IBUS_CONFIG_IFACE
+    IBUS_IFACE_CONFIG
 
 class IConfig(dbus.service.Object):
     # define method decorator.
     method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_CONFIG_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_CONFIG, \
             **args)
 
     # define signal decorator.
     signal = lambda **args: \
-        dbus.service.signal(dbus_interface=IBUS_CONFIG_IFACE, \
+        dbus.service.signal(dbus_interface=IBUS_IFACE_CONFIG, \
             **args)
 
     # define async method decorator.
     async_method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_CONFIG_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_CONFIG, \
             async_callbacks=(&quot;reply_cb&quot;, &quot;error_cb&quot;), \
             **args)
 </diff>
      <filename>ibus/interface/iconfig.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,27 +23,27 @@ __all__ = (&quot;IEngine&quot;, )
 
 import dbus.service
 from ibus.common import \
-    IBUS_ENGINE_IFACE
+    IBUS_IFACE_ENGINE
 
 class IEngine(dbus.service.Object):
     # define method decorator.
     method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_ENGINE_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_ENGINE, \
                             **args)
 
     # define signal decorator.
     signal = lambda **args: \
-        dbus.service.signal(dbus_interface=IBUS_ENGINE_IFACE, \
+        dbus.service.signal(dbus_interface=IBUS_IFACE_ENGINE, \
                             **args)
 
     # define async method decorator.
     async_method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_ENGINE_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_ENGINE, \
                             async_callbacks=(&quot;reply_cb&quot;, &quot;error_cb&quot;), \
                             **args)
 
-    @method(in_signature=&quot;ubu&quot;, out_signature=&quot;b&quot;)
-    def ProcessKeyEvent(self, keyval, is_press, state):
+    @method(in_signature=&quot;uu&quot;, out_signature=&quot;b&quot;)
+    def ProcessKeyEvent(self, keyval, state):
         pass
 
     @method(in_signature=&quot;iiii&quot;)
@@ -89,29 +89,30 @@ class IEngine(dbus.service.Object):
     @method()
     def Destroy(self): pass
 
-    @signal(signature=&quot;s&quot;)
-    def CommitString(self, text): pass
+
+    @signal(signature=&quot;v&quot;)
+    def CommitText(self, text): pass
 
     @signal(signature=&quot;ubu&quot;)
     def ForwardKeyEvent(self, keyval, is_press, state): pass
 
-    @signal(signature=&quot;sa(uuuu)ib&quot;)
-    def UpdatePreedit(self, text, attrs, cursor_pos, visible): pass
+    @signal(signature=&quot;vub&quot;)
+    def UpdatePreeditText(self, text, cursor_pos, visible): pass
 
     @signal()
-    def ShowPreedit(self): pass
+    def ShowPreeditText(self): pass
 
     @signal()
-    def HidePreedit(self): pass
+    def HidePreeditText(self): pass
 
-    @signal(signature=&quot;sa(uuuu)b&quot;)
-    def UpdateAuxString(self, text, attrs, visible): pass
+    @signal(signature=&quot;vb&quot;)
+    def UpdateAuxiliaryText(self, text, visible): pass
 
     @signal()
-    def ShowAuxString(self): pass
+    def ShowAuxiliaryText(self): pass
 
     @signal()
-    def HideAuxString(self): pass
+    def HideAuxiliaryText(self): pass
 
     @signal(signature=&quot;vb&quot;)
     def UpdateLookupTable(self, lookup_table, visible): pass</diff>
      <filename>ibus/interface/iengine.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,17 +23,17 @@ __all__ = (&quot;IEngineFactory&quot;, )
 
 import dbus.service
 from ibus.common import \
-    IBUS_ENGINE_FACTORY_IFACE
+    IBUS_IFACE_ENGINE_FACTORY
 
 class IEngineFactory(dbus.service.Object):
     # define method decorator.
     method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_ENGINE_FACTORY_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_ENGINE_FACTORY, \
                             **args)
 
     # define async method decorator.
     async_method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_ENGINE_FACTORY_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_ENGINE_FACTORY, \
                             async_callbacks=(&quot;reply_cb&quot;, &quot;error_cb&quot;), \
                             **args)
 
@@ -51,8 +51,8 @@ class IEngineFactory(dbus.service.Object):
 
     # Create an input context and return the id of the context.
     # If failed, it will return &quot;&quot; or None.
-    @method(out_signature=&quot;o&quot;)
-    def CreateEngine(self): pass
+    @method(in_signature=&quot;s&quot;, out_signature=&quot;o&quot;)
+    def CreateEngine(self, engine_name): pass
 
     # Destroy the engine
     @method()</diff>
      <filename>ibus/interface/ienginefactory.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,100 +23,49 @@ __all__ = (&quot;IIBus&quot;, )
 
 import dbus.service
 from ibus.common import \
-    IBUS_IFACE
+    IBUS_IFACE_IBUS
 
 class IIBus(dbus.service.Object):
     # define method decorator.
     method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_IBUS, \
                             connection_keyword=&quot;dbusconn&quot;, \
                             **args)
 
     # define async method decorator.
     async_method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_IBUS, \
                             connection_keyword=&quot;dbusconn&quot;, \
                             async_callbacks=(&quot;reply_cb&quot;, &quot;error_cb&quot;), \
                             **args)
 
     @method(out_signature=&quot;s&quot;)
-    def GetIBusAddress(self, dbusconn): pass
+    def GetAddress(self, dbusconn): pass
 
     # methods for ibus clients
-    @method(in_signature=&quot;s&quot;, out_signature=&quot;s&quot;)
+    @method(in_signature=&quot;s&quot;, out_signature=&quot;o&quot;)
     def CreateInputContext(self, client_name, dbusconn): pass
 
-    @method(in_signature=&quot;s&quot;)
-    def ReleaseInputContext(self, ic, dbusconn): pass
-
-    @async_method(in_signature=&quot;subu&quot;, out_signature=&quot;b&quot;)
-    def ProcessKeyEvent(self, ic, keyval, is_press, state, dbusconn, reply_cb, error_cb): pass
-
-    @method(in_signature=&quot;siiii&quot;)
-    def SetCursorLocation(self, ic, x, y, w, h, dbusconn): pass
-
-    @method(in_signature=&quot;s&quot;)
-    def FocusIn(self, ic, dbusconn): pass
-
-    @method(in_signature=&quot;s&quot;)
-    def FocusOut(self, ic, dbusconn): pass
-
-    @method(in_signature=&quot;s&quot;)
-    def Reset(self, ic, dbusconn): pass
-
-    @method(in_signature=&quot;s&quot;, out_signature=&quot;b&quot;)
-    def IsEnabled(self, ic, dbusconn): pass
-
-    @method(in_signature=&quot;si&quot;)
-    def SetCapabilities(self, ic, caps, dbusconn): pass
+    @method(in_signature=&quot;s&quot;, out_signature=&quot;sb&quot;)
+    def GetInputContextStates(self, ic, dbusconn): pass
 
     # methods for ibus engine provide
-    @method(in_signature=&quot;ao&quot;)
+    @method(in_signature=&quot;av&quot;)
     def RegisterFactories(self, object_paths, dbusconn): pass
 
-    @method(in_signature=&quot;ao&quot;)
+    @method(in_signature=&quot;av&quot;)
     def UnregisterFactories(self, object_paths, dbusconn): pass
 
     # general methods
-    @method(out_signature=&quot;av&quot;)
-    def GetFactories(self, dbusconn): pass
+    @method(in_signature=&quot;av&quot;)
+    def RegisterComponent(self, components, dbusconn): pass
 
-    @method(in_signature=&quot;o&quot;, out_signature=&quot;av&quot;)
-    def GetFactoryInfo(self, factory_path, dbusconn): pass
-
-    @method(in_signature=&quot;o&quot;)
-    def SetFactory(self, factory_path, dbusconn): pass
-
-    @method(in_signature=&quot;s&quot;, out_signature=&quot;sb&quot;)
-    def GetInputContextStates(self, ic, dbusconn): pass
-
-    @method(out_signature=&quot;a(sssssssb)&quot;)
-    def RegisterListEngines(self, dbusconn): pass
-
-    @method()
-    def RegisterReloadEngines(self, dbusconn): pass
-
-    @method(in_signature=&quot;ss&quot;)
-    def RegisterStartEngine(self, lang, name, dbusconn): pass
-
-    @method(in_signature=&quot;ss&quot;)
-    def RegisterRestartEngine(self, lang, name, dbusconn): pass
+    @method(out_signature=&quot;av&quot;)
+    def ListEngines(self, dbusconn): pass
 
-    @method(in_signature=&quot;ss&quot;)
-    def RegisterStopEngine(self, lang, name, dbusconn): pass
+    @method(out_signature=&quot;av&quot;)
+    def ListActiveEngines(self, dbusconn): pass
 
     @async_method()
     def Kill(self, dbusconn, reply_cb, error_cb): pass
 
-    #sigals
-    def CommitString(self, ic, text): pass
-
-    def UpdatePreedit(self, ic, text, attrs, cursor_pos, show): pass
-
-    def Enabled(self, ic): pass
-
-    def Disabled(self, ic): pass
-
-    def ConfigValueChanged(self, key, value): pass
-
-    def ConfigReload(self): pass</diff>
      <filename>ibus/interface/iibus.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,22 +23,22 @@ __all__ = (&quot;INotifications&quot;, )
 
 import dbus.service
 from ibus.common import \
-    IBUS_NOTIFICATIONS_IFACE
+    IBUS_IFACE_NOTIFICATIONS
 
 class INotifications(dbus.service.Object):
     # define method decorator.
     method = lambda **args: \
-        dbus.service.method(dbus_interface = IBUS_NOTIFICATIONS_IFACE, \
+        dbus.service.method(dbus_interface = IBUS_IFACE_NOTIFICATIONS, \
                             **args)
 
     # define signal decorator.
     signal = lambda **args: \
-        dbus.service.signal(dbus_interface = IBUS_NOTIFICATIONS_IFACE, \
+        dbus.service.signal(dbus_interface = IBUS_IFACE_NOTIFICATIONS, \
                             **args)
 
     # define async method decorator.
     async_method = lambda **args: \
-        dbus.service.method(dbus_interface = IBUS_NOTIFICATIONS_IFACE, \
+        dbus.service.method(dbus_interface = IBUS_IFACE_NOTIFICATIONS, \
                             async_callbacks = (&quot;reply_cb&quot;, &quot;error_cb&quot;), \
                             **args)
 </diff>
      <filename>ibus/interface/inotifications.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,44 +23,44 @@ __all__ = (&quot;IPanel&quot;, )
 
 import dbus.service
 from ibus.common import \
-    IBUS_PANEL_IFACE
+    IBUS_IFACE_PANEL
 
 class IPanel(dbus.service.Object):
     # define method decorator.
     method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_PANEL_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_PANEL, \
                             **args)
 
     # define signal decorator.
     signal = lambda **args: \
-        dbus.service.signal(dbus_interface=IBUS_PANEL_IFACE, \
+        dbus.service.signal(dbus_interface=IBUS_IFACE_PANEL, \
                             **args)
 
     # define async method decorator.
     async_method = lambda **args: \
-        dbus.service.method(dbus_interface=IBUS_PANE_IFACE, \
+        dbus.service.method(dbus_interface=IBUS_IFACE_PANEL, \
                             async_callbacks=(&quot;reply_cb&quot;, &quot;error_cb&quot;), \
                             **args)
     @method(in_signature=&quot;iiii&quot;)
     def SetCursorLocation(self, x, y, w, h): pass
 
-    @method(in_signature=&quot;svub&quot;)
-    def UpdatePreedit(self, text, attrs, cursor_pos, visible): pass
+    @method(in_signature=&quot;vub&quot;)
+    def UpdatePreeditText(self, text, cursor_pos, visible): pass
 
     @method()
-    def ShowPreedit(self): pass
+    def ShowPreeditText(self): pass
 
     @method()
-    def HidePreedit(self): pass
+    def HidePreeditText(self): pass
 
-    @method(in_signature=&quot;svb&quot;)
-    def UpdateAuxString(self, text, attrs, visible): pass
+    @method(in_signature=&quot;vb&quot;)
+    def UpdateAuxiliaryText(self, text, visible): pass
 
     @method()
-    def ShowAuxString(self): pass
+    def ShowAuxiliaryText(self): pass
 
     @method()
-    def HideAuxString(self): pass
+    def HideAuxiliaryText(self): pass
 
     @method(in_signature=&quot;vb&quot;)
     def UpdateLookupTable(self, lookup_table, visible): pass
@@ -95,14 +95,14 @@ class IPanel(dbus.service.Object):
     @method()
     def HideLanguageBar(self): pass
 
-    @method(in_signature=&quot;s&quot;)
+    @method(in_signature=&quot;o&quot;)
     def FocusIn(self, ic): pass
 
-    @method(in_signature=&quot;s&quot;)
+    @method(in_signature=&quot;o&quot;)
     def FocusOut(self, ic): pass
 
     @method()
-    def StatesChanged(self): pass
+    def StateChanged(self): pass
 
     @method()
     def Reset(self): pass
@@ -126,12 +126,12 @@ class IPanel(dbus.service.Object):
     @signal()
     def CursorDown(self): pass
 
-    @signal()
+    @signal(signature=&quot;si&quot;)
     def PropertyActivate(self, prop_name, prop_state): pass
 
-    @signal()
+    @signal(signature=&quot;s&quot;)
     def PropertyShow(self, prop_name): pass
 
-    @signal()
+    @signal(signature=&quot;s&quot;)
     def PropertyHide(self, prop_name): pass
 </diff>
      <filename>ibus/interface/ipanel.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,54 +21,24 @@
 
 __all__ = (
         &quot;LookupTable&quot;,
-        &quot;lookup_table_from_dbus_value&quot;
     )
 
 import dbus
-from attribute import *
+from serializable import *
 from exception import *
 
-class CandidateList(list):
-    def __init__(self, items = []):
-        super(CandidateList, self).__init__(items)
-
-    def clean(self):
-        del self[:]
-    def __getslice__(self, i, j):
-        items = super(CandidateList, self).__getslice__(i, j)
-        return CandidateList(items)
-
-    def to_dbus_value(self):
-        value = dbus.Array([], signature=&quot;v&quot;)
-        for text, attrs in self:
-            value.append(dbus.Struct((dbus.String(text), attrs.to_dbus_value())))
-        return value
-
-    def from_dbus_value(self, value):
-        candidates = []
-        if not isinstance(value, dbus.Array):
-            raise dbus.Exception(&quot;Candidates must from dbus.Array(a(sa(...))&quot;)
-        for candidate in value:
-            if not isinstance(candidate, dbus.Struct):
-                raise IBusException(&quot;Candidates must from dbus.Array(a(sa(...)))&quot;)
-            if len(candidate) != 2 or \
-                not isinstance(candidate[0], dbus.String):
-                raise IBusException(&quot;Candidates must from dbus.Array(a(sa(...)))&quot;)
-            text = candidate[0]
-            attrs = attr_list_from_dbus_value(candidate[1])
-            candidates.append((text, attrs))
-
-        self.clean()
-        self[:] = candidates
-
-class LookupTable(object):
-    def __init__(self, page_size=5, labels=None):
+class LookupTable(Serializable):
+    __NAME__ = &quot;IBusLookupTable&quot;
+    def __init__(self, page_size=5, cursor_pos=0, coursor_visible=True, candidates=None):
         super(LookupTable, self).__init__()
         self.__cursor_visible = True
-        self.__cursor_pos = 0
-        self.__candidates = CandidateList()
+        self.__cursor_pos = cursor_pos
+        if candidates == None:
+            self.__candidates = list()
+        else:
+            self.__candidates = candidates
         self.set_page_size(page_size)
-        self.set_labels(labels)
+        self.set_labels(None)
 
     def set_page_size(self, page_size):
         self.__page_size = page_size
@@ -159,18 +129,16 @@ class LookupTable(object):
         return True
 
     def clean(self):
-        self.__candidates.clean()
+        self.__candidates = list()
         self.__cursor_pos = 0
 
-    def append_candidate(self, candidate, attrs = None):
-        if attrs == None:
-            attrs = AttrList()
-        self.__candidates.append((candidate, attrs))
+    def append_candidate(self, text):
+        self.__candidates.append(text)
 
     def get_candidate(self, index):
         return self.__candidates[index]
 
-    def get_canidates_in_current_page(self):
+    def get_candidates_in_current_page(self):
         page = self.__cursor_pos / self.__page_size
         start_index = page * self.__page_size
         end_index = min((page + 1) * self.__page_size, len(self.__candidates))
@@ -185,50 +153,43 @@ class LookupTable(object):
     def __len__(self):
         return self.get_number_of_candidates()
 
-    def to_dbus_value(self):
-        value = (dbus.Int32(self.__page_size),
-                 dbus.Int32(self.__cursor_pos),
-                 dbus.Boolean(self.__cursor_visible),
-                 self.__candidates.to_dbus_value())
-        return dbus.Struct(value)
-
-    def current_page_to_dbus_value(self):
-        candidates = self.get_canidates_in_current_page()
-        value = (dbus.Int32(self.__page_size),
-                 dbus.Int32(self.__cursor_pos % self.__page_size),
-                 dbus.Boolean(self.__cursor_visible),
-                 candidates.to_dbus_value())
-        return dbus.Struct(value)
-
-    def from_dbus_value(self, value):
-        if not isinstance(value, dbus.Struct):
-            raise dbus.Exception(&quot;LookupTable must from dbus.Struct(uuba(...))&quot;)
-
-        if len(value) != 4 or \
-            not isinstance(value[0], dbus.Int32) or \
-            not isinstance(value[1], dbus.Int32) or \
-            not isinstance(value[2], dbus.Boolean):
-            raise dbus.Exception(&quot;LookupTable must from dbus.Struct(uuba(...))&quot;)
-
-        self.__candidates.from_dbus_value(value[3])
-        self.__page_size = value[0]
-        self.__cursor_pos = value[1]
-        self.__cursor_visible = value[2]
-
-def lookup_table_from_dbus_value(value):
-    lookup_table = LookupTable()
-    lookup_table.from_dbus_value(value)
-    return lookup_table
-
-def unit_test():
+    def serialize(self, struct):
+        super(LookupTable, self).serialize(struct)
+        struct.append(dbus.UInt32(self.__page_size))
+        struct.append(dbus.UInt32(self.__cursor_pos))
+        struct.append(dbus.Boolean(self.__cursor_visible))
+        candidates = map(lambda c: serialize_object(c), self.__candidates)
+        struct.append(dbus.Array(candidates, signature=&quot;v&quot;))
+
+    def get_current_page_as_lookup_table(self):
+        candidates = self.get_candidates_in_current_page()
+        return LookupTable(self.__page_size,
+                           self.__cursor_pos % self.__page_size,
+                           self.__cursor_visible,
+                           candidates)
+
+    def deserialize(self, struct):
+        super(LookupTable, self).deserialize(struct)
+
+        self.__page_size = struct.pop(0)
+        self.__cursor_pos = struct.pop(0)
+        self.__cursor_visible = struct.pop(0)
+        self.__candidates = map(deserialize_object, struct.pop(0))
+
+
+serializable_register(LookupTable)
+
+def test():
     t = LookupTable()
     # attrs = AttrList()
     # attrs.append(AttributeBackground(RGB(233, 0,1), 0, 3))
     # attrs.append(AttributeUnderline(1, 3, 5))
     t.append_candidate(&quot;Hello&quot;)
-    value = t.to_dbus_value()
-    print value
-    t = lookup_table_from_dbus_value(value)
+    value = serialize_object(t)
+    t = deserialize_object(value)
+    t = t.get_current_page_as_lookup_table()
+    value = serialize_object(t)
+    t = deserialize_object(value)
 
 if __name__ == &quot;__main__&quot;:
-    unit_test()
+    test()</diff>
      <filename>ibus/lookuptable.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,12 +21,12 @@
 
 __all__ = (
         &quot;NotificationsBase&quot;,
-        &quot;IBUS_NOTIFICATIONS_NAME&quot;,
-        &quot;IBUS_NOTIFICATIONS_PATH&quot;
+        &quot;IBUS_SERVICE_NOTIFICATIONS&quot;,
+        &quot;IBUS_PATH_NOTIFICATIONS&quot;
     )
 
-IBUS_NOTIFICATIONS_NAME = &quot;org.freedesktop.ibus.Notifications&quot;
-IBUS_NOTIFICATIONS_PATH = &quot;/org/freedesktop/ibus/Notifications&quot;
+IBUS_SERVICE_NOTIFICATIONS = &quot;org.freedesktop.IBus.Notifications&quot;
+IBUS_PATH_NOTIFICATIONS = &quot;/org/freedesktop/IBus/Notifications&quot;
 
 import ibus
 from ibus import interface
@@ -50,7 +50,7 @@ class NotificationsBase(ibus.Object):
 
 class NotificationsProxy(interface.INotifications):
     def __init__ (self, notify, dbusconn):
-        super(NotificationsProxy, self).__init__(dbusconn, IBUS_NOTIFICATIONS_PATH)
+        super(NotificationsProxy, self).__init__(dbusconn, IBUS_PATH_NOTIFICATIONS)
         self.__dbusconn = dbusconn
         self.__notify = notify
     </diff>
      <filename>ibus/notifications.py</filename>
    </modified>
    <modified>
      <diff>@@ -28,21 +28,30 @@ import gobject
 class Object(gobject.GObject):
     __gsignals__ = {
         'destroy' : (
-            gobject.SIGNAL_RUN_FIRST, 
+            gobject.SIGNAL_RUN_LAST,
             gobject.TYPE_NONE,
             ())
     }
 
     def __init__(self):
         super(Object, self).__init__()
-        self._destroyed = False
+        self.__destroyed = False
+        self.__handlers = []
 
     def destroy(self):
-        if not self._destroyed:
+        if not self.__destroyed:
             self.emit(&quot;destroy&quot;)
-            self._destroyed = True
+            self.__destroyed = True
 
     def do_destroy(self):
-        pass
+        self.__disconnect_all()
+
+    def connect(self, signal_name, handler, *args):
+        id = super(Object, self).connect(signal_name, handler, *args)
+        self.__handlers.append(id)
+
+    def __disconnect_all(self):
+        map(self.disconnect, self.__handlers)
+        self.__handlers = []
 
 gobject.type_register(Object)</diff>
      <filename>ibus/object.py</filename>
    </modified>
    <modified>
      <diff>@@ -25,15 +25,17 @@ __all__ = (
         &quot;PanelButton&quot;,
         &quot;PanelToggleButton&quot;,
         &quot;PanelMenu&quot;,
-        &quot;IBUS_PANEL_NAME&quot;,
-        &quot;IBUS_PANEL_PATH&quot;
+        &quot;IBUS_SERVICE_PANEL&quot;,
+        &quot;IBUS_PATH_PANEL&quot;
     )
 
-IBUS_PANEL_NAME = &quot;org.freedesktop.ibus.Panel&quot;
-IBUS_PANEL_PATH = &quot;/org/freedesktop/ibus/Panel&quot;
+IBUS_SERVICE_PANEL = &quot;org.freedesktop.IBus.Panel&quot;
+IBUS_PATH_PANEL = &quot;/org/freedesktop/IBus/Panel&quot;
 
-import ibus
-from ibus import interface
+from serializable import *
+from object import Object
+import interface
+import dbus
 
 class PanelItem:
     pass
@@ -47,30 +49,31 @@ class PanelToggleButton(PanelButton):
 class PanelMenu(PanelItem):
     pass
 
-class PanelBase(ibus.Object):
+class PanelBase(Object):
     def __init__(self, bus):
         super(PanelBase, self).__init__()
-        self.__proxy = PanelProxy(self, bus.get_dbusconn())
+        self.__bus = bus
+        self.__proxy = PanelProxy(self, bus)
 
     def set_cursor_location(self, x, y, w, h):
         pass
 
-    def update_preedit(self, text, attrs, cursor_pos, visible):
+    def update_preedit_text(self, text, cursor_pos, visible):
         pass
 
-    def show_preedit(self):
+    def show_preedit_text(self):
         pass
 
-    def hide_preedit(self):
+    def hide_preedit_text(self):
         pass
 
-    def update_aux_string(self, text, attrs, visible):
+    def update_auxiliary_text(self, text, visible):
         pass
 
-    def show_aux_string(self):
+    def show_auxiliary_text(self):
         pass
 
-    def hide_aux_string(self):
+    def hide_auxiliary_text(self):
         pass
 
     def update_lookup_table(self, lookup_table, visible):
@@ -118,7 +121,7 @@ class PanelBase(ibus.Object):
     def focus_out(self, ic):
         pass
 
-    def states_changed(self):
+    def state_changed(self):
         pass
 
     def reset(self):
@@ -140,47 +143,52 @@ class PanelBase(ibus.Object):
         self.__proxy.CursorDown()
 
     def property_activate(self, prop_name, prop_state):
+        prop_name = dbus.String(prop_name)
+        prop_state = dbus.Int32(prop_state)
         self.__proxy.PropertyActivate(prop_name, prop_state)
 
     def property_show(self, prop_name):
+        prop_name = dbus.String(prop_name)
         self.__proxy.PropertyShow(prop_name)
 
     def property_hide(self, prop_name):
+        prop_name = dbus.String(prop_name)
         self.__proxy.PropertyHide(prop_name)
 
 
 class PanelProxy(interface.IPanel):
-    def __init__ (self, panel, dbusconn):
-        super(PanelProxy, self).__init__(dbusconn, IBUS_PANEL_PATH)
-        self.__dbusconn = dbusconn
+    def __init__ (self, panel, bus):
+        super(PanelProxy, self).__init__(bus.get_dbusconn(), IBUS_PATH_PANEL)
+        self.__bus = bus
         self.__panel = panel
+        self.__focus_ic = None
 
     def SetCursorLocation(self, x, y, w, h):
         self.__panel.set_cursor_location(x, y, w, h)
 
-    def UpdatePreedit(self, text, attrs, cursor_pos, show):
-        attrs = ibus.attr_list_from_dbus_value(attrs)
-        self.__panel.update_preedit(text, attrs, cursor_pos, show)
+    def UpdatePreeditText(self, text, cursor_pos, visible):
+        text = deserialize_object(text)
+        self.__panel.update_preedit_text(text, cursor_pos, visible)
 
-    def ShowPreedit(self):
-        self.__panel.show_preedit()
+    def ShowPreeditText(self):
+        self.__panel.show_preedit_text()
 
-    def HidePreedit(self):
-        self.__panel.hide_preedit()
+    def HidePreeditText(self):
+        self.__panel.hide_preedit_text()
 
-    def UpdateAuxString(self, text, attrs, show):
-        attrs = ibus.attr_list_from_dbus_value(attrs)
-        self.__panel.update_aux_string(text, attrs, show)
+    def UpdateAuxiliaryText(self, text, visible):
+        text = deserialize_object(text)
+        self.__panel.update_auxiliary_text(text, visible)
 
-    def ShowAuxString(self):
-        self.__panel.show_aux_string()
+    def ShowAuxiliaryText(self):
+        self.__panel.show_auxiliary_text()
 
-    def HideAuxString(self):
-        self.__panel.hide_aux_string()
+    def HideAuxiliaryText(self):
+        self.__panel.hide_auxiliary_text()
 
-    def UpdateLookupTable(self, lookup_table, show):
-        lookup_table = ibus.lookup_table_from_dbus_value(lookup_table)
-        self.__panel.update_lookup_table(lookup_table, show)
+    def UpdateLookupTable(self, lookup_table, visible):
+        lookup_table = deserialize_object(lookup_table)
+        self.__panel.update_lookup_table(lookup_table, visible)
 
     def ShowLookupTable(self):
         self.__panel.show_lookup_table()
@@ -213,11 +221,11 @@ class PanelProxy(interface.IPanel):
         self.__panel.hide_language_bar()
 
     def RegisterProperties(self, props):
-        props = ibus.prop_list_from_dbus_value(props)
+        props = deserialize_object(props)
         self.__panel.register_properties(props)
 
     def UpdateProperty(self, prop):
-        prop = ibus.property_from_dbus_value(prop)
+        prop = deserialize_object(prop)
         self.__panel.update_property(prop)
 
     def FocusIn(self, ic):
@@ -226,8 +234,8 @@ class PanelProxy(interface.IPanel):
     def FocusOut(self, ic):
         self.__panel.focus_out(ic)
 
-    def StatesChanged(self):
-        self.__panel.states_changed()
+    def StateChanged(self):
+        self.__panel.state_changed()
 
     def Reset(self):
         self.__panel.reset()
@@ -238,3 +246,41 @@ class PanelProxy(interface.IPanel):
     def Destroy(self):
         self.__panel.destroy()
 
+def test():
+    import gtk
+    from bus import Bus
+    from inputcontext import InputContext
+    import factory
+    import attribute
+    import property
+    import text
+    import lookuptable
+
+    class TestPanel(PanelBase):
+        def __init__(self):
+            self.__bus = Bus()
+            self.__bus.connect(&quot;disconnected&quot;, gtk.main_quit)
+            super(TestPanel, self).__init__(self.__bus)
+            self.__bus.request_name(IBUS_SERVICE_PANEL, 0)
+
+        def focus_in(self, ic):
+            print &quot;focus-in:&quot;, ic
+            context = InputContext(self.__bus, ic)
+            info = context.get_factory_info()
+            print &quot;factory:&quot;, info.name
+
+        def focus_out(self, ic):
+            print &quot;focus-out:&quot;, ic
+
+        def update_auxiliary_text(self, text, visible):
+            print &quot;update-auxiliary-text:&quot;, text.text
+
+        def update_lookup_table(self, table, visible):
+            print &quot;update-lookup-table&quot;, table
+
+    panel = TestPanel()
+    gtk.main()
+
+
+if __name__ == &quot;__main__&quot;:
+    test()</diff>
      <filename>ibus/panel.py</filename>
    </modified>
    <modified>
      <diff>@@ -30,11 +30,11 @@ __all__ = (
         &quot;PROP_STATE_INCONSISTENT&quot;,
         &quot;Property&quot;,
         &quot;PropList&quot;,
-        &quot;property_from_dbus_value&quot;,
-        &quot;prop_list_from_dbus_value&quot;,
     )
 
 import dbus
+from text import Text
+from serializable import *
 
 PROP_TYPE_NORMAL = 0
 PROP_TYPE_TOGGLE = 1
@@ -52,18 +52,18 @@ def _to_unicode(text):
     if isinstance(text, str):
         return unicode(text, &quot;utf8&quot;)
     raise TypeError(&quot;text must be instance of unicode or str&quot;)
+def _to_text(text):
+    if isinstance(text, Text):
+        return text
+    text = _to_unicode(text)
+    return Text(text)
 
-class Property(object):
-    def __init__(self, name,
-                        type = PROP_TYPE_NORMAL,
-                        label = u&quot;&quot;,
-                        icon = u&quot;&quot;,
-                        tooltip = u&quot;&quot;,
-                        sensitive = True,
-                        visible = True,
-                        state = PROP_STATE_UNCHECKED):
+class Property(Serializable):
+    __NAME__ = &quot;IBusProperty&quot;
+    def __init__(self, key=&quot;&quot;, type=PROP_TYPE_NORMAL, label=u&quot;&quot;, icon=u&quot;&quot;, tooltip=u&quot;&quot;,
+                 sensitive=True, visible=True, state=PROP_STATE_UNCHECKED):
         super(Property, self).__init__()
-        self.__name = _to_unicode(name)
+        self.__key = _to_unicode(key)
         self.__type = type
         self.label = label
         self.icon = icon
@@ -79,14 +79,14 @@ class Property(object):
     def get_sub_props(self):
         return self.__sub_props
 
-    def get_name(self):
-        return self.__name
+    def get_key(self):
+        return self.__key
 
     def get_type(self):
         return self.__type
 
     def set_label(self, label):
-        self.__label = _to_unicode(label)
+        self.__label = _to_text(label)
 
     def get_label(self):
         return self.__label
@@ -98,7 +98,7 @@ class Property(object):
         return self.__icon
 
     def set_tooltip(self, tooltip):
-        self.__tooltip = _to_unicode(tooltip)
+        self.__tooltip = _to_text(tooltip)
 
     def get_tooltip(self):
         return self.__tooltip
@@ -121,7 +121,7 @@ class Property(object):
     def get_visible(self):
         return self.__visible
 
-    name        = property(get_name)
+    key         = property(get_key)
     type        = property(get_type)
     label       = property(get_label, set_label)
     icon        = property(get_icon, set_icon)
@@ -146,38 +146,37 @@ class Property(object):
         return self.__sub_props.is_same(prop.__sub_props, test_all)
 
 
-    def to_dbus_value(self):
-        sub_props = self.__sub_props.to_dbus_value()
-        values = (dbus.String(self.__name),
-                dbus.UInt32(self.__type),
-                dbus.String(self.__label),
-                dbus.String(self.__icon),
-                dbus.String(self.__tooltip),
-                dbus.Boolean(self.__sensitive),
-                dbus.Boolean(self.__visible),
-                dbus.UInt32(self.__state),
-                sub_props)
-        return dbus.Struct(values)
-
-    def from_dbus_value(self, value):
-        self.__name, \
-        self.__type, \
-        self.__label, \
-        self.__icon, \
-        self.__tooltip, \
-        self.__sensitive, \
-        self.__visible, \
-        self.__state, \
-        props = value
-
-        self.__sub_props = prop_list_from_dbus_value(props)
-
-def property_from_dbus_value(value):
-    p = Property(&quot;&quot;)
-    p.from_dbus_value(value)
-    return p
-
-class PropList(object):
+    def serialize(self, struct):
+        super(Property, self).serialize(struct)
+        struct.append(dbus.String(self.__key))
+        struct.append(dbus.UInt32(self.__type))
+        struct.append(serialize_object(self.__label))
+        struct.append(dbus.String(self.__icon))
+        struct.append(serialize_object(self.__tooltip))
+        struct.append(dbus.Boolean(self.__sensitive))
+        struct.append(dbus.Boolean(self.__visible))
+        struct.append(dbus.UInt32(self.__state))
+        sub_props = serialize_object(self.__sub_props)
+        struct.append(sub_props)
+
+    def deserialize(self, struct):
+        super(Property, self).deserialize(struct)
+        self.__key = struct.pop(0)
+        self.__type = struct.pop(0)
+        self.__label = deserialize_object(struct.pop(0))
+        self.__icon = struct.pop(0)
+        self.__tooltip = deserialize_object(struct.pop(0))
+        self.__sensitive = deserialize_object(struct.pop(0))
+        self.__visible = struct.pop(0)
+        self.__state = struct.pop(0)
+        props = struct.pop(0)
+
+        self.__sub_props = deserialize_object(props)
+
+serializable_register(Property)
+
+class PropList(Serializable):
+    __NAME__ = &quot;IBusPropList&quot;
     def __init__(self):
         super(PropList, self).__init__()
         self.__props = []
@@ -203,14 +202,14 @@ class PropList(object):
                 return False
         return False
 
-    def to_dbus_value(self):
-        props = map(lambda p: p.to_dbus_value(), self.__props)
-        return dbus.Array(props, signature = &quot;v&quot;)
+    def serialize(self, struct):
+        super(PropList, self).serialize(struct)
+        props = map(lambda p: serialize_object(p), self.__props)
+        struct.append (dbus.Array(props, signature = &quot;v&quot;))
 
-    def from_dbus_value(self, value):
-        props = []
-        for p in value:
-            props.append(property_from_dbus_value(p))
+    def deserialize(self, struct):
+        super(PropList, self).deserialize(struct)
+        props = map(lambda v: deserialize_object(v), struct.pop(0))
         self.__props = props
 
     def __iter__(self):
@@ -219,10 +218,7 @@ class PropList(object):
     def __getitem__(self, i):
         return self.__props.__getitem__(i)
 
-def prop_list_from_dbus_value(value):
-    props = PropList()
-    props.from_dbus_value(value)
-    return props
+serializable_register(PropList)
 
 def test():
     props = PropList()
@@ -230,18 +226,9 @@ def test():
     props.append(Property(u&quot;b&quot;))
     props.append(Property(u&quot;c&quot;))
     props.append(Property(u&quot;d&quot;))
-    value = props.to_dbus_value()
-    print prop_list_from_dbus_value(value)
-
-    p = Property(u&quot;z&quot;)
-    p.set_sub_props(props)
-    props = PropList()
-    props.append(p)
-    value = props.to_dbus_value()
-    print prop_list_from_dbus_value(value)
-    p.label = u&quot;a&quot;
-    p.label = &quot;a&quot;
-    p.label = 1
+    value = serialize_object(props)
+    props = deserialize_object(value)
+    print props
 
 if __name__ == &quot;__main__&quot;:
     test()</diff>
      <filename>ibus/property.py</filename>
    </modified>
    <modified>
      <diff>@@ -11,3 +11,8 @@ insert-header.sin
 quot.sed
 remove-potcdate.sed
 remove-potcdate.sin
+ja.gmo
+pa.gmo
+zh_CN.gmo
+ibus.pot
+stamp-po</diff>
      <filename>po/.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 ./ibus/lang.py
 ./ibus/lookuptable.py
 ./ibus/property.py
-./ibus/gtk.py
+./ibus/_gtk.py
 ./ibus/ascii.py
 ./ibus/factory.py
 ./ui/gtk/menu.py
@@ -31,20 +31,6 @@
 ./ui/gtk/panel.py
 ./ui/gtk/propitem.py
 ./ui/gtk/languagebar.py
-./gconf/main.py
-./gconf/config.py
 ./setup/main.py
 ./setup/keyboardshortcut.py
-./daemon/bus.py
-./daemon/register.py
-./daemon/contextmanager.py
-./daemon/ibusdaemon.py
-./daemon/factorymanager.py
-./daemon/engine.py
-./daemon/panel.py
-./daemon/config.py
-./daemon/inputcontext.py
-./daemon/lookuptable.py
-./daemon/enginefactory.py
-./daemon/connection.py
 ./setup/setup.glade</diff>
      <filename>po/POTFILES.in</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ msgid &quot;&quot;
 msgstr &quot;&quot;
 &quot;Project-Id-Version: ibus VERSION\n&quot;
 &quot;Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n&quot;
-&quot;POT-Creation-Date: 2008-10-19 09:45+0800\n&quot;
+&quot;POT-Creation-Date: 2009-02-05 10:29+0800\n&quot;
 &quot;PO-Revision-Date: 2008-08-28 17:31+0900\n&quot;
 &quot;Last-Translator: UTUMI Hirosi &lt;utuhiro78@yahoo.co.jp&gt;\n&quot;
 &quot;Language-Team: Japanese &lt;gnome-translation@gnome.gr.jp&gt;\n&quot;
@@ -16,20 +16,20 @@ msgstr &quot;&quot;
 &quot;Content-Type: text/plain; charset=UTF-8\n&quot;
 &quot;Content-Transfer-Encoding: 8bit\n&quot;
 
-#: ibus/lang.py:40 ui/gtk/panel.py:294 ui/gtk/panel.py:295 ui/gtk/panel.py:296
-#: ui/gtk/panel.py:297 setup/main.py:361 setup/main.py:362 setup/main.py:363
+#: ibus/lang.py:40 ui/gtk/panel.py:307 ui/gtk/panel.py:308 ui/gtk/panel.py:309
+#: ui/gtk/panel.py:310
 msgid &quot;Other&quot;
 msgstr &quot;&quot;
 
-#: ui/gtk/panel.py:94
+#: ui/gtk/panel.py:99
 msgid &quot;iBus - Running&quot;
 msgstr &quot;iBus - &#23455;&#34892;&#20013;&quot;
 
-#: ui/gtk/panel.py:356
+#: ui/gtk/panel.py:370
 msgid &quot;IBus is an intelligent input bus for Linux/Unix.&quot;
 msgstr &quot;&quot;
 
-#: ui/gtk/panel.py:360
+#: ui/gtk/panel.py:374
 msgid &quot;translator-credits&quot;
 msgstr &quot;UTUMI Hirosi &lt;utuhiro78@yahoo.co.jp&gt;&quot;
 
@@ -37,23 +37,23 @@ msgstr &quot;UTUMI Hirosi &lt;utuhiro78@yahoo.co.jp&gt;&quot;
 msgid &quot;Switch engine&quot;
 msgstr &quot;&quot;
 
-#: setup/main.py:100
+#: setup/main.py:99
 msgid &quot;trigger&quot;
 msgstr &quot;&#12488;&#12522;&#12460;&#12540;&quot;
 
-#: setup/main.py:110
+#: setup/main.py:109
 msgid &quot;next engine&quot;
 msgstr &quot;&#27425;&#12398;&#12456;&#12531;&#12472;&#12531;&quot;
 
-#: setup/main.py:120
+#: setup/main.py:119
 msgid &quot;prev engine&quot;
 msgstr &quot;&#21069;&#12398;&#12456;&#12531;&#12472;&#12531;&quot;
 
-#: setup/main.py:165
+#: setup/main.py:197
 msgid &quot;IBus daemon is not started. Do you want to start it now?&quot;
 msgstr &quot;IBus &#12487;&#12540;&#12514;&#12531;&#12364;&#21205;&#12356;&#12390;&#12356;&#12414;&#12379;&#12435;&#12290;&#36215;&#21205;&#12375;&#12414;&#12377;&#12363;&#65311;&quot;
 
-#: setup/main.py:180
+#: setup/main.py:212
 msgid &quot;&quot;
 &quot;IBus has been started! If you can not use IBus, please add below lines in &quot;
 &quot;$HOME/.bashrc, and relogin your desktop.\n&quot;
@@ -67,19 +67,7 @@ msgstr &quot;&quot;
 &quot;  export XMODIFIERS=@im=ibus\n&quot;
 &quot;  export QT_IM_MODULE=ibus&quot;
 
-#: setup/main.py:202 setup/setup.glade:368
-msgid &quot;Engine&quot;
-msgstr &quot;&#12456;&#12531;&#12472;&#12531;&quot;
-
-#: setup/main.py:229
-msgid &quot;Started&quot;
-msgstr &quot;&#38283;&#22987;&quot;
-
-#: setup/main.py:239
-msgid &quot;Preload&quot;
-msgstr &quot;&#12503;&#12522;&#12525;&#12540;&#12489;&quot;
-
-#: setup/main.py:249
+#: setup/main.py:227
 #, python-format
 msgid &quot;Select keyboard shortcut for %s&quot;
 msgstr &quot;%s &#12398;&#12461;&#12540;&#12508;&#12540;&#12489;&#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12434;&#36984;&#25246;&quot;
@@ -108,25 +96,6 @@ msgstr &quot;&quot;
 msgid &quot;Please press a key (or a key combination)&quot;
 msgstr &quot;&#12461;&#12540;&#12418;&#12375;&#12367;&#12399;&#12461;&#12540;&#12398;&#32068;&#12415;&#21512;&#12431;&#12379;&#12434;&#20837;&#21147;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&quot;
 
-#: daemon/bus.py:221
-msgid &quot;Cannot enable input engine&quot;
-msgstr &quot;&quot;
-
-#: daemon/bus.py:222
-msgid &quot;&quot;
-&quot;IBus can not enable input engine, because IBus does not load any input &quot;
-&quot;engines!\n&quot;
-&quot;Please use ibus-setup program to load some input engines.&quot;
-msgstr &quot;&quot;
-
-#: daemon/bus.py:224
-msgid &quot;Setup&quot;
-msgstr &quot;&quot;
-
-#: daemon/bus.py:224
-msgid &quot;Don't show this again&quot;
-msgstr &quot;&quot;
-
 #: setup/setup.glade:7
 msgid &quot;IBus - Setup&quot;
 msgstr &quot;IBus - &#12475;&#12483;&#12488;&#12450;&#12483;&#12503;&quot;
@@ -183,7 +152,28 @@ msgstr &quot;&quot;
 msgid &quot;General&quot;
 msgstr &quot;&#19968;&#33324;&quot;
 
-#: setup/setup.glade:385
+#: setup/setup.glade:399
+msgid &quot;gtk-add&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:409
+#, fuzzy
+msgid &quot;gtk-remove&quot;
+msgstr &quot;gtk-close&quot;
+
+#: setup/setup.glade:422
+msgid &quot;gtk-go-up&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:435
+msgid &quot;gtk-go-down&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:460
+msgid &quot;Engine&quot;
+msgstr &quot;&#12456;&#12531;&#12472;&#12531;&quot;
+
+#: setup/setup.glade:477
 msgid &quot;&quot;
 &quot;&lt;big&gt;&lt;b&gt;iBus&lt;/b&gt;&lt;/big&gt;\n&quot;
 &quot;&lt;small&gt;The intelligent input bus&lt;/small&gt;\n&quot;
@@ -193,10 +183,16 @@ msgid &quot;&quot;
 &quot;\n&quot;
 msgstr &quot;&quot;
 
-#: setup/setup.glade:410
+#: setup/setup.glade:502
 msgid &quot;About&quot;
 msgstr &quot;About&quot;
 
-#: setup/setup.glade:432
+#: setup/setup.glade:524
 msgid &quot;gtk-close&quot;
 msgstr &quot;gtk-close&quot;
+
+#~ msgid &quot;Started&quot;
+#~ msgstr &quot;&#38283;&#22987;&quot;
+
+#~ msgid &quot;Preload&quot;
+#~ msgstr &quot;&#12503;&#12522;&#12525;&#12540;&#12489;&quot;</diff>
      <filename>po/ja.po</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ msgid &quot;&quot;
 msgstr &quot;&quot;
 &quot;Project-Id-Version: ibus\n&quot;
 &quot;Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n&quot;
-&quot;POT-Creation-Date: 2008-10-19 09:45+0800\n&quot;
+&quot;POT-Creation-Date: 2009-02-05 10:29+0800\n&quot;
 &quot;PO-Revision-Date: 2008-10-17 14:15+0530\n&quot;
 &quot;Last-Translator: Amanpreet Singh &lt;aalam@users.sf.net&gt;\n&quot;
 &quot;Language-Team: Punjabi/Panjabi &lt;punjabi-l10n@lists.sf.net&gt;\n&quot;
@@ -16,20 +16,20 @@ msgstr &quot;&quot;
 &quot;X-Generator: Lokalize 0.2\n&quot;
 &quot;Plural-Forms: nplurals=2; plural=n != 1;\n&quot;
 
-#: ibus/lang.py:40 ui/gtk/panel.py:294 ui/gtk/panel.py:295 ui/gtk/panel.py:296
-#: ui/gtk/panel.py:297 setup/main.py:361 setup/main.py:362 setup/main.py:363
+#: ibus/lang.py:40 ui/gtk/panel.py:307 ui/gtk/panel.py:308 ui/gtk/panel.py:309
+#: ui/gtk/panel.py:310
 msgid &quot;Other&quot;
 msgstr &quot;&#2617;&#2635;&#2608;&quot;
 
-#: ui/gtk/panel.py:94
+#: ui/gtk/panel.py:99
 msgid &quot;iBus - Running&quot;
 msgstr &quot;iBus - &#160;&#2586;&#2673;&#2610; &#2608;&#2623;&#2617;&#2622; &#2617;&#2632;&quot;
 
-#: ui/gtk/panel.py:356
+#: ui/gtk/panel.py:370
 msgid &quot;IBus is an intelligent input bus for Linux/Unix.&quot;
 msgstr &quot;iBus &#2610;&#2624;&#2600;&#2581;&#2616;/&#2607;&#2626;&#2600;&#2632;&#2581;&#2616; &#2610;&#2568; &#2606;&#2622;&#2617;&#2608; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2604;&#2673;&#2616; &#2617;&#2632;&#2404;&quot;
 
-#: ui/gtk/panel.py:360
+#: ui/gtk/panel.py:374
 msgid &quot;translator-credits&quot;
 msgstr &quot;&#2565;&#2606;&#2600;&#2602;&#2608;&#2624;&#2596; &#2616;&#2623;&#2672;&#2584; &#2566;&#2610;&#2606;&quot;
 
@@ -37,23 +37,23 @@ msgstr &quot;&#2565;&#2606;&#2600;&#2602;&#2608;&#2624;&#2596; &#2616;&#2623;&#2672;&#2584; &#2566;&#2610;&#2606;&quot;
 msgid &quot;Switch engine&quot;
 msgstr &quot;&#2567;&#2672;&#2588;&#2595; &#2604;&#2598;&#2610;&#2635;&quot;
 
-#: setup/main.py:100
+#: setup/main.py:99
 msgid &quot;trigger&quot;
 msgstr &quot;&#2591;&#2608;&#2623;&#2673;&#2583;&#2608;&quot;
 
-#: setup/main.py:110
+#: setup/main.py:109
 msgid &quot;next engine&quot;
 msgstr &quot;&#2565;&#2583;&#2610;&#2622; &#2567;&#2672;&#2588;&#2595;&quot;
 
-#: setup/main.py:120
+#: setup/main.py:119
 msgid &quot;prev engine&quot;
 msgstr &quot;&#2602;&#2623;&#2587;&#2610;&#2622; &#2567;&#2672;&#2588;&#2595;&quot;
 
-#: setup/main.py:165
+#: setup/main.py:197
 msgid &quot;IBus daemon is not started. Do you want to start it now?&quot;
 msgstr &quot;iBus &#2593;&#2632;&#2606;&#2600; &#2586;&#2673;&#2610;&#2598;&#2624; &#2600;&#2617;&#2624;&#2562; &#2617;&#2632;&#2404; &#2581;&#2624; &#2596;&#2625;&#2616;&#2624;&#2562; &#2567;&#2616; &#2600;&#2626;&#2672; &#2616;&#2620;&#2625;&#2608;&#2626; &#2581;&#2608;&#2600;&#2622; &#2586;&#2622;&#2617;&#2625;&#2672;&#2598;&#2631; &#2617;&#2635;?&quot;
 
-#: setup/main.py:180
+#: setup/main.py:212
 msgid &quot;&quot;
 &quot;IBus has been started! If you can not use IBus, please add below lines in &quot;
 &quot;$HOME/.bashrc, and relogin your desktop.\n&quot;
@@ -66,19 +66,7 @@ msgstr &quot;&quot;
 &quot;&#8233;  export XMODIFIERS=@im=ibus\n&quot;
 &quot;&#8233;  export QT_IM_MODULE=ibus&quot;
 
-#: setup/main.py:202 setup/setup.glade:368
-msgid &quot;Engine&quot;
-msgstr &quot;&#2567;&#2672;&#2588;&#2595;&quot;
-
-#: setup/main.py:229
-msgid &quot;Started&quot;
-msgstr &quot;&#2586;&#2622;&#2610;&#2626; &#2617;&#2632;&quot;
-
-#: setup/main.py:239
-msgid &quot;Preload&quot;
-msgstr &quot;&#2602;&#2637;&#2608;&#2624;-&#2610;&#2635;&#2593;&quot;
-
-#: setup/main.py:249
+#: setup/main.py:227
 #, python-format
 msgid &quot;Select keyboard shortcut for %s&quot;
 msgstr &quot;%s &#2610;&#2568; &#2581;&#2624;&#2604;&#2635;&#2608;&#2593; &#2616;&#2620;&#2622;&#2608;&#2591;&#2581;&#2673;&#2591; &#2586;&#2625;&#2595;&#2635;&quot;
@@ -107,28 +95,6 @@ msgstr &quot;&quot;
 msgid &quot;Please press a key (or a key combination)&quot;
 msgstr &quot;&#2581;&#2635;&#2568; &#2613;&#2624; &#2616;&#2613;&#2623;&#2673;&#2586; &#2598;&#2673;&#2604;&#2635; (&#2588;&#2622;&#2562; &#2616;&#2613;&#2623;&#2673;&#2586; &#2588;&#2635;&#2652;)&quot;
 
-#: daemon/bus.py:221
-msgid &quot;Cannot enable input engine&quot;
-msgstr &quot;&#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2607;&#2635;&#2583; &#2600;&#2617;&#2624;&#2562; &#2581;&#2624;&#2596;&#2622; &#2588;&#2622; &#2616;&#2581;&#2598;&#2622; &#2617;&#2632;&quot;
-
-#: daemon/bus.py:222
-msgid &quot;&quot;
-&quot;IBus can not enable input engine, because IBus does not load any input &quot;
-&quot;engines!\n&quot;
-&quot;Please use ibus-setup program to load some input engines.&quot;
-msgstr &quot;&quot;
-&quot;iBus &#2581;&#2635;&#2568; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2607;&#2635;&#2583; &#2600;&#2617;&#2624;&#2562; &#2581;&#2608; &#2616;&#2581;&#2598;&#2624; &#2617;&#2632;, &#2581;&#2623;&#2569;&#2562;&#2581;&#2623; &#2566;&#2568;-&#2604;&#2673;&#2616; &#2581;&#2623;&#2616;&#2631; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2600;&#2626;&#2672; &#2610;&#2635;&#2593; &#2600;&#2617;&#2624;&#2562; &#2581;&#2608; &#2616;&#2581;&#2598;&#2624; &quot;
-&quot;&#2617;&#2632;!\n&quot;
-&quot;&#8233;&#2581;&#2625;&#2589; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2600;&#2626;&#2672; &#2610;&#2635;&#2593; &#2581;&#2608;&#2600; &#2613;&#2622;&#2616;&#2596;&#2631; ibus-setup &#2602;&#2608;&#2635;&#2583;&#2608;&#2622;&#2606; &#2613;&#2608;&#2596;&#2635;&#2562;&#2404;&quot;
-
-#: daemon/bus.py:224
-msgid &quot;Setup&quot;
-msgstr &quot;&#2616;&#2632;&#2673;&#2591;&#2565;&#2673;&#2602;&quot;
-
-#: daemon/bus.py:224
-msgid &quot;Don't show this again&quot;
-msgstr &quot;&#2567;&#2617; &#2606;&#2625;&#2652; &#2600;&#2622; &#2613;&#2631;&#2582;&#2622;&#2579;&quot;
-
 #: setup/setup.glade:7
 msgid &quot;IBus - Setup&quot;
 msgstr &quot;IBus - &#2616;&#2632;&#2673;&#2591;&#2565;&#2673;&#2602;&quot;
@@ -185,7 +151,28 @@ msgstr &quot;&lt;b&gt;UI&lt;/b&gt;&quot;
 msgid &quot;General&quot;
 msgstr &quot;&#2566;&#2606;&quot;
 
-#: setup/setup.glade:385
+#: setup/setup.glade:399
+msgid &quot;gtk-add&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:409
+#, fuzzy
+msgid &quot;gtk-remove&quot;
+msgstr &quot;gtk-close&quot;
+
+#: setup/setup.glade:422
+msgid &quot;gtk-go-up&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:435
+msgid &quot;gtk-go-down&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:460
+msgid &quot;Engine&quot;
+msgstr &quot;&#2567;&#2672;&#2588;&#2595;&quot;
+
+#: setup/setup.glade:477
 msgid &quot;&quot;
 &quot;&lt;big&gt;&lt;b&gt;iBus&lt;/b&gt;&lt;/big&gt;\n&quot;
 &quot;&lt;small&gt;The intelligent input bus&lt;/small&gt;\n&quot;
@@ -201,10 +188,34 @@ msgstr &quot;&quot;
 &quot;&#8233;\n&quot;
 &quot;&#8233;\n&quot;
 
-#: setup/setup.glade:410
+#: setup/setup.glade:502
 msgid &quot;About&quot;
 msgstr &quot;&#2567;&#2616; &#2604;&#2622;&#2608;&#2631;&quot;
 
-#: setup/setup.glade:432
+#: setup/setup.glade:524
 msgid &quot;gtk-close&quot;
 msgstr &quot;gtk-close&quot;
+
+#~ msgid &quot;Started&quot;
+#~ msgstr &quot;&#2586;&#2622;&#2610;&#2626; &#2617;&#2632;&quot;
+
+#~ msgid &quot;Preload&quot;
+#~ msgstr &quot;&#2602;&#2637;&#2608;&#2624;-&#2610;&#2635;&#2593;&quot;
+
+#~ msgid &quot;Cannot enable input engine&quot;
+#~ msgstr &quot;&#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2607;&#2635;&#2583; &#2600;&#2617;&#2624;&#2562; &#2581;&#2624;&#2596;&#2622; &#2588;&#2622; &#2616;&#2581;&#2598;&#2622; &#2617;&#2632;&quot;
+
+#~ msgid &quot;&quot;
+#~ &quot;IBus can not enable input engine, because IBus does not load any input &quot;
+#~ &quot;engines!\n&quot;
+#~ &quot;Please use ibus-setup program to load some input engines.&quot;
+#~ msgstr &quot;&quot;
+#~ &quot;iBus &#2581;&#2635;&#2568; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2607;&#2635;&#2583; &#2600;&#2617;&#2624;&#2562; &#2581;&#2608; &#2616;&#2581;&#2598;&#2624; &#2617;&#2632;, &#2581;&#2623;&#2569;&#2562;&#2581;&#2623; &#2566;&#2568;-&#2604;&#2673;&#2616; &#2581;&#2623;&#2616;&#2631; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2600;&#2626;&#2672; &#2610;&#2635;&#2593; &#2600;&#2617;&#2624;&#2562; &#2581;&#2608; &quot;
+#~ &quot;&#2616;&#2581;&#2598;&#2624; &#2617;&#2632;!\n&quot;
+#~ &quot;&#8233;&#2581;&#2625;&#2589; &#2567;&#2672;&#2602;&#2625;&#2673;&#2591; &#2567;&#2672;&#2588;&#2595; &#2600;&#2626;&#2672; &#2610;&#2635;&#2593; &#2581;&#2608;&#2600; &#2613;&#2622;&#2616;&#2596;&#2631; ibus-setup &#2602;&#2608;&#2635;&#2583;&#2608;&#2622;&#2606; &#2613;&#2608;&#2596;&#2635;&#2562;&#2404;&quot;
+
+#~ msgid &quot;Setup&quot;
+#~ msgstr &quot;&#2616;&#2632;&#2673;&#2591;&#2565;&#2673;&#2602;&quot;
+
+#~ msgid &quot;Don't show this again&quot;
+#~ msgstr &quot;&#2567;&#2617; &#2606;&#2625;&#2652; &#2600;&#2622; &#2613;&#2631;&#2582;&#2622;&#2579;&quot;</diff>
      <filename>po/pa.po</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ msgid &quot;&quot;
 msgstr &quot;&quot;
 &quot;Project-Id-Version: 0.1.1.20080813\n&quot;
 &quot;Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n&quot;
-&quot;POT-Creation-Date: 2008-10-19 09:45+0800\n&quot;
+&quot;POT-Creation-Date: 2009-02-05 10:29+0800\n&quot;
 &quot;PO-Revision-Date: 2008-08-13 21:59+0800\n&quot;
 &quot;Last-Translator: Huang Peng &lt;shawn.p.huang@gmail.com&gt;\n&quot;
 &quot;Language-Team: Huang Peng &lt;shawn.p.huang@gmail.com&gt;\n&quot;
@@ -16,20 +16,20 @@ msgstr &quot;&quot;
 &quot;Content-Transfer-Encoding: 8bit\n&quot;
 &quot;Plural-Forms: nplurals=1; plural=0;\n&quot;
 
-#: ibus/lang.py:40 ui/gtk/panel.py:294 ui/gtk/panel.py:295 ui/gtk/panel.py:296
-#: ui/gtk/panel.py:297 setup/main.py:361 setup/main.py:362 setup/main.py:363
+#: ibus/lang.py:40 ui/gtk/panel.py:307 ui/gtk/panel.py:308 ui/gtk/panel.py:309
+#: ui/gtk/panel.py:310
 msgid &quot;Other&quot;
 msgstr &quot;&#20854;&#20182;&quot;
 
-#: ui/gtk/panel.py:94
+#: ui/gtk/panel.py:99
 msgid &quot;iBus - Running&quot;
 msgstr &quot;iBus - &#36816;&#34892;&quot;
 
-#: ui/gtk/panel.py:356
+#: ui/gtk/panel.py:370
 msgid &quot;IBus is an intelligent input bus for Linux/Unix.&quot;
 msgstr &quot;&quot;
 
-#: ui/gtk/panel.py:360
+#: ui/gtk/panel.py:374
 msgid &quot;translator-credits&quot;
 msgstr &quot;Huang Peng &lt;shawn.p.huang@gmail.com&gt;&quot;
 
@@ -37,23 +37,23 @@ msgstr &quot;Huang Peng &lt;shawn.p.huang@gmail.com&gt;&quot;
 msgid &quot;Switch engine&quot;
 msgstr &quot;&#20999;&#25442;&#24341;&#25806;&quot;
 
-#: setup/main.py:100
+#: setup/main.py:99
 msgid &quot;trigger&quot;
 msgstr &quot;&#24320;&#20851;&quot;
 
-#: setup/main.py:110
+#: setup/main.py:109
 msgid &quot;next engine&quot;
 msgstr &quot;&#19979;&#19968;&#20010;&#24341;&#25806;&quot;
 
-#: setup/main.py:120
+#: setup/main.py:119
 msgid &quot;prev engine&quot;
 msgstr &quot;&#19978;&#19968;&#20010;&#24341;&#25806;&quot;
 
-#: setup/main.py:165
+#: setup/main.py:197
 msgid &quot;IBus daemon is not started. Do you want to start it now?&quot;
 msgstr &quot;IBus&#23432;&#25252;&#36827;&#31243;&#27809;&#26377;&#21551;&#21160;&#65292;&#24744;&#26159;&#21542;&#24819;&#29616;&#22312;&#21551;&#21160;&#23427;&#65311;&quot;
 
-#: setup/main.py:180
+#: setup/main.py:212
 msgid &quot;&quot;
 &quot;IBus has been started! If you can not use IBus, please add below lines in &quot;
 &quot;$HOME/.bashrc, and relogin your desktop.\n&quot;
@@ -66,19 +66,7 @@ msgstr &quot;&quot;
 &quot;  export XMODIFIERS=@im=ibus\n&quot;
 &quot;  export QT_IM_MODULE=ibus&quot;
 
-#: setup/main.py:202 setup/setup.glade:368
-msgid &quot;Engine&quot;
-msgstr &quot;&#36755;&#20837;&#27861;&#24341;&#25806;&quot;
-
-#: setup/main.py:229
-msgid &quot;Started&quot;
-msgstr &quot;&#21551;&#21160;&quot;
-
-#: setup/main.py:239
-msgid &quot;Preload&quot;
-msgstr &quot;&#39044;&#21152;&#36733;&quot;
-
-#: setup/main.py:249
+#: setup/main.py:227
 #, python-format
 msgid &quot;Select keyboard shortcut for %s&quot;
 msgstr &quot;&#36873;&#25321;%s&#30340;&#24555;&#25463;&#38190;&quot;
@@ -107,27 +95,6 @@ msgstr &quot;&quot;
 msgid &quot;Please press a key (or a key combination)&quot;
 msgstr &quot;&#35831;&#25353;&#19968;&#20010;&#38190;&#30424;&#25353;&#38190;&#65288;&#25110;&#32773;&#19968;&#20010;&#32452;&#21512;&#25353;&#38190;&#65289;&quot;
 
-#: daemon/bus.py:221
-msgid &quot;Cannot enable input engine&quot;
-msgstr &quot;&#19981;&#33021;&#21551;&#21160;&#36755;&#20837;&#24341;&#25806;&quot;
-
-#: daemon/bus.py:222
-msgid &quot;&quot;
-&quot;IBus can not enable input engine, because IBus does not load any input &quot;
-&quot;engines!\n&quot;
-&quot;Please use ibus-setup program to load some input engines.&quot;
-msgstr &quot;&quot;
-&quot;IBus&#19981;&#33021;&#21551;&#21160;&#36755;&#20837;&#24341;&#25806;&#65292;&#22240;&#20026;IBus&#27809;&#26377;&#21152;&#36733;&#20219;&#20309;&#36755;&#20837;&#24341;&#25806;&#65281;\n&quot;
-&quot;&#35831;&#36816;&#34892;ibus-setup&#31243;&#24207;&#65292;&#21551;&#21160;&#38656;&#35201;&#30340;&#36755;&#20837;&#27861;&#24341;&#25806;&#12290;&quot;
-
-#: daemon/bus.py:224
-msgid &quot;Setup&quot;
-msgstr &quot;&#35774;&#32622;&quot;
-
-#: daemon/bus.py:224
-msgid &quot;Don't show this again&quot;
-msgstr &quot;&#19981;&#20877;&#26174;&#31034;&#35813;&#20449;&#24687;&quot;
-
 #: setup/setup.glade:7
 msgid &quot;IBus - Setup&quot;
 msgstr &quot;IBus - &#35774;&#32622;&quot;
@@ -184,7 +151,27 @@ msgstr &quot;&lt;b&gt;&#29992;&#25143;&#30028;&#38754;&lt;/b&gt;&quot;
 msgid &quot;General&quot;
 msgstr &quot;&#36890;&#29992;&quot;
 
-#: setup/setup.glade:385
+#: setup/setup.glade:399
+msgid &quot;gtk-add&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:409
+msgid &quot;gtk-remove&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:422
+msgid &quot;gtk-go-up&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:435
+msgid &quot;gtk-go-down&quot;
+msgstr &quot;&quot;
+
+#: setup/setup.glade:460
+msgid &quot;Engine&quot;
+msgstr &quot;&#36755;&#20837;&#27861;&#24341;&#25806;&quot;
+
+#: setup/setup.glade:477
 msgid &quot;&quot;
 &quot;&lt;big&gt;&lt;b&gt;iBus&lt;/b&gt;&lt;/big&gt;\n&quot;
 &quot;&lt;small&gt;The intelligent input bus&lt;/small&gt;\n&quot;
@@ -194,10 +181,33 @@ msgid &quot;&quot;
 &quot;\n&quot;
 msgstr &quot;&quot;
 
-#: setup/setup.glade:410
+#: setup/setup.glade:502
 msgid &quot;About&quot;
 msgstr &quot;&#20851;&#20110;&quot;
 
-#: setup/setup.glade:432
+#: setup/setup.glade:524
 msgid &quot;gtk-close&quot;
 msgstr &quot;&quot;
+
+#~ msgid &quot;Started&quot;
+#~ msgstr &quot;&#21551;&#21160;&quot;
+
+#~ msgid &quot;Preload&quot;
+#~ msgstr &quot;&#39044;&#21152;&#36733;&quot;
+
+#~ msgid &quot;Cannot enable input engine&quot;
+#~ msgstr &quot;&#19981;&#33021;&#21551;&#21160;&#36755;&#20837;&#24341;&#25806;&quot;
+
+#~ msgid &quot;&quot;
+#~ &quot;IBus can not enable input engine, because IBus does not load any input &quot;
+#~ &quot;engines!\n&quot;
+#~ &quot;Please use ibus-setup program to load some input engines.&quot;
+#~ msgstr &quot;&quot;
+#~ &quot;IBus&#19981;&#33021;&#21551;&#21160;&#36755;&#20837;&#24341;&#25806;&#65292;&#22240;&#20026;IBus&#27809;&#26377;&#21152;&#36733;&#20219;&#20309;&#36755;&#20837;&#24341;&#25806;&#65281;\n&quot;
+#~ &quot;&#35831;&#36816;&#34892;ibus-setup&#31243;&#24207;&#65292;&#21551;&#21160;&#38656;&#35201;&#30340;&#36755;&#20837;&#27861;&#24341;&#25806;&#12290;&quot;
+
+#~ msgid &quot;Setup&quot;
+#~ msgstr &quot;&#35774;&#32622;&quot;
+
+#~ msgid &quot;Don't show this again&quot;
+#~ msgstr &quot;&#19981;&#20877;&#26174;&#31034;&#35813;&#20449;&#24687;&quot;</diff>
      <filename>po/zh_CN.po</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,2 @@
 ibus-setup
+ibus-setup.desktop</diff>
      <filename>setup/.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,9 @@
 
 ibussetup_PYTHON = \
 	main.py \
+	icon.py \
+	enginecombobox.py \
+	enginetreeview.py \
 	keyboardshortcut.py \
 	$(NULL)
 </diff>
      <filename>setup/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -80,7 +80,7 @@ class KeyboardShortcutSelection(gtk.VBox):
 
         table = gtk.Table(4, 2)
         self.__modifier_buttons = []
-        self.__modifier_buttons.append((&quot;Ctrl&quot;,     gtk.CheckButton(&quot;_Ctrl&quot;),       gdk.CONTROL_MASK))
+        self.__modifier_buttons.append((&quot;Control&quot;,     gtk.CheckButton(&quot;_Control&quot;),       gdk.CONTROL_MASK))
         self.__modifier_buttons.append((&quot;Alt&quot;,      gtk.CheckButton(&quot;A_lt&quot;),        gdk.MOD1_MASK))
         self.__modifier_buttons.append((&quot;Shift&quot;,    gtk.CheckButton(&quot;_Shift&quot;),      gdk.SHIFT_MASK))
         self.__modifier_buttons.append((&quot;Meta&quot;,     gtk.CheckButton(&quot;_Meta&quot;),       gdk.META_MASK))
@@ -258,7 +258,7 @@ if __name__ == &quot;__main__&quot;:
     dlg = KeyboardShortcutSelectionDialog(
         title = &quot;Select test&quot;,
         buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK))
-    dlg.add_shortcut(&quot;Ctrl+Shift+space&quot;)
+    dlg.add_shortcut(&quot;Control+Shift+space&quot;)
     dlg.set_shortcuts(None)
     print dlg.run()
     print dlg.get_shortcuts()</diff>
      <filename>setup/keyboardshortcut.py</filename>
    </modified>
    <modified>
      <diff>@@ -33,6 +33,9 @@ from os import path
 from xdg import BaseDirectory
 from gtk import gdk
 from gtk import glade
+from enginecombobox import EngineComboBox
+from enginetreeview import EngineTreeView
+from icon import load_icon
 
 _  = lambda a : gettext.dgettext(&quot;ibus&quot;, a)
 N_ = lambda a : a
@@ -75,12 +78,6 @@ class Setup(object):
 
     def __init_ui(self):
         # add icon search path
-        icon_theme = gtk.icon_theme_get_default()
-        dir = path.dirname(__file__)
-        icondir = path.join(dir, &quot;..&quot;, &quot;icons&quot;)
-        icon_theme.prepend_search_path(icondir)
-
-
         self.__dialog = self.__xml.get_widget(&quot;dialog_setup&quot;)
 
         # auto start ibus
@@ -90,76 +87,111 @@ class Setup(object):
 
         # keyboard shortcut
         # trigger
-        shortcuts = self.__bus.config_get_value(
-                        &quot;general&quot;, &quot;keyboard_shortcut_trigger&quot;,
+        self.__config = self.__bus.get_config()
+        shortcuts = self.__config.get_value(
+                        &quot;general/hotkey&quot;, &quot;trigger&quot;,
                         ibus.CONFIG_GENERAL_SHORTCUT_TRIGGER_DEFAULT)
+
         button = self.__xml.get_widget(&quot;button_trigger&quot;)
         entry = self.__xml.get_widget(&quot;entry_trigger&quot;)
         entry.set_text(&quot;; &quot;.join(shortcuts))
         button.connect(&quot;clicked&quot;, self.__shortcut_button_clicked_cb,
-                    N_(&quot;trigger&quot;), &quot;general&quot;, &quot;keyboard_shortcut_trigger&quot;, entry)
+                    N_(&quot;trigger&quot;), &quot;general/hotkey&quot;, &quot;trigger&quot;, entry)
 
         # next engine
-        shortcuts = self.__bus.config_get_value(
-                        &quot;general&quot;, &quot;keyboard_shortcut_next_engine&quot;,
+        shortcuts = self.__config.get_value(
+                        &quot;general/hotkey&quot;, &quot;next_engine&quot;,
                         ibus.CONFIG_GENERAL_SHORTCUT_NEXT_ENGINE_DEFAULT)
         button = self.__xml.get_widget(&quot;button_next_engine&quot;)
         entry = self.__xml.get_widget(&quot;entry_next_engine&quot;)
         entry.set_text(&quot;; &quot;.join(shortcuts))
         button.connect(&quot;clicked&quot;, self.__shortcut_button_clicked_cb,
-                    N_(&quot;next engine&quot;), &quot;general&quot;, &quot;keyboard_shortcut_next_engine&quot;, entry)
+                    N_(&quot;next engine&quot;), &quot;general/hotkey&quot;, &quot;next_engine&quot;, entry)
 
         # prev engine
-        shortcuts = self.__bus.config_get_value(
-                        &quot;general&quot;, &quot;keyboard_shortcut_prev_engine&quot;,
+        shortcuts = self.__config.get_value(
+                        &quot;general/hotkey&quot;, &quot;prev_engine&quot;,
                         ibus.CONFIG_GENERAL_SHORTCUT_PREV_ENGINE_DEFAULT)
         button = self.__xml.get_widget(&quot;button_prev_engine&quot;)
         entry = self.__xml.get_widget(&quot;entry_prev_engine&quot;)
         entry.set_text(&quot;; &quot;.join(shortcuts))
         button.connect(&quot;clicked&quot;, self.__shortcut_button_clicked_cb,
-                    N_(&quot;prev engine&quot;), &quot;general&quot;, &quot;keyboard_shortcut_prev_engine&quot;, entry)
-
-
+                    N_(&quot;prev engine&quot;), &quot;general/hotkey&quot;, &quot;prev_engine&quot;, entry)
 
         # lookup table orientation
         self.__combobox_lookup_table_orientation = self.__xml.get_widget(&quot;combobox_lookup_table_orientation&quot;)
         self.__combobox_lookup_table_orientation.set_active(
-            self.__bus.config_get_value(&quot;panel&quot;, &quot;lookup_table_orientation&quot;, 0))
+            self.__config.get_value(&quot;panel&quot;, &quot;lookup_table_orientation&quot;, 0))
         self.__combobox_lookup_table_orientation.connect(&quot;changed&quot;,
             self.__combobox_lookup_table_orientation_changed_cb)
 
         # auto hide
         self.__checkbutton_auto_hide = self.__xml.get_widget(&quot;checkbutton_auto_hide&quot;)
         self.__checkbutton_auto_hide.set_active(
-            self.__bus.config_get_value(&quot;panel&quot;, &quot;auto_hide&quot;, False))
+            self.__config.get_value(&quot;panel&quot;, &quot;auto_hide&quot;, False))
         self.__checkbutton_auto_hide.connect(&quot;toggled&quot;, self.__checkbutton_auto_hide_toggled_cb)
 
         # custom font
         self.__checkbutton_custom_font = self.__xml.get_widget(&quot;checkbutton_custom_font&quot;)
         self.__checkbutton_custom_font.set_active(
-            self.__bus.config_get_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False))
+            self.__config.get_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False))
         self.__checkbutton_custom_font.connect(&quot;toggled&quot;, self.__checkbutton_custom_font_toggled_cb)
 
         self.__fontbutton_custom_font = self.__xml.get_widget(&quot;fontbutton_custom_font&quot;)
-        if self.__bus.config_get_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False):
+        if self.__config.get_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False):
             self.__fontbutton_custom_font.set_sensitive(True)
         else:
             self.__fontbutton_custom_font.set_sensitive(False)
         font_name = gtk.settings_get_default().get_property(&quot;gtk-font-name&quot;)
         font_name = unicode(font_name, &quot;utf-8&quot;)
-        font_name = self.__bus.config_get_value(&quot;panel&quot;, &quot;custom_font&quot;, font_name)
+        font_name = self.__config.get_value(&quot;panel&quot;, &quot;custom_font&quot;, font_name)
         self.__fontbutton_custom_font.connect(&quot;notify::font-name&quot;, self.__fontbutton_custom_font_notify_cb)
         self.__fontbutton_custom_font.set_font_name(font_name)
 
-        self.__init_engine_view()
+        # init engine page
+        self.__engines = self.__bus.list_engines()
+        self.__combobox = EngineComboBox(self.__engines)
+        self.__combobox.show()
+        self.__xml.get_widget(&quot;alignment_engine_combobox&quot;).add(self.__combobox)
+
+        tmp_dict = {}
+        for e in self.__engines:
+            tmp_dict[e.name] = e
+        engine_names = self.__config.get_value(&quot;general&quot;, &quot;preload_engines&quot;, [])
+        engines = []
+        for n in engine_names:
+            if n in tmp_dict:
+                engines.append(tmp_dict[n])
+        self.__treeview = EngineTreeView(engines)
+        self.__treeview.show()
+        self.__xml.get_widget(&quot;scrolledwindow_engine_treeview&quot;).add(self.__treeview)
+
+        self.__treeview.connect(&quot;changed&quot;, self.__treeview_changed_cb)
+
+        button = self.__xml.get_widget(&quot;button_engine_add&quot;)
+        button.connect(&quot;clicked&quot;,
+                       lambda *args:self.__treeview.prepend_engine(self.__combobox.get_active_engine()))
+        button = self.__xml.get_widget(&quot;button_engine_remove&quot;)
+        button.connect(&quot;clicked&quot;, lambda *args:self.__treeview.remove_engine())
+        button = self.__xml.get_widget(&quot;button_engine_up&quot;)
+        button.connect(&quot;clicked&quot;, lambda *args:self.__treeview.move_up_engine())
+
+        button = self.__xml.get_widget(&quot;button_engine_down&quot;)
+        button.connect(&quot;clicked&quot;, lambda *args:self.__treeview.move_down_engine())
+
+    def __treeview_changed_cb(self, treeview):
+        engines = self.__treeview.get_engines()
+        engine_names = map(lambda e: e.name, engines)
+        self.__config.set_list(&quot;general&quot;, &quot;preload_engines&quot;, engine_names, &quot;s&quot;)
 
     def __init_bus(self):
         try:
             self.__bus = ibus.Bus()
             # self.__bus.connect(&quot;config-value-changed&quot;, self.__config_value_changed_cb)
-            self.__bus.connect(&quot;config-reloaded&quot;, self.__config_reloaded_cb)
-            self.__bus.config_add_watch(&quot;/general&quot;)
-            self.__bus.config_add_watch(&quot;/panel&quot;)
+            # self.__bus.connect(&quot;config-reloaded&quot;, self.__config_reloaded_cb)
+            # self.__bus.config_add_watch(&quot;/general&quot;)
+            # self.__bus.config_add_watch(&quot;/general/hotkey&quot;)
+            # self.__bus.config_add_watch(&quot;/panel&quot;)
         except:
             while self.__bus == None:
                 message = _(&quot;IBus daemon is not started. Do you want to start it now?&quot;)
@@ -190,60 +222,6 @@ class Setup(object):
                 dlg.destroy()
                 self.__flush_gtk_events()
 
-    def __init_engine_view(self):
-        # engines tree
-        self.__tree = self.__xml.get_widget(&quot;treeview_engines&quot;)
-        self.__preload_engines = set(self.__bus.config_get_value(&quot;general&quot;, &quot;preload_engines&quot;, []))
-        model = self.__create_model()
-        self.__tree.set_model(model)
-
-        # column for engine
-        column = gtk.TreeViewColumn()
-        column.set_title(_(&quot;Engine&quot;))
-        column.set_resizable(True)
-        column.set_min_width(120)
-
-        renderer = gtk.CellRendererPixbuf()
-        renderer.set_property(&quot;xalign&quot;, 0.5)
-
-        column.pack_start(renderer, False)
-        column.set_attributes(renderer, pixbuf = COLUMN_ICON, visible = COLUMN_VISIBLE)
-
-        renderer = gtk.CellRendererText()
-        renderer.set_property(&quot;xalign&quot;, 0.0)
-        renderer.set_property(&quot;ellipsize&quot;, pango.ELLIPSIZE_END)
-
-        # column.set_clickable(True)
-        column.pack_start(renderer)
-        column.set_attributes(renderer, text = COLUMN_NAME)
-
-        self.__tree.append_column(column)
-
-        # column for started
-        renderer = gtk.CellRendererToggle()
-        renderer.set_data('column', COLUMN_ENABLE)
-        renderer.set_property(&quot;xalign&quot;, 0.5)
-        renderer.connect(&quot;toggled&quot;, self.__item_started_column_toggled_cb, model)
-
-        #col_offset = gtk.TreeViewColumn(&quot;Holiday&quot;, renderer, text=HOLIDAY_NAME)
-        column = gtk.TreeViewColumn(_(&quot;Started&quot;), renderer, active = COLUMN_ENABLE, visible = COLUMN_VISIBLE)
-        column.set_resizable(True)
-        self.__tree.append_column(column)
-
-        # column for preload
-        renderer = gtk.CellRendererToggle()
-        renderer.set_data('column', COLUMN_PRELOAD)
-        renderer.set_property(&quot;xalign&quot;, 0.5)
-        renderer.connect(&quot;toggled&quot;, self.__item_preload_column_toggled_cb, model)
-
-        column = gtk.TreeViewColumn(_(&quot;Preload&quot;), renderer, active = COLUMN_PRELOAD, visible = COLUMN_VISIBLE)
-        column.set_resizable(True)
-        self.__tree.append_column(column)
-
-        renderer = gtk.CellRendererText()
-        column = gtk.TreeViewColumn(&quot;&quot;, renderer)
-        self.__tree.append_column(column)
-
     def __shortcut_button_clicked_cb(self, button, name, section, _name, entry):
         buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK)
         title = _(&quot;Select keyboard shortcut for %s&quot;) %  _(name)
@@ -259,7 +237,7 @@ class Setup(object):
         dialog.destroy()
         if id != gtk.RESPONSE_OK:
             return
-        self.__bus.config_set_value(section, _name, shortcuts)
+        self.__config.set_value(section, _name, shortcuts)
         entry.set_text(&quot;; &quot;.join(shortcuts))
 
 
@@ -309,94 +287,15 @@ class Setup(object):
         if data[DATA_PRELOAD]:
             if engine not in self.__preload_engines:
                 self.__preload_engines.add(engine)
-                self.__bus.config_set_list(&quot;general&quot;, &quot;preload_engines&quot;, list(self.__preload_engines), &quot;s&quot;)
+                self.__config.set_list(&quot;general&quot;, &quot;preload_engines&quot;, list(self.__preload_engines), &quot;s&quot;)
         else:
             if engine in self.__preload_engines:
                 self.__preload_engines.remove(engine)
-                self.__bus.config_set_list(&quot;general&quot;, &quot;preload_engines&quot;, list(self.__preload_engines), &quot;s&quot;)
+                self.__config.set_list(&quot;general&quot;, &quot;preload_engines&quot;, list(self.__preload_engines), &quot;s&quot;)
 
         # set new value
         model.set(iter, COLUMN_PRELOAD, data[DATA_PRELOAD])
 
-    def __load_icon(self, icon, icon_size):
-        pixbuf = None
-        try:
-            pixbuf = gdk.pixbuf_new_from_file(icon)
-            w, h = pixbuf.get_width(), pixbuf.get_height()
-            rate = max(w, h) / float(icon_size)
-            w = int(w / rate)
-            h = int(h / rate)
-            pixbuf = pixbuf.scale_simple(w, h, gdk.INTERP_BILINEAR)
-        except:
-            pass
-        if pixbuf == None:
-            try:
-                theme = gtk.icon_theme_get_default()
-                pixbuf = theme.load_icon(icon, icon_size, 0)
-            except:
-                pass
-        return pixbuf
-
-    def __create_model(self):
-        # create tree store
-        model = gtk.TreeStore(
-            gobject.TYPE_STRING,
-            gobject.TYPE_BOOLEAN,
-            gobject.TYPE_BOOLEAN,
-            gobject.TYPE_BOOLEAN,
-            gdk.Pixbuf,
-            gobject.TYPE_PYOBJECT)
-
-        langs = dict()
-
-        self.__bus.register_reload_engines()
-        for name, local_name, lang, icon, author, credits, _exec, started in self.__bus.register_list_engines():
-            _lang = ibus.get_language_name(lang)
-            if _lang not in langs:
-                langs[_lang] = list()
-            langs[_lang].append([name, local_name, lang, icon, author, credits, _exec, started])
-
-        keys = langs.keys()
-        keys.sort()
-        if _(&quot;Other&quot;) in keys:
-            keys.remove(_(&quot;Other&quot;))
-            keys.append(_(&quot;Other&quot;))
-
-        icon_size = gtk.icon_size_lookup(gtk.ICON_SIZE_LARGE_TOOLBAR)[0]
-        pixbuf_missing = self.__load_icon(&quot;engine-default&quot;, icon_size)
-        if pixbuf_missing == None:
-            pixbuf_missing = self.__load_icon(&quot;gtk-missing-image&quot;, icon_size)
-
-        for key in keys:
-            iter = model.append(None)
-            model.set(iter,
-                COLUMN_NAME, key,
-                COLUMN_ENABLE, False,
-                COLUMN_PRELOAD, False,
-                COLUMN_VISIBLE, False,
-                COLUMN_ICON, None,
-                COLUMN_DATA, None)
-            langs[key].sort()
-
-            for name, local_name, lang, icon, author, credits, _exec, started in langs[key]:
-                child_iter = model.append(iter)
-                is_preload = &quot;%s:%s&quot; % (lang, name) in self.__preload_engines
-
-                pixbuf = self.__load_icon(icon, icon_size)
-                if pixbuf == None:
-                    pixbuf = pixbuf_missing
-
-                model.set(child_iter,
-                    COLUMN_NAME, local_name,
-                    COLUMN_ENABLE, started,
-                    COLUMN_PRELOAD, is_preload,
-                    COLUMN_VISIBLE, True,
-                    COLUMN_ICON, pixbuf,
-                    COLUMN_DATA,
-                    [name, local_name, lang, icon, author, credits, _exec, started, is_preload])
-
-        return model
-
     def __is_auto_start(self):
         link_file = path.join(BaseDirectory.xdg_config_home, &quot;autostart/ibus.desktop&quot;)
         ibus_desktop = path.join(os.getenv(&quot;IBUS_PREFIX&quot;), &quot;share/applications/ibus.desktop&quot;)
@@ -425,27 +324,27 @@ class Setup(object):
             os.symlink(ibus_desktop, link_file)
 
     def __combobox_lookup_table_orientation_changed_cb(self, combobox):
-        self.__bus.config_set_value(
+        self.__config.set_value(
             &quot;panel&quot;, &quot;lookup_table_orientation&quot;,
             self.__combobox_lookup_table_orientation.get_active())
 
     def __checkbutton_auto_hide_toggled_cb(self, button):
-        self.__bus.config_set_value(
+        self.__config.set_value(
             &quot;panel&quot;, &quot;auto_hide&quot;,
             self.__checkbutton_auto_hide.get_active())
 
     def __checkbutton_custom_font_toggled_cb(self, button):
         if self.__checkbutton_custom_font.get_active():
             self.__fontbutton_custom_font.set_sensitive(True)
-            self.__bus.config_set_value(&quot;panel&quot;, &quot;use_custom_font&quot;, True)
+            self.__config.set_value(&quot;panel&quot;, &quot;use_custom_font&quot;, True)
         else:
             self.__fontbutton_custom_font.set_sensitive(False)
-            self.__bus.config_set_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False)
+            self.__config.set_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False)
 
     def __fontbutton_custom_font_notify_cb(self, button, arg):
         font_name = self.__fontbutton_custom_font.get_font_name()
         font_name = unicode(font_name, &quot;utf-8&quot;)
-        self.__bus.config_set_value(&quot;panel&quot;, &quot;custom_font&quot;, font_name)
+        self.__config.set_value(&quot;panel&quot;, &quot;custom_font&quot;, font_name)
 
     def __config_value_changed_cb(self, bus, section, name, value):
         pass</diff>
      <filename>setup/main.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
 &lt;!DOCTYPE glade-interface SYSTEM &quot;glade-2.0.dtd&quot;&gt;
-&lt;!--Generated with glade3 3.4.5 on Thu Oct  9 11:25:43 2008 --&gt;
+&lt;!--Generated with glade3 3.4.5 on Wed Feb  4 15:58:20 2009 --&gt;
 &lt;glade-interface&gt;
   &lt;widget class=&quot;GtkDialog&quot; id=&quot;dialog_setup&quot;&gt;
     &lt;property name=&quot;border_width&quot;&gt;5&lt;/property&gt;
@@ -340,20 +340,112 @@ Vertical&lt;/property&gt;
                 &lt;property name=&quot;left_padding&quot;&gt;2&lt;/property&gt;
                 &lt;property name=&quot;right_padding&quot;&gt;2&lt;/property&gt;
                 &lt;child&gt;
-                  &lt;widget class=&quot;GtkScrolledWindow&quot; id=&quot;scrolledwindow1&quot;&gt;
-                    &lt;property name=&quot;width_request&quot;&gt;300&lt;/property&gt;
-                    &lt;property name=&quot;height_request&quot;&gt;350&lt;/property&gt;
+                  &lt;widget class=&quot;GtkHBox&quot; id=&quot;hbox1&quot;&gt;
                     &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
-                    &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
-                    &lt;property name=&quot;hscrollbar_policy&quot;&gt;GTK_POLICY_AUTOMATIC&lt;/property&gt;
-                    &lt;property name=&quot;vscrollbar_policy&quot;&gt;GTK_POLICY_AUTOMATIC&lt;/property&gt;
-                    &lt;property name=&quot;shadow_type&quot;&gt;GTK_SHADOW_IN&lt;/property&gt;
                     &lt;child&gt;
-                      &lt;widget class=&quot;GtkTreeView&quot; id=&quot;treeview_engines&quot;&gt;
+                      &lt;widget class=&quot;GtkAlignment&quot; id=&quot;alignment6&quot;&gt;
                         &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
-                        &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
-                        &lt;property name=&quot;reorderable&quot;&gt;True&lt;/property&gt;
+                        &lt;property name=&quot;top_padding&quot;&gt;4&lt;/property&gt;
+                        &lt;child&gt;
+                          &lt;widget class=&quot;GtkVBox&quot; id=&quot;vbox1&quot;&gt;
+                            &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                            &lt;property name=&quot;spacing&quot;&gt;6&lt;/property&gt;
+                            &lt;child&gt;
+                              &lt;widget class=&quot;GtkAlignment&quot; id=&quot;alignment_engine_combobox&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;child&gt;
+                                  &lt;placeholder/&gt;
+                                &lt;/child&gt;
+                              &lt;/widget&gt;
+                            &lt;/child&gt;
+                            &lt;child&gt;
+                              &lt;widget class=&quot;GtkScrolledWindow&quot; id=&quot;scrolledwindow_engine_treeview&quot;&gt;
+                                &lt;property name=&quot;width_request&quot;&gt;240&lt;/property&gt;
+                                &lt;property name=&quot;height_request&quot;&gt;350&lt;/property&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;hscrollbar_policy&quot;&gt;GTK_POLICY_AUTOMATIC&lt;/property&gt;
+                                &lt;property name=&quot;vscrollbar_policy&quot;&gt;GTK_POLICY_AUTOMATIC&lt;/property&gt;
+                                &lt;property name=&quot;shadow_type&quot;&gt;GTK_SHADOW_IN&lt;/property&gt;
+                                &lt;child&gt;
+                                  &lt;placeholder/&gt;
+                                &lt;/child&gt;
+                              &lt;/widget&gt;
+                              &lt;packing&gt;
+                                &lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
+                              &lt;/packing&gt;
+                            &lt;/child&gt;
+                          &lt;/widget&gt;
+                        &lt;/child&gt;
+                      &lt;/widget&gt;
+                    &lt;/child&gt;
+                    &lt;child&gt;
+                      &lt;widget class=&quot;GtkAlignment&quot; id=&quot;alignment2&quot;&gt;
+                        &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                        &lt;property name=&quot;top_padding&quot;&gt;8&lt;/property&gt;
+                        &lt;property name=&quot;bottom_padding&quot;&gt;8&lt;/property&gt;
+                        &lt;property name=&quot;left_padding&quot;&gt;8&lt;/property&gt;
+                        &lt;property name=&quot;right_padding&quot;&gt;8&lt;/property&gt;
+                        &lt;child&gt;
+                          &lt;widget class=&quot;GtkVButtonBox&quot; id=&quot;vbuttonbox1&quot;&gt;
+                            &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                            &lt;property name=&quot;spacing&quot;&gt;5&lt;/property&gt;
+                            &lt;property name=&quot;layout_style&quot;&gt;GTK_BUTTONBOX_START&lt;/property&gt;
+                            &lt;child&gt;
+                              &lt;widget class=&quot;GtkButton&quot; id=&quot;button_engine_add&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;receives_default&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;gtk-add&lt;/property&gt;
+                                &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;response_id&quot;&gt;0&lt;/property&gt;
+                              &lt;/widget&gt;
+                            &lt;/child&gt;
+                            &lt;child&gt;
+                              &lt;widget class=&quot;GtkButton&quot; id=&quot;button_engine_remove&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;receives_default&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;gtk-remove&lt;/property&gt;
+                                &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;response_id&quot;&gt;0&lt;/property&gt;
+                              &lt;/widget&gt;
+                              &lt;packing&gt;
+                                &lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
+                              &lt;/packing&gt;
+                            &lt;/child&gt;
+                            &lt;child&gt;
+                              &lt;widget class=&quot;GtkButton&quot; id=&quot;button_engine_up&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;receives_default&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;gtk-go-up&lt;/property&gt;
+                                &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;response_id&quot;&gt;0&lt;/property&gt;
+                              &lt;/widget&gt;
+                              &lt;packing&gt;
+                                &lt;property name=&quot;position&quot;&gt;2&lt;/property&gt;
+                              &lt;/packing&gt;
+                            &lt;/child&gt;
+                            &lt;child&gt;
+                              &lt;widget class=&quot;GtkButton&quot; id=&quot;button_engine_down&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;receives_default&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;gtk-go-down&lt;/property&gt;
+                                &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;response_id&quot;&gt;0&lt;/property&gt;
+                              &lt;/widget&gt;
+                              &lt;packing&gt;
+                                &lt;property name=&quot;position&quot;&gt;3&lt;/property&gt;
+                              &lt;/packing&gt;
+                            &lt;/child&gt;
+                          &lt;/widget&gt;
+                        &lt;/child&gt;
                       &lt;/widget&gt;
+                      &lt;packing&gt;
+                        &lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
+                      &lt;/packing&gt;
                     &lt;/child&gt;
                   &lt;/widget&gt;
                 &lt;/child&gt;</diff>
      <filename>setup/setup.glade</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,2 @@
 ibus-ui-gtk
+gtkpanel.xml</diff>
      <filename>ui/gtk/.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -31,10 +31,16 @@ ui_gtk_PYTHON = \
 	propitem.py \
 	toolitem.py \
 	$(NULL)
-
 ui_gtkdir = $(pkgdatadir)/ui/gtk
 
-bin_SCRIPTS = ibus-ui-gtk
+libexec_SCRIPTS = \
+	ibus-ui-gtk \
+	$(NULL)
+
+component_DATA = \
+	gtkpanel.xml \
+	$(NULL)
+componentdir = $(pkgdatadir)/component
 
 CLEANFILES = \
 	*.pyc \
@@ -42,9 +48,11 @@ CLEANFILES = \
 
 EXTRA_DIST = \
 	ibus-ui-gtk.in \
+	gtkpanel.xml.in \
 	$(NULL)
 
 test:
 	$(ENV) DBUS_DEBUG=true \
+		IBUS_PREFIX=@prefix@ \
 		PYTHONPATH=$(top_srcdir) \
 		$(PYTHON) $(srcdir)/main.py</diff>
      <filename>ui/gtk/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ import gtk.gdk as gdk
 import gobject
 import pango
 import ibus
-from ibus.gtk import PangoAttrList
+from ibus._gtk import PangoAttrList
 
 class Label(gtk.Label): pass
 gobject.type_register(Label, &quot;IBusPanelLabel&quot;)
@@ -260,58 +260,53 @@ class CandidatePanel(gtk.VBox):
         # self.hide_all()
         # self.show_all()
 
-    def show_preedit(self):
+    def show_preedit_text(self):
         self.__preedit_visible = True
         self.__preedit_label.show()
         self.__check_show_states()
 
-    def hide_preedit(self):
+    def hide_preedit_text(self):
         self.__preedit_visible = False
         self.__preedit_label.hide()
         self.__check_show_states()
 
-    def update_preedit(self, text, attrs, cursor_pos, visible):
-        if attrs:
-            attrs = PangoAttrList(attrs, text)
+    def update_preedit_text(self, text, cursor_pos, visible):
+        attrs = PangoAttrList(text.attributes, text.text)
         if visible:
-            self.show_preedit()
+            self.show_preedit_text()
         else:
-            self.hide_preedit()
-        self.__preedit_string = text
-        self.__preedit_label.set_text(text)
-        if attrs == None:
-            attrs = pango.AttrList()
+            self.hide_preedit_text()
+        self.__preedit_stribg = text.text
+        self.__preedit_label.set_text(text.text)
         self.__preedit_attrs = attrs
         self.__preedit_label.set_attributes(attrs)
 
-    def show_aux_string(self):
+    def show_auxiliary_text(self):
         self.__aux_string_visible = True
         self.__aux_label.show()
         self.__check_show_states()
 
-    def hide_aux_string(self):
+    def hide_auxiliary_text(self):
         self.__aux_string_visible = False
         self.__aux_label.hide()
         self.__check_show_states()
 
-    def update_aux_string(self, text, attrs, show):
-        attrs = PangoAttrList(attrs, text)
+    def update_auxiliary_text(self, text, show):
+        attrs = PangoAttrList(text.attributes, text.text)
 
         if show:
-            self.show_aux_string()
+            self.show_auxiliary_text()
         else:
-            self.hide_aux_string()
+            self.hide_auxiliary_text()
 
-        self.__aux_string = text
-        self.__aux_label.set_text(text)
-        if attrs == None:
-            attrs = pango.AttrList()
+        self.__aux_string = text.text
+        self.__aux_label.set_text(text.text)
         self.__aux_attrs = attrs
         self.__aux_label.set_attributes(attrs)
 
     def __refresh_candidates(self):
-        candidates = self.__lookup_table.get_canidates_in_current_page()
-        candidates = map(lambda x: (x[0], PangoAttrList(x[1], x[0]) if x[1] else None), candidates)
+        candidates = self.__lookup_table.get_candidates_in_current_page()
+        candidates = map(lambda x: (x.text, PangoAttrList(x.attributes, x.text)), candidates)
         self.__candidate_area.set_candidates(candidates,
                 self.__lookup_table.get_cursor_pos_in_current_page(),
                 self.__lookup_table.is_cursor_visible()
@@ -372,8 +367,8 @@ class CandidatePanel(gtk.VBox):
             self.emit(&quot;hide&quot;)
 
     def reset(self):
-        self.update_preedit(&quot;&quot;, None, 0, False)
-        self.update_aux_string(&quot;&quot;, None, False)
+        self.update_preedit_text(ibus.Text(&quot;&quot;), 0, False)
+        self.update_auxiliary_text(ibus.Text(&quot;&quot;), False)
         self.update_lookup_table(None, False)
         self.hide()
 </diff>
      <filename>ui/gtk/candidatepanel.py</filename>
    </modified>
    <modified>
      <diff>@@ -33,9 +33,6 @@ class IconWidget(gtk.Image):
                 theme = gtk.icon_theme_get_default()
                 pixbuf = theme.load_icon(icon, size, 0)
         except:
-            pass
-
-        if pixbuf == None:
             theme = gtk.icon_theme_get_default()
             pixbuf = theme.load_icon(gtk.STOCK_MISSING_IMAGE, size, 0)
 </diff>
      <filename>ui/gtk/icon.py</filename>
    </modified>
    <modified>
      <diff>@@ -78,7 +78,7 @@ class LanguageBar(gtk.Toolbar):
         self.insert(self.__handle, -1)
 
         # create input methods menu
-        prop = ibus.Property(name = &quot;&quot;, type = ibus.PROP_TYPE_TOGGLE, icon = &quot;ibus&quot;, tooltip = _(&quot;Switch engine&quot;))
+        prop = ibus.Property(key = &quot;&quot;, type = ibus.PROP_TYPE_TOGGLE, icon = &quot;ibus&quot;, tooltip = _(&quot;Switch engine&quot;))
         self.__im_menu = ToggleToolButton(prop)
         self.__im_menu.set_homogeneous(False)
         self.__im_menu.connect(&quot;toggled&quot;, self.__im_menu_toggled_cb)
@@ -192,6 +192,8 @@ class LanguageBar(gtk.Toolbar):
         self.__im_menu.set_sensitive(False)
         if self.__auto_hide:
             self.hide_all()
+        else:
+            self.show_all()
 
 gobject.type_register(LanguageBar, &quot;IBusLanguageBar&quot;)
 </diff>
      <filename>ui/gtk/languagebar.py</filename>
    </modified>
    <modified>
      <diff>@@ -31,19 +31,16 @@ import notifications
 class UIApplication:
     def __init__ (self):
         self.__bus = ibus.Bus()
-        self.__bus.connect(&quot;destroy&quot;, self.__bus_destroy_cb)
+        self.__bus.connect(&quot;disconnected&quot;, gtk.main_quit)
 
         self.__panel = panel.Panel(self.__bus)
-        self.__notify = notifications.Notifications(self.__bus)
-        self.__notify.set_status_icon(self.__panel.get_status_icon())
+        self.__bus.request_name(ibus.IBUS_SERVICE_PANEL, 0)
+        # self.__notify = notifications.Notifications(self.__bus)
+        # self.__notify.set_status_icon(self.__panel.get_status_icon())
 
     def run(self):
         gtk.main()
 
-    def __bus_destroy_cb(self, _ibus):
-        gtk.main_quit()
-
-
 def launch_panel():
     # gtk.settings_get_default().props.gtk_theme_name = &quot;/home/phuang/.themes/aud-Default/gtk-2.0/gtkrc&quot;
     # gtk.rc_parse(&quot;./themes/default/gtkrc&quot;)</diff>
      <filename>ui/gtk/main.py</filename>
    </modified>
    <modified>
      <diff>@@ -107,7 +107,7 @@ class ImageMenuItem (gtk.ImageMenuItem, PropItem):
             self.hide_all ()
 
     def do_activate (self):
-        self.emit (&quot;property-activate&quot;, self._prop.name, self._prop.state)
+        self.emit (&quot;property-activate&quot;, self._prop.key, self._prop.state)
 
     def property_changed (self):
         self.set_sensitive (self._prop.sensitive)
@@ -145,7 +145,7 @@ class CheckMenuItem (gtk.CheckMenuItem, PropItem):
             self._prop.state = ibus.PROP_STATE_CHECKED
         else:
             self._prop.state = ibus.PROP_STATE_UNCHECKED
-        self.emit (&quot;property-activate&quot;, self._prop.name, self._prop.state)
+        self.emit (&quot;property-activate&quot;, self._prop.key, self._prop.state)
 
     def property_changed (self):
         self.set_active (self._prop.state == ibus.PROP_STATE_CHECKED)
@@ -167,7 +167,7 @@ class RadioMenuItem (gtk.RadioMenuItem, PropItem):
     }
 
     def __init__ (self, group, prop):
-        gtk.RadioMenuItem.__init__ (self, group, label = prop.label)
+        gtk.RadioMenuItem.__init__ (self, group, label = prop.label.text)
         PropItem.__init__ (self, prop)
 
         self.set_active (self._prop.state == ibus.PROP_STATE_CHECKED)
@@ -194,7 +194,7 @@ class RadioMenuItem (gtk.RadioMenuItem, PropItem):
             self._prop.state = ibus.PROP_STATE_CHECKED
         else:
             self._prop.state = ibus.PROP_STATE_UNCHECKED
-        self.emit (&quot;property-activate&quot;, self._prop.name, self._prop.state)
+        self.emit (&quot;property-activate&quot;, self._prop.key, self._prop.state)
 
 class SeparatorMenuItem (gtk.SeparatorMenuItem, PropItem):
     __gsignals__ = {</diff>
      <filename>ui/gtk/menu.py</filename>
    </modified>
    <modified>
      <diff>@@ -34,17 +34,13 @@ from gettext import dgettext
 _  = lambda a : dgettext(&quot;ibus&quot;, a)
 N_ = lambda a : a
 
-BUS_NOTIFICATIONS_NAME = &quot;org.freedesktop.Notifications&quot;
-BUS_NOTIFICATIONS_PATH = &quot;/org/freedesktop/Notifications&quot;
-BUS_NOTIFICATIONS_IFACE = &quot;org.freedesktop.Notifications&quot;
-
 class Notifications(ibus.NotificationsBase):
     def __init__ (self, bus):
         super(Notifications, self).__init__(bus)
         self.__bus = bus
         try:
             self.__dbus = dbus.SessionBus()
-            self.__dbus.watch_name_owner(BUS_NOTIFICATIONS_NAME,
+            self.__dbus.watch_name_owner(ibus.IBUS_SERVICE_NOTIFICATIONS,
                     self.__notifications_name_owner_changed_cb)
         except:
             self.__dbus = None
@@ -52,7 +48,7 @@ class Notifications(ibus.NotificationsBase):
         self.__ids = set([])
         self.__init_notifications()
         self.__status_icons = None
-        self.__bus.request_name(ibus.IBUS_NOTIFICATIONS_NAME, 0)
+        self.__bus.request_name(ibus.IBUS_SERVICE_NOTIFICATIONS, 0)
 
     def __notifications_name_owner_changed_cb(self, unique_name):
         if unique_name:
@@ -66,13 +62,13 @@ class Notifications(ibus.NotificationsBase):
 
         try:
             self.__notifications = self.__dbus.get_object(
-                    BUS_NOTIFICATIONS_NAME, BUS_NOTIFICATIONS_PATH)
+                    ibus.IBUS_SERVICE_NOTIFICATIONS, ibus.IBUS_PATH_NOTIFICATIONS)
             self.__notifications.connect_to_signal(&quot;NotificationClosed&quot;,
                     self.__notification_closed_cb,
-                    dbus_interface=BUS_NOTIFICATIONS_IFACE)
+                    dbus_interface=ibus.IBUS_IFACE_NOTIFICATIONS)
             self.__notifications.connect_to_signal(&quot;ActionInvoked&quot;,
                     self.__action_invoked_cb,
-                    dbus_interface=BUS_NOTIFICATIONS_IFACE)
+                    dbus_interface=ibus.IBUS_IFACE_NOTIFICATIONS)
             self.__ids = set([])
         except:
             self.__notifications = None</diff>
      <filename>ui/gtk/notifications.py</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,7 @@ class Panel(ibus.PanelBase):
     def __init__ (self, bus):
         super(Panel, self).__init__(bus)
         self.__bus = bus
+        self.__config = self.__bus.get_config()
         self.__focus_ic = None
         self.__setup_pid = 0
         self.__prefix = os.getenv(&quot;IBUS_PREFIX&quot;)
@@ -67,9 +68,9 @@ class Panel(ibus.PanelBase):
         signal.signal(signal.SIGCHLD, self.__sigchld_cb)
 
         # connect bus signal
-        self.__bus.connect(&quot;config-value-changed&quot;, self.__config_value_changed_cb)
-        self.__bus.connect(&quot;config-reloaded&quot;, self.__config_reloaded_cb)
-        self.__bus.config_add_watch(&quot;panel&quot;)
+        self.__config.connect(&quot;value-changed&quot;, self.__config_value_changed_cb)
+        self.__config.connect(&quot;reloaded&quot;, self.__config_reloaded_cb)
+        # self.__bus.config_add_watch(&quot;panel&quot;)
 
         # add icon search path
         icon_theme = gtk.icon_theme_get_default()
@@ -101,28 +102,28 @@ class Panel(ibus.PanelBase):
         self.__config_load_lookup_table_orientation()
         self.__config_load_auto_hide()
         self.__config_load_custom_font()
-        self.__bus.request_name(ibus.panel.IBUS_PANEL_NAME, 0)
+        # self.__bus.request_name(ibus.panel.IBUS_SERVICE_PANEL, 0)
 
     def set_cursor_location(self, x, y, w, h):
         self.__candidate_panel.set_cursor_location(x + w, y + h)
 
-    def update_preedit(self, text, attrs, cursor_pos, visible):
-        self.__candidate_panel.update_preedit(text, attrs, cursor_pos, visible)
+    def update_preedit_text(self, text, cursor_pos, visible):
+        self.__candidate_panel.update_preedit_text(text, cursor_pos, visible)
 
-    def show_preedit(self):
-        self.__candidate_panel.show_preedit()
+    def show_preedit_text(self):
+        self.__candidate_panel.show_preedit_text()
 
-    def hide_preedit(self):
-        self.__candidate_panel.hide_preedit()
+    def hide_preedit_text(self):
+        self.__candidate_panel.hide_preedit_text()
 
-    def update_aux_string(self, text, attrs, visible):
-        self.__candidate_panel.update_aux_string(text, attrs, visible)
+    def update_auxiliary_text(self, text, visible):
+        self.__candidate_panel.update_auxiliary_text(text, visible)
 
-    def show_aux_string(self):
-        self.__candidate_panel.show_aux_string()
+    def show_auxiliary_text(self):
+        self.__candidate_panel.show_auxiliary_text()
 
-    def hide_aux_string(self):
-        self.__candidate_panel.hide_aux_string()
+    def hide_auxiliary_text(self):
+        self.__candidate_panel.hide_auxiliary_text()
 
     def update_lookup_table(self, lookup_table, visible):
         self.__candidate_panel.update_lookup_table(lookup_table, visible)
@@ -175,35 +176,43 @@ class Panel(ibus.PanelBase):
 
     def focus_in(self, ic):
         self.reset()
-        self.__focus_ic = ic
-
-        factory, enabled = self.__bus.get_input_context_states(ic)
+        self.__focus_ic = ibus.InputContext(self.__bus, ic)
+        enabled = self.__focus_ic.is_enabled()
         self.__language_bar.set_enabled(enabled)
 
-        if factory == &quot;&quot; or not enabled:
+        if not enabled:
             self.__set_im_icon(self.__ibus_icon)
         else:
-            name, lang, icon, authors, credits = self.__bus.get_factory_info(factory)
-            self.__set_im_icon(icon)
+            engine = self.__focus_ic.get_engine()
+            if engine:
+                self.__set_im_icon(engine.icon)
+            else:
+                self.__set_im_icon(self.__ibus_icon)
         self.__language_bar.focus_in()
 
     def focus_out(self, ic):
         self.reset()
-        if self.__focus_ic == ic:
-            self.__focus_ic = None
-            self.__language_bar.focus_out()
-            self.__set_im_icon(self.__ibus_icon)
+        self.__focus_ic = None
+        self.__language_bar.focus_out()
+        self.__set_im_icon(self.__ibus_icon)
 
-    def states_changed(self):
+    def state_changed(self):
         if not self.__focus_ic:
             return
-        factory, enabled = self.__bus.get_input_context_states(self.__focus_ic)
+
+        enabled = self.__focus_ic.is_enabled()
         self.__language_bar.set_enabled(enabled)
-        if enabled == False or not factory:
+
+        if enabled == False:
+            self.reset()
             self.__set_im_icon(self.__ibus_icon)
         else:
-            name, lang, icon, authors, credits = self.__bus.get_factory_info(factory)
-            self.__set_im_icon(icon)
+            engine = self.__focus_ic.get_engine()
+            if engine:
+                self.__set_im_icon(engine.icon)
+            else:
+                self.__set_im_icon(self.__ibus_icon)
+
 
     def reset(self):
         self.__candidate_panel.reset()
@@ -216,7 +225,7 @@ class Panel(ibus.PanelBase):
         gtk.main_quit()
 
     def __config_load_lookup_table_orientation(self):
-        value = self.__bus.config_get_value(&quot;panel&quot;, &quot;lookup_table_orientation&quot;, 0)
+        value = self.__config.get_value(&quot;panel&quot;, &quot;lookup_table_orientation&quot;, 0)
         if value != 0 and value != 1:
             value = 0
         if value == 0:
@@ -225,14 +234,14 @@ class Panel(ibus.PanelBase):
             self.__candidate_panel.set_orientation(gtk.ORIENTATION_VERTICAL)
 
     def __config_load_auto_hide(self):
-        auto_hide = self.__bus.config_get_value(&quot;panel&quot;, &quot;auto_hide&quot;, False)
+        auto_hide = self.__config.get_value(&quot;panel&quot;, &quot;auto_hide&quot;, False)
         self.__language_bar.set_auto_hide(auto_hide)
 
     def __config_load_custom_font(self):
-        use_custom_font = self.__bus.config_get_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False)
+        use_custom_font = self.__config.get_value(&quot;panel&quot;, &quot;use_custom_font&quot;, False)
         font_name = gtk.settings_get_default().get_property(&quot;gtk-font-name&quot;)
         font_name = unicode(font_name, &quot;utf-8&quot;)
-        custom_font =  self.__bus.config_get_value(&quot;panel&quot;, &quot;custom_font&quot;, font_name)
+        custom_font =  self.__config.get_value(&quot;panel&quot;, &quot;custom_font&quot;, font_name)
         style_string = 'style &quot;custom-font&quot; { font_name=&quot;%s&quot; }\n' \
             'class &quot;IBusPanelLabel&quot; style &quot;custom-font&quot;\n'
         if use_custom_font:
@@ -246,6 +255,8 @@ class Panel(ibus.PanelBase):
         gtk.rc_reset_styles(settings)
 
     def __config_value_changed_cb(self, bus, section, name, value):
+        if section != &quot;panel&quot;:
+            return
         if name == &quot;lookup_table_orientation&quot;:
             self.__config_load_lookup_table_orientation()
         elif name == &quot;auto_hide&quot;:
@@ -278,45 +289,44 @@ class Panel(ibus.PanelBase):
 
     def __create_im_menu(self):
         menu = gtk.Menu()
-        factories = self.__bus.get_factories()
+        engines = self.__bus.list_active_engines()
 
-        if not factories:
+        if not engines:
             item = gtk.MenuItem(label = &quot;no engine&quot;)
             item.set_sensitive(False)
             menu.add(item)
         else:
             tmp = {}
-            for factory in factories:
-                name, lang, icon, authors, credits = self.__bus.get_factory_info(factory)
-                lang = ibus.get_language_name(lang)
-                if not icon:
-                    icon = &quot;engine-default&quot;
+            for engine in engines:
+                lang = ibus.get_language_name(engine.language)
                 if lang not in tmp:
                     tmp[lang] = []
-                tmp[lang].append((name, lang, icon, authors, credits, factory))
+                tmp[lang].append(engine)
+
             langs = tmp.keys()
             other = tmp.get(_(&quot;Other&quot;), [])
             if _(&quot;Other&quot;) in tmp:
                 langs.remove(_(&quot;Other&quot;))
                 langs.append(_(&quot;Other&quot;))
+
             for lang in langs:
                 if len(tmp[lang]) == 1:
-                    name, lang, icon, authors, credits, factory = tmp[lang][0]
-                    item = gtk.ImageMenuItem(&quot;%s - %s&quot; % (lang, name))
+                    engine = tmp[lang][0]
+                    item = gtk.ImageMenuItem(&quot;%s - %s&quot; % (lang, engine.longname))
                     size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
-                    item.set_image (_icon.IconWidget(icon, size[0]))
-                    item.connect(&quot;activate&quot;, self.__im_menu_item_activate_cb, factory)
+                    item.set_image (_icon.IconWidget(engine.icon, size[0]))
+                    item.connect(&quot;activate&quot;, self.__im_menu_item_activate_cb, engine)
                     menu.add(item)
                 else:
                     item = gtk.MenuItem(lang)
                     menu.add(item)
                     submenu = gtk.Menu()
                     item.set_submenu(submenu)
-                    for name, __lang, icon, authors, credits, factory in tmp[lang]:
-                        item = gtk.ImageMenuItem(name)
+                    for engine in tmp[lang]:
+                        item = gtk.ImageMenuItem(engine.longname)
                         size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
-                        item.set_image (_icon.IconWidget(icon, size[0]))
-                        item.connect(&quot;activate&quot;, self.__im_menu_item_activate_cb, factory)
+                        item.set_image (_icon.IconWidget(engine.icon, size[0]))
+                        item.connect(&quot;activate&quot;, self.__im_menu_item_activate_cb, engine)
                         submenu.add(item)
 
         menu.show_all()
@@ -345,8 +355,8 @@ class Panel(ibus.PanelBase):
                 gtk.get_current_event_time(),
                 self.__status_icon)
 
-    def __im_menu_item_activate_cb(self, item, factory):
-        self.__bus.set_factory(factory)
+    def __im_menu_item_activate_cb(self, item, engine):
+        self.__focus_ic.set_engine(engine)
 
     def __sys_menu_item_activate_cb(self, item, command):
         if command == gtk.STOCK_PREFERENCES:</diff>
      <filename>ui/gtk/panel.py</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@ class PropItem:
 
         retval = False
 
-        if self._prop.name == prop.name and self._prop.type == prop.type:
+        if self._prop.key == prop.key and self._prop.type == prop.type:
             self._prop = prop
             self.property_changed ()
             retval =  True</diff>
      <filename>ui/gtk/propitem.py</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ class ToolButton(gtk.ToolButton, PropItem):
         }
 
     def __init__(self, prop):
-        gtk.ToolButton.__init__ (self, label = prop.label)
+        gtk.ToolButton.__init__ (self, label = prop.label.text)
         self.set_homogeneous(False)
         PropItem.__init__ (self, prop)
         self.property_changed()
@@ -58,14 +58,14 @@ class ToolButton(gtk.ToolButton, PropItem):
 
     def set_tooltip_text(self, text):
         if text:
-            gtk.ToolButton.set_tooltip_text(self, text)
+            gtk.ToolButton.set_tooltip_text(self, text.text)
         else:
             gtk.ToolButton.set_tooltip_text(self, None)
 
         self._prop.tooltip = text
 
     def property_changed(self):
-        self.set_label(self._prop.label)
+        self.set_label(self._prop.label.text)
         self.set_tooltip_text(self._prop.tooltip)
         self.set_sensitive(self._prop.sensitive)
         self.set_icon_name(self._prop.icon)
@@ -78,7 +78,7 @@ class ToolButton(gtk.ToolButton, PropItem):
             self.hide_all()
 
     def do_clicked(self):
-        self.emit(&quot;property-activate&quot;, self._prop.name, self._prop.state)
+        self.emit(&quot;property-activate&quot;, self._prop.key, self._prop.state)
 
 
 class ToggleToolButton(gtk.ToggleToolButton, PropItem):
@@ -112,7 +112,7 @@ class ToggleToolButton(gtk.ToggleToolButton, PropItem):
 
     def set_tooltip_text(self, text):
         if text:
-            gtk.ToggleToolButton.set_tooltip_text(self, text)
+            gtk.ToggleToolButton.set_tooltip_text(self, text.text)
         else:
             gtk.ToggleToolButton.set_tooltip_text(self, None)
 
@@ -120,7 +120,7 @@ class ToggleToolButton(gtk.ToggleToolButton, PropItem):
 
     def property_changed(self):
         self.set_tooltip_text(self._prop.tooltip)
-        self.set_label(self._prop.label)
+        self.set_label(self._prop.label.text)
         self.set_icon_name(self._prop.icon)
         self.set_active(self._prop.state == ibus.PROP_STATE_CHECKED)
         self.set_sensitive(self._prop.sensitive)
@@ -136,7 +136,7 @@ class ToggleToolButton(gtk.ToggleToolButton, PropItem):
             self._prop.state = ibus.PROP_STATE_CHECKED
         else:
             self._prop.state = ibus.PROP_STATE_UNCHECKED
-        self.emit(&quot;property-activate&quot;, self._prop.name, self._prop.state)
+        self.emit(&quot;property-activate&quot;, self._prop.key, self._prop.state)
 
 class SeparatorToolItem(gtk.SeparatorToolItem, PropItem):
     def __init__ (self, prop):</diff>
      <filename>ui/gtk/toolitem.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,5 +21,4 @@
 
 SUBDIRS = \
 	IMdkit \
-	gconf \
 	$(NULL)</diff>
      <filename>util/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 XIM=ibus
-XIM_PROGRAM=&quot;/usr/bin/ibus&quot;
+XIM_PROGRAM=&quot;/usr/bin/ibus-daemon&quot;
 ICON=&quot;/usr/share/ibus/icons/ibus.svg&quot;
 # XIM_ARGS=&quot;0xffffffff&quot;
 PREFERENCE_PROGRAM=/usr/bin/ibus-setup
-SHORT_DESC=&quot;iBus&quot;
+SHORT_DESC=&quot;IBus&quot;
 GTK_IM_MODULE=ibus
-QT_IM_MODULE=ibus
+# QT_IM_MODULE=ibus</diff>
      <filename>xinput-ibus</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>daemon/.gitignore</filename>
    </removed>
    <removed>
      <filename>daemon/Makefile.am</filename>
    </removed>
    <removed>
      <filename>daemon/_dbus.py</filename>
    </removed>
    <removed>
      <filename>daemon/bus.py</filename>
    </removed>
    <removed>
      <filename>daemon/config.py</filename>
    </removed>
    <removed>
      <filename>daemon/connection.py</filename>
    </removed>
    <removed>
      <filename>daemon/contextmanager.py</filename>
    </removed>
    <removed>
      <filename>daemon/engine.py</filename>
    </removed>
    <removed>
      <filename>daemon/enginefactory.py</filename>
    </removed>
    <removed>
      <filename>daemon/factorymanager.py</filename>
    </removed>
    <removed>
      <filename>daemon/ibus-daemon.in</filename>
    </removed>
    <removed>
      <filename>daemon/ibusdaemon.py</filename>
    </removed>
    <removed>
      <filename>daemon/inputcontext.py</filename>
    </removed>
    <removed>
      <filename>daemon/lookuptable.py</filename>
    </removed>
    <removed>
      <filename>daemon/notifications.py</filename>
    </removed>
    <removed>
      <filename>daemon/panel.py</filename>
    </removed>
    <removed>
      <filename>daemon/register.py</filename>
    </removed>
    <removed>
      <filename>gconf/config.py</filename>
    </removed>
    <removed>
      <filename>gconf/ibus-gconf.in</filename>
    </removed>
    <removed>
      <filename>gconf/main.py</filename>
    </removed>
    <removed>
      <filename>ibus/gtk.py</filename>
    </removed>
    <removed>
      <filename>launcher/Makefile.am</filename>
    </removed>
    <removed>
      <filename>launcher/ibus.desktop.in</filename>
    </removed>
    <removed>
      <filename>launcher/ibus.in</filename>
    </removed>
    <removed>
      <filename>lib/Makefile.am</filename>
    </removed>
    <removed>
      <filename>lib/gtk2/Makefile.am</filename>
    </removed>
    <removed>
      <filename>lib/gtk2/ibusattribute.c</filename>
    </removed>
    <removed>
      <filename>lib/gtk2/ibusattribute.h</filename>
    </removed>
    <removed>
      <filename>lib/gtk2/ibusimclient.c</filename>
    </removed>
    <removed>
      <filename>lib/gtk2/ibusimclient.h</filename>
    </removed>
    <removed>
      <filename>lib/gtk2/ibusmarshalers.list</filename>
    </removed>
    <removed>
      <filename>util/gconf/Makefile.am</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf-arg-types.py</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf-fixes.c</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf-fixes.h</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf-types.c</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf-types.h</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf.defs</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconf.override</filename>
    </removed>
    <removed>
      <filename>util/gconf/gconfmodule.c</filename>
    </removed>
    <removed>
      <filename>util/gconf/wscript</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>41ad46305a88637dd99f00a2d2a3f455505d357b</id>
    </parent>
  </parents>
  <author>
    <name>Huang Peng</name>
    <email>shawn.p.huang@gmail.com</email>
  </author>
  <url>http://github.com/phuang/ibus/commit/aedad1ea0a7fef604aa27f4b58433fd8f2ece29e</url>
  <id>aedad1ea0a7fef604aa27f4b58433fd8f2ece29e</id>
  <committed-date>2009-02-04T18:39:56-08:00</committed-date>
  <authored-date>2009-02-04T18:39:56-08:00</authored-date>
  <message>re-implement ibus in c language.</message>
  <tree>ffcb531d8474bde18b90341bcd4eb639edd74525</tree>
  <committer>
    <name>Huang Peng</name>
    <email>shawn.p.huang@gmail.com</email>
  </committer>
</commit>
