[mouse] Rename Button to button_t

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-23 13:35:46 +02:00
parent 0142f0efc9
commit a04417494b
11 changed files with 27 additions and 27 deletions

View File

@ -818,7 +818,7 @@ luaA_client_mouse(lua_State *L)
{ {
size_t i, len; size_t i, len;
int b; int b;
Button *button; button_t *button;
/* arg 2 is modkey table */ /* arg 2 is modkey table */
luaA_checktable(L, 1); luaA_checktable(L, 1);
@ -827,7 +827,7 @@ luaA_client_mouse(lua_State *L)
/* arg 4 is cmd to run */ /* arg 4 is cmd to run */
luaA_checkfunction(L, 3); luaA_checkfunction(L, 3);
button = p_new(Button, 1); button = p_new(button_t, 1);
button->button = xutil_button_fromint(b); button->button = xutil_button_fromint(b);
button->fct = luaL_ref(L, LUA_REGISTRYINDEX); button->fct = luaL_ref(L, LUA_REGISTRYINDEX);

View File

@ -39,7 +39,7 @@
#define CURSOR_SIZING 120 #define CURSOR_SIZING 120
#define ANY_KEY 0L /* special Key Code, passed to GrabKey */ #define ANY_KEY 0L /* special Key Code, passed to GrabKey */
#define ANY_MODIFIER (1<<15) /* used in GrabButton, GrabKey */ #define ANY_MODIFIER (1<<15) /* used in Grabbutton_t, GrabKey */
/***************************************************************** /*****************************************************************
* ERROR CODES * ERROR CODES

View File

@ -50,9 +50,9 @@ extern AwesomeConf globalconf;
static void static void
event_handle_mouse_button_press(unsigned int button, event_handle_mouse_button_press(unsigned int button,
unsigned int state, unsigned int state,
Button *buttons) button_t *buttons)
{ {
Button *b; button_t *b;
for(b = buttons; b; b = b->next) for(b = buttons; b; b = b->next)
if(button == b->button && CLEANMASK(state) == b->mod && b->fct) if(button == b->button && CLEANMASK(state) == b->mod && b->fct)

4
lua.c
View File

@ -59,7 +59,7 @@ luaA_mouse(lua_State *L)
{ {
size_t i, len; size_t i, len;
int b; int b;
Button *button; button_t *button;
/* arg 1 is modkey table */ /* arg 1 is modkey table */
luaA_checktable(L, 1); luaA_checktable(L, 1);
@ -68,7 +68,7 @@ luaA_mouse(lua_State *L)
/* arg 3 is cmd to run */ /* arg 3 is cmd to run */
luaA_checkfunction(L, 3); luaA_checkfunction(L, 3);
button = p_new(Button, 1); button = p_new(button_t, 1);
button->button = xutil_button_fromint(b); button->button = xutil_button_fromint(b);
button->fct = luaL_ref(L, LUA_REGISTRYINDEX); button->fct = luaL_ref(L, LUA_REGISTRYINDEX);

View File

@ -94,8 +94,8 @@ struct keybinding_t
DO_SLIST(keybinding_t, keybinding, p_delete) DO_SLIST(keybinding_t, keybinding, p_delete)
/** Mouse buttons bindings */ /** Mouse buttons bindings */
typedef struct Button Button; typedef struct button_t button_t;
struct Button struct button_t
{ {
/** Key modifiers */ /** Key modifiers */
unsigned long mod; unsigned long mod;
@ -104,10 +104,10 @@ struct Button
/** Lua function to execute. */ /** Lua function to execute. */
luaA_function fct; luaA_function fct;
/** Next and previous buttons */ /** Next and previous buttons */
Button *prev, *next; button_t *prev, *next;
}; };
DO_SLIST(Button, button, p_delete) DO_SLIST(button_t, button, p_delete)
/** Widget tell status code */ /** Widget tell status code */
typedef enum typedef enum
@ -141,8 +141,8 @@ struct widget_t
alignment_t align; alignment_t align;
/** Misc private data */ /** Misc private data */
void *data; void *data;
/** Buttons bindings */ /** Button bindings */
Button *buttons; button_t *buttons;
/** Cache flags */ /** Cache flags */
int cache_flags; int cache_flags;
}; };
@ -359,9 +359,9 @@ struct AwesomeConf
/** Mouse bindings list */ /** Mouse bindings list */
struct struct
{ {
Button *root; button_t *root;
Button *client; button_t *client;
Button *titlebar; button_t *titlebar;
} buttons; } buttons;
/** Numlock mask */ /** Numlock mask */
unsigned int numlockmask; unsigned int numlockmask;

View File

