From aacb020564e5f9a54c10827fb446e5270e14797e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 14 Dec 2007 20:10:52 +0100 Subject: [PATCH] rename statusbar functions --- awesome.c | 8 ++++---- client.c | 2 +- config.c | 2 +- event.c | 10 +++++----- layout.c | 4 ++-- screen.c | 4 ++-- statusbar.c | 19 ++++++++++--------- statusbar.h | 8 ++++---- 8 files changed, 29 insertions(+), 28 deletions(-) diff --git a/awesome.c b/awesome.c index 5dad294dd..3b9137f42 100644 --- a/awesome.c +++ b/awesome.c @@ -223,9 +223,9 @@ void setup_screen(awesome_config *awesomeconf, int screen) { setup(awesomeconf, screen); - initstatusbar(awesomeconf->display, screen, &awesomeconf->screens[screen].statusbar, - awesomeconf->cursor[CurNormal], awesomeconf->screens[screen].font, - awesomeconf->screens[screen].layouts, &awesomeconf->screens[screen].padding); + statusbar_init(awesomeconf->display, screen, &awesomeconf->screens[screen].statusbar, + awesomeconf->cursor[CurNormal], awesomeconf->screens[screen].font, + awesomeconf->screens[screen].layouts, &awesomeconf->screens[screen].padding); } /** Startup Error handler to check if another window manager @@ -345,7 +345,7 @@ main(int argc, char *argv[]) { /* set screen */ setup_screen(awesomeconf, screen); - drawstatusbar(awesomeconf, screen); + statusbar_draw(awesomeconf, screen); } netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); diff --git a/client.c b/client.c index 31b6b82c0..f9e7e072c 100644 --- a/client.c +++ b/client.c @@ -223,7 +223,7 @@ focus(Client *c, Bool selscreen, awesome_config *awesomeconf, int screen) if(!selscreen) return; curtag->client_sel = c; - drawstatusbar(awesomeconf, screen); + statusbar_draw(awesomeconf, screen); if(curtag->client_sel) { XSetInputFocus(curtag->client_sel->display, curtag->client_sel->win, RevertToPointerRoot, CurrentTime); diff --git a/config.c b/config.c index 6d6258f93..a5d1facb3 100644 --- a/config.c +++ b/config.c @@ -470,7 +470,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf) /* Statusbar */ awesomeconf->screens[screen].statusbar.position = 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 */ if(cfg_size(cfg_layouts, "layout")) diff --git a/event.c b/event.c index d9b5bae94..11bb07598 100644 --- a/event.c +++ b/event.c @@ -160,8 +160,8 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf) if(old_screen != c->screen) { move_client_to_screen(c, awesomeconf, c->screen, False); - drawstatusbar(awesomeconf, old_screen); - drawstatusbar(awesomeconf, c->screen); + statusbar_draw(awesomeconf, old_screen); + statusbar_draw(awesomeconf, c->screen); } tag_client_with_rules(c, awesomeconf); 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.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); } } @@ -257,7 +257,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf) if(!ev->count) for(screen = 0; screen < get_screen_count(e->xany.display); screen++) if(awesomeconf->screens[screen].statusbar.window == ev->window) - drawstatusbar(awesomeconf, screen); + statusbar_draw(awesomeconf, screen); } void @@ -366,7 +366,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf) { client_updatetitle(c); if(c == get_current_tag(awesomeconf->screens[c->screen])->client_sel) - drawstatusbar(awesomeconf, c->screen); + statusbar_draw(awesomeconf, c->screen); } } } diff --git a/layout.c b/layout.c index 99cbd90d1..143251ffb 100644 --- a/layout.c +++ b/layout.c @@ -153,7 +153,7 @@ restack(awesome_config *awesomeconf, int screen) XEvent ev; XWindowChanges wc; - drawstatusbar(awesomeconf, screen); + statusbar_draw(awesomeconf, screen); if(!sel) return; 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) arrange(awesomeconf, screen); else - drawstatusbar(awesomeconf, screen); + statusbar_draw(awesomeconf, screen); saveawesomeprops(awesomeconf, screen); } diff --git a/screen.c b/screen.c index cf1f8a744..3595519ed 100644 --- a/screen.c +++ b/screen.c @@ -219,8 +219,8 @@ move_client_to_screen(Client *c, awesome_config *awesomeconf, int new_screen, Bo focus(c, True, awesomeconf, c->screen); /* redraw statusbar on all screens */ - drawstatusbar(awesomeconf, old_screen); - drawstatusbar(awesomeconf, new_screen); + statusbar_draw(awesomeconf, old_screen); + statusbar_draw(awesomeconf, new_screen); } /** Move mouse pointer to x_org and y_xorg of specified screen diff --git a/statusbar.c b/statusbar.c index 625fd94ed..820e22d4b 100644 --- a/statusbar.c +++ b/statusbar.c @@ -48,7 +48,7 @@ isoccupied(TagClientLink *tc, int screen, Client *head, Tag *t) } void -drawstatusbar(awesome_config *awesomeconf, int screen) +statusbar_draw(awesome_config *awesomeconf, int screen) { int z, x = 0, y = 0, w; Client *sel = get_current_tag(awesomeconf->screens[screen])->client_sel; @@ -199,7 +199,8 @@ drawstatusbar(awesome_config *awesomeconf, int screen) } 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; XSetWindowAttributes wa; @@ -238,7 +239,7 @@ initstatusbar(Display *disp, int screen, Statusbar *statusbar, Cursor cursor, Xf DefaultVisual(disp, phys_screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); XDefineCursor(disp, statusbar->window, cursor); - updatebarpos(disp, *statusbar, padding); + statusbar_update_position(disp, *statusbar, padding); XMapRaised(disp, statusbar->window); for(l = layouts ; l; l = l->next) @@ -247,7 +248,7 @@ initstatusbar(Display *disp, int screen, Statusbar *statusbar, Cursor cursor, Xf } void -updatebarpos(Display *disp, Statusbar statusbar, Padding *padding) +statusbar_update_position(Display *disp, Statusbar statusbar, Padding *padding) { XEvent ev; ScreenInfo *si = get_screen_info(disp, statusbar.screen, NULL, padding); @@ -274,7 +275,7 @@ updatebarpos(Display *disp, Statusbar statusbar, Padding *padding) } int -get_statusbar_position_from_str(const char * pos) +statusbar_get_position_from_str(const char * pos) { if(!a_strncmp(pos, "off", 3)) 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; else 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); } @@ -307,8 +308,8 @@ uicb_statusbar_set_position(awesome_config *awesomeconf, { awesomeconf->screens[screen].statusbar.dposition = awesomeconf->screens[screen].statusbar.position = - get_statusbar_position_from_str(arg); - updatebarpos(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding); + statusbar_get_position_from_str(arg); + statusbar_update_position(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding); } void @@ -319,6 +320,6 @@ uicb_statusbar_set_text(awesome_config *awesomeconf, int screen, const char *arg a_strncpy(awesomeconf->screens[screen].statustext, 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 diff --git a/statusbar.h b/statusbar.h index 56340525f..cc599a7e7 100644 --- a/statusbar.h +++ b/statusbar.h @@ -24,10 +24,10 @@ #include "common.h" -void initstatusbar(Display *, int, Statusbar *, Cursor, XftFont *, Layout *, Padding *); -void drawstatusbar(awesome_config *, int); -int get_statusbar_position_from_str(const char *); -void updatebarpos(Display *, Statusbar, Padding *); +void statusbar_init(Display *, int, Statusbar *, Cursor, XftFont *, Layout *, Padding *); +void statusbar_draw(awesome_config *, int); +int statusbar_get_position_from_str(const char *); +void statusbar_update_position(Display *, Statusbar, Padding *); UICB_PROTO(uicb_statusbar_toggle); UICB_PROTO(uicb_statusbar_set_position);