]>
git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/src/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__
15 #include "controlbar.h"
16 #include "updatesmgr.h"
21 * class implements optimized logic for refreshing
22 * areas of frame layout - which actually need to be updated.
23 * Is used as default updates-manager by wxFrameLayout.
25 * it is called "Garbage Collecting" u.mgr for it's impelmentation
26 * tries to find out dependencies between bars, and to order
27 * them ito "hierarchy", this hierarchical sorting resembles
28 * impelmenation of heap-garbage collectors, which resolve
29 * dependencies between referencs.
31 * Example: there are situations where the order of moving
32 * the windows does matter:
45 * past/future positions of A and B windows completely overlapp, i.e.
46 * depend on each other, and there is not solution for
47 * moving the windows witout refereshing both of them,
48 * -- we have cyclic dependency here. The gc. alg will
49 * find this cyclic dependecy and will force "refresh"
69 * in this case past/future positions do not overlapp, thus
70 * it's enough only to move windows, without refreshing them.
71 * GC will "notice" it.
73 * there is also third case, when overlapping is partial
74 * in this case the refershing can be also avoided by
75 * moving windows in the order of "most-dependant" towards the
76 * "least-dependent". GC handles this automatically, by
77 * sorting windows by their dependency-level (or "hierarchy")
79 * See garbagec.h for more details of this method, garbagec.h/cpp
80 * implement sorting of generic-depenencies (does not deal
81 * with graphical objects directly)
83 * Summary: improves performance when complex/large windows are
84 * moved around, by reducing number of repaints. Also helps
85 * to avoid dirty non-client areas of moved windows
86 * in some sepcal cases of "overlapping anomalies"
89 class cbGCUpdatesMgr
: public cbSimpleUpdatesMgr
91 DECLARE_DYNAMIC_CLASS( cbGCUpdatesMgr
)
96 void DoRepositionItems( wxList
& items
);
98 void AddItem( wxList
& itemList
,
102 wxRect
& prevBounds
);
106 cbGCUpdatesMgr(void) {}
108 cbGCUpdatesMgr( wxFrameLayout
* pPanel
);
110 // notificiactions received from Frame Layout :
112 virtual void OnStartChanges();
114 // refreshes parts of the frame layout, which need an update
115 virtual void UpdateNow();