#include <lib/gdi/esize.h>
#include <lib/gui/ewindow.h>
#include <lib/gui/ewindowstyle.h>
-
+#include <lib/base/init.h>
+#include <lib/base/init_num.h>
eWindowStyle::~eWindowStyle() {}
+DEFINE_REF(eWindowStyleManager);
+
+eWindowStyleManager::eWindowStyleManager()
+{
+ m_instance = this;
+}
+
+eWindowStyleManager::~eWindowStyleManager()
+{
+ m_instance = 0;
+}
+
+void eWindowStyleManager::getStyle(ePtr<eWindowStyle> &style)
+{
+ style = m_current_style;
+}
+
+void eWindowStyleManager::setStyle(eWindowStyle *style)
+{
+ m_current_style = style;
+}
+
+eWindowStyleManager *eWindowStyleManager::m_instance;
+
DEFINE_REF(eWindowStyleSimple);
eWindowStyleSimple::eWindowStyleSimple()
m_background_color = gColor(0x19);
}
-void eWindowStyleSimple::handleNewSize(eWindow *wnd, const eSize &size)
+void eWindowStyleSimple::handleNewSize(eWindow *wnd, eSize &size, eSize &offset)
{
// eDebug("handle new size: %d x %d", size.width(), size.height());
painter.line(frame.bottomLeft1(), frame.topLeft1());
}
-DEFINE_REF(eWindowStyleSkinned);
-
-eWindowStyleSkinned::eWindowStyleSkinned()
-{
-}
-
-void eWindowStyleSkinned::handleNewSize(eWindow *wnd, const eSize &size)
-{
-}
-
-void eWindowStyleSkinned::paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title)
-{
-}
-
-void eWindowStyleSkinned::paintBackground(gPainter &painter, const ePoint &offset, const eSize &size)
-{
-}
-
-void eWindowStyleSkinned::setStyle(gPainter &painter, int what)
-{
-}
-
-void eWindowStyleSkinned::drawFrame(gPainter &painter, const eRect &frame, int what)
-{
-}
-
-void eWindowStyleSkinned::drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where)
+RESULT eWindowStyleSimple::getFont(int what, ePtr<gFont> &fnt)
{
+ fnt = 0;
+ switch (what)
+ {
+ case fontStatic:
+ fnt = new gFont("Arial", 12);
+ break;
+ case fontButton:
+ fnt = new gFont("Arial", 20);
+ break;
+ case fontTitlebar:
+ fnt = new gFont("Arial", 25);
+ break;
+ default:
+ return -1;
+ }
+ return 0;
}
+eAutoInitPtr<eWindowStyleManager> init_eWindowStyleManager(eAutoInitNumbers::skin, "eWindowStyleManager");