X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ddc3964ed95d01e72229dc9af968a327cd84e56c..3ecd3b8d7f2d52fd7b5956c1fe08f926cc2a2858:/lib/gui/ewidgetdesktop.h?ds=sidebyside diff --git a/lib/gui/ewidgetdesktop.h b/lib/gui/ewidgetdesktop.h index 197693f8..fb4b3b82 100644 --- a/lib/gui/ewidgetdesktop.h +++ b/lib/gui/ewidgetdesktop.h @@ -5,25 +5,89 @@ #include class eWidget; +class eMainloop; +class eTimer; -class eWidgetDesktop + /* an eWidgetDesktopCompBuffer is a composition buffer. in + immediate composition mode, we only have one composition + buffer - the screen. + in buffered mode, we have one buffer for each widget, plus + the screen. + + even in buffered mode, we have a background region, because + a window can be arbitrary shaped. the screen size acts as a bounding + box in these cases. */ + +struct eWidgetDesktopCompBuffer { -public: // weil debug + ePoint m_position; eSize m_screen_size; gRegion m_dirty_region; + gRegion m_background_region; ePtr m_dc; + gRGB m_background_color; +}; + +class eWidgetDesktop: public Object +{ public: eWidgetDesktop(eSize screen); ~eWidgetDesktop(); - void addRootWidget(eWidget *root, int top); - void recalcClipRegions(); + void addRootWidget(eWidget *root); + void removeRootWidget(eWidget *root); + + /* 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 invalidate(const gRegion ®ion); void paint(); void setDC(gDC *dc); + + void setBackgroundColor(gRGB col); + void setBackgroundColor(eWidgetDesktopCompBuffer *comp, gRGB col); + + void setPalette(gPixmap &pm); + + void setRedrawTask(eMainloop &ml); + + void makeCompatiblePixmap(gPixmap &pm); + + enum { + cmImmediate, + cmBuffered + }; + + void setCompositionMode(int mode); + + int getStyleID() { return m_style_id; } + void setStyleID(int id) { m_style_id = id; } private: ePtrList m_root; void calcWidgetClipRegion(eWidget *widget, gRegion &parent_visible); + void paintBackground(eWidgetDesktopCompBuffer *comp); + + eMainloop *m_mainloop; + eTimer *m_timer; + + int m_comp_mode; + int m_require_redraw; + + eWidgetDesktopCompBuffer m_screen; + + void createBufferForWidget(eWidget *widget); + void removeBufferForWidget(eWidget *widget); + + void redrawComposition(int notifed); + void notify(); + + void clearVisibility(eWidget *widget); + + int m_style_id; }; #endif