]> git.saurik.com Git - wxWidgets.git/blame_incremental - contrib/include/wx/fl/gcupdatesmgr.h
mark slider as being transparent, otherwise it has ugly solid grey background when...
[wxWidgets.git] / contrib / include / wx / fl / gcupdatesmgr.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: gcupdatesmgr.h
3// Purpose: Header for cbGCUpdatesMgr class.
4// Author: Aleksandras Gluchovas
5// Modified by:
6// Created: 19/10/98
7// RCS-ID: $Id$
8// Copyright: (c) Aleksandras Gluchovas
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __GCUPDATESMGR_G__
13#define __GCUPDATESMGR_G__
14
15#if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "gcupdatesmgr.h"
17#endif
18
19#include "wx/fl/controlbar.h"
20#include "wx/fl/updatesmgr.h"
21
22#include "wx/fl/garbagec.h"
23
24/*
25This class implements optimized logic for refreshing
26the areas of frame layout that actually need to be updated.
27It is used as the default updates manager by wxFrameLayout.
28
29It is called 'Garbage Collecting' updates manager because
30its implementation tries to find out dependencies between bars,
31and to order them into a 'hierarchy'. This hierarchical sorting resembles
32the implementation of heap-garbage collectors, which resolve
33dependencies between references.
34
35Example: there are situations where the order in which the user
36moves windows does matter.
37
38\begin{verbatim}
39 case 1)
40 ------ ---
41 | A | |B|
42 ------ ---> | |
43 --- --- ------
44 |B| | A |
45 | | ------
46 ---
47 (future)
48 (past)
49\end{verbatim}
50
51Past/future positions of A and B windows completely overlap, i.e.
52depend on each other, and there is no solution for
53moving the windows without refreshing both of them
54-- we have a cyclic dependency here. The garbage collection algorithm will
55find this cyclic dependecy and will force refresh after movement.
56
57\begin{verbatim}
58 case 2)
59
60 ------
61 | A |
62 ------ --->
63 ---
64 |B| ------
65 | | | A |
66 --- ------
67 ---
68 |B|
69 | |
70 ---
71
72 (future)
73 (past)
74\end{verbatim}
75
76In this case past/future positions do not overlap, so
77it is enough only to move windows without refreshing them.
78Garbage collection will 'notice' this.
79
80There is also a third case, when overlapping is partial.
81In this case the refreshing can also be avoided by
82moving windows in the order of 'most-dependant' towards the
83'least-dependent'. GC handles this automatically, by
84sorting windows by their dependency-level (or 'hierarchy').
85
86See garbagec.h for more details of this method; garbagec.h/cpp
87implement sorting of generic dependencies and does not deal
88with graphical objects directly.
89
90Summary: garbage collection improves performance when complex or large
91windows are moved around, by reducing the number of repaints. It also helps
92to avoid dirty non-client areas of moved windows
93in some special cases of 'overlapping anomalies'.
94*/
95
96class WXDLLIMPEXP_FL cbGCUpdatesMgr : public cbSimpleUpdatesMgr
97{
98 DECLARE_DYNAMIC_CLASS( cbGCUpdatesMgr )
99protected:
100
101 GarbageCollector mGC;
102
103 // Internal function for repositioning items.
104 void DoRepositionItems( wxList& items );
105
106 // Internal function for repositioning items.
107 void AddItem( wxList& itemList,
108 cbBarInfo* pBar,
109 cbDockPane* pPane,
110 wxRect& curBounds,
111 wxRect& prevBounds );
112
113public:
114
115 // Default constructor.
116 cbGCUpdatesMgr(void) {}
117
118 // Constructor, taking a frame layout.
119 cbGCUpdatesMgr( wxFrameLayout* pPanel );
120
121 // Receives notifications from the frame layout.
122 virtual void OnStartChanges();
123
124 // Refreshes the parts of the frame layout which need an update.
125 virtual void UpdateNow();
126};
127
128#endif /* __GCUPDATESMGR_G__ */
129