X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ba02fb4aced5868d047a5bffbd2ed87583daee4d..95ac56f69ddb6de8e260c8e55aff68d1df0b452c:/lib/gui/ewindowstyle.h diff --git a/lib/gui/ewindowstyle.h b/lib/gui/ewindowstyle.h index d5da5a34..0014bfa4 100644 --- a/lib/gui/ewindowstyle.h +++ b/lib/gui/ewindowstyle.h @@ -13,14 +13,27 @@ 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 setForegroundStyle(gPainter &painter) = 0; - virtual void drawButtonFrame(gPainter &painter, const eRect &frame) = 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 m_fnt; gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color; @@ -31,8 +44,47 @@ public: 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 setForegroundStyle(gPainter &painter); - void drawButtonFrame(gPainter &painter, const eRect &frame); + 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 m_pixmap[9]; + }; + + void drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where); }; #endif