Woopsi 1.3
Nintendo DS Gui Framework
Public Member Functions | Protected Member Functions | Protected Attributes
WoopsiUI::SuperBitmap Class Reference

#include <libwoopsi/include/superbitmap.h>

Inheritance diagram for WoopsiUI::SuperBitmap:
WoopsiUI::Gadget

List of all members.

Public Member Functions

 SuperBitmap (s16 x, s16 y, u16 width, u16 height, u16 bitmapWidth, u16 bitmapHeight, bool isDecoration, GadgetStyle *style=NULL)
BitmapgetBitmap ()
GraphicsgetGraphics ()
virtual void clearBitmap ()
void setBitmapX (s16 x)
void setBitmapY (s16 y)
s16 getBitmapX () const
s16 getBitmapY () const

Protected Member Functions

virtual void drawContents (GraphicsPort *port)
virtual void drawBorder (GraphicsPort *port)
virtual void onDrag (s16 x, s16 y, s16 vX, s16 vY)
virtual void onClick (s16 x, s16 y)
virtual ~SuperBitmap ()
 SuperBitmap (const SuperBitmap &superBitmap)

Protected Attributes

s32 _bitmapX
s32 _bitmapY
Bitmap_bitmap
Graphics_graphics

Detailed Description

The SuperBitmap class provides a set of 2D drawing tools and a bitmap in RAM to draw on. The class manifests itself as a gadget that can be scrolled around using the stylus.


Constructor & Destructor Documentation

WoopsiUI::SuperBitmap::SuperBitmap ( s16  x,
s16  y,
u16  width,
u16  height,
u16  bitmapWidth,
u16  bitmapHeight,
bool  isDecoration,
GadgetStyle style = NULL 
)

Constructor.

Parameters:
xThe x co-ordinate of the gadget.
yThe y co-ordinate of the gadget.
widthThe width of the gadget.
heightThe height of the gadget.
bitmapWidthThe desired width of the gadget's bitmap.
bitmapHeightThe desired height of the gadget's bitmap.
isDecorationSpecify if the gadget is a decoration or not. If set to true the gadget will function as a background image.
styleThe style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.
virtual WoopsiUI::SuperBitmap::~SuperBitmap ( ) [protected, virtual]

Destructor.

WoopsiUI::SuperBitmap::SuperBitmap ( const SuperBitmap superBitmap) [inline, protected]

Copy constructor is protected to prevent usage.


Member Function Documentation

virtual void WoopsiUI::SuperBitmap::clearBitmap ( ) [virtual]

Erases the internal bitmap by filling it with the gadget's back colour.

virtual void WoopsiUI::SuperBitmap::drawBorder ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::SuperBitmap::drawContents ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

Bitmap* WoopsiUI::SuperBitmap::getBitmap ( )

Get a pointer to the internal bitmap.

Returns:
Pointer to the internal bitmap.
s16 WoopsiUI::SuperBitmap::getBitmapX ( ) const

Get the x co-ordinate of the bitmap.

Returns:
The x co-ordinate of the bitmap.
s16 WoopsiUI::SuperBitmap::getBitmapY ( ) const

Get the y co-ordinate of the bitmap.

Returns:
The y co-ordinate of the bitmap.
Graphics* WoopsiUI::SuperBitmap::getGraphics ( )

Get a pointer to a Graphics object that can be used to draw to the internal bitmap. Note that this should *not* be deleted.

Returns:
Pointer to a graphics object for drawing to the internal bitmap.
virtual void WoopsiUI::SuperBitmap::onClick ( s16  x,
s16  y 
) [protected, virtual]

Starts the dragging system.

Parameters:
xThe x co-ordinate of the click.
yThe y co-ordinate of the click.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::SuperBitmap::onDrag ( s16  x,
s16  y,
s16  vX,
s16  vY 
) [protected, virtual]

Scrolls the bitmap.

Parameters:
xThe x co-ordinate of the stylus.
yThe y co-ordinate of the stylus.
vXThe horizontal drag distance.
vYThe vertical drag distance.

Reimplemented from WoopsiUI::Gadget.

void WoopsiUI::SuperBitmap::setBitmapX ( s16  x)

Set the x co-ordinate of the bitmap.

Parameters:
xThe new x co-ordinate of the bitmap.
void WoopsiUI::SuperBitmap::setBitmapY ( s16  y)

Set the y co-ordinate of the bitmap.

Parameters:
yThe new y co-ordinate of the bitmap.

Member Data Documentation

X co-ordinate of the bitmap relative to the gadget

Y co-ordinate of the bitmap relative to the gadget

Graphics object for drawing to bitmap


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