Nintendo DS Gui Framework
|RectCache (const Gadget *gadget)|
|WoopsiArray< Rect > *||getBackgroundRegions ()|
|WoopsiArray< Rect > *||getForegroundRegions ()|
|void||splitRectangles (WoopsiArray< Rect > *invalidRectangles, WoopsiArray< Rect > *validRects) const|
|void||removeOverlappedRects (WoopsiArray< Rect > *visibleRects, WoopsiArray< Rect > *invisibleRects, const Gadget *gadget) const|
|void||markRectsDamaged () const|
|void||markRectDamaged (const Rect &rect) const|
Maintains a list of foreground (ie. above children) and background (with child overlapped-rects removed) rectangles representing the visible portions of a gadget.
|WoopsiUI::RectCache::RectCache||(||const Gadget *||gadget||)|
|gadget||Gadget that contains the rect cache.|
Rebuild the cache if it is invalid.
Return the list of background regions. These are regions that are not overlapped by child gadgets.
Return the list of foreground regions. These are regions that represent the entire visible surface of the gadget - that is, any regions not overlapped by ancestors or sublings of the gadget - including any regions that are actually overlapped by child gadgets.
Invalidates the cache.
|void WoopsiUI::RectCache::markRectDamaged||(||const Rect &||rect||)||const|
Marks a specific rect as dirty. The rect's co-ordinates should be in Woopsi-space. The rect is automatically clipped and split so that only regions of it that intersect the foreground rects are redrawn.
|rect||Rect to mark as dirty.|
Marks all foreground rects dirty. All rects are sent to the DisplayController for redraw. Since all foreground rects are sent, not background rects, this means that all of the owning gadget's children will also be redrawn next time the display is refreshed.
|void WoopsiUI::RectCache::removeOverlappedRects||(||WoopsiArray< Rect > *||visibleRects,|
|WoopsiArray< Rect > *||invisibleRects,|
|const Gadget *||gadget|
Move any rectangles from the visibleRects list that overlap this gadget into the invisibleRects list. Used during visible region calculations.
|visibleRects||A vector of regions that are not overlapped.|
|invisibleRects||A vector of regions that are overlapped.|
|gadget||The gadget that requested the lists.|
|void WoopsiUI::RectCache::splitRectangles||(||WoopsiArray< Rect > *||invalidRectangles,|
|WoopsiArray< Rect > *||validRects|
Works out which rectangles in the invalidRectangles list overlap this gadget, then cuts the rectangles into smaller pieces. The overlapping pieces are pushed into validRects, and the non-overlapping pieces are pushed back into the invalidRects vector.
|invalidRectangles||A vector of regions that need to be tested for collisions against this gadget; they represent regions that need to be redrawn.|
|validRects||A vector of regions that represents areas of the display that do not need to be redrawn.|