]> Pileus Git - ~andy/gtk/blob - gdk/gdkkeysprivate.h
Add a way to get the current modifier state
[~andy/gtk] / gdk / gdkkeysprivate.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 2010 Red Hat, Inc
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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GDK_KEYS_PRIVATE_H__
21 #define __GDK_KEYS_PRIVATE_H__
22
23 #include "gdkkeys.h"
24
25 G_BEGIN_DECLS
26
27 #define GDK_KEYMAP_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_KEYMAP, GdkKeymapClass))
28 #define GDK_IS_KEYMAP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_KEYMAP))
29 #define GDK_KEYMAP_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_KEYMAP, GdkKeymapClass))
30
31 typedef struct _GdkKeymapClass GdkKeymapClass;
32
33 struct _GdkKeymapClass
34 {
35   GObjectClass parent_class;
36
37   PangoDirection (* get_direction)      (GdkKeymap *keymap);
38   gboolean (* have_bidi_layouts)        (GdkKeymap *keymap);
39   gboolean (* get_caps_lock_state)      (GdkKeymap *keymap);
40   gboolean (* get_num_lock_state)       (GdkKeymap *keymap);
41   gboolean (* get_entries_for_keyval)   (GdkKeymap     *keymap,
42                                          guint          keyval,
43                                          GdkKeymapKey **keys,
44                                          gint          *n_keys);
45   gboolean (* get_entries_for_keycode)  (GdkKeymap     *keymap,
46                                          guint          hardware_keycode,
47                                          GdkKeymapKey **keys,
48                                          guint        **keyvals,
49                                          gint          *n_entries);
50   guint (* lookup_key)                  (GdkKeymap          *keymap,
51                                          const GdkKeymapKey *key);
52   gboolean (* translate_keyboard_state) (GdkKeymap       *keymap,
53                                          guint            hardware_keycode,
54                                          GdkModifierType  state,
55                                          gint             group,
56                                          guint           *keyval,
57                                          gint            *effective_group,
58                                          gint            *level,
59                                          GdkModifierType *consumed_modifiers);
60   void (* add_virtual_modifiers)        (GdkKeymap       *keymap,
61                                          GdkModifierType *state);
62   gboolean (* map_virtual_modifiers)    (GdkKeymap       *keymap,
63                                          GdkModifierType *state);
64   GdkModifierType (*get_modifier_mask)  (GdkKeymap         *keymap,
65                                          GdkModifierIntent  intent);
66   guint (* get_modifier_state)          (GdkKeymap *keymap);
67
68
69   /* Signals */
70   void (*direction_changed) (GdkKeymap *keymap);
71   void (*keys_changed)      (GdkKeymap *keymap);
72   void (*state_changed)     (GdkKeymap *keymap);
73 };
74
75 struct _GdkKeymap
76 {
77   GObject     parent_instance;
78   GdkDisplay *display;
79 };
80
81 void _gdk_display_manager_real_keyval_convert_case (GdkDisplayManager *manager,
82                                                     guint              symbol,
83                                                     guint             *lower,
84                                                     guint             *upper);
85
86 G_END_DECLS
87
88 #endif