diff --git a/common/configopts.c b/common/configopts.c index 1c5d8c09..bc859c46 100644 --- a/common/configopts.c +++ b/common/configopts.c @@ -98,7 +98,7 @@ static int cfg_alignment_parse(cfg_t *cfg, cfg_opt_t *opt, const char *value, void *result) { - Alignment *p = p_new(Alignment, 1); + alignment_t *p = p_new(alignment_t, 1); if((*p = draw_align_get_from_str(value)) == Auto && a_strcmp(value, "auto")) @@ -119,19 +119,19 @@ cfg_value_free(void *value) p_delete(&value); } -Alignment +alignment_t cfg_opt_getnalignment(cfg_opt_t *opt, unsigned int oindex) { - return * (Alignment *) cfg_opt_getnptr(opt, oindex); + return * (alignment_t *) cfg_opt_getnptr(opt, oindex); } -Alignment +alignment_t cfg_getnalignment(cfg_t *cfg, const char *name, unsigned int oindex) { return cfg_opt_getnalignment(cfg_getopt(cfg, name), oindex); } -Alignment +alignment_t cfg_getalignment(cfg_t *cfg, const char *name) { return cfg_getnalignment(cfg, name, 0); diff --git a/common/configopts.h b/common/configopts.h index 49c64b95..103b91fc 100644 --- a/common/configopts.h +++ b/common/configopts.h @@ -28,9 +28,9 @@ cfg_t * cfg_new(void); char * config_file(void); int config_check(const char *); -Alignment cfg_opt_getnalignment(cfg_opt_t *, unsigned int); -Alignment cfg_getnalignment(cfg_t *, const char *, unsigned int); -Alignment cfg_getalignment(cfg_t *, const char *); +alignment_t cfg_opt_getnalignment(cfg_opt_t *, unsigned int); +alignment_t cfg_getnalignment(cfg_t *, const char *, unsigned int); +alignment_t cfg_getalignment(cfg_t *, const char *); Position cfg_opt_getnposition(cfg_opt_t *, unsigned int); Position cfg_getnposition(cfg_t *, const char *, unsigned int); diff --git a/common/draw.c b/common/draw.c index fa6575db..33b381c1 100644 --- a/common/draw.c +++ b/common/draw.c @@ -225,7 +225,7 @@ draw_font_delete(font_t **font) void draw_text(DrawCtx *ctx, area_t area, - Alignment align, + alignment_t align, int padding, char *text, style_t style) @@ -893,13 +893,13 @@ draw_textwidth(xcb_connection_t *conn, int default_screen, font_t *font, const c return ext.width; } -/** Transform a string to a Alignment type. +/** Transform a string to a alignment_t type. * Recognized string are left, center or right. Everything else will be * recognized as AlignAuto. * \param align string with align text - * \return Alignment type + * \return alignment_t type */ -Alignment +alignment_t draw_align_get_from_str(const char *align) { if(!a_strcmp(align, "left")) diff --git a/common/draw.h b/common/draw.h index c0018535..1352cb6d 100644 --- a/common/draw.h +++ b/common/draw.h @@ -40,7 +40,7 @@ typedef enum AlignCenter, AlignFlex, AlignAuto -} Alignment; +} alignment_t; typedef struct area_t area_t; struct area_t @@ -125,7 +125,7 @@ void draw_context_delete(DrawCtx **); font_t *draw_font_new(xcb_connection_t *, int, char *); void draw_font_delete(font_t **); -void draw_text(DrawCtx *, area_t, Alignment, int, char *, style_t); +void draw_text(DrawCtx *, area_t, alignment_t, int, char *, style_t); void draw_rectangle(DrawCtx *, area_t, float, bool, xcolor_t); void draw_rectangle_gradient(DrawCtx *, area_t, float, bool, area_t, xcolor_t *, xcolor_t *, xcolor_t *); @@ -138,7 +138,7 @@ void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char area_t draw_get_image_size(const char *filename); void draw_rotate(DrawCtx *, xcb_drawable_t, int, int, double, int, int); unsigned short draw_textwidth(xcb_connection_t *, int, font_t *, const char *); -Alignment draw_align_get_from_str(const char *); +alignment_t draw_align_get_from_str(const char *); bool draw_color_new(xcb_connection_t *, int, const char *, xcolor_t *); void draw_style_init(xcb_connection_t *, int, cfg_t *, style_t *, style_t *); diff --git a/structs.h b/structs.h index a1a02661..73fa035a 100644 --- a/structs.h +++ b/structs.h @@ -50,8 +50,8 @@ typedef struct simple_window_t *sw; Position position; Position dposition; - Alignment align; - Alignment text_align; + alignment_t align; + alignment_t text_align; int width, height; /** Colors */ struct @@ -134,7 +134,7 @@ struct Widget /** Statusbar */ Statusbar *statusbar; /** Alignement */ - Alignment alignment; + alignment_t alignment; /** Misc private data */ void *data; /** true if user supplied coords */ diff --git a/widgets/tasklist.c b/widgets/tasklist.c index a482ddad..cc3d6931 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -43,7 +43,7 @@ typedef struct { ShowClient show; bool show_icons; - Alignment align; + alignment_t align; struct { style_t normal; diff --git a/widgets/textbox.c b/widgets/textbox.c index 8f23ed45..65a080a2 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -30,7 +30,7 @@ typedef struct { char *text; int width; - Alignment align; + alignment_t align; style_t style; } Data;