diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2009-07-05 20:10:17 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2009-07-05 20:10:17 +0000 |
commit | 0ade453958339a28b4291aefd6fd0bd2e5038afd (patch) | |
tree | 5a6be53fef4f3790f5902d8ac574c6ef725b29bb /desktop/plotters.h | |
parent | ab2391ade1592936b95b106d17a77ff09ba852a8 (diff) | |
download | netsurf-0ade453958339a28b4291aefd6fd0bd2e5038afd.tar.gz netsurf-0ade453958339a28b4291aefd6fd0bd2e5038afd.tar.bz2 |
Refactor fill plotter to take a style
svn path=/trunk/netsurf/; revision=8332
Diffstat (limited to 'desktop/plotters.h')
-rw-r--r-- | desktop/plotters.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/desktop/plotters.h b/desktop/plotters.h index 8a7183f89..d634f2135 100644 --- a/desktop/plotters.h +++ b/desktop/plotters.h @@ -35,6 +35,27 @@ typedef unsigned long bitmap_flags_t; #define BITMAPF_REPEAT_X 1 #define BITMAPF_REPEAT_Y 2 +typedef enum { + PLOT_OP_TYPE_NONE = 0, /**< No operation */ + PLOT_OP_TYPE_SOLID, /**< Solid colour */ + PLOT_OP_TYPE_DOT, /**< Doted plot */ + PLOT_OP_TYPE_DASH, /**< dashed plot */ +} plot_operation_type_t; + + +typedef struct { + plot_operation_type_t stroke_type; + int stroke_width; + colour stroke_colour; + plot_operation_type_t fill_type; + colour fill_colour; +} plot_style_t; + +/* global styles */ +extern plot_style_t *plot_style_fill_white; +extern plot_style_t *plot_style_fill_red; +extern plot_style_t *plot_style_fill_black; + /** Set of target specific plotting functions. * * The functions are: @@ -99,7 +120,7 @@ struct plotter_table { bool (*line)(int x0, int y0, int x1, int y1, int width, colour c, bool dotted, bool dashed); bool (*polygon)(const int *p, unsigned int n, colour fill); - bool (*fill)(int x0, int y0, int x1, int y1, colour c); + bool (*fill)(int x0, int y0, int x1, int y1, plot_style_t *style); bool (*clip)(int x0, int y0, int x1, int y1); bool (*text)(int x, int y, const struct css_style *style, const char *text, size_t length, colour bg, colour c); |