1 #ifndef _GNM_STYLE_BORDER_H_
2 # define _GNM_STYLE_BORDER_H_
10 GNM_STYLE_BORDER_HORIZONTAL
,
11 GNM_STYLE_BORDER_VERTICAL
,
12 GNM_STYLE_BORDER_DIAGONAL
13 } GnmStyleBorderOrientation
;
16 GNM_STYLE_BORDER_NONE
= 0x0,
17 GNM_STYLE_BORDER_THIN
= 0x1,
18 GNM_STYLE_BORDER_MEDIUM
= 0x2,
19 GNM_STYLE_BORDER_DASHED
= 0x3,
20 GNM_STYLE_BORDER_DOTTED
= 0x4,
21 GNM_STYLE_BORDER_THICK
= 0x5,
22 GNM_STYLE_BORDER_DOUBLE
= 0x6,
23 GNM_STYLE_BORDER_HAIR
= 0x7,
24 GNM_STYLE_BORDER_MEDIUM_DASH
= 0x8,
25 GNM_STYLE_BORDER_DASH_DOT
= 0x9,
26 GNM_STYLE_BORDER_MEDIUM_DASH_DOT
= 0xa,
27 GNM_STYLE_BORDER_DASH_DOT_DOT
= 0xb,
28 GNM_STYLE_BORDER_MEDIUM_DASH_DOT_DOT
= 0xc,
29 GNM_STYLE_BORDER_SLANTED_DASH_DOT
= 0xd,
31 /* ONLY for internal use */
32 GNM_STYLE_BORDER_INCONSISTENT
= 0xe,
37 /* The order corresponds to the border_buttons name list
38 * in dialog_cell_format_impl
39 * GNM_STYLE_BORDER_TOP must be 0 */
41 GNM_STYLE_BORDER_TOP
, GNM_STYLE_BORDER_BOTTOM
,
42 GNM_STYLE_BORDER_LEFT
, GNM_STYLE_BORDER_RIGHT
,
43 GNM_STYLE_BORDER_REV_DIAG
, GNM_STYLE_BORDER_DIAG
,
46 * They are logical rather than actual borders, however, they
47 * require extra lines to be drawn so they need to be here.
49 GNM_STYLE_BORDER_HORIZ
, GNM_STYLE_BORDER_VERT
,
51 GNM_STYLE_BORDER_EDGE_MAX
52 } GnmStyleBorderLocation
;
54 #define GNM_STYLE_BORDER_LOCATION_TO_STYLE_ELEMENT(sbl) ((GnmStyleElement)(MSTYLE_BORDER_TOP + (int)((sbl) - GNM_STYLE_BORDER_TOP)))
58 GnmStyleBorderType line_type
;
60 int begin_margin
, end_margin
, width
;
66 void gnm_border_shutdown (void);
67 GType
gnm_border_get_type (void);
68 void gnm_style_border_unref (GnmBorder
*border
);
69 GnmBorder
*gnm_style_border_ref (GnmBorder
*border
);
71 #define gnm_style_border_is_blank(b) ((b) == NULL || (b)->line_type == GNM_STYLE_BORDER_NONE)
72 GnmBorder
*gnm_style_border_none (void);
73 void gnm_style_border_none_set_color (GnmColor
*color
);
75 GnmBorder
*gnm_style_border_fetch (GnmStyleBorderType line_type
,
77 GnmStyleBorderOrientation orientation
);
78 gboolean
gnm_style_border_visible_in_blank (GnmBorder
const *border
);
80 GnmStyleBorderOrientation
gnm_style_border_get_orientation (GnmStyleBorderLocation type
);
82 gint
gnm_style_border_get_width (GnmStyleBorderType
const line_type
);
83 void gnm_style_border_set_dash (GnmStyleBorderType
const i
, cairo_t
*context
);
85 void gnm_style_borders_row_draw (GnmBorder
const * const * prev_vert
,
86 GnmStyleRow
const *sr
,
88 int x
, int y1
, int y2
,
90 gboolean draw_vertical
, int dir
);
91 void gnm_style_border_draw_diag (GnmStyle
const *style
,
93 int x1
, int y1
, int x2
, int y2
);
95 void gnm_style_borders_row_print_gtk (GnmBorder
const * const * prev_vert
,
96 GnmStyleRow
const *sr
,
98 double x
, double y1
, double y2
,
100 gboolean draw_vertical
, int dir
);
101 void gnm_style_border_print_diag_gtk (GnmStyle
const *style
,
103 double x1
, double y1
,
104 double x2
, double y2
);
108 #endif /* _GNM_STYLE_BORDER_H_ */