⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gcupdatesmgr.h

📁 wxGTK 是 wxWidgets 的 linux GTK+ (>2.2.3)版本。wxWidgets 是一个跨平台的 GUI 框架
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////// Name:        gcupdatesmgr.h// Purpose:     Header for cbGCUpdatesMgr class.// Author:      Aleksandras Gluchovas// Modified by:// Created:     19/10/98// RCS-ID:      $Id: gcupdatesmgr.h,v 1.6 2005/09/23 12:46:57 MR Exp $// Copyright:   (c) Aleksandras Gluchovas// Licence:     wxWindows licence/////////////////////////////////////////////////////////////////////////////#ifndef __GCUPDATESMGR_G__#define __GCUPDATESMGR_G__#include "wx/fl/controlbar.h"#include "wx/fl/updatesmgr.h"#include "wx/fl/garbagec.h"/*This class implements optimized logic for refreshingthe areas of frame layout that actually need to be updated.It is used as the default updates manager by wxFrameLayout.It is called 'Garbage Collecting' updates manager becauseits implementation tries to find out dependencies between bars,and to order them into a 'hierarchy'. This hierarchical sorting resemblesthe implementation of heap-garbage collectors, which resolvedependencies between references.Example: there are situations where the order in which the usermoves windows does matter.\begin{verbatim}  case 1)     ------            ---     | A     |             |B|        ------     --->      | |            ---               --- ------            |B|                   | A  |            | |                   ------            ---                        (future)       (past)\end{verbatim}Past/future positions of A and B windows completely overlap, i.e.depend on each other, and there is no solution formoving the windows without refreshing both of them-- we have a cyclic dependency here. The garbage collection algorithm willfind this cyclic dependecy and will force refresh after movement.\begin{verbatim}  case 2)     ------     | A     |        ------     --->            ---            |B|                              ------            | |                              | A  |            ---                              ------                         ---                         |B|                         | |                         ---                        (future)       (past)\end{verbatim}In this case past/future positions do not overlap, soit is enough only to move windows without refreshing them.Garbage collection will 'notice' this.There is also a third case, when overlapping is partial.In this case the refreshing can also be avoided bymoving windows in the order of 'most-dependant' towards the'least-dependent'. GC handles this automatically, bysorting windows by their dependency-level (or 'hierarchy').See garbagec.h for more details of this method; garbagec.h/cppimplement sorting of generic dependencies and does not dealwith graphical objects directly.Summary: garbage collection improves performance when complex or largewindows are moved around, by reducing the number of repaints. It also helpsto avoid dirty non-client areas of moved windowsin some special cases of 'overlapping anomalies'.*/class WXDLLIMPEXP_FL cbGCUpdatesMgr : public cbSimpleUpdatesMgr{    DECLARE_DYNAMIC_CLASS( cbGCUpdatesMgr )protected:    GarbageCollector mGC;        // Internal function for repositioning items.    void DoRepositionItems( wxList& items );        // Internal function for repositioning items.    void AddItem( wxList&     itemList,                  cbBarInfo*  pBar,                  cbDockPane* pPane,                  wxRect&     curBounds,                  wxRect&     prevBounds );public:        // Default constructor.    cbGCUpdatesMgr(void) {}        // Constructor, taking a frame layout.    cbGCUpdatesMgr( wxFrameLayout* pPanel );        // Receives notifications from the frame layout.    virtual void OnStartChanges();        // Refreshes the parts of the frame layout which need an update.    virtual void UpdateNow();};#endif /* __GCUPDATESMGR_G__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -