1 #ifndef __lib_gui_ewidgetdesktop_h
2 #define __lib_gui_ewidgetdesktop_h
4 #include <lib/gdi/grc.h>
5 #include <lib/base/eptrlist.h>
11 /* an eWidgetDesktopCompBuffer is a composition buffer. in
12 immediate composition mode, we only have one composition
14 in buffered mode, we have one buffer for each widget, plus
17 even in buffered mode, we have a background region, because
18 a window can be arbitrary shaped. the screen size acts as a bounding
19 box in these cases. */
21 struct eWidgetDesktopCompBuffer
25 gRegion m_dirty_region;
26 gRegion m_background_region;
28 gRGB m_background_color;
31 class eWidgetDesktop: public Object
34 eWidgetDesktop(eSize screen);
36 void addRootWidget(eWidget *root);
37 void removeRootWidget(eWidget *root);
39 /* try to move widget content. */
40 /* returns -1 if there's no move support. */
41 /* call this after recalcClipRegions for that widget. */
42 /* you probably want to invalidate if -1 was returned. */
43 int movedWidget(eWidget *root);
45 void recalcClipRegions(eWidget *root);
47 void invalidate(const gRegion ®ion);
51 void setBackgroundColor(gRGB col);
52 void setBackgroundColor(eWidgetDesktopCompBuffer *comp, gRGB col);
54 void setPalette(gPixmap &pm);
56 void setRedrawTask(eMainloop &ml);
58 void makeCompatiblePixmap(gPixmap &pm);
65 void setCompositionMode(int mode);
67 int getStyleID() { return m_style_id; }
68 void setStyleID(int id) { m_style_id = id; }
70 ePtrList<eWidget> m_root;
71 void calcWidgetClipRegion(eWidget *widget, gRegion &parent_visible);
72 void paintBackground(eWidgetDesktopCompBuffer *comp);
74 eMainloop *m_mainloop;
80 eWidgetDesktopCompBuffer m_screen;
82 void createBufferForWidget(eWidget *widget);
83 void removeBufferForWidget(eWidget *widget);
85 void redrawComposition(int notifed);
88 void clearVisibility(eWidget *widget);