move uicb_togglebar to statusbar.c

This commit is contained in:
Julien Danjou 2007-09-15 15:34:28 +02:00
parent 56a387ec5c
commit 3e3f213b72
5 changed files with 19 additions and 16 deletions

View File

@ -32,6 +32,7 @@
#include "tag.h"
#include "draw.h"
#include "util.h"
#include "statusbar.h"
#include "layouts/tile.h"
#include "layouts/spiral.h"
#include "layouts/floating.h"
@ -100,7 +101,6 @@ static const NameFuncLink KeyfuncList[] = {
{"viewprevtags", uicb_viewprevtags},
/* layout.c */
{"setlayout", uicb_setlayout},
{"togglebar", uicb_togglebar},
{"focusnext", uicb_focusnext},
{"focusprev", uicb_focusprev},
{"togglemax", uicb_togglemax},
@ -113,6 +113,8 @@ static const NameFuncLink KeyfuncList[] = {
{"setncols", uicb_setncols},
/* awesome.c */
{"quit", uicb_quit},
/* statusbar.c */
{"togglebar", uicb_togglebar},
{NULL, NULL}
};

View File

@ -191,20 +191,6 @@ uicb_setlayout(Display *disp,
awesomeconf->tag_layouts[j] = awesomeconf->current_layout;
}
void
uicb_togglebar(Display *disp,
DC *drawcontext,
awesome_config *awesomeconf,
const char *arg __attribute__ ((unused)))
{
if(awesomeconf->statusbar.position == BarOff)
awesomeconf->statusbar.position = (awesomeconf->statusbar.position == BarOff) ? BarTop : awesomeconf->statusbar_default_position;
else
awesomeconf->statusbar.position = BarOff;
updatebarpos(disp, awesomeconf->statusbar);
arrange(disp, drawcontext, awesomeconf);
}
static void
maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomeconf)
{

View File

@ -34,7 +34,6 @@ void restack(Display *, DC *, awesome_config *); /* restores z layers of
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_togglebar(Display *, DC *, awesome_config *, const char *); /* shows/hides the bar */
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 *);

View File

@ -112,3 +112,18 @@ updatebarpos(Display *disp, Statusbar statusbar)
XSync(disp, False);
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
}
void
uicb_togglebar(Display *disp,
DC *drawcontext,
awesome_config *awesomeconf,
const char *arg __attribute__ ((unused)))
{
if(awesomeconf->statusbar.position == BarOff)
awesomeconf->statusbar.position = (awesomeconf->statusbar.position == BarOff) ? BarTop : awesomeconf->statusbar_default_position;
else
awesomeconf->statusbar.position = BarOff;
updatebarpos(disp, awesomeconf->statusbar);
arrange(disp, drawcontext, awesomeconf);
}

View File

@ -26,5 +26,6 @@
void drawstatusbar(Display *, DC *, awesome_config *);
void updatebarpos(Display *, Statusbar);
void uicb_togglebar(Display *, DC *, awesome_config *, const char *);
#endif