diff --git a/awesome.c b/awesome.c index 8570a4e2..493b7fc9 100644 --- a/awesome.c +++ b/awesome.c @@ -292,7 +292,7 @@ main(int argc, char **argv) int r, xfd, csfd, i, screen_nbr, opt; ssize_t cmdlen = 1; const xcb_query_extension_reply_t *shape_query, *randr_query; - Statusbar *statusbar; + statusbar_t *statusbar; fd_set rd; xcb_generic_event_t *ev; struct sockaddr_un *addr; diff --git a/config.c b/config.c index 8d754396..049514cf 100644 --- a/config.c +++ b/config.c @@ -240,7 +240,7 @@ cmp_widget_cfg(const void *a, const void *b) } static void -statusbar_widgets_create(cfg_t *cfg_statusbar, Statusbar *statusbar) +statusbar_widgets_create(cfg_t *cfg_statusbar, statusbar_t *statusbar) { cfg_t* widgets, *wptr; widget_t *widget = NULL; @@ -313,7 +313,7 @@ config_parse_screen(cfg_t *cfg, int screen) FloatingPlacement flpl; Layout *layout = NULL; Tag *tag = NULL; - Statusbar *statusbar = NULL; + statusbar_t *statusbar = NULL; cfg_t *cfg_general, *cfg_styles, *cfg_screen, *cfg_tags, *cfg_layouts, *cfg_padding, *cfgsectmp, *cfg_titlebar, *cfg_styles_normal, *cfg_styles_focus, *cfg_styles_urgent; @@ -394,11 +394,11 @@ config_parse_screen(cfg_t *cfg, int screen) /* Titlebar */ config_section_titlebar_init(cfg_titlebar, &virtscreen->titlebar_default, screen); - /* Statusbar */ + /* statusbar_t */ statusbar_list_init(&virtscreen->statusbar); for(i = cfg_size(cfg_screen, "statusbar") - 1; i >= 0; i--) { - statusbar = p_new(Statusbar, 1); + statusbar = p_new(statusbar_t, 1); cfgsectmp = cfg_getnsec(cfg_screen, "statusbar", i); statusbar->position = statusbar->dposition = cfg_getposition(cfgsectmp, "position"); diff --git a/event.c b/event.c index c26c87f1..9b66e1e6 100644 --- a/event.c +++ b/event.c @@ -79,7 +79,7 @@ event_handle_buttonpress(void *data __attribute__ ((unused)), int screen; Client *c; widget_t *widget; - Statusbar *statusbar; + statusbar_t *statusbar; xcb_query_pointer_cookie_t qc; xcb_query_pointer_reply_t *qr; @@ -358,7 +358,7 @@ event_handle_expose(void *data __attribute__ ((unused)), xcb_expose_event_t *ev) { int screen; - Statusbar *statusbar; + statusbar_t *statusbar; Client *c; if(!ev->count) diff --git a/screen.c b/screen.c index 6be5f9d8..8e8254a8 100644 --- a/screen.c +++ b/screen.c @@ -39,10 +39,10 @@ extern AwesomeConf globalconf; * \return area_t */ area_t -screen_get_area(int screen, Statusbar *statusbar, Padding *padding) +screen_get_area(int screen, statusbar_t *statusbar, Padding *padding) { area_t area = globalconf.screens_info->geometry[screen]; - Statusbar *sb; + statusbar_t *sb; /* make padding corrections */ if(padding) @@ -80,10 +80,10 @@ screen_get_area(int screen, Statusbar *statusbar, Padding *padding) * \return area_t */ area_t -get_display_area(int screen, Statusbar *statusbar, Padding *padding) +get_display_area(int screen, statusbar_t *statusbar, Padding *padding) { area_t area = { 0, 0, 0, 0, NULL, NULL }; - Statusbar *sb; + statusbar_t *sb; xcb_screen_t *s = xcb_aux_get_screen(globalconf.connection, screen); area.width = s->width_in_pixels; diff --git a/screen.h b/screen.h index 40558c93..b7ec8426 100644 --- a/screen.h +++ b/screen.h @@ -24,8 +24,8 @@ #include "structs.h" -area_t screen_get_area(int, Statusbar *, Padding *); -area_t get_display_area(int, Statusbar *, Padding *); +area_t screen_get_area(int, statusbar_t *, Padding *); +area_t get_display_area(int, statusbar_t *, Padding *); int screen_virttophys(int); void move_client_to_screen(Client *, int, bool); diff --git a/statusbar.c b/statusbar.c index be92b16f..cdfde723 100644 --- a/statusbar.c +++ b/statusbar.c @@ -33,9 +33,9 @@ extern AwesomeConf globalconf; static void -statusbar_position_update(Statusbar *statusbar) +statusbar_position_update(statusbar_t *statusbar) { - Statusbar *sb; + statusbar_t *sb; area_t area; if(statusbar->position == Off) @@ -46,7 +46,7 @@ statusbar_position_update(Statusbar *statusbar) xcb_map_window(globalconf.connection, statusbar->sw->window); - /* Top and Bottom Statusbar have prio */ + /* Top and Bottom statusbar_t have prio */ if(statusbar->position == Top || statusbar->position == Bottom) area = screen_get_area(statusbar->screen, NULL, @@ -107,7 +107,7 @@ statusbar_position_update(Statusbar *statusbar) } static void -statusbar_draw(Statusbar *statusbar) +statusbar_draw(statusbar_t *statusbar) { widget_t *widget; int left = 0, right = 0; @@ -165,7 +165,7 @@ statusbar_draw(Statusbar *statusbar) } void -statusbar_preinit(Statusbar *statusbar) +statusbar_preinit(statusbar_t *statusbar) { if(statusbar->height <= 0) /* 1.5 as default factor, it fits nice but no one knows why */ @@ -175,9 +175,9 @@ statusbar_preinit(Statusbar *statusbar) } void -statusbar_init(Statusbar *statusbar) +statusbar_init(statusbar_t *statusbar) { - Statusbar *sb; + statusbar_t *sb; xcb_drawable_t dw; xcb_screen_t *s = NULL; int phys_screen = screen_virttophys(statusbar->screen); @@ -187,7 +187,7 @@ statusbar_init(Statusbar *statusbar) statusbar->phys_screen = phys_screen; - /* Top and Bottom Statusbar have prio */ + /* Top and Bottom statusbar_t have prio */ for(sb = globalconf.screens[statusbar->screen].statusbar; sb; sb = sb->next) switch(sb->position) { @@ -262,7 +262,7 @@ void statusbar_refresh() { int screen; - Statusbar *statusbar; + statusbar_t *statusbar; widget_t *widget; for(screen = 0; screen < globalconf.screens_info->nscreen; screen++) @@ -277,10 +277,10 @@ statusbar_refresh() } } -Statusbar * +statusbar_t * statusbar_getbyname(int screen, const char *name) { - Statusbar *sb; + statusbar_t *sb; for(sb = globalconf.screens[screen].statusbar; sb; sb = sb->next) if(!a_strcmp(sb->name, name)) @@ -290,7 +290,7 @@ statusbar_getbyname(int screen, const char *name) } static void -statusbar_toggle(Statusbar *statusbar) +statusbar_toggle(statusbar_t *statusbar) { if(statusbar->position == Off) statusbar->position = (statusbar->dposition == Off) ? Top : statusbar->dposition; @@ -309,7 +309,7 @@ statusbar_toggle(Statusbar *statusbar) void uicb_statusbar_toggle(int screen, char *arg) { - Statusbar *sb = statusbar_getbyname(screen, arg); + statusbar_t *sb = statusbar_getbyname(screen, arg); if(sb) statusbar_toggle(sb); diff --git a/statusbar.h b/statusbar.h index b2433fe1..6cdee9c6 100644 --- a/statusbar.h +++ b/statusbar.h @@ -25,13 +25,13 @@ #include "structs.h" void statusbar_refresh(void); -void statusbar_preinit(Statusbar *); -void statusbar_init(Statusbar *); -Statusbar * statusbar_getbyname(int, const char *); +void statusbar_preinit(statusbar_t *); +void statusbar_init(statusbar_t *); +statusbar_t * statusbar_getbyname(int, const char *); uicb_t uicb_statusbar_toggle; -DO_SLIST(Statusbar, statusbar, p_delete) +DO_SLIST(statusbar_t, statusbar, p_delete) #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/structs.h b/structs.h index c5f06390..bec46d4a 100644 --- a/structs.h +++ b/structs.h @@ -120,7 +120,7 @@ typedef enum /** widget_t */ typedef struct widget_t widget_t; -typedef struct Statusbar Statusbar; +typedef struct statusbar_t statusbar_t; struct widget_t { /** widget_t name */ @@ -131,8 +131,8 @@ struct widget_t widget_tell_status_t (*tell)(widget_t *, char *, char *); /** ButtonPressedEvent handler */ void (*button_press)(widget_t *, xcb_button_press_event_t *); - /** Statusbar */ - Statusbar *statusbar; + /** statusbar_t */ + statusbar_t *statusbar; /** Alignement */ alignment_t alignment; /** Misc private data */ @@ -155,11 +155,11 @@ struct widget_t }; /** Status bar */ -struct Statusbar +struct statusbar_t { /** Window */ simple_window_t *sw; - /** Statusbar name */ + /** statusbar_t name */ char *name; /** Bar width */ int width; @@ -178,7 +178,7 @@ struct Statusbar /** Draw context */ DrawCtx *ctx; /** Next and previous statusbars */ - Statusbar *prev, *next; + statusbar_t *prev, *next; }; /** Client type */ @@ -325,7 +325,7 @@ typedef struct /** Layout list */ Layout *layouts; /** Status bar */ - Statusbar *statusbar; + statusbar_t *statusbar; /** Padding */ Padding padding; } VirtScreen; diff --git a/widget.c b/widget.c index 9d14bd73..d08169da 100644 --- a/widget.c +++ b/widget.c @@ -93,7 +93,7 @@ widget_calculate_offset(int barwidth, int widgetwidth, int offset, int alignment * \return a widget */ static widget_t * -widget_getbyname(Statusbar *sb, char *name) +widget_getbyname(statusbar_t *sb, char *name) { widget_t *widget; @@ -142,7 +142,7 @@ widget_common_tell(widget_t *widget, char *property __attribute__ ((unused)), * \param config the cfg_t structure we will parse to set common info */ void -widget_common_new(widget_t *widget, Statusbar *statusbar, cfg_t *config) +widget_common_new(widget_t *widget, statusbar_t *statusbar, cfg_t *config) { widget->statusbar = statusbar; widget->name = a_strdup(cfg_title(config)); @@ -163,7 +163,7 @@ widget_common_new(widget_t *widget, Statusbar *statusbar, cfg_t *config) void widget_invalidate_cache(int screen, int flags) { - Statusbar *statusbar; + statusbar_t *statusbar; widget_t *widget; for(statusbar = globalconf.screens[screen].statusbar; @@ -182,7 +182,7 @@ widget_invalidate_cache(int screen, int flags) void uicb_widget_tell(int screen, char *arg) { - Statusbar *statusbar; + statusbar_t *statusbar; widget_t *widget; char *p, *property = NULL, *command; ssize_t len; diff --git a/widget.h b/widget.h index 78bc9f55..3cf03629 100644 --- a/widget.h +++ b/widget.h @@ -32,12 +32,12 @@ #define WIDGET_CACHE_TAGS 1<<2 #define WIDGET_CACHE_ALL (WIDGET_CACHE_CLIENTS | WIDGET_CACHE_LAYOUTS | WIDGET_CACHE_TAGS) -typedef widget_t *(WidgetConstructor)(Statusbar *, cfg_t *); +typedef widget_t *(WidgetConstructor)(statusbar_t *, cfg_t *); void widget_invalidate_cache(int, int); int widget_calculate_offset(int, int, int, int); void widget_calculate_alignments(widget_t *); -void widget_common_new(widget_t*, Statusbar *, cfg_t *); +void widget_common_new(widget_t*, statusbar_t *, cfg_t *); WidgetConstructor layoutinfo_new; WidgetConstructor taglist_new; diff --git a/widgets/emptybox.c b/widgets/emptybox.c index bd74e7da..b3d704e6 100644 --- a/widgets/emptybox.c +++ b/widgets/emptybox.c @@ -49,7 +49,7 @@ emptybox_draw(widget_t *widget, DrawCtx *ctx, int offset, } widget_t * -emptybox_new(Statusbar *statusbar, cfg_t *config) +emptybox_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; Data *d; diff --git a/widgets/focusicon.c b/widgets/focusicon.c index 27477813..caff0eb9 100644 --- a/widgets/focusicon.c +++ b/widgets/focusicon.c @@ -94,7 +94,7 @@ focusicon_draw(widget_t *widget, DrawCtx *ctx, int offset, } widget_t * -focusicon_new(Statusbar *statusbar, cfg_t *config) +focusicon_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; diff --git a/widgets/graph.c b/widgets/graph.c index e1da4f07..293023b5 100644 --- a/widgets/graph.c +++ b/widgets/graph.c @@ -380,7 +380,7 @@ graph_tell(widget_t *widget, char *property, char *command) } widget_t * -graph_new(Statusbar *statusbar, cfg_t *config) +graph_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; Data *d; diff --git a/widgets/iconbox.c b/widgets/iconbox.c index efc25bd3..5593b305 100644 --- a/widgets/iconbox.c +++ b/widgets/iconbox.c @@ -93,7 +93,7 @@ iconbox_tell(widget_t *widget, char *property, char *command) } widget_t * -iconbox_new(Statusbar *statusbar, cfg_t *config) +iconbox_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; Data *d; diff --git a/widgets/layoutinfo.c b/widgets/layoutinfo.c index 2a677590..4338c695 100644 --- a/widgets/layoutinfo.c +++ b/widgets/layoutinfo.c @@ -59,7 +59,7 @@ layoutinfo_draw(widget_t *widget, } widget_t * -layoutinfo_new(Statusbar *statusbar, cfg_t* config) +layoutinfo_new(statusbar_t *statusbar, cfg_t* config) { widget_t *w; w = p_new(widget_t, 1); diff --git a/widgets/progressbar.c b/widgets/progressbar.c index 14b04aab..a972bce1 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -451,7 +451,7 @@ progressbar_tell(widget_t *widget, char *property, char *command) } widget_t * -progressbar_new(Statusbar *statusbar, cfg_t *config) +progressbar_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; Data *d; diff --git a/widgets/taglist.c b/widgets/taglist.c index 1d3ef140..3ac0fb62 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -204,7 +204,7 @@ taglist_button_press(widget_t *widget, xcb_button_press_event_t *ev) } widget_t * -taglist_new(Statusbar *statusbar, cfg_t *config) +taglist_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; w = p_new(widget_t, 1); diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 017fb83b..8fd99892 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -258,7 +258,7 @@ tasklist_button_press(widget_t *widget, xcb_button_press_event_t *ev) } widget_t * -tasklist_new(Statusbar *statusbar, cfg_t *config) +tasklist_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; Data *d; diff --git a/widgets/textbox.c b/widgets/textbox.c index a8398957..d7486343 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -107,7 +107,7 @@ textbox_tell(widget_t *widget, char *property, char *command) } widget_t * -textbox_new(Statusbar *statusbar, cfg_t *config) +textbox_new(statusbar_t *statusbar, cfg_t *config) { widget_t *w; Data *d;