Lines Matching defs:action
53 * Define the size of the hash table that is used to associate action
54 * names with action functions. This should be a prime number.
200 * action char * The action to associate with the key sequence, or
201 * NULL to remove the action associated with the
208 const char *action)
210 KtKeyFn *keyfn; /* The action function */
211 void *data; /* The callback data of the action function */
222 * Lookup the function that implements the specified action.
224 if(!action) {
228 Symbol *sym = _find_HashSymbol(kt->actions, action);
230 _err_record_msg(kt->err, "Unknown key-binding action: ", action,
239 * Record the action in the table.
245 * Add, update or remove a keybinding to the table, specifying an action
252 * keyfn KtKeyFn * The action function, or NULL to remove any existing
253 * action function.
370 KtAction *action = sym->actions + i;
371 action->fn = 0;
372 action->data = NULL;
650 * Add, remove or modify an action.
654 * action char * The name of the action.
655 * fn KtKeyFn * The function that implements the action, or NULL
656 * to remove an existing action.
658 * action function whenever it is called.
663 int _kt_set_action(KeyTab *kt, const char *action, KtKeyFn *fn, void *data)
665 Symbol *sym; /* The symbol table entry of the action */
669 if(!kt || !action) {
676 * If no function was provided, delete an existing action.
679 sym = _del_HashSymbol(kt->actions, action);
683 * If the action already exists, replace its action function.
685 sym = _find_HashSymbol(kt->actions, action);
692 * Add a new action.
694 if(!_new_HashSymbol(kt->actions, action, 0, (void (*)(void))fn, data, 0)) {
695 _err_record_msg(kt->err, "Insufficient memory to record key-binding action",
743 * Assign a given action function to a binding table entry.
748 * keyfn KtKeyFn * The action function.
750 * the action function whenever it is called.
755 KtAction *action; /* An action function/data pair */
763 * Record the action according to its source.
765 action = sym->actions + binder;
766 action->fn = keyfn;
767 action->data = data;
770 * action. Note that the actions[] array is ordered in order of
777 * Record the index of this action for use during lookups.
958 if(_kt_set_keybinding(kt, binder, bindings[i].keyseq, bindings[i].action))
965 * Lookup the function that implements a given action.
969 * action const char * The name of the action to look up.
971 * fn KtKeyFn ** If the action is found, the function that
974 * data void ** If the action is found, the callback data
975 * associated with the action function, will be
981 int _kt_lookup_action(KeyTab *kt, const char *action,
984 Symbol *sym; /* The symbol table entry of the action */
988 if(!kt || !action) {
995 * Lookup the symbol table entry of the action.
997 sym = _find_HashSymbol(kt->actions, action);
1001 * Return the function and ccallback data associated with the action.