[config] Rename Key to keybinding_t
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
04ea13c205
commit
fb5b227214
17
config.c
17
config.c
|
@ -156,7 +156,7 @@ parse_mouse_bindings(cfg_t * cfg, const char *secname, bool handle_arg)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_key_info(Key *key, cfg_t *cfg)
|
set_key_info(keybinding_t *key, cfg_t *cfg)
|
||||||
{
|
{
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
|
||||||
|
@ -168,10 +168,9 @@ set_key_info(Key *key, cfg_t *cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_key_store(Key *key, char *str)
|
config_key_store(keybinding_t *key, char *str)
|
||||||
{
|
{
|
||||||
xcb_keycode_t kc;
|
xcb_keycode_t kc;
|
||||||
xcb_keysym_t ks;
|
|
||||||
int ikc;
|
int ikc;
|
||||||
|
|
||||||
if(!a_strlen(str))
|
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)
|
section_keys(cfg_t *cfg_keys)
|
||||||
{
|
{
|
||||||
Key *key = NULL, *head = NULL;
|
keybinding_t *key = NULL, *head = NULL;
|
||||||
int i, j, numkeys;
|
int i, j, numkeys;
|
||||||
cfg_t *cfgkeytmp;
|
cfg_t *cfgkeytmp;
|
||||||
|
|
||||||
for(i = cfg_size(cfg_keys, "key") - 1; i >= 0; i--)
|
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);
|
cfgkeytmp = cfg_getnsec(cfg_keys, "key", i);
|
||||||
set_key_info(key, cfgkeytmp);
|
set_key_info(key, cfgkeytmp);
|
||||||
config_key_store(key, cfg_getstr(cfgkeytmp, "key"));
|
config_key_store(key, cfg_getstr(cfgkeytmp, "key"));
|
||||||
key->arg = a_strdup(cfg_getstr(cfgkeytmp, "arg"));
|
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--)
|
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++)
|
for(j = 0; j < numkeys; j++)
|
||||||
{
|
{
|
||||||
key = p_new(Key, 1);
|
key = p_new(keybinding_t, 1);
|
||||||
set_key_info(key, cfgkeytmp);
|
set_key_info(key, cfgkeytmp);
|
||||||
config_key_store(key, cfg_getnstr(cfgkeytmp, "keylist", j));
|
config_key_store(key, cfg_getnstr(cfgkeytmp, "keylist", j));
|
||||||
key->arg = a_strdup(cfg_getnstr(cfgkeytmp, "arglist", j));
|
key->arg = a_strdup(cfg_getnstr(cfgkeytmp, "arglist", j));
|
||||||
key_list_push(&head, key);
|
keybinding_list_push(&head, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
config.h
2
config.h
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
|
||||||
DO_SLIST(Key, key, p_delete)
|
DO_SLIST(keybinding_t, keybinding, p_delete)
|
||||||
DO_SLIST(Button, button, p_delete)
|
DO_SLIST(Button, button, p_delete)
|
||||||
|
|
||||||
void config_parse(const char *);
|
void config_parse(const char *);
|
||||||
|
|
2
event.c
2
event.c
|
@ -394,7 +394,7 @@ event_handle_keypress(void *data __attribute__ ((unused)),
|
||||||
int screen;
|
int screen;
|
||||||
xcb_query_pointer_reply_t *qpr = NULL;
|
xcb_query_pointer_reply_t *qpr = NULL;
|
||||||
xcb_keysym_t keysym;
|
xcb_keysym_t keysym;
|
||||||
Key *k;
|
keybinding_t *k;
|
||||||
|
|
||||||
/* find the right screen for this event */
|
/* find the right screen for this event */
|
||||||
for(screen = 0; screen < xcb_setup_roots_length (xcb_get_setup (connection)); screen++)
|
for(screen = 0; screen < xcb_setup_roots_length (xcb_get_setup (connection)); screen++)
|
||||||
|
|
10
structs.h
10
structs.h
|
@ -73,9 +73,9 @@ struct rule_t
|
||||||
rule_t *prev, *next;
|
rule_t *prev, *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Key bindings */
|
/** Keys bindings */
|
||||||
typedef struct Key Key;
|
typedef struct keybinding_t keybinding_t;
|
||||||
struct Key
|
struct keybinding_t
|
||||||
{
|
{
|
||||||
unsigned long mod;
|
unsigned long mod;
|
||||||
xcb_keysym_t keysym;
|
xcb_keysym_t keysym;
|
||||||
|
@ -83,7 +83,7 @@ struct Key
|
||||||
uicb_t *func;
|
uicb_t *func;
|
||||||
char *arg;
|
char *arg;
|
||||||
/** Next and previous keys */
|
/** Next and previous keys */
|
||||||
Key *prev, *next;
|
keybinding_t *prev, *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Mouse buttons bindings */
|
/** Mouse buttons bindings */
|
||||||
|
@ -342,7 +342,7 @@ struct AwesomeConf
|
||||||
/** Rules list */
|
/** Rules list */
|
||||||
rule_t *rules;
|
rule_t *rules;
|
||||||
/** Keys bindings list */
|
/** Keys bindings list */
|
||||||
Key *keys;
|
keybinding_t *keys;
|
||||||
/** Mouse bindings list */
|
/** Mouse bindings list */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
2
window.c
2
window.c
|
@ -178,7 +178,7 @@ void
|
||||||
window_root_grabkeys(int phys_screen)
|
window_root_grabkeys(int phys_screen)
|
||||||
{
|
{
|
||||||
xcb_screen_t *s = xcb_aux_get_screen(globalconf.connection, phys_screen);
|
xcb_screen_t *s = xcb_aux_get_screen(globalconf.connection, phys_screen);
|
||||||
Key *k;
|
keybinding_t *k;
|
||||||
xcb_keycode_t kc;
|
xcb_keycode_t kc;
|
||||||
|
|
||||||
xcb_ungrab_key(globalconf.connection, ANY_KEY, s->root, ANY_MODIFIER);
|
xcb_ungrab_key(globalconf.connection, ANY_KEY, s->root, ANY_MODIFIER);
|
||||||
|
|
Loading…
Reference in New Issue