]> git.decadent.org.uk Git - ion3.git/blob - de/style.h
6f4063fb46b191e335b2dc0e6f9808b55e45551a
[ion3.git] / de / style.h
1 /*
2  * ion/de/style.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2008. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_DE_STYLE_H
10 #define ION_DE_STYLE_H
11
12 #include <libextl/extl.h>
13
14 #include <ioncore/common.h>
15 #include <ioncore/gr.h>
16 #include <ioncore/rectangle.h>
17
18 INTRSTRUCT(DEBorder);
19 INTRSTRUCT(DEStyle);
20
21 #include "font.h"
22 #include "colour.h"
23
24 enum{
25     DEBORDER_INLAID=0,    /* -\xxxxxx/- */
26     DEBORDER_RIDGE,       /* /-\xxxx/-\ */
27     DEBORDER_ELEVATED,    /* /-xxxxxx-\ */
28     DEBORDER_GROOVE       /* \_/xxxx\_/ */
29 };
30
31 enum{
32     DEBORDER_ALL=0, 
33     DEBORDER_TB,
34     DEBORDER_LR
35 };
36
37
38 enum{
39     DEALIGN_LEFT=0,
40     DEALIGN_RIGHT=1,
41     DEALIGN_CENTER=2
42 };
43
44
45 DECLSTRUCT(DEBorder){
46     uint sh, hl, pad;
47     uint style;
48     uint sides;
49 };
50
51
52 DECLSTRUCT(DEStyle){
53     GrStyleSpec spec;
54     int usecount;
55     bool is_fallback;
56     
57     WRootWin *rootwin;
58     
59     DEStyle *based_on;
60     
61     GC normal_gc;    
62     
63     DEBorder border;
64     bool cgrp_alloced;
65     DEColourGroup cgrp;
66     int n_extra_cgrps;
67     DEColourGroup *extra_cgrps;
68     GrTransparency transparency_mode;
69     DEFont *font;
70     int textalign;
71     uint spacing;
72     
73     ExtlTab extras_table;
74
75     /* Only initialised if used as a DETabBrush */
76     bool tabbrush_data_ok;
77     GC stipple_gc;
78     GC copy_gc;
79     
80     Pixmap tag_pixmap;
81     int tag_pixmap_w;
82     int tag_pixmap_h;
83     
84     DEStyle *next, *prev;
85 };
86
87
88 extern bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name);
89 extern void destyle_deinit(DEStyle *style);
90 extern DEStyle *de_create_style(WRootWin *rootwin, const char *name);
91 extern void destyle_unref(DEStyle *style);
92
93 extern void destyle_create_tab_gcs(DEStyle *style);
94
95 extern void de_reset();
96 extern void de_deinit_styles();
97
98 extern DEStyle *de_get_style(WRootWin *rootwin, const GrStyleSpec *spec);
99
100 extern void destyle_add(DEStyle *style);
101 extern void destyle_dump(DEStyle *style);
102
103
104 #endif /* ION_DE_STYLE_H */