#include <screen.h>
Public Member Functions | |
Screen (const char *title, u32 flags, FontBase *font=NULL) | |
virtual void | getClientRect (Rect &rect) const |
virtual const u8 | getTitleHeight () const |
virtual const char * | getTitle () const |
virtual void | draw (Rect clipRect) |
virtual bool | swapGadgetDepth (Gadget *gadget) |
virtual bool | click (s16 x, s16 y) |
virtual bool | release (s16 x, s16 y) |
virtual bool | drag (s16 x, s16 y, s16 vX, s16 vY) |
virtual void | flipToTopScreen () |
virtual void | flipToBottomScreen () |
virtual bool | flipScreens () |
virtual bool | focus () |
void | setTitle (const char *title) |
Protected Member Functions | |
virtual | ~Screen () |
Screen (const Screen &screen) | |
Protected Attributes | |
u8 | _titleHeight |
char * | _title |
Class representing a basic, empty screen. All gadgets, except for the Woopsi object itself, must ultimately have a screen at the top of their hierarchies (below Woopsi). Screen gadgets can only be children of the Woopsi object.
Screen::Screen | ( | const char * | title, | |
u32 | flags, | |||
FontBase * | font = NULL | |||
) |
Constructor.
title | The title of the screen; not displayed by default. | |
flags | Bitmask specifying some set-up values for the screen. | |
font | The font to use with the screen. |
virtual WoopsiUI::Screen::~Screen | ( | ) | [inline, protected, virtual] |
Destructor.
WoopsiUI::Screen::Screen | ( | const Screen & | screen | ) | [inline, protected] |
Copy constructor is protected to prevent usage.
bool Screen::click | ( | s16 | x, | |
s16 | y | |||
) | [virtual] |
Click this gadget at the supplied co-ordinates.
x | X co-ordinate of the click. | |
y | Y co-ordinate of the click. |
Reimplemented from WoopsiUI::Gadget.
bool Screen::drag | ( | s16 | x, | |
s16 | y, | |||
s16 | vX, | |||
s16 | vY | |||
) | [virtual] |
Drag the gadget to the supplied co-ordinates. This will move the screen around the display as it is dragged, using the DMA hardware to copy the rows up or down. DMA operations are optimised based on the assumption that the screen will have at most one rectangular region visible; since screens can only move up or down and are guaranteed to reach the bottom of the DS' display, this is a valid assumption to make and greatly reduces the complexity of the routine.
x | The x co-ordinate of the stylus. | |
y | The y co-ordinate of the stylus. | |
vX | The horizontal distance that the stylus was dragged. | |
vY | The vertical distance that the stylus was dragged. |
Reimplemented from WoopsiUI::Gadget.
void Screen::draw | ( | Rect | clipRect | ) | [virtual] |
Draw the area of this gadget that falls within the clipping region. Called by the draw() function to draw all visible regions.
clipRect | The clipping region to draw. |
Reimplemented from WoopsiUI::Gadget.
Reimplemented in WoopsiUI::DimmedScreen.
bool Screen::flipScreens | ( | ) | [virtual] |
Flip the screen from the current physical display to the other.
void Screen::flipToBottomScreen | ( | ) | [virtual] |
Flip the screen from the top physical display to the bottom display.
void Screen::flipToTopScreen | ( | ) | [virtual] |
Flip the screen from the bottom physical display to the top display.
bool Screen::focus | ( | ) | [virtual] |
Give the gadget focus.
Reimplemented from WoopsiUI::Gadget.
void Screen::getClientRect | ( | Rect & | rect | ) | const [virtual] |
Insert the properties of the space within this gadget that is available for children into the rect passed in as a parameter. All co-ordinates are relative to this gadget.
rect | Reference to a rect to populate with data. |
Reimplemented from WoopsiUI::Gadget.
virtual const char* WoopsiUI::Screen::getTitle | ( | ) | const [inline, virtual] |
Get the screen's title.
virtual const u8 WoopsiUI::Screen::getTitleHeight | ( | ) | const [inline, virtual] |
Gets the height of the title bar. Mainly available for subclassing, as this class does not include a title bar.
bool Screen::release | ( | s16 | x, | |
s16 | y | |||
) | [virtual] |
Release this gadget at the supplied co-ordinates
x | X co-ordinate of the release. | |
y | Y co-ordinate of the release. |
Reimplemented from WoopsiUI::Gadget.
void Screen::setTitle | ( | const char * | title | ) |
Set the title of the screen.
title | The new title. |
bool Screen::swapGadgetDepth | ( | Gadget * | gadget | ) | [virtual] |
Swaps the depth of the supplied child gadget. The child gadget is assumed to be a window, and although this is not a requirement, it does mean that child gadgets are depth-swapped as windows would be expected to. If the gadget is not at the top of the z-order of the gadgets is collides with, it is raised above those gadgets. If it is at the top of the z-order of the gadgets it collides with, it is dropped down to the bottom of that z-order.
gadget | A pointer to the child gadget that needs to swap depths. |
char* WoopsiUI::Screen::_title [protected] |
Title of the screen
u8 WoopsiUI::Screen::_titleHeight [protected] |
Height of the title bar