also use refcounting for eTimers
[enigma2.git] / lib / gui / ewidgetdesktop.h
index 58bff50a4e74dda18dee56fc29cc5268d594106d..4ea5b57a2b9d0ebdf6e8b1c9bdc74847dcf3d731 100644 (file)
@@ -33,11 +33,21 @@ class eWidgetDesktop: public Object
 public:
        eWidgetDesktop(eSize screen);
        ~eWidgetDesktop();
-       void addRootWidget(eWidget *root, int top);
+       void addRootWidget(eWidget *root);
        void removeRootWidget(eWidget *root);
-       void recalcClipRegions();
        
-       void invalidate(const gRegion &region);
+               /* try to move widget content. */
+               /* returns -1 if there's no move support. */
+               /* call this after recalcClipRegions for that widget. */
+               /* you probably want to invalidate if -1 was returned. */
+       int movedWidget(eWidget *root);
+       
+       void recalcClipRegions(eWidget *root);
+       
+       void invalidateWidgetLayer(const gRegion &region, const eWidget *widget, int layer);
+       void invalidateWidget(const gRegion &region, const eWidget *widget, int layer = -1);
+       void invalidate(const gRegion &region, const eWidget *widget = 0, int layer = -1);
+       void paintLayer(eWidget *widget, int layer);
        void paint();
        void setDC(gDC *dc);
        
@@ -47,7 +57,8 @@ public:
        void setPalette(gPixmap &pm);
        
        void setRedrawTask(eMainloop &ml);
-       
+
+       void makeCompatiblePixmap(ePtr<gPixmap> &pm);
        void makeCompatiblePixmap(gPixmap &pm);
        
        enum {
@@ -56,23 +67,34 @@ public:
        };
        
        void setCompositionMode(int mode);
+       
+       int getStyleID() { return m_style_id; }
+       void setStyleID(int id) { m_style_id = id; }
+       
+       void resize(eSize size);
+       eSize size() const { return m_screen.m_screen_size; }
 private:
        ePtrList<eWidget> m_root;
-       void calcWidgetClipRegion(eWidgetDesktopCompBuffer *comp, eWidget *widget, gRegion &parent_visible);
+       void calcWidgetClipRegion(eWidget *widget, gRegion &parent_visible);
        void paintBackground(eWidgetDesktopCompBuffer *comp);
        
        eMainloop *m_mainloop;
-       eTimer *m_timer;
+       ePtr<eTimer> m_timer;
        
        int m_comp_mode;
        int m_require_redraw;
        
        eWidgetDesktopCompBuffer m_screen;
        
-       void createBufferForWidget(eWidget *widget);
-       void removeBufferForWidget(eWidget *widget);
+       void createBufferForWidget(eWidget *widget, int layer);
+       void removeBufferForWidget(eWidget *widget, int layer);
+       
+       void redrawComposition(int notifed);
+       void notify();
+       
+       void clearVisibility(eWidget *widget);
        
-       void redrawComposition();
+       int m_style_id;
 };
 
 #endif