- Main Page
- Classes
- Files

- File List

# C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.40/Woopsi/libwoopsi/include/rectcache.h

    00001 #ifndef _RECT_CACHE_H_
    00002 #define _RECT_CACHE_H_
    00003
    00004 #include "woopsiarray.h"
    00005 #include "gadget.h"
    00006
    00007 namespace WoopsiUI {
    00008
    00014         class RectCache {
    00015         public:
    00016
    00021                 RectCache(const Gadget* gadget);
    00022
    00026                 inline ~RectCache() { };
    00027
    00031                 void cache();
    00032
    00036                 inline void invalidate() {
    00037                         _foregroundInvalid = true;
    00038                         _backgroundInvalid = true;
    00039                 };
    00040
    00046                 inline WoopsiArray<Rect>* getBackgroundRegions() { return &_backgroundRegions; };
    00047
    00054                 inline WoopsiArray<Rect>* getForegroundRegions() { return &_foregroundRegions; };
    00055
    00068                 void splitRectangles(WoopsiArray<Rect>* invalidRectangles, WoopsiArray<Rect>* validRects, const Gadget* sender) const;
    00069
    00078                 void removeOverlappedRects(WoopsiArray<Rect>* visibleRects, WoopsiArray<Rect>* invisibleRects, const Gadget* gadget) const;
    00079
    00080         private:
    00081                 WoopsiArray<Rect> _foregroundRegions;
    00082                 WoopsiArray<Rect> _backgroundRegions;
    00083                 const Gadget* _gadget;
    00084                 bool _foregroundInvalid;
    00085                 bool _backgroundInvalid;
    00090                 void cacheForegroundRegions();
    00091
    00095                 void cacheBackgroundRegions();
    00096
    00097         };
    00098 }
    00099
    00100 #endif