GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

keymap.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GDK_KEYS_HH 00025 #define GFC_GDK_KEYS_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GDK_TYPES_HH 00032 #include <gfc/gdk/types.hh> 00033 #endif 00034 00035 #ifndef GFC_PANGO_TYPES_HH 00036 #include <gfc/pango/types.hh> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace Gdk { 00046 00047 class Display; 00048 class Keyval; 00049 00054 00055 class KeymapKey 00056 { 00057 GdkKeymapKey key_; 00058 00059 public: 00062 00063 KeymapKey(); 00065 00066 KeymapKey(unsigned int keycode, int group, int level); 00071 00075 00076 GdkKeymapKey* gdk_keymap_key() const; 00078 00079 unsigned int keycode() const; 00081 00082 int group() const; 00084 00085 int level() const; 00088 00091 00092 void set(unsigned int keycode, int group, int level); 00106 00108 }; 00109 00159 00160 class Keymap : public G::Object 00161 { 00162 friend class G::Object; 00163 00164 Keymap(const Keymap&); 00165 Keymap& operator=(const Keymap&); 00166 00167 protected: 00170 00171 explicit Keymap(GdkKeymap *keymap, bool owns_reference = true); 00178 00182 00183 typedef G::Signal<void> DirectionChangedSignalType; 00184 typedef G::SignalProxy<TypeInstance, DirectionChangedSignalType> DirectionChangedSignalProxy; 00185 static const DirectionChangedSignalType direction_changed_signal; 00190 00191 typedef G::Signal<void> KeysChangedSignalType; 00192 typedef G::SignalProxy<TypeInstance, KeysChangedSignalType> KeysChangedSignalProxy; 00193 static const KeysChangedSignalType keys_changed_signal; 00198 00200 00201 public: 00204 00205 virtual ~Keymap(); 00207 00209 00210 static Keymap* get(const Display *display = 0); 00214 00217 00218 GdkKeymap* gdk_keymap() const; 00220 00221 operator GdkKeymap* () const; 00223 00224 Pango::Direction get_direction() const; 00226 00230 00231 Keyval lookup_key(const KeymapKey& key); 00239 00240 bool translate_keyboard_state 00241 ( 00242 unsigned int hardware_keycode, 00243 ModifierTypeField state, 00244 int group, 00245 Keyval& keyval, 00246 int *effective_group, 00247 int *level, 00248 ModifierTypeField *consumed_modifiers 00249 ); 00267 00268 bool get_entries_for_keyval(const Keyval& keyval, std::vector<KeymapKey>& keys); 00282 00283 bool get_entries_for_keycode(unsigned int hardware_keycode, std::vector<KeymapKey> *keys, std::vector<Keyval> *keyvals); 00293 00297 00298 const DirectionChangedSignalProxy sig_direction_changed(); 00300 00301 const KeysChangedSignalProxy sig_keys_changed(); 00303 00305 }; 00306 00307 } // namespace Gdk 00308 00309 } // namespace GFC 00310 00311 #include <gfc/gdk/inline/keymap.inl> 00312 00313 #endif // GFC_GDK_KEYS_HH 00314

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8