[config] Rename Key to keybinding_t

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-28 15:40:49 +02:00
parent 04ea13c205
commit fb5b227214
5 changed files with 16 additions and 17 deletions

View File

@ -156,7 +156,7 @@ parse_mouse_bindings(cfg_t * cfg, const char *secname, bool handle_arg)
static void
set_key_info(Key *key, cfg_t *cfg)
set_key_info(keybinding_t *key, cfg_t *cfg)
{
unsigned int j;
@ -168,10 +168,9 @@ set_key_info(Key *key, cfg_t *cfg)
}
static void
config_key_store(Key *key, char *str)
config_key_store(keybinding_t *key, char *str)
{
xcb_keycode_t kc;
xcb_keysym_t ks;
int ikc;
if(!a_strlen(str))
@ -186,21 +185,21 @@ config_key_store(Key *key, char *str)
}
}
static Key *
static keybinding_t *
section_keys(cfg_t *cfg_keys)
{
Key *key = NULL, *head = NULL;
keybinding_t *key = NULL, *head = NULL;
int i, j, numkeys;
cfg_t *cfgkeytmp;
for(i = cfg_size(cfg_keys, "key") - 1; i >= 0; i--)
{
key = p_new(Key, 1);
key = p_new(keybinding_t, 1);
cfgkeytmp = cfg_getnsec(cfg_keys, "key", i);
set_key_info(key, cfgkeytmp);
config_key_store(key, cfg_getstr(cfgkeytmp, "key"));
key->arg = a_strdup(cfg_getstr(cfgkeytmp, "arg"));
key_list_push(&head, key);
keybinding_list_push(&head, key);
}
for(i = cfg_size(cfg_keys, "keylist") - 1; i >= 0; i--)
@ -215,11 +214,11 @@ section_keys(cfg_t *cfg_keys)
for(j = 0; j < numkeys; j++)
{
key = p_new(Key, 1);
key = p_new(keybinding_t, 1);
set_key_info(key, cfgkeytmp);
config_key_store(key, cfg_getnstr(cfgkeytmp, "keylist", j));
key->arg = a_strdup(cfg_getnstr(cfgkeytmp, "arglist", j));
key_list_push(&head, key);
keybinding_list_push(&head, key);
}
}

View File

@ -24,7 +24,7 @@
#include "structs.h"
DO_SLIST(Key, key, p_delete)
DO_SLIST(keybinding_t, keybinding, p_delete)
DO_SLIST(Button, button, p_delete)
void config_parse(const char *);

View File

@ -394,7 +394,7 @@ event_handle_keypress(void *data __attribute__ ((unused)),
int screen;
xcb_query_pointer_reply_t *qpr = NULL;
xcb_keysym_t keysym;
Key *k;
keybinding_t *k;
/* find the right screen for this event */
for(screen = 0; screen < xcb_setup_roots_length (xcb_get_setup (connection)); screen++)

View File

@ -73,9 +73,9 @@ struct rule_t
rule_t *prev, *next;
};
/** Key bindings */
typedef struct Key Key;
struct Key
/** Keys bindings */
typedef struct keybinding_t keybinding_t;
struct keybinding_t
{
unsigned long mod;
xcb_keysym_t keysym;
@ -83,7 +83,7 @@ struct Key
uicb_t *func;
char *arg;
/** Next and previous keys */
Key *prev, *next;
keybinding_t *prev, *next;
};
/** Mouse buttons bindings */
@ -342,7 +342,7 @@ struct AwesomeConf
/** Rules list */
rule_t *rules;
/** Keys bindings list */
Key *keys;
keybinding_t *keys;
/** Mouse bindings list */
struct
{

View File

@ -178,7 +178,7 @@ void
window_root_grabkeys(int phys_screen)
{
xcb_screen_t *s = xcb_aux_get_screen(globalconf.connection, phys_screen);
Key *k;
keybinding_t *k;
xcb_keycode_t kc;
xcb_ungrab_key(globalconf.connection, ANY_KEY, s->root, ANY_MODIFIER);