6559f3c16cd3125f24bed908468efc838b100b5d
[ardour.git] / libs / clearlooks-newer / clearlooks_types.h
1 #ifndef CLEARLOOKS_TYPES_H
2 #define CLEARLOOKS_TYPES_H
3
4 #include <ge-support.h>
5
6 typedef unsigned char boolean;
7 typedef unsigned char uint8;
8 typedef struct _ClearlooksStyleFunctions ClearlooksStyleFunctions;
9
10 typedef enum
11 {
12         CL_STYLE_CLASSIC = 0,
13         CL_STYLE_GLOSSY = 1,
14         CL_STYLE_INVERTED = 2,
15         CL_STYLE_GUMMY = 3,
16         CL_NUM_STYLES = 4
17 } ClearlooksStyles;
18
19
20 typedef enum
21 {
22         CL_STATE_NORMAL,
23         CL_STATE_ACTIVE,
24         CL_STATE_SELECTED,
25         CL_STATE_INSENSITIVE
26 } ClearlooksStateType;
27
28 typedef enum
29 {
30         CL_JUNCTION_NONE      = 0,
31         CL_JUNCTION_BEGIN     = 1,
32         CL_JUNCTION_END       = 2
33 } ClearlooksJunction;
34
35 typedef enum
36 {
37         CL_STEPPER_UNKNOWN    = 0,
38         CL_STEPPER_A          = 1,
39         CL_STEPPER_B          = 2,
40         CL_STEPPER_C          = 4,
41         CL_STEPPER_D          = 8
42 } ClearlooksStepper;
43
44 typedef enum
45 {
46         CL_ORDER_FIRST,
47         CL_ORDER_MIDDLE,
48         CL_ORDER_LAST
49 } ClearlooksOrder;
50
51 typedef enum
52 {
53         CL_ORIENTATION_LEFT_TO_RIGHT,
54         CL_ORIENTATION_RIGHT_TO_LEFT,
55         CL_ORIENTATION_BOTTOM_TO_TOP,
56         CL_ORIENTATION_TOP_TO_BOTTOM
57 } ClearlooksOrientation;
58
59 typedef enum
60 {
61         CL_GAP_LEFT,
62         CL_GAP_RIGHT,
63         CL_GAP_TOP,
64         CL_GAP_BOTTOM
65 } ClearlooksGapSide;
66
67 typedef enum
68 {
69         CL_SHADOW_NONE,
70         CL_SHADOW_IN,
71         CL_SHADOW_OUT,
72         CL_SHADOW_ETCHED_IN,
73         CL_SHADOW_ETCHED_OUT
74 } ClearlooksShadowType;
75
76 typedef enum
77 {
78         CL_HANDLE_TOOLBAR,
79         CL_HANDLE_SPLITTER
80 } ClearlooksHandleType;
81
82 typedef enum
83 {
84         CL_ARROW_NORMAL,
85         CL_ARROW_COMBO
86 } ClearlooksArrowType;
87
88 typedef enum
89 {
90         CL_DIRECTION_UP,
91         CL_DIRECTION_DOWN,
92         CL_DIRECTION_LEFT,
93         CL_DIRECTION_RIGHT
94 } ClearlooksDirection;
95
96 typedef enum
97 {
98         CL_PROGRESSBAR_CONTINUOUS,
99         CL_PROGRESSBAR_DISCRETE
100 } ClearlooksProgressBarStyle;
101
102 typedef enum
103 {
104         CL_WINDOW_EDGE_NORTH_WEST,
105         CL_WINDOW_EDGE_NORTH,
106         CL_WINDOW_EDGE_NORTH_EAST,
107         CL_WINDOW_EDGE_WEST,
108         CL_WINDOW_EDGE_EAST,
109         CL_WINDOW_EDGE_SOUTH_WEST,
110         CL_WINDOW_EDGE_SOUTH,
111         CL_WINDOW_EDGE_SOUTH_EAST
112 } ClearlooksWindowEdge;
113
114 typedef struct
115 {
116         double x;
117         double y;
118         double width;
119         double height;
120 } ClearlooksRectangle;
121
122 typedef struct
123 {
124         CairoColor fg[5];
125         CairoColor bg[5];
126         CairoColor base[5];
127         CairoColor text[5];
128         
129         CairoColor shade[9];
130         CairoColor spot[3];
131 } ClearlooksColors;
132
133 typedef struct
134 {
135         boolean active;
136         boolean prelight;
137         boolean disabled;
138         boolean focus;
139         boolean is_default;
140         boolean ltr;
141         boolean enable_glow;
142
143         gfloat  radius;
144         
145         ClearlooksStateType state_type;
146         
147         uint8 corners;
148         uint8 xthickness;
149         uint8 ythickness;
150
151         CairoColor parentbg;
152
153         ClearlooksStyleFunctions *style_functions;
154 } WidgetParameters;
155
156 typedef struct
157 {
158         boolean lower;
159         boolean horizontal;
160         boolean fill_level;
161 } SliderParameters;
162
163 typedef struct
164 {
165         ClearlooksOrientation orientation;
166         boolean pulsing;
167         float value;
168 } ProgressBarParameters;
169
170 typedef struct
171 {
172         int linepos;
173 } OptionMenuParameters;
174
175 typedef struct
176 {
177         ClearlooksShadowType shadow;
178         ClearlooksGapSide gap_side;
179         int gap_x;
180         int gap_width;
181         const CairoColor *border; /* maybe changes this to some other hint ... */
182 } FrameParameters;
183
184 typedef struct
185 {
186         ClearlooksGapSide gap_side;
187 } TabParameters;
188
189 typedef struct
190 {
191         CairoCorners    corners;
192         ClearlooksShadowType shadow;    
193 } ShadowParameters;
194
195 typedef struct
196 {
197         boolean horizontal;
198 } SeparatorParameters;
199
200 typedef struct
201 {
202         ClearlooksOrder order; /* XXX: rename to position */
203         boolean         resizable;
204 } ListViewHeaderParameters;
205
206 typedef struct
207 {
208         CairoColor         color;
209         ClearlooksJunction junction;       /* On which sides the slider junctions */
210         boolean            horizontal;
211         boolean            has_color;
212 } ScrollBarParameters;
213
214 typedef struct
215 {
216         ClearlooksHandleType type;
217         boolean              horizontal;
218 } HandleParameters;
219
220 typedef struct
221 {
222         ClearlooksStepper stepper;         /* Which stepper to draw */
223 } ScrollBarStepperParameters;
224
225 typedef struct
226 {
227         ClearlooksWindowEdge edge;
228 } ResizeGripParameters;
229
230 typedef struct
231 {
232         int style;
233 } MenuBarParameters;
234
235 typedef struct
236 {
237         ClearlooksShadowType shadow_type;
238         boolean              in_cell;
239         boolean              in_menu;
240 } CheckboxParameters;
241
242 typedef struct
243 {
244         ClearlooksArrowType type;
245         ClearlooksDirection direction;
246 } ArrowParameters;
247
248 typedef struct
249 {
250         int      style;
251         boolean  topmost;
252 } ToolbarParameters;
253
254 struct _ClearlooksStyleFunctions
255 {
256         void (*draw_button)           (cairo_t                          *cr,
257                                        const ClearlooksColors           *colors,
258                                        const WidgetParameters           *widget,
259                                        int x, int y, int width, int height);
260
261         void (*draw_scale_trough)     (cairo_t                          *cr,
262                                        const ClearlooksColors           *colors,
263                                        const WidgetParameters           *widget,
264                                        const SliderParameters           *slider,
265                                        int x, int y, int width, int height);
266
267         void (*draw_progressbar_trough) (cairo_t                        *cr,
268                                        const ClearlooksColors           *colors,
269                                        const WidgetParameters           *widget,
270                                        int x, int y, int width, int height);
271
272         void (*draw_progressbar_fill) (cairo_t                          *cr,
273                                        const ClearlooksColors           *colors,
274                                        const WidgetParameters           *widget,
275                                        const ProgressBarParameters      *progressbar,
276                                        int x, int y, int width, int height, gint offset);
277
278         void (*draw_slider_button)    (cairo_t                          *cr,
279                                        const ClearlooksColors           *colors,
280                                        const WidgetParameters           *widget,
281                                        const SliderParameters           *slider,
282                                        int x, int y, int width, int height);
283
284         void (*draw_entry)            (cairo_t                          *cr,
285                                        const ClearlooksColors           *colors,
286                                        const WidgetParameters           *widget,
287                                        int x, int y, int width, int height);
288
289         void (*draw_spinbutton)       (cairo_t                          *cr,
290                                        const ClearlooksColors           *colors,
291                                        const WidgetParameters           *widget,
292                                        int x, int y, int width, int height);
293
294         void (*draw_spinbutton_down)  (cairo_t                          *cr,
295                                        const ClearlooksColors           *colors,
296                                        const WidgetParameters           *widget,
297                                        int x, int y, int width, int height);
298
299         void (*draw_optionmenu)       (cairo_t                          *cr,
300                                        const ClearlooksColors           *colors,
301                                        const WidgetParameters           *widget,
302                                        const OptionMenuParameters *optionmenu,
303                                        int x, int y, int width, int height);
304                                         
305         void (*draw_inset)            (cairo_t                          *cr,
306                                         const CairoColor                *bg_color,
307                                         double x, double y, double w, double h,
308                                         double radius, uint8 corners);
309
310         void (*draw_menubar)          (cairo_t                          *cr,
311                                        const ClearlooksColors           *colors,
312                                        const WidgetParameters           *widget,
313                                        const MenuBarParameters  *menubar,
314                                        int x, int y, int width, int height);
315
316         void (*draw_tab)              (cairo_t                          *cr,
317                                        const ClearlooksColors           *colors,
318                                        const WidgetParameters           *widget,
319                                        const TabParameters                 *tab,
320                                        int x, int y, int width, int height);
321
322         void (*draw_frame)            (cairo_t                          *cr,
323                                        const ClearlooksColors           *colors,
324                                        const WidgetParameters           *widget,
325                                        const FrameParameters            *frame,
326                                        int x, int y, int width, int height);
327
328         void (*draw_separator)        (cairo_t                          *cr,
329                                        const ClearlooksColors           *colors,
330                                        const WidgetParameters           *widget,
331                                        const SeparatorParameters        *separator,
332                                        int x, int y, int width, int height);
333
334         void (*draw_menu_item_separator) (cairo_t                       *cr,
335                                        const ClearlooksColors           *colors,
336                                        const WidgetParameters           *widget,
337                                        const SeparatorParameters        *separator,
338                                        int x, int y, int width, int height);
339
340         void (*draw_list_view_header) (cairo_t                          *cr,
341                                        const ClearlooksColors           *colors,
342                                        const WidgetParameters           *widget,
343                                        const ListViewHeaderParameters   *header,
344                                        int x, int y, int width, int height);
345
346         void (*draw_toolbar)          (cairo_t                          *cr,
347                                        const ClearlooksColors           *colors,
348                                        const WidgetParameters           *widget,
349                                        const ToolbarParameters          *toolbar,
350                                        int x, int y, int width, int height);
351
352         void (*draw_menuitem)         (cairo_t                          *cr,
353                                        const ClearlooksColors           *colors,
354                                        const WidgetParameters           *widget,
355                                        int x, int y, int width, int height);
356
357         void (*draw_menubaritem)      (cairo_t                          *cr,
358                                        const ClearlooksColors           *colors,
359                                        const WidgetParameters           *widget,
360                                        int x, int y, int width, int height);
361
362         void (*draw_selected_cell)    (cairo_t                          *cr,
363                                        const ClearlooksColors           *colors,
364                                        const WidgetParameters           *widget,
365                                        int x, int y, int width, int height);
366
367         void (*draw_scrollbar_stepper) (cairo_t                         *cr,
368                                         const ClearlooksColors  *colors,
369                                         const WidgetParameters  *widget,
370                                         const ScrollBarParameters *scrollbar,
371                                         const ScrollBarStepperParameters *stepper,
372                                         int x, int y, int width, int height);
373
374         void (*draw_scrollbar_slider) (cairo_t                          *cr,
375                                        const ClearlooksColors           *colors,
376                                        const WidgetParameters           *widget,
377                                        const ScrollBarParameters        *scrollbar,
378                                        int x, int y, int width, int height);
379
380         void (*draw_scrollbar_trough) (cairo_t                          *cr,
381                                        const ClearlooksColors           *colors,
382                                        const WidgetParameters           *widget,
383                                        const ScrollBarParameters        *scrollbar,
384                                        int x, int y, int width, int height);
385
386         void (*draw_statusbar)        (cairo_t                          *cr,
387                                        const ClearlooksColors           *colors,
388                                        const WidgetParameters           *widget,
389                                        int x, int y, int width, int height);
390
391         void (*draw_menu_frame)       (cairo_t                          *cr,
392                                        const ClearlooksColors           *colors,
393                                        const WidgetParameters           *widget,
394                                        int x, int y, int width, int height);
395
396         void (*draw_tooltip)          (cairo_t                          *cr,
397                                        const ClearlooksColors           *colors,
398                                        const WidgetParameters           *widget,
399                                        int x, int y, int width, int height);
400
401         void (*draw_handle)           (cairo_t                          *cr,
402                                        const ClearlooksColors           *colors,
403                                        const WidgetParameters           *widget,
404                                        const HandleParameters           *handle,
405                                        int x, int y, int width, int height);
406
407         void (*draw_resize_grip)      (cairo_t                          *cr,
408                                        const ClearlooksColors           *colors,
409                                        const WidgetParameters           *widget,
410                                        const ResizeGripParameters       *grip,
411                                        int x, int y, int width, int height);
412
413         void (*draw_arrow)            (cairo_t                          *cr,
414                                        const ClearlooksColors           *colors,
415                                        const WidgetParameters           *widget,
416                                        const ArrowParameters            *arrow,
417                                        int x, int y, int width, int height);
418         
419         void (*draw_checkbox)         (cairo_t                          *cr,
420                                        const ClearlooksColors           *colors,
421                                        const WidgetParameters           *widget,
422                                        const CheckboxParameters *checkbox,
423                                        int x, int y, int width, int height);
424
425         void (*draw_radiobutton)      (cairo_t                          *cr,
426                                        const ClearlooksColors           *colors,
427                                        const WidgetParameters           *widget,
428                                        const CheckboxParameters *checkbox,
429                                        int x, int y, int width, int height);
430
431         /* Style internal functions */
432         /* XXX: Only used by slider_button, inline it? */
433         void (*draw_shadow)           (cairo_t                          *cr,
434                                        const ClearlooksColors           *colors,
435                                        gfloat                            radius,
436                                        int width, int height);
437
438         void (*draw_slider)           (cairo_t                          *cr,
439                                        const ClearlooksColors           *colors,
440                                        const WidgetParameters           *widget,
441                                        int x, int y, int width, int height);
442
443         void (*draw_gripdots)         (cairo_t *cr,
444                                        const ClearlooksColors *colors, int x, int y,
445                                        int width, int height, int xr, int yr,
446                                        float contrast);
447 };
448
449
450 #define CLEARLOOKS_RECTANGLE_SET(rect, _x, _y, _w, _h) rect.x      = _x; \
451                                                        rect.y      = _y; \
452                                                        rect.width  = _w; \
453                                                        rect.height = _h;
454
455 #endif /* CLEARLOOKS_TYPES_H */