[util] Change Position type to position_t

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-11 11:19:23 +02:00
parent df7db5e86b
commit bd18eb2018
11 changed files with 23 additions and 23 deletions

View File

@ -79,7 +79,7 @@ static int
cfg_position_parse(cfg_t *cfg, cfg_opt_t *opt, cfg_position_parse(cfg_t *cfg, cfg_opt_t *opt,
const char *value, void *result) 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 if((*p = position_get_from_str(value)) == Off
&& a_strcmp(value, "off")) && a_strcmp(value, "off"))
@ -137,19 +137,19 @@ cfg_getalignment(cfg_t *cfg, const char *name)
return cfg_getnalignment(cfg, name, 0); return cfg_getnalignment(cfg, name, 0);
} }
Position position_t
cfg_opt_getnposition(cfg_opt_t *opt, unsigned int oindex) 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) cfg_getnposition(cfg_t *cfg, const char *name, unsigned int oindex)
{ {
return cfg_opt_getnposition(cfg_getopt(cfg, name), oindex); return cfg_opt_getnposition(cfg_getopt(cfg, name), oindex);
} }
Position position_t
cfg_getposition(cfg_t *cfg, const char *name) cfg_getposition(cfg_t *cfg, const char *name)
{ {
return cfg_getnposition(cfg, name, 0); return cfg_getnposition(cfg, name, 0);

View File

@ -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_getnalignment(cfg_t *, const char *, unsigned int);
alignment_t cfg_getalignment(cfg_t *, const char *); alignment_t cfg_getalignment(cfg_t *, const char *);
Position cfg_opt_getnposition(cfg_opt_t *, unsigned int); position_t cfg_opt_getnposition(cfg_opt_t *, unsigned int);
Position cfg_getnposition(cfg_t *, const char *, unsigned int); position_t cfg_getnposition(cfg_t *, const char *, unsigned int);
Position cfg_getposition(cfg_t *, const char *); position_t cfg_getposition(cfg_t *, const char *);
#endif #endif

View File

@ -456,7 +456,7 @@ draw_graph_setup(DrawCtx *ctx)
*/ */
void void
draw_graph(DrawCtx *ctx, area_t rect, int *from, int *to, int cur_index, 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) xcolor_t *pcolor, xcolor_t *pcolor_center, xcolor_t *pcolor_end)
{ {
int i, y, w; int i, y, w;
@ -516,7 +516,7 @@ draw_graph(DrawCtx *ctx, area_t rect, int *from, int *to, int cur_index,
*/ */
void void
draw_graph_line(DrawCtx *ctx, area_t rect, int *to, int cur_index, 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) xcolor_t *pcolor, xcolor_t *pcolor_center, xcolor_t *pcolor_end)
{ {
int i, w; int i, w;

View File

@ -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_rectangle_gradient(DrawCtx *, area_t, float, bool, area_t, xcolor_t *, xcolor_t *, xcolor_t *);
void draw_graph_setup(DrawCtx *); 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(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, 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_circle(DrawCtx *, int, int, int, bool, xcolor_t);
void draw_image(DrawCtx *, int, int, int, const char *); void draw_image(DrawCtx *, int, int, int, const char *);
void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *); void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *);

View File

@ -96,7 +96,7 @@ name_func_lookup(const char *funcname, const name_func_link_t *list)
return NULL; return NULL;
} }
Position position_t
position_get_from_str(const char *pos) position_get_from_str(const char *pos)
{ {
if(!a_strcmp(pos, "top")) if(!a_strcmp(pos, "top"))

View File

@ -36,7 +36,7 @@ typedef enum
Right, Right,
Left, Left,
Auto Auto
} Position; } position_t;
/** Fuzzy logic */ /** Fuzzy logic */
typedef enum typedef enum
@ -260,7 +260,7 @@ void _eprint(int, const char *, const char *, ...)
void _warn(int, const char *, const char *, ...) void _warn(int, const char *, const char *, ...)
__attribute__ ((format(printf, 3, 4))); __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 *); Fuzzy fuzzy_get_from_str(const char *);
double compute_new_value_from_arg(const char *, double); double compute_new_value_from_arg(const char *, double);
void *name_func_lookup(const char *, const name_func_link_t *); void *name_func_lookup(const char *, const name_func_link_t *);

View File

@ -125,7 +125,7 @@ uicb_tag_setmwfact(int screen, char *arg)
} }
static void static void
_tile(int screen, const Position position) _tile(int screen, const position_t position)
{ {
/* windows area geometry */ /* windows area geometry */
int wah = 0, waw = 0, wax = 0, way = 0; int wah = 0, waw = 0, wax = 0, way = 0;

View File

@ -48,8 +48,8 @@ enum
typedef struct typedef struct
{ {
simple_window_t *sw; simple_window_t *sw;
Position position; position_t position;
Position dposition; position_t dposition;
alignment_t align; alignment_t align;
alignment_t text_align; alignment_t text_align;
int width, height; int width, height;
@ -166,9 +166,9 @@ struct Statusbar
/** Bar height */ /** Bar height */
int height; int height;
/** Default position */ /** Default position */
Position dposition; position_t dposition;
/** Bar position */ /** Bar position */
Position position; position_t position;
/** Screen */ /** Screen */
int screen; int screen;
/** Physical screen id */ /** Physical screen id */

View File

@ -449,7 +449,7 @@ titlebar_update_geometry(Client *c, area_t geometry)
} }
void void
titlebar_position_set(titlebar_t *t, Position p) titlebar_position_set(titlebar_t *t, position_t p)
{ {
if(!t->sw) if(!t->sw)
return; return;

View File

@ -30,7 +30,7 @@ void titlebar_update_geometry_floating(Client *);
void titlebar_update_geometry(Client *, area_t); void titlebar_update_geometry(Client *, area_t);
area_t titlebar_geometry_add(titlebar_t *, area_t); area_t titlebar_geometry_add(titlebar_t *, area_t);
area_t titlebar_geometry_remove(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; Uicb uicb_client_toggletitlebar;

View File

@ -41,7 +41,7 @@ typedef struct
int size; /** Size of lines-array (also innerbox-lenght) */ int size; /** Size of lines-array (also innerbox-lenght) */
xcolor_t bg; /** Background color */ xcolor_t bg; /** Background color */
xcolor_t bordercolor; /** Border color */ xcolor_t bordercolor; /** Border color */
Position grow; /** grow: Left or Right */ position_t grow; /** grow: Left or Right */
/* markers... */ /* markers... */
int *index; /** Index of current (new) value */ int *index; /** Index of current (new) value */