Debian Codegraph @

gtk-input-context/client-gtk/client-imcontext-gtk.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2010, Intel Corporation.
3 *
4 * Author: Raymond Liu <[email protected]>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * version 2.1 as published by the Free Software Foundation.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 */
20
21 #ifndef _CLIENT_IMCONTEXT_GTK_H
22 #define _CLIENT_IMCONTEXT_GTK_H
23
24 #include <gtk/gtk.h>
25 #include <maliit-glib/maliitserver.h>
26 #include <maliit-glib/maliitcontext.h>
27 #include <maliit-glib/maliitattributeextensionregistry.h>
28
29 G_BEGIN_DECLS
30
31 // Be careful not to override the existing flag of GDK
32 // Currently bit 15-25 unused, so we pick a middle one.
33 typedef enum {
34 IM_FORWARD_MASK = 1 << 20
35 } IMModifierType;
36
37 typedef struct _MaliitIMContext MaliitIMContext;
38 typedef struct _MaliitIMContextClass MaliitIMContextClass;
39
40 #define MALIIT_TYPE_IM_CONTEXT (maliit_im_context_get_type())
41 #define MALIIT_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MALIIT_TYPE_IM_CONTEXT, MaliitIMContext))
42 #define MALIIT_IM_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MALIIT_TYPE_IM_CONTEXT, MaliitIMContextClass))
43 #define MALIIT_IS_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MALIIT_TYPE_IM_CONTEXT))
44 #define MALIIT_IS_IM_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MALIIT_TYPE_IM_CONTEXT))
45 #define MALIIT_IM_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MALIIT_TYPE_IM_CONTEXT, MaliitIMContextClass))
46
47
48 struct _MaliitIMContext {
49 GtkIMContext parent;
50
51 MaliitServer *server;
52 MaliitContext *context;
53 MaliitAttributeExtensionRegistry *registry;
54
55 GdkWindow *client_window;
56 GdkRectangle cursor_location;
57
58 gchar *preedit_str;
59 PangoAttrList *preedit_attrs;
60 gint preedit_cursor_pos;
61 GVariant *widget_state; /* Mapping between string and GVariants with properties of the focused widget */
62 gboolean focus_state; /* TRUE means a widget is focused, FALSE means no widget is focused */
63
64 GdkRectangle keyboard_area;
65 };
66
67 struct _MaliitIMContextClass {
68 GtkIMContextClass parent;
69 };
70
71 GType maliit_im_context_get_type(void);
72
73 void maliit_im_context_register_type(GTypeModule *type_module);
74 GtkIMContext *maliit_im_context_new(void);
75
76 G_END_DECLS
77
78 #endif //_CLIENT_IMCONTEXT_GTK_H