Compilation: clean up dialog including.
[gnumeric.git] / src / style-border.h
blob367669ec93fd788d7ad02beebb9091dc69352037
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_STYLE_BORDER_H_
3 # define _GNM_STYLE_BORDER_H_
5 #include "gnumeric.h"
6 #include <gdk/gdk.h>
8 G_BEGIN_DECLS
10 typedef enum {
11 GNM_STYLE_BORDER_HORIZONTAL,
12 GNM_STYLE_BORDER_VERTICAL,
13 GNM_STYLE_BORDER_DIAGONAL
14 } GnmStyleBorderOrientation;
16 typedef enum {
17 GNM_STYLE_BORDER_NONE = 0x0,
18 GNM_STYLE_BORDER_THIN = 0x1,
19 GNM_STYLE_BORDER_MEDIUM = 0x2,
20 GNM_STYLE_BORDER_DASHED = 0x3,
21 GNM_STYLE_BORDER_DOTTED = 0x4,
22 GNM_STYLE_BORDER_THICK = 0x5,
23 GNM_STYLE_BORDER_DOUBLE = 0x6,
24 GNM_STYLE_BORDER_HAIR = 0x7,
25 GNM_STYLE_BORDER_MEDIUM_DASH = 0x8,
26 GNM_STYLE_BORDER_DASH_DOT = 0x9,
27 GNM_STYLE_BORDER_MEDIUM_DASH_DOT = 0xa,
28 GNM_STYLE_BORDER_DASH_DOT_DOT = 0xb,
29 GNM_STYLE_BORDER_MEDIUM_DASH_DOT_DOT = 0xc,
30 GNM_STYLE_BORDER_SLANTED_DASH_DOT = 0xd,
32 /* ONLY for internal use */
33 GNM_STYLE_BORDER_INCONSISTENT = 0xe,
35 GNM_STYLE_BORDER_MAX
36 } GnmStyleBorderType;
38 /* The order corresponds to the border_buttons name list
39 * in dialog_cell_format_impl
40 * GNM_STYLE_BORDER_TOP must be 0 */
41 typedef enum {
42 GNM_STYLE_BORDER_TOP, GNM_STYLE_BORDER_BOTTOM,
43 GNM_STYLE_BORDER_LEFT, GNM_STYLE_BORDER_RIGHT,
44 GNM_STYLE_BORDER_REV_DIAG, GNM_STYLE_BORDER_DIAG,
46 /* These are special.
47 * They are logical rather than actual borders, however, they
48 * require extra lines to be drawn so they need to be here.
50 GNM_STYLE_BORDER_HORIZ, GNM_STYLE_BORDER_VERT,
52 GNM_STYLE_BORDER_EDGE_MAX
53 } GnmStyleBorderLocation;
55 #define GNM_STYLE_BORDER_LOCATION_TO_STYLE_ELEMENT(sbl) ((GnmStyleElement)(MSTYLE_BORDER_TOP + (int)((sbl) - GNM_STYLE_BORDER_TOP)))
57 struct _GnmBorder {
58 /* Key elements */
59 GnmStyleBorderType line_type;
60 GnmColor *color;
61 int begin_margin, end_margin, width;
63 /* Private */
64 gint ref_count;
67 void gnm_border_shutdown (void);
68 GType gnm_border_get_type (void);
69 void gnm_style_border_unref (GnmBorder *border);
70 GnmBorder *gnm_style_border_ref (GnmBorder *border);
72 #define gnm_style_border_is_blank(b) ((b) == NULL || (b)->line_type == GNM_STYLE_BORDER_NONE)
73 GnmBorder *gnm_style_border_none (void);
74 void gnm_style_border_none_set_color (GnmColor *color);
76 GnmBorder *gnm_style_border_fetch (GnmStyleBorderType line_type,
77 GnmColor *color,
78 GnmStyleBorderOrientation orientation);
79 gboolean gnm_style_border_visible_in_blank (GnmBorder const *border);
81 GnmStyleBorderOrientation gnm_style_border_get_orientation (GnmStyleBorderLocation type);
83 gint gnm_style_border_get_width (GnmStyleBorderType const line_type);
84 void gnm_style_border_set_dash (GnmStyleBorderType const i, cairo_t *context);
86 void gnm_style_borders_row_draw (GnmBorder const * const * prev_vert,
87 GnmStyleRow const *sr,
88 cairo_t *cr,
89 int x, int y1, int y2,
90 int *colwidths,
91 gboolean draw_vertical, int dir);
92 void gnm_style_border_draw_diag (GnmStyle const *style,
93 cairo_t *cr,
94 int x1, int y1, int x2, int y2);
96 void gnm_style_borders_row_print_gtk (GnmBorder const * const * prev_vert,
97 GnmStyleRow const *sr,
98 cairo_t *context,
99 double x, double y1, double y2,
100 Sheet const *sheet,
101 gboolean draw_vertical, int dir);
102 void gnm_style_border_print_diag_gtk (GnmStyle const *style,
103 cairo_t *context,
104 double x1, double y1,
105 double x2, double y2);
107 G_END_DECLS
109 #endif /* _GNM_STYLE_BORDER_H_ */