WoopsiUI::Screen Class Reference

#include <screen.h>

Inheritance diagram for WoopsiUI::Screen:
WoopsiUI::Gadget WoopsiUI::AmigaScreen WoopsiUI::DimmedScreen WoopsiUI::SkinnedScreen

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

Screen::Screen ( const char *  title,
u32  flags,
FontBase font = NULL 
)

Constructor.

Parameters:
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.


Member Function Documentation

bool Screen::click ( s16  x,
s16  y 
) [virtual]

Click this gadget at the supplied co-ordinates.

Parameters:
x X co-ordinate of the click.
y Y co-ordinate of the click.
Returns:
True if the click was successful.

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.

Parameters:
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.
Returns:
True if the drag was successful.

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.

Parameters:
clipRect The clipping region to draw.
See also:
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.

Returns:
True if the gadget received focus correctly.

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.

Parameters:
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.

Returns:
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.

Returns:
The height of the title bar.
bool Screen::release ( s16  x,
s16  y 
) [virtual]

Release this gadget at the supplied co-ordinates

Parameters:
x X co-ordinate of the release.
y Y co-ordinate of the release.
Returns:
True if the release was successful.

Reimplemented from WoopsiUI::Gadget.

void Screen::setTitle ( const char *  title  ) 

Set the title of the screen.

Parameters:
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.

Parameters:
gadget A pointer to the child gadget that needs to swap depths.
Returns:
True if the swap was successful.

Member Data Documentation

char* WoopsiUI::Screen::_title [protected]

Title of the screen

Height of the title bar


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Enumerator

Generated on Sat Oct 24 14:33:11 2009 for Woopsi by  doxygen 1.6.1