@ -437,7 +437,7 @@ luaA_titlebar_mouse(lua_State *L)
{ {
size_t i, len; size_t i, len;
int b; int b;
Button *button; button_t *button;
/* arg 1 is modkey table */ /* arg 1 is modkey table */
luaA_checktable(L, 1); luaA_checktable(L, 1);
@ -446,7 +446,7 @@ luaA_titlebar_mouse(lua_State *L)
/* arg 3 is cmd to run */ /* arg 3 is cmd to run */
luaA_checkfunction(L, 3); luaA_checkfunction(L, 3);
button = p_new(Button, 1); button = p_new(button_t, 1);
button->button = xutil_button_fromint(b); button->button = xutil_button_fromint(b);
button->fct = luaL_ref(L, LUA_REGISTRYINDEX); button->fct = luaL_ref(L, LUA_REGISTRYINDEX);

View File

@ -78,7 +78,7 @@ widget_common_button_press(widget_node_t *w,
statusbar_t *statusbar __attribute__ ((unused)), statusbar_t *statusbar __attribute__ ((unused)),
xcb_button_press_event_t *ev) xcb_button_press_event_t *ev)
{ {
Button *b; button_t *b;
for(b = w->widget->buttons; b; b = b->next) for(b = w->widget->buttons; b; b = b->next)
if(ev->detail == b->button && CLEANMASK(ev->state) == b->mod && b->fct) if(ev->detail == b->button && CLEANMASK(ev->state) == b->mod && b->fct)
@ -194,7 +194,7 @@ luaA_widget_mouse(lua_State *L)
/* arg 1 is object */ /* arg 1 is object */
widget_t **widget = luaL_checkudata(L, 1, "widget"); widget_t **widget = luaL_checkudata(L, 1, "widget");
int b; int b;
Button *button; button_t *button;
/* arg 2 is modkey table */ /* arg 2 is modkey table */
luaA_checktable(L, 2); luaA_checktable(L, 2);
@ -203,7 +203,7 @@ luaA_widget_mouse(lua_State *L)
/* arg 4 is cmd to run */ /* arg 4 is cmd to run */
luaA_checkfunction(L, 4); luaA_checkfunction(L, 4);
button = p_new(Button, 1); button = p_new(button_t, 1);
button->button = xutil_button_fromint(b); button->button = xutil_button_fromint(b);
button->fct = luaL_ref(L, LUA_REGISTRYINDEX); button->fct = luaL_ref(L, LUA_REGISTRYINDEX);

View File

@ -192,7 +192,7 @@ taglist_button_press(widget_node_t *w, statusbar_t *statusbar,
xcb_button_press_event_t *ev) xcb_button_press_event_t *ev)
{ {
VirtScreen *vscreen = &globalconf.screens[statusbar->screen]; VirtScreen *vscreen = &globalconf.screens[statusbar->screen];
Button *b; button_t *b;
taglist_data_t *data = w->widget->data; taglist_data_t *data = w->widget->data;
taglist_drawn_area_t *tda; taglist_drawn_area_t *tda;
area_t *area; area_t *area;

View File

@ -177,7 +177,7 @@ static void
tasklist_button_press(widget_node_t *w, statusbar_t *statusbar, tasklist_button_press(widget_node_t *w, statusbar_t *statusbar,
xcb_button_press_event_t *ev) xcb_button_press_event_t *ev)
{ {
Button *b; button_t *b;
client_t *c, **lc; client_t *c, **lc;
Data *d = w->widget->data; Data *d = w->widget->data;
int n = 0, box_width = 0, i, ci = 0; int n = 0, box_width = 0, i, ci = 0;

View File

@ -112,7 +112,7 @@ window_configure(xcb_window_t win, area_t geometry, int border)
void void
window_grabbuttons(xcb_window_t win, int phys_screen) window_grabbuttons(xcb_window_t win, int phys_screen)
{ {
Button *b; button_t *b;
/* Always grab the first mouse button. */ /* Always grab the first mouse button. */
xcb_grab_button(globalconf.connection, false, win, BUTTONMASK, xcb_grab_button(globalconf.connection, false, win, BUTTONMASK,
@ -155,7 +155,7 @@ window_grabbuttons(xcb_window_t win, int phys_screen)
void void
window_root_grabbuttons(void) window_root_grabbuttons(void)
{ {
Button *b; button_t *b;
xcb_screen_t *s; xcb_screen_t *s;
int phys_screen = globalconf.default_screen; int phys_screen = globalconf.default_screen;
@ -186,7 +186,7 @@ window_root_grabbuttons(void)
* \param b The button binding. * \param b The button binding.
*/ */
void void
window_root_grabbutton(Button *b) window_root_grabbutton(button_t *b)
{ {
xcb_screen_t *s; xcb_screen_t *s;
int phys_screen = globalconf.default_screen; int phys_screen = globalconf.default_screen;

View File

@ -28,7 +28,7 @@ void window_setstate(xcb_window_t, long);
long window_getstate(xcb_window_t); long window_getstate(xcb_window_t);
void window_configure(xcb_window_t, area_t, int); void window_configure(xcb_window_t, area_t, int);
void window_grabbuttons(xcb_window_t, int); void window_grabbuttons(xcb_window_t, int);
void window_root_grabbutton(Button *); void window_root_grabbutton(button_t *);
void window_root_grabbuttons(void); void window_root_grabbuttons(void);
void window_root_grabkey(keybinding_t *); void window_root_grabkey(keybinding_t *);
void window_setshape(xcb_window_t, int); void window_setshape(xcb_window_t, int);