Restore compatible action structs This unbreaks the X server code to serialize an xkb_desc, but loses the 32 bit vmod fields. Needs some work...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h
index 6bf7d8a..9a42834 100644
--- a/include/X11/extensions/XKBcommon.h
+++ b/include/X11/extensions/XKBcommon.h
@@ -85,118 +85,99 @@ struct xkb_rule_names {
};
struct xkb_any_action {
- unsigned char type;
- unsigned char pad[18];
+ uint8_t type;
+ uint8_t data[7];
};
struct xkb_mod_action {
- unsigned char type;
+ uint8_t type;
uint8_t flags;
+ uint8_t mask;
uint8_t real_mods;
- uint32_t mask;
- uint32_t vmods;
+ uint16_t vmods;
};
struct xkb_group_action {
- unsigned char type;
- unsigned char flags;
+ uint8_t type;
+ uint8_t flags;
int16_t group;
};
struct xkb_iso_action {
- unsigned char type;
+ uint8_t type;
uint8_t flags;
- int16_t group;
- uint32_t mask;
- uint32_t vmods;
+ uint8_t mask;
uint8_t real_mods;
-
- uint8_t affect;
+ uint8_t group;
+ uint8_t affect;
+ uint16_t vmods;
};
struct xkb_controls_action {
- unsigned char type;
+ uint8_t type;
uint8_t flags;
uint32_t ctrls;
};
struct xkb_device_button_action {
- unsigned char type;
+ uint8_t type;
uint8_t flags;
- uint16_t device;
- uint16_t button;
uint8_t count;
+ uint8_t button;
+ uint8_t device;
};
struct xkb_device_valuator_action {
- unsigned char type;
+ uint8_t type;
+ uint8_t device;
uint8_t v1_what;
- uint16_t device;
- uint16_t v1_index;
- int16_t v1_value;
- uint16_t v2_index;
- int16_t v2_value;
+ uint8_t v1_index;
+ uint8_t v1_value;
uint8_t v2_what;
+ uint8_t v2_index;
+ uint8_t v2_value;
};
struct xkb_pointer_default_action {
- unsigned char type;
+ uint8_t type;
uint8_t flags;
uint8_t affect;
uint8_t value;
};
struct xkb_switch_screen_action {
- unsigned char type;
+ uint8_t type;
uint8_t flags;
uint8_t screen;
};
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;
-};
-#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\
- ((unsigned int)(a)->vmods0))
-#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
- ((a)->vmods_mask0=((m)&0xff)))
-#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\
- ((unsigned int)(a)->vmods_mask0))
-#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
- ((a)->vmods_mask0=((m)&0xff)))
-
+ uint8_t type;
+ uint8_t new_key;
+ uint8_t mods_mask;
+ uint8_t mods;
+ uint16_t vmods_mask;
+ uint16_t vmods;
+};
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;
+ uint8_t type;
+ uint8_t flags;
+ uint16_t x;
+ uint16_t y;
};
-#define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff)))
-#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))
-#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))
-#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))
-#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))
struct xkb_message_action {
- unsigned char type;
- unsigned char flags;
- unsigned char message[6];
+ uint8_t type;
+ uint8_t flags;
+ uint8_t message[6];
};
struct xkb_pointer_button_action {
- unsigned char type;
- unsigned char flags;
- unsigned char count;
- unsigned char button;
+ uint8_t type;
+ uint8_t flags;
+ uint8_t count;
+ uint8_t button;
};
union xkb_action {
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index fa6a80c..d0b5860 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -606,13 +606,13 @@ HandleMovePtr(struct xkb_desc * xkb,
{
if (absolute)
act->flags |= XkbSA_MoveAbsoluteX;
- XkbSetPtrActionX(act, rtrn.ival);
+ act->x = rtrn.ival;
}
else
{
if (absolute)
act->flags |= XkbSA_MoveAbsoluteY;
- XkbSetPtrActionY(act, rtrn.ival);
+ act->y = rtrn.ival;
}
return True;
}
@@ -1069,11 +1069,11 @@ HandleRedirectKey(struct xkb_desc * xkb,
act->mods &= ~(t2 & 0xff);
t2 = (t2 >> 8) & 0xffff;
- XkbSARedirectSetVModsMask(act, XkbSARedirectVModsMask(act) | t2);
+ act->vmods_mask |= t2;
if (field == F_Modifiers)
- XkbSARedirectSetVMods(act, XkbSARedirectVMods(act) | t2);
+ act->vmods |= t2;
else
- XkbSARedirectSetVMods(act, XkbSARedirectVMods(act) & ~t2);
+ act->vmods &= ~t2;
return True;
}
return True;
@@ -1200,7 +1200,7 @@ HandlePrivate(struct xkb_desc * xkb,
ACTION("Extra %d bytes ignored\n", len - 6);
return False;
}
- strncpy((char *) action->pad, rtrn.str, sizeof action->pad);
+ strncpy((char *) action->data, rtrn.str, sizeof action->data);
}
free(rtrn.str);
return True;
@@ -1215,7 +1215,7 @@ HandlePrivate(struct xkb_desc * xkb,
return False;
}
ndx = rtrn.uval;
- if (ndx >= sizeof action->pad)
+ if (ndx >= sizeof action->data)
{
ERROR("The data for a private action is 18 bytes long\n");
ACTION("Attempt to use data[%d] ignored\n", ndx);
@@ -1229,7 +1229,7 @@ HandlePrivate(struct xkb_desc * xkb,
ACTION("Illegal datum %d ignored\n", rtrn.ival);
return False;
}
- action->pad[ndx] = rtrn.uval;
+ action->data[ndx] = rtrn.uval;
return True;
}
}
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index de2c25b..af231ff 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -119,9 +119,9 @@ InitCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
info->dflt.interp.flags = 0;
info->dflt.interp.virtual_mod = XkbNoModifier;
info->dflt.interp.act.type = XkbSA_NoAction;
- for (i = 0; i < sizeof info->dflt.interp.act.pad; i++)
+ for (i = 0; i < sizeof info->dflt.interp.act.data; i++)
{
- info->dflt.interp.act.pad[i] = 0;
+ info->dflt.interp.act.data[i] = 0;
}
ClearIndicatorMapInfo(&info->ledDflt);
info->ledDflt.defs.fileID = info->fileID;
@@ -147,9 +147,9 @@ ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
info->dflt.interp.flags = 0;
info->dflt.interp.virtual_mod = XkbNoModifier;
info->dflt.interp.act.type = XkbSA_NoAction;
- for (i = 0; i < sizeof info->dflt.interp.act.pad; i++)
+ for (i = 0; i < sizeof info->dflt.interp.act.data; i++)
{
- info->dflt.interp.act.pad[i] = 0;
+ info->dflt.interp.act.data[i] = 0;
}
ClearIndicatorMapInfo(&info->ledDflt);
info->nInterps = 0;