示例#1
0
文件: engineproxy.c 项目: XueWei/ibus
static void
bus_engine_proxy_real_destroy (BusEngineProxy *engine)
{
    if (engine->prop_list) {
        g_object_unref (engine->prop_list);
        engine->prop_list = NULL;
    }

    if (ibus_proxy_get_connection ((IBusProxy *) engine)) {
        ibus_proxy_call ((IBusProxy *) engine,
                         "Destroy",
                         G_TYPE_INVALID);
    }

    if (engine->desc) {
        g_object_unref (engine->desc);
        engine->desc = NULL;
    }

    if (engine->keymap) {
        g_object_unref (engine->keymap);
        engine->keymap = NULL;
    }

    IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (engine));
}
示例#2
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_focus_in (BusPanelProxy     *panel,
                          BusInputContext   *context)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (BUS_IS_INPUT_CONTEXT (context));

    if (panel->focused_context == context)
        return;

    if (panel->focused_context != NULL)
        bus_panel_proxy_focus_out (panel, panel->focused_context);

    g_object_ref_sink (context);
    panel->focused_context = context;

    const gchar *path = ibus_service_get_path ((IBusService *)context);

    ibus_proxy_call ((IBusProxy *) panel,
                     "FocusIn",
                     IBUS_TYPE_OBJECT_PATH, &path,
                     G_TYPE_INVALID);

    /* install signal handlers */
    gint i;
    for (i = 0; i < G_N_ELEMENTS (__signals); i++) {
        g_signal_connect (context,
                          __signals[i].name,
                          __signals[i].callback,
                          panel);
    }
}
示例#3
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_focus_out (BusPanelProxy    *panel,
                           BusInputContext  *context)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (BUS_IS_INPUT_CONTEXT (context));

    g_assert (panel->focused_context == context);

    /* uninstall signal handlers */
    gint i;
    for (i = 0; i < G_N_ELEMENTS (__signals); i++) {
        g_signal_handlers_disconnect_by_func (context,
                                              __signals[i].callback,
                                              panel);
    }

    const gchar *path = ibus_service_get_path ((IBusService *)context);

    ibus_proxy_call ((IBusProxy *) panel,
                     "FocusOut",
                     IBUS_TYPE_OBJECT_PATH, &path,
                     G_TYPE_INVALID);

    g_object_unref (panel->focused_context);
    panel->focused_context = NULL;
}
示例#4
0
文件: engineproxy.c 项目: hychen/ibus
void bus_engine_proxy_property_hide (BusEngineProxy *engine,
                                     const gchar    *prop_name)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));
    g_assert (prop_name != NULL);

    ibus_proxy_call ((IBusProxy *) engine,
                     "PropertyHide",
                     G_TYPE_STRING, &prop_name,
                     G_TYPE_INVALID);
}
示例#5
0
文件: engineproxy.c 项目: hychen/ibus
void
bus_engine_proxy_focus_in (BusEngineProxy *engine)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));
    if (!engine->has_focus) {
        engine->has_focus = TRUE;
        ibus_proxy_call ((IBusProxy *) engine,
                         "FocusIn",
                         G_TYPE_INVALID);
    }
}
示例#6
0
文件: engineproxy.c 项目: hychen/ibus
void
bus_engine_proxy_disable (BusEngineProxy *engine)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));
    if (engine->enabled) {
        engine->enabled = FALSE;
        ibus_proxy_call ((IBusProxy *) engine,
                         "Disable",
                         G_TYPE_INVALID);
    }
}
示例#7
0
void
ibus_input_context_set_engine (IBusInputContext *context,
                               const gchar *name)
{
    g_assert (IBUS_IS_INPUT_CONTEXT (context));

    ibus_proxy_call ((IBusProxy *) context,
                     "SetEngine",
                     G_TYPE_STRING, &name,
                     G_TYPE_INVALID);
}
示例#8
0
void
ibus_input_context_property_hide (IBusInputContext *context,
                                       const gchar      *prop_name)
{
    g_assert (IBUS_IS_INPUT_CONTEXT (context));

    ibus_proxy_call ((IBusProxy *) context,
                     "PropertyHide",
                     G_TYPE_STRING, &prop_name,
                     G_TYPE_INVALID);
}
示例#9
0
void
ibus_input_context_set_capabilities (IBusInputContext   *context,
                                     guint32             capabilites)
{
    g_assert (IBUS_IS_INPUT_CONTEXT (context));

    ibus_proxy_call ((IBusProxy *) context,
                     "SetCapabilities",
                     G_TYPE_UINT, &capabilites,
                     G_TYPE_INVALID);
}
示例#10
0
static void
ibus_config_real_destroy (IBusConfig *config)
{
    if (ibus_proxy_get_connection ((IBusProxy *) config) != NULL) {
        ibus_proxy_call ((IBusProxy *) config,
                         "Destroy",
                         G_TYPE_INVALID);
    }

    IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (config));
}
示例#11
0
文件: engineproxy.c 项目: hychen/ibus
void
bus_engine_proxy_focus_out (BusEngineProxy *engine)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));
    if (engine->has_focus) {
        engine->has_focus = FALSE;
        ibus_proxy_call ((IBusProxy *) engine,
                         "FocusOut",
                         G_TYPE_INVALID);
    }
}
示例#12
0
文件: engineproxy.c 项目: XueWei/ibus
void
bus_engine_proxy_set_capabilities (BusEngineProxy *engine,
                                   guint           caps)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));

    ibus_proxy_call ((IBusProxy *) engine,
                     "SetCapabilities",
                     G_TYPE_UINT, &caps,
                     G_TYPE_INVALID);

}
示例#13
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_update_property (BusPanelProxy  *panel,
                                 IBusProperty   *prop)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (prop != NULL);

    ibus_proxy_call ((IBusProxy *) panel,
                     "UpdateProperty",
                     IBUS_TYPE_PROPERTY, &prop,
                     G_TYPE_INVALID);
}
示例#14
0
void
ibus_input_context_property_activate (IBusInputContext *context,
                                      const gchar      *prop_name,
                                      gint32            state)
{
    g_assert (IBUS_IS_INPUT_CONTEXT (context));

    ibus_proxy_call ((IBusProxy *) context,
                     "PropertyActivate",
                     G_TYPE_STRING, &prop_name,
                     G_TYPE_INT, &state,
                     G_TYPE_INVALID);
}
示例#15
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_register_properties (BusPanelProxy  *panel,
                                     IBusPropList   *prop_list)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (prop_list != NULL);

    ibus_proxy_call ((IBusProxy *) panel,
                     "RegisterProperties",
                     IBUS_TYPE_PROP_LIST, &prop_list,
                     G_TYPE_INVALID);
    ibus_connection_flush (ibus_proxy_get_connection((IBusProxy *)panel));
}
示例#16
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_update_lookup_table (BusPanelProxy   *panel,
                                     IBusLookupTable *table,
                                     gboolean         visible)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (table != NULL);

    ibus_proxy_call ((IBusProxy *) panel,
                     "UpdateLookupTable",
                     IBUS_TYPE_LOOKUP_TABLE, &table,
                     G_TYPE_BOOLEAN, &visible,
                     G_TYPE_INVALID);
}
示例#17
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_update_auxiliary_text (BusPanelProxy *panel,
                                       IBusText      *text,
                                       gboolean       visible)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (text != NULL);

    ibus_proxy_call ((IBusProxy *) panel,
                     "UpdateAuxiliaryText",
                     IBUS_TYPE_TEXT, &text,
                     G_TYPE_BOOLEAN, &visible,
                     G_TYPE_INVALID);
}
示例#18
0
static void
ibus_input_context_real_destroy (IBusInputContext *context)
{
    IBusInputContextPrivate *priv;
    priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context);

    if (priv->own && ibus_proxy_get_connection ((IBusProxy *) context) != NULL) {
        ibus_proxy_call (IBUS_PROXY (context),
                         "Destroy",
                         G_TYPE_INVALID);
    }

    IBUS_OBJECT_CLASS(ibus_input_context_parent_class)->destroy (IBUS_OBJECT (context));
}
示例#19
0
文件: engineproxy.c 项目: hychen/ibus
void
bus_engine_proxy_property_activate (BusEngineProxy *engine,
                                    const gchar    *prop_name,
                                    guint           prop_state)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));
    g_assert (prop_name != NULL);

    ibus_proxy_call ((IBusProxy *) engine,
                     "PropertyActivate",
                     G_TYPE_STRING, &prop_name,
                     G_TYPE_UINT, &prop_state,
                     G_TYPE_INVALID);
}
示例#20
0
文件: engineproxy.c 项目: hychen/ibus
void
bus_engine_proxy_candidate_clicked (BusEngineProxy *engine,
                                    guint           index,
                                    guint           button,
                                    guint           state)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));

    ibus_proxy_call ((IBusProxy *) engine,
                     "CandidateClicked",
                     G_TYPE_UINT, &index,
                     G_TYPE_UINT, &button,
                     G_TYPE_UINT, &state,
                     G_TYPE_INVALID);
}
示例#21
0
文件: panelproxy.c 项目: hychen/ibus
static void
bus_panel_proxy_real_destroy (BusPanelProxy *panel)
{
    if (ibus_proxy_get_connection ((IBusProxy *)panel) != NULL) {
        ibus_proxy_call ((IBusProxy *) panel,
                         "Destroy",
                         G_TYPE_INVALID);
    }

    if (panel->focused_context) {
        bus_panel_proxy_focus_out (panel, panel->focused_context);
        panel->focused_context = NULL;
    }

    IBUS_OBJECT_CLASS(bus_panel_proxy_parent_class)->destroy (IBUS_OBJECT (panel));
}
示例#22
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_update_preedit_text (BusPanelProxy  *panel,
                                     IBusText       *text,
                                     guint           cursor_pos,
                                     gboolean        visible)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));
    g_assert (text != NULL);

    ibus_proxy_call ((IBusProxy *) panel,
                     "UpdatePreeditText",
                     IBUS_TYPE_TEXT, &text,
                     G_TYPE_UINT, &cursor_pos,
                     G_TYPE_BOOLEAN, &visible,
                     G_TYPE_INVALID);
}
示例#23
0
文件: engineproxy.c 项目: XueWei/ibus
void
bus_engine_proxy_set_cursor_location (BusEngineProxy *engine,
                                      gint            x,
                                      gint            y,
                                      gint            w,
                                      gint            h)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));

    ibus_proxy_call ((IBusProxy *) engine,
                     "SetCursorLocation",
                     G_TYPE_INT, &x,
                     G_TYPE_INT, &y,
                     G_TYPE_INT, &w,
                     G_TYPE_INT, &h,
                     G_TYPE_INVALID);
}
示例#24
0
文件: panelproxy.c 项目: hychen/ibus
void
bus_panel_proxy_set_cursor_location (BusPanelProxy *panel,
                                     gint           x,
                                     gint           y,
                                     gint           w,
                                     gint           h)
{
    g_assert (BUS_IS_PANEL_PROXY (panel));

    ibus_proxy_call ((IBusProxy *) panel,
                     "SetCursorLocation",
                     G_TYPE_INT, &x,
                     G_TYPE_INT, &y,
                     G_TYPE_INT, &w,
                     G_TYPE_INT, &h,
                     G_TYPE_INVALID);
}
示例#25
0
void
ibus_input_context_set_cursor_location (IBusInputContext *context,
                                        gint32            x,
                                        gint32            y,
                                        gint32            w,
                                        gint32            h)
{
    g_assert (IBUS_IS_INPUT_CONTEXT (context));

    ibus_proxy_call ((IBusProxy *) context,
                     "SetCursorLocation",
                     G_TYPE_INT, &x,
                     G_TYPE_INT, &y,
                     G_TYPE_INT, &w,
                     G_TYPE_INT, &h,
                     G_TYPE_INVALID);
}
示例#26
0
文件: panelproxy.c 项目: iwaim/ibus
static void
bus_panel_proxy_real_destroy (BusPanelProxy *panel)
{
    BusPanelProxyPrivate *priv;
    priv = BUS_PANEL_PROXY_GET_PRIVATE (panel);

    if (ibus_proxy_get_connection ((IBusProxy *)panel) != NULL) {
        ibus_proxy_call ((IBusProxy *) panel,
                         "Destroy",
                         G_TYPE_INVALID);
    }

    if (priv->focused_context) {
        bus_panel_proxy_focus_out (panel, priv->focused_context);
        priv->focused_context = NULL;
    }

    IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (panel));
}
示例#27
0
gboolean
ibus_config_set_value (IBusConfig   *config,
                       const gchar  *section,
                       const gchar  *name,
                       const GValue *value)
{
    g_assert (IBUS_IS_CONFIG (config));
    g_assert (section != NULL);
    g_assert (name != NULL);
    g_assert (value != NULL);

    gboolean retval;

    retval = ibus_proxy_call ((IBusProxy *) config,
                              "SetValue",
                              G_TYPE_STRING, &section,
                              G_TYPE_STRING, &name,
                              G_TYPE_VALUE, value,
                              G_TYPE_INVALID);
    g_assert (retval);
    return TRUE;
}
示例#28
0
文件: engineproxy.c 项目: hychen/ibus
void
bus_engine_proxy_set_cursor_location (BusEngineProxy *engine,
                                      gint            x,
                                      gint            y,
                                      gint            w,
                                      gint            h)
{
    g_assert (BUS_IS_ENGINE_PROXY (engine));

    if (engine->x != x || engine->y != y || engine->w != w || engine->h != h) {
        engine->x = x;
        engine->y = y;
        engine->w = w;
        engine->h = h;
        ibus_proxy_call ((IBusProxy *) engine,
                         "SetCursorLocation",
                         G_TYPE_INT, &x,
                         G_TYPE_INT, &y,
                         G_TYPE_INT, &w,
                         G_TYPE_INT, &h,
                         G_TYPE_INVALID);
    }
}