- improved parser
[enigma2.git] / lib / gui / ewindowstyle.h
index 02f155af7a2bb3adc20fd8aa40d8741024e31e6e..0014bfa46f201c284b6d8637340dc0f7a7126fb8 100644 (file)
@@ -3,6 +3,7 @@
 
 class eWindow;
 class eSize;
+class gFont;
 
 #include <lib/base/object.h>
 
@@ -10,15 +11,80 @@ class eWindowStyle: public iObject
 {
 public:
        virtual void handleNewSize(eWindow *wnd, const eSize &size) = 0;
+       virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
+       virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
+       virtual void setStyle(gPainter &painter, int what) = 0;
+       enum {
+               styleLabel,
+               styleListboxSelected,
+               styleListboxNormal,
+               styleListboxMarked
+       };
+       
+       virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
+       
+       enum {
+               frameButton,
+               frameListboxEntry
+       };
+       virtual ~eWindowStyle() = 0;
+
 };
 
 class eWindowStyleSimple: public eWindowStyle
 {
-       DECLARE_REF;
+       DECLARE_REF(eWindowStyleSimple);
+private:
+       ePtr<gFont> m_fnt;
+       gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
+       
+       int m_border_top, m_border_left, m_border_right, m_border_bottom;
 public:
        eWindowStyleSimple();
        void handleNewSize(eWindow *wnd, const eSize &size);
-       int m_border_top, m_border_left, m_border_right, m_border_bottom;
+       void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
+       void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
+       void setStyle(gPainter &painter, int what);
+       void drawFrame(gPainter &painter, const eRect &frame, int what);
+};
+
+class eWindowStyleSkinned: public eWindowStyle
+{
+       DECLARE_REF(eWindowStyleSkinned);
+public:
+       eWindowStyleSkinned();
+       void handleNewSize(eWindow *wnd, const eSize &size);
+       void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
+       void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
+       void setStyle(gPainter &painter, int what);
+       void drawFrame(gPainter &painter, const eRect &frame, int what);
+       
+       enum {
+               bsWindow,
+               bsButton,
+#ifndef SWIG
+               bsMax
+#endif
+       };
+       
+       enum {
+               bpTopLeft     =     1,
+               bpTop         =     2,
+               bpTopRight    =     4,
+               bpLeft        =     8,
+               bpRight       =  0x10,
+               bpBottomLeft  =  0x20,
+               bpBottom      =  0x40,
+               bpBottomRight =  0x80,
+               bpBackground  = 0x100
+       };
+private:
+       struct borderSet
+       {
+               ePtr<gPixmap> m_pixmap[9];
+       };
+       
+       void drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where);
 };
 
 #endif