You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

135 lines
5.1 KiB

  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. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
  26. #error "Only <gdk/gdk.h> can be included directly."
  27. #endif
  28. #ifndef __GDK_KEYS_H__
  29. #define __GDK_KEYS_H__
  30. #include <gdk/gdktypes.h>
  31. G_BEGIN_DECLS
  32. typedef struct _GdkKeymapKey GdkKeymapKey;
  33. /* GdkKeymapKey is a hardware key that can be mapped to a keyval */
  34. struct _GdkKeymapKey
  35. {
  36. guint keycode;
  37. gint group;
  38. gint level;
  39. };
  40. /* A GdkKeymap defines the translation from keyboard state
  41. * (including a hardware key, a modifier mask, and active keyboard group)
  42. * to a keyval. This translation has two phases. The first phase is
  43. * to determine the effective keyboard group and level for the keyboard
  44. * state; the second phase is to look up the keycode/group/level triplet
  45. * in the keymap and see what keyval it corresponds to.
  46. */
  47. typedef struct _GdkKeymap GdkKeymap;
  48. typedef struct _GdkKeymapClass GdkKeymapClass;
  49. #define GDK_TYPE_KEYMAP (gdk_keymap_get_type ())
  50. #define GDK_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_KEYMAP, GdkKeymap))
  51. #define GDK_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_KEYMAP, GdkKeymapClass))
  52. #define GDK_IS_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_KEYMAP))
  53. #define GDK_IS_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_KEYMAP))
  54. #define GDK_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_KEYMAP, GdkKeymapClass))
  55. struct _GdkKeymap
  56. {
  57. GObject parent_instance;
  58. GdkDisplay *GSEAL (display);
  59. };
  60. struct _GdkKeymapClass
  61. {
  62. GObjectClass parent_class;
  63. void (*direction_changed) (GdkKeymap *keymap);
  64. void (*keys_changed) (GdkKeymap *keymap);
  65. void (*state_changed) (GdkKeymap *keymap);
  66. };
  67. GType gdk_keymap_get_type (void) G_GNUC_CONST;
  68. #ifndef GDK_MULTIHEAD_SAFE
  69. GdkKeymap* gdk_keymap_get_default (void);
  70. #endif
  71. GdkKeymap* gdk_keymap_get_for_display (GdkDisplay *display);
  72. guint gdk_keymap_lookup_key (GdkKeymap *keymap,
  73. const GdkKeymapKey *key);
  74. gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
  75. guint hardware_keycode,
  76. GdkModifierType state,
  77. gint group,
  78. guint *keyval,
  79. gint *effective_group,
  80. gint *level,
  81. GdkModifierType *consumed_modifiers);
  82. gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
  83. guint keyval,
  84. GdkKeymapKey **keys,
  85. gint *n_keys);
  86. gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
  87. guint hardware_keycode,
  88. GdkKeymapKey **keys,
  89. guint **keyvals,
  90. gint *n_entries);
  91. PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap);
  92. gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap);
  93. gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap);
  94. void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
  95. GdkModifierType *state);
  96. gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
  97. GdkModifierType *state);
  98. /* Key values
  99. */
  100. gchar* gdk_keyval_name (guint keyval) G_GNUC_CONST;
  101. guint gdk_keyval_from_name (const gchar *keyval_name);
  102. void gdk_keyval_convert_case (guint symbol,
  103. guint *lower,
  104. guint *upper);
  105. guint gdk_keyval_to_upper (guint keyval) G_GNUC_CONST;
  106. guint gdk_keyval_to_lower (guint keyval) G_GNUC_CONST;
  107. gboolean gdk_keyval_is_upper (guint keyval) G_GNUC_CONST;
  108. gboolean gdk_keyval_is_lower (guint keyval) G_GNUC_CONST;
  109. guint32 gdk_keyval_to_unicode (guint keyval) G_GNUC_CONST;
  110. guint gdk_unicode_to_keyval (guint32 wc) G_GNUC_CONST;
  111. G_END_DECLS
  112. #endif /* __GDK_KEYS_H__ */