diff --git a/bus/connection.c b/bus/connection.c index c1f6fcd90..c6303414e 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/connection.h b/bus/connection.h index 0e027ed6c..71f39b133 100644 --- a/bus/connection.h +++ b/bus/connection.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c index 68e742315..4ac66cb32 100644 --- a/bus/dbusimpl.c +++ b/bus/dbusimpl.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/dbusimpl.h b/bus/dbusimpl.h index 34ce6bb48..4bded309c 100644 --- a/bus/dbusimpl.h +++ b/bus/dbusimpl.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/engineproxy.c b/bus/engineproxy.c index 64dda4fc2..1f3558832 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/engineproxy.h b/bus/engineproxy.h index 7c2626f0f..9abb20407 100644 --- a/bus/engineproxy.h +++ b/bus/engineproxy.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/factoryproxy.c b/bus/factoryproxy.c index 0b6434ea6..99ef18903 100644 --- a/bus/factoryproxy.c +++ b/bus/factoryproxy.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/factoryproxy.h b/bus/factoryproxy.h index 07718ab38..20b1430d4 100644 --- a/bus/factoryproxy.h +++ b/bus/factoryproxy.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c index e3d7e399b..267863684 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/ibusimpl.h b/bus/ibusimpl.h index 860f695d2..bf9c5f716 100644 --- a/bus/ibusimpl.h +++ b/bus/ibusimpl.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/inputcontext.c b/bus/inputcontext.c index d61051515..4123c53f3 100644 --- a/bus/inputcontext.c +++ b/bus/inputcontext.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/inputcontext.h b/bus/inputcontext.h index ebbe4ba81..31f12e76b 100644 --- a/bus/inputcontext.h +++ b/bus/inputcontext.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/matchrule.c b/bus/matchrule.c index b40efce17..e81076773 100644 --- a/bus/matchrule.c +++ b/bus/matchrule.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/matchrule.h b/bus/matchrule.h index 3d73f0eae..1c20c9b21 100644 --- a/bus/matchrule.h +++ b/bus/matchrule.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/option.h b/bus/option.h index 28e775a13..0aad59c1b 100644 --- a/bus/option.h +++ b/bus/option.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/panelproxy.c b/bus/panelproxy.c index ac48691a9..880d3cfc4 100644 --- a/bus/panelproxy.c +++ b/bus/panelproxy.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/panelproxy.h b/bus/panelproxy.h index 9c2c85d2b..cf7b803ec 100644 --- a/bus/panelproxy.h +++ b/bus/panelproxy.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/registry.c b/bus/registry.c index c5479cac9..c3e17db7e 100644 --- a/bus/registry.c +++ b/bus/registry.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/registry.h b/bus/registry.h index 0bd564a55..490e611f5 100644 --- a/bus/registry.h +++ b/bus/registry.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/server.c b/bus/server.c index 6c1478092..9d90a6e6b 100644 --- a/bus/server.c +++ b/bus/server.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/server.h b/bus/server.h index ee056d084..d3c4eb845 100644 --- a/bus/server.h +++ b/bus/server.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/bus/test-matchrule.c b/bus/test-matchrule.c index 07cbf1c6c..558b5729a 100644 --- a/bus/test-matchrule.c +++ b/bus/test-matchrule.c @@ -4,38 +4,38 @@ int main(gint argc, gchar **argv) { - BusMatchRule *rule, *rule1; - g_type_init (); + BusMatchRule *rule, *rule1; + g_type_init (); - rule = bus_match_rule_new (" type='signal' , interface = 'org.freedesktop.IBus' "); - g_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL); - g_assert (g_strcmp0 (rule->interface, "org.freedesktop.IBus") == 0 ); - g_object_unref (rule); + rule = bus_match_rule_new (" type='signal' , interface = 'org.freedesktop.IBus' "); + g_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL); + g_assert (g_strcmp0 (rule->interface, "org.freedesktop.IBus") == 0 ); + g_object_unref (rule); - rule = bus_match_rule_new ("type='method_call', interface='org.freedesktop.IBus' "); - g_assert (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_CALL); - g_assert (g_strcmp0 (rule->interface, "org.freedesktop.IBus") == 0 ); - g_object_unref (rule); + rule = bus_match_rule_new ("type='method_call', interface='org.freedesktop.IBus' "); + g_assert (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_CALL); + g_assert (g_strcmp0 (rule->interface, "org.freedesktop.IBus") == 0 ); + g_object_unref (rule); - rule = bus_match_rule_new ("type='signal'," - "interface='org.freedesktop.DBus'," - "member='NameOwnerChanged'," - "arg0='ibus.freedesktop.IBus.config'," - "arg0='ibus.freedesktop.IBus.config'," - "arg2='ibus.freedesktop.IBus.config'"); - g_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL); - g_assert (g_strcmp0 (rule->interface, "org.freedesktop.DBus") == 0 ); - rule1 = bus_match_rule_new ("type='signal'," - "interface='org.freedesktop.DBus'," - "member='NameOwnerChanged'," - "arg0='ibus.freedesktop.IBus.config'," - "arg0='ibus.freedesktop.IBus.config'," - "arg2='ibus.freedesktop.IBus.config'"); + rule = bus_match_rule_new ("type='signal'," + "interface='org.freedesktop.DBus'," + "member='NameOwnerChanged'," + "arg0='ibus.freedesktop.IBus.config'," + "arg0='ibus.freedesktop.IBus.config'," + "arg2='ibus.freedesktop.IBus.config'"); + g_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL); + g_assert (g_strcmp0 (rule->interface, "org.freedesktop.DBus") == 0 ); + rule1 = bus_match_rule_new ("type='signal'," + "interface='org.freedesktop.DBus'," + "member='NameOwnerChanged'," + "arg0='ibus.freedesktop.IBus.config'," + "arg0='ibus.freedesktop.IBus.config'," + "arg2='ibus.freedesktop.IBus.config'"); - g_assert (bus_match_rule_is_equal (rule, rule1)); + g_assert (bus_match_rule_is_equal (rule, rule1)); - g_object_unref (rule); - g_object_unref (rule1); + g_object_unref (rule); + g_object_unref (rule1); - return 0; + return 0; } diff --git a/bus/test-registry.c b/bus/test-registry.c index fdcbba87d..cdff32e96 100644 --- a/bus/test-registry.c +++ b/bus/test-registry.c @@ -2,8 +2,8 @@ int main() { - g_type_init (); - BusRegistry *registry = bus_registry_new (); - g_object_unref (registry); - return 0; + g_type_init (); + BusRegistry *registry = bus_registry_new (); + g_object_unref (registry); + return 0; } diff --git a/client/gtk2/ibusimcontext.h b/client/gtk2/ibusimcontext.h index b92c0990b..e3f38af5b 100644 --- a/client/gtk2/ibusimcontext.h +++ b/client/gtk2/ibusimcontext.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/client/gtk3/ibusim.c b/client/gtk3/ibusim.c deleted file mode 120000 index 63065330f..000000000 --- a/client/gtk3/ibusim.c +++ /dev/null @@ -1 +0,0 @@ -../gtk2/ibusim.c \ No newline at end of file diff --git a/client/gtk3/ibusim.c b/client/gtk3/ibusim.c new file mode 100644 index 000000000..f50f28941 --- /dev/null +++ b/client/gtk3/ibusim.c @@ -0,0 +1,81 @@ +/* vim:set et ts=4: */ +/* ibus - The Input Bus + * Copyright (C) 2008-2010 Peng Huang + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include "ibusimcontext.h" + +#define IBUS_LOCALDIR "" +static const GtkIMContextInfo ibus_im_info = { + "ibus", + "IBus (Intelligent Input Bus)", + "ibus", + IBUS_LOCALDIR, + "ja:ko:zh:*" +}; + +static const GtkIMContextInfo *info_list[] = { + &ibus_im_info +}; + +G_MODULE_EXPORT const gchar* +g_module_check_init (GModule *module) +{ + return glib_check_version (GLIB_MAJOR_VERSION, + GLIB_MINOR_VERSION, + 0); +} + +G_MODULE_EXPORT void +im_module_init (GTypeModule *type_module) +{ + /* make module resident */ + g_type_module_use (type_module); + + ibus_im_context_register_type (type_module); +} + +G_MODULE_EXPORT void +im_module_exit (void) +{ +} + +G_MODULE_EXPORT GtkIMContext * +im_module_create (const gchar *context_id) +{ + if (g_strcmp0 (context_id, "ibus") == 0) { + IBusIMContext *context; + context = ibus_im_context_new (); + return (GtkIMContext *) context; + } + return NULL; +} + +G_MODULE_EXPORT void +im_module_list (const GtkIMContextInfo ***contexts, + gint *n_contexts) +{ + *contexts = info_list; + *n_contexts = G_N_ELEMENTS (info_list); +} + diff --git a/client/gtk3/ibusimcontext.c b/client/gtk3/ibusimcontext.c deleted file mode 120000 index 41896f052..000000000 --- a/client/gtk3/ibusimcontext.c +++ /dev/null @@ -1 +0,0 @@ -../gtk2/ibusimcontext.c \ No newline at end of file diff --git a/client/gtk3/ibusimcontext.c b/client/gtk3/ibusimcontext.c new file mode 100644 index 000000000..2ddae8c26 --- /dev/null +++ b/client/gtk3/ibusimcontext.c @@ -0,0 +1,1186 @@ +/* vim:set et sts=4: */ +/* ibus - The Input Bus + * Copyright (C) 2008-2010 Peng Huang + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ibusimcontext.h" + +#ifdef DEBUG +# define IDEBUG g_debug +#else +# define IDEBUG(a...) +#endif + +struct _IBusIMContext { + GtkIMContext parent; + + /* instance members */ + GtkIMContext *slave; + GdkWindow *client_window; + + /* enabled */ + gboolean enable; + IBusInputContext *ibuscontext; + + /* preedit status */ + gchar *preedit_string; + PangoAttrList *preedit_attrs; + gint preedit_cursor_pos; + gboolean preedit_visible; + + GdkRectangle cursor_area; + gboolean has_focus; + + gint caps; + +}; + +struct _IBusIMContextClass { +GtkIMContextClass parent; + /* class members */ +}; + +static guint _signal_commit_id = 0; +static guint _signal_preedit_changed_id = 0; +static guint _signal_preedit_start_id = 0; +static guint _signal_preedit_end_id = 0; +static guint _signal_delete_surrounding_id = 0; +static guint _signal_retrieve_surrounding_id = 0; + +static const gchar *_snooper_apps = SNOOPER_APPS; +static gboolean _use_key_snooper = ENABLE_SNOOPER; + +static GtkIMContext *_focus_im_context = NULL; +static IBusInputContext *_fake_context = NULL; +static GdkWindow *_input_window = NULL; + +/* functions prototype */ +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); +static void ibus_im_context_get_preedit_string + (GtkIMContext *context, + gchar **str, + PangoAttrList **attrs, + gint *cursor_pos); +static void ibus_im_context_set_client_window + (GtkIMContext *context, + GdkWindow *client); +static void ibus_im_context_set_cursor_location + (GtkIMContext *context, + GdkRectangle *area); +static void ibus_im_context_set_use_preedit + (GtkIMContext *context, + gboolean use_preedit); + +/* static methods*/ +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, + IBusIMContext *context); +static void _slave_preedit_changed_cb (GtkIMContext *slave, + IBusIMContext *context); +static void _slave_preedit_start_cb (GtkIMContext *slave, + IBusIMContext *context); +static void _slave_preedit_end_cb (GtkIMContext *slave, + IBusIMContext *context); +static void _slave_retrieve_surrounding_cb + (GtkIMContext *slave, + IBusIMContext *context); +static void _slave_delete_surrounding_cb + (GtkIMContext *slave, + gint offset_from_cursor, + guint nchars, + IBusIMContext *context); +static void _create_fake_input_context (void); + + + +static GType _ibus_type_im_context = 0; +static GtkIMContextClass *parent_class = NULL; + +static IBusBus *_bus = NULL; + +void +ibus_im_context_register_type (GTypeModule *type_module) +{ + IDEBUG ("%s", __FUNCTION__); + + static const GTypeInfo ibus_im_context_info = { + sizeof (IBusIMContextClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) ibus_im_context_class_init, + NULL, /* class finialize */ + NULL, /* class data */ + sizeof (IBusIMContext), + 0, + (GInstanceInitFunc) ibus_im_context_init, + }; + + if (! _ibus_type_im_context ) { + if (type_module) { + _ibus_type_im_context = + g_type_module_register_type (type_module, + GTK_TYPE_IM_CONTEXT, + "IBusIMContext", + &ibus_im_context_info, + (GTypeFlags)0); + } + else { + _ibus_type_im_context = + g_type_register_static (GTK_TYPE_IM_CONTEXT, + "IBusIMContext", + &ibus_im_context_info, + (GTypeFlags)0); + } + } +} + +GType +ibus_im_context_get_type (void) +{ + IDEBUG ("%s", __FUNCTION__); + + if (_ibus_type_im_context == 0) { + ibus_im_context_register_type (NULL); + } + + g_assert (_ibus_type_im_context != 0); + return _ibus_type_im_context; +} + +IBusIMContext * +ibus_im_context_new (void) +{ + IDEBUG ("%s", __FUNCTION__); + + GObject *obj = g_object_new (IBUS_TYPE_IM_CONTEXT, NULL); + return IBUS_IM_CONTEXT (obj); +} + +static gint +_key_snooper_cb (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + IDEBUG ("%s", __FUNCTION__); + gboolean retval = FALSE; + + IBusIMContext *ibusimcontext = (IBusIMContext *) _focus_im_context; + IBusInputContext *ibuscontext = NULL; + + if (ibusimcontext != NULL && + ibusimcontext->has_focus == TRUE) { + /* has IC with focus and use_key_snooper is true */ + if (_use_key_snooper) + ibuscontext = ibusimcontext->ibuscontext; + } + else { + /* If no IC has focus, and fake IC has been created, then pass key events to fake IC. */ + ibuscontext = _fake_context; + } + + if (ibuscontext == NULL) + return FALSE; + + if (G_UNLIKELY (event->state & IBUS_HANDLED_MASK)) + return TRUE; + + if (G_UNLIKELY (event->state & IBUS_IGNORED_MASK)) + return FALSE; + + if (_fake_context == ibuscontext && _input_window != event->window) { + if (_input_window) + g_object_unref (_input_window); + if (event->window) + g_object_ref (event->window); + _input_window = event->window; + } + + switch (event->type) { + case GDK_KEY_RELEASE: + retval = ibus_input_context_process_key_event (ibuscontext, + event->keyval, + event->hardware_keycode - 8, + event->state | IBUS_RELEASE_MASK); + break; + case GDK_KEY_PRESS: + retval = ibus_input_context_process_key_event (ibuscontext, + event->keyval, + event->hardware_keycode - 8, + event->state); + break; + default: + retval = FALSE; + break; + } + + if (retval) { + event->state |= IBUS_HANDLED_MASK; + } + else { + event->state |= IBUS_IGNORED_MASK; + } + + return retval; +} + +static void +ibus_im_context_class_init (IBusIMContextClass *klass) +{ + IDEBUG ("%s", __FUNCTION__); + + GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + parent_class = (GtkIMContextClass *) g_type_class_peek_parent (klass); + + im_context_class->reset = ibus_im_context_reset; + im_context_class->focus_in = ibus_im_context_focus_in; + im_context_class->focus_out = ibus_im_context_focus_out; + im_context_class->filter_keypress = ibus_im_context_filter_keypress; + im_context_class->get_preedit_string = ibus_im_context_get_preedit_string; + im_context_class->set_client_window = ibus_im_context_set_client_window; + im_context_class->set_cursor_location = ibus_im_context_set_cursor_location; + im_context_class->set_use_preedit = ibus_im_context_set_use_preedit; + gobject_class->finalize = ibus_im_context_finalize; + + _signal_commit_id = + g_signal_lookup ("commit", G_TYPE_FROM_CLASS (klass)); + g_assert (_signal_commit_id != 0); + + _signal_preedit_changed_id = + g_signal_lookup ("preedit-changed", G_TYPE_FROM_CLASS (klass)); + g_assert (_signal_preedit_changed_id != 0); + + _signal_preedit_start_id = + g_signal_lookup ("preedit-start", G_TYPE_FROM_CLASS (klass)); + g_assert (_signal_preedit_start_id != 0); + + _signal_preedit_end_id = + g_signal_lookup ("preedit-end", G_TYPE_FROM_CLASS (klass)); + g_assert (_signal_preedit_end_id != 0); + + _signal_delete_surrounding_id = + g_signal_lookup ("delete-surrounding", G_TYPE_FROM_CLASS (klass)); + g_assert (_signal_delete_surrounding_id != 0); + + _signal_retrieve_surrounding_id = + g_signal_lookup ("retrieve-surrounding", G_TYPE_FROM_CLASS (klass)); + g_assert (_signal_retrieve_surrounding_id != 0); + + const gchar *ibus_snooper = g_getenv ("IBUS_SNOOPER"); + if (ibus_snooper) { + /* env IBUS_SNOOPER exist */ + if (g_strcmp0 (ibus_snooper, "") == 0 || + g_strcmp0 (ibus_snooper, "0") == 0 || + g_strcmp0 (ibus_snooper, "false") == 0 || + g_strcmp0 (ibus_snooper, "FALSE") == 0) { + _use_key_snooper = FALSE; + } + else { + _use_key_snooper = TRUE; + } + } + else { + /* env IBUS_SNOOPER does not exist */ + if (!_use_key_snooper) { + /* disable snooper if app is in _no_snooper_apps */ + const gchar * prgname = g_get_prgname (); + if (g_getenv ("IBUS_SNOOPER_APPS")) { + _snooper_apps = g_getenv ("IBUS_SNOOPER_APPS"); + } + gchar **p; + gchar ** apps = g_strsplit (_snooper_apps, ",", 0); + for (p = apps; *p != NULL; p++) { + if (g_regex_match_simple (*p, prgname, 0, 0)) { + _use_key_snooper = TRUE; + break; + } + } + g_strfreev (apps); + } + } + + /* init bus object */ + if (_bus == NULL) { + ibus_set_display (gdk_display_get_name (gdk_display_get_default ())); + _bus = ibus_bus_new(); + } + + if (ibus_bus_is_connected (_bus)) { + _create_fake_input_context (); + } + g_signal_connect (_bus, "connected", G_CALLBACK (_bus_connected_cb), NULL); + + /* always install snooper */ + gtk_key_snooper_install (_key_snooper_cb, NULL); +} + +static void +ibus_im_context_init (GObject *obj) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (obj); + + ibusimcontext->client_window = NULL; + + // Init ibus status + ibusimcontext->enable = FALSE; + + // Init preedit status + ibusimcontext->preedit_string = NULL; + ibusimcontext->preedit_attrs = NULL; + ibusimcontext->preedit_cursor_pos = 0; + ibusimcontext->preedit_visible = FALSE; + + // Init cursor area + ibusimcontext->cursor_area.x = -1; + ibusimcontext->cursor_area.y = -1; + ibusimcontext->cursor_area.width = 0; + ibusimcontext->cursor_area.height = 0; + + ibusimcontext->ibuscontext = NULL; + ibusimcontext->has_focus = FALSE; + ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS | IBUS_CAP_SURROUNDING_TEXT; + + + // Create slave im context + ibusimcontext->slave = gtk_im_context_simple_new (); + g_signal_connect (ibusimcontext->slave, + "commit", + G_CALLBACK (_slave_commit_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->slave, + "preedit-start", + G_CALLBACK (_slave_preedit_start_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->slave, + "preedit-end", + G_CALLBACK (_slave_preedit_end_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->slave, + "preedit-changed", + G_CALLBACK (_slave_preedit_changed_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->slave, + "retrieve-surrounding", + G_CALLBACK (_slave_retrieve_surrounding_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->slave, + "delete-surrounding", + G_CALLBACK (_slave_delete_surrounding_cb), + ibusimcontext); + + if (ibus_bus_is_connected (_bus)) { + _create_input_context (ibusimcontext); + } + + g_signal_connect (_bus, "connected", G_CALLBACK (_bus_connected_cb), obj); +} + +static void +ibus_im_context_finalize (GObject *obj) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (obj); + + g_signal_handlers_disconnect_by_func (_bus, G_CALLBACK (_bus_connected_cb), obj); + + if (ibusimcontext->ibuscontext) { + ibus_object_destroy ((IBusObject *)ibusimcontext->ibuscontext); + } + + ibus_im_context_set_client_window ((GtkIMContext *)ibusimcontext, NULL); + + if (ibusimcontext->slave) { + g_object_unref (ibusimcontext->slave); + ibusimcontext->slave = NULL; + } + + // release preedit + if (ibusimcontext->preedit_string) { + g_free (ibusimcontext->preedit_string); + } + if (ibusimcontext->preedit_attrs) { + pango_attr_list_unref (ibusimcontext->preedit_attrs); + } + + G_OBJECT_CLASS(parent_class)->finalize (obj); +} + +static gboolean +ibus_im_context_filter_keypress (GtkIMContext *context, + GdkEventKey *event) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if (G_LIKELY (ibusimcontext->ibuscontext && ibusimcontext->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 = FALSE; + + if (event->state & IBUS_HANDLED_MASK) + return TRUE; + + if (event->state & IBUS_IGNORED_MASK) + return gtk_im_context_filter_keypress (ibusimcontext->slave, event); + + /* XXX it is a workaround for some applications do not set client window. */ + if (ibusimcontext->client_window == NULL && event->window != NULL) + gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext, event->window); + + switch (event->type) { + case GDK_KEY_RELEASE: + retval = ibus_input_context_process_key_event (ibusimcontext->ibuscontext, + event->keyval, + event->hardware_keycode - 8, + event->state | IBUS_RELEASE_MASK); + break; + case GDK_KEY_PRESS: + retval = ibus_input_context_process_key_event (ibusimcontext->ibuscontext, + event->keyval, + event->hardware_keycode - 8, + event->state); + break; + default: + retval = FALSE; + } + + if (retval) { + event->state |= IBUS_HANDLED_MASK; + return TRUE; + } + else { + event->state |= IBUS_IGNORED_MASK; + return gtk_im_context_filter_keypress (ibusimcontext->slave, event); + } + } + else { + return gtk_im_context_filter_keypress (ibusimcontext->slave, event); + } +} + +static void +_weak_notify_cb (gpointer data, + GObject *context) +{ + if (_focus_im_context == (GtkIMContext *)context) + _focus_im_context = NULL; +} + +static void +ibus_im_context_focus_in (GtkIMContext *context) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if (_focus_im_context != NULL && _focus_im_context != context) { + gtk_im_context_focus_out (_focus_im_context); + g_assert (_focus_im_context == NULL); + } + + ibusimcontext->has_focus = TRUE; + if (ibusimcontext->ibuscontext) { + ibus_input_context_focus_in (ibusimcontext->ibuscontext); + } + + gtk_im_context_focus_in (ibusimcontext->slave); + + _set_cursor_location_internal (context); + + if (_focus_im_context != context) { + g_object_weak_ref ((GObject *) context, _weak_notify_cb, NULL); + _focus_im_context = context; + } +} + +static void +ibus_im_context_focus_out (GtkIMContext *context) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if (_focus_im_context == context) { + g_object_weak_unref ((GObject *)_focus_im_context, _weak_notify_cb, NULL); + _focus_im_context = NULL; + } + + ibusimcontext->has_focus = FALSE; + if (ibusimcontext->ibuscontext) { + ibus_input_context_focus_out (ibusimcontext->ibuscontext); + } + + gtk_im_context_focus_out (ibusimcontext->slave); + + /* focus in the fake ic */ + if (_fake_context) + ibus_input_context_focus_in (_fake_context); +} + +static void +ibus_im_context_reset (GtkIMContext *context) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if (ibusimcontext->ibuscontext) { + ibus_input_context_reset (ibusimcontext->ibuscontext); + } + gtk_im_context_reset (ibusimcontext->slave); +} + + +static void +ibus_im_context_get_preedit_string (GtkIMContext *context, + gchar **str, + PangoAttrList **attrs, + gint *cursor_pos) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if (ibusimcontext->enable) { + if (ibusimcontext->preedit_visible) { + if (str) { + *str = g_strdup (ibusimcontext->preedit_string ? ibusimcontext->preedit_string: ""); + } + + if (attrs) { + *attrs = ibusimcontext->preedit_attrs ? + pango_attr_list_ref (ibusimcontext->preedit_attrs): + pango_attr_list_new (); + } + + if (cursor_pos) { + *cursor_pos = ibusimcontext->preedit_cursor_pos; + } + } + else { + if (str) { + *str = g_strdup (""); + } + if (attrs) { + *attrs = pango_attr_list_new (); + } + if (cursor_pos) { + *cursor_pos = 0; + } + } + } + else { + gtk_im_context_get_preedit_string (ibusimcontext->slave, str, attrs, cursor_pos); + } + IDEBUG ("str=%s", *str); +} + + +static void +ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if (ibusimcontext->client_window) { + g_object_unref (ibusimcontext->client_window); + ibusimcontext->client_window = NULL; + } + + if (client != NULL) + ibusimcontext->client_window = g_object_ref (client); + + if (ibusimcontext->slave) + gtk_im_context_set_client_window (ibusimcontext->slave, client); +} + +static void +_set_cursor_location_internal (GtkIMContext *context) +{ + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + GdkRectangle area; + gint x, y; + + if(ibusimcontext->client_window == NULL || ibusimcontext->ibuscontext == NULL) { + return; + } + + area = ibusimcontext->cursor_area; + if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { + gint w, h; + gdk_drawable_get_size (ibusimcontext->client_window, &w, &h); + area.y += h; + area.x = 0; + } + + gdk_window_get_origin (ibusimcontext->client_window, &x, &y); + area.x += x; + area.y += y; + ibus_input_context_set_cursor_location (ibusimcontext->ibuscontext, + area.x, + area.y, + area.width, + area.height); +} + +static void +ibus_im_context_set_cursor_location (GtkIMContext *context, GdkRectangle *area) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + ibusimcontext->cursor_area = *area; + _set_cursor_location_internal (context); + gtk_im_context_set_cursor_location (ibusimcontext->slave, area); +} + +static void +ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) +{ + IDEBUG ("%s", __FUNCTION__); + + IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + + if(ibusimcontext->ibuscontext) { + if (use_preedit) { + ibusimcontext->caps |= IBUS_CAP_PREEDIT_TEXT; + } + else { + ibusimcontext->caps &= ~IBUS_CAP_PREEDIT_TEXT; + } + ibus_input_context_set_capabilities (ibusimcontext->ibuscontext, ibusimcontext->caps); + } + gtk_im_context_set_use_preedit (ibusimcontext->slave, use_preedit); +} + +static void +_bus_connected_cb (IBusBus *bus, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + if (ibusimcontext) + _create_input_context (ibusimcontext); + else + _create_fake_input_context (); +} + +static void +_ibus_context_commit_text_cb (IBusInputContext *ibuscontext, + IBusText *text, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + + g_signal_emit (ibusimcontext, _signal_commit_id, 0, text->text); +} + +static gboolean +_key_is_modifier (guint keyval) +{ + /* See gdkkeys-x11.c:_gdk_keymap_key_is_modifier() for how this + * really should be implemented */ + + switch (keyval) { + case GDK_Shift_L: + case GDK_Shift_R: + case GDK_Control_L: + case GDK_Control_R: + case GDK_Caps_Lock: + case GDK_Shift_Lock: + case GDK_Meta_L: + case GDK_Meta_R: + case GDK_Alt_L: + case GDK_Alt_R: + case GDK_Super_L: + case GDK_Super_R: + case GDK_Hyper_L: + case GDK_Hyper_R: + case GDK_ISO_Lock: + case GDK_ISO_Level2_Latch: + case GDK_ISO_Level3_Shift: + case GDK_ISO_Level3_Latch: + case GDK_ISO_Level3_Lock: + case GDK_ISO_Level5_Shift: + case GDK_ISO_Level5_Latch: + case GDK_ISO_Level5_Lock: + case GDK_ISO_Group_Shift: + case GDK_ISO_Group_Latch: + case GDK_ISO_Group_Lock: + return TRUE; + default: + return FALSE; + } +} +/* Copy from gdk */ +static GdkEventKey * +_create_gdk_event (IBusIMContext *ibusimcontext, + guint keyval, + guint keycode, + guint state) +{ + gunichar c = 0; + gchar buf[8]; + + GdkEventKey *event = (GdkEventKey *)gdk_event_new ((state & IBUS_RELEASE_MASK) ? GDK_KEY_RELEASE : GDK_KEY_PRESS); + + if (ibusimcontext && ibusimcontext->client_window) + event->window = g_object_ref (ibusimcontext->client_window); + else if (_input_window) + event->window = g_object_ref (_input_window); + event->time = GDK_CURRENT_TIME; + event->send_event = FALSE; + event->state = state; + event->keyval = keyval; + event->string = NULL; + event->length = 0; + event->hardware_keycode = (keycode != 0) ? keycode + 8 : 0; + event->group = 0; + event->is_modifier = _key_is_modifier (keyval); + + if (keyval != GDK_VoidSymbol) + c = gdk_keyval_to_unicode (keyval); + + if (c) { + gsize bytes_written; + gint len; + + /* Apply the control key - Taken from Xlib + */ + if (event->state & GDK_CONTROL_MASK) { + if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; + else if (c == '2') { + event->string = g_memdup ("\0\0", 2); + event->length = 1; + buf[0] = '\0'; + goto out; + } + else if (c >= '3' && c <= '7') c -= ('3' - '\033'); + else if (c == '8') c = '\177'; + else if (c == '/') c = '_' & 0x1F; + } + + len = g_unichar_to_utf8 (c, buf); + buf[len] = '\0'; + + event->string = g_locale_from_utf8 (buf, len, + NULL, &bytes_written, + NULL); + if (event->string) + event->length = bytes_written; + } else if (keyval == GDK_Escape) { + event->length = 1; + event->string = g_strdup ("\033"); + } + else if (keyval == GDK_Return || + keyval == GDK_KP_Enter) { + event->length = 1; + event->string = g_strdup ("\r"); + } + + if (!event->string) { + event->length = 0; + event->string = g_strdup (""); + } +out: + return event; +} + +static void +_ibus_context_forward_key_event_cb (IBusInputContext *ibuscontext, + guint keyval, + guint keycode, + guint state, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + GdkEventKey *event = _create_gdk_event (ibusimcontext, keyval, keycode, state); + gdk_event_put ((GdkEvent *)event); + gdk_event_free ((GdkEvent *)event); +} + +static void +_ibus_context_delete_surrounding_text_cb (IBusInputContext *ibuscontext, + gint offset_from_cursor, + guint nchars, + IBusIMContext *ibusimcontext) +{ + gboolean return_value; + g_signal_emit (ibusimcontext, _signal_delete_surrounding_id, 0, offset_from_cursor, nchars, &return_value); +} + +static void +_ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext, + IBusText *text, + gint cursor_pos, + gboolean visible, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + + const gchar *str; + gboolean flag; + + if (ibusimcontext->preedit_string) { + g_free (ibusimcontext->preedit_string); + } + if (ibusimcontext->preedit_attrs) { + pango_attr_list_unref (ibusimcontext->preedit_attrs); + ibusimcontext->preedit_attrs = NULL; + } + + str = text->text; + ibusimcontext->preedit_string = g_strdup (str); + if (text->attrs) { + guint i; + ibusimcontext->preedit_attrs = pango_attr_list_new (); + for (i = 0; ; i++) { + IBusAttribute *attr = ibus_attr_list_get (text->attrs, i); + if (attr == NULL) { + break; + } + + PangoAttribute *pango_attr; + switch (attr->type) { + case IBUS_ATTR_TYPE_UNDERLINE: + pango_attr = pango_attr_underline_new (attr->value); + break; + case IBUS_ATTR_TYPE_FOREGROUND: + pango_attr = pango_attr_foreground_new ( + ((attr->value & 0xff0000) >> 8) | 0xff, + ((attr->value & 0x00ff00)) | 0xff, + ((attr->value & 0x0000ff) << 8) | 0xff); + break; + case IBUS_ATTR_TYPE_BACKGROUND: + pango_attr = pango_attr_background_new ( + ((attr->value & 0xff0000) >> 8) | 0xff, + ((attr->value & 0x00ff00)) | 0xff, + ((attr->value & 0x0000ff) << 8) | 0xff); + break; + default: + continue; + } + pango_attr->start_index = g_utf8_offset_to_pointer (str, attr->start_index) - str; + pango_attr->end_index = g_utf8_offset_to_pointer (str, attr->end_index) - str; + pango_attr_list_insert (ibusimcontext->preedit_attrs, pango_attr); + } + } + + ibusimcontext->preedit_cursor_pos = cursor_pos; + + flag = ibusimcontext->preedit_visible != visible; + ibusimcontext->preedit_visible = visible; + + if (ibusimcontext->preedit_visible) { + if (flag) { + /* invisible => visible */ + g_signal_emit (ibusimcontext, _signal_preedit_start_id, 0); + } + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); + } + else { + if (flag) { + /* visible => invisible */ + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); + g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); + } + else { + /* still invisible */ + /* do nothing */ + } + } +} + +static void +_ibus_context_show_preedit_text_cb (IBusInputContext *ibuscontext, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + + if (ibusimcontext->preedit_visible == TRUE) + return; + + ibusimcontext->preedit_visible = TRUE; + g_signal_emit (ibusimcontext, _signal_preedit_start_id, 0); + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); +} + +static void +_ibus_context_hide_preedit_text_cb (IBusInputContext *ibuscontext, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + + if (ibusimcontext->preedit_visible == FALSE) + return; + + ibusimcontext->preedit_visible = FALSE; + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); + g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); +} + +static void +_ibus_context_enabled_cb (IBusInputContext *ibuscontext, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + + ibusimcontext->enable = TRUE; +} + +static void +_ibus_context_disabled_cb (IBusInputContext *ibuscontext, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + ibusimcontext->enable = FALSE; + + /* clear preedit */ + ibusimcontext->preedit_visible = FALSE; + ibusimcontext->preedit_cursor_pos = 0; + g_free (ibusimcontext->preedit_string); + ibusimcontext->preedit_string = NULL; + + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); + g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); +} + +static void +_ibus_context_destroy_cb (IBusInputContext *ibuscontext, + IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + g_assert (ibusimcontext->ibuscontext == ibuscontext); + + g_object_unref (ibusimcontext->ibuscontext); + ibusimcontext->ibuscontext = NULL; + + ibusimcontext->enable = FALSE; + + /* clear preedit */ + ibusimcontext->preedit_visible = FALSE; + ibusimcontext->preedit_cursor_pos = 0; + g_free (ibusimcontext->preedit_string); + ibusimcontext->preedit_string = NULL; + + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); + g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); +} + +static void +_create_input_context (IBusIMContext *ibusimcontext) +{ + IDEBUG ("%s", __FUNCTION__); + + g_assert (ibusimcontext->ibuscontext == NULL); + + ibusimcontext->ibuscontext = ibus_bus_create_input_context (_bus, "gtk-im"); + + g_return_if_fail (ibusimcontext->ibuscontext != NULL); + g_object_ref_sink (ibusimcontext->ibuscontext); + + g_signal_connect (ibusimcontext->ibuscontext, + "commit-text", + G_CALLBACK (_ibus_context_commit_text_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "forward-key-event", + G_CALLBACK (_ibus_context_forward_key_event_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "delete-surrounding-text", + G_CALLBACK (_ibus_context_delete_surrounding_text_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "update-preedit-text", + G_CALLBACK (_ibus_context_update_preedit_text_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "show-preedit-text", + G_CALLBACK (_ibus_context_show_preedit_text_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "hide-preedit-text", + G_CALLBACK (_ibus_context_hide_preedit_text_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "enabled", + G_CALLBACK (_ibus_context_enabled_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, + "disabled", + G_CALLBACK (_ibus_context_disabled_cb), + ibusimcontext); + g_signal_connect (ibusimcontext->ibuscontext, "destroy", + G_CALLBACK (_ibus_context_destroy_cb), + ibusimcontext); + + ibus_input_context_set_capabilities (ibusimcontext->ibuscontext, ibusimcontext->caps); + + if (ibusimcontext->has_focus) { + gtk_im_context_focus_in (GTK_IM_CONTEXT (ibusimcontext)); + } +} + +/* Callback functions for slave context */ +static void +_slave_commit_cb (GtkIMContext *slave, + gchar *string, + IBusIMContext *ibusimcontext) +{ +#if 0 + if ((GtkIMContext *)context == CURRENT_CONTEXT && ibus_im_client_is_enabled (_client)) + return; +#endif + g_signal_emit (ibusimcontext, _signal_commit_id, 0, string); +} + +static void +_slave_preedit_changed_cb (GtkIMContext *slave, + IBusIMContext *ibusimcontext) +{ + if (ibusimcontext->enable && ibusimcontext->ibuscontext) { + return; + } + + g_signal_emit (ibusimcontext, _signal_preedit_changed_id, 0); +} + +static void +_slave_preedit_start_cb (GtkIMContext *slave, + IBusIMContext *ibusimcontext) +{ + if (ibusimcontext->enable && ibusimcontext->ibuscontext) { + return; + } + + g_signal_emit (ibusimcontext, _signal_preedit_start_id, 0); +} + +static void +_slave_preedit_end_cb (GtkIMContext *slave, + IBusIMContext *ibusimcontext) +{ + if (ibusimcontext->enable && ibusimcontext->ibuscontext) { + return; + } + g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0); +} + +static void +_slave_retrieve_surrounding_cb (GtkIMContext *slave, + IBusIMContext *ibusimcontext) +{ + if (ibusimcontext->enable && ibusimcontext->ibuscontext) { + return; + } + g_signal_emit (ibusimcontext, _signal_retrieve_surrounding_id, 0); +} + +static void +_slave_delete_surrounding_cb (GtkIMContext *slave, + gint offset_from_cursor, + guint nchars, + IBusIMContext *ibusimcontext) +{ + gboolean return_value; + + if (ibusimcontext->enable && ibusimcontext->ibuscontext) { + return; + } + g_signal_emit (ibusimcontext, _signal_delete_surrounding_id, 0, offset_from_cursor, nchars, &return_value); +} + +#ifdef OS_CHROMEOS +static void +_ibus_fake_context_destroy_cb (IBusInputContext *ibuscontext, + gpointer user_data) +{ + /* The fack IC may be destroyed when the connection is lost. + * Should release it. */ + g_assert (ibuscontext == _fake_context); + g_object_unref (_fake_context); + _fake_context = NULL; +} + +static void +_create_fake_input_context (void) +{ + g_return_if_fail (_fake_context == NULL); + + /* Global engine is always enabled in Chrome OS, + * so create fake IC, and set focus if no other IC has focus. + */ + _fake_context = ibus_bus_create_input_context (_bus, "fake"); + g_return_if_fail (_fake_context != NULL); + g_object_ref_sink (_fake_context); + + g_signal_connect (_fake_context, "forward-key-event", + G_CALLBACK (_ibus_context_forward_key_event_cb), + NULL); + g_signal_connect (_fake_context, "destroy", + G_CALLBACK (_ibus_fake_context_destroy_cb), + NULL); + + guint32 caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS | IBUS_CAP_SURROUNDING_TEXT; + ibus_input_context_set_capabilities (_fake_context, caps); + + ibus_input_context_focus_in (_fake_context); +} +#else +static void +_create_fake_input_context (void) +{ + /* For Linux desktop, do not use fake IC. */ +} +#endif diff --git a/client/gtk3/ibusimcontext.h b/client/gtk3/ibusimcontext.h deleted file mode 120000 index 29759883e..000000000 --- a/client/gtk3/ibusimcontext.h +++ /dev/null @@ -1 +0,0 @@ -../gtk2/ibusimcontext.h \ No newline at end of file diff --git a/client/gtk3/ibusimcontext.h b/client/gtk3/ibusimcontext.h new file mode 100644 index 000000000..e3f38af5b --- /dev/null +++ b/client/gtk3/ibusimcontext.h @@ -0,0 +1,76 @@ +/* vim:set et ts=4: */ +/* ibus - The Input Bus + * Copyright (C) 2008-2010 Peng Huang + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __IBUS_IM_CONTEXT_H_ +#define __IBUS_IM_CONTEXT_H_ + +#include + +/* + * Type macros. + */ +#define IBUS_TYPE_IM_CONTEXT \ + (ibus_im_context_get_type ()) +#define IBUS_IM_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_IM_CONTEXT, IBusIMContext)) +#define IBUS_IM_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_IM_CONTEXT, IBusIMContextClass)) +#define IBUS_IS_IM_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_IM_CONTEXT)) +#define IBUS_IS_IM_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_IM_CONTEXT)) +#define IBUS_IM_CONTEXT_GET_CLASS(obj) \ + (G_TYPE_CHECK_GET_CLASS ((obj), IBUS_TYPE_IM_CONTEXT, IBusIMContextClass)) + +G_BEGIN_DECLS +typedef struct _IBusIMContext IBusIMContext; +typedef struct _IBusIMContextClass IBusIMContextClass; +typedef struct _IBusIMContextPrivate IBusIMContextPrivate; + + +GType ibus_im_context_get_type (void); +IBusIMContext + *ibus_im_context_new (void); +void ibus_im_context_register_type + (GTypeModule *type_module); +void ibus_im_context_shutdown + (void); +const gchar + *ibus_im_context_get_ic (IBusIMContext *context); +void ibus_im_context_set_ic (IBusIMContext *context, + const gchar *ic); +void ibus_im_context_enable (IBusIMContext *context); +void ibus_im_context_disable (IBusIMContext *context); +void ibus_im_context_commit_string + (IBusIMContext *context, + const gchar *string); +void ibus_im_context_update_preedit + (IBusIMContext *context, + const gchar *string, + PangoAttrList *attrs, + gint cursor_pos, + gboolean visible); +void ibus_im_context_show_preedit + (IBusIMContext *context); +void ibus_im_context_hide_preedit + (IBusIMContext *context); +G_END_DECLS +#endif + diff --git a/client/x11/gdk-private.c b/client/x11/gdk-private.c index 30d45adec..9ea1068d5 100644 --- a/client/x11/gdk-private.c +++ b/client/x11/gdk-private.c @@ -30,8 +30,8 @@ void translate_key_event (GdkDisplay *display, - GdkEvent *event, - XEvent *xevent) + GdkEvent *event, + XEvent *xevent) { GdkKeymap *keymap = gdk_keymap_get_for_display (display); #if 0 @@ -55,11 +55,11 @@ translate_key_event (GdkDisplay *display, event->key.keyval = GDK_VoidSymbol; gdk_keymap_translate_keyboard_state (keymap, - event->key.hardware_keycode, - event->key.state, - event->key.group, - &event->key.keyval, - NULL, NULL, NULL); + event->key.hardware_keycode, + event->key.state, + event->key.group, + &event->key.keyval, + NULL, NULL, NULL); #if 0 _gdk_keymap_add_virtual_modifiers (keymap, &event->key.state); event->key.is_modifier = _gdk_keymap_key_is_modifier (keymap, event->key.hardware_keycode); @@ -86,28 +86,28 @@ translate_key_event (GdkDisplay *display, /* Apply the control key - Taken from Xlib */ if (event->key.state & GDK_CONTROL_MASK) - { - if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; - else if (c == '2') - { - event->key.string = g_memdup ("\0\0", 2); - event->key.length = 1; - buf[0] = '\0'; - goto out; - } - else if (c >= '3' && c <= '7') c -= ('3' - '\033'); - else if (c == '8') c = '\177'; - else if (c == '/') c = '_' & 0x1F; - } + { + if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; + else if (c == '2') + { + event->key.string = g_memdup ("\0\0", 2); + event->key.length = 1; + buf[0] = '\0'; + goto out; + } + else if (c >= '3' && c <= '7') c -= ('3' - '\033'); + else if (c == '8') c = '\177'; + else if (c == '/') c = '_' & 0x1F; + } len = g_unichar_to_utf8 (c, buf); buf[len] = '\0'; event->key.string = g_locale_from_utf8 (buf, len, - NULL, &bytes_written, - NULL); + NULL, &bytes_written, + NULL); if (event->key.string) - event->key.length = bytes_written; + event->key.length = bytes_written; } else if (event->key.keyval == GDK_Escape) { @@ -115,7 +115,7 @@ translate_key_event (GdkDisplay *display, event->key.string = g_strdup ("\033"); } else if (event->key.keyval == GDK_Return || - event->key.keyval == GDK_KP_Enter) + event->key.keyval == GDK_KP_Enter) { event->key.length = 1; event->key.string = g_strdup ("\r"); diff --git a/client/x11/gdk-private.h b/client/x11/gdk-private.h index 92ee8fab9..6cb12251f 100644 --- a/client/x11/gdk-private.h +++ b/client/x11/gdk-private.h @@ -24,6 +24,6 @@ void translate_key_event (GdkDisplay *display, - GdkEvent *event, - XEvent *xevent); + GdkEvent *event, + XEvent *xevent); #endif diff --git a/gconf/config.c b/gconf/config.c index 6ee039b56..73eea7aa5 100644 --- a/gconf/config.c +++ b/gconf/config.c @@ -8,9 +8,9 @@ #define GCONF_PREFIX "/desktop/ibus" /* functions prototype */ -static void ibus_config_gconf_class_init (IBusConfigGConfClass *klass); -static void ibus_config_gconf_init (IBusConfigGConf *config); -static void ibus_config_gconf_destroy (IBusConfigGConf *config); +static void ibus_config_gconf_class_init (IBusConfigGConfClass *klass); +static void ibus_config_gconf_init (IBusConfigGConf *config); +static void ibus_config_gconf_destroy (IBusConfigGConf *config); static gboolean ibus_config_gconf_set_value (IBusConfigService *config, const gchar *section, const gchar *name, @@ -35,28 +35,28 @@ static IBusConfigServiceClass *parent_class = NULL; GType ibus_config_gconf_get_type (void) { - static GType type = 0; - - static const GTypeInfo type_info = { - sizeof (IBusConfigGConfClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ibus_config_gconf_class_init, - NULL, - NULL, - sizeof (IBusConfigGConf), - 0, - (GInstanceInitFunc) ibus_config_gconf_init, - }; - - if (type == 0) { - type = g_type_register_static (IBUS_TYPE_CONFIG_SERVICE, - "IBusConfigGConf", - &type_info, - (GTypeFlags) 0); - } - - return type; + static GType type = 0; + + static const GTypeInfo type_info = { + sizeof (IBusConfigGConfClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) ibus_config_gconf_class_init, + NULL, + NULL, + sizeof (IBusConfigGConf), + 0, + (GInstanceInitFunc) ibus_config_gconf_init, + }; + + if (type == 0) { + type = g_type_register_static (IBUS_TYPE_CONFIG_SERVICE, + "IBusConfigGConf", + &type_info, + (GTypeFlags) 0); + } + + return type; } static void @@ -66,7 +66,7 @@ ibus_config_gconf_class_init (IBusConfigGConfClass *klass) parent_class = (IBusConfigServiceClass *) g_type_class_peek_parent (klass); - IBUS_OBJECT_CLASS (object_class)->destroy = (IBusObjectDestroyFunc) ibus_config_gconf_destroy; + IBUS_OBJECT_CLASS (object_class)->destroy = (IBusObjectDestroyFunc) ibus_config_gconf_destroy; IBUS_CONFIG_SERVICE_CLASS (object_class)->set_value = ibus_config_gconf_set_value; IBUS_CONFIG_SERVICE_CLASS (object_class)->get_value = ibus_config_gconf_get_value; IBUS_CONFIG_SERVICE_CLASS (object_class)->unset = ibus_config_gconf_unset; @@ -119,7 +119,7 @@ ibus_config_gconf_destroy (IBusConfigGConf *config) config->client = NULL; } - IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)config); + IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)config); } static GConfValue * diff --git a/gconf/config.h b/gconf/config.h index e2b5356c2..11a13e226 100644 --- a/gconf/config.h +++ b/gconf/config.h @@ -5,19 +5,19 @@ #include #include -#define IBUS_TYPE_CONFIG_GCONF \ - (ibus_config_gconf_get_type ()) +#define IBUS_TYPE_CONFIG_GCONF \ + (ibus_config_gconf_get_type ()) typedef struct _IBusConfigGConf IBusConfigGConf; typedef struct _IBusConfigGConfClass IBusConfigGConfClass; struct _IBusConfigGConf { - IBusConfigService parent; + IBusConfigService parent; GConfClient *client; }; struct _IBusConfigGConfClass { - IBusConfigServiceClass parent; + IBusConfigServiceClass parent; }; diff --git a/memconf/config.h b/memconf/config.h index f4253f164..1ccb1f55d 100644 --- a/memconf/config.h +++ b/memconf/config.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibus.h b/src/ibus.h index d724b6a76..6ae182f44 100644 --- a/src/ibus.h +++ b/src/ibus.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusattribute.c b/src/ibusattribute.c index 3a7c7a37f..177e5d7ba 100644 --- a/src/ibusattribute.c +++ b/src/ibusattribute.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusattribute.h b/src/ibusattribute.h index 74f2b06db..07bf582da 100644 --- a/src/ibusattribute.h +++ b/src/ibusattribute.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusattrlist.c b/src/ibusattrlist.c index 00238828c..5f30d46fc 100644 --- a/src/ibusattrlist.c +++ b/src/ibusattrlist.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusattrlist.h b/src/ibusattrlist.h index 69f68fc54..e1f547540 100644 --- a/src/ibusattrlist.h +++ b/src/ibusattrlist.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusbus.c b/src/ibusbus.c index 40d456671..21a4eb7ca 100644 --- a/src/ibusbus.c +++ b/src/ibusbus.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusbus.h b/src/ibusbus.h index c57774ab9..42e9309f2 100644 --- a/src/ibusbus.h +++ b/src/ibusbus.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuscomponent.c b/src/ibuscomponent.c index 0c5526868..bf2e30f18 100644 --- a/src/ibuscomponent.c +++ b/src/ibuscomponent.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuscomponent.h b/src/ibuscomponent.h index 249c8cf14..39dd57af8 100644 --- a/src/ibuscomponent.h +++ b/src/ibuscomponent.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconfig.c b/src/ibusconfig.c index 2400d9e73..7edd9ef96 100644 --- a/src/ibusconfig.c +++ b/src/ibusconfig.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconfig.h b/src/ibusconfig.h index fd256c102..cbb784178 100644 --- a/src/ibusconfig.h +++ b/src/ibusconfig.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconfigprivate.h b/src/ibusconfigprivate.h index 7e7316d45..056ae5a00 100644 --- a/src/ibusconfigprivate.h +++ b/src/ibusconfigprivate.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconfigservice.c b/src/ibusconfigservice.c index 4a271190d..d360ed693 100644 --- a/src/ibusconfigservice.c +++ b/src/ibusconfigservice.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconfigservice.h b/src/ibusconfigservice.h index cc446ecfa..cb4e537c1 100644 --- a/src/ibusconfigservice.h +++ b/src/ibusconfigservice.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconnection.c b/src/ibusconnection.c index 94a25ea46..a7c1aab00 100644 --- a/src/ibusconnection.c +++ b/src/ibusconnection.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusconnection.h b/src/ibusconnection.h index eb1d5aede..02f4b0670 100644 --- a/src/ibusconnection.h +++ b/src/ibusconnection.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusdbus.h b/src/ibusdbus.h index 75e7e7ab8..95f1aa6b6 100644 --- a/src/ibusdbus.h +++ b/src/ibusdbus.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusdebug.h b/src/ibusdebug.h index 2751e6e8d..12705a8ac 100644 --- a/src/ibusdebug.h +++ b/src/ibusdebug.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusengine.c b/src/ibusengine.c index 899d7c883..8cf09fe51 100644 --- a/src/ibusengine.c +++ b/src/ibusengine.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusengine.h b/src/ibusengine.h index 80e87c76e..27eb5a27b 100644 --- a/src/ibusengine.h +++ b/src/ibusengine.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusenginedesc.c b/src/ibusenginedesc.c index e9a62484d..f06d5685e 100644 --- a/src/ibusenginedesc.c +++ b/src/ibusenginedesc.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusenginedesc.h b/src/ibusenginedesc.h index 59d7edfbc..165a50091 100644 --- a/src/ibusenginedesc.h +++ b/src/ibusenginedesc.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuserror.c b/src/ibuserror.c index 1d46493f1..7f2e5a96b 100644 --- a/src/ibuserror.c +++ b/src/ibuserror.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuserror.h b/src/ibuserror.h index e35b4b41e..9dd4682e4 100644 --- a/src/ibuserror.h +++ b/src/ibuserror.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusfactory.c b/src/ibusfactory.c index e0ec2a5e8..614109fc7 100644 --- a/src/ibusfactory.c +++ b/src/ibusfactory.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusfactory.h b/src/ibusfactory.h index e92c810e6..bab878983 100644 --- a/src/ibusfactory.h +++ b/src/ibusfactory.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibushotkey.c b/src/ibushotkey.c index a91013ee3..37a464d91 100644 --- a/src/ibushotkey.c +++ b/src/ibushotkey.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibushotkey.h b/src/ibushotkey.h index 4014d467e..c0bb5b2f8 100644 --- a/src/ibushotkey.h +++ b/src/ibushotkey.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c index 7359de0a6..df3f1f68a 100644 --- a/src/ibusinputcontext.c +++ b/src/ibusinputcontext.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h index 026460ba5..6e21cf275 100644 --- a/src/ibusinputcontext.h +++ b/src/ibusinputcontext.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusinternal.c b/src/ibusinternal.c index 4a03a5a10..94d6d7493 100644 --- a/src/ibusinternal.c +++ b/src/ibusinternal.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -611,7 +611,7 @@ dbus_connection_setup (DBusConnection *connection, */ void dbus_server_setup (DBusServer *server, - GMainContext *context) + GMainContext *context) { ConnectionSetup *old_setup; ConnectionSetup *cs; diff --git a/src/ibusinternal.h b/src/ibusinternal.h index 28d673339..c090b7ef8 100644 --- a/src/ibusinternal.h +++ b/src/ibusinternal.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuskeymap.c b/src/ibuskeymap.c index 19b1c39c6..22da0d684 100644 --- a/src/ibuskeymap.c +++ b/src/ibuskeymap.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuskeymap.h b/src/ibuskeymap.h index 0d0d96980..d2602cb2d 100644 --- a/src/ibuskeymap.h +++ b/src/ibuskeymap.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuskeynames.c b/src/ibuskeynames.c index 6c5d7fc02..b5c4aad68 100644 --- a/src/ibuskeynames.c +++ b/src/ibuskeynames.c @@ -54,8 +54,8 @@ ibus_keyval_name (guint keyval) } found = bsearch (&keyval, gdk_keys_by_keyval, - IBUS_NUM_KEYS, sizeof (gdk_key), - gdk_keys_keyval_compare); + IBUS_NUM_KEYS, sizeof (gdk_key), + gdk_keys_keyval_compare); if (found != NULL) { @@ -78,7 +78,7 @@ static int gdk_keys_name_compare (const void *pkey, const void *pbase) { return strcmp ((const char *) pkey, - (const char *) (keynames + ((const gdk_key *) pbase)->offset)); + (const char *) (keynames + ((const gdk_key *) pbase)->offset)); } guint @@ -89,8 +89,8 @@ ibus_keyval_from_name (const gchar *keyval_name) g_return_val_if_fail (keyval_name != NULL, 0); found = bsearch (keyval_name, gdk_keys_by_name, - IBUS_NUM_KEYS, sizeof (gdk_key), - gdk_keys_name_compare); + IBUS_NUM_KEYS, sizeof (gdk_key), + gdk_keys_name_compare); if (found != NULL) return found->keyval; else @@ -99,100 +99,100 @@ ibus_keyval_from_name (const gchar *keyval_name) static const gchar * modifier_name[] = { - "Shift", // 0 - "Lock", // 1 - "Control", // 2 - "Alt", // 3 - "Mod2", // 4 - "Mod3", // 5 - "Mod4", // 6 - "Mod5", // 7 - "Button1", // 8 - "Button2", // 9 - "Button3", // 10 - "Button4", // 11 - "Button5", // 12 + "Shift", // 0 + "Lock", // 1 + "Control", // 2 + "Alt", // 3 + "Mod2", // 4 + "Mod3", // 5 + "Mod4", // 6 + "Mod5", // 7 + "Button1", // 8 + "Button2", // 9 + "Button3", // 10 + "Button4", // 11 + "Button5", // 12 NULL, NULL, NULL, NULL, NULL, // 13 - 17 NULL, NULL, NULL, NULL, NULL, // 18 - 22 NULL, NULL, NULL, // 23 - 25 - "Supper", // 26 - "Hyper", // 27 - "Meta", // 28 - NULL, // 29 - "Release", // 30 - NULL, // 31 + "Supper", // 26 + "Hyper", // 27 + "Meta", // 28 + NULL, // 29 + "Release", // 30 + NULL, // 31 }; const gchar * ibus_key_event_to_string (guint keyval, - guint modifiers) + guint modifiers) { - guint i; - GString *str; - const gchar *keyval_name; + guint i; + GString *str; + const gchar *keyval_name; - g_return_val_if_fail (keyval != IBUS_VoidSymbol, NULL); + g_return_val_if_fail (keyval != IBUS_VoidSymbol, NULL); - keyval_name = ibus_keyval_name (keyval); - g_return_val_if_fail (keyval_name != NULL, NULL); + keyval_name = ibus_keyval_name (keyval); + g_return_val_if_fail (keyval_name != NULL, NULL); - str = g_string_new (""); + str = g_string_new (""); - for (i = 0; i < 32; i++) { - guint mask = 1 << i; + for (i = 0; i < 32; i++) { + guint mask = 1 << i; - if ((modifiers & mask) == 0) - continue; - if (modifier_name[i] == NULL) - continue; + if ((modifiers & mask) == 0) + continue; + if (modifier_name[i] == NULL) + continue; - g_string_append (str, modifier_name[i]); - g_string_append_c (str, '+'); - } + g_string_append (str, modifier_name[i]); + g_string_append_c (str, '+'); + } - g_string_append (str, keyval_name); + g_string_append (str, keyval_name); - return g_string_free (str, FALSE); + return g_string_free (str, FALSE); } gboolean ibus_key_event_from_string (const gchar *string, - guint *keyval, - guint *modifiers) + guint *keyval, + guint *modifiers) { - g_return_val_if_fail (string != NULL, FALSE); - g_return_val_if_fail (keyval != NULL, FALSE); - g_return_val_if_fail (modifiers != NULL, FALSE); - - gchar **tokens = NULL; - gchar **p; - gboolean retval = FALSE; - - tokens = g_strsplit (string, "+", 0); - g_return_val_if_fail (tokens != NULL, FALSE); - - *keyval = 0; - *modifiers = 0; - - for (p = tokens; *(p + 1) != NULL; p++) { - gint i; - for (i = 0; i < 32; i++) { - if (g_strcmp0 (modifier_name[i], *p) != 0) - continue; - *modifiers |= (1 << i); - break; - } - if (i == 32) { - goto _out; - } - } - - *keyval = ibus_keyval_from_name (*p); - if (*keyval != IBUS_VoidSymbol) - retval = TRUE; + g_return_val_if_fail (string != NULL, FALSE); + g_return_val_if_fail (keyval != NULL, FALSE); + g_return_val_if_fail (modifiers != NULL, FALSE); + + gchar **tokens = NULL; + gchar **p; + gboolean retval = FALSE; + + tokens = g_strsplit (string, "+", 0); + g_return_val_if_fail (tokens != NULL, FALSE); + + *keyval = 0; + *modifiers = 0; + + for (p = tokens; *(p + 1) != NULL; p++) { + gint i; + for (i = 0; i < 32; i++) { + if (g_strcmp0 (modifier_name[i], *p) != 0) + continue; + *modifiers |= (1 << i); + break; + } + if (i == 32) { + goto _out; + } + } + + *keyval = ibus_keyval_from_name (*p); + if (*keyval != IBUS_VoidSymbol) + retval = TRUE; _out: - if (tokens) - g_strfreev (tokens); - return retval; + if (tokens) + g_strfreev (tokens); + return retval; } diff --git a/src/ibuskeysyms.h b/src/ibuskeysyms.h index 51d31512c..7245b1d4c 100644 --- a/src/ibuskeysyms.h +++ b/src/ibuskeysyms.h @@ -9,7 +9,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuslookuptable.c b/src/ibuslookuptable.c index 504c233e1..dcc4f5326 100644 --- a/src/ibuslookuptable.c +++ b/src/ibuslookuptable.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuslookuptable.h b/src/ibuslookuptable.h index 1e5664456..5a8137fca 100644 --- a/src/ibuslookuptable.h +++ b/src/ibuslookuptable.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusmainloop.c b/src/ibusmainloop.c index 35e3b7d7b..ce429a581 100644 --- a/src/ibusmainloop.c +++ b/src/ibusmainloop.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusmainloop.h b/src/ibusmainloop.h index 0c68d1f5e..ded891af0 100644 --- a/src/ibusmainloop.h +++ b/src/ibusmainloop.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusmessage.c b/src/ibusmessage.c index 80a2a7547..2d969bfb5 100644 --- a/src/ibusmessage.c +++ b/src/ibusmessage.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusmessage.h b/src/ibusmessage.h index fba2673d4..8e07f80aa 100644 --- a/src/ibusmessage.h +++ b/src/ibusmessage.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -175,7 +175,7 @@ void ibus_message_unref (IBusMessage *message); * ibus_message_new_method_call: * @destination: Where this message to be sent to or %NULL for no destination. * @path: Object path the message should be sent to. - * @interface: Interface to invoke method on, or %NULL. + * @interface: Interface to invoke method on, or %NULL. * @method: The method to be invoked. * @returns: A newly allocate IBusMessage; or %NULL if memory cannot be allocated. * @@ -244,7 +244,7 @@ IBusMessage *ibus_message_new_error_printf (IBusMessage *reply_to, /** * ibus_message_new_signal: * @path: Object path the message should be sent to. - * @interface: Interface to invoke method on, or %NULL. + * @interface: Interface to invoke method on, or %NULL. * @method: The method to invoke. * @returns: A newly allocate IBusMessage with the error information; or %NULL if memory cannot be allocated. * @@ -260,7 +260,7 @@ IBusMessage *ibus_message_new_signal (const gchar *path, /** * ibus_message_is_method_call: * @message: An IBusMessage. - * @interface: The interface to check. Cannot be %NULL. + * @interface: The interface to check. Cannot be %NULL. * @method: The method to check. Cannot be %NULL. * @returns: %TRUE if @message is DBUS_MESSAGE_TYPE_METHOD_CALL and the invoked method is matched with @method; * %FALSE otherwise. diff --git a/src/ibusobject.c b/src/ibusobject.c index f6723ae6a..6cc079b09 100644 --- a/src/ibusobject.c +++ b/src/ibusobject.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusobject.h b/src/ibusobject.h index f7aa26af1..c4f92b753 100644 --- a/src/ibusobject.h +++ b/src/ibusobject.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusobservedpath.c b/src/ibusobservedpath.c index a71b48b26..925979f64 100644 --- a/src/ibusobservedpath.c +++ b/src/ibusobservedpath.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusobservedpath.h b/src/ibusobservedpath.h index 66791a2f1..713edf4d3 100644 --- a/src/ibusobservedpath.h +++ b/src/ibusobservedpath.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuspanelservice.c b/src/ibuspanelservice.c index 681dc17bc..6d61ba141 100644 --- a/src/ibuspanelservice.c +++ b/src/ibuspanelservice.c @@ -9,7 +9,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuspanelservice.h b/src/ibuspanelservice.h index 5c05bac72..2e71e0817 100644 --- a/src/ibuspanelservice.h +++ b/src/ibuspanelservice.h @@ -9,7 +9,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuspendingcall.c b/src/ibuspendingcall.c index 33b803c05..f07592954 100644 --- a/src/ibuspendingcall.c +++ b/src/ibuspendingcall.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibuspendingcall.h b/src/ibuspendingcall.h index afcc35a9f..afcd7ae2d 100644 --- a/src/ibuspendingcall.h +++ b/src/ibuspendingcall.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusproperty.c b/src/ibusproperty.c index c0e44304b..a9b87ed6d 100644 --- a/src/ibusproperty.c +++ b/src/ibusproperty.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusproperty.h b/src/ibusproperty.h index 71d883d9e..19deab877 100644 --- a/src/ibusproperty.h +++ b/src/ibusproperty.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusproplist.c b/src/ibusproplist.c index 1e960f7e0..6558e0833 100644 --- a/src/ibusproplist.c +++ b/src/ibusproplist.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusproplist.h b/src/ibusproplist.h index 180529715..6de024443 100644 --- a/src/ibusproplist.h +++ b/src/ibusproplist.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusproxy.c b/src/ibusproxy.c index a92a6af01..293ae592b 100644 --- a/src/ibusproxy.c +++ b/src/ibusproxy.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusproxy.h b/src/ibusproxy.h index cf1aea24d..ae3f04b35 100644 --- a/src/ibusproxy.h +++ b/src/ibusproxy.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusserializable.c b/src/ibusserializable.c index 717418147..7ed008141 100644 --- a/src/ibusserializable.c +++ b/src/ibusserializable.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusserializable.h b/src/ibusserializable.h index 2e051f316..62f7fff7c 100644 --- a/src/ibusserializable.h +++ b/src/ibusserializable.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusserver.c b/src/ibusserver.c index c2764571a..632718d5b 100644 --- a/src/ibusserver.c +++ b/src/ibusserver.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusserver.h b/src/ibusserver.h index 08d21d0e2..6c04fd1cf 100644 --- a/src/ibusserver.h +++ b/src/ibusserver.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusservice.c b/src/ibusservice.c index 431b965fd..20c6fee76 100644 --- a/src/ibusservice.c +++ b/src/ibusservice.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusservice.h b/src/ibusservice.h index d0ef86805..51d52fa29 100644 --- a/src/ibusservice.h +++ b/src/ibusservice.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusshare.c b/src/ibusshare.c index 194b51092..04d9984a2 100644 --- a/src/ibusshare.c +++ b/src/ibusshare.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibusshare.h b/src/ibusshare.h index c33a372b3..3e33a6905 100644 --- a/src/ibusshare.h +++ b/src/ibusshare.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibustext.c b/src/ibustext.c index 78d5d054b..bf4a5449b 100644 --- a/src/ibustext.c +++ b/src/ibustext.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibustext.h b/src/ibustext.h index 476e9575f..42b006e2c 100644 --- a/src/ibustext.h +++ b/src/ibustext.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/ibustypes.h b/src/ibustypes.h index 583b5344e..04b6947d8 100644 --- a/src/ibustypes.h +++ b/src/ibustypes.h @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/src/test-attribute.c b/src/test-attribute.c index b2ab4e5f6..d8ac82400 100644 --- a/src/test-attribute.c +++ b/src/test-attribute.c @@ -3,42 +3,42 @@ int main() { - g_type_init (); - IBusAttrList *list; - IBusMessage *message; - gboolean retval; - IBusError *error; + g_type_init (); + IBusAttrList *list; + IBusMessage *message; + gboolean retval; + IBusError *error; - list = ibus_attr_list_new (); - ibus_attr_list_append (list, ibus_attribute_new (1, 1, 1, 2)); - ibus_attr_list_append (list, ibus_attribute_new (2, 1, 1, 2)); - ibus_attr_list_append (list, ibus_attribute_new (3, 1, 1, 2)); - ibus_attr_list_append (list, ibus_attribute_new (3, 1, 1, 2)); + list = ibus_attr_list_new (); + ibus_attr_list_append (list, ibus_attribute_new (1, 1, 1, 2)); + ibus_attr_list_append (list, ibus_attribute_new (2, 1, 1, 2)); + ibus_attr_list_append (list, ibus_attribute_new (3, 1, 1, 2)); + ibus_attr_list_append (list, ibus_attribute_new (3, 1, 1, 2)); - message = ibus_message_new_signal ("/org/freedesktop/IBus", - "org.freedesktop.IBus", - "Test"); + message = ibus_message_new_signal ("/org/freedesktop/IBus", + "org.freedesktop.IBus", + "Test"); - IBusSerializable *p = ibus_serializable_new (); - retval = ibus_message_append_args (message, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - G_TYPE_INVALID); - g_assert (retval); + IBusSerializable *p = ibus_serializable_new (); + retval = ibus_message_append_args (message, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + G_TYPE_INVALID); + g_assert (retval); - retval = ibus_message_get_args (message, - &error, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - IBUS_TYPE_SERIALIZABLE, &p, - G_TYPE_INVALID); - g_assert (retval); + retval = ibus_message_get_args (message, + &error, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + G_TYPE_INVALID); + g_assert (retval); - return 0; + return 0; } diff --git a/src/test-bus.c b/src/test-bus.c index b5f4a6b2f..568ecca09 100644 --- a/src/test-bus.c +++ b/src/test-bus.c @@ -7,9 +7,9 @@ get_last_engine_id (const GList *engines) g_assert (engines); const char *result = NULL; for (; engines; engines = g_list_next (engines)) { - IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (engines->data); - g_assert (engine_desc); - result = engine_desc->name; + IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (engines->data); + g_assert (engine_desc); + result = engine_desc->name; } g_assert (result); return g_strdup (result); @@ -20,82 +20,82 @@ print_engines (const GList *engines) { g_assert (engines); for (; engines; engines = g_list_next (engines)) { - IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (engines->data); - g_assert (engine_desc); - g_debug ("%s (id:%s, icon:%s)", engine_desc->longname, engine_desc->name, engine_desc->icon); - g_object_unref (engine_desc); + IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (engines->data); + g_assert (engine_desc); + g_debug ("%s (id:%s, icon:%s)", engine_desc->longname, engine_desc->name, engine_desc->icon); + g_object_unref (engine_desc); } } int main() { - g_type_init (); + g_type_init (); - IBusBus *bus; - GList *engines; - gchar *active_engine_name; + IBusBus *bus; + GList *engines; + gchar *active_engine_name; - bus = ibus_bus_new (); + bus = ibus_bus_new (); - /* Test ibusbus.c */ - g_debug ("===== Active engines:"); - engines = ibus_bus_list_active_engines (bus); - g_assert (engines); - active_engine_name = get_last_engine_id (engines); - print_engines (engines); - g_list_free (engines); + /* Test ibusbus.c */ + g_debug ("===== Active engines:"); + engines = ibus_bus_list_active_engines (bus); + g_assert (engines); + active_engine_name = get_last_engine_id (engines); + print_engines (engines); + g_list_free (engines); - g_debug ("===== All engines:"); - engines = ibus_bus_list_engines (bus); - g_assert (engines); - print_engines (engines); - g_list_free (engines); + g_debug ("===== All engines:"); + engines = ibus_bus_list_engines (bus); + g_assert (engines); + print_engines (engines); + g_list_free (engines); - g_debug ("===== Global engine:"); - if (ibus_bus_get_use_global_engine (bus)) { - g_debug ("use_global_engine is true."); - if (ibus_bus_is_global_engine_enabled (bus)) { - g_debug ("Global engine is enabled."); - IBusEngineDesc *global_engine = ibus_bus_get_global_engine (bus); - g_assert (global_engine); - g_debug ("%s (id:%s, icon:%s)", global_engine->longname, - global_engine->name, global_engine->icon); - g_object_unref (global_engine); - } - } + g_debug ("===== Global engine:"); + if (ibus_bus_get_use_global_engine (bus)) { + g_debug ("use_global_engine is true."); + if (ibus_bus_is_global_engine_enabled (bus)) { + g_debug ("Global engine is enabled."); + IBusEngineDesc *global_engine = ibus_bus_get_global_engine (bus); + g_assert (global_engine); + g_debug ("%s (id:%s, icon:%s)", global_engine->longname, + global_engine->name, global_engine->icon); + g_object_unref (global_engine); + } + } - g_debug ("===== Use system layout:%s", ibus_bus_get_use_sys_layout (bus) ? "true" : "false"); + g_debug ("===== Use system layout:%s", ibus_bus_get_use_sys_layout (bus) ? "true" : "false"); - g_debug ("Test ibusbus.c: passed."); + g_debug ("Test ibusbus.c: passed."); - /* Test ibusinputcontext.c */ + /* Test ibusinputcontext.c */ #if 1 { - IBusInputContext *context; - IBusEngineDesc *engine_desc; - gchar *current_ic; - context = ibus_bus_create_input_context (bus, "test"); - ibus_input_context_set_capabilities (context, IBUS_CAP_FOCUS); - ibus_input_context_disable (context); - g_assert (ibus_input_context_is_enabled (context) == FALSE); - ibus_input_context_enable (context); - g_assert (ibus_input_context_is_enabled (context) == TRUE); - ibus_input_context_focus_in (context); - ibus_input_context_set_engine (context, active_engine_name); - current_ic = ibus_bus_current_input_context (bus); - g_assert (!strcmp (current_ic, ibus_proxy_get_path (IBUS_PROXY (context)))); - engine_desc = ibus_input_context_get_engine (context); - g_assert (engine_desc); - g_assert (!strcmp (active_engine_name, engine_desc->name)); - g_debug ("Test ibusinputcontext.c: passed."); + IBusInputContext *context; + IBusEngineDesc *engine_desc; + gchar *current_ic; + context = ibus_bus_create_input_context (bus, "test"); + ibus_input_context_set_capabilities (context, IBUS_CAP_FOCUS); + ibus_input_context_disable (context); + g_assert (ibus_input_context_is_enabled (context) == FALSE); + ibus_input_context_enable (context); + g_assert (ibus_input_context_is_enabled (context) == TRUE); + ibus_input_context_focus_in (context); + ibus_input_context_set_engine (context, active_engine_name); + current_ic = ibus_bus_current_input_context (bus); + g_assert (!strcmp (current_ic, ibus_proxy_get_path (IBUS_PROXY (context)))); + engine_desc = ibus_input_context_get_engine (context); + g_assert (engine_desc); + g_assert (!strcmp (active_engine_name, engine_desc->name)); + g_debug ("Test ibusinputcontext.c: passed."); - g_free (active_engine_name); - g_free (current_ic); - g_object_unref (engine_desc); - g_object_unref (context); + g_free (active_engine_name); + g_free (current_ic); + g_object_unref (engine_desc); + g_object_unref (context); } #endif - g_object_unref (bus); + g_object_unref (bus); - return 0; + return 0; } diff --git a/src/test-engine.c b/src/test-engine.c index bea99cf86..ddfdb7ed5 100644 --- a/src/test-engine.c +++ b/src/test-engine.c @@ -2,15 +2,15 @@ int main() { - g_type_init (); + g_type_init (); - GMainLoop *mainloop; - IBusConnection *connection; - IBusService *service; + GMainLoop *mainloop; + IBusConnection *connection; + IBusService *service; - mainloop = g_main_loop_new (NULL, FALSE); - connection = ibus_connection_open ("unix:path=/tmp/ibus-phuang/ibus--0.0"); - service = IBUS_SERVICE (ibus_engine_new ("/a/Engine", connection)); - g_main_loop_run (mainloop); - return 0; + mainloop = g_main_loop_new (NULL, FALSE); + connection = ibus_connection_open ("unix:path=/tmp/ibus-phuang/ibus--0.0"); + service = IBUS_SERVICE (ibus_engine_new ("/a/Engine", connection)); + g_main_loop_run (mainloop); + return 0; } diff --git a/src/test-global-engine.c b/src/test-global-engine.c index 45e5e63f5..2b05a6dad 100644 --- a/src/test-global-engine.c +++ b/src/test-global-engine.c @@ -7,58 +7,58 @@ static GList *current_engine = NULL; void global_engine_changed_cb (IBusBus *bus) { - IBusEngineDesc *global_engine = ibus_bus_get_global_engine (bus); - g_assert (global_engine); - g_debug ("%s (id:%s, icon:%s)", global_engine->longname, - global_engine->name, global_engine->icon); - IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (current_engine->data); - g_assert (strcmp (engine_desc->name, global_engine->name) == 0); - g_object_unref (global_engine); + IBusEngineDesc *global_engine = ibus_bus_get_global_engine (bus); + g_assert (global_engine); + g_debug ("%s (id:%s, icon:%s)", global_engine->longname, + global_engine->name, global_engine->icon); + IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (current_engine->data); + g_assert (strcmp (engine_desc->name, global_engine->name) == 0); + g_object_unref (global_engine); } gboolean change_global_engine_cb (IBusBus *bus) { - if (!current_engine) - current_engine = engines; - else - current_engine = g_list_next (current_engine); + if (!current_engine) + current_engine = engines; + else + current_engine = g_list_next (current_engine); - if (!current_engine) { - ibus_quit(); - return FALSE; - } + if (!current_engine) { + ibus_quit(); + return FALSE; + } - IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (current_engine->data); - ibus_bus_set_global_engine (bus, engine_desc->name); + IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (current_engine->data); + ibus_bus_set_global_engine (bus, engine_desc->name); - return TRUE; + return TRUE; } int main() { - g_type_init (); + g_type_init (); - IBusBus *bus; + IBusBus *bus; - bus = ibus_bus_new (); - engines = ibus_bus_list_active_engines (bus); - g_assert (engines); + bus = ibus_bus_new (); + engines = ibus_bus_list_active_engines (bus); + g_assert (engines); - g_debug ("===== Global engine:"); - if (ibus_bus_get_use_global_engine (bus) == FALSE) + g_debug ("===== Global engine:"); + if (ibus_bus_get_use_global_engine (bus) == FALSE) return 0; - g_signal_connect (bus, "global-engine-changed", + g_signal_connect (bus, "global-engine-changed", G_CALLBACK (global_engine_changed_cb), bus); - g_idle_add ((GSourceFunc)change_global_engine_cb, bus); + g_idle_add ((GSourceFunc)change_global_engine_cb, bus); - ibus_main(); + ibus_main(); - g_debug ("Test ibusbus.c's global engine api: passed."); - g_list_free (engines); - g_object_unref (bus); + g_debug ("Test ibusbus.c's global engine api: passed."); + g_list_free (engines); + g_object_unref (bus); - return 0; + return 0; } diff --git a/src/test-keymap.c b/src/test-keymap.c index 63b214731..0df53a4a9 100644 --- a/src/test-keymap.c +++ b/src/test-keymap.c @@ -26,7 +26,7 @@ int main (int argc, char **argv) IBusKeymap *keymap = ibus_keymap_get (argc > 1 ? argv[1] : "us"); g_object_unref (keymap); - return 0; + return 0; fd = open (KEYBOARDPATH, O_RDONLY); @@ -48,7 +48,7 @@ int main (int argc, char **argv) } g_object_unref (keymap); - return 0; + return 0; } #endif diff --git a/src/test-keynames.c b/src/test-keynames.c index 629f4d323..f2db793a4 100644 --- a/src/test-keynames.c +++ b/src/test-keynames.c @@ -2,7 +2,7 @@ int main() { - g_assert_cmpstr (ibus_keyval_name (IBUS_Home), ==, "Home"); - g_assert (ibus_keyval_from_name ("Home") == IBUS_Home); - return 0; + g_assert_cmpstr (ibus_keyval_name (IBUS_Home), ==, "Home"); + g_assert (ibus_keyval_from_name ("Home") == IBUS_Home); + return 0; } diff --git a/src/test-lookuptable.c b/src/test-lookuptable.c index 521d0cc90..06cc96e4a 100644 --- a/src/test-lookuptable.c +++ b/src/test-lookuptable.c @@ -3,38 +3,38 @@ int main() { - g_type_init (); - IBusLookupTable *table, *table1; - IBusMessage *message; - IBusError *error; - gboolean retval; - - table = ibus_lookup_table_new (9, 0, TRUE, FALSE); - ibus_lookup_table_append_candidate (table, ibus_text_new_from_static_string ("Hello")); - ibus_lookup_table_append_candidate (table, ibus_text_new_from_static_string ("Cool")); - - message = ibus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); - - retval = ibus_message_append_args (message, - IBUS_TYPE_LOOKUP_TABLE, &table, - IBUS_TYPE_LOOKUP_TABLE, &table, - G_TYPE_INVALID); - g_assert (retval); - - g_object_unref (table); - table = table1 = NULL; - - retval = ibus_message_get_args (message, - &error, - IBUS_TYPE_LOOKUP_TABLE, &table, - IBUS_TYPE_LOOKUP_TABLE, &table1, - G_TYPE_INVALID); - g_assert (retval); - g_assert (table); - g_assert (table1); - - g_object_unref (table); - g_object_unref (table1); - - return 0; + g_type_init (); + IBusLookupTable *table, *table1; + IBusMessage *message; + IBusError *error; + gboolean retval; + + table = ibus_lookup_table_new (9, 0, TRUE, FALSE); + ibus_lookup_table_append_candidate (table, ibus_text_new_from_static_string ("Hello")); + ibus_lookup_table_append_candidate (table, ibus_text_new_from_static_string ("Cool")); + + message = ibus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); + + retval = ibus_message_append_args (message, + IBUS_TYPE_LOOKUP_TABLE, &table, + IBUS_TYPE_LOOKUP_TABLE, &table, + G_TYPE_INVALID); + g_assert (retval); + + g_object_unref (table); + table = table1 = NULL; + + retval = ibus_message_get_args (message, + &error, + IBUS_TYPE_LOOKUP_TABLE, &table, + IBUS_TYPE_LOOKUP_TABLE, &table1, + G_TYPE_INVALID); + g_assert (retval); + g_assert (table); + g_assert (table1); + + g_object_unref (table); + g_object_unref (table1); + + return 0; } diff --git a/src/test-proxy.c b/src/test-proxy.c index aedd73257..7bac66ac2 100644 --- a/src/test-proxy.c +++ b/src/test-proxy.c @@ -3,24 +3,24 @@ static _value_changed_cb (IBusConfig *config, gchar *section, gchar *name, GValue *value, gpointer data) { - g_debug ("value-changed %s %s", section, name); + g_debug ("value-changed %s %s", section, name); } int main() { - g_type_init (); + g_type_init (); - IBusBus *bus; - IBusConfig *config; + IBusBus *bus; + IBusConfig *config; - bus = ibus_bus_new (); - config = ibus_bus_get_config (bus); + bus = ibus_bus_new (); + config = ibus_bus_get_config (bus); - g_signal_connect (config, - "value-changed", - G_CALLBACK (_value_changed_cb), - NULL); - g_main_loop_run (g_main_loop_new (NULL, FALSE)); + g_signal_connect (config, + "value-changed", + G_CALLBACK (_value_changed_cb), + NULL); + g_main_loop_run (g_main_loop_new (NULL, FALSE)); - return 0; + return 0; } diff --git a/src/test-server.c b/src/test-server.c index 4e3708597..240b68bc5 100644 --- a/src/test-server.c +++ b/src/test-server.c @@ -3,28 +3,28 @@ void connection_destroy_cb (IBusConnection *connection, gpointer user_data) { - g_debug ("connnection %p destroyed", connection ); + g_debug ("connnection %p destroyed", connection ); } void new_connection_cb (IBusServer *server, IBusConnection *connection, gpointer user_data) { - g_debug ("new-connection %p", connection); - g_signal_connect (connection, "destroy", (GCallback) connection_destroy_cb, 0); + g_debug ("new-connection %p", connection); + g_signal_connect (connection, "destroy", (GCallback) connection_destroy_cb, 0); } int main() { - g_type_init (); + g_type_init (); - GMainLoop *mainloop; - IBusServer *server; + GMainLoop *mainloop; + IBusServer *server; - mainloop = g_main_loop_new (NULL, FALSE); - server = ibus_server_new (); - ibus_server_listen (server, "unix:abstract=/tmp/1234567"); - g_signal_connect (server, "new-connection", (GCallback) new_connection_cb, 0); + mainloop = g_main_loop_new (NULL, FALSE); + server = ibus_server_new (); + ibus_server_listen (server, "unix:abstract=/tmp/1234567"); + g_signal_connect (server, "new-connection", (GCallback) new_connection_cb, 0); - g_main_loop_run (mainloop); + g_main_loop_run (mainloop); - return 0; + return 0; } diff --git a/src/test-text.c b/src/test-text.c index 37bc3a625..bb16c0eac 100644 --- a/src/test-text.c +++ b/src/test-text.c @@ -2,41 +2,41 @@ int main() { - g_type_init (); - - IBusText *text1; - IBusText *text2; - IBusMessage *message; - IBusError *error; - gboolean retval; - - text1 = ibus_text_new_from_string ("Hello"); - text2 = ibus_text_new_from_static_string ("Hello"); - - message = ibus_message_new_signal ("/org/freedesktop/IBus", - "org.freedesktop.IBus", - "Test"); - - retval = ibus_message_append_args (message, - IBUS_TYPE_SERIALIZABLE, &text1, - IBUS_TYPE_SERIALIZABLE, &text2, - G_TYPE_INVALID); - g_assert (retval); - g_object_unref (text1); - g_object_unref (text2); - - retval = ibus_message_get_args (message, - &error, - IBUS_TYPE_SERIALIZABLE, &text1, - IBUS_TYPE_SERIALIZABLE, &text2, - G_TYPE_INVALID); - g_assert (retval); - g_assert_cmpstr (text1->text, ==, "Hello"); - g_assert_cmpstr (text2->text, ==, "Hello"); - - g_object_unref (text1); - g_object_unref (text2); - - return 0; + g_type_init (); + + IBusText *text1; + IBusText *text2; + IBusMessage *message; + IBusError *error; + gboolean retval; + + text1 = ibus_text_new_from_string ("Hello"); + text2 = ibus_text_new_from_static_string ("Hello"); + + message = ibus_message_new_signal ("/org/freedesktop/IBus", + "org.freedesktop.IBus", + "Test"); + + retval = ibus_message_append_args (message, + IBUS_TYPE_SERIALIZABLE, &text1, + IBUS_TYPE_SERIALIZABLE, &text2, + G_TYPE_INVALID); + g_assert (retval); + g_object_unref (text1); + g_object_unref (text2); + + retval = ibus_message_get_args (message, + &error, + IBUS_TYPE_SERIALIZABLE, &text1, + IBUS_TYPE_SERIALIZABLE, &text2, + G_TYPE_INVALID); + g_assert (retval); + g_assert_cmpstr (text1->text, ==, "Hello"); + g_assert_cmpstr (text2->text, ==, "Hello"); + + g_object_unref (text1); + g_object_unref (text2); + + return 0; } diff --git a/util/IMdkit/FrameMgr.c b/util/IMdkit/FrameMgr.c index 9b4979480..83c6177e2 100644 --- a/util/IMdkit/FrameMgr.c +++ b/util/IMdkit/FrameMgr.c @@ -66,9 +66,9 @@ typedef struct _FrameInst *FrameInst; typedef union { - int num; /* For BARRAY */ - FrameInst fi; /* For POINTER */ - Iter iter; /* For ITER */ + int num; /* For BARRAY */ + FrameInst fi; /* For POINTER */ + Iter iter; /* For ITER */ } ExtraDataRec, *ExtraData; typedef struct _Chain @@ -194,12 +194,12 @@ NO_VALUE : (it)->max_count) { \ Chain tmp; \ Chain cur = (cm)->top; \ - \ + \ while (cur) \ { \ tmp = cur->next; \ Xfree (cur); \ - cur = tmp; \ + cur = tmp; \ } \ } @@ -327,8 +327,8 @@ FmStatus _FrameMgrPutToken (FrameMgr fm, void *data, int data_size) fm->idx += 8; break; #endif - default: - break; + default: + break; } /*endswitch*/ _FrameMgrPutToken(fm, data, data_size); @@ -481,7 +481,7 @@ FmStatus _FrameMgrPutToken (FrameMgr fm, void *data, int data_size) case EOL: return FmEOD; default: - break; + break; } /*endswitch*/ return (FmStatus) NULL; /* Should never be reached */ @@ -524,8 +524,8 @@ FmStatus _FrameMgrGetToken (FrameMgr fm , void* data, int data_size) end = Swap64 (fm, *(CARD64 *) (fm->area + fm->idx)); break; #endif - default: - break; + default: + break; } /*endswitch*/ @@ -700,12 +700,12 @@ FmStatus _FrameMgrGetToken (FrameMgr fm , void* data, int data_size) return _FrameMgrGetToken (fm, data, data_size); case ITER: - return FmInvalidCall; /* if comes here, it's a bug! */ + return FmInvalidCall; /* if comes here, it's a bug! */ case EOL: return FmEOD; default: - break; + break; } /*endswitch*/ return (FmStatus) NULL; /* Should never be reached */ @@ -800,8 +800,8 @@ FmStatus FrameMgrSkipToken (FrameMgr fm, int skip_count) case EOL: return FmEOD; - default: - break; + default: + break; } /*endswitch*/ } @@ -1052,7 +1052,7 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info) } break; default: - break; + break; } /*endswitch*/ return ret_type; @@ -1080,7 +1080,7 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info) if (info) { register int offset; - register int iter_idx; + register int iter_idx; info->counter.is_byte_len = (((long) fi->template[fi->cur_no].data) & 0xFF) == FmCounterByte; @@ -1186,8 +1186,8 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info) else ret_type = sub_type; /*endif*/ - default: - break; + default: + break; } break; } @@ -1352,8 +1352,8 @@ static FmStatus FrameInstSetSize (FrameInst fi, int num) return FmSuccess; /*endif*/ break; - default: - break; + default: + break; } /*endswitch*/ i = _FrameInstIncrement(fi->template, i); @@ -1406,8 +1406,8 @@ static int FrameInstGetSize (FrameInst fi) return ret_size; /*endif*/ break; - default: - break; + default: + break; } /*endswitch*/ i = _FrameInstIncrement (fi->template, i); @@ -1453,8 +1453,8 @@ static FmStatus FrameInstSetIterCount (FrameInst fi, int num) /*endif*/ break; - default: - break; + default: + break; } /*endswitch*/ i = _FrameInstIncrement (fi->template, i); @@ -1597,7 +1597,7 @@ static void IterFree (Iter it) break; default: - break; + break; } /*endswitch*/ Xfree (it); @@ -1724,7 +1724,7 @@ static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info) ret_type = IterGetNextType (it, info); } /*endif*/ - return ret_type; + return ret_type; } case POINTER: @@ -1747,11 +1747,11 @@ static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info) ret_type = IterGetNextType (it, info); } /*endif*/ - return ret_type; + return ret_type; } default: - return (XimFrameType) NULL; + return (XimFrameType) NULL; } /*endswitch*/ return (XimFrameType) NULL; /* This should never occur */ @@ -1828,7 +1828,7 @@ static XimFrameType IterPeekNextType (Iter it, XimFrameTypeInfo info) } default: - break; + break; } /*endswitch*/ /* Reaching here is a bug! */ @@ -1951,7 +1951,7 @@ static FmStatus IterSetSize (Iter it, int num) return FmNoMoreData; default: - break; + break; } /*endswitch*/ return FmNoMoreData; @@ -2014,7 +2014,7 @@ static int IterGetSize (Iter it) return NO_VALID_FIELD; default: - break; + break; } /*endswitch*/ return NO_VALID_FIELD; @@ -2102,7 +2102,7 @@ static FmStatus IterSetIterCount (Iter it, int num) break; default: - break; + break; } /*endswitch*/ return FmNoMoreData; @@ -2197,7 +2197,7 @@ static int IterGetTotalSize (Iter it) break; default: - break; + break; } /*endswitch*/ return size; @@ -2228,7 +2228,7 @@ static void IterReset (Iter it) break; default: - break; + break; } /*endswitch*/ it->cur_no = 0; @@ -2319,7 +2319,7 @@ static int _FrameInstIncrement (XimFrame frame, int count) case ITER: return _FrameInstIncrement (frame, count + 1); default: - break; + break; } /*endswitch*/ return - 1; /* Error */ @@ -2365,7 +2365,7 @@ static int _FrameInstDecrement (XimFrame frame, int count) /*endwhile*/ return 0; default: - break; + break; } /*enswitch*/ return - 1; /* Error */ @@ -2459,7 +2459,7 @@ static int _FrameInstGetItemSize (FrameInst fi, int cur_no) } default: - break; + break; } /*endswitch*/ return NO_VALUE; diff --git a/util/IMdkit/FrameMgr.h b/util/IMdkit/FrameMgr.h index ce7ed50b0..cd39943e6 100644 --- a/util/IMdkit/FrameMgr.h +++ b/util/IMdkit/FrameMgr.h @@ -50,7 +50,7 @@ typedef enum BIT8 = 0x1, /* {CARD8* | INT8*} */ BIT16 = 0x2, /* {CARD16* | INT16*} */ BIT32 = 0x3, /* {CARD32* | INT32*} */ - BIT64 = 0x4, /* {CARD64* | INT64*} */ + BIT64 = 0x4, /* {CARD64* | INT64*} */ BARRAY = 0x5, /* int*, void* */ ITER = 0x6, /* int* */ POINTER = 0x7, /* specifies next item is a PTR_ITEM */ @@ -62,8 +62,8 @@ typedef enum * should also modify the logic in FrameMgr program. */ PADDING = 0x9, /* specifies that a padding is needed. - * This requires extra data in data field. - */ + * This requires extra data in data field. + */ EOL = 0xA, /* specifies the end of list */ COUNTER_BIT8 = COUNTER_MASK | 0x1, @@ -111,7 +111,7 @@ typedef struct _FrameMgr *FrameMgr; FrameMgr FrameMgrInit(XimFrame frame, char* area, Bool byte_swap); void FrameMgrInitWithData(FrameMgr fm, XimFrame frame, void* area, - Bool byte_swap); + Bool byte_swap); void FrameMgrFree(FrameMgr fm); FmStatus FrameMgrSetBuffer(FrameMgr, void*); FmStatus _FrameMgrPutToken(FrameMgr, void*, int); diff --git a/util/IMdkit/IMConn.c b/util/IMdkit/IMConn.c index 6d3658938..4d6bbf6ec 100644 --- a/util/IMdkit/IMConn.c +++ b/util/IMdkit/IMConn.c @@ -45,8 +45,8 @@ static void _IMCountVaList(va_list var, int *total_count) for (attr = va_arg (var, char*); attr; attr = va_arg (var, char*)) { - (void)va_arg (var, XIMArg *); - ++(*total_count); + (void)va_arg (var, XIMArg *); + ++(*total_count); } /*endfor*/ } @@ -58,8 +58,8 @@ static void _IMVaToNestedList(va_list var, int max_count, XIMArg **args_return) if (max_count <= 0) { - *args_return = (XIMArg *) NULL; - return; + *args_return = (XIMArg *) NULL; + return; } /*endif*/ @@ -71,9 +71,9 @@ static void _IMVaToNestedList(va_list var, int max_count, XIMArg **args_return) for (attr = va_arg (var, char*); attr; attr = va_arg (var, char *)) { - args->name = attr; - args->value = va_arg (var, XPointer); - args++; + args->name = attr; + args->value = va_arg (var, XPointer); + args++; } /*endfor*/ args->name = (char*)NULL; @@ -85,16 +85,16 @@ static char *_FindModifiers (XIMArg *args) while (args->name) { - if (strcmp (args->name, IMModifiers) == 0) - { - modifiers = args->value; - return modifiers; - } - else - { - args++; - } - /*endif*/ + if (strcmp (args->name, IMModifiers) == 0) + { + modifiers = args->value; + return modifiers; + } + else + { + args++; + } + /*endif*/ } /*endwhile*/ return NULL; @@ -106,18 +106,18 @@ XIMS _GetIMS (char *modifiers) extern IMMethodsRec Xi18n_im_methods; if ((ims = (XIMS) malloc (sizeof (XIMProtocolRec))) == (XIMS) NULL) - return ((XIMS) NULL); + return ((XIMS) NULL); /*endif*/ memset ((void *) ims, 0, sizeof (XIMProtocolRec)); if (modifiers == NULL - || - modifiers[0] == '\0' - || - strcmp (modifiers, "Xi18n") == 0) + || + modifiers[0] == '\0' + || + strcmp (modifiers, "Xi18n") == 0) { - ims->methods = &Xi18n_im_methods; - return ims; + ims->methods = &Xi18n_im_methods; + return ims; } /*endif*/ XFree (ims); @@ -154,15 +154,15 @@ XIMS IMOpenIM (Display *display, ...) XFree (args); if (ims->protocol == (void *) NULL) { - XFree (ims); - return (XIMS) NULL; + XFree (ims); + return (XIMS) NULL; } /*endif*/ ret = (ims->methods->openIM) (ims); if (ret == False) { - XFree (ims); - return (XIMS) NULL; + XFree (ims); + return (XIMS) NULL; } /*endif*/ return (XIMS) ims; diff --git a/util/IMdkit/IMValues.c b/util/IMdkit/IMValues.c index 687014a4c..2846685ed 100644 --- a/util/IMdkit/IMValues.c +++ b/util/IMdkit/IMValues.c @@ -44,8 +44,8 @@ static void _IMCountVaList (va_list var, int *total_count) for (attr = va_arg (var, char *); attr; attr = va_arg (var, char *)) { - (void)va_arg (var, XIMArg *); - ++(*total_count); + (void)va_arg (var, XIMArg *); + ++(*total_count); } /*endfor*/ } @@ -57,8 +57,8 @@ static void _IMVaToNestedList (va_list var, int max_count, XIMArg **args_return) if (max_count <= 0) { - *args_return = (XIMArg *) NULL; - return; + *args_return = (XIMArg *) NULL; + return; } /*endif*/ @@ -69,9 +69,9 @@ static void _IMVaToNestedList (va_list var, int max_count, XIMArg **args_return) /*endif*/ for (attr = va_arg (var, char *); attr; attr = va_arg (var, char *)) { - args->name = attr; - args->value = va_arg (var, XPointer); - args++; + args->name = attr; + args->value = va_arg (var, XPointer); + args++; } /*endfor*/ args->name = (char *) NULL; diff --git a/util/IMdkit/IMdkit.h b/util/IMdkit/IMdkit.h index 6f8d6730f..93956fb98 100644 --- a/util/IMdkit/IMdkit.h +++ b/util/IMdkit/IMdkit.h @@ -39,43 +39,43 @@ extern "C" { #endif /* IM Attributes Name */ -#define IMModifiers "modifiers" -#define IMServerWindow "serverWindow" -#define IMServerName "serverName" -#define IMServerTransport "serverTransport" -#define IMLocale "locale" -#define IMInputStyles "inputStyles" -#define IMProtocolHandler "protocolHandler" -#define IMOnKeysList "onKeysList" -#define IMOffKeysList "offKeysList" -#define IMEncodingList "encodingList" -#define IMFilterEventMask "filterEventMask" -#define IMProtocolDepend "protocolDepend" +#define IMModifiers "modifiers" +#define IMServerWindow "serverWindow" +#define IMServerName "serverName" +#define IMServerTransport "serverTransport" +#define IMLocale "locale" +#define IMInputStyles "inputStyles" +#define IMProtocolHandler "protocolHandler" +#define IMOnKeysList "onKeysList" +#define IMOffKeysList "offKeysList" +#define IMEncodingList "encodingList" +#define IMFilterEventMask "filterEventMask" +#define IMProtocolDepend "protocolDepend" /* Masks for IM Attributes Name */ -#define I18N_IMSERVER_WIN 0x0001 /* IMServerWindow */ -#define I18N_IM_NAME 0x0002 /* IMServerName */ -#define I18N_IM_LOCALE 0x0004 /* IMLocale */ -#define I18N_IM_ADDRESS 0x0008 /* IMServerTransport */ -#define I18N_INPUT_STYLES 0x0010 /* IMInputStyles */ -#define I18N_ON_KEYS 0x0020 /* IMOnKeysList */ -#define I18N_OFF_KEYS 0x0040 /* IMOffKeysList */ -#define I18N_IM_HANDLER 0x0080 /* IMProtocolHander */ -#define I18N_ENCODINGS 0x0100 /* IMEncodingList */ -#define I18N_FILTERMASK 0x0200 /* IMFilterEventMask */ -#define I18N_PROTO_DEPEND 0x0400 /* IMProtoDepend */ +#define I18N_IMSERVER_WIN 0x0001 /* IMServerWindow */ +#define I18N_IM_NAME 0x0002 /* IMServerName */ +#define I18N_IM_LOCALE 0x0004 /* IMLocale */ +#define I18N_IM_ADDRESS 0x0008 /* IMServerTransport */ +#define I18N_INPUT_STYLES 0x0010 /* IMInputStyles */ +#define I18N_ON_KEYS 0x0020 /* IMOnKeysList */ +#define I18N_OFF_KEYS 0x0040 /* IMOffKeysList */ +#define I18N_IM_HANDLER 0x0080 /* IMProtocolHander */ +#define I18N_ENCODINGS 0x0100 /* IMEncodingList */ +#define I18N_FILTERMASK 0x0200 /* IMFilterEventMask */ +#define I18N_PROTO_DEPEND 0x0400 /* IMProtoDepend */ typedef struct { - char *name; - XPointer value; + char *name; + XPointer value; } XIMArg; typedef struct { - CARD32 keysym; - CARD32 modifier; - CARD32 modifier_mask; + CARD32 keysym; + CARD32 modifier; + CARD32 modifier_mask; } XIMTriggerKey; typedef struct @@ -96,31 +96,31 @@ typedef struct _XIMS *XIMS; typedef struct { - void* (*setup) (Display *, XIMArg *); - Status (*openIM) (XIMS); - Status (*closeIM) (XIMS); - char* (*setIMValues) (XIMS, XIMArg *); - char* (*getIMValues) (XIMS, XIMArg *); - Status (*forwardEvent) (XIMS, XPointer); - Status (*commitString) (XIMS, XPointer); - int (*callCallback) (XIMS, XPointer); - int (*preeditStart) (XIMS, XPointer); - int (*preeditEnd) (XIMS, XPointer); - int (*syncXlib) (XIMS, XPointer); + void* (*setup) (Display *, XIMArg *); + Status (*openIM) (XIMS); + Status (*closeIM) (XIMS); + char* (*setIMValues) (XIMS, XIMArg *); + char* (*getIMValues) (XIMS, XIMArg *); + Status (*forwardEvent) (XIMS, XPointer); + Status (*commitString) (XIMS, XPointer); + int (*callCallback) (XIMS, XPointer); + int (*preeditStart) (XIMS, XPointer); + int (*preeditEnd) (XIMS, XPointer); + int (*syncXlib) (XIMS, XPointer); } IMMethodsRec, *IMMethods; typedef struct { - Display *display; - int screen; + Display *display; + int screen; } IMCoreRec, *IMCore; typedef struct _XIMS { - IMMethods methods; - IMCoreRec core; - Bool sync; - void *protocol; + IMMethods methods; + IMCoreRec core; + Bool sync; + void *protocol; } XIMProtocolRec; /* diff --git a/util/IMdkit/Xi18n.h b/util/IMdkit/Xi18n.h index 484cc624b..1b2a06b20 100644 --- a/util/IMdkit/Xi18n.h +++ b/util/IMdkit/Xi18n.h @@ -39,19 +39,19 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* * Minor Protocol Number for Extension Protocol */ -#define XIM_EXTENSION 128 -#define XIM_EXT_SET_EVENT_MASK (0x30) -#define XIM_EXT_FORWARD_KEYEVENT (0x32) -#define XIM_EXT_MOVE (0x33) -#define COMMON_EXTENSIONS_NUM 3 +#define XIM_EXTENSION 128 +#define XIM_EXT_SET_EVENT_MASK (0x30) +#define XIM_EXT_FORWARD_KEYEVENT (0x32) +#define XIM_EXT_MOVE (0x33) +#define COMMON_EXTENSIONS_NUM 3 #include #include "IMdkit.h" /* XI18N Valid Attribute Name Definition */ -#define ExtForwardKeyEvent "extForwardKeyEvent" -#define ExtMove "extMove" -#define ExtSetEventMask "extSetEventMask" +#define ExtForwardKeyEvent "extForwardKeyEvent" +#define ExtMove "extMove" +#define ExtSetEventMask "extSetEventMask" /* * Padding macro @@ -61,12 +61,12 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* * Target Atom for Transport Connection */ -#define LOCALES "LOCALES" -#define TRANSPORT "TRANSPORT" +#define LOCALES "LOCALES" +#define TRANSPORT "TRANSPORT" -#define I18N_OPEN 0 -#define I18N_SET 1 -#define I18N_GET 2 +#define I18N_OPEN 0 +#define I18N_SET 1 +#define I18N_GET 2 typedef struct { @@ -83,75 +83,75 @@ typedef struct _XIMPending typedef struct _XimProtoHdr { - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 length; + CARD8 major_opcode; + CARD8 minor_opcode; + CARD16 length; } XimProtoHdr; typedef struct { - CARD16 attribute_id; - CARD16 type; - CARD16 length; - char *name; + CARD16 attribute_id; + CARD16 type; + CARD16 length; + char *name; } XIMAttr; typedef struct { - CARD16 attribute_id; - CARD16 type; - CARD16 length; - char *name; + CARD16 attribute_id; + CARD16 type; + CARD16 length; + char *name; } XICAttr; typedef struct { - int attribute_id; - CARD16 name_length; - char *name; - int value_length; - void *value; - int type; + int attribute_id; + CARD16 name_length; + char *name; + int value_length; + void *value; + int type; } XIMAttribute; typedef struct { - int attribute_id; - CARD16 name_length; - char *name; - int value_length; - void *value; - int type; + int attribute_id; + CARD16 name_length; + char *name; + int value_length; + void *value; + int type; } XICAttribute; typedef struct { - int length; - char *name; + int length; + char *name; } XIMStr; typedef struct { - CARD16 major_opcode; - CARD16 minor_opcode; - CARD16 length; - char *name; + CARD16 major_opcode; + CARD16 minor_opcode; + CARD16 length; + char *name; } XIMExt; typedef struct _Xi18nClient { - int connect_id; - CARD8 byte_order; + int connect_id; + CARD8 byte_order; /* '?': initial value 'B': for Big-Endian 'l': for little-endian */ - int sync; + int sync; XIMPending *pending; /* property offset to read next data */ long property_offset; - void *trans_rec; /* contains transport specific data */ + void *trans_rec; /* contains transport specific data */ struct _Xi18nClient *next; } Xi18nClient; @@ -162,70 +162,70 @@ typedef struct _Xi18nCore *Xi18n; */ typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; + int major_code; + int minor_code; + CARD16 connect_id; } IMAnyStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD8 byte_order; - CARD16 major_version; - CARD16 minor_version; + int major_code; + int minor_code; + CARD16 connect_id; + CARD8 byte_order; + CARD16 major_version; + CARD16 minor_version; } IMConnectStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; + int major_code; + int minor_code; + CARD16 connect_id; } IMDisConnectStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - XIMStr lang; + int major_code; + int minor_code; + CARD16 connect_id; + XIMStr lang; } IMOpenStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; + int major_code; + int minor_code; + CARD16 connect_id; } IMCloseStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 number; - XIMStr *extension; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 number; + XIMStr *extension; } IMQueryExtensionStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 number; - char **im_attr_list; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 number; + char **im_attr_list; } IMGetIMValuesStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD16 preedit_attr_num; - CARD16 status_attr_num; - CARD16 ic_attr_num; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD16 preedit_attr_num; + CARD16 status_attr_num; + CARD16 ic_attr_num; XICAttribute *preedit_attr; XICAttribute *status_attr; XICAttribute *ic_attr; @@ -233,186 +233,186 @@ typedef struct typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; } IMDestroyICStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD16 length; - char *commit_string; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD16 length; + char *commit_string; } IMResetICStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; } IMChangeFocusStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - BITMASK16 sync_bit; - CARD16 serial_number; - XEvent event; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + BITMASK16 sync_bit; + CARD16 serial_number; + XEvent event; } IMForwardEventStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD16 flag; - KeySym keysym; - char *commit_string; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD16 flag; + KeySym keysym; + char *commit_string; } IMCommitStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD32 flag; - CARD32 key_index; - CARD32 event_mask; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD32 flag; + CARD32 key_index; + CARD32 event_mask; } IMTriggerNotifyStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 encoding_number; - XIMStr *encoding; /* name information */ - CARD16 encoding_info_number; - XIMStr *encodinginfo; /* detailed information */ - CARD16 category; /* #0 for name, #1 for detail */ - INT16 enc_index; /* index of the encoding determined */ + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 encoding_number; + XIMStr *encoding; /* name information */ + CARD16 encoding_info_number; + XIMStr *encodinginfo; /* detailed information */ + CARD16 category; /* #0 for name, #1 for detail */ + INT16 enc_index; /* index of the encoding determined */ } IMEncodingNegotiationStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD32 flag; - CARD32 forward_event_mask; - CARD32 sync_event_mask; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD32 flag; + CARD32 forward_event_mask; + CARD32 sync_event_mask; } IMSetEventMaskStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD32 filter_event_mask; - CARD32 intercept_event_mask; - CARD32 select_event_mask; - CARD32 forward_event_mask; - CARD32 sync_event_mask; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD32 filter_event_mask; + CARD32 intercept_event_mask; + CARD32 select_event_mask; + CARD32 forward_event_mask; + CARD32 sync_event_mask; } IMExtSetEventMaskStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - CARD16 x; - CARD16 y; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + CARD16 x; + CARD16 y; } IMMoveStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; - BITMASK16 flag; - CARD16 error_code; - CARD16 str_length; - CARD16 error_type; - char *error_detail; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; + BITMASK16 flag; + CARD16 error_code; + CARD16 str_length; + CARD16 error_type; + char *error_detail; } IMErrorStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; } IMPreeditStateStruct; /* Callbacks */ typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; } IMGeometryCBStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; union { - int return_value; /* PreeditStart */ - XIMPreeditDrawCallbackStruct draw; /* PreeditDraw */ - XIMPreeditCaretCallbackStruct caret; /* PreeditCaret */ + int return_value; /* PreeditStart */ + XIMPreeditDrawCallbackStruct draw; /* PreeditDraw */ + XIMPreeditCaretCallbackStruct caret; /* PreeditCaret */ } todo; } IMPreeditCBStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; union { - XIMStatusDrawCallbackStruct draw; /* StatusDraw */ + XIMStatusDrawCallbackStruct draw; /* StatusDraw */ } todo; } IMStatusCBStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; XIMStringConversionCallbackStruct strconv; } IMStrConvCBStruct; typedef struct { - int major_code; - int minor_code; - CARD16 connect_id; - CARD16 icid; + int major_code; + int minor_code; + CARD16 connect_id; + CARD16 icid; } IMSyncXlibStruct; typedef union _IMProtocol { - int major_code; + int major_code; IMAnyStruct any; IMConnectStruct imconnect; IMDisConnectStruct imdisconnect; @@ -443,42 +443,42 @@ typedef union _IMProtocol typedef int (*IMProtoHandler) (XIMS, IMProtocol*); -#define DEFAULT_FILTER_MASK (KeyPressMask) +#define DEFAULT_FILTER_MASK (KeyPressMask) /* Xi18nAddressRec structure */ typedef struct _Xi18nAddressRec { - Display *dpy; - CARD8 im_byteOrder; /* byte order 'B' or 'l' */ + Display *dpy; + CARD8 im_byteOrder; /* byte order 'B' or 'l' */ /* IM Values */ - long imvalue_mask; - Window im_window; /* IMServerWindow */ - char *im_name; /* IMServerName */ - char *im_locale; /* IMLocale */ - char *im_addr; /* IMServerTransport */ - XIMStyles input_styles; /* IMInputStyles */ - XIMTriggerKeys on_keys; /* IMOnKeysList */ - XIMTriggerKeys off_keys; /* IMOffKeysList */ + long imvalue_mask; + Window im_window; /* IMServerWindow */ + char *im_name; /* IMServerName */ + char *im_locale; /* IMLocale */ + char *im_addr; /* IMServerTransport */ + XIMStyles input_styles; /* IMInputStyles */ + XIMTriggerKeys on_keys; /* IMOnKeysList */ + XIMTriggerKeys off_keys; /* IMOffKeysList */ XIMEncodings encoding_list; /* IMEncodingList */ - IMProtoHandler improto; /* IMProtocolHander */ - long filterevent_mask; /* IMFilterEventMask */ + IMProtoHandler improto; /* IMProtocolHander */ + long filterevent_mask; /* IMFilterEventMask */ /* XIM_SERVERS target Atoms */ - Atom selection; - Atom Localename; - Atom Transportname; + Atom selection; + Atom Localename; + Atom Transportname; /* XIM/XIC Attr */ - int im_attr_num; - XIMAttr *xim_attr; - int ic_attr_num; - XICAttr *xic_attr; - CARD16 preeditAttr_id; - CARD16 statusAttr_id; - CARD16 separatorAttr_id; + int im_attr_num; + XIMAttr *xim_attr; + int ic_attr_num; + XICAttr *xic_attr; + CARD16 preeditAttr_id; + CARD16 statusAttr_id; + CARD16 separatorAttr_id; /* XIMExtension List */ - int ext_num; - XIMExt extension[COMMON_EXTENSIONS_NUM]; + int ext_num; + XIMExt extension[COMMON_EXTENSIONS_NUM]; /* transport specific connection address */ - void *connect_addr; + void *connect_addr; /* actual data is defined: XSpecRec in Xi18nX.h for X-based connection. TransSpecRec in Xi18nTr.h for Socket-based connection. diff --git a/util/IMdkit/Xi18nX.h b/util/IMdkit/Xi18nX.h index ff91b1ac6..9b9deeea3 100644 --- a/util/IMdkit/Xi18nX.h +++ b/util/IMdkit/Xi18nX.h @@ -35,18 +35,18 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define _XIM_PROTOCOL "_XIM_PROTOCOL" #define _XIM_XCONNECT "_XIM_XCONNECT" -#define XCM_DATA_LIMIT 20 +#define XCM_DATA_LIMIT 20 typedef struct _XClient { - Window client_win; /* client window */ - Window accept_win; /* accept window */ + Window client_win; /* client window */ + Window accept_win; /* accept window */ } XClient; typedef struct { - Atom xim_request; - Atom connect_request; + Atom xim_request; + Atom connect_request; } XSpecRec; #endif diff --git a/util/IMdkit/XimFunc.h b/util/IMdkit/XimFunc.h index a9f4a0421..a530c8da7 100644 --- a/util/IMdkit/XimFunc.h +++ b/util/IMdkit/XimFunc.h @@ -65,8 +65,8 @@ void _Xi18nSetEventMask (XIMS ims, CARD16 connect_id, CARD16 im_id, /* Xlib internal */ void _XRegisterFilterByType(Display*, Window, int, int, - Bool (*filter)(Display*, Window, XEvent*, XPointer), XPointer); + Bool (*filter)(Display*, Window, XEvent*, XPointer), XPointer); void _XUnregisterFilter(Display*, Window, - Bool (*filter)(Display*, Window, XEvent*, XPointer), XPointer); + Bool (*filter)(Display*, Window, XEvent*, XPointer), XPointer); #endif diff --git a/util/IMdkit/XimProto.h b/util/IMdkit/XimProto.h index e3ed168c6..a0195750b 100644 --- a/util/IMdkit/XimProto.h +++ b/util/IMdkit/XimProto.h @@ -35,195 +35,195 @@ PERFORMANCE OF THIS SOFTWARE. /* * Default Preconnection selection target */ -#define XIM_SERVERS "XIM_SERVERS" -#define XIM_LOCALES "LOCALES" -#define XIM_TRANSPORT "TRANSPORT" +#define XIM_SERVERS "XIM_SERVERS" +#define XIM_LOCALES "LOCALES" +#define XIM_TRANSPORT "TRANSPORT" /* * categories in XIM_SERVERS */ -#define XIM_SERVER_CATEGORY "@server=" -#define XIM_LOCAL_CATEGORY "@locale=" -#define XIM_TRANSPORT_CATEGORY "@transport=" +#define XIM_SERVER_CATEGORY "@server=" +#define XIM_LOCAL_CATEGORY "@locale=" +#define XIM_TRANSPORT_CATEGORY "@transport=" /* * Xim implementation revision */ -#define PROTOCOLMAJORVERSION 0 -#define PROTOCOLMINORVERSION 0 +#define PROTOCOLMAJORVERSION 0 +#define PROTOCOLMINORVERSION 0 /* * Major Protocol number */ -#define XIM_CONNECT 1 -#define XIM_CONNECT_REPLY 2 -#define XIM_DISCONNECT 3 -#define XIM_DISCONNECT_REPLY 4 - -#define XIM_AUTH_REQUIRED 10 -#define XIM_AUTH_REPLY 11 -#define XIM_AUTH_NEXT 12 -#define XIM_AUTH_SETUP 13 -#define XIM_AUTH_NG 14 - -#define XIM_ERROR 20 - -#define XIM_OPEN 30 -#define XIM_OPEN_REPLY 31 -#define XIM_CLOSE 32 -#define XIM_CLOSE_REPLY 33 -#define XIM_REGISTER_TRIGGERKEYS 34 -#define XIM_TRIGGER_NOTIFY 35 -#define XIM_TRIGGER_NOTIFY_REPLY 36 -#define XIM_SET_EVENT_MASK 37 -#define XIM_ENCODING_NEGOTIATION 38 -#define XIM_ENCODING_NEGOTIATION_REPLY 39 -#define XIM_QUERY_EXTENSION 40 -#define XIM_QUERY_EXTENSION_REPLY 41 -#define XIM_SET_IM_VALUES 42 -#define XIM_SET_IM_VALUES_REPLY 43 -#define XIM_GET_IM_VALUES 44 -#define XIM_GET_IM_VALUES_REPLY 45 - -#define XIM_CREATE_IC 50 -#define XIM_CREATE_IC_REPLY 51 -#define XIM_DESTROY_IC 52 -#define XIM_DESTROY_IC_REPLY 53 -#define XIM_SET_IC_VALUES 54 -#define XIM_SET_IC_VALUES_REPLY 55 -#define XIM_GET_IC_VALUES 56 -#define XIM_GET_IC_VALUES_REPLY 57 -#define XIM_SET_IC_FOCUS 58 -#define XIM_UNSET_IC_FOCUS 59 -#define XIM_FORWARD_EVENT 60 -#define XIM_SYNC 61 -#define XIM_SYNC_REPLY 62 -#define XIM_COMMIT 63 -#define XIM_RESET_IC 64 -#define XIM_RESET_IC_REPLY 65 - -#define XIM_GEOMETRY 70 -#define XIM_STR_CONVERSION 71 -#define XIM_STR_CONVERSION_REPLY 72 -#define XIM_PREEDIT_START 73 -#define XIM_PREEDIT_START_REPLY 74 -#define XIM_PREEDIT_DRAW 75 -#define XIM_PREEDIT_CARET 76 -#define XIM_PREEDIT_CARET_REPLY 77 -#define XIM_PREEDIT_DONE 78 -#define XIM_STATUS_START 79 -#define XIM_STATUS_DRAW 80 -#define XIM_STATUS_DONE 81 +#define XIM_CONNECT 1 +#define XIM_CONNECT_REPLY 2 +#define XIM_DISCONNECT 3 +#define XIM_DISCONNECT_REPLY 4 + +#define XIM_AUTH_REQUIRED 10 +#define XIM_AUTH_REPLY 11 +#define XIM_AUTH_NEXT 12 +#define XIM_AUTH_SETUP 13 +#define XIM_AUTH_NG 14 + +#define XIM_ERROR 20 + +#define XIM_OPEN 30 +#define XIM_OPEN_REPLY 31 +#define XIM_CLOSE 32 +#define XIM_CLOSE_REPLY 33 +#define XIM_REGISTER_TRIGGERKEYS 34 +#define XIM_TRIGGER_NOTIFY 35 +#define XIM_TRIGGER_NOTIFY_REPLY 36 +#define XIM_SET_EVENT_MASK 37 +#define XIM_ENCODING_NEGOTIATION 38 +#define XIM_ENCODING_NEGOTIATION_REPLY 39 +#define XIM_QUERY_EXTENSION 40 +#define XIM_QUERY_EXTENSION_REPLY 41 +#define XIM_SET_IM_VALUES 42 +#define XIM_SET_IM_VALUES_REPLY 43 +#define XIM_GET_IM_VALUES 44 +#define XIM_GET_IM_VALUES_REPLY 45 + +#define XIM_CREATE_IC 50 +#define XIM_CREATE_IC_REPLY 51 +#define XIM_DESTROY_IC 52 +#define XIM_DESTROY_IC_REPLY 53 +#define XIM_SET_IC_VALUES 54 +#define XIM_SET_IC_VALUES_REPLY 55 +#define XIM_GET_IC_VALUES 56 +#define XIM_GET_IC_VALUES_REPLY 57 +#define XIM_SET_IC_FOCUS 58 +#define XIM_UNSET_IC_FOCUS 59 +#define XIM_FORWARD_EVENT 60 +#define XIM_SYNC 61 +#define XIM_SYNC_REPLY 62 +#define XIM_COMMIT 63 +#define XIM_RESET_IC 64 +#define XIM_RESET_IC_REPLY 65 + +#define XIM_GEOMETRY 70 +#define XIM_STR_CONVERSION 71 +#define XIM_STR_CONVERSION_REPLY 72 +#define XIM_PREEDIT_START 73 +#define XIM_PREEDIT_START_REPLY 74 +#define XIM_PREEDIT_DRAW 75 +#define XIM_PREEDIT_CARET 76 +#define XIM_PREEDIT_CARET_REPLY 77 +#define XIM_PREEDIT_DONE 78 +#define XIM_STATUS_START 79 +#define XIM_STATUS_DRAW 80 +#define XIM_STATUS_DONE 81 /* * values for the flag of XIM_ERROR */ -#define XIM_IMID_VALID 0x0001 -#define XIM_ICID_VALID 0x0002 +#define XIM_IMID_VALID 0x0001 +#define XIM_ICID_VALID 0x0002 /* * XIM Error Code */ -#define XIM_BadAlloc 1 -#define XIM_BadStyle 2 -#define XIM_BadClientWindow 3 -#define XIM_BadFocusWindow 4 -#define XIM_BadArea 5 -#define XIM_BadSpotLocation 6 -#define XIM_BadColormap 7 -#define XIM_BadAtom 8 -#define XIM_BadPixel 9 -#define XIM_BadPixmap 10 -#define XIM_BadName 11 -#define XIM_BadCursor 12 -#define XIM_BadProtocol 13 -#define XIM_BadForeground 14 -#define XIM_BadBackground 15 -#define XIM_LocaleNotSupported 16 -#define XIM_BadSomething 999 +#define XIM_BadAlloc 1 +#define XIM_BadStyle 2 +#define XIM_BadClientWindow 3 +#define XIM_BadFocusWindow 4 +#define XIM_BadArea 5 +#define XIM_BadSpotLocation 6 +#define XIM_BadColormap 7 +#define XIM_BadAtom 8 +#define XIM_BadPixel 9 +#define XIM_BadPixmap 10 +#define XIM_BadName 11 +#define XIM_BadCursor 12 +#define XIM_BadProtocol 13 +#define XIM_BadForeground 14 +#define XIM_BadBackground 15 +#define XIM_LocaleNotSupported 16 +#define XIM_BadSomething 999 /* * byte order */ -#define BIGENDIAN (CARD8) 0x42 /* MSB first */ -#define LITTLEENDIAN (CARD8) 0x6c /* LSB first */ +#define BIGENDIAN (CARD8) 0x42 /* MSB first */ +#define LITTLEENDIAN (CARD8) 0x6c /* LSB first */ /* * values for the type of XIMATTR & XICATTR */ -#define XimType_SeparatorOfNestedList 0 -#define XimType_CARD8 1 -#define XimType_CARD16 2 -#define XimType_CARD32 3 -#define XimType_STRING8 4 -#define XimType_Window 5 -#define XimType_XIMStyles 10 -#define XimType_XRectangle 11 -#define XimType_XPoint 12 -#define XimType_XFontSet 13 -#define XimType_XIMOptions 14 -#define XimType_XIMHotKeyTriggers 15 -#define XimType_XIMHotKeyState 16 -#define XimType_XIMStringConversion 17 -#define XimType_XIMValuesList 18 -#define XimType_NEST 0x7FFF +#define XimType_SeparatorOfNestedList 0 +#define XimType_CARD8 1 +#define XimType_CARD16 2 +#define XimType_CARD32 3 +#define XimType_STRING8 4 +#define XimType_Window 5 +#define XimType_XIMStyles 10 +#define XimType_XRectangle 11 +#define XimType_XPoint 12 +#define XimType_XFontSet 13 +#define XimType_XIMOptions 14 +#define XimType_XIMHotKeyTriggers 15 +#define XimType_XIMHotKeyState 16 +#define XimType_XIMStringConversion 17 +#define XimType_XIMValuesList 18 +#define XimType_NEST 0x7FFF /* * values for the category of XIM_ENCODING_NEGOTIATON_REPLY */ -#define XIM_Encoding_NameCategory 0 -#define XIM_Encoding_DetailCategory 1 +#define XIM_Encoding_NameCategory 0 +#define XIM_Encoding_DetailCategory 1 /* * value for the index of XIM_ENCODING_NEGOTIATON_REPLY */ -#define XIM_Default_Encoding_IDX -1 +#define XIM_Default_Encoding_IDX -1 /* * value for the flag of XIM_FORWARD_EVENT, XIM_COMMIT */ -#define XimSYNCHRONUS 0x0001 -#define XimLookupChars 0x0002 -#define XimLookupKeySym 0x0004 -#define XimLookupBoth 0x0006 +#define XimSYNCHRONUS 0x0001 +#define XimLookupChars 0x0002 +#define XimLookupKeySym 0x0004 +#define XimLookupBoth 0x0006 /* * request packet header size */ -#define XIM_HEADER_SIZE \ - sizeof(CARD8) /* sizeof mejor-opcode */ \ - + sizeof(CARD8) /* sizeof minor-opcode */ \ - + sizeof(INT16) /* sizeof length */ +#define XIM_HEADER_SIZE \ + sizeof(CARD8) /* sizeof mejor-opcode */ \ + + sizeof(CARD8) /* sizeof minor-opcode */ \ + + sizeof(INT16) /* sizeof length */ /* * Client Message data size */ -#define XIM_CM_DATA_SIZE 20 +#define XIM_CM_DATA_SIZE 20 /* * XIM data structure */ -typedef CARD16 BITMASK16; -typedef CARD32 BITMASK32; -typedef CARD32 EVENTMASK; +typedef CARD16 BITMASK16; +typedef CARD32 BITMASK32; +typedef CARD32 EVENTMASK; -typedef CARD16 XIMID; /* Input Method ID */ -typedef CARD16 XICID; /* Input Context ID */ +typedef CARD16 XIMID; /* Input Method ID */ +typedef CARD16 XICID; /* Input Context ID */ /* * Padding macro */ -#define XIM_PAD(length) ((4 - ((length) % 4)) % 4) - -#define XIM_SET_PAD(ptr, length) \ - { \ - register int Counter = XIM_PAD((int)length); \ - if (Counter) { \ - register char *Ptr = (char *)(ptr) + (length); \ - length += Counter; \ - for (; Counter; --Counter, ++Ptr) \ - *Ptr = '\0'; \ - } \ +#define XIM_PAD(length) ((4 - ((length) % 4)) % 4) + +#define XIM_SET_PAD(ptr, length) \ + { \ + register int Counter = XIM_PAD((int)length); \ + if (Counter) { \ + register char *Ptr = (char *)(ptr) + (length); \ + length += Counter; \ + for (; Counter; --Counter, ++Ptr) \ + *Ptr = '\0'; \ + } \ } #endif diff --git a/util/IMdkit/Xtrans.h b/util/IMdkit/Xtrans.h index cae691c15..5b6ab1bdb 100644 --- a/util/IMdkit/Xtrans.h +++ b/util/IMdkit/Xtrans.h @@ -138,10 +138,10 @@ from the X Consortium. * This structure needs to be independent of the socket/TLI interface used. */ -#define XTRANS_MAX_ADDR_LEN 128 /* large enough to hold sun_path */ +#define XTRANS_MAX_ADDR_LEN 128 /* large enough to hold sun_path */ -typedef struct { - unsigned char addr[XTRANS_MAX_ADDR_LEN]; +typedef struct { + unsigned char addr[XTRANS_MAX_ADDR_LEN]; } Xtransaddr; @@ -176,15 +176,15 @@ typedef struct _XtransConnInfo *XtransConnInfo; * Transport Option definitions */ -#define TRANS_NONBLOCKING 1 -#define TRANS_CLOSEONEXEC 2 +#define TRANS_NONBLOCKING 1 +#define TRANS_CLOSEONEXEC 2 /* * Return values of Connect (0 is success) */ -#define TRANS_CONNECT_FAILED -1 +#define TRANS_CONNECT_FAILED -1 #define TRANS_TRY_CONNECT_AGAIN -2 @@ -192,18 +192,18 @@ typedef struct _XtransConnInfo *XtransConnInfo; * Return values of Accept (0 is success) */ -#define TRANS_ACCEPT_BAD_MALLOC -1 -#define TRANS_ACCEPT_FAILED -2 -#define TRANS_ACCEPT_MISC_ERROR -3 +#define TRANS_ACCEPT_BAD_MALLOC -1 +#define TRANS_ACCEPT_FAILED -2 +#define TRANS_ACCEPT_MISC_ERROR -3 /* * ResetListener return values */ -#define TRANS_RESET_NOOP 1 -#define TRANS_RESET_NEW_FD 2 -#define TRANS_RESET_FAILURE 3 +#define TRANS_RESET_NOOP 1 +#define TRANS_RESET_NEW_FD 2 +#define TRANS_RESET_FAILURE 3 /* @@ -214,7 +214,7 @@ typedef struct _XtransConnInfo *XtransConnInfo; XtransConnInfo TRANS(OpenCOTSClient)( #if NeedFunctionPrototypes - char * /* address */ + char * /* address */ #endif ); @@ -224,7 +224,7 @@ XtransConnInfo TRANS(OpenCOTSClient)( XtransConnInfo TRANS(OpenCOTSServer)( #if NeedFunctionPrototypes - char * /* address */ + char * /* address */ #endif ); @@ -234,7 +234,7 @@ XtransConnInfo TRANS(OpenCOTSServer)( XtransConnInfo TRANS(OpenCLTSClient)( #if NeedFunctionPrototypes - char * /* address */ + char * /* address */ #endif ); @@ -244,7 +244,7 @@ XtransConnInfo TRANS(OpenCLTSClient)( XtransConnInfo TRANS(OpenCLTSServer)( #if NeedFunctionPrototypes - char * /* address */ + char * /* address */ #endif ); @@ -254,26 +254,26 @@ XtransConnInfo TRANS(OpenCLTSServer)( XtransConnInfo TRANS(ReopenCOTSServer)( #if NeedFunctionPrototypes - int, /* trans_id */ - int, /* fd */ - char * /* port */ + int, /* trans_id */ + int, /* fd */ + char * /* port */ #endif ); XtransConnInfo TRANS(ReopenCLTSServer)( #if NeedFunctionPrototypes - int, /* trans_id */ - int, /* fd */ - char * /* port */ + int, /* trans_id */ + int, /* fd */ + char * /* port */ #endif ); int TRANS(GetReopenInfo)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - int *, /* trans_id */ - int *, /* fd */ - char ** /* port */ + XtransConnInfo, /* ciptr */ + int *, /* trans_id */ + int *, /* fd */ + char ** /* port */ #endif ); @@ -282,9 +282,9 @@ int TRANS(GetReopenInfo)( int TRANS(SetOption)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - int, /* option */ - int /* arg */ + XtransConnInfo, /* ciptr */ + int, /* option */ + int /* arg */ #endif ); @@ -292,21 +292,21 @@ int TRANS(SetOption)( int TRANS(CreateListener)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - char * /* port */ + XtransConnInfo, /* ciptr */ + char * /* port */ #endif ); int TRANS(ResetListener)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); XtransConnInfo TRANS(Accept)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - int * /* status */ + XtransConnInfo, /* ciptr */ + int * /* status */ #endif ); @@ -316,8 +316,8 @@ XtransConnInfo TRANS(Accept)( int TRANS(Connect)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - char * /* address */ + XtransConnInfo, /* ciptr */ + char * /* address */ #endif ); @@ -325,88 +325,88 @@ int TRANS(Connect)( int TRANS(BytesReadable)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - BytesReadable_t * /* pend */ + XtransConnInfo, /* ciptr */ + BytesReadable_t * /* pend */ #endif ); int TRANS(Read)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - char *, /* buf */ - int /* size */ + XtransConnInfo, /* ciptr */ + char *, /* buf */ + int /* size */ #endif ); int TRANS(Write)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - char *, /* buf */ - int /* size */ + XtransConnInfo, /* ciptr */ + char *, /* buf */ + int /* size */ #endif ); int TRANS(Readv)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - struct iovec *, /* buf */ - int /* size */ + XtransConnInfo, /* ciptr */ + struct iovec *, /* buf */ + int /* size */ #endif ); int TRANS(Writev)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - struct iovec *, /* buf */ - int /* size */ + XtransConnInfo, /* ciptr */ + struct iovec *, /* buf */ + int /* size */ #endif ); int TRANS(Disconnect)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); int TRANS(Close)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); int TRANS(CloseForCloning)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); int TRANS(IsLocal)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); int TRANS(GetMyAddr)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - int *, /* familyp */ - int *, /* addrlenp */ - Xtransaddr ** /* addrp */ + XtransConnInfo, /* ciptr */ + int *, /* familyp */ + int *, /* addrlenp */ + Xtransaddr ** /* addrp */ #endif ); int TRANS(GetPeerAddr)( #if NeedFunctionPrototypes - XtransConnInfo, /* ciptr */ - int *, /* familyp */ - int *, /* addrlenp */ - Xtransaddr ** /* addrp */ + XtransConnInfo, /* ciptr */ + int *, /* familyp */ + int *, /* addrlenp */ + Xtransaddr ** /* addrp */ #endif ); int TRANS(GetConnectionNumber)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); @@ -414,19 +414,19 @@ int TRANS(GetConnectionNumber)( int TRANS(MakeAllCOTSServerListeners)( #if NeedFunctionPrototypes - char *, /* port */ - int *, /* partial */ - int *, /* count_ret */ - XtransConnInfo ** /* ciptrs_ret */ + char *, /* port */ + int *, /* partial */ + int *, /* count_ret */ + XtransConnInfo ** /* ciptrs_ret */ #endif ); int TRANS(MakeAllCLTSServerListeners)( #if NeedFunctionPrototypes - char *, /* port */ - int *, /* partial */ - int *, /* count_ret */ - XtransConnInfo ** /* ciptrs_ret */ + char *, /* port */ + int *, /* partial */ + int *, /* count_ret */ + XtransConnInfo ** /* ciptrs_ret */ #endif ); @@ -441,9 +441,9 @@ int TRANS(MakeAllCLTSServerListeners)( int TRANS(ConvertAddress)( #if NeedFunctionPrototypes - int *, /* familyp */ - int *, /* addrlenp */ - Xtransaddr * /* addrp */ + int *, /* familyp */ + int *, /* addrlenp */ + Xtransaddr * /* addrp */ #endif ); @@ -454,14 +454,14 @@ int TRANS(ConvertAddress)( char * TRANS(GetMyNetworkId)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); char * TRANS(GetPeerNetworkId)( #if NeedFunctionPrototypes - XtransConnInfo /* ciptr */ + XtransConnInfo /* ciptr */ #endif ); diff --git a/util/IMdkit/i18nAttr.c b/util/IMdkit/i18nAttr.c index a52370bcf..b13eea65d 100644 --- a/util/IMdkit/i18nAttr.c +++ b/util/IMdkit/i18nAttr.c @@ -51,7 +51,7 @@ typedef struct IMListOfAttr Default_IMattr[] = { {XNQueryInputStyle, XimType_XIMStyles}, -/* {XNQueryIMValuesList, XimType_XIMValuesList}, */ +/* {XNQueryIMValuesList, XimType_XIMValuesList}, */ {(char *) NULL, (CARD16) 0} }; @@ -136,7 +136,7 @@ static XIMAttr *CreateAttrList (Xi18n i18n_core, void _Xi18nInitAttrList (Xi18n i18n_core) { XIMAttr *args; - int total_count; + int total_count; /* init IMAttr list */ if (i18n_core->address.xim_attr) diff --git a/util/IMdkit/i18nIMProto.c b/util/IMdkit/i18nIMProto.c index 618da9d6d..48e568c3d 100644 --- a/util/IMdkit/i18nIMProto.c +++ b/util/IMdkit/i18nIMProto.c @@ -24,7 +24,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Author: Hiroyuki Miyamoto Digital Equipment Corporation miyamoto@jrd.dec.com - Hidetoshi Tajima(tajima@Eng.Sun.COM) Sun Microsystems, Inc. + Hidetoshi Tajima(tajima@Eng.Sun.COM) Sun Microsystems, Inc. This version tidied and debugged by Steve Underwood May 1999 @@ -38,28 +38,28 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. static XimFrameRec ximattr_fr[] = { - _FRAME(BIT16), /* attribute ID */ - _FRAME(BIT16), /* type of the value */ - _FRAME(BIT16), /* length of im-attribute */ - _FRAME(BARRAY), /* im-attribute */ + _FRAME(BIT16), /* attribute ID */ + _FRAME(BIT16), /* type of the value */ + _FRAME(BIT16), /* length of im-attribute */ + _FRAME(BARRAY), /* im-attribute */ _PAD4(2), _FRAME(EOL), }; static XimFrameRec xicattr_fr[] = { - _FRAME(BIT16), /* attribute ID */ - _FRAME(BIT16), /* type of the value */ - _FRAME(BIT16), /* length of ic-attribute */ - _FRAME(BARRAY), /* ic-attribute */ + _FRAME(BIT16), /* attribute ID */ + _FRAME(BIT16), /* type of the value */ + _FRAME(BIT16), /* length of ic-attribute */ + _FRAME(BARRAY), /* ic-attribute */ _PAD4(2), _FRAME(EOL), }; static XimFrameRec ximattribute_fr[] = { - _FRAME(BIT16), /* attribute ID */ - _FRAME(BIT16), /* value length */ + _FRAME(BIT16), /* attribute ID */ + _FRAME(BIT16), /* value length */ _FRAME(BARRAY), /* value */ _PAD4(1), _FRAME(EOL), @@ -67,8 +67,8 @@ static XimFrameRec ximattribute_fr[] = static XimFrameRec xicattribute_fr[] = { - _FRAME(BIT16), /* attribute ID */ - _FRAME(BIT16), /* value length */ + _FRAME(BIT16), /* attribute ID */ + _FRAME(BIT16), /* value length */ _FRAME(BARRAY), /* value */ _PAD4(1), _FRAME(EOL), @@ -76,99 +76,99 @@ static XimFrameRec xicattribute_fr[] = static XimFrameRec ximtriggerkey_fr[] = { - _FRAME(BIT32), /* keysym */ - _FRAME(BIT32), /* modifier */ - _FRAME(BIT32), /* modifier mask */ + _FRAME(BIT32), /* keysym */ + _FRAME(BIT32), /* modifier */ + _FRAME(BIT32), /* modifier mask */ _FRAME(EOL), }; static XimFrameRec encodinginfo_fr[] = { - _FRAME(BIT16), /* length of encoding info */ - _FRAME(BARRAY), /* encoding info */ + _FRAME(BIT16), /* length of encoding info */ + _FRAME(BARRAY), /* encoding info */ _PAD4(2), _FRAME(EOL), }; static XimFrameRec str_fr[] = { - _FRAME(BIT8), /* number of byte */ - _FRAME(BARRAY), /* string */ + _FRAME(BIT8), /* number of byte */ + _FRAME(BARRAY), /* string */ _FRAME(EOL), }; static XimFrameRec xpcs_fr[] = { - _FRAME(BIT16), /* length of string in bytes */ - _FRAME(BARRAY), /* string */ + _FRAME(BIT16), /* length of string in bytes */ + _FRAME(BARRAY), /* string */ _PAD4(2), }; static XimFrameRec ext_fr[] = { - _FRAME(BIT8), /* extension major-opcode */ - _FRAME(BIT8), /* extension minor-opcode */ - _FRAME(BIT16), /* length of extension name */ - _FRAME(BARRAY), /* extension name */ + _FRAME(BIT8), /* extension major-opcode */ + _FRAME(BIT8), /* extension minor-opcode */ + _FRAME(BIT16), /* length of extension name */ + _FRAME(BARRAY), /* extension name */ _PAD4(1), _FRAME(EOL), }; static XimFrameRec inputstyle_fr[] = { - _FRAME(BIT32), /* inputstyle */ + _FRAME(BIT32), /* inputstyle */ _FRAME(EOL), }; /* Protocol definitions */ xim_externaldef XimFrameRec attr_head_fr[] = { - _FRAME(BIT16), /* attribute id */ - _FRAME(BIT16), /* attribute length */ + _FRAME(BIT16), /* attribute id */ + _FRAME(BIT16), /* attribute length */ _FRAME(EOL), }; xim_externaldef XimFrameRec short_fr[] = { - _FRAME(BIT16), /* value */ + _FRAME(BIT16), /* value */ _FRAME(EOL), }; xim_externaldef XimFrameRec long_fr[] = { - _FRAME(BIT32), /* value */ + _FRAME(BIT32), /* value */ _FRAME(EOL), }; xim_externaldef XimFrameRec xrectangle_fr[] = { - _FRAME(BIT16), /* x */ - _FRAME(BIT16), /* y */ - _FRAME(BIT16), /* width */ - _FRAME(BIT16), /* height */ + _FRAME(BIT16), /* x */ + _FRAME(BIT16), /* y */ + _FRAME(BIT16), /* width */ + _FRAME(BIT16), /* height */ _FRAME(EOL), }; xim_externaldef XimFrameRec xpoint_fr[] = { - _FRAME(BIT16), /* x */ - _FRAME(BIT16), /* y */ + _FRAME(BIT16), /* x */ + _FRAME(BIT16), /* y */ _FRAME(EOL), }; xim_externaldef XimFrameRec fontset_fr[] = { - _FRAME(BIT16), /* length of base font name */ - _FRAME(BARRAY), /* base font name list */ - _PAD4(2), /* unused */ + _FRAME(BIT16), /* length of base font name */ + _FRAME(BARRAY), /* base font name list */ + _PAD4(2), /* unused */ _FRAME(EOL), }; xim_externaldef XimFrameRec input_styles_fr[] = { - _FRAME(BIT16), /* number of list */ - _PAD4(1), /* unused */ - _FRAME(ITER), /* XIMStyle list */ + _FRAME(BIT16), /* number of list */ + _PAD4(1), /* unused */ + _FRAME(ITER), /* XIMStyle list */ _FRAME(POINTER), _PTR(inputstyle_fr), _FRAME(EOL), @@ -176,33 +176,33 @@ xim_externaldef XimFrameRec input_styles_fr[] = xim_externaldef XimFrameRec packet_header_fr[] = { - _FRAME(BIT8), /* major-opcode */ - _FRAME(BIT8), /* minor-opcode */ - _FRAME(BIT16), /* length */ + _FRAME(BIT8), /* major-opcode */ + _FRAME(BIT8), /* minor-opcode */ + _FRAME(BIT16), /* length */ _FRAME(EOL), }; xim_externaldef XimFrameRec error_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* flag */ - _FRAME(BIT16), /* Error Code */ - _FRAME(BIT16), /* length of error detail */ - _FRAME(BIT16), /* type of error detail */ - _FRAME(BARRAY), /* error detail */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* flag */ + _FRAME(BIT16), /* Error Code */ + _FRAME(BIT16), /* length of error detail */ + _FRAME(BIT16), /* type of error detail */ + _FRAME(BARRAY), /* error detail */ _PAD4(1), _FRAME(EOL), }; xim_externaldef XimFrameRec connect_fr[] = { - _FRAME(BIT8), /* byte order */ - _PAD2(1), /* unused */ - _FRAME(BIT16), /* client-major-protocol-version */ - _FRAME(BIT16), /* client-minor-protocol-version */ - _BYTE_COUNTER(BIT16, 1), /* length of client-auth-protocol-names */ - _FRAME(ITER), /* client-auth-protocol-names */ + _FRAME(BIT8), /* byte order */ + _PAD2(1), /* unused */ + _FRAME(BIT16), /* client-major-protocol-version */ + _FRAME(BIT16), /* client-minor-protocol-version */ + _BYTE_COUNTER(BIT16, 1), /* length of client-auth-protocol-names */ + _FRAME(ITER), /* client-auth-protocol-names */ _FRAME(POINTER), _PTR(xpcs_fr), _FRAME(EOL), @@ -210,16 +210,16 @@ xim_externaldef XimFrameRec connect_fr[] = xim_externaldef XimFrameRec connect_reply_fr[] = { - _FRAME(BIT16), /* server-major-protocol-version */ - _FRAME(BIT16), /* server-minor-protocol-version */ + _FRAME(BIT16), /* server-major-protocol-version */ + _FRAME(BIT16), /* server-minor-protocol-version */ _FRAME(EOL), }; xim_externaldef XimFrameRec auth_required_fr[] = { - _FRAME(BIT8), /* auth-protocol-index */ - _FRAME(BIT8), /* auth-data1 */ - _FRAME(BARRAY), /* auth-data2 */ + _FRAME(BIT8), /* auth-protocol-index */ + _FRAME(BIT8), /* auth-data1 */ + _FRAME(BARRAY), /* auth-data2 */ _PAD4(3), _FRAME(EOL), }; @@ -235,17 +235,17 @@ xim_externaldef XimFrameRec auth_reply_fr[] = xim_externaldef XimFrameRec auth_next_fr[] = { - _FRAME(BIT8), /* auth-data1 */ - _FRAME(BARRAY), /* auth-data2 */ + _FRAME(BIT8), /* auth-data1 */ + _FRAME(BARRAY), /* auth-data2 */ _PAD4(2), _FRAME(EOL), }; xim_externaldef XimFrameRec auth_setup_fr[] = { - _BYTE_COUNTER(BIT16, 2), /* number of client-auth-protocol-names */ - _PAD4(1), /* unused */ - _FRAME(ITER), /* server-auth-protocol-names */ + _BYTE_COUNTER(BIT16, 2), /* number of client-auth-protocol-names */ + _PAD4(1), /* unused */ + _FRAME(ITER), /* server-auth-protocol-names */ _FRAME(POINTER), _PTR(xpcs_fr), _FRAME(EOL), @@ -268,7 +268,7 @@ xim_externaldef XimFrameRec disconnect_reply_fr[] = xim_externaldef XimFrameRec open_fr[] = { - _FRAME(POINTER), /* locale name */ + _FRAME(POINTER), /* locale name */ _PTR(str_fr), _PAD4(1), _FRAME(EOL), @@ -276,14 +276,14 @@ xim_externaldef XimFrameRec open_fr[] = xim_externaldef XimFrameRec open_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of IM attributes supported */ - _FRAME(ITER), /* IM attribute supported */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of IM attributes supported */ + _FRAME(ITER), /* IM attribute supported */ _FRAME(POINTER), _PTR(ximattr_fr), - _BYTE_COUNTER(BIT16, 2), /* number of IC attribute supported */ - _PAD4(1), /* unused */ - _FRAME(ITER), /* IC attribute supported */ + _BYTE_COUNTER(BIT16, 2), /* number of IC attribute supported */ + _PAD4(1), /* unused */ + _FRAME(ITER), /* IC attribute supported */ _FRAME(POINTER), _PTR(xicattr_fr), _FRAME(EOL), @@ -291,28 +291,28 @@ xim_externaldef XimFrameRec open_reply_fr[] = xim_externaldef XimFrameRec close_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _PAD4(1), /* unused */ + _FRAME(BIT16), /* input-method-ID */ + _PAD4(1), /* unused */ _FRAME(EOL), }; xim_externaldef XimFrameRec close_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _PAD4(1), /* unused */ + _FRAME(BIT16), /* input-method-ID */ + _PAD4(1), /* unused */ _FRAME(EOL), }; xim_externaldef XimFrameRec register_triggerkeys_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _PAD4(1), /* unused */ + _FRAME(BIT16), /* input-method-ID */ + _PAD4(1), /* unused */ _BYTE_COUNTER(BIT32, 1), /* byte length of on-keys */ - _FRAME(ITER), /* on-keys list */ + _FRAME(ITER), /* on-keys list */ _FRAME(POINTER), _PTR(ximtriggerkey_fr), - _BYTE_COUNTER(BIT32, 1), /* byte length of off-keys */ - _FRAME(ITER), /* off-keys list */ + _BYTE_COUNTER(BIT32, 1), /* byte length of off-keys */ + _FRAME(ITER), /* off-keys list */ _FRAME(POINTER), _PTR(ximtriggerkey_fr), _FRAME(EOL), @@ -320,43 +320,43 @@ xim_externaldef XimFrameRec register_triggerkeys_fr[] = xim_externaldef XimFrameRec trigger_notify_fr[] = { - _FRAME(BIT16), /* input-mehotd-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* flag */ - _FRAME(BIT32), /* index of keys list */ - _FRAME(BIT32), /* client-select-event-mask */ + _FRAME(BIT16), /* input-mehotd-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* flag */ + _FRAME(BIT32), /* index of keys list */ + _FRAME(BIT32), /* client-select-event-mask */ _FRAME(EOL), }; xim_externaldef XimFrameRec trigger_notify_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec set_event_mask_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* forward-event-mask */ - _FRAME(BIT32), /* synchronous-event-mask */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* forward-event-mask */ + _FRAME(BIT32), /* synchronous-event-mask */ _FRAME(EOL), }; xim_externaldef XimFrameRec encoding_negotiation_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of encodings listed by name */ - _FRAME(ITER), /* supported list of encoding in IM library */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of encodings listed by name */ + _FRAME(ITER), /* supported list of encoding in IM library */ _FRAME(POINTER), _PTR(str_fr), _PAD4(1), - _BYTE_COUNTER(BIT16, 2), /* byte length of encodings listed by + _BYTE_COUNTER(BIT16, 2), /* byte length of encodings listed by detailed data */ _PAD4(1), - _FRAME(ITER), /* list of encodings supported in the - IM library */ + _FRAME(ITER), /* list of encodings supported in the + IM library */ _FRAME(POINTER), _PTR(encodinginfo_fr), _FRAME(EOL), @@ -364,19 +364,19 @@ xim_externaldef XimFrameRec encoding_negotiation_fr[] = xim_externaldef XimFrameRec encoding_negotiation_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* category of the encoding determined */ - _FRAME(BIT16), /* index of the encoding dterminated */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* category of the encoding determined */ + _FRAME(BIT16), /* index of the encoding dterminated */ _PAD4(1), _FRAME(EOL), }; xim_externaldef XimFrameRec query_extension_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of extensions supported - by the IM library */ - _FRAME(ITER), /* extensions supported by the IM library */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of extensions supported + by the IM library */ + _FRAME(ITER), /* extensions supported by the IM library */ _FRAME(POINTER), _PTR(str_fr), _PAD4(1), @@ -385,11 +385,11 @@ xim_externaldef XimFrameRec query_extension_fr[] = xim_externaldef XimFrameRec query_extension_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of extensions supported - by the IM server */ - _FRAME(ITER), /* list of extensions supported by the - IM server */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of extensions supported + by the IM server */ + _FRAME(ITER), /* list of extensions supported by the + IM server */ _FRAME(POINTER), _PTR(ext_fr), _FRAME(EOL), @@ -397,9 +397,9 @@ xim_externaldef XimFrameRec query_extension_reply_fr[] = xim_externaldef XimFrameRec get_im_values_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of im-attribute-id */ - _FRAME(ITER), /* im-attribute-id */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of im-attribute-id */ + _FRAME(ITER), /* im-attribute-id */ _FRAME(BIT16), _PAD4(1), _FRAME(EOL), @@ -407,9 +407,9 @@ xim_externaldef XimFrameRec get_im_values_fr[] = xim_externaldef XimFrameRec get_im_values_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of im-attribute returned */ - _FRAME(ITER), /* im-attribute returned */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of im-attribute returned */ + _FRAME(ITER), /* im-attribute returned */ _FRAME(POINTER), _PTR(ximattribute_fr), _FRAME(EOL), @@ -417,9 +417,9 @@ xim_externaldef XimFrameRec get_im_values_reply_fr[] = xim_externaldef XimFrameRec create_ic_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of ic-attributes */ - _FRAME(ITER), /* ic-attributes */ + _FRAME(BIT16), /* input-method-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of ic-attributes */ + _FRAME(ITER), /* ic-attributes */ _FRAME(POINTER), _PTR(xicattribute_fr), _FRAME(EOL), @@ -427,32 +427,32 @@ xim_externaldef XimFrameRec create_ic_fr[] = xim_externaldef XimFrameRec create_ic_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec destroy_ic_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec destroy_ic_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec set_ic_values_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _BYTE_COUNTER(BIT16, 2), /* byte length of ic-attributes */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _BYTE_COUNTER(BIT16, 2), /* byte length of ic-attributes */ _PAD4(1), - _FRAME(ITER), /* ic-attribute */ + _FRAME(ITER), /* ic-attribute */ _FRAME(POINTER), _PTR(xicattribute_fr), _FRAME(EOL), @@ -460,17 +460,17 @@ xim_externaldef XimFrameRec set_ic_values_fr[] = xim_externaldef XimFrameRec set_ic_values_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec get_ic_values_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _BYTE_COUNTER(BIT16, 1), /* byte length of ic-attribute-id */ - _FRAME(ITER), /* ic-attribute */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _BYTE_COUNTER(BIT16, 1), /* byte length of ic-attribute-id */ + _FRAME(ITER), /* ic-attribute */ _FRAME(BIT16), _PAD4(2), _FRAME(EOL), @@ -478,11 +478,11 @@ xim_externaldef XimFrameRec get_ic_values_fr[] = xim_externaldef XimFrameRec get_ic_values_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _BYTE_COUNTER(BIT16, 2), /* byte length of ic-attribute */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _BYTE_COUNTER(BIT16, 2), /* byte length of ic-attribute */ _PAD4(1), - _FRAME(ITER), /* ic-attribute */ + _FRAME(ITER), /* ic-attribute */ _FRAME(POINTER), _PTR(xicattribute_fr), _FRAME(EOL), @@ -490,69 +490,69 @@ xim_externaldef XimFrameRec get_ic_values_reply_fr[] = xim_externaldef XimFrameRec set_ic_focus_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec unset_ic_focus_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec forward_event_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* flag */ - _FRAME(BIT16), /* sequence number */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* flag */ + _FRAME(BIT16), /* sequence number */ _FRAME(EOL), }; xim_externaldef XimFrameRec wire_keyevent_fr[] = { - _FRAME(BIT8), /* type */ - _FRAME(BIT8), /* detail */ - _FRAME(BIT16), /* serial number */ - _FRAME(BIT32), /* time */ - _FRAME(BIT32), /* root */ - _FRAME(BIT32), /* window */ - _FRAME(BIT32), /* subwindow */ - _FRAME(BIT16), /* rootX */ - _FRAME(BIT16), /* rootY */ - _FRAME(BIT16), /* X */ - _FRAME(BIT16), /* Y */ - _FRAME(BIT16), /* state */ - _FRAME(BIT8), /* sameScreen */ + _FRAME(BIT8), /* type */ + _FRAME(BIT8), /* detail */ + _FRAME(BIT16), /* serial number */ + _FRAME(BIT32), /* time */ + _FRAME(BIT32), /* root */ + _FRAME(BIT32), /* window */ + _FRAME(BIT32), /* subwindow */ + _FRAME(BIT16), /* rootX */ + _FRAME(BIT16), /* rootY */ + _FRAME(BIT16), /* X */ + _FRAME(BIT16), /* Y */ + _FRAME(BIT16), /* state */ + _FRAME(BIT8), /* sameScreen */ _FRAME(EOL), }; xim_externaldef XimFrameRec sync_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec sync_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; #if 0 xim_externaldef XimFrameRec commit_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* flag */ - _FRAME(BIT16), /* byte length of committed string */ - _FRAME(BARRAY), /* committed string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* flag */ + _FRAME(BIT16), /* byte length of committed string */ + _FRAME(BARRAY), /* committed string */ _PAD4(1), - _BYTE_COUNTER(BIT16, 1), /* byte length of keysym */ - _FRAME(ITER), /* keysym */ + _BYTE_COUNTER(BIT16, 1), /* byte length of keysym */ + _FRAME(ITER), /* keysym */ _FRAME(BIT32), _PAD4(1), _FRAME(EOL), @@ -561,65 +561,65 @@ xim_externaldef XimFrameRec commit_fr[] = xim_externaldef XimFrameRec commit_chars_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* flag */ - _FRAME(BIT16), /* byte length of committed string */ - _FRAME(BARRAY), /* committed string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* flag */ + _FRAME(BIT16), /* byte length of committed string */ + _FRAME(BARRAY), /* committed string */ _PAD4(1), _FRAME(EOL), }; xim_externaldef XimFrameRec commit_both_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* flag */ - _PAD4(1), /* unused */ - _FRAME(BIT32), /* keysym */ - _FRAME(BIT16), /* byte length of committed string */ - _FRAME(BARRAY), /* committed string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* flag */ + _PAD4(1), /* unused */ + _FRAME(BIT32), /* keysym */ + _FRAME(BIT16), /* byte length of committed string */ + _FRAME(BARRAY), /* committed string */ _PAD4(2), _FRAME(EOL), }; xim_externaldef XimFrameRec reset_ic_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec reset_ic_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* byte length of committed string */ - _FRAME(BARRAY), /* committed string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* byte length of committed string */ + _FRAME(BARRAY), /* committed string */ _PAD4(2), _FRAME(EOL), }; xim_externaldef XimFrameRec geometry_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec str_conversion_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* XIMStringConversionPosition */ - _FRAME(BIT32), /* XIMStringConversionType */ - _FRAME(BIT32), /* XIMStringConversionOperation */ - _FRAME(BIT16), /* length to multiply the - XIMStringConversionType */ - _FRAME(BIT16), /* length of the string to be - substituted */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* XIMStringConversionPosition */ + _FRAME(BIT32), /* XIMStringConversionType */ + _FRAME(BIT32), /* XIMStringConversionOperation */ + _FRAME(BIT16), /* length to multiply the + XIMStringConversionType */ + _FRAME(BIT16), /* length of the string to be + substituted */ #if 0 - _FRAME(BARRAY), /* string */ + _FRAME(BARRAY), /* string */ _PAD4(1), #endif _FRAME(EOL), @@ -627,147 +627,147 @@ xim_externaldef XimFrameRec str_conversion_fr[] = xim_externaldef XimFrameRec str_conversion_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* XIMStringConversionFeedback */ - _FRAME(BIT16), /* length of the retrieved string */ - _FRAME(BARRAY), /* retrieved string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* XIMStringConversionFeedback */ + _FRAME(BIT16), /* length of the retrieved string */ + _FRAME(BARRAY), /* retrieved string */ _PAD4(2), - _BYTE_COUNTER(BIT16, 2), /* number of feedback array */ + _BYTE_COUNTER(BIT16, 2), /* number of feedback array */ _PAD4(1), - _FRAME(ITER), /* feedback array */ + _FRAME(ITER), /* feedback array */ _FRAME(BIT32), _FRAME(EOL), }; xim_externaldef XimFrameRec preedit_start_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec preedit_start_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* return value */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* return value */ _FRAME(EOL), }; xim_externaldef XimFrameRec preedit_draw_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* caret */ - _FRAME(BIT32), /* chg_first */ - _FRAME(BIT32), /* chg_length */ - _FRAME(BIT32), /* status */ - _FRAME(BIT16), /* length of preedit string */ - _FRAME(BARRAY), /* preedit string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* caret */ + _FRAME(BIT32), /* chg_first */ + _FRAME(BIT32), /* chg_length */ + _FRAME(BIT32), /* status */ + _FRAME(BIT16), /* length of preedit string */ + _FRAME(BARRAY), /* preedit string */ _PAD4(2), - _BYTE_COUNTER(BIT16, 2), /* number of feedback array */ + _BYTE_COUNTER(BIT16, 2), /* number of feedback array */ _PAD4(1), - _FRAME(ITER), /* feedback array */ + _FRAME(ITER), /* feedback array */ _FRAME(BIT32), _FRAME(EOL), }; xim_externaldef XimFrameRec preedit_caret_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* position */ - _FRAME(BIT32), /* direction */ - _FRAME(BIT32), /* style */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* position */ + _FRAME(BIT32), /* direction */ + _FRAME(BIT32), /* style */ _FRAME(EOL), }; xim_externaldef XimFrameRec preedit_caret_reply_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* position */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* position */ _FRAME(EOL), }; xim_externaldef XimFrameRec preedit_done_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec status_start_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec status_draw_text_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* type */ - _FRAME(BIT32), /* status */ - _FRAME(BIT16), /* length of status string */ - _FRAME(BARRAY), /* status string */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* type */ + _FRAME(BIT32), /* status */ + _FRAME(BIT16), /* length of status string */ + _FRAME(BARRAY), /* status string */ _PAD4(2), - _BYTE_COUNTER(BIT16, 2), /* number of feedback array */ + _BYTE_COUNTER(BIT16, 2), /* number of feedback array */ _PAD4(1), - _FRAME(ITER), /* feedback array */ + _FRAME(ITER), /* feedback array */ _FRAME(BIT32), _FRAME(EOL), }; xim_externaldef XimFrameRec status_draw_bitmap_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* type */ - _FRAME(BIT32), /* pixmap data */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* type */ + _FRAME(BIT32), /* pixmap data */ _FRAME(EOL), }; xim_externaldef XimFrameRec status_done_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ _FRAME(EOL), }; xim_externaldef XimFrameRec ext_set_event_mask_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT32), /* filter-event-mask */ - _FRAME(BIT32), /* intercept-event-mask */ - _FRAME(BIT32), /* select-event-mask */ - _FRAME(BIT32), /* forward-event-mask */ - _FRAME(BIT32), /* synchronous-event-mask */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT32), /* filter-event-mask */ + _FRAME(BIT32), /* intercept-event-mask */ + _FRAME(BIT32), /* select-event-mask */ + _FRAME(BIT32), /* forward-event-mask */ + _FRAME(BIT32), /* synchronous-event-mask */ _FRAME(EOL), }; xim_externaldef XimFrameRec ext_forward_keyevent_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* flag */ - _FRAME(BIT16), /* sequence number */ - _FRAME(BIT8), /* xEvent.u.u.type */ - _FRAME(BIT8), /* keycode */ - _FRAME(BIT16), /* state */ - _FRAME(BIT32), /* time */ - _FRAME(BIT32), /* window */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* flag */ + _FRAME(BIT16), /* sequence number */ + _FRAME(BIT8), /* xEvent.u.u.type */ + _FRAME(BIT8), /* keycode */ + _FRAME(BIT16), /* state */ + _FRAME(BIT32), /* time */ + _FRAME(BIT32), /* window */ _FRAME(EOL), }; xim_externaldef XimFrameRec ext_move_fr[] = { - _FRAME(BIT16), /* input-method-ID */ - _FRAME(BIT16), /* input-context-ID */ - _FRAME(BIT16), /* X */ - _FRAME(BIT16), /* Y */ + _FRAME(BIT16), /* input-method-ID */ + _FRAME(BIT16), /* input-context-ID */ + _FRAME(BIT16), /* X */ + _FRAME(BIT16), /* Y */ _FRAME(EOL), }; diff --git a/util/IMdkit/i18nIc.c b/util/IMdkit/i18nIc.c index 61b576f99..93ec0f143 100644 --- a/util/IMdkit/i18nIc.c +++ b/util/IMdkit/i18nIc.c @@ -368,7 +368,7 @@ static int ReadICValue (Xi18n i18n_core, + (INT16) attribute_length + IMPAD (attribute_length); } - /*endwhile*/ + /*endwhile*/ return ic_len; } @@ -398,8 +398,8 @@ static int ReadICValue (Xi18n i18n_core, #if 0 case XimType_XIMHotKeyTriggers: SetHotKeyAttribute (value_ret, p, ic_attr, value_length, need_swap, value_buf); - *number_ret = (CARD16) 1; - return *number_ret; + *number_ret = (CARD16) 1; + return *number_ret; #endif } /*endswitch*/ @@ -537,7 +537,7 @@ static int GetICValue (Xi18n i18n_core, attr_ret[n].attribute_id = xic_attr[j].attribute_id; attr_ret[n].name_length = xic_attr[j].length; attr_ret[n].name = malloc (xic_attr[j].length + 1); - strcpy(attr_ret[n].name, xic_attr[j].name); + strcpy(attr_ret[n].name, xic_attr[j].name); attr_ret[n].type = xic_attr[j].type; n++; i++; @@ -558,7 +558,7 @@ static int GetICValue (Xi18n i18n_core, attr_ret[n].attribute_id = xic_attr[j].attribute_id; attr_ret[n].name_length = xic_attr[j].length; attr_ret[n].name = malloc (xic_attr[j].length + 1); - strcpy(attr_ret[n].name, xic_attr[j].name); + strcpy(attr_ret[n].name, xic_attr[j].name); attr_ret[n].type = xic_attr[j].type; n++; break; @@ -572,7 +572,7 @@ static int GetICValue (Xi18n i18n_core, } static void SwapAttributes (XICAttribute *list, - int number){ + int number){ FrameMgr fm; CARD16 c16; extern XimFrameRec short_fr[]; @@ -585,37 +585,37 @@ static void SwapAttributes (XICAttribute *list, int i; for (i = 0; i < number; ++i, ++list) { - if (list->value == NULL) - continue; - switch (list->type) { - case XimType_CARD16: - fm = FrameMgrInit (short_fr, (char *)list->value, 1); - FrameMgrGetToken (fm, c16); - memmove(list->value, &c16, sizeof(CARD16)); - FrameMgrFree (fm); - break; - case XimType_CARD32: - case XimType_Window: - fm = FrameMgrInit (long_fr, (char *)list->value, 1); - FrameMgrGetToken (fm, c32); - memmove(list->value, &c32, sizeof(CARD32)); - FrameMgrFree (fm); - break; - case XimType_XRectangle: - fm = FrameMgrInit (xrectangle_fr, (char *)list->value, 1); - FrameMgrGetToken (fm, xrect); - memmove(list->value, &xrect, sizeof(XRectangle)); - FrameMgrFree (fm); - break; - case XimType_XPoint: - fm = FrameMgrInit (xpoint_fr, (char *)list->value, 1); - FrameMgrGetToken (fm, xpoint); - memmove(list->value, &xpoint, sizeof(XPoint)); - FrameMgrFree (fm); - break; - default: - break; - } + if (list->value == NULL) + continue; + switch (list->type) { + case XimType_CARD16: + fm = FrameMgrInit (short_fr, (char *)list->value, 1); + FrameMgrGetToken (fm, c16); + memmove(list->value, &c16, sizeof(CARD16)); + FrameMgrFree (fm); + break; + case XimType_CARD32: + case XimType_Window: + fm = FrameMgrInit (long_fr, (char *)list->value, 1); + FrameMgrGetToken (fm, c32); + memmove(list->value, &c32, sizeof(CARD32)); + FrameMgrFree (fm); + break; + case XimType_XRectangle: + fm = FrameMgrInit (xrectangle_fr, (char *)list->value, 1); + FrameMgrGetToken (fm, xrect); + memmove(list->value, &xrect, sizeof(XRectangle)); + FrameMgrFree (fm); + break; + case XimType_XPoint: + fm = FrameMgrInit (xpoint_fr, (char *)list->value, 1); + FrameMgrGetToken (fm, xpoint); + memmove(list->value, &xpoint, sizeof(XPoint)); + FrameMgrFree (fm); + break; + default: + break; + } } } @@ -699,7 +699,7 @@ void _Xi18nChangeIC (XIMS ims, FrameMgrGetToken (fm, value); attrib_list[attrib_num].value = (void *) malloc (value_length + 1); memmove (attrib_list[attrib_num].value, value, value_length); - ((char *)attrib_list[attrib_num].value)[value_length] = '\0'; + ((char *)attrib_list[attrib_num].value)[value_length] = '\0'; attrib_num++; total_value_length += (value_length + 1); } @@ -976,8 +976,8 @@ void _Xi18nGetIC (XIMS ims, IMProtocol *call_data, unsigned char *p) if (!(i18n_core->address.improto (ims, call_data))) return; /*endif*/ - if (_Xi18nNeedSwap (i18n_core, connect_id)) - SwapAttributes(getic->ic_attr, getic->ic_attr_num); + if (_Xi18nNeedSwap (i18n_core, connect_id)) + SwapAttributes(getic->ic_attr, getic->ic_attr_num); } /*endif*/ iter_count = getic->ic_attr_num; @@ -1061,9 +1061,9 @@ void _Xi18nGetIC (XIMS ims, IMProtocol *call_data, unsigned char *p) for (i = 0; i < (int) getic->ic_attr_num; i++) { - if (getic->ic_attr[i].name) - XFree (getic->ic_attr[i].name); - /*endif*/ + if (getic->ic_attr[i].name) + XFree (getic->ic_attr[i].name); + /*endif*/ if (getic->ic_attr[i].value) XFree (getic->ic_attr[i].value); /*endif*/ @@ -1071,22 +1071,22 @@ void _Xi18nGetIC (XIMS ims, IMProtocol *call_data, unsigned char *p) /*endfor*/ for (i = 0; i < (int) getic->preedit_attr_num; i++) { - if (getic->preedit_attr[i].name) - XFree (getic->preedit_attr[i].name); - /*endif*/ - if (getic->preedit_attr[i].value) - XFree (getic->preedit_attr[i].value); - /*endif*/ + if (getic->preedit_attr[i].name) + XFree (getic->preedit_attr[i].name); + /*endif*/ + if (getic->preedit_attr[i].value) + XFree (getic->preedit_attr[i].value); + /*endif*/ } /*endfor*/ for (i = 0; i < (int) getic->status_attr_num; i++) { - if (getic->status_attr[i].name) - XFree (getic->status_attr[i].name); - /*endif*/ - if (getic->status_attr[i].value) - XFree (getic->status_attr[i].value); - /*endif*/ + if (getic->status_attr[i].name) + XFree (getic->status_attr[i].name); + /*endif*/ + if (getic->status_attr[i].value) + XFree (getic->status_attr[i].value); + /*endif*/ } /*endfor*/ diff --git a/util/IMdkit/i18nMethod.c b/util/IMdkit/i18nMethod.c index 203f83157..e1c36036a 100644 --- a/util/IMdkit/i18nMethod.c +++ b/util/IMdkit/i18nMethod.c @@ -96,7 +96,7 @@ static Bool GetInputStyles (Xi18n i18n_core, XIMStyles **p_style) { Xi18nAddressRec *address = (Xi18nAddressRec *) &i18n_core->address; XIMStyles *p; - int i; + int i; p = &address->input_styles; if ((*p_style = (XIMStyles *) malloc (sizeof (XIMStyles) @@ -118,7 +118,7 @@ static Bool GetOnOffKeys (Xi18n i18n_core, long mask, XIMTriggerKeys **p_key) { Xi18nAddressRec *address = (Xi18nAddressRec *) &i18n_core->address; XIMTriggerKeys *p; - int i; + int i; if (mask & I18N_ON_KEYS) p = &address->on_keys; @@ -149,7 +149,7 @@ static Bool GetEncodings(Xi18n i18n_core, XIMEncodings **p_encoding) { Xi18nAddressRec *address = (Xi18nAddressRec *) &i18n_core->address; XIMEncodings *p; - int i; + int i; p = &address->encoding_list; @@ -561,9 +561,9 @@ static int SetXi18nSelectionOwner(Xi18n i18n_core) 1); } else { - /* - * We always need to generate the PropertyNotify to the Root Window - */ + /* + * We always need to generate the PropertyNotify to the Root Window + */ XChangeProperty (dpy, root, XIM_Servers, @@ -817,7 +817,7 @@ static char *xi18n_getIMValues (XIMS ims, XIMArg *args) } static void EventToWireEvent (XEvent *ev, xEvent *event, - CARD16 *serial, Bool byte_swap) + CARD16 *serial, Bool byte_swap) { FrameMgr fm; extern XimFrameRec wire_keyevent_fr[]; @@ -830,35 +830,35 @@ static void EventToWireEvent (XEvent *ev, xEvent *event, switch (ev->type) { case KeyPress: case KeyRelease: - { - XKeyEvent *kev = (XKeyEvent*)ev; - /* create FrameMgr */ - fm = FrameMgrInit(wire_keyevent_fr, (char *)(&(event->u)), byte_swap); - - /* set values */ - b = (BYTE)kev->type; FrameMgrPutToken(fm, b); - b = (BYTE)kev->keycode; FrameMgrPutToken(fm, b); - c16 = (CARD16)(kev->serial & (unsigned long)0xffff); - FrameMgrPutToken(fm, c16); - c32 = (CARD32)kev->time; FrameMgrPutToken(fm, c32); - c32 = (CARD32)kev->root; FrameMgrPutToken(fm, c32); - c32 = (CARD32)kev->window; FrameMgrPutToken(fm, c32); - c32 = (CARD32)kev->subwindow; FrameMgrPutToken(fm, c32); - c16 = (CARD16)kev->x_root; FrameMgrPutToken(fm, c16); - c16 = (CARD16)kev->y_root; FrameMgrPutToken(fm, c16); - c16 = (CARD16)kev->x; FrameMgrPutToken(fm, c16); - c16 = (CARD16)kev->y; FrameMgrPutToken(fm, c16); - c16 = (CARD16)kev->state; FrameMgrPutToken(fm, c16); - b = (BYTE)kev->same_screen; FrameMgrPutToken(fm, b); - } - break; + { + XKeyEvent *kev = (XKeyEvent*)ev; + /* create FrameMgr */ + fm = FrameMgrInit(wire_keyevent_fr, (char *)(&(event->u)), byte_swap); + + /* set values */ + b = (BYTE)kev->type; FrameMgrPutToken(fm, b); + b = (BYTE)kev->keycode; FrameMgrPutToken(fm, b); + c16 = (CARD16)(kev->serial & (unsigned long)0xffff); + FrameMgrPutToken(fm, c16); + c32 = (CARD32)kev->time; FrameMgrPutToken(fm, c32); + c32 = (CARD32)kev->root; FrameMgrPutToken(fm, c32); + c32 = (CARD32)kev->window; FrameMgrPutToken(fm, c32); + c32 = (CARD32)kev->subwindow; FrameMgrPutToken(fm, c32); + c16 = (CARD16)kev->x_root; FrameMgrPutToken(fm, c16); + c16 = (CARD16)kev->y_root; FrameMgrPutToken(fm, c16); + c16 = (CARD16)kev->x; FrameMgrPutToken(fm, c16); + c16 = (CARD16)kev->y; FrameMgrPutToken(fm, c16); + c16 = (CARD16)kev->state; FrameMgrPutToken(fm, c16); + b = (BYTE)kev->same_screen; FrameMgrPutToken(fm, b); + } + break; default: - /* create FrameMgr */ - fm = FrameMgrInit(short_fr, (char *)(&(event->u.u.sequenceNumber)), - byte_swap); - c16 = (CARD16)(ev->xany.serial & (unsigned long)0xffff); - FrameMgrPutToken(fm, c16); - break; + /* create FrameMgr */ + fm = FrameMgrInit(short_fr, (char *)(&(event->u.u.sequenceNumber)), + byte_swap); + c16 = (CARD16)(ev->xany.serial & (unsigned long)0xffff); + FrameMgrPutToken(fm, c16); + break; } /* free FrameMgr */ FrameMgrFree(fm); @@ -902,7 +902,7 @@ static Status xi18n_forwardEvent (XIMS ims, XPointer xp) FrameMgrSetBuffer (fm, reply); replyp = reply; - call_data->sync_bit = 1; /* always sync */ + call_data->sync_bit = 1; /* always sync */ client->sync = True; FrameMgrPutToken (fm, call_data->connect_id); diff --git a/util/IMdkit/i18nPtHdr.c b/util/IMdkit/i18nPtHdr.c index d35035452..65155937c 100644 --- a/util/IMdkit/i18nPtHdr.c +++ b/util/IMdkit/i18nPtHdr.c @@ -45,9 +45,9 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef XIM_DEBUG #include -static void DebugLog(char * msg) +static void DebugLog(char * msg) { - fprintf(stderr, msg); + fprintf(stderr, msg); } #endif @@ -568,14 +568,14 @@ static void SyncReplyMessageProc (XIMS ims, client->sync = False; if (ims->sync == True) { - ims->sync = False; - if (i18n_core->address.improto) { - call_data->sync_xlib.major_code = XIM_SYNC_REPLY; - call_data->sync_xlib.minor_code = 0; - call_data->sync_xlib.connect_id = input_method_ID; - call_data->sync_xlib.icid = input_context_ID; - i18n_core->address.improto(ims, call_data); - } + ims->sync = False; + if (i18n_core->address.improto) { + call_data->sync_xlib.major_code = XIM_SYNC_REPLY; + call_data->sync_xlib.minor_code = 0; + call_data->sync_xlib.connect_id = input_method_ID; + call_data->sync_xlib.icid = input_context_ID; + i18n_core->address.improto(ims, call_data); + } } } @@ -591,7 +591,7 @@ static void GetIMValueFromName (Xi18n i18n_core, { XIMStyles *styles = (XIMStyles *) &i18n_core->address.input_styles; - *length = sizeof (CARD16)*2; /* count_styles, unused */ + *length = sizeof (CARD16)*2; /* count_styles, unused */ *length += styles->count_styles*sizeof (CARD32); if (buf != NULL) @@ -760,7 +760,7 @@ static void GetIMValuesMessageProc (XIMS ims, if (i18n_core->address.xim_attr[j].attribute_id == im_attrID_list[i]) { name_list[name_number++] = - i18n_core->address.xim_attr[j].name; + i18n_core->address.xim_attr[j].name; break; } } @@ -1140,7 +1140,7 @@ static void ForwardEventMessageProc (XIMS ims, &wire_event, forward->serial_number, &forward->event, - _Xi18nNeedSwap (i18n_core, connect_id)) == True) + _Xi18nNeedSwap (i18n_core, connect_id)) == True) { if (i18n_core->address.improto) { @@ -1663,7 +1663,7 @@ void _Xi18nMessageHandler (XIMS ims, unsigned char *p, Bool *delete) { - XimProtoHdr *hdr = (XimProtoHdr *)p; + XimProtoHdr *hdr = (XimProtoHdr *)p; unsigned char *p1 = (unsigned char *)(hdr + 1); IMProtocol call_data; Xi18n i18n_core = ims->protocol; @@ -1684,98 +1684,98 @@ void _Xi18nMessageHandler (XIMS ims, { case XIM_CONNECT: #ifdef XIM_DEBUG - DebugLog("-- XIM_CONNECT\n"); + DebugLog("-- XIM_CONNECT\n"); #endif ConnectMessageProc (ims, &call_data, p1); break; case XIM_DISCONNECT: #ifdef XIM_DEBUG - DebugLog("-- XIM_DISCONNECT\n"); + DebugLog("-- XIM_DISCONNECT\n"); #endif DisConnectMessageProc (ims, &call_data); break; case XIM_OPEN: #ifdef XIM_DEBUG - DebugLog("-- XIM_OPEN\n"); + DebugLog("-- XIM_OPEN\n"); #endif OpenMessageProc (ims, &call_data, p1); break; case XIM_CLOSE: #ifdef XIM_DEBUG - DebugLog("-- XIM_CLOSE\n"); + DebugLog("-- XIM_CLOSE\n"); #endif CloseMessageProc (ims, &call_data, p1); break; case XIM_QUERY_EXTENSION: #ifdef XIM_DEBUG - DebugLog("-- XIM_QUERY_EXTENSION\n"); + DebugLog("-- XIM_QUERY_EXTENSION\n"); #endif QueryExtensionMessageProc (ims, &call_data, p1); break; case XIM_GET_IM_VALUES: #ifdef XIM_DEBUG - DebugLog("-- XIM_GET_IM_VALUES\n"); + DebugLog("-- XIM_GET_IM_VALUES\n"); #endif GetIMValuesMessageProc (ims, &call_data, p1); break; case XIM_CREATE_IC: #ifdef XIM_DEBUG - DebugLog("-- XIM_CREATE_IC\n"); + DebugLog("-- XIM_CREATE_IC\n"); #endif CreateICMessageProc (ims, &call_data, p1); break; case XIM_SET_IC_VALUES: #ifdef XIM_DEBUG - DebugLog("-- XIM_SET_IC_VALUES\n"); + DebugLog("-- XIM_SET_IC_VALUES\n"); #endif SetICValuesMessageProc (ims, &call_data, p1); break; case XIM_GET_IC_VALUES: #ifdef XIM_DEBUG - DebugLog("-- XIM_GET_IC_VALUES\n"); + DebugLog("-- XIM_GET_IC_VALUES\n"); #endif GetICValuesMessageProc (ims, &call_data, p1); break; case XIM_SET_IC_FOCUS: #ifdef XIM_DEBUG - DebugLog("-- XIM_SET_IC_FOCUS\n"); + DebugLog("-- XIM_SET_IC_FOCUS\n"); #endif SetICFocusMessageProc (ims, &call_data, p1); break; case XIM_UNSET_IC_FOCUS: #ifdef XIM_DEBUG - DebugLog("-- XIM_UNSET_IC_FOCUS\n"); + DebugLog("-- XIM_UNSET_IC_FOCUS\n"); #endif UnsetICFocusMessageProc (ims, &call_data, p1); break; case XIM_DESTROY_IC: #ifdef XIM_DEBUG - DebugLog("-- XIM_DESTROY_IC\n"); + DebugLog("-- XIM_DESTROY_IC\n"); #endif DestroyICMessageProc (ims, &call_data, p1); break; case XIM_RESET_IC: #ifdef XIM_DEBUG - DebugLog("-- XIM_RESET_IC\n"); + DebugLog("-- XIM_RESET_IC\n"); #endif ResetICMessageProc (ims, &call_data, p1); break; case XIM_FORWARD_EVENT: #ifdef XIM_DEBUG - DebugLog("-- XIM_FORWARD_EVENT\n"); + DebugLog("-- XIM_FORWARD_EVENT\n"); #endif if (client->sync == True) { @@ -1790,20 +1790,20 @@ void _Xi18nMessageHandler (XIMS ims, case XIM_EXTENSION: #ifdef XIM_DEBUG - DebugLog("-- XIM_EXTENSION\n"); + DebugLog("-- XIM_EXTENSION\n"); #endif ExtensionMessageProc (ims, &call_data, p1); break; case XIM_SYNC: #ifdef XIM_DEBUG - DebugLog("-- XIM_SYNC\n"); + DebugLog("-- XIM_SYNC\n"); #endif break; case XIM_SYNC_REPLY: #ifdef XIM_DEBUG - DebugLog("-- XIM_SYNC_REPLY\n"); + DebugLog("-- XIM_SYNC_REPLY\n"); #endif SyncReplyMessageProc (ims, &call_data, p1); ProcessQueue (ims, connect_id); @@ -1811,35 +1811,35 @@ void _Xi18nMessageHandler (XIMS ims, case XIM_TRIGGER_NOTIFY: #ifdef XIM_DEBUG - DebugLog("-- XIM_TRIGGER_NOTIFY\n"); + DebugLog("-- XIM_TRIGGER_NOTIFY\n"); #endif TriggerNotifyMessageProc (ims, &call_data, p1); break; case XIM_ENCODING_NEGOTIATION: #ifdef XIM_DEBUG - DebugLog("-- XIM_ENCODING_NEGOTIATION\n"); + DebugLog("-- XIM_ENCODING_NEGOTIATION\n"); #endif EncodingNegotiatonMessageProc (ims, &call_data, p1); break; case XIM_PREEDIT_START_REPLY: #ifdef XIM_DEBUG - DebugLog("-- XIM_PREEDIT_START_REPLY\n"); + DebugLog("-- XIM_PREEDIT_START_REPLY\n"); #endif PreeditStartReplyMessageProc (ims, &call_data, p1); break; case XIM_PREEDIT_CARET_REPLY: #ifdef XIM_DEBUG - DebugLog("-- XIM_PREEDIT_CARET_REPLY\n"); + DebugLog("-- XIM_PREEDIT_CARET_REPLY\n"); #endif PreeditCaretReplyMessageProc (ims, &call_data, p1); break; case XIM_STR_CONVERSION_REPLY: #ifdef XIM_DEBUG - DebugLog("-- XIM_STR_CONVERSION_REPLY\n"); + DebugLog("-- XIM_STR_CONVERSION_REPLY\n"); #endif StrConvReplyMessageProc (ims, &call_data, p1); break; diff --git a/util/IMdkit/i18nUtil.c b/util/IMdkit/i18nUtil.c index c07de481a..a10ebdcbc 100644 --- a/util/IMdkit/i18nUtil.c +++ b/util/IMdkit/i18nUtil.c @@ -56,19 +56,19 @@ Xi18nClient *_Xi18nNewClient(Xi18n i18n_core) { client = i18n_core->address.free_clients; i18n_core->address.free_clients = client->next; - new_connect_id = client->connect_id; + new_connect_id = client->connect_id; } else { client = (Xi18nClient *) malloc (sizeof (Xi18nClient)); - new_connect_id = ++connect_id; + new_connect_id = ++connect_id; } /*endif*/ memset (client, 0, sizeof (Xi18nClient)); client->connect_id = new_connect_id; client->pending = (XIMPending *) NULL; client->sync = False; - client->byte_order = '?'; /* initial value */ + client->byte_order = '?'; /* initial value */ memset (&client->pending, 0, sizeof (XIMPending *)); client->property_offset = 0; client->next = i18n_core->address.clients; @@ -260,8 +260,8 @@ void _Xi18nSetEventMask (XIMS ims, memset (reply, 0, total_size); FrameMgrSetBuffer (fm, reply); - FrameMgrPutToken (fm, im_id); /* input-method-id */ - FrameMgrPutToken (fm, ic_id); /* input-context-id */ + FrameMgrPutToken (fm, im_id); /* input-method-id */ + FrameMgrPutToken (fm, ic_id); /* input-context-id */ FrameMgrPutToken (fm, forward_mask); FrameMgrPutToken (fm, sync_mask);