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