draw: use len param in draw_align_fromstr()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
6ff843e65e
commit
a055634d4e
|
@ -609,8 +609,8 @@ draw_graph(draw_context_t *ctx, area_t rect, int *from, int *to, int cur_index,
|
||||||
cairo_pattern_destroy(pat);
|
cairo_pattern_destroy(pat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a line into a graph-widget
|
/** Draw a line into a graph-widget.
|
||||||
* \param ctx Draw context
|
* \param ctx Draw context.
|
||||||
* \param rect The area to draw into.
|
* \param rect The area to draw into.
|
||||||
* \param to array of offsets to draw the line through...
|
* \param to array of offsets to draw the line through...
|
||||||
* \param cur_index current position in data-array (cycles around)
|
* \param cur_index current position in data-array (cycles around)
|
||||||
|
@ -686,13 +686,13 @@ draw_graph_line(draw_context_t *ctx, area_t rect, int *to, int cur_index,
|
||||||
cairo_set_line_width(ctx->cr, 1.0);
|
cairo_set_line_width(ctx->cr, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a circle
|
/** Draw a circle.
|
||||||
* \param ctx Draw context to draw to
|
* \param ctx Draw context to draw to.
|
||||||
* \param x x coordinate
|
* \param x X coordinate.
|
||||||
* \param y y coordinate
|
* \param y Y coordinate.
|
||||||
* \param r size of the circle
|
* \param r Size of the circle.
|
||||||
* \param filled fill circle?
|
* \param filled Fill circle, or not.
|
||||||
* \param color color to use
|
* \param color Color to use.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_circle(draw_context_t *ctx, int x, int y, int r, bool filled, xcolor_t color)
|
draw_circle(draw_context_t *ctx, int x, int y, int r, bool filled, xcolor_t color)
|
||||||
|
@ -720,13 +720,13 @@ draw_circle(draw_context_t *ctx, int x, int y, int r, bool filled, xcolor_t colo
|
||||||
/** Draw an image from ARGB data to a draw context.
|
/** Draw an image from ARGB data to a draw context.
|
||||||
* Data should be stored as an array of alpha, red, blue, green for each pixel
|
* Data should be stored as an array of alpha, red, blue, green for each pixel
|
||||||
* and the array size should be w * h elements long.
|
* and the array size should be w * h elements long.
|
||||||
* \param ctx Draw context to draw to
|
* \param ctx Draw context to draw to.
|
||||||
* \param x x coordinate
|
* \param x X coordinate.
|
||||||
* \param y y coordinate
|
* \param y Y coordinate.
|
||||||
* \param w width
|
* \param w Width.
|
||||||
* \param h height
|
* \param h Height.
|
||||||
* \param wanted_h wanted height: if > 0, image will be resized
|
* \param wanted_h Wanted height: if > 0, image will be resized.
|
||||||
* \param data the image pixels array
|
* \param data The image pixels array.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_image_from_argb_data(draw_context_t *ctx, int x, int y, int w, int h,
|
draw_image_from_argb_data(draw_context_t *ctx, int x, int y, int w, int h,
|
||||||
|
@ -926,8 +926,8 @@ draw_image_new(const char *filename)
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Delete an image
|
/** Delete an image.
|
||||||
* \param image the image to delete
|
* \param image The image to delete.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_image_delete(draw_image_t **image)
|
draw_image_delete(draw_image_t **image)
|
||||||
|
@ -939,12 +939,12 @@ draw_image_delete(draw_image_t **image)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw an image to a draw context
|
/** Draw an image to a draw context.
|
||||||
* \param ctx Draw context to draw to
|
* \param ctx Draw context to draw to.
|
||||||
* \param x x coordinate
|
* \param x X coordinate.
|
||||||
* \param y y coordinate
|
* \param y Y coordinate.
|
||||||
* \param wanted_h wanted height: if > 0, image will be resized
|
* \param wanted_h Wanted height: if > 0, image will be resized.
|
||||||
* \param image the image to draw
|
* \param image The image to draw.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_image(draw_context_t *ctx, int x, int y, int wanted_h, draw_image_t *image)
|
draw_image(draw_context_t *ctx, int x, int y, int wanted_h, draw_image_t *image)
|
||||||
|
@ -1054,7 +1054,7 @@ draw_text_extents(xcb_connection_t *conn, int phys_screen, font_t *font,
|
||||||
alignment_t
|
alignment_t
|
||||||
draw_align_fromstr(const char *align, ssize_t len)
|
draw_align_fromstr(const char *align, ssize_t len)
|
||||||
{
|
{
|
||||||
switch (a_tokenize(align, -1))
|
switch (a_tokenize(align, len))
|
||||||
{
|
{
|
||||||
case A_TK_LEFT: return AlignLeft;
|
case A_TK_LEFT: return AlignLeft;
|
||||||
case A_TK_CENTER: return AlignCenter;
|
case A_TK_CENTER: return AlignCenter;
|
||||||
|
@ -1066,12 +1066,12 @@ draw_align_fromstr(const char *align, ssize_t len)
|
||||||
|
|
||||||
#define RGB_COLOR_8_TO_16(i) (65535 * ((i) & 0xff) / 255)
|
#define RGB_COLOR_8_TO_16(i) (65535 * ((i) & 0xff) / 255)
|
||||||
|
|
||||||
/** Initialize an X color
|
/** Initialize an X color.
|
||||||
* \param conn Connection ref
|
* \param conn Connection ref.
|
||||||
* \param phys_screen Physical screen number
|
* \param phys_screen Physical screen number.
|
||||||
* \param colstr Color specification
|
* \param colstr Color specification.
|
||||||
* \param color xcolor_t struct to store color to
|
* \param color xcolor_t struct to store color to.
|
||||||
* \return true if color allocation was successfull
|
* \return True if color allocation was successfull.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t *color)
|
xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t *color)
|
||||||
|
@ -1170,8 +1170,8 @@ xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t
|
||||||
|
|
||||||
/** Remove a area from a list of them,
|
/** Remove a area from a list of them,
|
||||||
* spliting the space between several area that can overlap
|
* spliting the space between several area that can overlap
|
||||||
* \param areas array of areas.
|
* \param areas Array of areas.
|
||||||
* \param elem area to remove
|
* \param elem Area to remove.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
area_array_remove(area_array_t *areas, area_t elem)
|
area_array_remove(area_array_t *areas, area_t elem)
|
||||||
|
|
Loading…
Reference in New Issue