]> Pileus Git - ~andy/gtk/blob - gdk/broadway/gdkkeys-broadway.c
1d5f41a542951ed6d5cf184212a55f4bc50634f6
[~andy/gtk] / gdk / broadway / gdkkeys-broadway.c
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 2000 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 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #include "config.h"
28
29 #include "gdkprivate-broadway.h"
30 #include "gdkinternals.h"
31 #include "gdkdisplay-broadway.h"
32 #include "gdkkeysprivate.h"
33 #include "gdkkeysyms.h"
34
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include <string.h>
38 #include <unistd.h>
39 #include <limits.h>
40 #include <errno.h>
41
42 typedef struct _GdkBroadwayKeymap   GdkBroadwayKeymap;
43 typedef struct _GdkKeymapClass GdkBroadwayKeymapClass;
44
45 #define GDK_TYPE_BROADWAY_KEYMAP          (gdk_broadway_keymap_get_type ())
46 #define GDK_BROADWAY_KEYMAP(object)       (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_KEYMAP, GdkBroadwayKeymap))
47 #define GDK_IS_BROADWAY_KEYMAP(object)    (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_KEYMAP))
48
49 typedef struct _DirectionCacheEntry DirectionCacheEntry;
50
51 struct _GdkBroadwayKeymap
52 {
53   GdkKeymap     parent_instance;
54 };
55
56 struct _GdkBroadwayKeymapClass
57 {
58   GdkKeymapClass keymap_class;
59 };
60
61 G_DEFINE_TYPE (GdkBroadwayKeymap, gdk_broadway_keymap, GDK_TYPE_KEYMAP)
62
63 static void  gdk_broadway_keymap_finalize   (GObject           *object);
64
65 static void
66 gdk_broadway_keymap_init (GdkBroadwayKeymap *keymap)
67 {
68 }
69
70 static void
71 gdk_broadway_keymap_finalize (GObject *object)
72 {
73   G_OBJECT_CLASS (gdk_broadway_keymap_parent_class)->finalize (object);
74 }
75
76 GdkKeymap*
77 _gdk_broadway_display_get_keymap (GdkDisplay *display)
78 {
79   GdkBroadwayDisplay *broadway_display;
80
81   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
82   broadway_display = GDK_BROADWAY_DISPLAY (display);
83
84   if (!broadway_display->keymap)
85     broadway_display->keymap = g_object_new (gdk_broadway_keymap_get_type (), NULL);
86
87   broadway_display->keymap->display = display;
88
89   return broadway_display->keymap;
90 }
91
92 static PangoDirection
93 gdk_broadway_keymap_get_direction (GdkKeymap *keymap)
94 {
95   return PANGO_DIRECTION_NEUTRAL;
96 }
97
98 static gboolean
99 gdk_broadway_keymap_have_bidi_layouts (GdkKeymap *keymap)
100 {
101   return FALSE;
102 }
103
104 static gboolean
105 gdk_broadway_keymap_get_caps_lock_state (GdkKeymap *keymap)
106 {
107   return FALSE;
108 }
109
110 static gboolean
111 gdk_broadway_keymap_get_num_lock_state (GdkKeymap *keymap)
112 {
113   return FALSE;
114 }
115
116 static gboolean
117 gdk_broadway_keymap_get_entries_for_keyval (GdkKeymap     *keymap,
118                                             guint          keyval,
119                                             GdkKeymapKey **keys,
120                                             gint          *n_keys)
121 {
122   *n_keys = 0;
123   return FALSE;
124 }
125
126 static gboolean
127 gdk_broadway_keymap_get_entries_for_keycode (GdkKeymap     *keymap,
128                                              guint          hardware_keycode,
129                                              GdkKeymapKey **keys,
130                                              guint        **keyvals,
131                                              gint          *n_entries)
132 {
133   *n_entries = 0;
134   return FALSE;
135 }
136
137 static guint
138 gdk_broadway_keymap_lookup_key (GdkKeymap          *keymap,
139                                 const GdkKeymapKey *key)
140 {
141   return 0;
142 }
143
144
145 static gboolean
146 gdk_broadway_keymap_translate_keyboard_state (GdkKeymap       *keymap,
147                                               guint            hardware_keycode,
148                                               GdkModifierType  state,
149                                               gint             group,
150                                               guint           *keyval,
151                                               gint            *effective_group,
152                                               gint            *level,
153                                               GdkModifierType *consumed_modifiers)
154 {
155   return FALSE;
156 }
157
158 static void
159 gdk_broadway_keymap_add_virtual_modifiers (GdkKeymap       *keymap,
160                                            GdkModifierType *state)
161 {
162 }
163
164 static gboolean
165 gdk_broadway_keymap_map_virtual_modifiers (GdkKeymap       *keymap,
166                                            GdkModifierType *state)
167 {
168   return FALSE;
169 }
170
171 static void
172 gdk_broadway_keymap_class_init (GdkBroadwayKeymapClass *klass)
173 {
174   GObjectClass *object_class = G_OBJECT_CLASS (klass);
175   GdkKeymapClass *keymap_class = GDK_KEYMAP_CLASS (klass);
176
177   object_class->finalize = gdk_broadway_keymap_finalize;
178
179   keymap_class->get_direction = gdk_broadway_keymap_get_direction;
180   keymap_class->have_bidi_layouts = gdk_broadway_keymap_have_bidi_layouts;
181   keymap_class->get_caps_lock_state = gdk_broadway_keymap_get_caps_lock_state;
182   keymap_class->get_num_lock_state = gdk_broadway_keymap_get_num_lock_state;
183   keymap_class->get_entries_for_keyval = gdk_broadway_keymap_get_entries_for_keyval;
184   keymap_class->get_entries_for_keycode = gdk_broadway_keymap_get_entries_for_keycode;
185   keymap_class->lookup_key = gdk_broadway_keymap_lookup_key;
186   keymap_class->translate_keyboard_state = gdk_broadway_keymap_translate_keyboard_state;
187   keymap_class->add_virtual_modifiers = gdk_broadway_keymap_add_virtual_modifiers;
188   keymap_class->map_virtual_modifiers = gdk_broadway_keymap_map_virtual_modifiers;
189 }
190