X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftable-provider.h;h=9a790612287033a2db29fcfe269d62a6b54ae36c;hb=66a8687fbbe219b8c5b8d4dcd7aa2249fd55f5cf;hp=a511e13bd5c95439dc0504b91abb64f414e7aedf;hpb=0b676d85cb983fa0e719de9300935d2c8b549b14;p=pspp diff --git a/src/output/table-provider.h b/src/output/table-provider.h index a511e13bd5..9a79061228 100644 --- a/src/output/table-provider.h +++ b/src/output/table-provider.h @@ -17,6 +17,7 @@ #ifndef OUTPUT_TABLE_PROVIDER #define OUTPUT_TABLE_PROVIDER 1 +#include #include "output/table.h" struct string; @@ -42,6 +43,26 @@ struct cell_contents void cell_contents_format_footnote_markers (const struct cell_contents *, struct string *); +struct cell_color + { + uint8_t r, g, b; + }; + +#define CELL_COLOR(r, g, b) (struct cell_color) { r, g, b } +#define CELL_COLOR_BLACK CELL_COLOR (0, 0, 0) +#define CELL_COLOR_WHITE CELL_COLOR (255, 255, 255) + +static inline bool +cell_color_equal (const struct cell_color *a, const struct cell_color *b) +{ + return a->r == b->r && a->g == b->g && a->b == b->b; +} + +struct cell_style + { + struct cell_color fg, bg; + }; + /* A cell in a table. */ struct table_cell { @@ -75,6 +96,8 @@ struct table_cell size_t n_contents; struct cell_contents inline_contents; + const struct cell_style *style; + /* Called to free the cell's data, if nonnull. */ void (*destructor) (void *destructor_aux); void *destructor_aux;