rename some client functions

This commit is contained in:
Julien Danjou 2008-01-29 08:21:05 +01:00
parent 9c7bbad840
commit ee1214846e
6 changed files with 20 additions and 20 deletions

View File

@ -85,7 +85,7 @@ client_loadprops(Client * c, int screen)
* \return True if client has WM_DELETE_WINDOW * \return True if client has WM_DELETE_WINDOW
*/ */
static Bool static Bool
isprotodel(Display *disp, Window win) client_isprotodel(Display *disp, Window win)
{ {
int i, n; int i, n;
Atom *protocols; Atom *protocols;
@ -107,7 +107,7 @@ isprotodel(Display *disp, Window win)
* \return client * \return client
*/ */
Client * Client *
get_client_bywin(Client *list, Window w) client_get_bywin(Client *list, Window w)
{ {
Client *c; Client *c;
@ -121,7 +121,7 @@ get_client_bywin(Client *list, Window w)
* \return first matching client * \return first matching client
*/ */
Client * Client *
get_client_byname(Client *list, char *name) client_get_byname(Client *list, char *name)
{ {
Client *c; Client *c;
@ -345,7 +345,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
* XGetTransientForHint returns 1 on success * XGetTransientForHint returns 1 on success
*/ */
if((rettrans = XGetTransientForHint(globalconf.display, w, &trans)) if((rettrans = XGetTransientForHint(globalconf.display, w, &trans))
&& (t = get_client_bywin(globalconf.clients, trans))) && (t = client_get_bywin(globalconf.clients, trans)))
for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next) for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next)
if(is_client_tagged(t, tag)) if(is_client_tagged(t, tag))
tag_client(c, tag); tag_client(c, tag);
@ -840,7 +840,7 @@ client_kill(Client *c)
{ {
XEvent ev; XEvent ev;
if(isprotodel(globalconf.display, c->win)) if(client_isprotodel(globalconf.display, c->win))
{ {
ev.type = ClientMessage; ev.type = ClientMessage;
ev.xclient.window = c->win; ev.xclient.window = c->win;

View File

@ -25,8 +25,8 @@
#include "structs.h" #include "structs.h"
Bool client_isvisible(Client *, int); Bool client_isvisible(Client *, int);
Client * get_client_bywin(Client *, Window); Client * client_get_bywin(Client *, Window);
Client * get_client_byname(Client *, char *); Client * client_get_byname(Client *, char *);
void client_focus(Client *, int, Bool); void client_focus(Client *, int, Bool);
void client_ban(Client *); void client_ban(Client *);
void client_unban(Client *); void client_unban(Client *);

18
event.c
View File

@ -115,7 +115,7 @@ handle_event_buttonpress(XEvent *e)
return; return;
} }
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
{ {
client_focus(c, c->screen, False); client_focus(c, c->screen, False);
if(CLEANMASK(ev->state) == NoSymbol if(CLEANMASK(ev->state) == NoSymbol
@ -151,7 +151,7 @@ handle_event_configurerequest(XEvent * e)
int old_screen; int old_screen;
Area geometry; Area geometry;
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
{ {
geometry = c->geometry; geometry = c->geometry;
@ -212,7 +212,7 @@ handle_event_destroynotify(XEvent * e)
Client *c; Client *c;
XDestroyWindowEvent *ev = &e->xdestroywindow; XDestroyWindowEvent *ev = &e->xdestroywindow;
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
client_unmanage(c); client_unmanage(c);
} }
@ -226,7 +226,7 @@ handle_event_enternotify(XEvent * e)
if(ev->mode != NotifyNormal) if(ev->mode != NotifyNormal)
return; return;
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
{ {
window_grabbuttons(get_phys_screen(c->screen), c->win); window_grabbuttons(get_phys_screen(c->screen), c->win);
if(globalconf.screens[c->screen].sloppy_focus) if(globalconf.screens[c->screen].sloppy_focus)
@ -325,7 +325,7 @@ handle_event_maprequest(XEvent *e)
return; return;
if(wa.override_redirect) if(wa.override_redirect)
return; return;
if(!get_client_bywin(globalconf.clients, ev->window)) if(!client_get_bywin(globalconf.clients, ev->window))
{ {
for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++); for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++);
if(screen == 0 && XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), if(screen == 0 && XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen),
@ -344,14 +344,14 @@ handle_event_propertynotify(XEvent * e)
if(ev->state == PropertyDelete) if(ev->state == PropertyDelete)
return; /* ignore */ return; /* ignore */
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
{ {
switch (ev->atom) switch (ev->atom)
{ {
case XA_WM_TRANSIENT_FOR: case XA_WM_TRANSIENT_FOR:
XGetTransientForHint(e->xany.display, c->win, &trans); XGetTransientForHint(e->xany.display, c->win, &trans);
if(!c->isfloating if(!c->isfloating
&& (c->isfloating = (get_client_bywin(globalconf.clients, trans) != NULL))) && (c->isfloating = (client_get_bywin(globalconf.clients, trans) != NULL)))
globalconf.screens[c->screen].need_arrange = True; globalconf.screens[c->screen].need_arrange = True;
break; break;
case XA_WM_NORMAL_HINTS: case XA_WM_NORMAL_HINTS:
@ -372,7 +372,7 @@ handle_event_unmapnotify(XEvent * e)
Client *c; Client *c;
XUnmapEvent *ev = &e->xunmap; XUnmapEvent *ev = &e->xunmap;
if((c = get_client_bywin(globalconf.clients, ev->window)) if((c = client_get_bywin(globalconf.clients, ev->window))
&& ev->event == RootWindow(e->xany.display, get_phys_screen(c->screen)) && ev->event == RootWindow(e->xany.display, get_phys_screen(c->screen))
&& ev->send_event && window_getstate(c->win) == NormalState) && ev->send_event && window_getstate(c->win) == NormalState)
client_unmanage(c); client_unmanage(c);
@ -382,7 +382,7 @@ void
handle_event_shape(XEvent * e) handle_event_shape(XEvent * e)
{ {
XShapeEvent *ev = (XShapeEvent *) e; XShapeEvent *ev = (XShapeEvent *) e;
Client *c = get_client_bywin(globalconf.clients, ev->window); Client *c = client_get_bywin(globalconf.clients, ev->window);
if(c) if(c)
window_setshape(get_phys_screen(c->screen), c->win); window_setshape(get_phys_screen(c->screen), c->win);

4
ewmh.c
View File

@ -309,12 +309,12 @@ ewmh_process_client_message(XClientMessageEvent *ev)
if(ev->message_type == net_close_window) if(ev->message_type == net_close_window)
{ {
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
client_kill(c); client_kill(c);
} }
else if(ev->message_type == net_wm_state) else if(ev->message_type == net_wm_state)
{ {
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
{ {
ewmh_process_state_atom(c, (Atom) ev->data.l[1], ev->data.l[0]); ewmh_process_state_atom(c, (Atom) ev->data.l[1], ev->data.l[0]);
if(ev->data.l[2]) if(ev->data.l[2])

View File

@ -134,7 +134,7 @@ uicb_focus_client_byname(int screen, char *arg)
if(arg) if(arg)
{ {
curtags = get_current_tags(screen); curtags = get_current_tags(screen);
if((c = get_client_byname(globalconf.clients, arg))) if((c = client_get_byname(globalconf.clients, arg)))
for(tag = curtags; *tag; tag++) for(tag = curtags; *tag; tag++)
if(is_client_tagged(c, *tag)) if(is_client_tagged(c, *tag))
client_focus(c, screen, False); client_focus(c, screen, False);

View File

@ -125,7 +125,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
globalconf.screens[newscreen].need_arrange = True; globalconf.screens[newscreen].need_arrange = True;
layout_refresh(); layout_refresh();
} }
if((target = get_client_bywin(globalconf.clients, child)) if((target = client_get_bywin(globalconf.clients, child))
&& target != c) && target != c)
{ {
client_list_swap(&globalconf.clients, c, target); client_list_swap(&globalconf.clients, c, target);