Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members

Canvas Class Reference

Canvas manages a canvas into which a user can paint. More...

#include <Canvas.h>

Inheritance diagram for Canvas

Inheritance graph

[legend]
List of all members.

Public Methods

Construction / Destruction
 Canvas ()
 Construct a new canvas. More...

virtual ~Canvas ()
 Destroy the canvas. More...

Output management
virtual void beginDraw (WinLockInitType initMode) = 0
 Switch drawing window to the window into which the application shall paint. More...

virtual void endDraw (RectangleType *bounds) = 0
 Notify the canvas of the end of user paint operations. More...

virtual void show () = 0
 Display user painted graphics. More...

Physical Display management
Coord getWidth () const
 Get the width of the display. More...

Coord getHeight () const
 Get the height of the display. More...


Static Public Methods

Utility operations
void uniteBounds (RectangleType *rect1Bound, RectangleType *rect2Bound, RectangleType *resultBound)
 Determine a rectangle that encompasses two other rectangles. More...


Static Public Attributes

const UInt32 GRAY_1BPP = 0x00000001
 1bpp b/w. More...

const UInt32 GRAY_2BPP = 0x00000002
 2bpp grayscale. More...

const UInt32 GRAY_4BPP = 0x00000008
 4bpp grayscale. More...

const UInt32 COLOR_4BPP = 0x80000008
 4bpp color. Use the special 4bpp color commands from PilRC 2.6 or higher to generate the required bitmap resources. More...

const UInt32 COLOR_8BPP = 0x80000080
 8bpp color. More...

const UInt32 COLOR_16BPP = 0x80008000
 16bpp color. Use the special HandSpring resource compiler to generate the required bitmap resources. More...


Protected Attributes

RectangleType displayBounds
Coord width
Coord height
UInt32 selectedDepth
Boolean colorMode

Detailed Description

Canvas manages a canvas into which a user can paint.

Definition at line 33 of file Canvas.h.


Constructor & Destructor Documentation

Canvas::Canvas ( )
 

Construct a new canvas.

Definition at line 30 of file Canvas.cpp.

Canvas::~Canvas ( ) [virtual]
 

Destroy the canvas.

Definition at line 127 of file Canvas.cpp.


Member Function Documentation

void Canvas::beginDraw ( WinLockInitType initMode ) [pure virtual]
 

Switch drawing window to the window into which the application shall paint.

Reimplemented in DoubleBufferCanvas.

void Canvas::endDraw ( RectangleType * bounds ) [pure virtual]
 

Notify the canvas of the end of user paint operations.

Parameters:
bounds   the area that was modified by the user draw operation

Reimplemented in DoubleBufferCanvas.

Coord Canvas::getHeight ( ) const [inline]
 

Get the height of the display.

Definition at line 101 of file Canvas.h.

Coord Canvas::getWidth ( ) const [inline]
 

Get the width of the display.

Definition at line 92 of file Canvas.h.

void Canvas::show ( ) [pure virtual]
 

Display user painted graphics.

Reimplemented in DoubleBufferCanvas.

void Canvas::uniteBounds ( RectangleType * rect1Bound,
RectangleType * rect2Bound,
RectangleType * resultBound ) [static]
 

Determine a rectangle that encompasses two other rectangles.

Parameters:
rect1Bound   the bounds of rectangle #1
rect2Bound   the bounds of rectangle #2
resultBound   the bounds of the encompassing rectangle. rect1Bound, or rect2Bound, and resultBound may safely point to the same RectangleType structure.

Definition at line 134 of file Canvas.cpp.

Referenced by SpriteGroup::draw(), and DoubleBufferCanvas::endDraw().


Member Data Documentation

const UInt32 Canvas::COLOR_16BPP = 0x80008000 [static]
 

16bpp color. Use the special HandSpring resource compiler to generate the required bitmap resources.

Definition at line 48 of file Canvas.h.

const UInt32 Canvas::COLOR_4BPP = 0x80000008 [static]
 

4bpp color. Use the special 4bpp color commands from PilRC 2.6 or higher to generate the required bitmap resources.

Definition at line 44 of file Canvas.h.

const UInt32 Canvas::COLOR_8BPP = 0x80000080 [static]
 

8bpp color.

Definition at line 46 of file Canvas.h.

const UInt32 Canvas::GRAY_1BPP = 0x00000001 [static]
 

1bpp b/w.

Definition at line 38 of file Canvas.h.

const UInt32 Canvas::GRAY_2BPP = 0x00000002 [static]
 

2bpp grayscale.

Definition at line 40 of file Canvas.h.

const UInt32 Canvas::GRAY_4BPP = 0x00000008 [static]
 

4bpp grayscale.

Definition at line 42 of file Canvas.h.

Boolean Canvas::colorMode [protected]
 

Definition at line 128 of file Canvas.h.

RectangleType Canvas::displayBounds [protected]
 

Definition at line 123 of file Canvas.h.

Coord Canvas::height [protected]
 

Definition at line 126 of file Canvas.h.

UInt32 Canvas::selectedDepth [protected]
 

Definition at line 127 of file Canvas.h.

Coord Canvas::width [protected]
 

Definition at line 125 of file Canvas.h.


The documentation for this class was generated from the following files:
Razor! Engine Developer's Guide. Copyright © by Tilo Christ. All Rights Reserved. Last updated: 17 Dec 2000