1 #ifndef __lib_gui_ewindowstyle_h
2 #define __lib_gui_ewindowstyle_h
8 #include <lib/base/object.h>
10 class eWindowStyle: public iObject
13 virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
14 virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
15 virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
16 virtual void setStyle(gPainter &painter, int what) = 0;
24 virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
37 virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
38 virtual ~eWindowStyle() = 0;
41 class eWindowStyleManager: public iObject
43 DECLARE_REF(eWindowStyleManager);
45 eWindowStyleManager();
46 ~eWindowStyleManager();
50 eWindowStyleManager();
51 ~eWindowStyleManager();
53 void getStyle(ePtr<eWindowStyle> &style);
54 void setStyle(eWindowStyle *style);
55 static int getInstance(ePtr<eWindowStyleManager> &mgr) { mgr = m_instance; if (!mgr) return -1; return 0; }
57 static eWindowStyleManager *m_instance;
58 ePtr<eWindowStyle> m_current_style;
61 TEMPLATE_TYPEDEF(ePtr<eWindowStyleManager>, eWindowStyleManagerPtr);
63 class eWindowStyleSimple: public eWindowStyle
65 DECLARE_REF(eWindowStyleSimple);
68 gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
70 int m_border_top, m_border_left, m_border_right, m_border_bottom;
73 void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
74 void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
75 void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
76 void setStyle(gPainter &painter, int what);
77 void drawFrame(gPainter &painter, const eRect &frame, int what);
78 RESULT getFont(int what, ePtr<gFont> &font);