diff --git a/client.c b/client.c index 25146a52..fd9966d4 100644 --- a/client.c +++ b/client.c @@ -52,7 +52,7 @@ static bool client_loadprops(client_t * c, int screen) { int i, ntags = 0; - Tag *tag; + tag_t *tag; char *prop; bool result = false; @@ -112,7 +112,7 @@ client_isprotodel(xcb_connection_t *c, xcb_window_t win) static bool client_isvisible_anyscreen(client_t *c) { - Tag *tag; + tag_t *tag; int screen; if(!c) @@ -138,7 +138,7 @@ client_isvisible_anyscreen(client_t *c) bool client_isvisible(client_t *c, int screen) { - Tag *tag; + tag_t *tag; if(!c || c->screen != screen) return false; @@ -349,7 +349,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int screen) xcb_window_t trans; bool rettrans, retloadprops; uint32_t config_win_val; - Tag *tag; + tag_t *tag; rule_t *rule; xcb_size_hints_t *u_size_hints; @@ -667,7 +667,7 @@ client_saveprops(client_t *c) { int i = 0, ntags = 0; char *prop; - Tag *tag; + tag_t *tag; for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next) ntags++; @@ -702,7 +702,7 @@ client_unban(client_t *c) void client_unmanage(client_t *c) { - Tag *tag; + tag_t *tag; /* The server grab construct avoids race conditions. */ xcb_grab_server(globalconf.connection); diff --git a/config.c b/config.c index 049514cf..d3684fcf 100644 --- a/config.c +++ b/config.c @@ -312,7 +312,7 @@ config_parse_screen(cfg_t *cfg, int screen) const char *tmp; FloatingPlacement flpl; Layout *layout = NULL; - Tag *tag = NULL; + tag_t *tag = NULL; statusbar_t *statusbar = NULL; cfg_t *cfg_general, *cfg_styles, *cfg_screen, *cfg_tags, *cfg_layouts, *cfg_padding, *cfgsectmp, *cfg_titlebar, diff --git a/ewmh.c b/ewmh.c index 3ddaaf82..939ae34f 100644 --- a/ewmh.c +++ b/ewmh.c @@ -188,7 +188,7 @@ void ewmh_update_net_numbers_of_desktop(int phys_screen) { uint32_t count = 0; - Tag *tag; + tag_t *tag; for(tag = globalconf.screens[phys_screen].tags; tag; tag = tag->next) count++; @@ -202,7 +202,7 @@ void ewmh_update_net_current_desktop(int phys_screen) { uint32_t count = 0; - Tag *tag, **curtags = tags_get_current(phys_screen); + tag_t *tag, **curtags = tags_get_current(phys_screen); for(tag = globalconf.screens[phys_screen].tags; tag != curtags[0]; tag = tag->next) count++; @@ -219,7 +219,7 @@ ewmh_update_net_desktop_names(int phys_screen) { char buf[1024], *pos; ssize_t len, curr_size; - Tag *tag; + tag_t *tag; pos = buf; len = 0; @@ -256,7 +256,7 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set) if(state == net_wm_state_sticky) { - Tag *tag; + tag_t *tag; for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next) tag_client(c, tag); } diff --git a/focus.c b/focus.c index 22d611bf..0af7659e 100644 --- a/focus.c +++ b/focus.c @@ -67,10 +67,10 @@ focus_delete_client(client_t *c) } static client_t * -focus_get_latest_client_for_tags(Tag **t, int nindex) +focus_get_latest_client_for_tags(tag_t **t, int nindex) { client_node_t *node; - Tag **tags; + tag_t **tags; int i = 0; for(node = globalconf.focus; node; node = node->next) @@ -92,7 +92,7 @@ focus_get_latest_client_for_tags(Tag **t, int nindex) client_t * focus_get_current_client(int screen) { - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); client_t *sel = focus_get_latest_client_for_tags(curtags, 0); p_delete(&curtags); @@ -109,7 +109,7 @@ void uicb_focus_history(int screen, char *arg) { int i; - Tag **curtags; + tag_t **curtags; client_t *c; if(arg) @@ -136,7 +136,7 @@ void uicb_focus_client_byname(int screen, char *arg) { client_t *c; - Tag **curtags, **tag; + tag_t **curtags, **tag; if(arg) { diff --git a/layout.c b/layout.c index 0e6468a1..0f3e2c94 100644 --- a/layout.c +++ b/layout.c @@ -124,7 +124,7 @@ layout_refresh(void) Layout * layout_get_current(int screen) { - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); Layout *l = curtags[0]->layout; p_delete(&curtags); return l; @@ -140,7 +140,7 @@ void uicb_tag_setlayout(int screen, char *arg) { Layout *l = globalconf.screens[screen].layouts; - Tag *tag, **curtags; + tag_t *tag, **curtags; int i; if(arg) diff --git a/layouts/tile.c b/layouts/tile.c index 4e751af4..fd92a394 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -34,7 +34,7 @@ extern AwesomeConf globalconf; void uicb_tag_setnmaster(int screen, char * arg) { - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); Layout *curlay = curtags[0]->layout; client_t *c; int n; @@ -63,7 +63,7 @@ uicb_tag_setnmaster(int screen, char * arg) void uicb_tag_setncol(int screen, char * arg) { - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); Layout *curlay = curtags[0]->layout; client_t *c; int n; @@ -94,7 +94,7 @@ void uicb_tag_setmwfact(int screen, char *arg) { char *newarg; - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); Layout *curlay = curtags[0]->layout; if(!arg || (curlay->arrange != layout_tile @@ -135,7 +135,7 @@ _tile(int screen, const position_t position) int real_ncol = 1, win_by_col = 1, current_col = 0; area_t area, geometry = { 0, 0, 0, 0, NULL, NULL }; client_t *c; - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); area = screen_get_area(screen, globalconf.screens[screen].statusbar, diff --git a/mouse.c b/mouse.c index 37e83a27..c3dfc88a 100644 --- a/mouse.c +++ b/mouse.c @@ -325,7 +325,7 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused))) xcb_generic_event_t *ev = NULL; xcb_motion_notify_event_t *ev_motion = NULL; client_t *c = globalconf.focus->client; - Tag **curtags = tags_get_current(screen); + tag_t **curtags = tags_get_current(screen); Layout *layout = curtags[0]->layout; area_t area = { 0, 0, 0, 0, NULL, NULL }, geometry = { 0, 0, 0, 0, NULL, NULL }; double mwfact; diff --git a/rules.c b/rules.c index 5fe0a1fb..fa20b5b5 100644 --- a/rules.c +++ b/rules.c @@ -42,7 +42,7 @@ rules_compile_regex(char *val) } bool -tag_match_rule(Tag *t, rule_t *r) +tag_match_rule(tag_t *t, rule_t *r) { regmatch_t tmp; diff --git a/rules.h b/rules.h index 5bb0187c..14739a6e 100644 --- a/rules.h +++ b/rules.h @@ -27,7 +27,7 @@ #define RULE_NOSCREEN -1 regex_t * rules_compile_regex(char *); -bool tag_match_rule(Tag *, rule_t *); +bool tag_match_rule(tag_t *, rule_t *); rule_t * rule_matching_client(client_t *); DO_SLIST(rule_t, rule, p_delete) diff --git a/screen.c b/screen.c index dabee2d6..47243556 100644 --- a/screen.c +++ b/screen.c @@ -128,7 +128,7 @@ screen_virttophys(int screen) void move_client_to_screen(client_t *c, int new_screen, bool doresize) { - Tag *tag; + tag_t *tag; int old_screen = c->screen; area_t from, to; diff --git a/structs.h b/structs.h index c8a7d261..b1985ddb 100644 --- a/structs.h +++ b/structs.h @@ -238,8 +238,8 @@ struct client_node_t }; /** Tag type */ -typedef struct Tag Tag; -struct Tag +typedef struct _tag_t tag_t; +struct _tag_t { /** Tag name */ char *name; @@ -258,14 +258,14 @@ struct Tag /** Number of columns in tile layout */ int ncol; /** Next and previous tags */ - Tag *prev, *next; + tag_t *prev, *next; }; /** tag_client_node type */ typedef struct tag_client_node_t tag_client_node_t; struct tag_client_node_t { - Tag *tag; + tag_t *tag; client_t *client; /** Next and previous tag_client_nodes */ tag_client_node_t *prev, *next; @@ -321,7 +321,7 @@ typedef struct /** Transparency of focused clients */ double opacity_focused; /** Tag list */ - Tag *tags; + tag_t *tags; /** Layout list */ Layout *layouts; /** Status bar */ diff --git a/tag.c b/tag.c index 7110916b..9004260a 100644 --- a/tag.c +++ b/tag.c @@ -39,12 +39,12 @@ extern AwesomeConf globalconf; * \param ncol number of columns for slaves windows * \return a new tag with all these parameters */ -Tag * +tag_t * tag_new(const char *name, Layout *layout, double mwfact, int nmaster, int ncol) { - Tag *tag; + tag_t *tag; - tag = p_new(Tag, 1); + tag = p_new(tag_t, 1); tag->name = a_strdup(name); tag->layout = layout; @@ -66,7 +66,7 @@ tag_new(const char *name, Layout *layout, double mwfact, int nmaster, int ncol) * \param screen the screen id */ void -tag_append_to_screen(Tag *tag, int screen) +tag_append_to_screen(tag_t *tag, int screen) { int phys_screen = screen_virttophys(screen); @@ -82,7 +82,7 @@ tag_append_to_screen(Tag *tag, int screen) * \param screen the screen */ void -tag_push_to_screen(Tag *tag, int screen) +tag_push_to_screen(tag_t *tag, int screen) { tag->screen = screen; tag_list_push(&globalconf.screens[screen].tags, tag); @@ -94,7 +94,7 @@ tag_push_to_screen(Tag *tag, int screen) * \param t the tag to tag the client with */ void -tag_client(client_t *c, Tag *t) +tag_client(client_t *c, tag_t *t) { tag_client_node_t *tc; @@ -117,7 +117,7 @@ tag_client(client_t *c, Tag *t) * \param t the tag to tag the client with */ void -untag_client(client_t *c, Tag *t) +untag_client(client_t *c, tag_t *t) { tag_client_node_t *tc; @@ -139,7 +139,7 @@ untag_client(client_t *c, Tag *t) * \return true if the client is tagged with the tag, false otherwise. */ bool -is_client_tagged(client_t *c, Tag *t) +is_client_tagged(client_t *c, tag_t *t) { tag_client_node_t *tc; @@ -159,7 +159,7 @@ is_client_tagged(client_t *c, Tag *t) void tag_client_with_current_selected(client_t *c) { - Tag *tag; + tag_t *tag; VirtScreen vscreen = globalconf.screens[c->screen]; for(tag = vscreen.tags; tag; tag = tag->next) @@ -176,7 +176,7 @@ tag_client_with_current_selected(client_t *c) void tag_client_with_rule(client_t *c, rule_t *r) { - Tag *tag; + tag_t *tag; bool matched = false; if(!r) return; @@ -202,13 +202,13 @@ tag_client_with_rule(client_t *c, rule_t *r) * \param screen screen id * \return a double pointer of tag list finished with a NULL element */ -Tag ** +tag_t ** tags_get_current(int screen) { - Tag *tag, **tags = NULL; + tag_t *tag, **tags = NULL; int n = 1; - tags = p_new(Tag *, n); + tags = p_new(tag_t *, n); for(tag = globalconf.screens[screen].tags; tag; tag = tag->next) if(tag->selected) { @@ -224,14 +224,14 @@ tags_get_current(int screen) /** Tag the focused client with the given tag. * \param screen Screen ID - * \param arg Tag name + * \param arg tag name * \ingroup ui_callback */ void uicb_client_tag(int screen, char *arg) { int tag_id = -1; - Tag *tag, *target_tag; + tag_t *tag, *target_tag; client_t *sel = globalconf.focus->client; if(!sel) @@ -268,7 +268,7 @@ uicb_client_toggletag(int screen, char *arg) client_t *sel = globalconf.focus->client; int i; Bool is_sticky = True; - Tag *tag, *target_tag; + tag_t *tag, *target_tag; if(!sel) return; @@ -308,14 +308,14 @@ uicb_client_toggletag(int screen, char *arg) /** Toggle the visibility of a tag. * \param screen Screen ID - * \param arg Tag name + * \param arg tag_t name * \ingroup ui_callback */ void uicb_tag_toggleview(int screen, char *arg) { int i; - Tag *tag, *target_tag, + tag_t *tag, *target_tag, **backtag, **curtags = tags_get_current(screen); if(arg) @@ -344,9 +344,9 @@ uicb_tag_toggleview(int screen, char *arg) * \param target the tag to see */ static void -tag_view_only(Tag *target) +tag_view_only(tag_t *target) { - Tag *tag; + tag_t *tag; if(!target) return; @@ -362,7 +362,7 @@ tag_view_only(Tag *target) void tag_view_byindex(int screen, int dindex, bool view) { - Tag *tag; + tag_t *tag; if(dindex < 0) return; @@ -379,7 +379,7 @@ tag_view_byindex(int screen, int dindex, bool view) void tag_view_only_byindex(int screen, int dindex) { - Tag *tag; + tag_t *tag; if(dindex < 0) return; @@ -394,7 +394,7 @@ tag_view_only_byindex(int screen, int dindex) * \param view set visible or not */ void -tag_view(Tag *tag, bool view) +tag_view(tag_t *tag, bool view) { tag->was_selected = tag->selected; tag->selected = view; @@ -411,7 +411,7 @@ tag_view(Tag *tag, bool view) void uicb_tag_view(int screen, char *arg) { - Tag *tag; + tag_t *tag; if(arg) tag_view_only_byindex(screen, atoi(arg) - 1); @@ -428,7 +428,7 @@ uicb_tag_view(int screen, char *arg) void uicb_tag_prev_selected(int screen, char *arg __attribute__ ((unused))) { - Tag *tag; + tag_t *tag; for(tag = globalconf.screens[screen].tags; tag; tag = tag->next) tag_view(tag, tag->was_selected); @@ -442,7 +442,7 @@ uicb_tag_prev_selected(int screen, char *arg __attribute__ ((unused))) void uicb_tag_viewnext(int screen, char *arg __attribute__ ((unused))) { - Tag *tag, **curtags = tags_get_current(screen); + tag_t *tag, **curtags = tags_get_current(screen); tag = tag_list_next_cycle(&globalconf.screens[screen].tags, curtags[0]); @@ -460,7 +460,7 @@ uicb_tag_viewnext(int screen, char *arg __attribute__ ((unused))) void uicb_tag_viewprev(int screen, char *arg __attribute__ ((unused))) { - Tag *tag, **curtags = tags_get_current(screen); + tag_t *tag, **curtags = tags_get_current(screen); tag = tag_list_prev_cycle(&globalconf.screens[screen].tags, curtags[0]); @@ -477,7 +477,7 @@ uicb_tag_viewprev(int screen, char *arg __attribute__ ((unused))) void uicb_tag_create(int screen, char *arg) { - Tag *tag; + tag_t *tag; if(!a_strlen(arg)) return; diff --git a/tag.h b/tag.h index 86a28ce1..12d4cca8 100644 --- a/tag.h +++ b/tag.h @@ -27,18 +27,18 @@ /** Check if a client is tiled */ #define IS_TILED(client, screen) (client && !client->isfloating && !client->ismax && client_isvisible(client, screen)) -Tag * tag_new(const char *, Layout *, double, int, int); -void tag_view(Tag *, bool); +tag_t * tag_new(const char *, Layout *, double, int, int); +void tag_view(tag_t *, bool); void tag_view_byindex(int, int, bool); -void tag_push_to_screen(Tag *, int); -Tag ** tags_get_current(int); -void tag_client(client_t *, Tag *); -void untag_client(client_t *, Tag *); -bool is_client_tagged(client_t *, Tag *); +void tag_push_to_screen(tag_t *, int); +tag_t ** tags_get_current(int); +void tag_client(client_t *, tag_t *); +void untag_client(client_t *, tag_t *); +bool is_client_tagged(client_t *, tag_t *); void tag_client_with_rule(client_t *, rule_t *r); void tag_client_with_current_selected(client_t *); void tag_view_only_byindex(int, int); -void tag_append_to_screen(Tag *, int); +void tag_append_to_screen(tag_t *, int); uicb_t uicb_client_tag; uicb_t uicb_client_toggletag; @@ -49,7 +49,7 @@ uicb_t uicb_tag_viewnext; uicb_t uicb_tag_viewprev; uicb_t uicb_tag_create; -DO_SLIST(Tag, tag, p_delete) +DO_SLIST(tag_t, tag, p_delete) DO_SLIST(tag_client_node_t, tag_client_node, p_delete) #endif diff --git a/widgets/layoutinfo.c b/widgets/layoutinfo.c index 4338c695..d1fffae4 100644 --- a/widgets/layoutinfo.c +++ b/widgets/layoutinfo.c @@ -34,7 +34,7 @@ layoutinfo_draw(widget_t *widget, int offset, int used __attribute__ ((unused))) { - Tag **curtags = tags_get_current(widget->statusbar->screen); + tag_t **curtags = tags_get_current(widget->statusbar->screen); area_t area = draw_get_image_size(curtags[0]->layout->image); if(!widget->user_supplied_x) diff --git a/widgets/taglist.c b/widgets/taglist.c index 582b1c49..cfc4bd0d 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -36,7 +36,7 @@ extern AwesomeConf globalconf; * \return true or false */ static bool -isoccupied(Tag *t) +isoccupied(tag_t *t) { client_t *c; @@ -48,7 +48,7 @@ isoccupied(Tag *t) } static bool -isurgent(Tag *t) +isurgent(tag_t *t) { client_t *c; @@ -60,7 +60,7 @@ isurgent(Tag *t) } static style_t -taglist_style_get(VirtScreen vscreen, Tag *tag) +taglist_style_get(VirtScreen vscreen, tag_t *tag) { if(tag->selected) return vscreen.styles.focus; @@ -76,7 +76,7 @@ taglist_draw(widget_t *widget, int offset, int used __attribute__ ((unused))) { - Tag *tag; + tag_t *tag; client_t *sel = globalconf.focus->client; VirtScreen vscreen = globalconf.screens[widget->statusbar->screen]; int w = 0, flagsize; @@ -141,7 +141,7 @@ taglist_button_press(widget_t *widget, xcb_button_press_event_t *ev) { VirtScreen vscreen = globalconf.screens[widget->statusbar->screen]; Button *b; - Tag *tag; + tag_t *tag; char buf[4]; int prev_width = 0, width = 0, i = 1; style_t style; diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 68debec7..35e2a9e7 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -195,7 +195,7 @@ tasklist_button_press(widget_t *widget, xcb_button_press_event_t *ev) Button *b; client_t *c; Data *d = widget->data; - Tag *tag; + tag_t *tag; int n = 0, box_width = 0, i, ci = 0; /* button1 give focus */