audio selection - fake
[enigma2.git] / lib / gui / ewindowstyle.h
index 6431c2428003f4984f005f4c61eb19796ec9a78f..08ea0a4179105292471819c8a712a359268ffafe 100644 (file)
@@ -10,14 +10,15 @@ class gFont;
 class eWindowStyle: public iObject
 {
 public:
-       virtual void handleNewSize(eWindow *wnd, const eSize &size) = 0;
+       virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 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
+               styleListboxNormal,
+               styleListboxMarked
        };
        
        virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
@@ -26,10 +27,33 @@ public:
                frameButton,
                frameListboxEntry
        };
+       
+       enum {
+               fontStatic,
+               fontButton,
+               fontTitlebar
+       };
+       
+       virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
        virtual ~eWindowStyle() = 0;
+};
 
+class eWindowStyleManager: public iObject
+{
+       DECLARE_REF(eWindowStyleManager);
+public:
+       eWindowStyleManager();
+       ~eWindowStyleManager();
+       void getStyle(ePtr<eWindowStyle> &style);
+       void setStyle(eWindowStyle *style);
+       static int getInstance(ePtr<eWindowStyleManager> &mgr) { mgr = m_instance; if (!mgr) return -1; return 0; }
+private:
+       static eWindowStyleManager *m_instance;
+       ePtr<eWindowStyle> m_current_style;
 };
 
+TEMPLATE_TYPEDEF(ePtr<eWindowStyleManager>, eWindowStyleManagerPtr);
+
 class eWindowStyleSimple: public eWindowStyle
 {
        DECLARE_REF(eWindowStyleSimple);
@@ -40,50 +64,12 @@ private:
        int m_border_top, m_border_left, m_border_right, m_border_bottom;
 public:
        eWindowStyleSimple();
-       void handleNewSize(eWindow *wnd, const eSize &size);
+       void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
        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);
+       RESULT getFont(int what, ePtr<gFont> &font);
 };
 
 #endif