[gtk/keymap-rework-2: 2/13] gdk: Clean up GdkModifierType
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/keymap-rework-2: 2/13] gdk: Clean up GdkModifierType
- Date: Mon, 6 Apr 2020 17:50:19 +0000 (UTC)
commit a6ebf7da139ff574bbe9a4b4036e0caf4838f430
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 5 10:24:07 2020 -0400
gdk: Clean up GdkModifierType
Remove MOD2..MOD5. Backends are expected to just set
the named modifiers.
docs/reference/gdk/gdk4-sections.txt | 2 +-
gdk/gdktypes.h | 60 +++++++++---------------------------
2 files changed, 15 insertions(+), 47 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 97df57c3ba..9585188c1b 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -216,7 +216,7 @@ gdk_surface_get_height
gdk_surface_set_shadow_width
gdk_surface_get_device_position
GdkModifierType
-GdkModifierIntent
+GDK_MODIFIER_MASK
<SUBSECTION>
gdk_surface_get_support_multidevice
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index aaff14a849..8497c6369a 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -202,57 +202,22 @@ typedef enum
* @GDK_ALT_MASK: the fourth modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier, but
* normally it is the Alt key).
- * @GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier
- * mapping of the X server which key is interpreted as this modifier).
- * @GDK_MOD3_MASK: the sixth modifier key (it depends on the modifier
- * mapping of the X server which key is interpreted as this modifier).
- * @GDK_MOD4_MASK: the seventh modifier key (it depends on the modifier
- * mapping of the X server which key is interpreted as this modifier).
- * @GDK_MOD5_MASK: the eighth modifier key (it depends on the modifier
- * mapping of the X server which key is interpreted as this modifier).
* @GDK_BUTTON1_MASK: the first mouse button.
* @GDK_BUTTON2_MASK: the second mouse button.
* @GDK_BUTTON3_MASK: the third mouse button.
* @GDK_BUTTON4_MASK: the fourth mouse button.
* @GDK_BUTTON5_MASK: the fifth mouse button.
- * @GDK_MODIFIER_RESERVED_13_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_14_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_15_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_16_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_17_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_18_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_19_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_20_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_21_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_22_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_23_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_24_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_25_MASK: A reserved bit flag; do not use in your own code
* @GDK_SUPER_MASK: the Super modifier
* @GDK_HYPER_MASK: the Hyper modifier
* @GDK_META_MASK: the Meta modifier
- * @GDK_MODIFIER_RESERVED_29_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_RESERVED_30_MASK: A reserved bit flag; do not use in your own code
- * @GDK_MODIFIER_MASK: a mask covering all modifier types.
*
* A set of bit-flags to indicate the state of modifier keys and mouse buttons
* in various event types. Typical modifier keys are Shift, Control, Meta,
* Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
*
- * Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
- *
- * GDK recognizes which of the Meta, Super or Hyper keys are mapped
- * to Mod2 - Mod5, and indicates this by setting %GDK_SUPER_MASK,
- * %GDK_HYPER_MASK or %GDK_META_MASK in the state field of key events.
- *
- * Note that GDK may add internal values to events which include
- * reserved values such as %GDK_MODIFIER_RESERVED_13_MASK. Your code
- * should preserve and ignore them. You can use %GDK_MODIFIER_MASK to
- * remove all reserved values.
- *
- * Also note that the GDK X backend interprets button press events for button
- * 4-7 as scroll events, so %GDK_BUTTON4_MASK and %GDK_BUTTON5_MASK will never
- * be set.
+ * Note that GDK may add internal values to events which include values outside
+ * of this enumeration. Your code should preserve and ignore them. You can use
+ * %GDK_MODIFIER_MASK to remove all private values.
*/
typedef enum
{
@@ -260,10 +225,7 @@ typedef enum
GDK_LOCK_MASK = 1 << 1,
GDK_CONTROL_MASK = 1 << 2,
GDK_ALT_MASK = 1 << 3,
- GDK_MOD2_MASK = 1 << 4,
- GDK_MOD3_MASK = 1 << 5,
- GDK_MOD4_MASK = 1 << 6,
- GDK_MOD5_MASK = 1 << 7,
+
GDK_BUTTON1_MASK = 1 << 8,
GDK_BUTTON2_MASK = 1 << 9,
GDK_BUTTON3_MASK = 1 << 10,
@@ -273,12 +235,18 @@ typedef enum
GDK_SUPER_MASK = 1 << 26,
GDK_HYPER_MASK = 1 << 27,
GDK_META_MASK = 1 << 28,
-
- /* Combination of GDK_SHIFT_MASK..GDK_BUTTON5_MASK + GDK_SUPER_MASK
- + GDK_HYPER_MASK + GDK_META_MASK */
- GDK_MODIFIER_MASK = 0x1c001fff
} GdkModifierType;
+
+/**
+ * GDK_MODIFIER_MASK:
+ *
+ * A mask covering all entries in #GdkModifierType.
+ */
+#define GDK_MODIFIER_MASK (GDK_SHIFT_MASK|GDK_LOCK_MASK|GDK_CONTROL_MASK| \
+ GDK_ALT_MASK|GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK| \
+ GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK| \
+ GDK_BUTTON4_MASK|GDK_BUTTON5_MASK)
/**
* GdkModifierIntent:
* @GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR: the primary modifier used to invoke
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]