static Bool
HandleNoAction(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
return ReportIllegal(action->type, field);
static Bool
HandleSetLatchMods(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
- XkbcModAction *act;
+ struct xkb_mod_action *act;
unsigned rtrn;
unsigned t1, t2;
- act = (XkbcModAction *) action;
+ act = (struct xkb_mod_action *) action;
if (array_ndx != NULL)
{
switch (field)
static Bool
HandleLockMods(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
- XkbcModAction *act;
+ struct xkb_mod_action *act;
unsigned t1, t2;
- act = (XkbcModAction *) action;
+ act = (struct xkb_mod_action *) action;
if ((array_ndx != NULL) && (field == F_Modifiers))
return ReportActionNotArray(action->type, field);
switch (field)
static Bool
HandleSetLatchGroup(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
XkbGroupAction *act;
static Bool
HandleLockGroup(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
XkbGroupAction *act;
static Bool
HandleMovePtr(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
- XkbcPtrAction *act;
+ struct xkb_pointer_action *act;
Bool absolute;
- act = (XkbcPtrAction *) action;
+ act = (struct xkb_pointer_action *) action;
if ((array_ndx != NULL) && ((field == F_X) || (field == F_Y)))
return ReportActionNotArray(action->type, field);
{
if (absolute)
act->flags |= XkbSA_MoveAbsoluteX;
- act->x = rtrn.ival;
+ XkbSetPtrActionX(act, rtrn.ival);
}
else
{
if (absolute)
act->flags |= XkbSA_MoveAbsoluteY;
- act->y = rtrn.ival;
+ XkbSetPtrActionY(act, rtrn.ival);
}
return True;
}
static Bool
HandlePtrBtn(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
- XkbPtrBtnAction *act;
+ struct xkb_pointer_button_action *act;
- act = (XkbPtrBtnAction *) action;
+ act = (struct xkb_pointer_button_action *) action;
if (field == F_Button)
{
if (array_ndx != NULL)
static Bool
HandleSetPtrDflt(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
static Bool
HandleISOLock(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
- XkbcISOAction *act;
+ struct xkb_iso_action *act;
unsigned flags, mods;
int group;
- act = (XkbcISOAction *) action;
+ act = (struct xkb_iso_action *) action;
switch (field)
{
case F_Modifiers:
if (CheckGroupField(action->type, value, &flags, &group))
{
act->flags = flags | XkbSA_ISODfltIsGroup;
- XkbSASetGroup(act, group);
+ act->group = group;
return True;
}
return False;
static Bool
HandleSwitchScreen(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
static Bool
HandleSetLockControls(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
- XkbcCtrlsAction *act;
+ struct xkb_controls_action *act;
- act = (XkbcCtrlsAction *) action;
+ act = (struct xkb_controls_action *) action;
if (field == F_Controls)
{
if (array_ndx != NULL)
static Bool
HandleActionMessage(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
- XkbMessageAction *act;
+ struct xkb_message_action *act;
- act = (XkbMessageAction *) action;
+ act = (struct xkb_message_action *) action;
switch (field)
{
case F_Report:
static Bool
HandleRedirectKey(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
- XkbcRedirectKeyAction *act;
+ struct xkb_redirect_key_action *act;
unsigned t1, t2;
unsigned long tmp;
if (array_ndx != NULL)
return ReportActionNotArray(action->type, field);
- act = (XkbcRedirectKeyAction *) action;
+ act = (struct xkb_redirect_key_action *) action;
switch (field)
{
case F_Keycode:
act->mods &= ~(t2 & 0xff);
t2 = (t2 >> 8) & 0xffff;
- act->vmods_mask |= t2;
+ XkbSARedirectSetVModsMask(act, XkbSARedirectVModsMask(act) | t2);
if (field == F_Modifiers)
- act->vmods |= t2;
+ XkbSARedirectSetVMods(act, XkbSARedirectVMods(act) | t2);
else
- act->vmods &= ~t2;
+ XkbSARedirectSetVMods(act, XkbSARedirectVMods(act) & ~t2);
return True;
}
return True;
static Bool
HandleDeviceBtn(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
static Bool
HandleDeviceValuator(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
#if 0
static Bool
HandlePrivate(XkbcDescPtr xkb,
- XkbAnyAction * action,
+ struct xkb_any_action * action,
unsigned field, ExprDef * array_ndx, ExprDef * value)
{
ExprResult rtrn;
ACTION("Extra %d bytes ignored\n", len - 6);
return False;
}
- strncpy((char *) action->data, rtrn.str, 7);
+ strncpy((char *) action->pad, rtrn.str, XkbcAnyActionDataSize);
}
free(rtrn.str);
return True;
return False;
}
ndx = rtrn.uval;
- if (ndx > 6)
+ if (ndx >= XkbcAnyActionDataSize)
{
- ERROR("The data for a private action is 7 bytes long\n");
+ ERROR("The data for a private action is 18 bytes long\n");
ACTION("Attempt to use data[%d] ignored\n", ndx);
return False;
}
ACTION("Illegal datum %d ignored\n", rtrn.ival);
return False;
}
- action->data[ndx] = rtrn.uval;
+ action->pad[ndx] = rtrn.uval;
return True;
}
}
}
typedef Bool(*actionHandler) (XkbcDescPtr /* xkb */ ,
- XkbAnyAction * /* action */ ,
+ struct xkb_any_action * /* action */ ,
unsigned /* field */ ,
ExprDef * /* array_ndx */ ,
ExprDef * /* value */
/***====================================================================***/
static void
-ApplyActionFactoryDefaults(XkbcAction * action)
+ApplyActionFactoryDefaults(union xkb_action * action)
{
if (action->type == XkbSA_SetPtrDflt)
{ /* increment default button */
action->dflt.affect = XkbSA_AffectDfltBtn;
action->dflt.flags = 0;
- XkbSASetPtrDfltValue(&action->dflt, 1);
+ action->dflt.value = 1;
}
else if (action->type == XkbSA_ISOLock)
{
int
HandleActionDef(ExprDef * def,
XkbcDescPtr xkb,
- XkbAnyAction * action, unsigned mergeMode, ActionInfo * info)
+ struct xkb_any_action * action, unsigned mergeMode, ActionInfo * info)
{
ExprDef *arg;
register char *str;
exprOpText(def->op));
return False;
}
- str = XkbcAtomGetString(def->value.action.name);
+ str = XkbcAtomText(def->value.action.name);
if (!str)
{
WSGO("Missing name in action definition!!\n");
action->type = hndlrType = tmp;
if (action->type != XkbSA_NoAction)
{
- ApplyActionFactoryDefaults((XkbcAction *) action);
+ ApplyActionFactoryDefaults((union xkb_action *) action);
while (info)
{
if ((info->action == XkbSA_NoAction)