1 #ifndef __lib_gui_ewindowstyle_h
2 #define __lib_gui_ewindowstyle_h
8 #include <lib/base/object.h>
10 SWIG_IGNORE(eWindowStyle);
11 class eWindowStyle: public iObject
18 virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
19 virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
20 virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
21 virtual void setStyle(gPainter &painter, int what) = 0;
22 virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
23 virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
25 virtual ~eWindowStyle() = 0;
31 styleListboxMarkedAndSelected
45 SWIG_TEMPLATE_TYPEDEF(ePtr<eWindowStyle>, eWindowStylePtr);
47 SWIG_IGNORE(eWindowStyleManager);
48 class eWindowStyleManager: public iObject
50 DECLARE_REF(eWindowStyleManager);
52 eWindowStyleManager();
53 ~eWindowStyleManager();
57 eWindowStyleManager();
58 ~eWindowStyleManager();
60 void getStyle(int style_id, ePtr<eWindowStyle> &SWIG_OUTPUT);
61 void setStyle(int style_id, eWindowStyle *style);
62 static SWIG_VOID(int) getInstance(ePtr<eWindowStyleManager> &SWIG_NAMED_OUTPUT(mgr)) { mgr = m_instance; if (!mgr) return -1; return 0; }
64 static eWindowStyleManager *m_instance;
65 std::map<int, ePtr<eWindowStyle> > m_current_style;
67 SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eWindowStyleManager>, eWindowStyleManager);
68 SWIG_EXTEND(ePtr<eWindowStyleManager>,
69 static ePtr<eWindowStyleManager> getInstance()
71 extern ePtr<eWindowStyleManager> NewWindowStylePtr(void);
72 return NewWindowStylePtr();
77 class eWindowStyleSimple: public eWindowStyle
79 DECLARE_REF(eWindowStyleSimple);
82 gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
84 int m_border_top, m_border_left, m_border_right, m_border_bottom;
87 void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
88 void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
89 void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
90 void setStyle(gPainter &painter, int what);
91 void drawFrame(gPainter &painter, const eRect &frame, int what);
92 RESULT getFont(int what, ePtr<gFont> &font);