Copy over missing action structs from kbproto
[platform/upstream/libxkbcommon.git] / include / X11 / extensions / XKBcommon.h
index 5b6d02c..64f8e8b 100644 (file)
@@ -65,50 +65,51 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 /* Action structures used in the server */
 
 #define XkbcAnyActionDataSize 18
-typedef struct _XkbcAnyAction {
+struct xkb_any_action {
     unsigned char   type;
     unsigned char   pad[XkbcAnyActionDataSize];
-} XkbcAnyAction;
+};
 
-typedef struct _XkbcModAction {
+struct xkb_mod_action {
     unsigned char   type;
     uint8_t         flags;
     uint8_t         real_mods;
     uint32_t        mask;
     uint32_t        vmods;
-} XkbcModAction;
+};
 
-typedef struct _XkbcGroupAction {
+struct xkb_group_action {
     unsigned char   type;
     unsigned char   flags;
     int16_t         group;
-} XkbcGroupAction;
+};
 
-typedef struct _XkbcISOAction {
+struct xkb_iso_action {
     unsigned char   type;
     uint8_t         flags;
     int16_t         group;
     uint32_t        mask;
     uint32_t        vmods;
     uint8_t         real_mods;
-    uint8_t         affect;
-} XkbcISOAction;
+   uint8_t         affect;
+};
 
-typedef struct _XkbcCtrlsAction {
+struct xkb_controls_action {
     unsigned char   type;
     uint8_t         flags;
     uint32_t        ctrls;
-} XkbcCtrlsAction;
+};
 
-typedef struct _XkbcDeviceBtnAction {
+struct xkb_device_button_action {
     unsigned char   type;
     uint8_t         flags;
     uint16_t        device;
     uint16_t        button;
     uint8_t         count;
-} XkbcDeviceBtnAction;
+};
 
