1 #ifndef __lib_gui_ewindowstyle_h
2 #define __lib_gui_ewindowstyle_h
8 #include <lib/base/object.h>
10 class eWindowStyle_ENUMS
14 ~eWindowStyle_ENUMS();
22 styleListboxMarkedAndSelected
37 SWIG_IGNORE(eWindowStyle);
38 class eWindowStyle: public eWindowStyle_ENUMS, public iObject
45 virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
46 virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
47 virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
48 virtual void setStyle(gPainter &painter, int what) = 0;
49 virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
50 virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
52 virtual ~eWindowStyle() = 0;
54 SWIG_TEMPLATE_TYPEDEF(ePtr<eWindowStyle>, eWindowStylePtr);
56 SWIG_IGNORE(eWindowStyleManager);
57 class eWindowStyleManager: public iObject
59 DECLARE_REF(eWindowStyleManager);
61 eWindowStyleManager();
62 ~eWindowStyleManager();
66 eWindowStyleManager();
67 ~eWindowStyleManager();
68 static SWIG_VOID(int) getInstance(ePtr<eWindowStyleManager> &SWIG_NAMED_OUTPUT(mgr)) { mgr = m_instance; if (!mgr) return -1; return 0; }
70 void getStyle(int style_id, ePtr<eWindowStyle> &SWIG_OUTPUT);
71 void setStyle(int style_id, eWindowStyle *style);
73 static eWindowStyleManager *m_instance;
74 std::map<int, ePtr<eWindowStyle> > m_current_style;
76 SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eWindowStyleManager>, eWindowStyleManager);
77 SWIG_EXTEND(ePtr<eWindowStyleManager>,
78 static ePtr<eWindowStyleManager> getInstance()
80 extern ePtr<eWindowStyleManager> NewWindowStylePtr(void);
81 return NewWindowStylePtr();
86 class eWindowStyleSimple: public eWindowStyle
88 DECLARE_REF(eWindowStyleSimple);
91 gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
93 int m_border_top, m_border_left, m_border_right, m_border_bottom;
96 void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
97 void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
98 void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
99 void setStyle(gPainter &painter, int what);
100 void drawFrame(gPainter &painter, const eRect &frame, int what);
101 RESULT getFont(int what, ePtr<gFont> &font);