1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2000 Red Hat Software
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __GTK_IM_CONTEXT_H__
19 #define __GTK_IM_CONTEXT_H__
22 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23 #error "Only <gtk/gtk.h> can be included directly."
31 #define GTK_TYPE_IM_CONTEXT (gtk_im_context_get_type ())
32 #define GTK_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContext))
33 #define GTK_IM_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
34 #define GTK_IS_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IM_CONTEXT))
35 #define GTK_IS_IM_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT))
36 #define GTK_IM_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
39 typedef struct _GtkIMContext GtkIMContext;
40 typedef struct _GtkIMContextClass GtkIMContextClass;
44 GObject parent_instance;
47 struct _GtkIMContextClass
50 GObjectClass parent_class;
54 void (*preedit_start) (GtkIMContext *context);
55 void (*preedit_end) (GtkIMContext *context);
56 void (*preedit_changed) (GtkIMContext *context);
57 void (*commit) (GtkIMContext *context, const gchar *str);
58 gboolean (*retrieve_surrounding) (GtkIMContext *context);
59 gboolean (*delete_surrounding) (GtkIMContext *context,
63 /* Virtual functions */
64 void (*set_client_window) (GtkIMContext *context,
66 void (*get_preedit_string) (GtkIMContext *context,
68 PangoAttrList **attrs,
70 gboolean (*filter_keypress) (GtkIMContext *context,
72 void (*focus_in) (GtkIMContext *context);
73 void (*focus_out) (GtkIMContext *context);
74 void (*reset) (GtkIMContext *context);
75 void (*set_cursor_location) (GtkIMContext *context,
77 void (*set_use_preedit) (GtkIMContext *context,
78 gboolean use_preedit);
79 void (*set_surrounding) (GtkIMContext *context,
83 gboolean (*get_surrounding) (GtkIMContext *context,
87 /* Padding for future expansion */
88 void (*_gtk_reserved1) (void);
89 void (*_gtk_reserved2) (void);
90 void (*_gtk_reserved3) (void);
91 void (*_gtk_reserved4) (void);
92 void (*_gtk_reserved5) (void);
93 void (*_gtk_reserved6) (void);
96 GType gtk_im_context_get_type (void) G_GNUC_CONST;
98 void gtk_im_context_set_client_window (GtkIMContext *context,
100 void gtk_im_context_get_preedit_string (GtkIMContext *context,
102 PangoAttrList **attrs,
104 gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
106 void gtk_im_context_focus_in (GtkIMContext *context);
107 void gtk_im_context_focus_out (GtkIMContext *context);
108 void gtk_im_context_reset (GtkIMContext *context);
109 void gtk_im_context_set_cursor_location (GtkIMContext *context,
110 const GdkRectangle *area);
111 void gtk_im_context_set_use_preedit (GtkIMContext *context,
112 gboolean use_preedit);
113 void gtk_im_context_set_surrounding (GtkIMContext *context,
117 gboolean gtk_im_context_get_surrounding (GtkIMContext *context,
120 gboolean gtk_im_context_delete_surrounding (GtkIMContext *context,
126 #endif /* __GTK_IM_CONTEXT_H__ */