From c8373622ec19c95c7781faed14303f851e31cf6c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 24 Sep 2007 14:40:40 +0200 Subject: [PATCH] Add UICB_PROTO to common.h (new) to declare uicb_functions --- awesome.h | 4 ++-- client.h | 10 +++++----- common.h | 29 +++++++++++++++++++++++++++++ layout.h | 15 ++++++++------- layouts/tile.h | 9 +++++---- screen.h | 7 +++---- statusbar.h | 5 +++-- tag.h | 17 +++++++++-------- util.h | 4 ++-- 9 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 common.h diff --git a/awesome.h b/awesome.h index 79f83f50..a9ed4e5c 100644 --- a/awesome.h +++ b/awesome.h @@ -22,9 +22,9 @@ #ifndef AWESOME_AWESOME_H #define AWESOME_AWESOME_H -#include "config.h" +#include "common.h" -void uicb_quit(Display *, DC *, awesome_config *, const char *); /* quit awesome nicely */ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */ +UICB_PROTO(uicb_quit); #endif diff --git a/client.h b/client.h index b2f3b710..686980e0 100644 --- a/client.h +++ b/client.h @@ -22,7 +22,7 @@ #ifndef AWESOME_CLIENT_H #define AWESOME_CLIENT_H -#include "config.h" +#include "common.h" /** Mask shorthands, used in event.c and client.c */ #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) @@ -68,9 +68,9 @@ 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 *, 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 *); -void uicb_setborder(Display *, DC *, awesome_config *, const char *); +UICB_PROTO(uicb_killclient); +UICB_PROTO(uicb_moveresize); +UICB_PROTO(uicb_settrans); +UICB_PROTO(uicb_setborder); #endif diff --git a/common.h b/common.h new file mode 100644 index 00000000..743fb61f --- /dev/null +++ b/common.h @@ -0,0 +1,29 @@ +/* + * common.h - common defines + * + * Copyright © 2007 Julien Danjou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef AWESOME_COMMON_H +#define AWESOME_COMMON_H + +#include "config.h" + +#define UICB_PROTO(name) void name(Display *, DC *, awesome_config *, const char *) + +#endif diff --git a/layout.h b/layout.h index 90cbd35c..aa8c5d1e 100644 --- a/layout.h +++ b/layout.h @@ -31,14 +31,15 @@ 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 *, 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 *, awesome_config *); void saveawesomeprops(Display *, awesome_config *); +UICB_PROTO(uicb_focusnext); +UICB_PROTO(uicb_focusprev); +UICB_PROTO(uicb_setlayout); +UICB_PROTO(uicb_togglemax); +UICB_PROTO(uicb_toggleverticalmax); +UICB_PROTO(uicb_togglehorizontalmax); +UICB_PROTO(uicb_zoom); + #endif diff --git a/layouts/tile.h b/layouts/tile.h index 449106ea..02022989 100644 --- a/layouts/tile.h +++ b/layouts/tile.h @@ -23,12 +23,13 @@ #ifndef AWESOME_TILE_H #define AWESOME_TILE_H -#include +#include "common.h" -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 layout_tile(Display *, awesome_config *); void layout_tileleft(Display *, awesome_config *); +UICB_PROTO(uicb_setnmaster); +UICB_PROTO(uicb_setncols); +UICB_PROTO(uicb_setmwfact); + #endif diff --git a/screen.h b/screen.h index 2a3f5dcc..574f7df9 100644 --- a/screen.h +++ b/screen.h @@ -22,8 +22,7 @@ #ifndef AWESOME_SCREEN_H #define AWESOME_SCREEN_H - -#include "config.h" +#include "common.h" #include @@ -31,7 +30,7 @@ typedef XineramaScreenInfo ScreenInfo; ScreenInfo * get_screen_info(Display *, int, Statusbar, int *); ScreenInfo * get_display_info(Display *disp, int, Statusbar statusbar); -void uicb_focusnextscreen(Display *, DC *, awesome_config *, const char *); -void uicb_focusprevscreen(Display *, DC *, awesome_config *, const char *); +UICB_PROTO(uicb_focusnextscreen); +UICB_PROTO(uicb_focusprevscreen); #endif diff --git a/statusbar.h b/statusbar.h index 6924affa..ac58ed10 100644 --- a/statusbar.h +++ b/statusbar.h @@ -22,11 +22,12 @@ #ifndef AWESOME_STATUSBAR_H #define AWESOME_STATUSBAR_H -#include "config.h" +#include "common.h" void initstatusbar(Display *, int, DC *, Statusbar *); void drawstatusbar(Display *, int, DC *, awesome_config *); void updatebarpos(Display *, Statusbar); -void uicb_togglebar(Display *, DC *, awesome_config *, const char *); + +UICB_PROTO(uicb_togglebar); #endif diff --git a/tag.h b/tag.h index 828a3ced..87fe532f 100644 --- a/tag.h +++ b/tag.h @@ -31,14 +31,15 @@ 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 *, 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_tag_prev_selected(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 */ + +UICB_PROTO(uicb_tag); +UICB_PROTO(uicb_togglefloating); +UICB_PROTO(uicb_toggletag); +UICB_PROTO(uicb_toggleview); +UICB_PROTO(uicb_view); +UICB_PROTO(uicb_tag_prev_selected); +UICB_PROTO(uicb_tag_viewnext); +UICB_PROTO(uicb_tag_viewprev); typedef struct { diff --git a/util.h b/util.h index 0f754593..ea0b3750 100644 --- a/util.h +++ b/util.h @@ -25,7 +25,7 @@ #include #include -#include "config.h" +#include "common.h" /** \brief replace \c NULL strings with emtpy strings */ #define NONULL(x) (x ? x : "") @@ -134,8 +134,8 @@ static inline int a_strcmp(const char *a, const char *b) 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 *, DC *, awesome_config *, const char *); Bool xgettextprop(Display *, Window, Atom, char *, unsigned int); double compute_new_value_from_arg(const char *, double); +UICB_PROTO(uicb_spawn); #endif