- add python, missing gui
[enigma2.git] / lib / gui / ewindow.cpp
1 #include <lib/gui/ewindow.h>
2 #include <lib/gui/ewidgetdesktop.h>
3
4 #include <lib/gui/ewindowstyle.h>
5
6 eWindow::eWindow(eWidgetDesktop *desktop): eWidget(0)
7 {
8         m_child = new eWidget(this);
9         desktop->addRootWidget(this, 0);
10         
11         m_style = new eWindowStyleSimple();
12 }
13
14 void eWindow::setTitle(const std::string &string)
15 {
16         if (m_title == string)  
17                 return;
18         m_title = string;
19         event(evtTitleChanged);
20 }
21
22 int eWindow::event(int event, void *data, void *data2)
23 {
24         switch (event)
25         {
26         case evtWillChangeSize:
27         {
28                 const eSize &new_size = *static_cast<eSize*>(data);
29                 eDebug("eWindow::evtWillChangeSize to %d %d", new_size.width(), new_size.height());
30                 if (m_style)
31                         m_style->handleNewSize(this, new_size);
32                 break;
33         }
34         case evtPaint:
35         {
36                 gPainter &painter = *static_cast<gPainter*>(data2);
37                 painter.setBackgroundColor(gColor(0x18));
38                 painter.clear();
39                 break;
40         }
41         default:
42                 break;
43         }
44         return eWidget::event(event, data, data2);
45 }
46