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, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GTK_IM_CONTEXT_H__
21 #define __GTK_IM_CONTEXT_H__
24 #include <gtk/gtkobject.h>
25 #include <pango/pango.h>
30 #endif /* __cplusplus */
32 #define GTK_TYPE_IM_CONTEXT (gtk_im_context_get_type ())
33 #define GTK_IM_CONTEXT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContext))
34 #define GTK_IM_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
35 #define GTK_IS_IM_CONTEXT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IM_CONTEXT))
36 #define GTK_IS_IM_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT))
37 #define GTK_IM_CONTEXT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
40 typedef struct _GtkIMContext GtkIMContext;
41 typedef struct _GtkIMContextClass GtkIMContextClass;
48 struct _GtkIMContextClass
50 GtkObjectClass parent_class;
53 void (*preedit_start) (GtkIMContext *context);
54 void (*preedit_end) (GtkIMContext *context);
55 void (*preedit_changed) (GtkIMContext *context);
56 void (*commit) (GtkIMContext *context, const gchar *str);
58 /* Virtual functions */
59 void (*set_client_window) (GtkIMContext *context,
61 void (*get_preedit_string) (GtkIMContext *context,
63 PangoAttrList **attrs,
65 gboolean (*filter_keypress) (GtkIMContext *context,
67 void (*focus_in) (GtkIMContext *context);
68 void (*focus_out) (GtkIMContext *context);
69 void (*reset) (GtkIMContext *context);
70 void (*set_cursor_location) (GtkIMContext *context,
74 GtkType gtk_im_context_get_type (void) G_GNUC_CONST;
76 void gtk_im_context_set_client_window (GtkIMContext *context,
78 void gtk_im_context_get_preedit_string (GtkIMContext *context,
80 PangoAttrList **attrs,
82 gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
84 void gtk_im_context_focus_in (GtkIMContext *context);
85 void gtk_im_context_focus_out (GtkIMContext *context);
86 void gtk_im_context_reset (GtkIMContext *context);
87 void gtk_im_context_set_cursor_location (GtkIMContext *context,
92 #endif /* __cplusplus */
95 #endif /* __GTK_IM_CONTEXT_H__ */