-typedef struct _XkbcDeviceValuatorAction {
+struct xkb_device_valuator_action {
     unsigned char   type;
     uint8_t         v1_what;
     uint16_t        device;
@@ -117,60 +118,105 @@ typedef struct _XkbcDeviceValuatorAction {
     uint16_t        v2_index;
     int16_t         v2_value;
     uint8_t         v2_what;
-} XkbcDeviceValuatorAction;
+};
 
-typedef struct _XkbcPtrDfltAction {
+struct xkb_pointer_default_action {
     unsigned char   type;
     uint8_t         flags;
     uint8_t         affect;
     uint8_t         value;
-} XkbcPtrDfltAction;
+};
 
-typedef struct _XkbcSwitchScreenAction {
+struct xkb_switch_screen_action {
     unsigned char   type;
     uint8_t         flags;
     uint8_t         screen;
-} XkbcSwitchScreenAction;
-
-typedef union _XkbcAction {
-    XkbcAnyAction            any;
-    XkbcModAction            mods;
-    XkbcGroupAction          group;
-    XkbcISOAction            iso;
-    XkbcCtrlsAction          ctrls;
-    XkbcDeviceBtnAction      devbtn;
-    XkbcDeviceValuatorAction devval;
-    XkbcPtrDfltAction        dflt;
-    XkbcSwitchScreenAction   screen;
-    XkbRedirectKeyAction     redirect; /* XXX wholly unnecessary? */
-    XkbPtrAction             ptr; /* XXX delete for DeviceValuator */
-    XkbPtrBtnAction          btn; /* XXX delete for DeviceBtn */
-    XkbMessageAction         msg; /* XXX just delete */
-    unsigned char            type;
-} XkbcAction;
+};
+
+struct xkb_redirect_key_action {
+       unsigned char   type;
+       unsigned char   new_key;
+       unsigned char   mods_mask;
+       unsigned char   mods;
+       unsigned char   vmods_mask0;
+       unsigned char   vmods_mask1;
+       unsigned char   vmods0;
+       unsigned char   vmods1;
+};
+
+struct xkb_pointer_action {
+       unsigned char   type;
+       unsigned char   flags;
+       unsigned char   high_XXX;
+       unsigned char   low_XXX;
+       unsigned char   high_YYY;
+       unsigned char   low_YYY;
+};
+
+struct xkb_message_action {
+       unsigned char   type;
+       unsigned char   flags;
+       unsigned char   message[6];
+};
+
+struct xkb_pointer_button_action {
+       unsigned char   type;
+       unsigned char   flags;
+       unsigned char   count;
+       unsigned char   button;
+};
+
+union xkb_action {
+    struct xkb_any_action             any;
+    struct xkb_mod_action             mods;
+    struct xkb_group_action           group;
+    struct xkb_iso_action             iso;
+    struct xkb_controls_action        ctrls;
+    struct xkb_device_button_action   devbtn;
+    struct xkb_device_valuator_action devval;
+    struct xkb_pointer_default_action dflt;
+    struct xkb_switch_screen_action   screen;
+    struct xkb_redirect_key_action    redirect; /* XXX wholly unnecessary? */
+    struct xkb_pointer_action         ptr; /* XXX delete for DeviceValuator */
+    struct xkb_pointer_button_action  btn; /* XXX delete for DeviceBtn */
+    struct xkb_message_action         msg; /* XXX just delete */
+    unsigned char                     type;
+};
+
+typedef struct _XkbcMods {
+        uint32_t        mask;   /* effective mods */
+        uint32_t        vmods;
+        uint8_t         real_mods;
+} XkbcModsRec, *XkbcModsPtr;
+
+typedef struct _XkbcKTMapEntry {
+        Bool            active;
+        uint16_t        level;
+        XkbcModsRec     mods;
+} XkbcKTMapEntryRec, *XkbcKTMapEntryPtr;
 
 typedef struct _XkbcKeyType {
-    XkbModsRec              mods;
-    unsigned char           num_levels;
+    XkbcModsRec             mods;
+    uint16_t                num_levels;
     unsigned char           map_count;
-    XkbKTMapEntryPtr        map;
-    XkbModsPtr              preserve;
-    CARD32                  name;
-    CARD32                 *level_names;
+    XkbcKTMapEntryPtr       map;
+    XkbcModsPtr             preserve;
+    uint32_t                  name;
+    uint32_t                 *level_names;
 } XkbcKeyTypeRec, *XkbcKeyTypePtr;
 
 typedef struct _XkbcSymInterpretRec {
-    CARD32          sym;
+    uint32_t          sym;
     unsigned char   flags;
     unsigned char   match;
     uint8_t         mods; /* XXX real or virt? */
     uint32_t        virtual_mod;
-    XkbcAnyAction   act;
+    struct xkb_any_action   act;
 } XkbcSymInterpretRec, *XkbcSymInterpretPtr;
 
 typedef struct _XkbcCompatMapRec {
     XkbcSymInterpretPtr      sym_interpret;
-    XkbModsRec               groups[XkbNumKbdGroups];
+    XkbcModsRec              groups[XkbNumKbdGroups];
     unsigned short           num_si;
     unsigned short           size_si;
 } XkbcCompatMapRec, *XkbcCompatMapPtr;
@@ -199,7 +245,7 @@ typedef struct _XkbcServerMapRec {
     unsigned char *     explicit;
 #endif
 
-    XkbcAction          *acts;
+    union xkb_action          *acts;
     XkbBehavior         *behaviors;
     unsigned short      *key_acts;
     unsigned char       *explicits;
@@ -208,18 +254,18 @@ typedef struct _XkbcServerMapRec {
 } XkbcServerMapRec, *XkbcServerMapPtr;
 
 typedef struct _XkbcNamesRec {
-    CARD32            keycodes;
-    CARD32            geometry;
-    CARD32            symbols;
-    CARD32            types;
-    CARD32            compat;
-    CARD32            vmods[XkbNumVirtualMods];
-    CARD32            indicators[XkbNumIndicators];
-    CARD32            groups[XkbNumKbdGroups];
+    uint32_t            keycodes;
+    uint32_t            geometry;
+    uint32_t            symbols;
+    uint32_t            types;
+    uint32_t            compat;
+    uint32_t            vmods[XkbNumVirtualMods];
+    uint32_t            indicators[XkbNumIndicators];
+    uint32_t            groups[XkbNumKbdGroups];
     XkbKeyNamePtr     keys;
     XkbKeyAliasPtr    key_aliases;
-    CARD32           *radio_groups;
-    CARD32            phys_symbols;
+    uint32_t           *radio_groups;
+    uint32_t            phys_symbols;
 
     unsigned char     num_keys;
     unsigned char     num_key_aliases;
@@ -256,7 +302,7 @@ typedef struct _XkbcOutline {
 } XkbcOutlineRec, *XkbcOutlinePtr;
 
 typedef struct _XkbcShape {
-       CARD32           name;
+       uint32_t                 name;
        unsigned short   num_outlines;
        unsigned short   sz_outlines;
        XkbcOutlinePtr   outlines;
@@ -267,7 +313,7 @@ typedef struct _XkbcShape {
 #define        XkbOutlineIndex(s,o)    ((int)((o)-&(s)->outlines[0]))
 
 typedef struct _XkbcShapeDoodad {
-       CARD32           name;
+       uint32_t                 name;
        unsigned char    type;
        unsigned char    priority;
        short            top;
@@ -282,7 +328,7 @@ typedef struct _XkbcShapeDoodad {
 #define        XkbSetShapeDoodadShape(g,d,s)   ((d)->shape_ndx= (s)-&(g)->shapes[0])
 
 typedef struct _XkbcTextDoodad {
-       CARD32           name;
+       uint32_t                 name;
        unsigned char    type;
        unsigned char    priority;
        short            top;
@@ -298,7 +344,7 @@ typedef struct _XkbcTextDoodad {
 #define        XkbSetTextDoodadColor(g,d,c)    ((d)->color_ndx= (c)-&(g)->colors[0])
 
 typedef struct _XkbcIndicatorDoodad {
-       CARD32           name;
+       uint32_t                 name;
        unsigned char    type;
        unsigned char    priority;
        short            top;
@@ -319,7 +365,7 @@ typedef struct _XkbcIndicatorDoodad {
                                ((d)->shape_ndx= (s)-&(g)->shapes[0])
 
 typedef struct _XkbcLogoDoodad {
-       CARD32           name;
+       uint32_t                 name;
        unsigned char    type;
        unsigned char    priority;
        short            top;
@@ -335,7 +381,7 @@ typedef struct _XkbcLogoDoodad {
 #define        XkbSetLogoDoodadShape(g,d,s)    ((d)->shape_ndx= (s)-&(g)->shapes[0])
 
 typedef struct _XkbcAnyDoodad {
-       CARD32           name;
+       uint32_t                 name;
        unsigned char    type;
        unsigned char    priority;
        short            top;
@@ -380,7 +426,7 @@ typedef struct _XkbRow {
 } XkbcRowRec, *XkbcRowPtr;
 
 typedef struct _XkbcSection {
-       CARD32           name;
+       uint32_t                 name;
        unsigned char    priority;
        short            top;
        short            left;
@@ -412,7 +458,7 @@ typedef struct _XkbOverlayRow {
 } XkbcOverlayRowRec, *XkbcOverlayRowPtr;
 
 typedef struct _XkbOverlay {
-       CARD32                  name;
+       uint32_t                        name;
        XkbcSectionPtr          section_under;
        unsigned short          num_rows;
        unsigned short          sz_rows;
@@ -421,7 +467,7 @@ typedef struct _XkbOverlay {
 } XkbcOverlayRec, *XkbcOverlayPtr;
 
 typedef struct _XkbcGeometry {
-       CARD32           name;
+       uint32_t                 name;
        unsigned short   width_mm;
        unsigned short   height_mm;
        char *           label_font;
@@ -529,17 +575,17 @@ XkbcCanonicaliseComponents(XkbComponentNamesPtr names,
  * XkbcKeysymToString: if you need to preserve it, then you must
  * duplicate it.
  *
- * This is CARD32 rather than KeySym, as KeySym changes size between
+ * This is uint32_t rather than KeySym, as KeySym changes size between
  * client and server (no, really).
  */
 extern char *
-XkbcKeysymToString(CARD32 ks);
+XkbcKeysymToString(uint32_t ks);
 
 /*
  * See XkbcKeysymToString comments: this function will accept any string
  * from that function.
  */
-extern CARD32
+extern uint32_t
 XkbcStringToKeysym(const char *s);
 
 _XFUNCPROTOEND