|
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-2015 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2017 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 |
|
|
Packit Service |
1d8f1c |
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
|
|
Packit Service |
1d8f1c |
#error "Only <ibus.h> can be included directly"
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#ifndef __IBUS_ENGINE_SIMPLE_H__
|
|
Packit Service |
1d8f1c |
#define __IBUS_ENGINE_SIMPLE_H__
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* SECTION: ibusenginesimple
|
|
Packit Service |
1d8f1c |
* @short_description: Input method engine supporting table-based input method
|
|
Packit Service |
1d8f1c |
* @title: IBusEngineSimple
|
|
Packit Service |
1d8f1c |
* @stability: Stable
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* An IBusEngineSimple provides table-based input method logic.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* see_also: #IBusEngine
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include "ibusengine.h"
|
|
Packit Service |
1d8f1c |
#include "ibuskeysyms.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_BEGIN_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#define IBUS_MAX_COMPOSE_LEN 7
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*
|
|
Packit Service |
1d8f1c |
* Type macros.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* define GOBJECT macros */
|
|
Packit Service |
1d8f1c |
#define IBUS_TYPE_ENGINE_SIMPLE \
|
|
Packit Service |
1d8f1c |
(ibus_engine_simple_get_type ())
|
|
Packit Service |
1d8f1c |
#define IBUS_ENGINE_SIMPLE(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimple))
|
|
Packit Service |
1d8f1c |
#define IBUS_ENGINE_SIMPLE_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimpleClass))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_ENGINE_SIMPLE(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ENGINE_SIMPLE))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_ENGINE_SIMPLE_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ENGINE_SIMPLE))
|
|
Packit Service |
1d8f1c |
#define IBUS_ENGINE_SIMPLE_GET_CLASS(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimpleClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _IBusEngineSimple IBusEngineSimple;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusEngineSimpleClass IBusEngineSimpleClass;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusEngineSimplePrivate IBusEngineSimplePrivate;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusEngineSimple:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* IBusEngineSimple properties.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
struct _IBusEngineSimple {
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusEngine parent;
|
|
Packit Service |
1d8f1c |
IBusEngineSimplePrivate *priv;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* instance members */
|
|
Packit Service |
1d8f1c |
/*< public >*/
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _IBusEngineSimpleClass {
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusEngineClass parent;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* class members */
|
|
Packit Service |
1d8f1c |
/*< public >*/
|
|
Packit Service |
1d8f1c |
/* signals */
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
/* padding */
|
|
Packit Service |
1d8f1c |
gpointer pdummy[8];
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static const guint16 IBUS_COMPOSE_IGNORE_KEYLIST[] = {
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Shift_L,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Shift_R,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Control_L,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Control_R,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Caps_Lock,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Shift_Lock,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Meta_L,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Meta_R,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Alt_L,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Alt_R,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Super_L,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Super_R,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Hyper_L,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Hyper_R,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_Mode_switch,
|
|
Packit Service |
1d8f1c |
IBUS_KEY_ISO_Level3_Shift
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType ibus_engine_simple_get_type (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_engine_simple_add_table:
|
|
Packit Service |
1d8f1c |
* @simple: An IBusEngineSimple.
|
|
Packit Service |
1d8f1c |
* @data: (element-type guint16) (array): The table which must be available
|
|
Packit Service |
1d8f1c |
* during the whole life of the simple engine.
|
|
Packit Service |
1d8f1c |
* @max_seq_len: Maximum length of a swquence in the table (cannot be greater
|
|
Packit Service |
1d8f1c |
* than %IBUS_MAX_COMPOSE_LEN)
|
|
Packit Service |
1d8f1c |
* @n_seqs: number of sequences in the table
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Adds an additional table to search to the engine. Each row of the table
|
|
Packit Service |
1d8f1c |
* consists of max_seq_len key symbols followed by two guint16 interpreted as
|
|
Packit Service |
1d8f1c |
* the high and low words of a gunicode value. Tables are searched starting from
|
|
Packit Service |
1d8f1c |
* the last added.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* The table must be sorted in dictionary order on the numeric value of the key
|
|
Packit Service |
1d8f1c |
* symbol fields. (Values beyond the length of the sequence should be zero.)
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_engine_simple_add_table (IBusEngineSimple *simple,
|
|
Packit Service |
1d8f1c |
const guint16 *data,
|
|
Packit Service |
1d8f1c |
gint max_seq_len,
|
|
Packit Service |
1d8f1c |
gint n_seqs);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_engine_simple_add_table_by_locale:
|
|
Packit Service |
1d8f1c |
* @simple: An IBusEngineSimple.
|
|
Packit Service |
1d8f1c |
* @locale: (allow-none): The locale name. If the locale is %NULL,
|
|
Packit Service |
1d8f1c |
* the current locale is used.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Call ibus_engine_simple_add_table() internally by locale.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the @locale is matched to the table.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_engine_simple_add_table_by_locale
|
|
Packit Service |
1d8f1c |
(IBusEngineSimple *simple,
|
|
Packit Service |
1d8f1c |
const gchar *locale);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_engine_simple_add_compose_file:
|
|
Packit Service |
1d8f1c |
* @simple: An IBusEngineSimple.
|
|
Packit Service |
1d8f1c |
* @file: The compose file.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Call ibus_engine_simple_add_table() internally by locale.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the @file is loaded.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_engine_simple_add_compose_file
|
|
Packit Service |
1d8f1c |
(IBusEngineSimple *simple,
|
|
Packit Service |
1d8f1c |
const gchar *file);
|
|
Packit Service |
1d8f1c |
G_END_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#endif // __IBUS_ENGINE_SIMPLE_H__
|