rename statusbar functions

This commit is contained in:
Julien Danjou 2007-12-14 20:10:52 +01:00
parent e53b941679
commit aacb020564
8 changed files with 29 additions and 28 deletions

View File

@ -223,7 +223,7 @@ void
setup_screen(awesome_config *awesomeconf, int screen) setup_screen(awesome_config *awesomeconf, int screen)
{ {
setup(awesomeconf, screen); setup(awesomeconf, screen);
initstatusbar(awesomeconf->display, screen, &awesomeconf->screens[screen].statusbar, statusbar_init(awesomeconf->display, screen, &awesomeconf->screens[screen].statusbar,
awesomeconf->cursor[CurNormal], awesomeconf->screens[screen].font, awesomeconf->cursor[CurNormal], awesomeconf->screens[screen].font,
awesomeconf->screens[screen].layouts, &awesomeconf->screens[screen].padding); awesomeconf->screens[screen].layouts, &awesomeconf->screens[screen].padding);
} }
@ -345,7 +345,7 @@ main(int argc, char *argv[])
{ {
/* set screen */ /* set screen */
setup_screen(awesomeconf, screen); setup_screen(awesomeconf, screen);
drawstatusbar(awesomeconf, screen); statusbar_draw(awesomeconf, screen);
} }
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);

View File

@ -223,7 +223,7 @@ focus(Client *c, Bool selscreen, awesome_config *awesomeconf, int screen)
if(!selscreen) if(!selscreen)
return; return;
curtag->client_sel = c; curtag->client_sel = c;
drawstatusbar(awesomeconf, screen); statusbar_draw(awesomeconf, screen);
if(curtag->client_sel) if(curtag->client_sel)
{ {
XSetInputFocus(curtag->client_sel->display, curtag->client_sel->win, RevertToPointerRoot, CurrentTime); XSetInputFocus(curtag->client_sel->display, curtag->client_sel->win, RevertToPointerRoot, CurrentTime);

View File

@ -470,7 +470,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
/* Statusbar */ /* Statusbar */
awesomeconf->screens[screen].statusbar.position = awesomeconf->screens[screen].statusbar.position =
awesomeconf->screens[screen].statusbar.dposition = awesomeconf->screens[screen].statusbar.dposition =
get_statusbar_position_from_str(cfg_getstr(cfg_statusbar, "position")); statusbar_get_position_from_str(cfg_getstr(cfg_statusbar, "position"));
/* Layouts */ /* Layouts */
if(cfg_size(cfg_layouts, "layout")) if(cfg_size(cfg_layouts, "layout"))

10
event.c
View File

@ -160,8 +160,8 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf)
if(old_screen != c->screen) if(old_screen != c->screen)
{ {
move_client_to_screen(c, awesomeconf, c->screen, False); move_client_to_screen(c, awesomeconf, c->screen, False);
drawstatusbar(awesomeconf, old_screen); statusbar_draw(awesomeconf, old_screen);
drawstatusbar(awesomeconf, c->screen); statusbar_draw(awesomeconf, c->screen);
} }
tag_client_with_rules(c, awesomeconf); tag_client_with_rules(c, awesomeconf);
XMoveResizeWindow(e->xany.display, c->win, c->rx, c->ry, c->rw, c->rh); XMoveResizeWindow(e->xany.display, c->win, c->rx, c->ry, c->rw, c->rh);
@ -209,7 +209,7 @@ handle_event_configurenotify(XEvent * e, awesome_config *awesomeconf)
awesomeconf->screens[screen].statusbar.width, awesomeconf->screens[screen].statusbar.width,
awesomeconf->screens[screen].statusbar.height); awesomeconf->screens[screen].statusbar.height);
updatebarpos(e->xany.display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding); statusbar_update_position(e->xany.display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding);
arrange(awesomeconf, screen); arrange(awesomeconf, screen);
} }
} }
@ -257,7 +257,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
if(!ev->count) if(!ev->count)
for(screen = 0; screen < get_screen_count(e->xany.display); screen++) for(screen = 0; screen < get_screen_count(e->xany.display); screen++)
if(awesomeconf->screens[screen].statusbar.window == ev->window) if(awesomeconf->screens[screen].statusbar.window == ev->window)
drawstatusbar(awesomeconf, screen); statusbar_draw(awesomeconf, screen);
} }
void void
@ -366,7 +366,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
{ {
client_updatetitle(c); client_updatetitle(c);
if(c == get_current_tag(awesomeconf->screens[c->screen])->client_sel) if(c == get_current_tag(awesomeconf->screens[c->screen])->client_sel)
drawstatusbar(awesomeconf, c->screen); statusbar_draw(awesomeconf, c->screen);
} }
} }
} }

View File

@ -153,7 +153,7 @@ restack(awesome_config *awesomeconf, int screen)
XEvent ev; XEvent ev;
XWindowChanges wc; XWindowChanges wc;
drawstatusbar(awesomeconf, screen); statusbar_draw(awesomeconf, screen);
if(!sel) if(!sel)
return; return;
if(awesomeconf->screens[screen].allow_lower_floats) if(awesomeconf->screens[screen].allow_lower_floats)
@ -238,7 +238,7 @@ uicb_tag_setlayout(awesome_config * awesomeconf,
if(get_current_tag(awesomeconf->screens[screen])->client_sel) if(get_current_tag(awesomeconf->screens[screen])->client_sel)
arrange(awesomeconf, screen); arrange(awesomeconf, screen);
else else
drawstatusbar(awesomeconf, screen); statusbar_draw(awesomeconf, screen);
saveawesomeprops(awesomeconf, screen); saveawesomeprops(awesomeconf, screen);
} }

View File

