]> git.decadent.org.uk Git - ion3.git/blob - de/style.h
[svn-upgrade] Integrating new upstream version, ion3 (20070203)
[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
35 enum{
36     DEALIGN_LEFT=0,
37     DEALIGN_RIGHT=1,
38     DEALIGN_CENTER=2
39 };
40
41
42 DECLSTRUCT(DEBorder){
43     uint sh, hl, pad;
44     uint style;
45 };
46
47
48 DECLSTRUCT(DEStyle){
49     GrStyleSpec spec;
50     int usecount;
51     bool is_fallback;
52     
53     WRootWin *rootwin;
54     
55     DEStyle *based_on;
56     
57     GC normal_gc;    
58     
59     DEBorder border;
60     bool cgrp_alloced;
61     DEColourGroup cgrp;
62     int n_extra_cgrps;
63     DEColourGroup *extra_cgrps;
64     GrTransparency transparency_mode;
65     DEFont *font;
66     int textalign;
67     uint spacing;
68     
69     ExtlTab data_table;
70
71     /* Only initialised if used as a DETabBrush */
72     bool tabbrush_data_ok;
73     GC stipple_gc;
74     GC copy_gc;
75     
76     Pixmap tag_pixmap;
77     int tag_pixmap_w;
78     int tag_pixmap_h;
79     
80     DEStyle *next, *prev;
81 };
82
83
84 extern bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name);
85 extern void destyle_deinit(DEStyle *style);
86 extern DEStyle *de_create_style(WRootWin *rootwin, const char *name);
87 extern void destyle_unref(DEStyle *style);
88
89 extern void destyle_create_tab_gcs(DEStyle *style);
90
91 extern void de_reset();
92 extern void de_deinit_styles();
93
94 extern DEStyle *de_get_style(WRootWin *rootwin, const GrStyleSpec *spec);
95
96
97 #endif /* ION_DE_STYLE_H */