From 642f1275567a6b16bb900ae3416b6b6b7abf3bc8 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sun, 11 Apr 2010 16:09:18 +0200 Subject: [PATCH] [AdgDress] Splitted table line style for grid and frame Use different builtin line dresses for frame lines (the one around the whole table) and grid lines (the ones around table cells). --- src/adg/adg-dress-builtins.c | 36 ++++++++++++++++++++++++++++++++---- src/adg/adg-dress-builtins.h | 6 ++++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/adg/adg-dress-builtins.c b/src/adg/adg-dress-builtins.c index 1e8bfb7d..4b6b1cf9 100644 --- a/src/adg/adg-dress-builtins.c +++ b/src/adg/adg-dress-builtins.c @@ -293,16 +293,17 @@ _adg_dress_line_hatch(void) } /** - * ADG_DRESS_LINE_TABLE: + * ADG_DRESS_LINE_GRID: * - * The builtin #AdgDress line type used for rendering #AdgTable. + * The builtin #AdgDress line type used for rendering the grid + * of #AdgTable entities, that is the frame of the cells. * The fallback style is a line with a thickness of %1 and a * pass-through color dress, rendered without antialiasing. * * This dress will be resolved to an #AdgLineStyle instance. **/ AdgDress -_adg_dress_line_table(void) +_adg_dress_line_grid(void) { static AdgDress dress = 0; @@ -311,7 +312,34 @@ _adg_dress_line_table(void) "antialias", CAIRO_ANTIALIAS_NONE, "width", 1., NULL); - dress = adg_dress_new("line-table", fallback); + dress = adg_dress_new("line-grid", fallback); + g_object_unref(fallback); + } + + return dress; +} + +/** + * ADG_DRESS_LINE_FRAME: + * + * The builtin #AdgDress line type used for rendering the frame + * of #AdgTable entities, that is the frame around the whole table. + * The fallback style is a line with a thickness of %2 and a + * pass-through color dress, rendered without antialiasing. + * + * This dress will be resolved to an #AdgLineStyle instance. + **/ +AdgDress +_adg_dress_line_frame(void) +{ + static AdgDress dress = 0; + + if (G_UNLIKELY(dress == 0)) { + AdgStyle *fallback = g_object_new(ADG_TYPE_LINE_STYLE, + "antialias", CAIRO_ANTIALIAS_NONE, + "width", 2., NULL); + + dress = adg_dress_new("line-frame", fallback); g_object_unref(fallback); } diff --git a/src/adg/adg-dress-builtins.h b/src/adg/adg-dress-builtins.h index 5a2c7bea..33611161 100644 --- a/src/adg/adg-dress-builtins.h +++ b/src/adg/adg-dress-builtins.h @@ -42,7 +42,8 @@ G_BEGIN_DECLS #define ADG_DRESS_LINE_STROKE (_adg_dress_line_stroke()) #define ADG_DRESS_LINE_DIMENSION (_adg_dress_line_dimension()) #define ADG_DRESS_LINE_HATCH (_adg_dress_line_hatch()) -#define ADG_DRESS_LINE_TABLE (_adg_dress_line_table()) +#define ADG_DRESS_LINE_GRID (_adg_dress_line_grid()) +#define ADG_DRESS_LINE_FRAME (_adg_dress_line_frame()) #define ADG_DRESS_TEXT (_adg_dress_text()) #define ADG_DRESS_TEXT_VALUE (_adg_dress_text_value()) #define ADG_DRESS_TEXT_LIMIT (_adg_dress_text_limit()) @@ -62,7 +63,8 @@ AdgDress _adg_dress_line (void) G_GNUC_CONST; AdgDress _adg_dress_line_stroke (void) G_GNUC_CONST; AdgDress _adg_dress_line_dimension (void) G_GNUC_CONST; AdgDress _adg_dress_line_hatch (void) G_GNUC_CONST; -AdgDress _adg_dress_line_table (void) G_GNUC_CONST; +AdgDress _adg_dress_line_grid (void) G_GNUC_CONST; +AdgDress _adg_dress_line_frame (void) G_GNUC_CONST; AdgDress _adg_dress_text (void) G_GNUC_CONST; AdgDress _adg_dress_text_value (void) G_GNUC_CONST; AdgDress _adg_dress_text_limit (void) G_GNUC_CONST; -- 2.11.4.GIT