g_object_unref (priv->slave);
- if (priv->client_window) g_object_unref (priv->client_window);
+ if (priv->client_window) {
+ g_object_unref (priv->client_window);
+ }
+
// release preedit
- if (priv->preedit_string) g_free (priv->preedit_string);
- if (priv->preedit_attrs) pango_attr_list_unref (priv->preedit_attrs);
+ if (priv->preedit_string) {
+ g_free (priv->preedit_string);
+ }
+ if (priv->preedit_attrs) {
+ pango_attr_list_unref (priv->preedit_attrs);
+ }
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
*/
gboolean retval = ibus_im_client_filter_keypress (_client,
priv->ic, event, FALSE);
- if (retval)
+ if (retval) {
return TRUE;
+ }
return gtk_im_context_filter_keypress (priv->slave, event);
}
- else
+ else {
return gtk_im_context_filter_keypress (priv->slave, event);
+ }
}
static void
IBusIMContextPrivate *priv = ibus->priv;
priv->has_focus = TRUE;
- if (priv->ic)
+ if (priv->ic) {
ibus_im_client_focus_in (_client, priv->ic);
+ }
+
gtk_im_context_focus_in (priv->slave);
_set_cursor_location_internal (context);
IBusIMContextPrivate *priv = ibus->priv;
priv->has_focus = FALSE;
- if (priv->ic)
+ if (priv->ic) {
ibus_im_client_focus_out (_client, priv->ic);
+ }
gtk_im_context_focus_out (priv->slave);
}
IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
IBusIMContextPrivate *priv = ibus->priv;
- if (priv->ic)
+ if (priv->ic) {
ibus_im_client_reset (_client, priv->ic);
+ }
gtk_im_context_reset (priv->slave);
}
}
}
else {
- if (str) *str = g_strdup ("");
- if (attrs) *attrs = pango_attr_list_new ();
- if (cursor_pos) *cursor_pos = 0;
+ if (str) {
+ *str = g_strdup ("");
+ }
+ if (attrs) {
+ *attrs = pango_attr_list_new ();
+ }
+ if (cursor_pos) {
+ *cursor_pos = 0;
+ }
}
}
else {
IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
IBusIMContextPrivate *priv = ibus->priv;
- if (priv->client_window)
+ if (priv->client_window) {
g_object_unref (priv->client_window);
+ }
if (client) {
g_object_ref (client);
IBusIMContextPrivate *priv = ibus->priv;
GdkRectangle area;
gint x, y;
- if(priv->client_window == NULL || priv->ic == NULL)
+
+ if(priv->client_window == NULL || priv->ic == NULL) {
return;
+ }
area = priv->cursor_area;
if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
IBusIMContextPrivate *priv = ibus->priv;
- if(priv->ic)
+ if(priv->ic) {
ibus_im_client_set_use_preedit (_client, priv->ic, use_preedit);
+ }
gtk_im_context_set_use_preedit (priv->slave, use_preedit);
}
context = g_array_index (_im_context_array, IBusIMContext *, i);
ic = ibus_im_client_create_input_context (client);
ibus_im_context_set_ic (context, ic);
- if (ic == NULL)
+ if (ic == NULL) {
continue;
+ }
g_hash_table_insert (_ic_table,
(gpointer) ibus_im_context_get_ic (context), (gpointer) context);
}
IBusIMContextPrivate *priv = context->priv;
- if (priv->preedit_string)
+ if (priv->preedit_string) {
g_free (priv->preedit_string);
- if (priv->preedit_attrs)
+ }
+ if (priv->preedit_attrs) {
pango_attr_list_unref (priv->preedit_attrs);
+ }
priv->preedit_string = g_strdup (string);
priv->preedit_attrs = pango_attr_list_ref (attrs);
static void
_init_ibus_client (void)
{
- if (_client != NULL)
+ if (_client != NULL) {
return;
+ }
_im_context_array = g_array_new (TRUE, TRUE, sizeof (IBusIMContext *));
_ic_table = g_hash_table_new (g_str_hash, g_str_equal);
IBusIMContextPrivate *priv = context->priv;
- if (priv->enable && priv->ic)
+ if (priv->enable && priv->ic) {
return;
+ }
g_signal_emit (context, _signal_preedit_changed_id, 0);
}
IBusIMContextPrivate *priv = context->priv;
- if (priv->enable && priv->ic)
+ if (priv->enable && priv->ic) {
return;
+ }
g_signal_emit (context, _signal_preedit_start_id, 0);
}
IBusIMContextPrivate *priv = context->priv;
- if (priv->enable && priv->ic)
+ if (priv->enable && priv->ic) {
return;
+ }
g_signal_emit (context, _signal_preedit_end_id, 0);
}
IBusIMContextPrivate *priv = context->priv;
- if (priv->enable && priv->ic)
+ if (priv->enable && priv->ic) {
return;
+ }
g_signal_emit (context, _signal_retrieve_surrounding_id, 0);
}
IBusIMContextPrivate *priv = context->priv;
- if (priv->enable && priv->ic)
+ if (priv->enable && priv->ic) {
return;
+ }
g_signal_emit (context, _signal_delete_surrounding_id, 0, a1, a2);
}
g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
IBusIMContextPrivate *priv = context->priv;
- if (priv->preedit_visible)
+ if (priv->preedit_visible) {
return;
+ }
priv->preedit_visible = TRUE;
IBusIMContextPrivate *priv = context->priv;
- if (!priv->preedit_visible)
+ if (!priv->preedit_visible) {
return;
+ }
priv->preedit_visible = FALSE;