|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4: */
|
|
Packit Service |
1d8f1c |
/* ibus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
|
|
rpm-build |
f3645b |
* Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
|
|
rpm-build |
f3645b |
* Copyright (C) 2008-2018 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
#include "ibusinputcontext.h"
|
|
Packit Service |
1d8f1c |
#include <gio/gio.h>
|
|
Packit Service |
1d8f1c |
#include "ibusshare.h"
|
|
Packit Service |
1d8f1c |
#include "ibusinternal.h"
|
|
Packit Service |
1d8f1c |
#include "ibusmarshalers.h"
|
|
Packit Service |
1d8f1c |
#include "ibusattribute.h"
|
|
Packit Service |
1d8f1c |
#include "ibuslookuptable.h"
|
|
Packit Service |
1d8f1c |
#include "ibusproplist.h"
|
|
Packit Service |
1d8f1c |
#include "ibuserror.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#define IBUS_INPUT_CONTEXT_GET_PRIVATE(o) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_INPUT_CONTEXT, IBusInputContextPrivate))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
enum {
|
|
Packit Service |
1d8f1c |
ENABLED,
|
|
Packit Service |
1d8f1c |
DISABLED,
|
|
Packit Service |
1d8f1c |
COMMIT_TEXT,
|
|
Packit Service |
1d8f1c |
FORWARD_KEY_EVENT,
|
|
Packit Service |
1d8f1c |
DELETE_SURROUNDING_TEXT,
|
|
Packit Service |
1d8f1c |
UPDATE_PREEDIT_TEXT,
|
|
rpm-build |
f3645b |
UPDATE_PREEDIT_TEXT_WITH_MODE,
|
|
Packit Service |
1d8f1c |
SHOW_PREEDIT_TEXT,
|
|
Packit Service |
1d8f1c |
HIDE_PREEDIT_TEXT,
|
|
Packit Service |
1d8f1c |
UPDATE_AUXILIARY_TEXT,
|
|
Packit Service |
1d8f1c |
SHOW_AUXILIARY_TEXT,
|
|
Packit Service |
1d8f1c |
HIDE_AUXILIARY_TEXT,
|
|
Packit Service |
1d8f1c |
UPDATE_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
SHOW_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
HIDE_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
PAGE_UP_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
PAGE_DOWN_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
CURSOR_UP_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
CURSOR_DOWN_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
REGISTER_PROPERTIES,
|
|
Packit Service |
1d8f1c |
UPDATE_PROPERTY,
|
|
Packit Service |
1d8f1c |
LAST_SIGNAL,
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* IBusInputContextPrivate */
|
|
Packit Service |
1d8f1c |
struct _IBusInputContextPrivate {
|
|
Packit Service |
1d8f1c |
/* TRUE if the current engine needs surrounding text; FALSE otherwise */
|
|
Packit Service |
1d8f1c |
gboolean needs_surrounding_text;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* cached surrounding text (see also IBusEnginePrivate and
|
|
Packit Service |
1d8f1c |
BusEngineProxy) */
|
|
Packit Service |
1d8f1c |
IBusText *surrounding_text;
|
|
Packit Service |
1d8f1c |
guint surrounding_cursor_pos;
|
|
Packit Service |
1d8f1c |
guint selection_anchor_pos;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _IBusInputContextPrivate IBusInputContextPrivate;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static guint context_signals[LAST_SIGNAL] = { 0 };
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static IBusText *text_empty = NULL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* functions prototype */
|
|
Packit Service |
1d8f1c |
static void ibus_input_context_real_destroy (IBusProxy *context);
|
|
Packit Service |
1d8f1c |
static void ibus_input_context_g_signal (GDBusProxy *proxy,
|
|
Packit Service |
1d8f1c |
const gchar *sender_name,
|
|
Packit Service |
1d8f1c |
const gchar *signal_name,
|
|
Packit Service |
1d8f1c |
GVariant *parameters);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_DEFINE_TYPE (IBusInputContext, ibus_input_context, IBUS_TYPE_PROXY)
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
ibus_input_context_class_init (IBusInputContextClass *class)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusProxyClass *ibus_proxy_class = IBUS_PROXY_CLASS (class);
|
|
Packit Service |
1d8f1c |
GDBusProxyClass *g_dbus_proxy_class = G_DBUS_PROXY_CLASS (class);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_type_class_add_private (class, sizeof (IBusInputContextPrivate));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
ibus_proxy_class->destroy = ibus_input_context_real_destroy;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_class->g_signal = ibus_input_context_g_signal;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* install signals */
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::enabled:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted when an IME is enabled.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[ENABLED] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("enabled"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::disabled:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted when an IME is disabled.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[DISABLED] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("disabled"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::commit-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @text: Text to be committed.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted when the text is going to be committed.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* (Note: The text object is floating, and it will be released after the
|
|
Packit Service |
1d8f1c |
* signal. If signal handler wants to keep the object, the handler should
|
|
Packit Service |
1d8f1c |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[COMMIT_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("commit-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__OBJECT,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
1,
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_TEXT);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::forward-key-event:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @keyval: Key symbol of the keyboard event.
|
|
Packit Service |
1d8f1c |
* @keycode: Key symbol of the keyboard event.
|
|
Packit Service |
1d8f1c |
* @modifiers: Key modifier flags.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to forward key event from IME to client of IME.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[FORWARD_KEY_EVENT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("forward-key-event"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__UINT_UINT_UINT,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
3,
|
|
Packit Service |
1d8f1c |
G_TYPE_UINT,
|
|
Packit Service |
1d8f1c |
G_TYPE_UINT,
|
|
Packit Service |
1d8f1c |
G_TYPE_UINT);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::delete-surrounding-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @offset: the character offset from the cursor position of the text to be deleted.
|
|
Packit Service |
1d8f1c |
* A negative value indicates a position before the cursor.
|
|
Packit Service |
1d8f1c |
* @n_chars: the number of characters to be deleted.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to delete surrounding text event from IME to client of IME.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[DELETE_SURROUNDING_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("delete-surrounding-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__INT_UINT,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
2,
|
|
Packit Service |
1d8f1c |
G_TYPE_INT,
|
|
Packit Service |
1d8f1c |
G_TYPE_UINT);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::update-preedit-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @text: Text to be updated.
|
|
Packit Service |
1d8f1c |
* @cursor_pos: Cursor position.
|
|
Packit Service |
1d8f1c |
* @visible: Whether the update is visible.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to update preedit text.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* (Note: The text object is floating, and it will be released after the
|
|
Packit Service |
1d8f1c |
* signal. If signal handler wants to keep the object, the handler should
|
|
Packit Service |
1d8f1c |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_PREEDIT_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("update-preedit-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__OBJECT_UINT_BOOLEAN,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
3,
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_TEXT,
|
|
Packit Service |
1d8f1c |
G_TYPE_UINT,
|
|
Packit Service |
1d8f1c |
G_TYPE_BOOLEAN);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
rpm-build |
f3645b |
* IBusInputContext::update-preedit-text-with-mode:
|
|
rpm-build |
f3645b |
* @context: An IBusInputContext.
|
|
rpm-build |
f3645b |
* @text: Text to be updated.
|
|
rpm-build |
f3645b |
* @cursor_pos: Cursor position.
|
|
rpm-build |
f3645b |
* @visible: Whether the update is visible.
|
|
rpm-build |
f3645b |
* @mode: Preedit mode.
|
|
rpm-build |
f3645b |
*
|
|
rpm-build |
f3645b |
* Emitted to update preedit text with the mode.
|
|
rpm-build |
f3645b |
*
|
|
rpm-build |
f3645b |
* (Note: The text object is floating, and it will be released after the
|
|
rpm-build |
f3645b |
* signal. If signal handler wants to keep the object, the handler should
|
|
rpm-build |
f3645b |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
rpm-build |
f3645b |
*/
|
|
rpm-build |
f3645b |
context_signals[UPDATE_PREEDIT_TEXT_WITH_MODE] =
|
|
rpm-build |
f3645b |
g_signal_new (I_("update-preedit-text-with-mode"),
|
|
rpm-build |
f3645b |
G_TYPE_FROM_CLASS (class),
|
|
rpm-build |
f3645b |
G_SIGNAL_RUN_LAST,
|
|
rpm-build |
f3645b |
0,
|
|
rpm-build |
f3645b |
NULL, NULL,
|
|
rpm-build |
f3645b |
_ibus_marshal_VOID__OBJECT_UINT_BOOLEAN_UINT,
|
|
rpm-build |
f3645b |
G_TYPE_NONE,
|
|
rpm-build |
f3645b |
4,
|
|
rpm-build |
f3645b |
IBUS_TYPE_TEXT,
|
|
rpm-build |
f3645b |
G_TYPE_UINT,
|
|
rpm-build |
f3645b |
G_TYPE_BOOLEAN,
|
|
rpm-build |
f3645b |
G_TYPE_UINT);
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::show-preedit-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to show preedit text.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[SHOW_PREEDIT_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("show-preedit-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::hide-preedit-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to hide preedit text.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[HIDE_PREEDIT_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("hide-preedit-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::update-auxiliary-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @text: An auxiliary text
|
|
Packit Service |
1d8f1c |
* @visible: The visibility of @text
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to hide auxilary text.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* (Note: The text object is floating, and it will be released after the
|
|
Packit Service |
1d8f1c |
* signal. If signal handler wants to keep the object, the handler should
|
|
Packit Service |
1d8f1c |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_AUXILIARY_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("update-auxiliary-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__OBJECT_BOOLEAN,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 2,
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_TEXT,
|
|
Packit Service |
1d8f1c |
G_TYPE_BOOLEAN);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::show-auxiliary-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to show auxiliary text.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[SHOW_AUXILIARY_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("show-auxiliary-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::hide-auxiliary-text:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to hide auxiliary text.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[HIDE_AUXILIARY_TEXT] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("hide-auxiliary-text"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::update-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @table: An IBusLookupTable to be updated.
|
|
Packit Service |
1d8f1c |
* @visible: Whether the table should be visible.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to update lookup table.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* (Note: The table object is floating, and it will be released after the
|
|
Packit Service |
1d8f1c |
* signal. If signal handler wants to keep the object, the handler should
|
|
Packit Service |
1d8f1c |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("update-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__OBJECT_BOOLEAN,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 2,
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_LOOKUP_TABLE,
|
|
Packit Service |
1d8f1c |
G_TYPE_BOOLEAN);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::show-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to show lookup table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[SHOW_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("show-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::hide-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to hide lookup table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[HIDE_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("hide-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::page-up-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to view the previous page of lookup table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[PAGE_UP_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("page-up-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::page-down-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to view the next page of lookup table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[PAGE_DOWN_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("page-down-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::cursor-up-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to select previous candidate of lookup table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[CURSOR_UP_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("cursor-up-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE, 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::cursor-down-lookup-table:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to select next candidate of lookup table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[CURSOR_DOWN_LOOKUP_TABLE] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("cursor-down-lookup-table"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__VOID,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::register-properties:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @props: An IBusPropList that contains properties.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to register the properties in @props.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* (Note: The props object is floating, and it will be released after the
|
|
Packit Service |
1d8f1c |
* signal. If signal handler wants to keep the object, the handler should
|
|
Packit Service |
1d8f1c |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[REGISTER_PROPERTIES] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("register-properties"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__OBJECT,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
1,
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_PROP_LIST);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusInputContext::update-property:
|
|
Packit Service |
1d8f1c |
* @context: An IBusInputContext.
|
|
Packit Service |
1d8f1c |
* @prop: The IBusProperty to be updated.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emitted to update the property @prop.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* (Note: The prop object is floating, and it will be released after the
|
|
Packit Service |
1d8f1c |
* signal. If signal handler wants to keep the object, the handler should
|
|
Packit Service |
1d8f1c |
* use g_object_ref_sink() to get the ownership of the object.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_PROPERTY] =
|
|
Packit Service |
1d8f1c |
g_signal_new (I_("update-property"),
|
|
Packit Service |
1d8f1c |
G_TYPE_FROM_CLASS (class),
|
|
Packit Service |
1d8f1c |
G_SIGNAL_RUN_LAST,
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
NULL, NULL,
|
|
Packit Service |
1d8f1c |
_ibus_marshal_VOID__OBJECT,
|
|
Packit Service |
1d8f1c |
G_TYPE_NONE,
|
|
Packit Service |
1d8f1c |
1,
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_PROPERTY);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
text_empty = ibus_text_new_from_static_string ("");
|
|
Packit Service |
1d8f1c |
g_object_ref_sink (text_empty);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
ibus_input_context_init (IBusInputContext *context)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusInputContextPrivate *priv;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context);
|
|
Packit Service |
1d8f1c |
priv->surrounding_text = g_object_ref_sink (text_empty);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
ibus_input_context_real_destroy (IBusProxy *context)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusInputContextPrivate *priv;
|
|
Packit Service |
1d8f1c |
priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (IBUS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (priv->surrounding_text) {
|
|
Packit Service |
1d8f1c |
g_object_unref (priv->surrounding_text);
|
|
Packit Service |
1d8f1c |
priv->surrounding_text = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBUS_PROXY_CLASS(ibus_input_context_parent_class)->destroy (context);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
ibus_input_context_g_signal (GDBusProxy *proxy,
|
|
Packit Service |
1d8f1c |
const gchar *sender_name,
|
|
Packit Service |
1d8f1c |
const gchar *signal_name,
|
|
Packit Service |
1d8f1c |
GVariant *parameters)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (proxy));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusInputContext *context;
|
|
Packit Service |
1d8f1c |
context = IBUS_INPUT_CONTEXT (proxy);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static const struct {
|
|
Packit Service |
1d8f1c |
const gchar *signal_name;
|
|
Packit Service |
1d8f1c |
guint signal_id;
|
|
Packit Service |
1d8f1c |
} signals [] = {
|
|
Packit Service |
1d8f1c |
{ "ShowPreeditText", SHOW_PREEDIT_TEXT },
|
|
Packit Service |
1d8f1c |
{ "HidePreeditText", HIDE_PREEDIT_TEXT },
|
|
Packit Service |
1d8f1c |
{ "ShowAuxiliaryText", SHOW_AUXILIARY_TEXT },
|
|
Packit Service |
1d8f1c |
{ "HideAuxiliaryText", HIDE_AUXILIARY_TEXT },
|
|
Packit Service |
1d8f1c |
{ "ShowLookupTable", SHOW_LOOKUP_TABLE },
|
|
Packit Service |
1d8f1c |
{ "HideLookupTable", HIDE_LOOKUP_TABLE },
|
|
Packit Service |
1d8f1c |
{ "PageUpLookupTable", PAGE_UP_LOOKUP_TABLE },
|
|
Packit Service |
1d8f1c |
{ "PageDownLookupTable", PAGE_DOWN_LOOKUP_TABLE },
|
|
Packit Service |
1d8f1c |
{ "CursorUpLookupTable", CURSOR_UP_LOOKUP_TABLE },
|
|
Packit Service |
1d8f1c |
{ "CursorDownLookupTable", CURSOR_DOWN_LOOKUP_TABLE },
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "CommitText") == 0) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = NULL;
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(v)", &variant);
|
|
Packit Service |
1d8f1c |
IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
g_signal_emit (context, context_signals[COMMIT_TEXT], 0, text);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_object_is_floating (text))
|
|
Packit Service |
1d8f1c |
g_object_unref (text);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "UpdatePreeditText") == 0) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = NULL;
|
|
Packit Service |
1d8f1c |
gint32 cursor_pos;
|
|
Packit Service |
1d8f1c |
gboolean visible;
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(vub)", &variant, &cursor_pos, &visible);
|
|
Packit Service |
1d8f1c |
IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_signal_emit (context,
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_PREEDIT_TEXT],
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
text,
|
|
Packit Service |
1d8f1c |
cursor_pos,
|
|
Packit Service |
1d8f1c |
visible);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_object_is_floating (text))
|
|
Packit Service |
1d8f1c |
g_object_unref (text);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
rpm-build |
f3645b |
if (g_strcmp0 (signal_name, "UpdatePreeditTextWithMode") == 0) {
|
|
rpm-build |
f3645b |
GVariant *variant = NULL;
|
|
rpm-build |
f3645b |
gint32 cursor_pos;
|
|
rpm-build |
f3645b |
gboolean visible;
|
|
rpm-build |
f3645b |
guint mode = 0;
|
|
rpm-build |
f3645b |
g_variant_get (parameters,
|
|
rpm-build |
f3645b |
"(vubu)", &variant, &cursor_pos, &visible, &mode);
|
|
rpm-build |
f3645b |
IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant));
|
|
rpm-build |
f3645b |
g_variant_unref (variant);
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
g_signal_emit (context,
|
|
rpm-build |
f3645b |
context_signals[UPDATE_PREEDIT_TEXT_WITH_MODE],
|
|
rpm-build |
f3645b |
0,
|
|
rpm-build |
f3645b |
text,
|
|
rpm-build |
f3645b |
cursor_pos,
|
|
rpm-build |
f3645b |
visible,
|
|
rpm-build |
f3645b |
mode);
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
if (g_object_is_floating (text))
|
|
rpm-build |
f3645b |
g_object_unref (text);
|
|
rpm-build |
f3645b |
return;
|
|
rpm-build |
f3645b |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* lookup signal in table */
|
|
Packit Service |
1d8f1c |
gint i;
|
|
Packit Service |
1d8f1c |
for (i = 0;
|
|
Packit Service |
1d8f1c |
i < G_N_ELEMENTS (signals) && g_strcmp0 (signal_name, signals[i].signal_name) != 0;
|
|
Packit Service |
1d8f1c |
i++);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (i < G_N_ELEMENTS (signals)) {
|
|
Packit Service |
1d8f1c |
g_signal_emit (context, context_signals[signals[i].signal_id], 0);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "UpdateAuxiliaryText") == 0) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = NULL;
|
|
Packit Service |
1d8f1c |
gboolean visible;
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(vb)", &variant, &visible);
|
|
Packit Service |
1d8f1c |
IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_signal_emit (context,
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_AUXILIARY_TEXT],
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
text,
|
|
Packit Service |
1d8f1c |
visible);
|
|
Packit Service |
1d8f1c |
if (g_object_is_floating (text))
|
|
Packit Service |
1d8f1c |
g_object_unref (text);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "UpdateLookupTable") == 0) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = NULL;
|
|
Packit Service |
1d8f1c |
gboolean visible;
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(vb)", &variant, &visible);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusLookupTable *table = IBUS_LOOKUP_TABLE (ibus_serializable_deserialize (variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_signal_emit (context,
|
|
Packit Service |
1d8f1c |
context_signals[UPDATE_LOOKUP_TABLE],
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
table,
|
|
Packit Service |
1d8f1c |
visible);
|
|
Packit Service |
1d8f1c |
if (g_object_is_floating (table))
|
|
Packit Service |
1d8f1c |
g_object_unref (table);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "RegisterProperties") == 0) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = NULL;
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(v)", &variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusPropList *prop_list = IBUS_PROP_LIST (ibus_serializable_deserialize (variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_signal_emit (context,
|
|
Packit Service |
1d8f1c |
context_signals[REGISTER_PROPERTIES],
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
prop_list);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_object_is_floating (prop_list))
|
|
Packit Service |
1d8f1c |
g_object_unref (prop_list);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "UpdateProperty") == 0) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = NULL;
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(v)", &variant);
|
|
Packit Service |
1d8f1c |
IBusProperty *prop = IBUS_PROPERTY (ibus_serializable_deserialize (variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_signal_emit (context, context_signals[UPDATE_PROPERTY], 0, prop);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_object_is_floating (prop))
|
|
Packit Service |
1d8f1c |
g_object_unref (prop);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "ForwardKeyEvent") == 0) {
|
|
Packit Service |
1d8f1c |
guint32 keyval;
|
|
Packit Service |
1d8f1c |
guint32 keycode;
|
|
Packit Service |
1d8f1c |
guint32 state;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(uuu)", &keyval, &keycode, &state);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* Forward key event back with IBUS_FORWARD_MASK. And process_key_event will
|
|
Packit Service |
1d8f1c |
* not process key event with IBUS_FORWARD_MASK again. */
|
|
Packit Service |
1d8f1c |
g_signal_emit (context,
|
|
Packit Service |
1d8f1c |
context_signals[FORWARD_KEY_EVENT],
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
keyval,
|
|
Packit Service |
1d8f1c |
keycode,
|
|
Packit Service |
1d8f1c |
state | IBUS_FORWARD_MASK);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "DeleteSurroundingText") == 0) {
|
|
Packit Service |
1d8f1c |
gint offset_from_cursor;
|
|
Packit Service |
1d8f1c |
guint nchars;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_variant_get (parameters, "(iu)", &offset_from_cursor, &nchars);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_signal_emit (context,
|
|
Packit Service |
1d8f1c |
context_signals[DELETE_SURROUNDING_TEXT],
|
|
Packit Service |
1d8f1c |
0,
|
|
Packit Service |
1d8f1c |
offset_from_cursor,
|
|
Packit Service |
1d8f1c |
nchars);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusInputContextPrivate *priv;
|
|
Packit Service |
1d8f1c |
priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (IBUS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "Enabled") == 0) {
|
|
Packit Service |
1d8f1c |
priv->needs_surrounding_text = FALSE;
|
|
Packit Service |
1d8f1c |
g_signal_emit (context, context_signals[ENABLED], 0);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "Disabled") == 0) {
|
|
Packit Service |
1d8f1c |
priv->needs_surrounding_text = FALSE;
|
|
Packit Service |
1d8f1c |
g_signal_emit (context, context_signals[DISABLED], 0);
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (signal_name, "RequireSurroundingText") == 0) {
|
|
Packit Service |
1d8f1c |
priv->needs_surrounding_text = TRUE;
|
|
Packit Service |
1d8f1c |
return;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_DBUS_PROXY_CLASS (ibus_input_context_parent_class)->g_signal (
|
|
Packit Service |
1d8f1c |
proxy, sender_name, signal_name, parameters);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusInputContext *
|
|
Packit Service |
1d8f1c |
ibus_input_context_new (const gchar *path,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
GCancellable *cancellable,
|
|
Packit Service |
1d8f1c |
GError **error)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (path != NULL);
|
|
Packit Service |
1d8f1c |
g_assert (G_IS_DBUS_CONNECTION (connection));
|
|
Packit Service |
1d8f1c |
const gchar *service_name = IBUS_SERVICE_IBUS;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GInitable *initable;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_object_get_data (G_OBJECT (connection), "ibus-portal-connection"))
|
|
Packit Service |
1d8f1c |
service_name = IBUS_SERVICE_PORTAL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
initable = g_initable_new (IBUS_TYPE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
cancellable,
|
|
Packit Service |
1d8f1c |
error,
|
|
Packit Service |
1d8f1c |
"g-connection", connection,
|
|
Packit Service |
1d8f1c |
"g-name", service_name,
|
|
Packit Service |
1d8f1c |
"g-flags", flags,
|
|
Packit Service |
1d8f1c |
"g-interface-name", IBUS_INTERFACE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
"g-object-path", path,
|
|
Packit Service |
1d8f1c |
"g-default-timeout", ibus_get_timeout (),
|
|
Packit Service |
1d8f1c |
NULL);
|
|
Packit Service |
1d8f1c |
if (initable != NULL)
|
|
Packit Service |
1d8f1c |
return IBUS_INPUT_CONTEXT (initable);
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_new_async (const gchar *path,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
GCancellable *cancellable,
|
|
Packit Service |
1d8f1c |
GAsyncReadyCallback callback,
|
|
Packit Service |
1d8f1c |
gpointer user_data)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (path != NULL);
|
|
Packit Service |
1d8f1c |
g_assert (G_IS_DBUS_CONNECTION (connection));
|
|
Packit Service |
1d8f1c |
g_assert (callback != NULL);
|
|
Packit Service |
1d8f1c |
const gchar *service_name = IBUS_SERVICE_IBUS;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (g_object_get_data (G_OBJECT (connection), "ibus-portal-connection"))
|
|
Packit Service |
1d8f1c |
service_name = IBUS_SERVICE_PORTAL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_async_initable_new_async (IBUS_TYPE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
G_PRIORITY_DEFAULT,
|
|
Packit Service |
1d8f1c |
cancellable,
|
|
Packit Service |
1d8f1c |
callback,
|
|
Packit Service |
1d8f1c |
user_data,
|
|
Packit Service |
1d8f1c |
"g-connection", connection,
|
|
Packit Service |
1d8f1c |
"g-name", service_name,
|
|
Packit Service |
1d8f1c |
"g-flags", flags,
|
|
Packit Service |
1d8f1c |
"g-interface-name", IBUS_INTERFACE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
"g-object-path", path,
|
|
Packit Service |
1d8f1c |
"g-default-timeout", ibus_get_timeout (),
|
|
Packit Service |
1d8f1c |
NULL);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusInputContext *
|
|
Packit Service |
1d8f1c |
ibus_input_context_new_async_finish (GAsyncResult *res,
|
|
Packit Service |
1d8f1c |
GError **error)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
GObject *object = NULL;
|
|
Packit Service |
1d8f1c |
GObject *source_object = NULL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
source_object = g_async_result_get_source_object (res);
|
|
Packit Service |
1d8f1c |
g_assert (source_object != NULL);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
|
|
Packit Service |
1d8f1c |
res,
|
|
Packit Service |
1d8f1c |
error);
|
|
Packit Service |
1d8f1c |
g_object_unref (source_object);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (object != NULL) {
|
|
Packit Service |
1d8f1c |
return IBUS_INPUT_CONTEXT (object);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
else {
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusInputContext *
|
|
Packit Service |
1d8f1c |
ibus_input_context_get_input_context (const gchar *path,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusInputContext *context = NULL;
|
|
Packit Service |
1d8f1c |
GError *error = NULL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
context = ibus_input_context_new (path, connection, NULL, &error);
|
|
Packit Service |
1d8f1c |
if (context == NULL) {
|
|
Packit Service |
1d8f1c |
g_warning ("ibus_input_context_get_input_context: %s", error->message);
|
|
Packit Service |
1d8f1c |
g_error_free (error);
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* Do not call "org.freedesktop.IBus.Service.Destroy" when the input
|
|
Packit Service |
1d8f1c |
* context object is disposed. */
|
|
Packit Service |
1d8f1c |
IBUS_PROXY (context)->own = FALSE;
|
|
Packit Service |
1d8f1c |
return context;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_get_input_context_async (const gchar *path,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
GCancellable *cancellable,
|
|
Packit Service |
1d8f1c |
GAsyncReadyCallback callback,
|
|
Packit Service |
1d8f1c |
gpointer user_data)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
ibus_input_context_new_async (path,
|
|
Packit Service |
1d8f1c |
connection,
|
|
Packit Service |
1d8f1c |
cancellable,
|
|
Packit Service |
1d8f1c |
callback,
|
|
Packit Service |
1d8f1c |
user_data);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusInputContext *
|
|
Packit Service |
1d8f1c |
ibus_input_context_get_input_context_async_finish (GAsyncResult *res,
|
|
Packit Service |
1d8f1c |
GError **error)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusInputContext *context = NULL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
context = ibus_input_context_new_async_finish (res, error);
|
|
Packit Service |
1d8f1c |
if (context == NULL) {
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* Do not call "org.freedesktop.IBus.Service.Destroy" when the input
|
|
Packit Service |
1d8f1c |
* context object is disposed. */
|
|
Packit Service |
1d8f1c |
IBUS_PROXY (context)->own = FALSE;
|
|
Packit Service |
1d8f1c |
return context;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_process_hand_writing_event (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
const gdouble *coordinates,
|
|
Packit Service |
1d8f1c |
guint coordinates_len)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_return_if_fail (coordinates != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (coordinates_len >= 4); /* The array should contain at least one line. */
|
|
Packit Service |
1d8f1c |
g_return_if_fail ((coordinates_len & 1) == 0);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
guint i;
|
|
Packit Service |
1d8f1c |
GVariantBuilder builder;
|
|
Packit Service |
1d8f1c |
g_variant_builder_init (&builder, G_VARIANT_TYPE ("ad"));
|
|
Packit Service |
1d8f1c |
for (i = 0; i < coordinates_len; i++) {
|
|
Packit Service |
1d8f1c |
g_variant_builder_add (&builder, "d", coordinates[i]);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"ProcessHandWritingEvent", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(ad)", &builder), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_cancel_hand_writing (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
guint n_strokes)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"CancelHandWriting", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(u)", n_strokes), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_process_key_event_async (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
guint32 keyval,
|
|
Packit Service |
1d8f1c |
guint32 keycode,
|
|
Packit Service |
1d8f1c |
guint32 state,
|
|
Packit Service |
1d8f1c |
gint timeout_msec,
|
|
Packit Service |
1d8f1c |
GCancellable *cancellable,
|
|
Packit Service |
1d8f1c |
GAsyncReadyCallback callback,
|
|
Packit Service |
1d8f1c |
gpointer user_data)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"ProcessKeyEvent", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(uuu)",
|
|
Packit Service |
1d8f1c |
keyval, keycode, state), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
timeout_msec, /* timeout */
|
|
Packit Service |
1d8f1c |
cancellable, /* cancellable */
|
|
Packit Service |
1d8f1c |
callback, /* callback */
|
|
Packit Service |
1d8f1c |
user_data /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gboolean
|
|
Packit Service |
1d8f1c |
ibus_input_context_process_key_event_async_finish (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
GAsyncResult *res,
|
|
Packit Service |
1d8f1c |
GError **error)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_assert (G_IS_ASYNC_RESULT (res));
|
|
Packit Service |
1d8f1c |
g_assert (error == NULL || *error == NULL);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gboolean processed = FALSE;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GVariant *variant = g_dbus_proxy_call_finish ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
res, error);
|
|
Packit Service |
1d8f1c |
if (variant != NULL) {
|
|
Packit Service |
1d8f1c |
g_variant_get (variant, "(b)", &processed);
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
return processed;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gboolean
|
|
Packit Service |
1d8f1c |
ibus_input_context_process_key_event (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
guint32 keyval,
|
|
Packit Service |
1d8f1c |
guint32 keycode,
|
|
Packit Service |
1d8f1c |
guint32 state)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GVariant *result = g_dbus_proxy_call_sync ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"ProcessKeyEvent", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(uuu)",
|
|
Packit Service |
1d8f1c |
keyval, keycode, state), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (result != NULL) {
|
|
Packit Service |
1d8f1c |
gboolean processed = FALSE;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_variant_get (result, "(b)", &processed);
|
|
Packit Service |
1d8f1c |
g_variant_unref (result);
|
|
Packit Service |
1d8f1c |
return processed;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
return FALSE;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_set_cursor_location (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
gint32 x,
|
|
Packit Service |
1d8f1c |
gint32 y,
|
|
Packit Service |
1d8f1c |
gint32 w,
|
|
Packit Service |
1d8f1c |
gint32 h)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"SetCursorLocation", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(iiii)", x, y, w, h),/* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_set_cursor_location_relative (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
gint32 x,
|
|
Packit Service |
1d8f1c |
gint32 y,
|
|
Packit Service |
1d8f1c |
gint32 w,
|
|
Packit Service |
1d8f1c |
gint32 h)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"SetCursorLocationRelative", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(iiii)", x, y, w, h),/* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_set_capabilities (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
guint32 capabilites)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"SetCapabilities", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(u)", capabilites), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_property_activate (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
const gchar *prop_name,
|
|
Packit Service |
1d8f1c |
guint32 state)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"PropertyActivate", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(su)",
|
|
Packit Service |
1d8f1c |
prop_name, state), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_property_show (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
const gchar *prop_name)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"PropertyShow", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(s)", prop_name), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_property_hide (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
const gchar *prop_name)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"PropertyHide", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(s)", prop_name), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_set_surrounding_text (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
IBusText *text,
|
|
Packit Service |
1d8f1c |
guint32 cursor_pos,
|
|
Packit Service |
1d8f1c |
guint32 anchor_pos)
|
|
Packit Service |
1d8f1c |
{
|
|
rpm-build |
f3645b |
IBusInputContextPrivate *priv;
|
|
rpm-build |
f3645b |
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_TEXT (text));
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (cursor_pos != priv->surrounding_cursor_pos ||
|
|
Packit Service |
1d8f1c |
anchor_pos != priv->selection_anchor_pos ||
|
|
Packit Service |
1d8f1c |
priv->surrounding_text == NULL ||
|
|
Packit Service |
1d8f1c |
g_strcmp0 (text->text, priv->surrounding_text->text) != 0) {
|
|
Packit Service |
1d8f1c |
if (priv->surrounding_text)
|
|
Packit Service |
1d8f1c |
g_object_unref (priv->surrounding_text);
|
|
Packit Service |
1d8f1c |
priv->surrounding_text = (IBusText *) g_object_ref_sink (text);
|
|
Packit Service |
1d8f1c |
priv->surrounding_cursor_pos = cursor_pos;
|
|
Packit Service |
1d8f1c |
priv->selection_anchor_pos = anchor_pos;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (priv->needs_surrounding_text) {
|
|
Packit Service |
1d8f1c |
GVariant *variant = ibus_serializable_serialize ((IBusSerializable *)text);
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"SetSurroundingText", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(vuu)",
|
|
Packit Service |
1d8f1c |
variant,
|
|
Packit Service |
1d8f1c |
cursor_pos,
|
|
Packit Service |
1d8f1c |
anchor_pos), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gboolean
|
|
Packit Service |
1d8f1c |
ibus_input_context_needs_surrounding_text (IBusInputContext *context)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusInputContextPrivate *priv;
|
|
Packit Service |
1d8f1c |
priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (IBUS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
return priv->needs_surrounding_text;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_set_content_type (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
guint purpose,
|
|
Packit Service |
1d8f1c |
guint hints)
|
|
Packit Service |
1d8f1c |
{
|
|
rpm-build |
f3645b |
GVariant *cached_content_type;
|
|
rpm-build |
f3645b |
GVariant *content_type;
|
|
rpm-build |
f3645b |
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
|
|
rpm-build |
f3645b |
cached_content_type =
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_get_cached_property ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"ContentType");
|
|
rpm-build |
f3645b |
content_type = g_variant_new ("(uu)", purpose, hints);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
g_variant_ref_sink (content_type);
|
|
Packit Service |
1d8f1c |
if (cached_content_type == NULL ||
|
|
Packit Service |
1d8f1c |
!g_variant_equal (content_type, cached_content_type)) {
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"org.freedesktop.DBus.Properties.Set",
|
|
Packit Service |
1d8f1c |
g_variant_new ("(ssv)",
|
|
Packit Service |
1d8f1c |
IBUS_INTERFACE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
"ContentType",
|
|
Packit Service |
1d8f1c |
content_type),
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE,
|
|
Packit Service |
1d8f1c |
-1,
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
if (cached_content_type != NULL)
|
|
Packit Service |
1d8f1c |
g_variant_unref (cached_content_type);
|
|
Packit Service |
1d8f1c |
g_variant_unref (content_type);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_get_engine_async (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
gint timeout_msec,
|
|
Packit Service |
1d8f1c |
GCancellable *cancellable,
|
|
Packit Service |
1d8f1c |
GAsyncReadyCallback callback,
|
|
Packit Service |
1d8f1c |
gpointer user_data)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"GetEngine", /* method_name */
|
|
Packit Service |
1d8f1c |
NULL, /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
timeout_msec,
|
|
Packit Service |
1d8f1c |
cancellable,
|
|
Packit Service |
1d8f1c |
callback,
|
|
Packit Service |
1d8f1c |
user_data);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusEngineDesc *
|
|
Packit Service |
1d8f1c |
ibus_input_context_get_engine_async_finish (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
GAsyncResult *res,
|
|
Packit Service |
1d8f1c |
GError **error)
|
|
Packit Service |
1d8f1c |
{
|
|
rpm-build |
f3645b |
GVariant *variant;
|
|
rpm-build |
f3645b |
GVariant *engine_desc_variant;
|
|
rpm-build |
f3645b |
IBusEngineDesc *desc;
|
|
rpm-build |
f3645b |
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_assert (G_IS_ASYNC_RESULT (res));
|
|
Packit Service |
1d8f1c |
g_assert (error == NULL || *error == NULL);
|
|
Packit Service |
1d8f1c |
|
|
rpm-build |
f3645b |
variant = g_dbus_proxy_call_finish ((GDBusProxy *) context, res, error);
|
|
Packit Service |
1d8f1c |
if (variant == NULL) {
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
rpm-build |
f3645b |
engine_desc_variant = g_variant_get_child_value (variant, 0);
|
|
rpm-build |
f3645b |
desc = IBUS_ENGINE_DESC (
|
|
rpm-build |
f3645b |
ibus_serializable_deserialize (engine_desc_variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (engine_desc_variant);
|
|
Packit Service |
1d8f1c |
g_variant_unref (variant);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
return desc;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
IBusEngineDesc *
|
|
Packit Service |
1d8f1c |
ibus_input_context_get_engine (IBusInputContext *context)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
GVariant *result = NULL;
|
|
Packit Service |
1d8f1c |
GError *error = NULL;
|
|
rpm-build |
f3645b |
GVariant *engine_desc_variant;
|
|
rpm-build |
f3645b |
IBusEngineDesc *desc;
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
rpm-build |
f3645b |
|
|
Packit Service |
1d8f1c |
result = g_dbus_proxy_call_sync ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"GetEngine", /* method_name */
|
|
Packit Service |
1d8f1c |
NULL, /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
&error /* error */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
if (result == NULL) {
|
|
Packit Service |
1d8f1c |
if (g_error_matches (error, IBUS_ERROR, IBUS_ERROR_NO_ENGINE)) {
|
|
Packit Service |
1d8f1c |
g_debug ("%s.GetEngine: %s",
|
|
Packit Service |
1d8f1c |
IBUS_INTERFACE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
error->message);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
else {
|
|
Packit Service |
1d8f1c |
g_warning ("%s.GetEngine: %s",
|
|
Packit Service |
1d8f1c |
IBUS_INTERFACE_INPUT_CONTEXT,
|
|
Packit Service |
1d8f1c |
error->message);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
g_error_free (error);
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
rpm-build |
f3645b |
engine_desc_variant = g_variant_get_child_value (result, 0);
|
|
rpm-build |
f3645b |
desc = IBUS_ENGINE_DESC (
|
|
rpm-build |
f3645b |
ibus_serializable_deserialize (engine_desc_variant));
|
|
Packit Service |
1d8f1c |
g_variant_unref (engine_desc_variant);
|
|
Packit Service |
1d8f1c |
g_variant_unref (result);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
return desc;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
ibus_input_context_set_engine (IBusInputContext *context,
|
|
Packit Service |
1d8f1c |
const gchar *name)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
Packit Service |
1d8f1c |
g_assert (name);
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
Packit Service |
1d8f1c |
"SetEngine", /* method_name */
|
|
Packit Service |
1d8f1c |
g_variant_new ("(s)", name), /* parameters */
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */
|
|
Packit Service |
1d8f1c |
-1, /* timeout */
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */
|
|
Packit Service |
1d8f1c |
NULL, /* callback */
|
|
Packit Service |
1d8f1c |
NULL /* user_data */
|
|
Packit Service |
1d8f1c |
);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
rpm-build |
f3645b |
void
|
|
rpm-build |
f3645b |
ibus_input_context_set_client_commit_preedit (IBusInputContext *context,
|
|
rpm-build |
f3645b |
gboolean client_commit)
|
|
rpm-build |
f3645b |
{
|
|
rpm-build |
f3645b |
GVariant *cached_content_type;
|
|
rpm-build |
f3645b |
GVariant *var_client_commit;
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
cached_content_type =
|
|
rpm-build |
f3645b |
g_dbus_proxy_get_cached_property ((GDBusProxy *) context,
|
|
rpm-build |
f3645b |
"ClientCommitPreedit");
|
|
rpm-build |
f3645b |
var_client_commit = g_variant_new ("(b)", client_commit);
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
g_variant_ref_sink (var_client_commit);
|
|
rpm-build |
f3645b |
if (cached_content_type == NULL) {
|
|
rpm-build |
f3645b |
g_dbus_proxy_call ((GDBusProxy *) context,
|
|
rpm-build |
f3645b |
"org.freedesktop.DBus.Properties.Set",
|
|
rpm-build |
f3645b |
g_variant_new ("(ssv)",
|
|
rpm-build |
f3645b |
IBUS_INTERFACE_INPUT_CONTEXT,
|
|
rpm-build |
f3645b |
"ClientCommitPreedit",
|
|
rpm-build |
f3645b |
var_client_commit),
|
|
rpm-build |
f3645b |
G_DBUS_CALL_FLAGS_NONE,
|
|
rpm-build |
f3645b |
-1,
|
|
rpm-build |
f3645b |
NULL, /* cancellable */
|
|
rpm-build |
f3645b |
NULL, /* callback */
|
|
rpm-build |
f3645b |
NULL /* user_data */
|
|
rpm-build |
f3645b |
);
|
|
rpm-build |
f3645b |
}
|
|
rpm-build |
f3645b |
|
|
rpm-build |
f3645b |
if (cached_content_type != NULL)
|
|
rpm-build |
f3645b |
g_variant_unref (cached_content_type);
|
|
rpm-build |
f3645b |
g_variant_unref (var_client_commit);
|
|
rpm-build |
f3645b |
}
|
|
rpm-build |
f3645b |
|
|
Packit Service |
1d8f1c |
#define DEFINE_FUNC(name, Name) \
|
|
Packit Service |
1d8f1c |
void \
|
|
Packit Service |
1d8f1c |
ibus_input_context_##name (IBusInputContext *context) \
|
|
Packit Service |
1d8f1c |
{ \
|
|
Packit Service |
1d8f1c |
g_assert (IBUS_IS_INPUT_CONTEXT (context)); \
|
|
Packit Service |
1d8f1c |
g_dbus_proxy_call ((GDBusProxy *) context, \
|
|
Packit Service |
1d8f1c |
#Name, /* method_name */ \
|
|
Packit Service |
1d8f1c |
NULL, /* parameters */ \
|
|
Packit Service |
1d8f1c |
G_DBUS_CALL_FLAGS_NONE, /* flags */ \
|
|
Packit Service |
1d8f1c |
-1, /* timeout */ \
|
|
Packit Service |
1d8f1c |
NULL, /* cancellable */ \
|
|
Packit Service |
1d8f1c |
NULL, /* callback */ \
|
|
Packit Service |
1d8f1c |
NULL /* user_data */ \
|
|
Packit Service |
1d8f1c |
); \
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(focus_in, FocusIn);
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(focus_out, FocusOut);
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(reset, Reset);
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(page_up, PageUp);
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(page_down, PageDown);
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(cursor_up, CursorUp);
|
|
Packit Service |
1d8f1c |
DEFINE_FUNC(cursor_down, CursorDown);
|
|
Packit Service |
1d8f1c |
#undef DEFINE_FUNC
|