Rename events functions from handle_event... to event_handle
This commit is contained in:
parent
edb865a070
commit
dd9a1b99c4
32
awesome.c
32
awesome.c
|
@ -321,33 +321,33 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
handler = p_new(event_handler *, LASTEvent);
|
handler = p_new(event_handler *, LASTEvent);
|
||||||
handler[ButtonPress] = handle_event_buttonpress;
|
handler[ButtonPress] = event_handle_buttonpress;
|
||||||
handler[ConfigureRequest] = handle_event_configurerequest;
|
handler[ConfigureRequest] = event_handle_configurerequest;
|
||||||
handler[ConfigureNotify] = handle_event_configurenotify;
|
handler[ConfigureNotify] = event_handle_configurenotify;
|
||||||
handler[DestroyNotify] = handle_event_destroynotify;
|
handler[DestroyNotify] = event_handle_destroynotify;
|
||||||
handler[EnterNotify] = handle_event_enternotify;
|
handler[EnterNotify] = event_handle_enternotify;
|
||||||
handler[LeaveNotify] = handle_event_leavenotify;
|
handler[LeaveNotify] = event_handle_leavenotify;
|
||||||
handler[MotionNotify] = handle_event_motionnotify;
|
handler[MotionNotify] = event_handle_motionnotify;
|
||||||
handler[Expose] = handle_event_expose;
|
handler[Expose] = event_handle_expose;
|
||||||
handler[KeyPress] = handle_event_keypress;
|
handler[KeyPress] = event_handle_keypress;
|
||||||
handler[MappingNotify] = handle_event_mappingnotify;
|
handler[MappingNotify] = event_handle_mappingnotify;
|
||||||
handler[MapRequest] = handle_event_maprequest;
|
handler[MapRequest] = event_handle_maprequest;
|
||||||
handler[PropertyNotify] = handle_event_propertynotify;
|
handler[PropertyNotify] = event_handle_propertynotify;
|
||||||
handler[UnmapNotify] = handle_event_unmapnotify;
|
handler[UnmapNotify] = event_handle_unmapnotify;
|
||||||
handler[ClientMessage] = handle_event_clientmessage;
|
handler[ClientMessage] = event_handle_clientmessage;
|
||||||
|
|
||||||
/* check for shape extension */
|
/* check for shape extension */
|
||||||
if((globalconf.have_shape = XShapeQueryExtension(dpy, &shape_event, &e_dummy)))
|
if((globalconf.have_shape = XShapeQueryExtension(dpy, &shape_event, &e_dummy)))
|
||||||
{
|
{
|
||||||
p_realloc(&handler, shape_event + 1);
|
p_realloc(&handler, shape_event + 1);
|
||||||
handler[shape_event] = handle_event_shape;
|
handler[shape_event] = event_handle_shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for randr extension */
|
/* check for randr extension */
|
||||||
if((globalconf.have_randr = XRRQueryExtension(dpy, &randr_event_base, &e_dummy)))
|
if((globalconf.have_randr = XRRQueryExtension(dpy, &randr_event_base, &e_dummy)))
|
||||||
{
|
{
|
||||||
p_realloc(&handler, randr_event_base + RRScreenChangeNotify + 1);
|
p_realloc(&handler, randr_event_base + RRScreenChangeNotify + 1);
|
||||||
handler[randr_event_base + RRScreenChangeNotify] = handle_event_randr_screen_change_notify;
|
handler[randr_event_base + RRScreenChangeNotify] = event_handle_randr_screen_change_notify;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
38
event.c
38
event.c
|
@ -50,7 +50,7 @@ extern AwesomeConf globalconf;
|
||||||
* \param arg optional arg passed to uicb, otherwise buttons' arg are used
|
* \param arg optional arg passed to uicb, otherwise buttons' arg are used
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
handle_mouse_button_press(int screen, unsigned int button, unsigned int state,
|
event_handle_mouse_button_press(int screen, unsigned int button, unsigned int state,
|
||||||
Button *buttons, char *arg)
|
Button *buttons, char *arg)
|
||||||
{
|
{
|
||||||
Button *b;
|
Button *b;
|
||||||
|
@ -70,7 +70,7 @@ handle_mouse_button_press(int screen, unsigned int button, unsigned int state,
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_buttonpress(XEvent *e)
|
event_handle_buttonpress(XEvent *e)
|
||||||
{
|
{
|
||||||
int i, screen, x = 0, y = 0;
|
int i, screen, x = 0, y = 0;
|
||||||
unsigned int udummy;
|
unsigned int udummy;
|
||||||
|
@ -135,7 +135,7 @@ handle_event_buttonpress(XEvent *e)
|
||||||
window_grabbuttons(get_phys_screen(c->screen), c->win);
|
window_grabbuttons(get_phys_screen(c->screen), c->win);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL);
|
event_handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
|
@ -146,7 +146,7 @@ handle_event_buttonpress(XEvent *e)
|
||||||
&i, &udummy))
|
&i, &udummy))
|
||||||
{
|
{
|
||||||
screen = screen_get_bycoord(screen, x, y);
|
screen = screen_get_bycoord(screen, x, y);
|
||||||
handle_mouse_button_press(screen, ev->button, ev->state,
|
event_handle_mouse_button_press(screen, ev->button, ev->state,
|
||||||
globalconf.buttons.root, NULL);
|
globalconf.buttons.root, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ handle_event_buttonpress(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_configurerequest(XEvent * e)
|
event_handle_configurerequest(XEvent * e)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
||||||
|
@ -209,7 +209,7 @@ handle_event_configurerequest(XEvent * e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_configurenotify(XEvent * e)
|
event_handle_configurenotify(XEvent * e)
|
||||||
{
|
{
|
||||||
XConfigureEvent *ev = &e->xconfigure;
|
XConfigureEvent *ev = &e->xconfigure;
|
||||||
int screen;
|
int screen;
|
||||||
|
@ -226,7 +226,7 @@ handle_event_configurenotify(XEvent * e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_destroynotify(XEvent *e)
|
event_handle_destroynotify(XEvent *e)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
XDestroyWindowEvent *ev = &e->xdestroywindow;
|
XDestroyWindowEvent *ev = &e->xdestroywindow;
|
||||||
|
@ -239,7 +239,7 @@ handle_event_destroynotify(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_enternotify(XEvent *e)
|
event_handle_enternotify(XEvent *e)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
XCrossingEvent *ev = &e->xcrossing;
|
XCrossingEvent *ev = &e->xcrossing;
|
||||||
|
@ -273,7 +273,7 @@ handle_event_enternotify(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_motionnotify(XEvent *e)
|
event_handle_motionnotify(XEvent *e)
|
||||||
{
|
{
|
||||||
XMotionEvent *ev = &e->xmotion;
|
XMotionEvent *ev = &e->xmotion;
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ handle_event_motionnotify(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_expose(XEvent *e)
|
event_handle_expose(XEvent *e)
|
||||||
{
|
{
|
||||||
XExposeEvent *ev = &e->xexpose;
|
XExposeEvent *ev = &e->xexpose;
|
||||||
int screen;
|
int screen;
|
||||||
|
@ -305,7 +305,7 @@ handle_event_expose(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_keypress(XEvent *e)
|
event_handle_keypress(XEvent *e)
|
||||||
{
|
{
|
||||||
int screen, x, y, d;
|
int screen, x, y, d;
|
||||||
unsigned int m;
|
unsigned int m;
|
||||||
|
@ -338,7 +338,7 @@ handle_event_keypress(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_leavenotify(XEvent * e)
|
event_handle_leavenotify(XEvent * e)
|
||||||
{
|
{
|
||||||
XCrossingEvent *ev = &e->xcrossing;
|
XCrossingEvent *ev = &e->xcrossing;
|
||||||
int screen;
|
int screen;
|
||||||
|
@ -352,7 +352,7 @@ handle_event_leavenotify(XEvent * e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_mappingnotify(XEvent *e)
|
event_handle_mappingnotify(XEvent *e)
|
||||||
{
|
{
|
||||||
XMappingEvent *ev = &e->xmapping;
|
XMappingEvent *ev = &e->xmapping;
|
||||||
int screen;
|
int screen;
|
||||||
|
@ -367,7 +367,7 @@ handle_event_mappingnotify(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_maprequest(XEvent *e)
|
event_handle_maprequest(XEvent *e)
|
||||||
{
|
{
|
||||||
static XWindowAttributes wa;
|
static XWindowAttributes wa;
|
||||||
XMapRequestEvent *ev = &e->xmaprequest;
|
XMapRequestEvent *ev = &e->xmaprequest;
|
||||||
|
@ -396,7 +396,7 @@ handle_event_maprequest(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_propertynotify(XEvent * e)
|
event_handle_propertynotify(XEvent * e)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
Window trans;
|
Window trans;
|
||||||
|
@ -430,7 +430,7 @@ handle_event_propertynotify(XEvent * e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_unmapnotify(XEvent * e)
|
event_handle_unmapnotify(XEvent * e)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
XUnmapEvent *ev = &e->xunmap;
|
XUnmapEvent *ev = &e->xunmap;
|
||||||
|
@ -445,7 +445,7 @@ handle_event_unmapnotify(XEvent * e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_shape(XEvent * e)
|
event_handle_shape(XEvent * e)
|
||||||
{
|
{
|
||||||
XShapeEvent *ev = (XShapeEvent *) e;
|
XShapeEvent *ev = (XShapeEvent *) e;
|
||||||
Client *c = client_get_bywin(globalconf.clients, ev->window);
|
Client *c = client_get_bywin(globalconf.clients, ev->window);
|
||||||
|
@ -458,7 +458,7 @@ handle_event_shape(XEvent * e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_randr_screen_change_notify(XEvent *e)
|
event_handle_randr_screen_change_notify(XEvent *e)
|
||||||
{
|
{
|
||||||
XRRUpdateConfiguration(e);
|
XRRUpdateConfiguration(e);
|
||||||
uicb_exec(0, globalconf.argv);
|
uicb_exec(0, globalconf.argv);
|
||||||
|
@ -468,7 +468,7 @@ handle_event_randr_screen_change_notify(XEvent *e)
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handle_event_clientmessage(XEvent *e)
|
event_handle_clientmessage(XEvent *e)
|
||||||
{
|
{
|
||||||
ewmh_process_client_message(&e->xclient);
|
ewmh_process_client_message(&e->xclient);
|
||||||
}
|
}
|
||||||
|
|
32
event.h
32
event.h
|
@ -28,22 +28,22 @@
|
||||||
|
|
||||||
void grabkeys(int);
|
void grabkeys(int);
|
||||||
|
|
||||||
void handle_event_buttonpress(XEvent *);
|
void event_handle_buttonpress(XEvent *);
|
||||||
void handle_event_configurerequest(XEvent *);
|
void event_handle_configurerequest(XEvent *);
|
||||||
void handle_event_configurenotify(XEvent *);
|
void event_handle_configurenotify(XEvent *);
|
||||||
void handle_event_destroynotify(XEvent *);
|
void event_handle_destroynotify(XEvent *);
|
||||||
void handle_event_enternotify(XEvent *);
|
void event_handle_enternotify(XEvent *);
|
||||||
void handle_event_motionnotify(XEvent *);
|
void event_handle_motionnotify(XEvent *);
|
||||||
void handle_event_expose(XEvent *);
|
void event_handle_expose(XEvent *);
|
||||||
void handle_event_keypress(XEvent *);
|
void event_handle_keypress(XEvent *);
|
||||||
void handle_event_leavenotify(XEvent *);
|
void event_handle_leavenotify(XEvent *);
|
||||||
void handle_event_mappingnotify(XEvent *);
|
void event_handle_mappingnotify(XEvent *);
|
||||||
void handle_event_maprequest(XEvent *);
|
void event_handle_maprequest(XEvent *);
|
||||||
void handle_event_propertynotify(XEvent *);
|
void event_handle_propertynotify(XEvent *);
|
||||||
void handle_event_unmapnotify(XEvent *);
|
void event_handle_unmapnotify(XEvent *);
|
||||||
void handle_event_shape(XEvent *);
|
void event_handle_shape(XEvent *);
|
||||||
void handle_event_randr_screen_change_notify(XEvent *);
|
void event_handle_randr_screen_change_notify(XEvent *);
|
||||||
void handle_event_clientmessage(XEvent *);
|
void event_handle_clientmessage(XEvent *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
14
mouse.c
14
mouse.c
|
@ -80,16 +80,16 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
XUngrabPointer(globalconf.display, CurrentTime);
|
XUngrabPointer(globalconf.display, CurrentTime);
|
||||||
return;
|
return;
|
||||||
case ConfigureRequest:
|
case ConfigureRequest:
|
||||||
handle_event_configurerequest(&ev);
|
event_handle_configurerequest(&ev);
|
||||||
break;
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
handle_event_expose(&ev);
|
event_handle_expose(&ev);
|
||||||
break;
|
break;
|
||||||
case MapRequest:
|
case MapRequest:
|
||||||
handle_event_maprequest(&ev);
|
event_handle_maprequest(&ev);
|
||||||
break;
|
break;
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
handle_event_enternotify(&ev);
|
event_handle_enternotify(&ev);
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
if(c->isfloating || layout->arrange == layout_floating)
|
if(c->isfloating || layout->arrange == layout_floating)
|
||||||
|
@ -206,13 +206,13 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
XUngrabPointer(globalconf.display, CurrentTime);
|
XUngrabPointer(globalconf.display, CurrentTime);
|
||||||
return;
|
return;
|
||||||
case ConfigureRequest:
|
case ConfigureRequest:
|
||||||
handle_event_configurerequest(&ev);
|
event_handle_configurerequest(&ev);
|
||||||
break;
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
handle_event_expose(&ev);
|
event_handle_expose(&ev);
|
||||||
break;
|
break;
|
||||||
case MapRequest:
|
case MapRequest:
|
||||||
handle_event_maprequest(&ev);
|
event_handle_maprequest(&ev);
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
if(layout->arrange == layout_floating || c->isfloating)
|
if(layout->arrange == layout_floating || c->isfloating)
|
||||||
|
|
Loading…
Reference in New Issue