From bd18eb20186f6fb0451fa4fdb0102d64eba5b8d5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 11 Apr 2008 11:19:23 +0200 Subject: [PATCH] [util] Change Position type to position_t Signed-off-by: Julien Danjou --- common/configopts.c | 10 +++++----- common/configopts.h | 6 +++--- common/draw.c | 4 ++-- common/draw.h | 4 ++-- common/util.c | 2 +- common/util.h | 4 ++-- layouts/tile.c | 2 +- structs.h | 8 ++++---- titlebar.c | 2 +- titlebar.h | 2 +- widgets/graph.c | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/common/configopts.c b/common/configopts.c index bc859c46..6ef66059 100644 --- a/common/configopts.c +++ b/common/configopts.c @@ -79,7 +79,7 @@ static int cfg_position_parse(cfg_t *cfg, cfg_opt_t *opt, const char *value, void *result) { - Position *p = p_new(Position, 1); + position_t *p = p_new(position_t, 1); if((*p = position_get_from_str(value)) == Off && a_strcmp(value, "off")) @@ -137,19 +137,19 @@ cfg_getalignment(cfg_t *cfg, const char *name) return cfg_getnalignment(cfg, name, 0); } -Position +position_t cfg_opt_getnposition(cfg_opt_t *opt, unsigned int oindex) { - return * (Position *) cfg_opt_getnptr(opt, oindex); + return * (position_t *) cfg_opt_getnptr(opt, oindex); } -Position +position_t cfg_getnposition(cfg_t *cfg, const char *name, unsigned int oindex) { return cfg_opt_getnposition(cfg_getopt(cfg, name), oindex); } -Position +position_t cfg_getposition(cfg_t *cfg, const char *name) { return cfg_getnposition(cfg, name, 0); diff --git a/common/configopts.h b/common/configopts.h index 103b91fc..75055f58 100644 --- a/common/configopts.h +++ b/common/configopts.h @@ -32,9 +32,9 @@ 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); -Position cfg_getposition(cfg_t *, const char *); +position_t cfg_opt_getnposition(cfg_opt_t *, unsigned int); +position_t cfg_getnposition(cfg_t *, const char *, unsigned int); +position_t cfg_getposition(cfg_t *, const char *); #endif diff --git a/common/draw.c b/common/draw.c index 33b381c1..c93d53f8 100644 --- a/common/draw.c +++ b/common/draw.c @@ -456,7 +456,7 @@ draw_graph_setup(DrawCtx *ctx) */ void draw_graph(DrawCtx *ctx, area_t rect, int *from, int *to, int cur_index, - Position grow, area_t patt_rect, + position_t grow, area_t patt_rect, xcolor_t *pcolor, xcolor_t *pcolor_center, xcolor_t *pcolor_end) { int i, y, w; @@ -516,7 +516,7 @@ draw_graph(DrawCtx *ctx, area_t rect, int *from, int *to, int cur_index, */ void draw_graph_line(DrawCtx *ctx, area_t rect, int *to, int cur_index, - Position grow, area_t patt_rect, + position_t grow, area_t patt_rect, xcolor_t *pcolor, xcolor_t *pcolor_center, xcolor_t *pcolor_end) { int i, w; diff --git a/common/draw.h b/common/draw.h index 1352cb6d..34acb93f 100644 --- a/common/draw.h +++ b/common/draw.h @@ -130,8 +130,8 @@ 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 *); void draw_graph_setup(DrawCtx *); -void draw_graph(DrawCtx *, area_t, int *, int *, int, Position, area_t, xcolor_t *, xcolor_t *, xcolor_t *); -void draw_graph_line(DrawCtx *, area_t, int *, int, Position, area_t, xcolor_t *, xcolor_t *, xcolor_t *); +void draw_graph(DrawCtx *, area_t, int *, int *, int, position_t, area_t, xcolor_t *, xcolor_t *, xcolor_t *); +void draw_graph_line(DrawCtx *, area_t, int *, int, position_t, area_t, xcolor_t *, xcolor_t *, xcolor_t *); void draw_circle(DrawCtx *, int, int, int, bool, xcolor_t); void draw_image(DrawCtx *, int, int, int, const char *); void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *); diff --git a/common/util.c b/common/util.c index d16fc0b0..8fcbe1a9 100644 --- a/common/util.c +++ b/common/util.c @@ -96,7 +96,7 @@ name_func_lookup(const char *funcname, const name_func_link_t *list) return NULL; } -Position +position_t position_get_from_str(const char *pos) { if(!a_strcmp(pos, "top")) diff --git a/common/util.h b/common/util.h index cc964ecb..8645cf9e 100644 --- a/common/util.h +++ b/common/util.h @@ -36,7 +36,7 @@ typedef enum Right, Left, Auto -} Position; +} position_t; /** Fuzzy logic */ typedef enum @@ -260,7 +260,7 @@ void _eprint(int, const char *, const char *, ...) void _warn(int, const char *, const char *, ...) __attribute__ ((format(printf, 3, 4))); -Position position_get_from_str(const char *); +position_t position_get_from_str(const char *); Fuzzy fuzzy_get_from_str(const char *); double compute_new_value_from_arg(const char *, double); void *name_func_lookup(const char *, const name_func_link_t *); diff --git a/layouts/tile.c b/layouts/tile.c index 15984b3e..99d1d807 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -125,7 +125,7 @@ uicb_tag_setmwfact(int screen, char *arg) } static void -_tile(int screen, const Position position) +_tile(int screen, const position_t position) { /* windows area geometry */ int wah = 0, waw = 0, wax = 0, way = 0; diff --git a/structs.h b/structs.h index 73fa035a..a787bf37 100644 --- a/structs.h +++ b/structs.h @@ -48,8 +48,8 @@ enum typedef struct { simple_window_t *sw; - Position position; - Position dposition; + position_t position; + position_t dposition; alignment_t align; alignment_t text_align; int width, height; @@ -166,9 +166,9 @@ struct Statusbar /** Bar height */ int height; /** Default position */ - Position dposition; + position_t dposition; /** Bar position */ - Position position; + position_t position; /** Screen */ int screen; /** Physical screen id */ diff --git a/titlebar.c b/titlebar.c index 9114d41e..55540a61 100644 --- a/titlebar.c +++ b/titlebar.c @@ -449,7 +449,7 @@ titlebar_update_geometry(Client *c, area_t geometry) } void -titlebar_position_set(titlebar_t *t, Position p) +titlebar_position_set(titlebar_t *t, position_t p) { if(!t->sw) return; diff --git a/titlebar.h b/titlebar.h index 98d31e89..11414bc7 100644 --- a/titlebar.h +++ b/titlebar.h @@ -30,7 +30,7 @@ void titlebar_update_geometry_floating(Client *); void titlebar_update_geometry(Client *, area_t); area_t titlebar_geometry_add(titlebar_t *, area_t); area_t titlebar_geometry_remove(titlebar_t *, area_t); -void titlebar_position_set(titlebar_t *, Position); +void titlebar_position_set(titlebar_t *, position_t); Uicb uicb_client_toggletitlebar; diff --git a/widgets/graph.c b/widgets/graph.c index e1839b59..a50b9879 100644 --- a/widgets/graph.c +++ b/widgets/graph.c @@ -41,7 +41,7 @@ typedef struct int size; /** Size of lines-array (also innerbox-lenght) */ xcolor_t bg; /** Background color */ xcolor_t bordercolor; /** Border color */ - Position grow; /** grow: Left or Right */ + position_t grow; /** grow: Left or Right */ /* markers... */ int *index; /** Index of current (new) value */