]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/fl/gcupdatesmgr.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __GCUPDATESMGR_G__
13 #define __GCUPDATESMGR_G__
16 #pragma interface "gcupdatesmgr.h"
19 #include "wx/fl/controlbar.h"
20 #include "wx/fl/updatesmgr.h"
22 #include "wx/fl/garbagec.h"
25 * class implements optimized logic for refreshing
26 * areas of frame layout - which actually need to be updated.
27 * Is used as default updates-manager by wxFrameLayout.
29 * it is called "Garbage Collecting" u.mgr for it's implementation
30 * tries to find out dependencies between bars, and to order
31 * them ito "hierarchy", this hierarchical sorting resembles
32 * implemenation of heap-garbage collectors, which resolve
33 * dependencies between references.
35 * Example: there are situations where the order of moving
36 * the windows does matter:
49 * past/future positions of A and B windows completely overlapp, i.e.
50 * depend on each other, and there is not solution for
51 * moving the windows witout refreshing both of them,
52 * -- we have cyclic dependency here. The gc. alg will
53 * find this cyclic dependecy and will force "refresh"
73 * in this case past/future positions do not overlapp, thus
74 * it's enough only to move windows, without refreshing them.
75 * GC will "notice" it.
77 * there is also third case, when overlapping is partial
78 * in this case the refershing can be also avoided by
79 * moving windows in the order of "most-dependant" towards the
80 * "least-dependent". GC handles this automatically, by
81 * sorting windows by their dependency-level (or "hierarchy")
83 * See garbagec.h for more details of this method, garbagec.h/cpp
84 * implement sorting of generic-dependencies (does not deal
85 * with graphical objects directly)
87 * Summary: improves performance when complex/large windows are
88 * moved around, by reducing number of repaints. Also helps
89 * to avoid dirty non-client areas of moved windows
90 * in some special cases of "overlapping anomalies"
93 class cbGCUpdatesMgr
: public cbSimpleUpdatesMgr
95 DECLARE_DYNAMIC_CLASS( cbGCUpdatesMgr
)
100 void DoRepositionItems( wxList
& items
);
102 void AddItem( wxList
& itemList
,
106 wxRect
& prevBounds
);
110 cbGCUpdatesMgr(void) {}
112 cbGCUpdatesMgr( wxFrameLayout
* pPanel
);
114 // notificiactions received from Frame Layout :
116 virtual void OnStartChanges();
118 // refreshes parts of the frame layout, which need an update
119 virtual void UpdateNow();
122 #endif /* __GCUPDATESMGR_G__ */