@ -219,8 +219,8 @@ move_client_to_screen(Client *c, awesome_config *awesomeconf, int new_screen, Bo
focus(c, True, awesomeconf, c->screen); focus(c, True, awesomeconf, c->screen);
/* redraw statusbar on all screens */ /* redraw statusbar on all screens */
drawstatusbar(awesomeconf, old_screen); statusbar_draw(awesomeconf, old_screen);
drawstatusbar(awesomeconf, new_screen); statusbar_draw(awesomeconf, new_screen);
} }
/** Move mouse pointer to x_org and y_xorg of specified screen /** Move mouse pointer to x_org and y_xorg of specified screen

View File

@ -48,7 +48,7 @@ isoccupied(TagClientLink *tc, int screen, Client *head, Tag *t)
} }
void void
drawstatusbar(awesome_config *awesomeconf, int screen) statusbar_draw(awesome_config *awesomeconf, int screen)
{ {
int z, x = 0, y = 0, w; int z, x = 0, y = 0, w;
Client *sel = get_current_tag(awesomeconf->screens[screen])->client_sel; Client *sel = get_current_tag(awesomeconf->screens[screen])->client_sel;
@ -199,7 +199,8 @@ drawstatusbar(awesome_config *awesomeconf, int screen)
} }
void void
initstatusbar(Display *disp, int screen, Statusbar *statusbar, Cursor cursor, XftFont *font, Layout *layouts, Padding *padding) statusbar_init(Display *disp, int screen, Statusbar *statusbar,
Cursor cursor, XftFont *font, Layout *layouts, Padding *padding)
{ {
Layout *l; Layout *l;
XSetWindowAttributes wa; XSetWindowAttributes wa;
@ -238,7 +239,7 @@ initstatusbar(Display *disp, int screen, Statusbar *statusbar, Cursor cursor, Xf
DefaultVisual(disp, phys_screen), DefaultVisual(disp, phys_screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
XDefineCursor(disp, statusbar->window, cursor); XDefineCursor(disp, statusbar->window, cursor);
updatebarpos(disp, *statusbar, padding); statusbar_update_position(disp, *statusbar, padding);
XMapRaised(disp, statusbar->window); XMapRaised(disp, statusbar->window);
for(l = layouts ; l; l = l->next) for(l = layouts ; l; l = l->next)
@ -247,7 +248,7 @@ initstatusbar(Display *disp, int screen, Statusbar *statusbar, Cursor cursor, Xf
} }
void void
updatebarpos(Display *disp, Statusbar statusbar, Padding *padding) statusbar_update_position(Display *disp, Statusbar statusbar, Padding *padding)
{ {
XEvent ev; XEvent ev;
ScreenInfo *si = get_screen_info(disp, statusbar.screen, NULL, padding); ScreenInfo *si = get_screen_info(disp, statusbar.screen, NULL, padding);
@ -274,7 +275,7 @@ updatebarpos(Display *disp, Statusbar statusbar, Padding *padding)
} }
int int
get_statusbar_position_from_str(const char * pos) statusbar_get_position_from_str(const char * pos)
{ {
if(!a_strncmp(pos, "off", 3)) if(!a_strncmp(pos, "off", 3))
return BarOff; return BarOff;
@ -296,7 +297,7 @@ uicb_statusbar_toggle(awesome_config *awesomeconf,
awesomeconf->screens[screen].statusbar.position = (awesomeconf->screens[screen].statusbar.dposition == BarOff) ? BarTop : awesomeconf->screens[screen].statusbar.dposition; awesomeconf->screens[screen].statusbar.position = (awesomeconf->screens[screen].statusbar.dposition == BarOff) ? BarTop : awesomeconf->screens[screen].statusbar.dposition;
else else
awesomeconf->screens[screen].statusbar.position = BarOff; awesomeconf->screens[screen].statusbar.position = BarOff;
updatebarpos(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding); statusbar_update_position(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding);
arrange(awesomeconf, screen); arrange(awesomeconf, screen);
} }
@ -307,8 +308,8 @@ uicb_statusbar_set_position(awesome_config *awesomeconf,
{ {
awesomeconf->screens[screen].statusbar.dposition = awesomeconf->screens[screen].statusbar.dposition =
awesomeconf->screens[screen].statusbar.position = awesomeconf->screens[screen].statusbar.position =
get_statusbar_position_from_str(arg); statusbar_get_position_from_str(arg);
updatebarpos(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding); statusbar_update_position(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding);
} }
void void
@ -319,6 +320,6 @@ uicb_statusbar_set_text(awesome_config *awesomeconf, int screen, const char *arg
a_strncpy(awesomeconf->screens[screen].statustext, a_strncpy(awesomeconf->screens[screen].statustext,
sizeof(awesomeconf->screens[screen].statustext), arg, a_strlen(arg)); sizeof(awesomeconf->screens[screen].statustext), arg, a_strlen(arg));
drawstatusbar(awesomeconf, screen); statusbar_draw(awesomeconf, screen);
} }
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -24,10 +24,10 @@
#include "common.h" #include "common.h"
void initstatusbar(Display *, int, Statusbar *, Cursor, XftFont *, Layout *, Padding *); void statusbar_init(Display *, int, Statusbar *, Cursor, XftFont *, Layout *, Padding *);
void drawstatusbar(awesome_config *, int); void statusbar_draw(awesome_config *, int);
int get_statusbar_position_from_str(const char *); int statusbar_get_position_from_str(const char *);
void updatebarpos(Display *, Statusbar, Padding *); void statusbar_update_position(Display *, Statusbar, Padding *);
UICB_PROTO(uicb_statusbar_toggle); UICB_PROTO(uicb_statusbar_toggle);
UICB_PROTO(uicb_statusbar_set_position); UICB_PROTO(uicb_statusbar_set_position);