draw: add draw_align_tostr()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
677d815a03
commit
48111308a0
|
@ -1066,6 +1066,24 @@ draw_align_fromstr(const char *align, ssize_t len)
|
|||
}
|
||||
}
|
||||
|
||||
/** Transform an alignment to a string.
|
||||
* \param a The alignment.
|
||||
* \return A string which must not be freed.
|
||||
*/
|
||||
const char *
|
||||
draw_align_tostr(alignment_t a)
|
||||
{
|
||||
switch(a)
|
||||
{
|
||||
case AlignLeft: return "left";
|
||||
case AlignCenter: return "center";
|
||||
case AlignRight: return "right";
|
||||
case AlignFlex: return "flex";
|
||||
case AlignAuto: return "auto";
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#define RGB_COLOR_8_TO_16(i) (65535 * ((i) & 0xff) / 255)
|
||||
|
||||
/** Initialize an X color.
|
||||
|
|
|
@ -197,6 +197,7 @@ void draw_image_from_argb_data(draw_context_t *, int, int, int, int, int, unsign
|
|||
void draw_rotate(draw_context_t *, xcb_drawable_t, xcb_drawable_t, int, int, int, int, double, int, int);
|
||||
area_t draw_text_extents(xcb_connection_t *, int, font_t *, const char *, draw_parser_data_t *);
|
||||
alignment_t draw_align_fromstr(const char *, ssize_t);
|
||||
const char *draw_align_tostr(alignment_t);
|
||||
|
||||
/** Wipe a color resources.
|
||||
* \param color The color to wipe out.
|
||||
|
|
Loading…
Reference in New Issue