fix auto inversion,
[enigma2.git] / lib / gui / ewindowstyleskinned.h
1 #ifndef __lib_gui_ewindowstyleskinned_h
2 #define __lib_gui_ewindowstyleskinned_h
3
4 #include <lib/gui/ewindowstyle.h>
5
6 class eWindowStyleSkinned: public eWindowStyle
7 {
8         DECLARE_REF(eWindowStyleSkinned);
9 public:
10         eWindowStyleSkinned();
11         void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
12         void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
13         void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
14         void setStyle(gPainter &painter, int what);
15         void drawFrame(gPainter &painter, const eRect &frame, int what);
16         RESULT getFont(int what, ePtr<gFont> &font);
17         
18         enum {
19                 bsWindow,
20                 bsButton,
21                 bsListboxEntry,
22 #ifndef SWIG
23                 bsMax
24 #endif
25         };
26         
27         enum {
28                 bpTopLeft     =     1,
29                 bpTop         =     2,
30                 bpTopRight    =     4,
31                 bpLeft        =     8,
32                 bpBackground  =  0x10,
33                 bpRight       =  0x20,
34                 bpBottomLeft  =  0x40,
35                 bpBottom      =  0x80,
36                 bpBottomRight = 0x100,
37                 bpAll         = 0x1ff,
38                 bpMax         = 0x200
39         };
40         
41         enum {
42                 bpiTopLeft     =  0,
43                 bpiTop         =  1,
44                 bpiTopRight    =  2,
45                 bpiLeft        =  3,
46                 bpiBackground  =  4,
47                 bpiRight       =  5,
48                 bpiBottomLeft  =  6,
49                 bpiBottom      =  7,
50                 bpiBottomRight =  8,
51         };
52         
53         void setPixmap(int bs, int bp, gPixmap &pixmap);
54         
55         enum {
56                 colBackground,
57                 colLabelForeground,
58                 colListboxBackground,
59                 colListboxForeground,
60                 colListboxSelectedBackground,
61                 colListboxSelectedForeground,
62                 colListboxMarkedBackground,
63                 colListboxMarkedForeground,
64                 
65                 colWindowTitleForeground,
66                 colWindowTitleBackground,
67                 colMax
68         };
69         
70         void setColor(int what, const gRGB &back);
71         
72         void setTitleOffset(const eSize &offset);
73         void setTitleFont(gFont *fnt);
74         
75 private:
76         struct borderSet
77         {
78                 ePtr<gPixmap> m_pixmap[9];
79                 int m_border_top, m_border_left, m_border_right, m_border_bottom;
80         };
81         
82         borderSet m_border[bsMax];
83         
84         gRGB m_color[colMax];
85         
86         eSize m_title_offset;
87         ePtr<gFont> m_fnt;
88         
89         void drawBorder(gPainter &painter, const eRect &size, struct borderSet &border, int where);
90 };
91
92 #endif