From dcec6aa7498120b3a62f3be20dd52bc098ecd208 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 17 Sep 2007 13:58:49 +0200 Subject: [PATCH] remove screen arg from uicb* --- awesome.c | 1 - awesome.h | 2 +- client.c | 3 --- client.h | 6 +++--- config.h | 2 +- event.c | 24 ++++++++++++------------ layout.c | 17 +++++------------ layout.h | 14 +++++++------- layouts/tile.c | 3 --- layouts/tile.h | 6 +++--- statusbar.c | 1 - statusbar.h | 2 +- tag.c | 16 ++++------------ tag.h | 16 ++++++++-------- util.c | 3 +-- util.h | 2 +- 16 files changed, 47 insertions(+), 71 deletions(-) diff --git a/awesome.c b/awesome.c index d4d77e05..c7528bf3 100644 --- a/awesome.c +++ b/awesome.c @@ -232,7 +232,6 @@ xerrorstart(Display * disp __attribute__ ((unused)), XErrorEvent * ee __attribut */ void uicb_quit(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)), awesome_config *awesomeconf __attribute__((unused)), const char *arg __attribute__ ((unused))) diff --git a/awesome.h b/awesome.h index 83a2557a..d7977d79 100644 --- a/awesome.h +++ b/awesome.h @@ -24,7 +24,7 @@ #include "config.h" -void uicb_quit(Display *, int, DC *, awesome_config *, const char *); /* quit awesome nicely */ +void uicb_quit(Display *, DC *, awesome_config *, const char *); /* quit awesome nicely */ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */ int __attribute__ ((deprecated)) get_windows_area_x(Statusbar); int __attribute__ ((deprecated)) get_windows_area_y(Statusbar); diff --git a/client.c b/client.c index 4d1a90e8..11954d78 100644 --- a/client.c +++ b/client.c @@ -301,7 +301,6 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config */ void uicb_killclient(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)), awesome_config *awesomeconf __attribute__ ((unused)), const char *arg __attribute__ ((unused))) @@ -491,7 +490,6 @@ resize(Client * c, int x, int y, int w, int h, Bool sizehints) void uicb_moveresize(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)), awesome_config *awesomeconf, const char *arg) @@ -660,7 +658,6 @@ set_shape(Client *c) void uicb_settrans(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)), awesome_config *awesomeconf __attribute__ ((unused)), const char *arg) diff --git a/client.h b/client.h index abea060a..fba65132 100644 --- a/client.h +++ b/client.h @@ -68,8 +68,8 @@ void updatesizehints(Client *); /* update the size hint variables of c */ void updatetitle(Client *); /* update the name of c */ void saveprops(Client * c, int); /* saves client properties */ void set_shape(Client *); -void uicb_killclient(Display *, int, DC *, awesome_config *, const char *); /* kill client */ -void uicb_moveresize(Display *, int, DC *, awesome_config *, const char *); /* move and resize window */ -void uicb_settrans(Display *, int, DC *, awesome_config *, const char *); +void uicb_killclient(Display *, DC *, awesome_config *, const char *); /* kill client */ +void uicb_moveresize(Display *, DC *, awesome_config *, const char *); /* move and resize window */ +void uicb_settrans(Display *, DC *, awesome_config *, const char *); #endif diff --git a/config.h b/config.h index ce2c1571..f3babcc9 100644 --- a/config.h +++ b/config.h @@ -72,7 +72,7 @@ typedef struct { unsigned long mod; KeySym keysym; - void (*func) (Display *, int, DC *, awesome_config *, char *); + void (*func) (Display *, DC *, awesome_config *, char *); char *arg; } Key; diff --git a/event.c b/event.c index 63e4d468..410d94c7 100644 --- a/event.c +++ b/event.c @@ -160,22 +160,22 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) if(ev->button == Button1) { if(ev->state & awesomeconf[screen].modkey) - uicb_tag(e->xany.display, screen, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); + uicb_tag(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); else - uicb_view(e->xany.display, screen, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); + uicb_view(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); } else if(ev->button == Button3) { if(ev->state & awesomeconf[screen].modkey) - uicb_toggletag(e->xany.display, screen, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); + uicb_toggletag(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); else - uicb_toggleview(e->xany.display, screen, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); + uicb_toggleview(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].tags[i]); } return; } } if((ev->x < x + awesomeconf[screen].statusbar.width) && ev->button == Button1) - uicb_setlayout(e->xany.display, screen, &dc[screen], &awesomeconf[screen], NULL); + uicb_setlayout(e->xany.display, &dc[screen], &awesomeconf[screen], NULL); return; } @@ -187,7 +187,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) if(ev->button == Button1) { if(!IS_ARRANGE(floating) && !c->isfloating) - uicb_togglefloating(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL); else restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]); movemouse(c, &awesomeconf[c->screen]); @@ -195,14 +195,14 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) else if(ev->button == Button2) { if(IS_ARRANGE(tile) && !c->isfixed && c->isfloating) - uicb_togglefloating(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL); else - uicb_zoom(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + uicb_zoom(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL); } else if(ev->button == Button3) { if(!IS_ARRANGE(floating) && !c->isfloating) - uicb_togglefloating(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + uicb_togglefloating(e->xany.display, &dc[c->screen], &awesomeconf[c->screen], NULL); else restack(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]); resizemouse(c, &awesomeconf[c->screen]); @@ -213,9 +213,9 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) if(RootWindow(e->xany.display, screen) == ev->window) { if(ev->button == Button4) - uicb_tag_viewnext(e->xany.display, screen, &dc[screen], &awesomeconf[screen], NULL); + uicb_tag_viewnext(e->xany.display, &dc[screen], &awesomeconf[screen], NULL); else if(ev->button == Button5) - uicb_tag_viewprev(e->xany.display, screen, &dc[screen], &awesomeconf[screen], NULL); + uicb_tag_viewprev(e->xany.display, &dc[screen], &awesomeconf[screen], NULL); } } @@ -347,7 +347,7 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf) for(i = 0; i < awesomeconf[screen].nkeys; i++) if(keysym == awesomeconf[screen].keys[i].keysym && CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func) - awesomeconf[screen].keys[i].func(e->xany.display, screen, &dc[screen], &awesomeconf[screen], awesomeconf[screen].keys[i].arg); + awesomeconf[screen].keys[i].func(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].keys[i].arg); } void diff --git a/layout.c b/layout.c index db70c653..759275f5 100644 --- a/layout.c +++ b/layout.c @@ -52,7 +52,6 @@ arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf) void uicb_focusnext(Display *disp __attribute__ ((unused)), - int screen, DC *drawcontext, awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) @@ -61,9 +60,9 @@ uicb_focusnext(Display *disp __attribute__ ((unused)), if(!sel) return; - for(c = sel->next; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); + for(c = sel->next; c && !isvisible(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); if(!c) - for(c = clients; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); + for(c = clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); if(c) { focus(c->display, drawcontext, c, True, awesomeconf); @@ -73,7 +72,6 @@ uicb_focusnext(Display *disp __attribute__ ((unused)), void uicb_focusprev(Display *disp __attribute__ ((unused)), - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -82,11 +80,11 @@ uicb_focusprev(Display *disp __attribute__ ((unused)), if(!sel) return; - for(c = sel->prev; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); + for(c = sel->prev; c && !isvisible(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); if(!c) { for(c = clients; c && c->next; c = c->next); - for(; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); + for(; c && !isvisible(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); } if(c) { @@ -161,7 +159,6 @@ saveawesomeprops(Display *disp, int screen, awesome_config *awesomeconf) void uicb_setlayout(Display *disp, - int screen, DC *drawcontext, awesome_config * awesomeconf, const char *arg) @@ -190,7 +187,7 @@ uicb_setlayout(Display *disp, else drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf); - saveawesomeprops(disp, screen, awesomeconf); + saveawesomeprops(disp, awesomeconf->screen, awesomeconf); for(j = 0; j < awesomeconf->ntags; j++) if (awesomeconf->selected_tags[j]) @@ -227,7 +224,6 @@ maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomecon void uicb_togglemax(Display *disp, - int screen __attribute__ ((unused)), DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -242,7 +238,6 @@ uicb_togglemax(Display *disp, void uicb_toggleverticalmax(Display *disp, - int screen __attribute__ ((unused)), DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -259,7 +254,6 @@ uicb_toggleverticalmax(Display *disp, void uicb_togglehorizontalmax(Display *disp, - int screen __attribute__ ((unused)), DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -275,7 +269,6 @@ uicb_togglehorizontalmax(Display *disp, void uicb_zoom(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), DC *drawcontext __attribute__ ((unused)), awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) diff --git a/layout.h b/layout.h index 0965b453..90d4cbb7 100644 --- a/layout.h +++ b/layout.h @@ -31,13 +31,13 @@ void arrange(Display *, DC *, awesome_config *); /* arranges all windows depending on the layout in use */ void restack(Display *, DC *, awesome_config *); /* restores z layers of all clients */ -void uicb_focusnext(Display *, int, DC *, awesome_config *, const char *); /* focuses next visible client */ -void uicb_focusprev(Display *, int, DC *, awesome_config *, const char *); /* focuses prev visible client */ -void uicb_setlayout(Display *, int, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */ -void uicb_togglemax(Display *, int, DC *, awesome_config *, const char *); /* toggles maximization of floating client */ -void uicb_toggleverticalmax(Display *, int, DC *, awesome_config *, const char *); -void uicb_togglehorizontalmax(Display *, int, DC *, awesome_config *, const char *); -void uicb_zoom(Display *, int, DC *, awesome_config *, const char *); /* set current window first in stack */ +void uicb_focusnext(Display *, DC *, awesome_config *, const char *); /* focuses next visible client */ +void uicb_focusprev(Display *, DC *, awesome_config *, const char *); /* focuses prev visible client */ +void uicb_setlayout(Display *, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */ +void uicb_togglemax(Display *, DC *, awesome_config *, const char *); /* toggles maximization of floating client */ +void uicb_toggleverticalmax(Display *, DC *, awesome_config *, const char *); +void uicb_togglehorizontalmax(Display *, DC *, awesome_config *, const char *); +void uicb_zoom(Display *, DC *, awesome_config *, const char *); /* set current window first in stack */ void loadawesomeprops(Display *, int, awesome_config *); void saveawesomeprops(Display *disp, int, awesome_config *); diff --git a/layouts/tile.c b/layouts/tile.c index 29bc84a5..0e102923 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -33,7 +33,6 @@ extern Client *sel, *clients; void uicb_setnmaster(Display *disp, - int screen, DC * drawcontext, awesome_config *awesomeconf, const char * arg) @@ -49,7 +48,6 @@ uicb_setnmaster(Display *disp, void uicb_setncols(Display *disp, - int screen, DC * drawcontext, awesome_config *awesomeconf, const char * arg) @@ -65,7 +63,6 @@ uicb_setncols(Display *disp, void uicb_setmwfact(Display *disp, - int screen, DC *drawcontext, awesome_config * awesomeconf, const char *arg) diff --git a/layouts/tile.h b/layouts/tile.h index 5965a041..050e594c 100644 --- a/layouts/tile.h +++ b/layouts/tile.h @@ -25,9 +25,9 @@ #include -void uicb_setnmaster(Display *, int, DC *, awesome_config *, const char *); /* change number of master windows */ -void uicb_setncols(Display *, int, DC *, awesome_config *, const char *); -void uicb_setmwfact(Display *, int, DC *, awesome_config *, const char *); /* sets master width factor */ +void uicb_setnmaster(Display *, DC *, awesome_config *, const char *); /* change number of master windows */ +void uicb_setncols(Display *, DC *, awesome_config *, const char *); +void uicb_setmwfact(Display *, DC *, awesome_config *, const char *); /* sets master width factor */ void tile(Display *, int, awesome_config *); void tileleft(Display *, int, awesome_config *); diff --git a/statusbar.c b/statusbar.c index 68592a7e..bafe6664 100644 --- a/statusbar.c +++ b/statusbar.c @@ -142,7 +142,6 @@ updatebarpos(Display *disp, Statusbar statusbar) void uicb_togglebar(Display *disp, - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) diff --git a/statusbar.h b/statusbar.h index 370d8f4c..6924affa 100644 --- a/statusbar.h +++ b/statusbar.h @@ -27,6 +27,6 @@ void initstatusbar(Display *, int, DC *, Statusbar *); void drawstatusbar(Display *, int, DC *, awesome_config *); void updatebarpos(Display *, Statusbar); -void uicb_togglebar(Display *, int, DC *, awesome_config *, const char *); +void uicb_togglebar(Display *, DC *, awesome_config *, const char *); #endif diff --git a/tag.c b/tag.c index abdc15ce..3e6d5ad6 100644 --- a/tag.c +++ b/tag.c @@ -145,7 +145,6 @@ isvisible(Client * c, int screen, Bool * tags, int ntags) */ void uicb_tag(Display *disp, - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg) @@ -170,7 +169,6 @@ uicb_tag(Display *disp, */ void uicb_togglefloating(Display *disp, - int screen, DC *drawcontext, awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) @@ -200,7 +198,6 @@ uicb_togglefloating(Display *disp, */ void uicb_toggletag(Display *disp, - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg) @@ -226,7 +223,6 @@ uicb_toggletag(Display *disp, */ void uicb_toggleview(Display *disp, - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg) @@ -239,7 +235,7 @@ uicb_toggleview(Display *disp, for(j = 0; j < awesomeconf->ntags && !awesomeconf->selected_tags[j]; j++); if(j == awesomeconf->ntags) awesomeconf->selected_tags[i] = True; /* cannot toggle last view */ - saveawesomeprops(disp, screen, awesomeconf); + saveawesomeprops(disp, awesomeconf->screen, awesomeconf); arrange(disp, drawcontext, awesomeconf); } @@ -251,7 +247,6 @@ uicb_toggleview(Display *disp, */ void uicb_view(Display *disp, - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg) @@ -269,7 +264,7 @@ uicb_view(Display *disp, awesomeconf->selected_tags[i] = True; awesomeconf->current_layout = awesomeconf->tag_layouts[i]; } - saveawesomeprops(disp, screen, awesomeconf); + saveawesomeprops(disp, awesomeconf->screen, awesomeconf); arrange(disp, drawcontext, awesomeconf); } @@ -281,7 +276,6 @@ uicb_view(Display *disp, */ void uicb_viewprevtags(Display * disp, - int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -305,7 +299,6 @@ uicb_viewprevtags(Display * disp, */ void uicb_tag_viewnext(Display *disp, - int screen, DC * drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -322,7 +315,7 @@ uicb_tag_viewnext(Display *disp, if(++firsttag >= awesomeconf->ntags) firsttag = 0; awesomeconf->selected_tags[firsttag] = True; - saveawesomeprops(disp, screen, awesomeconf); + saveawesomeprops(disp, awesomeconf->screen, awesomeconf); arrange(disp, drawcontext, awesomeconf); } @@ -333,7 +326,6 @@ uicb_tag_viewnext(Display *disp, */ void uicb_tag_viewprev(Display *disp, - int screen __attribute__ ((unused)), DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -350,6 +342,6 @@ uicb_tag_viewprev(Display *disp, if(--firsttag < 0) firsttag = awesomeconf->ntags - 1; awesomeconf->selected_tags[firsttag] = True; - saveawesomeprops(disp, screen, awesomeconf); + saveawesomeprops(disp, awesomeconf->screen, awesomeconf); arrange(disp, drawcontext, awesomeconf); } diff --git a/tag.h b/tag.h index 34fa12ff..a95a1353 100644 --- a/tag.h +++ b/tag.h @@ -31,14 +31,14 @@ void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */ Bool isvisible(Client *, int, Bool *, int); void applyrules(Client * c, awesome_config *); /* applies rules to c */ -void uicb_tag(Display *, int, DC *, awesome_config *, const char *); /* tags sel with arg's index */ -void uicb_togglefloating(Display *, int, DC *, awesome_config *, const char *); /* toggles sel between floating/tiled state */ -void uicb_toggletag(Display *, int, DC *, awesome_config *, const char *); /* toggles sel tags with arg's index */ -void uicb_toggleview(Display *, int, DC *, awesome_config *, const char *); /* toggles the tag with arg's index (in)visible */ -void uicb_view(Display *, int, DC *, awesome_config *, const char *); /* views the tag with arg's index */ -void uicb_viewprevtags(Display *, int, DC *, awesome_config *, const char *); -void uicb_tag_viewnext(Display *, int, DC *, awesome_config *, const char *); /* view only tag just after the first selected */ -void uicb_tag_viewprev(Display *, int, DC *, awesome_config *, const char *); /* view only tag just before the first selected */ +void uicb_tag(Display *, DC *, awesome_config *, const char *); /* tags sel with arg's index */ +void uicb_togglefloating(Display *, DC *, awesome_config *, const char *); /* toggles sel between floating/tiled state */ +void uicb_toggletag(Display *, DC *, awesome_config *, const char *); /* toggles sel tags with arg's index */ +void uicb_toggleview(Display *, DC *, awesome_config *, const char *); /* toggles the tag with arg's index (in)visible */ +void uicb_view(Display *, DC *, awesome_config *, const char *); /* views the tag with arg's index */ +void uicb_viewprevtags(Display *, DC *, awesome_config *, const char *); +void uicb_tag_viewnext(Display *, DC *, awesome_config *, const char *); /* view only tag just after the first selected */ +void uicb_tag_viewprev(Display *, DC *, awesome_config *, const char *); /* view only tag just before the first selected */ typedef struct { diff --git a/util.c b/util.c index 3c00b2e0..520e0587 100644 --- a/util.c +++ b/util.c @@ -54,7 +54,6 @@ eprint(const char *fmt, ...) void uicb_spawn(Display * disp, - int screen, DC *drawcontext __attribute__ ((unused)), awesome_config * awesomeconf __attribute__ ((unused)), const char *arg) @@ -73,7 +72,7 @@ uicb_spawn(Display * disp, display = strdup(tmp); if((tmp = strrchr(display, '.'))) *tmp = '\0'; - snprintf(newdisplay, sizeof(newdisplay), "%s.%d", display, screen); + snprintf(newdisplay, sizeof(newdisplay), "%s.%d", display, awesomeconf->screen); setenv("DISPLAY", newdisplay, 1); } diff --git a/util.h b/util.h index 736943c8..c56d7563 100644 --- a/util.h +++ b/util.h @@ -120,7 +120,7 @@ static inline char *a_strdup(const char *s) void die(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2))); void eprint(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2))); -void uicb_spawn(Display *, int, DC *, awesome_config *, const char *); +void uicb_spawn(Display *, DC *, awesome_config *, const char *); Bool xgettextprop(Display *, Window, Atom, char *, unsigned int); double compute_new_value_from_arg(const char *, double);