diff --git a/awesome.h b/awesome.h index 1956c0d0a..d77cecd62 100644 --- a/awesome.h +++ b/awesome.h @@ -22,10 +22,12 @@ #ifndef AWESOME_AWESOME_H #define AWESOME_AWESOME_H -#include "common.h" +#include +#include "uicb.h" int xerror(Display *, XErrorEvent *); -UICB_PROTO(uicb_quit); + +Uicb uicb_quit; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/client.c b/client.c index 824c77467..14fd33905 100644 --- a/client.c +++ b/client.c @@ -22,7 +22,9 @@ #include #include #include +#include +#include "client.h" #include "screen.h" #include "awesome.h" #include "layout.h" diff --git a/client.h b/client.h index 803327253..2990b6b3e 100644 --- a/client.h +++ b/client.h @@ -22,7 +22,8 @@ #ifndef AWESOME_CLIENT_H #define AWESOME_CLIENT_H -#include "common.h" +#include "config.h" +#include "uicb.h" Bool client_isvisible(Client *, int); Client * get_client_bywin(Client *, Window); @@ -41,12 +42,12 @@ void client_updatetitle(Client *); void client_saveprops(Client *); void client_kill(Client *); -UICB_PROTO(uicb_client_kill); -UICB_PROTO(uicb_client_moveresize); -UICB_PROTO(uicb_client_settrans); -UICB_PROTO(uicb_setborder); -UICB_PROTO(uicb_client_swapnext); -UICB_PROTO(uicb_client_swapprev); +Uicb uicb_client_kill; +Uicb uicb_client_moveresize; +Uicb uicb_client_settrans; +Uicb uicb_setborder; +Uicb uicb_client_swapnext; +Uicb uicb_client_swapprev; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/common.h b/common.h index 7220bceaa..c90ac2e98 100644 --- a/common.h +++ b/common.h @@ -24,9 +24,6 @@ #include "config.h" -/** Common prototype definition for ui_callback functions */ -#define UICB_PROTO(name) void name(int, char *) - /** Common prototype definition for layouts function */ #define LAYOUT_PROTO(name) void name(int) diff --git a/event.c b/event.c index 840d289e1..e0131cdd6 100644 --- a/event.c +++ b/event.c @@ -35,6 +35,7 @@ #include "window.h" #include "mouse.h" #include "ewmh.h" +#include "client.h" #include "layouts/tile.h" #include "layouts/floating.h" diff --git a/ewmh.c b/ewmh.c index a9d6b9529..1b7a18e78 100644 --- a/ewmh.c +++ b/ewmh.c @@ -27,6 +27,7 @@ #include "tag.h" #include "focus.h" #include "screen.h" +#include "client.h" #include "layout.h" extern AwesomeConf globalconf; diff --git a/focus.c b/focus.c index 3fb03c866..dc2428849 100644 --- a/focus.c +++ b/focus.c @@ -23,6 +23,7 @@ #include "tag.h" #include "layout.h" #include "focus.h" +#include "client.h" extern AwesomeConf globalconf; diff --git a/focus.h b/focus.h index 85ec45249..bda128684 100644 --- a/focus.h +++ b/focus.h @@ -23,13 +23,14 @@ #define AWESOME_FOCUS_H #include "config.h" +#include "uicb.h" void focus_add_client(Client *); void focus_delete_client(Client *); Client * focus_get_current_client(int); -UICB_PROTO(uicb_focus_history); -UICB_PROTO(uicb_focus_client_byname); +Uicb uicb_focus_history; +Uicb uicb_focus_client_byname; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/layout.c b/layout.c index e04092bb8..7ca4e0687 100644 --- a/layout.c +++ b/layout.c @@ -30,6 +30,7 @@ #include "focus.h" #include "statusbar.h" #include "ewmh.h" +#include "client.h" #include "layouts/tile.h" #include "layouts/max.h" #include "layouts/fibonacci.h" diff --git a/layout.h b/layout.h index 8c7a422b6..b4e9f5226 100644 --- a/layout.h +++ b/layout.h @@ -22,7 +22,8 @@ #ifndef AWESOME_LAYOUT_H #define AWESOME_LAYOUT_H -#include "common.h" +#include "config.h" +#include "uicb.h" #define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False) @@ -32,13 +33,13 @@ void loadawesomeprops(int); void saveawesomeprops(int); void client_maximize(Client *c, int, int, int, int); -UICB_PROTO(uicb_client_focusnext); -UICB_PROTO(uicb_client_focusprev); -UICB_PROTO(uicb_tag_setlayout); -UICB_PROTO(uicb_client_togglemax); -UICB_PROTO(uicb_client_toggleverticalmax); -UICB_PROTO(uicb_client_togglehorizontalmax); -UICB_PROTO(uicb_client_zoom); +Uicb uicb_client_focusnext; +Uicb uicb_client_focusprev; +Uicb uicb_tag_setlayout; +Uicb uicb_client_togglemax; +Uicb uicb_client_toggleverticalmax; +Uicb uicb_client_togglehorizontalmax; +Uicb uicb_client_zoom; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/layouts/fibonacci.c b/layouts/fibonacci.c index 89b6faac6..a0be9acc1 100644 --- a/layouts/fibonacci.c +++ b/layouts/fibonacci.c @@ -22,6 +22,7 @@ #include "screen.h" #include "tag.h" #include "util.h" +#include "client.h" #include "layouts/fibonacci.h" extern AwesomeConf globalconf; diff --git a/layouts/floating.c b/layouts/floating.c index dd06c5ce7..33db55152 100644 --- a/layouts/floating.c +++ b/layouts/floating.c @@ -19,6 +19,7 @@ * */ +#include "client.h" #include "tag.h" #include "layouts/floating.h" diff --git a/layouts/floating.h b/layouts/floating.h index b36f6098c..4b98ade91 100644 --- a/layouts/floating.h +++ b/layouts/floating.h @@ -23,6 +23,8 @@ #ifndef AWESOME_FLOATING_H #define AWESOME_FLOATING_H +#include "common.h" + LAYOUT_PROTO(layout_floating); #endif diff --git a/layouts/max.c b/layouts/max.c index 082502327..d4e6176ab 100644 --- a/layouts/max.c +++ b/layouts/max.c @@ -22,6 +22,7 @@ #include "tag.h" #include "screen.h" #include "util.h" +#include "client.h" #include "layouts/max.h" extern AwesomeConf globalconf; diff --git a/layouts/tile.c b/layouts/tile.c index afbe5ee91..40ba16bc8 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -26,6 +26,7 @@ #include "awesome.h" #include "tag.h" #include "layout.h" +#include "client.h" #include "layouts/tile.h" extern AwesomeConf globalconf; diff --git a/layouts/tile.h b/layouts/tile.h index 5699da86b..82c6af159 100644 --- a/layouts/tile.h +++ b/layouts/tile.h @@ -28,9 +28,9 @@ LAYOUT_PROTO(layout_tile); LAYOUT_PROTO(layout_tileleft); -UICB_PROTO(uicb_tag_setnmaster); -UICB_PROTO(uicb_tag_setncol); -UICB_PROTO(uicb_tag_setmwfact); +Uicb uicb_tag_setnmaster; +Uicb uicb_tag_setncol; +Uicb uicb_tag_setmwfact; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/mouse.c b/mouse.c index 0089c2daa..18cd9368e 100644 --- a/mouse.c +++ b/mouse.c @@ -29,6 +29,7 @@ #include "event.h" #include "window.h" #include "statusbar.h" +#include "client.h" #include "layouts/floating.h" #include "layouts/tile.h" diff --git a/mouse.h b/mouse.h index 42f3f53f2..d007a2476 100644 --- a/mouse.h +++ b/mouse.h @@ -22,12 +22,12 @@ #ifndef AWESOME_MOUSE_H #define AWESOME_MOUSE_H -#include "common.h" +#include "uicb.h" -#define MOUSEMASK (BUTTONMASK | PointerMotionMask) +#define MOUSEMASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask) -UICB_PROTO(uicb_client_movemouse); -UICB_PROTO(uicb_client_resizemouse); +Uicb uicb_client_movemouse; +Uicb uicb_client_resizemouse; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/screen.c b/screen.c index 55cf1ddd1..c3289f93d 100644 --- a/screen.c +++ b/screen.c @@ -19,12 +19,15 @@ * */ +#include + #include "util.h" #include "screen.h" #include "tag.h" #include "layout.h" #include "focus.h" #include "statusbar.h" +#include "client.h" extern AwesomeConf globalconf; diff --git a/screen.h b/screen.h index f4b5f5649..a4d93bf74 100644 --- a/screen.h +++ b/screen.h @@ -22,9 +22,8 @@ #ifndef AWESOME_SCREEN_H #define AWESOME_SCREEN_H -#include "common.h" - -#include +#include "config.h" +#include "uicb.h" Area get_screen_area(int, Statusbar *, Padding *); Area get_display_area(int, Statusbar *, Padding *); @@ -33,8 +32,8 @@ int get_screen_count(void); int get_phys_screen(int); void move_client_to_screen(Client *, int, Bool); -UICB_PROTO(uicb_screen_focus); -UICB_PROTO(uicb_client_movetoscreen); +Uicb uicb_screen_focus; +Uicb uicb_client_movetoscreen; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/statusbar.h b/statusbar.h index 06381197a..92326727c 100644 --- a/statusbar.h +++ b/statusbar.h @@ -22,7 +22,8 @@ #ifndef AWESOME_STATUSBAR_H #define AWESOME_STATUSBAR_H -#include "common.h" +#include "config.h" +#include "uicb.h" void statusbar_draw_all(int); void statusbar_init(Statusbar *, int); @@ -30,7 +31,7 @@ void statusbar_display(Statusbar *); int statusbar_get_position_from_str(const char *); void statusbar_update_position(Statusbar *); -UICB_PROTO(uicb_statusbar_toggle); +Uicb uicb_statusbar_toggle; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/tag.c b/tag.c index b3cbc9dc0..0179628f7 100644 --- a/tag.c +++ b/tag.c @@ -27,6 +27,7 @@ #include "tag.h" #include "util.h" #include "rules.h" +#include "client.h" #include "ewmh.h" extern AwesomeConf globalconf; diff --git a/tag.h b/tag.h index 1af98a74e..bf12cd129 100644 --- a/tag.h +++ b/tag.h @@ -22,7 +22,8 @@ #ifndef AWESOME_TAG_H #define AWESOME_TAG_H -#include "client.h" +#include "config.h" +#include "uicb.h" /** Check if a client is tiled */ #define IS_TILED(client, screen) (client && !client->isfloating && client_isvisible(client, screen)) @@ -35,14 +36,14 @@ void tag_client_with_current_selected(Client *); void tag_client_with_rules(Client *); void tag_view(int, int); -UICB_PROTO(uicb_client_tag); -UICB_PROTO(uicb_client_togglefloating); -UICB_PROTO(uicb_client_toggletag); -UICB_PROTO(uicb_tag_toggleview); -UICB_PROTO(uicb_tag_view); -UICB_PROTO(uicb_tag_prev_selected); -UICB_PROTO(uicb_tag_viewnext); -UICB_PROTO(uicb_tag_viewprev); +Uicb uicb_client_tag; +Uicb uicb_client_togglefloating; +Uicb uicb_client_toggletag; +Uicb uicb_tag_toggleview; +Uicb uicb_tag_view; +Uicb uicb_tag_prev_selected; +Uicb uicb_tag_viewnext; +Uicb uicb_tag_viewprev; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/uicb.c b/uicb.c index b44ae5522..aab4b2708 100644 --- a/uicb.c +++ b/uicb.c @@ -22,7 +22,6 @@ #include "awesome.h" #include "util.h" #include "xutil.h" -#include "uicb.h" #include "screen.h" #include "tag.h" #include "layout.h" @@ -30,6 +29,7 @@ #include "statusbar.h" #include "widget.h" #include "focus.h" +#include "client.h" #include "layouts/tile.h" extern AwesomeConf globalconf; diff --git a/uicb.h b/uicb.h index ddcb1810d..e61afc1a5 100644 --- a/uicb.h +++ b/uicb.h @@ -22,7 +22,7 @@ #ifndef AWESOME_UICB_H #define AWESOME_UICB_H -#include "config.h" +typedef void (Uicb)(int, char *); int parse_control(char *); diff --git a/widget.h b/widget.h index e2876550a..aee8a173a 100644 --- a/widget.h +++ b/widget.h @@ -24,9 +24,10 @@ #define AWESOME_WIDGET_H #include + #include "config.h" #include "draw.h" -#include "common.h" +#include "uicb.h" enum { AlignLeft, AlignRight, AlignFlex }; @@ -44,7 +45,7 @@ WidgetConstructor iconbox_new; WidgetConstructor netwmicon_new; WidgetConstructor progressbar_new; -UICB_PROTO(uicb_widget_tell); +Uicb uicb_widget_tell; #endif diff --git a/window.h b/window.h index b76195055..cfdcaa850 100644 --- a/window.h +++ b/window.h @@ -22,7 +22,7 @@ #ifndef AWESOME_WINDOW_H #define AWESOME_WINDOW_H -#include "config.h" +#include /** Mask shorthands, used in event.c and window.c */ #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) diff --git a/xutil.h b/xutil.h index db5d3fca7..946a2a609 100644 --- a/xutil.h +++ b/xutil.h @@ -27,8 +27,8 @@ Bool xgettextprop(Display *, Window, Atom, char *, ssize_t); XColor initxcolor(int, const char *); -UICB_PROTO(uicb_spawn); -UICB_PROTO(uicb_exec); +Uicb uicb_spawn; +Uicb uicb_exec; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80