]> Pileus Git - ~andy/gtk/blob - gtk/gtkimcontext.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkimcontext.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2000 Red Hat Software
3  *
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.
8  *
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.
13  *
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/>.
16  */
17
18 #ifndef __GTK_IM_CONTEXT_H__
19 #define __GTK_IM_CONTEXT_H__
20
21
22 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23 #error "Only <gtk/gtk.h> can be included directly."
24 #endif
25
26 #include <gdk/gdk.h>
27
28
29 G_BEGIN_DECLS
30
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))
37
38
39 typedef struct _GtkIMContext       GtkIMContext;
40 typedef struct _GtkIMContextClass  GtkIMContextClass;
41
42 struct _GtkIMContext
43 {
44   GObject parent_instance;
45 };
46
47 struct _GtkIMContextClass
48 {
49   /*< private >*/
50   GObjectClass parent_class;
51
52   /*< public >*/
53   /* Signals */
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,
60                                     gint          offset,
61                                     gint          n_chars);
62
63   /* Virtual functions */
64   void     (*set_client_window)   (GtkIMContext   *context,
65                                    GdkWindow      *window);
66   void     (*get_preedit_string)  (GtkIMContext   *context,
67                                    gchar         **str,
68                                    PangoAttrList **attrs,
69                                    gint           *cursor_pos);
70   gboolean (*filter_keypress)     (GtkIMContext   *context,
71                                    GdkEventKey    *event);
72   void     (*focus_in)            (GtkIMContext   *context);
73   void     (*focus_out)           (GtkIMContext   *context);
74   void     (*reset)               (GtkIMContext   *context);
75   void     (*set_cursor_location) (GtkIMContext   *context,
76                                    GdkRectangle   *area);
77   void     (*set_use_preedit)     (GtkIMContext   *context,
78                                    gboolean        use_preedit);
79   void     (*set_surrounding)     (GtkIMContext   *context,
80                                    const gchar    *text,
81                                    gint            len,
82                                    gint            cursor_index);
83   gboolean (*get_surrounding)     (GtkIMContext   *context,
84                                    gchar         **text,
85                                    gint           *cursor_index);
86   /*< private >*/
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);
94 };
95
96 GType    gtk_im_context_get_type            (void) G_GNUC_CONST;
97
98 void     gtk_im_context_set_client_window   (GtkIMContext       *context,
99                                              GdkWindow          *window);
100 void     gtk_im_context_get_preedit_string  (GtkIMContext       *context,
101                                              gchar             **str,
102                                              PangoAttrList     **attrs,
103                                              gint               *cursor_pos);
104 gboolean gtk_im_context_filter_keypress     (GtkIMContext       *context,
105                                              GdkEventKey        *event);
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,
114                                              const gchar        *text,
115                                              gint                len,
116                                              gint                cursor_index);
117 gboolean gtk_im_context_get_surrounding     (GtkIMContext       *context,
118                                              gchar             **text,
119                                              gint               *cursor_index);
120 gboolean gtk_im_context_delete_surrounding  (GtkIMContext       *context,
121                                              gint                offset,
122                                              gint                n_chars);
123
124 G_END_DECLS
125
126 #endif /* __GTK_IM_CONTEXT_H__ */