diff --git a/wmfs2/src/barwin.c b/wmfs2/src/barwin.c index 5345b42..29e24a2 100644 --- a/wmfs2/src/barwin.c +++ b/wmfs2/src/barwin.c @@ -17,10 +17,10 @@ * \param entermask bool for know if the EnterMask mask is needed * \return The BarWindow pointer */ -Barwin* +struct Barwin* barwin_new(Window parent, int x, int y, int w, int h, Color fg, Color bg, bool entermask) { - Barwin *b = (Barwin*)xcalloc(1, sizeof(Barwin)); + struct Barwin *b = (struct Barwin*)xcalloc(1, sizeof(struct Barwin)); XSetWindowAttributes at = { .override_redirect = True, @@ -57,7 +57,7 @@ barwin_new(Window parent, int x, int y, int w, int h, Color fg, Color bg, bool e * \param bw Barwin pointer */ void -barwin_remove(Barwin *b) +barwin_remove(struct Barwin *b) { SLIST_REMOVE(&W->h.barwin, b, Barwin, next); @@ -77,7 +77,7 @@ barwin_remove(Barwin *b) * \param h Height */ void -barwin_resize(Barwin *b, int w, int h) +barwin_resize(struct Barwin *b, int w, int h) { /* Frame */ XFreePixmap(W->dpy, b->dr); @@ -91,11 +91,11 @@ barwin_resize(Barwin *b, int w, int h) } void -barwin_mousebind_new(Barwin *b, unsigned int button, bool u, Geo a, void (*func)(Uicb), Uicb cmd) +barwin_mousebind_new(struct Barwin *b, unsigned int button, bool u, struct Geo a, void (*func)(Uicb), Uicb cmd) { - Mousebind *m; + struct Mousebind *m; - m = xcalloc(1, sizeof(Mousebind)); + m = xcalloc(1, sizeof(struct Mousebind)); m->button = button; m->use_area = u; @@ -111,7 +111,7 @@ barwin_mousebind_new(Barwin *b, unsigned int button, bool u, Geo a, void (*func) * \param bw Barwin pointer */ void -barwin_refresh_color(Barwin *b) +barwin_refresh_color(struct Barwin *b) { XSetForeground(W->dpy, W->gc, b->bg); XFillRectangle(W->dpy, b->dr, W->gc, 0, 0, b->geo.w, b->geo.h); diff --git a/wmfs2/src/barwin.h b/wmfs2/src/barwin.h index ff49764..3180f94 100644 --- a/wmfs2/src/barwin.h +++ b/wmfs2/src/barwin.h @@ -23,10 +23,10 @@ #define barwin_map(b) XMapWindow(W->dpy, b->win); #define barwin_unmap(b) XUnmapWindow(W->dpy, b->win); -Barwin* barwin_new(Window parent, int x, int y, int w, int h, Color fg, Color bg, bool entermask); -void barwin_remove(Barwin *b); -void barwin_resize(Barwin *b, int w, int h); -void barwin_mousebind_new(Barwin *b, unsigned int button, bool u, Geo a, void (*func)(Uicb), Uicb cmd); -void barwin_refresh_color(Barwin *b); +struct Barwin* barwin_new(Window parent, int x, int y, int w, int h, Color fg, Color bg, bool entermask); +void barwin_remove(struct Barwin *b); +void barwin_resize(struct Barwin *b, int w, int h); +void barwin_mousebind_new(struct Barwin *b, unsigned int button, bool u, struct Geo a, void (*func)(Uicb), Uicb cmd); +void barwin_refresh_color(struct Barwin *b); #endif /* BARWIN_H */ diff --git a/wmfs2/src/client.c b/wmfs2/src/client.c index 05ed8bd..b49d8cd 100644 --- a/wmfs2/src/client.c +++ b/wmfs2/src/client.c @@ -10,11 +10,11 @@ #define CLIENT_MOUSE_MOD Mod1Mask -/** Send a ConfigureRequest event to the Client - * \param c Client pointer +/** Send a ConfigureRequest event to the struct Client + * \param c struct Client pointer */ void -client_configure(Client *c) +client_configure(struct Client *c) { XConfigureEvent ev; @@ -33,10 +33,10 @@ client_configure(Client *c) XSync(W->dpy, False); } -Client* +struct Client* client_gb_win(Window w) { - Client *c = SLIST_FIRST(&W->h.client); + struct Client *c = SLIST_FIRST(&W->h.client); while(c && c->win != w) c = SLIST_NEXT(c, next); @@ -45,25 +45,25 @@ client_gb_win(Window w) } /** Map a client - * \param c Client pointer + * \param c struct Client pointer */ void -client_map(Client *c) +client_map(struct Client *c) { XMapWindow(W->dpy, c->win); } /** Unmap a client - * \param c Client pointer + * \param c struct Client pointer */ void -client_unmap(Client *c) +client_unmap(struct Client *c) { XUnmapWindow(W->dpy, c->win); } static void -client_grabbuttons(Client *c, bool focused) +client_grabbuttons(struct Client *c, bool focused) { wmfs_numlockmask(); @@ -94,7 +94,7 @@ client_grabbuttons(Client *c, bool focused) } void -client_focus(Client *c) +client_focus(struct Client *c) { /* Unfocus selected */ if(W->client && W->client != c) @@ -121,10 +121,10 @@ client_focus(Client *c) } /** Get a client name - * \param c Client pointer + * \param c struct Client pointer */ void -client_get_name(Client *c) +client_get_name(struct Client *c) { Atom rt; int rf; @@ -142,10 +142,10 @@ client_get_name(Client *c) } /** Close a client - * \param c Client pointer + * \param c struct Client pointer */ void -client_close(Client *c) +client_close(struct Client *c) { XEvent ev; Atom *atom = NULL; @@ -180,12 +180,12 @@ client_close(Client *c) XKillClient(W->dpy, c->win); } -Client* +struct Client* client_new(Window w, XWindowAttributes *wa) { - Client *c; + struct Client *c; - c = xcalloc(1, sizeof(Client)); + c = xcalloc(1, sizeof(struct Client)); /* C attributes */ c->win = w; @@ -195,7 +195,7 @@ client_new(Window w, XWindowAttributes *wa) /* Set tag */ tag_client(W->screen->seltag, c); - /* Geometry */ + /* struct Geometry */ c->geo.x = wa->x; c->geo.y = wa->y; c->geo.w = wa->width; @@ -228,9 +228,9 @@ client_new(Window w, XWindowAttributes *wa) } void -client_remove(Client *c) +client_remove(struct Client *c) { - Client *cc; + struct Client *cc; XGrabServer(W->dpy); XSetErrorHandler(wmfs_error_handler_dummy); diff --git a/wmfs2/src/client.h b/wmfs2/src/client.h index 52c6158..6b6f694 100644 --- a/wmfs2/src/client.h +++ b/wmfs2/src/client.h @@ -8,15 +8,15 @@ #include "wmfs.h" -void client_configure(Client *c); -Client *client_gb_win(Window w); -void client_map(Client *c); -void client_unmap(Client *c); -void client_focus(Client *c); -void client_get_name(Client *c); -void client_close(Client *c); -Client *client_new(Window w, XWindowAttributes *wa); -void client_remove(Client *c); +void client_configure(struct Client *c); +struct Client *client_gb_win(Window w); +void client_map(struct Client *c); +void client_unmap(struct Client *c); +void client_focus(struct Client *c); +void client_get_name(struct Client *c); +void client_close(struct Client *c); +struct Client *client_new(Window w, XWindowAttributes *wa); +void client_remove(struct Client *c); void client_free(void); #endif /* CLIENT_H */ diff --git a/wmfs2/src/config.c b/wmfs2/src/config.c index f59d82e..ed54d59 100644 --- a/wmfs2/src/config.c +++ b/wmfs2/src/config.c @@ -16,7 +16,7 @@ static void config_theme(void) { - Theme *t; + struct Theme *t; size_t i, n; struct conf_sec *sec, **ks; char *name; @@ -34,7 +34,7 @@ config_theme(void) /* [theme]*/ for(i = 0; i < n; ++i) { - t = (Theme*)xcalloc(1, sizeof(Theme)); + t = (struct Theme*)xcalloc(1, sizeof(struct Theme)); t->name = fetch_opt_first(ks[i], "default", "name").str; @@ -73,8 +73,8 @@ config_theme(void) static void config_bars(void) { - Scr33n *s; - Theme *t; + struct Scr33n *s; + struct Theme *t; size_t i, n; struct conf_sec *sec, **ks; int screenid; @@ -96,7 +96,7 @@ config_bars(void) SLIST_FOREACH(s, &W->h.screen, next) if(screenid == s->id || screenid == -1) - (Infobar*)infobar_new(s, t, pos, elem); + (struct Infobar*)infobar_new(s, t, pos, elem); } free(ks); @@ -106,8 +106,8 @@ config_bars(void) static void config_tag(void) { - Scr33n *s; - Tag *t; + struct Scr33n *s; + struct Tag *t; size_t i, n; struct conf_sec *sec, **ks; char *name; @@ -146,7 +146,7 @@ config_keybind(void) struct conf_sec *sec, **ks; struct opt_type *opt; char *cmd; - Keybind *k; + struct Keybind *k; /* [keys] */ sec = fetch_section_first(NULL, "keys"); @@ -158,7 +158,7 @@ config_keybind(void) /* [key] */ for(i = 0; i < n; ++i) { - k = (Keybind*)xcalloc(1, sizeof(Keybind)); + k = (struct Keybind*)xcalloc(1, sizeof(struct Keybind)); /* mod = {} */ opt = fetch_opt(ks[i], "", "mod"); diff --git a/wmfs2/src/config.h b/wmfs2/src/config.h index 92a6980..650cfc6 100644 --- a/wmfs2/src/config.h +++ b/wmfs2/src/config.h @@ -71,10 +71,10 @@ modkey_keysym(const char *name) return NoSymbol; } -static inline Theme* +static inline struct Theme* name_to_theme(const char *name) { - Theme *t; + struct Theme *t; SLIST_FOREACH(t, &W->h.theme, next) if(!strcmp(t->name, name)) diff --git a/wmfs2/src/draw.h b/wmfs2/src/draw.h index 06e7b32..f138cd6 100644 --- a/wmfs2/src/draw.h +++ b/wmfs2/src/draw.h @@ -16,14 +16,14 @@ #define PAD (8) static inline void -draw_text(Drawable d, Theme *t, int x, int y, Color fg, const char *str) +draw_text(Drawable d, struct Theme *t, int x, int y, Color fg, const char *str) { XSetForeground(W->dpy, W->gc, fg); XmbDrawString(W->dpy, d, t->font.fontset, W->gc, x, y, str, strlen(str)); } static inline unsigned short -draw_textw(Theme *t, const char *str) +draw_textw(struct Theme *t, const char *str) { XRectangle r; diff --git a/wmfs2/src/event.c b/wmfs2/src/event.c index 19752f8..b93f834 100644 --- a/wmfs2/src/event.c +++ b/wmfs2/src/event.c @@ -16,8 +16,8 @@ static void event_buttonpress(XEvent *e) { XButtonEvent *ev = &e->xbutton; - Mousebind *m; - Barwin *b; + struct Mousebind *m; + struct Barwin *b; screen_update_sel(); @@ -38,7 +38,7 @@ static void event_enternotify(XEvent *e) { XCrossingEvent *ev = &e->xcrossing; - Client *c; + struct Client *c; if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != W->root) @@ -60,7 +60,7 @@ event_configureevent(XEvent *e) { XConfigureRequestEvent *ev = &e->xconfigurerequest; XWindowChanges wc; - Client *c; + struct Client *c; if((c = client_gb_win(ev->window))) { @@ -95,7 +95,7 @@ static void event_destroynotify(XEvent *e) { XDestroyWindowEvent *ev = &e->xdestroywindow; - Client *c; + struct Client *c; if((c = client_gb_win(ev->window))) client_remove(c); @@ -104,7 +104,7 @@ event_destroynotify(XEvent *e) static void event_focusin(XEvent *e) { - Client *c; + struct Client *c; if(W->client && e->xfocus.window != W->client->win) client_focus(W->client); @@ -122,7 +122,7 @@ event_maprequest(XEvent *e) return; if(!client_gb_win(ev->window)) - (Client*)client_new(ev->window, &at); + (struct Client*)client_new(ev->window, &at); } static void @@ -139,7 +139,7 @@ static void event_propertynotify(XEvent *e) { XPropertyEvent *ev = &e->xproperty; - Client *c; + struct Client *c; if(ev->state == PropertyDelete) return; @@ -176,7 +176,7 @@ static void event_unmapnotify(XEvent *e) { XUnmapEvent *ev = &e->xunmap; - Client *c; + struct Client *c; if((c = client_gb_win(ev->window)) && ev->send_event) client_remove(c); @@ -201,7 +201,7 @@ event_keypress(XEvent *e) { XKeyPressedEvent *ev = &e->xkey; KeySym keysym = XKeycodeToKeysym(EVDPY(e), (KeyCode)ev->keycode, 0); - Keybind *k; + struct Keybind *k; screen_update_sel(); @@ -215,7 +215,7 @@ static void event_expose(XEvent *e) { XExposeEvent *ev = &e->xexpose; - Barwin *b; + struct Barwin *b; SLIST_FOREACH(b, &W->h.barwin, next) if(b->win == ev->window) diff --git a/wmfs2/src/frame.c b/wmfs2/src/frame.c index 27ed30a..6afd36f 100644 --- a/wmfs2/src/frame.c +++ b/wmfs2/src/frame.c @@ -9,11 +9,11 @@ #include "tag.h" #include "util.h" -Frame* -frame_new(Tag *t) +struct Frame* +frame_new(struct Tag *t) { - Geo g = t->screen->ugeo; - Frame *f = xcalloc(1, sizeof(Frame)); + struct Geo g = t->screen->ugeo; + struct Frame *f = xcalloc(1, sizeof(struct Frame)); XSetWindowAttributes at = { .override_redirect = True, @@ -34,7 +34,7 @@ frame_new(Tag *t) } static void -frame_remove(Frame *f) +frame_remove(struct Frame *f) { SLIST_REMOVE(&f->tag->frames, f, Frame, next); XDestroyWindow(W->dpy, f->win); @@ -44,16 +44,16 @@ frame_remove(Frame *f) } void -frame_free(Tag *t) +frame_free(struct Tag *t) { - Frame *f; + struct Frame *f; SLIST_FOREACH(f, &t->frames, next) frame_remove(f); } void -frame_client(Frame *f, Client *c) +frame_client(struct Frame *f, struct Client *c) { /* Remove client from its previous frame */ if(c->frame) @@ -71,7 +71,7 @@ frame_client(Frame *f, Client *c) } void -frame_update(Frame *f) +frame_update(struct Frame *f) { } diff --git a/wmfs2/src/frame.h b/wmfs2/src/frame.h index facf398..9a17c8b 100644 --- a/wmfs2/src/frame.h +++ b/wmfs2/src/frame.h @@ -8,8 +8,8 @@ #include "wmfs.h" -Frame *frame_new(Tag *t); -void frame_free(Tag *t); -void frame_update(Frame *f); +struct Frame *frame_new(struct Tag *t); +void frame_free(struct Tag *t); +void frame_update(struct Frame *f); #endif /* FRAME_H */ diff --git a/wmfs2/src/infobar.c b/wmfs2/src/infobar.c index ebc2401..1a4a8c4 100644 --- a/wmfs2/src/infobar.c +++ b/wmfs2/src/infobar.c @@ -10,14 +10,14 @@ #include "util.h" #include "tag.h" -static void infobar_elem_tag_init(Element *e); -static void infobar_elem_tag_update(Element *e); +static void infobar_elem_tag_init(struct Element *e); +static void infobar_elem_tag_update(struct Element *e); const struct elem_funcs { char c; - void (*func_init)(Element *e); - void (*func_update)(Element *e); + void (*func_init)(struct Element *e); + void (*func_update)(struct Element *e); } elem_funcs[] = { { 't', infobar_elem_tag_init, infobar_elem_tag_update }, @@ -30,11 +30,11 @@ const struct elem_funcs }; static void -infobar_elem_tag_init(Element *e) +infobar_elem_tag_init(struct Element *e) { - Tag *t; - Barwin *b, *prev; - Geo g = { 0, 0, 0, 0 }; + struct Tag *t; + struct Barwin *b, *prev; + struct Geo g = { 0, 0, 0, 0 }; int s, j; infobar_elem_placement(e); @@ -80,14 +80,14 @@ infobar_elem_tag_init(Element *e) } static void -infobar_elem_tag_update(Element *e) +infobar_elem_tag_update(struct Element *e) { - Tag *t, *sel = e->infobar->screen->seltag; - Barwin *b; + struct Tag *t, *sel = e->infobar->screen->seltag; + struct Barwin *b; SLIST_FOREACH(b, &e->bars, enext) { - t = (Tag*)b->ptr; + t = (struct Tag*)b->ptr; /* Selected */ /* TODO: color from conf */ @@ -112,9 +112,9 @@ infobar_elem_tag_update(Element *e) } static void -infobar_elem_init(Infobar *i) +infobar_elem_init(struct Infobar *i) { - Element *e; + struct Element *e; int n, j; TAILQ_INIT(&i->elements); @@ -124,7 +124,7 @@ infobar_elem_init(Infobar *i) for(j = 0; j < LEN(elem_funcs); ++j) if(elem_funcs[j].c == i->elemorder[n]) { - e = xcalloc(1, sizeof(Element)); + e = xcalloc(1, sizeof(struct Element)); SLIST_INIT(&e->bars); @@ -143,9 +143,9 @@ infobar_elem_init(Infobar *i) } void -infobar_elem_update(Infobar *i) +infobar_elem_update(struct Infobar *i) { - Element *e; + struct Element *e; TAILQ_FOREACH(e, &i->elements, next) if(i->screen->elemupdate & FLAGINT(e->type)) @@ -153,9 +153,9 @@ infobar_elem_update(Infobar *i) } void -infobar_elem_remove(Element *e) +infobar_elem_remove(struct Element *e) { - Barwin *b; + struct Barwin *b; TAILQ_REMOVE(&e->infobar->elements, e, next); @@ -167,13 +167,13 @@ infobar_elem_remove(Element *e) } } -Infobar* -infobar_new(Scr33n *s, Theme *theme, Barpos pos, const char *elem) +struct Infobar* +infobar_new(struct Scr33n *s, struct Theme *theme, Barpos pos, const char *elem) { bool map; int n; - Infobar *i = (Infobar*)xcalloc(1, sizeof(Infobar)); + struct Infobar *i = (struct Infobar*)xcalloc(1, sizeof(struct Infobar)); i->screen = s; i->theme = theme; @@ -181,13 +181,13 @@ infobar_new(Scr33n *s, Theme *theme, Barpos pos, const char *elem) map = infobar_placement(i, pos); - /* Barwin create */ + /* struct Barwin create */ i->bar = barwin_new(W->root, i->geo.x, i->geo.y, i->geo.w, i->geo.h, theme->bars.fg, theme->bars.bg, false); SLIST_INSERT_HEAD(&s->infobars, i, next); - /* Elements */ + /* struct Elements */ infobar_elem_init(i); /* Render, only if pos is Top or Bottom */ @@ -203,7 +203,7 @@ infobar_new(Scr33n *s, Theme *theme, Barpos pos, const char *elem) } void -infobar_refresh(Infobar *i) +infobar_refresh(struct Infobar *i) { infobar_elem_update(i); @@ -211,9 +211,9 @@ infobar_refresh(Infobar *i) } void -infobar_remove(Infobar *i) +infobar_remove(struct Infobar *i) { - Element *e; + struct Element *e; free(i->elemorder); @@ -228,9 +228,9 @@ infobar_remove(Infobar *i) } void -infobar_free(Scr33n *s) +infobar_free(struct Scr33n *s) { - Infobar *i; + struct Infobar *i; while(!SLIST_EMPTY(&s->infobars)) { diff --git a/wmfs2/src/infobar.h b/wmfs2/src/infobar.h index c40380c..9bccf4e 100644 --- a/wmfs2/src/infobar.h +++ b/wmfs2/src/infobar.h @@ -12,17 +12,17 @@ enum { ElemTag = 0, ElemLayout, ElemSelbar, ElemStatus, ElemCustom, ElemLast }; -Infobar *infobar_new(Scr33n *s, Theme *theme, Barpos pos, const char *elem); -void infobar_elem_update(Infobar *i); -void infobar_refresh(Infobar *i); -void infobar_remove(Infobar *i); -void infobar_free(Scr33n *s); +struct Infobar *infobar_new(struct Scr33n *s, struct Theme *theme, Barpos pos, const char *elem); +void infobar_elem_update(struct Infobar *i); +void infobar_refresh(struct Infobar *i); +void infobar_remove(struct Infobar *i); +void infobar_free(struct Scr33n *s); /* Basic placement of elements */ static inline void -infobar_elem_placement(Element *e) +infobar_elem_placement(struct Element *e) { - Element *p = TAILQ_PREV(e, esub, next); + struct Element *p = TAILQ_PREV(e, esub, next); e->geo.y = e->geo.w = 0; e->geo.h = e->infobar->geo.h; @@ -31,7 +31,7 @@ infobar_elem_placement(Element *e) /* Bars placement management and usable space management */ static inline bool -infobar_placement(Infobar *i, Barpos p) +infobar_placement(struct Infobar *i, Barpos p) { i->pos = p; i->geo = i->screen->ugeo; @@ -56,9 +56,9 @@ infobar_placement(Infobar *i, Barpos p) } static inline void -infobar_elem_screen_update(Scr33n *s, int addf) +infobar_elem_screen_update(struct Scr33n *s, int addf) { - Infobar *i; + struct Infobar *i; s->elemupdate |= FLAGINT(addf); diff --git a/wmfs2/src/screen.c b/wmfs2/src/screen.c index 49c3351..082c68d 100644 --- a/wmfs2/src/screen.c +++ b/wmfs2/src/screen.c @@ -14,10 +14,10 @@ #include "tag.h" #include "infobar.h" -static Scr33n* -screen_new(Geo *g, int id) +static struct Scr33n* +screen_new(struct Geo *g, int id) { - Scr33n *s = (Scr33n*)xcalloc(1, sizeof(Scr33n)); + struct Scr33n *s = (struct Scr33n*)xcalloc(1, sizeof(struct Scr33n)); s->geo = s->ugeo = *g; s->seltag = NULL; @@ -37,8 +37,8 @@ screen_new(Geo *g, int id) void screen_init(void) { - Scr33n *s; - Geo g; + struct Scr33n *s; + struct Geo g; SLIST_INIT(&W->h.screen); @@ -76,13 +76,13 @@ screen_init(void) /* * Update selected screen with mouse location */ -Scr33n* +struct Scr33n* screen_update_sel(void) { #ifdef HAVE_XINERAMA if(XineramaIsActive(W->dpy)) { - Scr33n *s; + struct Scr33n *s; Window w; int d, x, y; @@ -100,12 +100,13 @@ screen_update_sel(void) void screen_free(void) { - Scr33n *s; + struct Scr33n *s; while(!SLIST_EMPTY(&W->h.screen)) { s = SLIST_FIRST(&W->h.screen); SLIST_REMOVE_HEAD(&W->h.screen, next); + infobar_free(s); tag_free(s); free(s); diff --git a/wmfs2/src/screen.h b/wmfs2/src/screen.h index 7ed8e84..2c463ad 100644 --- a/wmfs2/src/screen.h +++ b/wmfs2/src/screen.h @@ -8,10 +8,10 @@ #include "wmfs.h" -static inline Scr33n* +static inline struct Scr33n* screen_gb_id(int id) { - Scr33n *s; + struct Scr33n *s; SLIST_FOREACH(s, &W->h.screen, next) if(s->id == id) @@ -21,7 +21,7 @@ screen_gb_id(int id) } void screen_init(void); -Scr33n* screen_update_sel(void); +struct Scr33n* screen_update_sel(void); void screen_free(void); #endif /* SCREEN_H */ diff --git a/wmfs2/src/tag.c b/wmfs2/src/tag.c index 1a265e2..6af9d43 100644 --- a/wmfs2/src/tag.c +++ b/wmfs2/src/tag.c @@ -9,12 +9,12 @@ #include "client.h" #include "frame.h" -Tag* -tag_new(Scr33n *s, char *name) +struct Tag* +tag_new(struct Scr33n *s, char *name) { - Tag *t; + struct Tag *t; - t = xcalloc(1, sizeof(Tag)); + t = xcalloc(1, sizeof(struct Tag)); t->screen = s; t->name = xstrdup(name); @@ -35,10 +35,10 @@ tag_new(Scr33n *s, char *name) } void -tag_screen(Scr33n *s, Tag *t) +tag_screen(struct Scr33n *s, struct Tag *t) { - Frame *f; - Client *c; + struct Frame *f; + struct Client *c; /* Hide previous tag's clients */ if(s->seltag) @@ -60,7 +60,7 @@ tag_screen(Scr33n *s, Tag *t) } void -tag_client(Tag *t, Client *c) +tag_client(struct Tag *t, struct Client *c) { /* Remove client from its previous tag */ if(c->tag) @@ -84,7 +84,7 @@ void uicb_tag_set(Uicb cmd) { int i = 0, n = ATOI(cmd); - Tag *t; + struct Tag *t; TAILQ_FOREACH(t, &W->screen->tags, next) if(++i == n) @@ -97,7 +97,7 @@ uicb_tag_set(Uicb cmd) void uicb_tag_set_with_name(Uicb cmd) { - Tag *t; + struct Tag *t; TAILQ_FOREACH(t, &W->screen->tags, next) if(!strcmp(cmd, t->name)) @@ -111,7 +111,7 @@ void uicb_tag_next(Uicb cmd) { (void)cmd; - Tag *t; + struct Tag *t; if((t = TAILQ_NEXT(W->screen->seltag, next))) tag_screen(W->screen, t); @@ -123,7 +123,7 @@ void uicb_tag_prev(Uicb cmd) { (void)cmd; - Tag *t; + struct Tag *t; if((t = TAILQ_PREV(W->screen->seltag, tsub, next))) tag_screen(W->screen, t); @@ -132,9 +132,9 @@ uicb_tag_prev(Uicb cmd) } static void -tag_remove(Tag *t) +tag_remove(struct Tag *t) { - Frame *f; + struct Frame *f; free(t->name); @@ -145,9 +145,9 @@ tag_remove(Tag *t) void -tag_free(Scr33n *s) +tag_free(struct Scr33n *s) { - Tag *t; + struct Tag *t; TAILQ_FOREACH(t, &s->tags, next) { diff --git a/wmfs2/src/tag.h b/wmfs2/src/tag.h index 19db6da..66942e9 100644 --- a/wmfs2/src/tag.h +++ b/wmfs2/src/tag.h @@ -8,16 +8,13 @@ #include "wmfs.h" -Tag *tag_new(Scr33n *s, char *name); -void tag_screen(Scr33n *s, Tag *t); -void tag_client(Tag *t, Client *c); -void tag_free(Scr33n *s); +struct Tag *tag_new(struct Scr33n *s, char *name); +void tag_screen(struct Scr33n *s, struct Tag *t); +void tag_client(struct Tag *t, struct Client *c); +void tag_free(struct Scr33n *s); void uicb_tag_set(Uicb cmd); void uicb_tag_set_with_name(Uicb cmd); void uicb_tag_next(Uicb cmd); void uicb_tag_prev(Uicb cmd); - - - #endif /* TAG_H */ diff --git a/wmfs2/src/wmfs.c b/wmfs2/src/wmfs.c index 5573c44..175038d 100644 --- a/wmfs2/src/wmfs.c +++ b/wmfs2/src/wmfs.c @@ -73,7 +73,7 @@ wmfs_numlockmask(void) } void -wmfs_init_font(char *font, Theme *t) +wmfs_init_font(char *font, struct Theme *t) { XFontStruct **xfs = NULL; char **misschar, **names, *defstring; @@ -150,7 +150,7 @@ void wmfs_grab_keys(void) { KeyCode c; - Keybind *k; + struct Keybind *k; wmfs_numlockmask(); @@ -252,8 +252,8 @@ wmfs_init(void) void wmfs_quit(void) { - Keybind *k; - Theme *t; + struct Keybind *k; + struct Theme *t; /* Will free: * diff --git a/wmfs2/src/wmfs.h b/wmfs2/src/wmfs.h index c79b540..b7af55c 100644 --- a/wmfs2/src/wmfs.h +++ b/wmfs2/src/wmfs.h @@ -36,58 +36,47 @@ typedef enum { Right = 0, Left, Top, Bottom, Center, PositionLast } Position; /* * Structures */ -typedef struct Geo Geo; -typedef struct Element Element; -typedef struct Infobar Infobar; -typedef struct Barwin Barwin; -typedef struct Scr33n Scr33n; -typedef struct Tag Tag; -typedef struct Client Client; -typedef struct Frame Frame; -typedef struct Keybind Keybind; -typedef struct Mousebind Mousebind; -typedef struct Theme Theme; struct Geo { int x, y, w, h; }; -/* Barwin */ +/* struct Barwin */ struct Barwin { + struct Geo geo; Window win; Drawable dr; Color fg, bg; - Geo geo; - Flags flags; + Flags flags; void *ptr; /* Special cases */ SLIST_HEAD(, Mousebind) mousebinds; SLIST_ENTRY(Barwin) next; /* global barwin */ SLIST_ENTRY(Barwin) enext; /* element barwin */ }; -/* Infobar's element */ +/* struct Infobar's element */ struct Element { - SLIST_HEAD(, Barwin) bars; - Geo geo; - Infobar *infobar; + struct Geo geo; + struct Infobar *infobar; int type; - void (*func_init)(Element *e); - void (*func_update)(Element *e); + void (*func_init)(struct Element *e); + void (*func_update)(struct Element *e); + SLIST_HEAD(, Barwin) bars; TAILQ_ENTRY(Element) next; }; -/* Infobar */ +/* struct Infobar */ struct Infobar { - Barwin *bar; - Geo geo; - Barpos pos; - Scr33n *screen; - Theme *theme; + struct Barwin *bar; + struct Geo geo; + struct Scr33n *screen; + struct Theme *theme; char *elemorder; + Barpos pos; TAILQ_HEAD(esub, Element) elements; SLIST_ENTRY(Infobar) next; }; @@ -95,8 +84,8 @@ struct Infobar /* Screen */ struct Scr33n { - Geo geo, ugeo; - Tag *seltag; + struct Geo geo, ugeo; + struct Tag *seltag; int id; Flags elemupdate; TAILQ_HEAD(tsub, Tag) tags; @@ -104,40 +93,40 @@ struct Scr33n SLIST_ENTRY(Scr33n) next; }; -/* Tag */ +/* struct Tag */ struct Tag { + struct Scr33n *screen; + struct Client *sel; + struct Frame *frame; char *name; - Scr33n *screen; Flags flags; - Client *sel; - Frame *frame; SLIST_HEAD(, Frame) frames; SLIST_HEAD(, Client) clients; TAILQ_ENTRY(Tag) next; }; -/* Client */ +/* struct Client */ struct Client { - Tag *tag; - Scr33n *screen; - Frame *frame; - Barwin *titlebar; - Geo geo; - Flags flags; + struct Tag *tag; + struct Scr33n *screen; + struct Frame *frame; + struct Barwin *titlebar; + struct Geo geo; char *title; + Flags flags; Window win; SLIST_ENTRY(Client) next; /* Global list */ - SLIST_ENTRY(Client) tnext; /* Tag list */ - SLIST_ENTRY(Client) fnext; /* Frame list */ + SLIST_ENTRY(Client) tnext; /* struct Tag list */ + SLIST_ENTRY(Client) fnext; /* struct struct Frame list */ }; -/* Frame */ +/* struct struct Frame */ struct Frame { - Tag *tag; - Geo geo; + struct Tag *tag; + struct Geo geo; Window win; Color fg, bg; SLIST_HEAD(, Client) clients; @@ -148,16 +137,16 @@ struct Frame struct Keybind { unsigned int mod; - KeySym keysym; void (*func)(Uicb); Uicb cmd; + KeySym keysym; SLIST_ENTRY(Keybind) next; }; struct Mousebind { + struct Geo area; unsigned int button; - Geo area; bool use_area; void (*func)(Uicb); Uicb cmd; @@ -184,12 +173,12 @@ struct Theme struct Colpair bars; int bars_width; - /* Elements */ + /* struct Elements */ struct Colpair tags_n, tags_s; /* normal / selected */ int tags_border_width; Color tags_border_col; - /* Client / Frame */ + /* struct Client / struct struct Frame */ struct Colpair client_n, client_s; Color frame_bg; int client_titlebar_width; @@ -223,8 +212,8 @@ struct Wmfs /* * Selected screen, client */ - Scr33n *screen; - Client *client; + struct Scr33n *screen; + struct Client *client; }; @@ -232,7 +221,7 @@ int wmfs_error_handler(Display *d, XErrorEvent *event); int wmfs_error_handler_dummy(Display *d, XErrorEvent *event); void wmfs_grab_keys(void); void wmfs_numlockmask(void); -void wmfs_init_font(char *font, Theme *t); +void wmfs_init_font(char *font, struct Theme *t); void wmfs_quit(void); void uicb_reload(Uicb cmd); void uicb_quit(Uicb cmd);