Add UICB_PROTO to common.h (new) to declare uicb_functions

This commit is contained in:
Julien Danjou 2007-09-24 14:40:40 +02:00
parent 32654ce496
commit c8373622ec
9 changed files with 66 additions and 34 deletions

View File

@ -22,9 +22,9 @@
#ifndef AWESOME_AWESOME_H #ifndef AWESOME_AWESOME_H
#define 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 */ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */
UICB_PROTO(uicb_quit);
#endif #endif

View File

@ -22,7 +22,7 @@
#ifndef AWESOME_CLIENT_H #ifndef AWESOME_CLIENT_H
#define AWESOME_CLIENT_H #define AWESOME_CLIENT_H
#include "config.h" #include "common.h"
/** Mask shorthands, used in event.c and client.c */ /** Mask shorthands, used in event.c and client.c */
#define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) #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 updatetitle(Client *); /* update the name of c */
void saveprops(Client * c, int); /* saves client properties */ void saveprops(Client * c, int); /* saves client properties */
void set_shape(Client *); void set_shape(Client *);
void uicb_killclient(Display *, DC *, awesome_config *, const char *); /* kill client */ UICB_PROTO(uicb_killclient);
void uicb_moveresize(Display *, DC *, awesome_config *, const char *); /* move and resize window */ UICB_PROTO(uicb_moveresize);
void uicb_settrans(Display *, DC *, awesome_config *, const char *); UICB_PROTO(uicb_settrans);
void uicb_setborder(Display *, DC *, awesome_config *, const char *); UICB_PROTO(uicb_setborder);
#endif #endif

29
common.h Normal file
View File

@ -0,0 +1,29 @@
/*
* common.h - common defines
*
* Copyright © 2007 Julien Danjou <julien@danjou.info>
*
* 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

View File

@ -31,14 +31,15 @@
void arrange(Display *, DC *, awesome_config *); /* arranges all windows depending on the layout in use */ 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 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 loadawesomeprops(Display *, awesome_config *);
void saveawesomeprops(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 #endif

View File

@ -23,12 +23,13 @@
#ifndef AWESOME_TILE_H #ifndef AWESOME_TILE_H
#define AWESOME_TILE_H #define AWESOME_TILE_H
#include <config.h> #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_tile(Display *, awesome_config *);
void layout_tileleft(Display *, awesome_config *); void layout_tileleft(Display *, awesome_config *);
UICB_PROTO(uicb_setnmaster);
UICB_PROTO(uicb_setncols);
UICB_PROTO(uicb_setmwfact);
#endif #endif

View File

@ -22,8 +22,7 @@
#ifndef AWESOME_SCREEN_H #ifndef AWESOME_SCREEN_H
#define AWESOME_SCREEN_H #define AWESOME_SCREEN_H
#include "common.h"
#include "config.h"
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
@ -31,7 +30,7 @@ typedef XineramaScreenInfo ScreenInfo;
ScreenInfo * get_screen_info(Display *, int, Statusbar, int *); ScreenInfo * get_screen_info(Display *, int, Statusbar, int *);
ScreenInfo * get_display_info(Display *disp, int, Statusbar statusbar); ScreenInfo * get_display_info(Display *disp, int, Statusbar statusbar);
void uicb_focusnextscreen(Display *, DC *, awesome_config *, const char *); UICB_PROTO(uicb_focusnextscreen);
void uicb_focusprevscreen(Display *, DC *, awesome_config *, const char *); UICB_PROTO(uicb_focusprevscreen);
#endif #endif

View File

@ -22,11 +22,12 @@
#ifndef AWESOME_STATUSBAR_H #ifndef AWESOME_STATUSBAR_H
#define AWESOME_STATUSBAR_H #define AWESOME_STATUSBAR_H
#include "config.h" #include "common.h"
void initstatusbar(Display *, int, DC *, Statusbar *); void initstatusbar(Display *, int, DC *, Statusbar *);
void drawstatusbar(Display *, int, DC *, awesome_config *); void drawstatusbar(Display *, int, DC *, awesome_config *);
void updatebarpos(Display *, Statusbar); void updatebarpos(Display *, Statusbar);
void uicb_togglebar(Display *, DC *, awesome_config *, const char *);
UICB_PROTO(uicb_togglebar);
#endif #endif

17
tag.h
View File

@ -31,14 +31,15 @@
void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */ void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */
Bool isvisible(Client *, int, Bool *, int); Bool isvisible(Client *, int, Bool *, int);
void applyrules(Client * c, awesome_config *); /* applies rules to c */ 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 */ UICB_PROTO(uicb_tag);
void uicb_toggletag(Display *, DC *, awesome_config *, const char *); /* toggles sel tags with arg's index */ UICB_PROTO(uicb_togglefloating);
void uicb_toggleview(Display *, DC *, awesome_config *, const char *); /* toggles the tag with arg's index (in)visible */ UICB_PROTO(uicb_toggletag);
void uicb_view(Display *, DC *, awesome_config *, const char *); /* views the tag with arg's index */ UICB_PROTO(uicb_toggleview);
void uicb_tag_prev_selected(Display *, DC *, awesome_config *, const char *); UICB_PROTO(uicb_view);
void uicb_tag_viewnext(Display *, DC *, awesome_config *, const char *); /* view only tag just after the first selected */ UICB_PROTO(uicb_tag_prev_selected);
void uicb_tag_viewprev(Display *, DC *, awesome_config *, const char *); /* view only tag just before the first selected */ UICB_PROTO(uicb_tag_viewnext);
UICB_PROTO(uicb_tag_viewprev);
typedef struct typedef struct
{ {

4
util.h
View File

@ -25,7 +25,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "config.h" #include "common.h"
/** \brief replace \c NULL strings with emtpy strings */ /** \brief replace \c NULL strings with emtpy strings */
#define NONULL(x) (x ? x : "") #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 die(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2)));
void eprint(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); Bool xgettextprop(Display *, Window, Atom, char *, unsigned int);
double compute_new_value_from_arg(const char *, double); double compute_new_value_from_arg(const char *, double);
UICB_PROTO(uicb_spawn);
#endif #endif