Lines Matching refs:action

34 #include "action.h"
302 ReportMismatch(unsigned action, unsigned field, const char *type)
306 XkbActionTypeText(action, XkbMessage));
311 ReportIllegal(unsigned action, unsigned field)
313 ERROR("Field %s is not defined for an action of type %s\n",
314 fieldText(field), XkbActionTypeText(action, XkbMessage));
320 ReportActionNotArray(unsigned action, unsigned field)
322 ERROR("The %s field in the %s action is not an array\n",
323 fieldText(field), XkbActionTypeText(action, XkbMessage));
329 ReportNotFound(unsigned action, unsigned field, const char *what, char *bad)
332 ACTION("Ignoring the %s field of an %s action\n", fieldText(field),
333 XkbActionTypeText(action, XkbMessage));
338 HandleNoAction(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
341 return ReportIllegal(action->type, field);
345 CheckLatchLockFlags(unsigned action, unsigned field,
358 return ReportMismatch(action, field, "boolean");
367 CheckModifierField(XkbDescPtr xkb, unsigned action, const ExprDef *value,
386 return ReportMismatch(action, F_Modifiers, "modifier mask");
393 HandleSetLatchMods(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
398 act = (XkbModAction *) action;
406 return ReportActionNotArray(action->type, field);
415 if (CheckLatchLockFlags(action->type, field, value, &rtrn))
425 if (CheckModifierField(xkb, action->type, value, &t1, &t2))
436 return ReportIllegal(action->type, field);
448 HandleLockMods(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
453 act = (XkbModAction *) action;
455 return ReportActionNotArray(action->type, field);
462 return ReportMismatch(action->type, field, "lock or unlock");
470 if (CheckModifierField(xkb, action->type, value, &t1, &t2))
481 return ReportIllegal(action->type, field);
497 CheckGroupField(unsigned action, const ExprDef *value,
515 return ReportMismatch(action, F_Group, "integer (range 1..8)");
521 XkbActionTypeText(action, XkbMessage));
534 HandleSetLatchGroup(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
539 act = (XkbGroupAction *) action;
547 return ReportActionNotArray(action->type, field);
556 if (CheckLatchLockFlags(action->type, field, value, &rtrn))
567 if (CheckGroupField(action->type, value, &t1, &t2))
576 return ReportIllegal(action->type, field);
580 HandleLockGroup(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
585 act = (XkbGroupAction *) action;
587 return ReportActionNotArray(action->type, field);
592 if (CheckGroupField(action->type, value, &t1, &t2))
600 return ReportIllegal(action->type, field);
604 HandleMovePtr(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
610 act = (XkbPtrAction *) action;
612 return ReportActionNotArray(action->type, field);
623 return ReportMismatch(action->type, field, "integer");
641 return ReportMismatch(action->type, field, "boolean");
648 return ReportIllegal(action->type, field);
662 HandlePtrBtn(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
668 act = (XkbPtrBtnAction *) action;
672 return ReportActionNotArray(action->type, field);
675 return ReportMismatch(action->type, field,
686 else if ((action->type == XkbSA_LockPtrBtn) && (field == F_Affect))
689 return ReportActionNotArray(action->type, field);
691 return ReportMismatch(action->type, field, "lock or unlock");
699 return ReportActionNotArray(action->type, field);
702 return ReportMismatch(action->type, field, "integer");
712 return ReportIllegal(action->type, field);
723 HandleSetPtrDflt(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
729 act = (XkbPtrDfltAction *) action;
733 return ReportActionNotArray(action->type, field);
735 return ReportMismatch(action->type, field, "pointer component");
743 return ReportActionNotArray(action->type, field);
757 return ReportMismatch(action->type, field,
777 return ReportIllegal(action->type, field);
799 HandleISOLock(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
806 act = (XkbISOAction *) action;
813 return ReportActionNotArray(action->type, field);
815 if (CheckModifierField(xkb, action->type, value, &flags, &mods))
829 return ReportActionNotArray(action->type, field);
831 if (CheckGroupField(action->type, value, &flags, &group))
841 return ReportActionNotArray(action->type, field);
843 return ReportMismatch(action->type, field, "keyboard component");
849 return ReportIllegal(action->type, field);
853 HandleSwitchScreen(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
859 act = (XkbSwitchScreenAction *) action;
864 return ReportActionNotArray(action->type, field);
877 return ReportMismatch(action->type, field, "integer (0..255)");
893 return ReportActionNotArray(action->type, field);
895 return ReportMismatch(action->type, field, "boolean");
902 return ReportIllegal(action->type, field);
944 HandleSetLockControls(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
950 act = (XkbCtrlsAction *) action;
954 return ReportActionNotArray(action->type, field);
957 return ReportMismatch(action->type, field, "controls mask");
961 else if (field == F_Affect && action->type == XkbSA_LockControls) {
963 return ReportActionNotArray(action->type, field);
965 return ReportMismatch(action->type, field, "lock or unlock");
970 return ReportIllegal(action->type, field);
984 HandleActionMessage(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
990 act = (XkbMessageAction *) action;
995 return ReportActionNotArray(action->type, field);
997 return ReportMismatch(action->type, field, "key event mask");
1004 return ReportActionNotArray(action->type, field);
1006 return ReportMismatch(action->type, field, "boolean");
1016 return ReportMismatch(action->type, field, "string");
1022 WARN("An action message can hold only 6 bytes\n");
1041 ERROR("An action message is at most 6 bytes long\n");
1046 return ReportMismatch(action->type, field, "integer");
1057 return ReportIllegal(action->type, field);
1061 HandleRedirectKey(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
1068 return ReportActionNotArray(action->type, field);
1070 act = (XkbRedirectKeyAction *) action;
1079 return ReportMismatch(action->type, field, "key name");
1083 return ReportNotFound(action->type, field, "Key",
1095 if (CheckModifierField(xkb, action->type, value, &t1, &t2))
1120 return ReportIllegal(action->type, field);
1124 HandleDeviceBtn(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
1130 act = (XkbDeviceBtnAction *) action;
1134 return ReportActionNotArray(action->type, field);
1136 return ReportMismatch(action->type, field,
1147 else if ((action->type == XkbSA_LockDeviceBtn) && (field == F_Affect))
1150 return ReportActionNotArray(action->type, field);
1152 return ReportMismatch(action->type, field, "lock or unlock");
1160 return ReportActionNotArray(action->type, field);
1163 return ReportMismatch(action->type, field, "integer");
1176 return ReportActionNotArray(action->type, field);
1178 return ReportMismatch(action->type, field,
1189 return ReportIllegal(action->type, field);
1193 HandleDeviceValuator(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
1200 act = (XkbDeviceValuatorAction *) action;
1207 HandlePrivate(XkbDescPtr xkb, XkbAnyAction *action, unsigned field,
1219 ERROR("Private action type must be in the range 0..255\n");
1223 action->type = rtrn.uval;
1229 return ReportMismatch(action->type, field, "string");
1235 WARN("A private action has 7 data bytes\n");
1239 strncpy((char *) action->data, rtrn.str, 7);
1255 ERROR("The data for a private action is 7 bytes long\n");
1260 return ReportMismatch(action->type, field, "integer");
1263 ERROR("All data for a private action must be 0..255\n");
1267 action->data[ndx] = rtrn.uval;
1275 XkbAnyAction * /* action */ ,
1309 ApplyActionFactoryDefaults(XkbAction * action)
1311 if (action->type == XkbSA_SetPtrDflt)
1313 action->dflt.affect = XkbSA_AffectDfltBtn;
1314 action->dflt.flags = 0;
1315 XkbSASetPtrDfltValue(&action->dflt, 1);
1317 else if (action->type == XkbSA_ISOLock)
1319 action->iso.real_mods = action->iso.mask = LockMask;
1326 HandleActionDef(const ExprDef *def, XkbDescPtr xkb, XkbAnyAction *action,
1338 ERROR("Expected an action definition, found %s\n",
1342 str = XkbAtomGetString(NULL, def->value.action.name);
1345 WSGO("Missing name in action definition!!\n");
1350 ERROR("Unknown action %s\n", str);
1353 action->type = hndlrType = tmp;
1354 if (action->type != XkbSA_NoAction)
1356 ApplyActionFactoryDefaults((XkbAction *) action);
1359 if ((info->action == XkbSA_NoAction)
1360 || (info->action == hndlrType))
1362 if (!(*handleAction[hndlrType]) (xkb, action,
1373 for (arg = def->value.action.args; arg != NULL;
1403 ERROR("Cannot change defaults in an action definition\n");
1414 (xkb, action, fieldNdx, arrayRtrn, value))
1436 WSGO("Couldn't allocate space for action default\n");
1439 if (uStrCaseCmp(elem, "action") == 0)
1440 new->action = XkbSA_NoAction;
1443 if (!stringToAction(elem, &new->action))
1445 if (new->action == XkbSA_NoAction)
1447 ERROR("\"%s\" is not a valid field in a NoAction action\n",