1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2 /* vim:set et sts=4: */
3 /* ibus - The Input Bus
4 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
5 * Copyright (C) 2008-2010 Red Hat, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
24 #error "Only <ibus.h> can be included directly"
28 * SECTION: ibussimpleengine
29 * @short_description: Input method engine supporting table-based input method
30 * @title: IBusEngineSimple
33 * An IBusEngineSimple provides table-based input method logic.
35 * see_also: #IBusEngine
37 #ifndef __IBUS_ENGINE_SIMPLE_H__
38 #define __IBUS_ENGINE_SIMPLE_H__
40 #include "ibusengine.h"
44 #define IBUS_MAX_COMPOSE_LEN 7
50 /* define GOBJECT macros */
51 #define IBUS_TYPE_ENGINE_SIMPLE \
52 (ibus_engine_simple_get_type ())
53 #define IBUS_ENGINE_SIMPLE(obj) \
54 (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimple))
55 #define IBUS_ENGINE_SIMPLE_CLASS(klass) \
56 (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimpleClass))
57 #define IBUS_IS_ENGINE_SIMPLE(obj) \
58 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ENGINE_SIMPLE))
59 #define IBUS_IS_ENGINE_SIMPLE_CLASS(klass) \
60 (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ENGINE_SIMPLE))
61 #define IBUS_ENGINE_SIMPLE_GET_CLASS(obj) \
62 (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimpleClass))
64 typedef struct _IBusEngineSimple IBusEngineSimple;
65 typedef struct _IBusEngineSimpleClass IBusEngineSimpleClass;
66 typedef struct _IBusEngineSimplePrivate IBusEngineSimplePrivate;
71 * IBusEngineSimple properties.
73 struct _IBusEngineSimple {
76 IBusEngineSimplePrivate *priv;
78 /* instance members */
82 struct _IBusEngineSimpleClass {
84 IBusEngineClass parent;
95 GType ibus_engine_simple_get_type (void);
98 * ibus_engine_simple_add_table:
99 * @simple: An IBusEngineSimple.
100 * @data: (element-type guint16) (array): The table which must be available
101 * during the whole life of the simple engine.
102 * @max_seq_len: Maximum length of a swquence in the table (cannot be greater
103 * than %IBUS_MAX_COMPOSE_LEN)
105 * Adds an additional table to search to the engine. Each row of the table
106 * consists of max_seq_len key symbols followed by two guint16 interpreted as
107 * the high and low words of a gunicode value. Tables are searched starting from
110 * The table must be sorted in dictionary order on the numeric value of the key
111 * symbol fields. (Values beyond the length of the sequence should be zero.)
113 void ibus_engine_simple_add_table (IBusEngineSimple *simple,
120 #endif // __IBUS_ENGINE_SIMPLE_H__