r3canvas

r3gfx
r3opengl

r3canvas

Class

oops/r3canvas.h

Library

r3oops

Description:

Base class for all canvas classes. Canvas is a class which defines all window specific things needed for rendering to a window.

See Also

oops/r3widget.h

See Also

oops/r3color.h

Super Class

r3Widget

R3CLID_WIDGET

JavaScript

r3Canvas

Class Identifier

R3CLID_CANVAS - 264

Methods

NEWDRAWCONTEXT, DELETEDRAWCONTEXT, COPYDRAWCONTEXT, _WAS__RESTOREFROMBACKUP, REGISTERCANVAS, ENUMCANVASLIST, SCREENPOSITIONCHANGED, ACTIVATE, PALETTECHANGED, GETINDEXFORCOLOR,

Attributes

DoubleBuffer, Main, Overlays, DoubleBufferOverlays, BackDrop, BackDropImage, Shaded, Backup, TrueColor, Palette, ClipLeft, ClipRight, ClipTop, ClipBottom, DrawContextClass, Semaphore, Depth,

Registration

int R3RegisterCanvasClass(R3APP *app);

R3CM_NEWDRAWCONTEXT

Method

NEWDRAWCONTEXT

Identifier

R3CM_NEWDRAWCONTEXT

Return

R3OBJ*, address of the created drawing context.

JavaScript

rc = obj.NEWDRAWCONTEXT();

Description

Ask canvas to create new drawing context. Multiple threads can render to a single window through drawing contexes. Drawing context specifies all rendering attributes, such as current color etc.

R3CM_DELETEDRAWCONTEXT

Method

DELETEDRAWCONTEXT

Identifier

R3CM_DELETEDRAWCONTEXT

Return

R3BOOL, FALSE if drawing context wasn't created by the canvas

Param 3:

R3OBJ*, drawing context

JavaScript

rc = obj.DELETEDRAWCONTEXT(p3);

Description

Ask canvas to delete given drawing context.

R3CM_COPYDRAWCONTEXT

Method

COPYDRAWCONTEXT

Identifier

R3CM_COPYDRAWCONTEXT

Return

R3OBJ*, newly created draw context

Param 3:

R3OBJ*, draw context to be duplicated

JavaScript

rc = obj.COPYDRAWCONTEXT(p3);

Description

Duplicate given draw context

R3CM__WAS__RESTOREFROMBACKUP

Method

_WAS__RESTOREFROMBACKUP

Identifier

R3CM__WAS__RESTOREFROMBACKUP

Return

R3BOOL, FALSE if failed

JavaScript

rc = obj._WAS__RESTOREFROMBACKUP();

Description

Ask canvas to restore the contents of the damaged window.

R3CCM_REGISTERCANVAS

Method

REGISTERCANVAS

Identifier

R3CCM_REGISTERCANVAS

Return

R3BOOL, FALSE if no more canvases cannot be registered

Param 1:

char*, name of the canvas

Param 2:

R3INT, class id of the canvas class

Param 3:

R3TAG*, currently unused

JavaScript

rc = obj.REGISTERCANVAS(p1, p2, p3);

Description

Class method which can be used for registering new canvas classes. The canvas class keeps track of all available canvas classes and ENUMCANVASLIST can be used for learning what classes are available.

R3CCM_ENUMCANVASLIST

Method

ENUMCANVASLIST

Identifier

R3CCM_ENUMCANVASLIST

Return

R3INT, return value from the callback object

Param 1:

R3OBJ*, object to be called

Param 2:

R3INT, method to be called

Param 3:

void*, whatever user specific data

JavaScript

rc = obj.ENUMCANVASLIST(p1, p2, p3);

Description

Enumerate available canvas classes. Calls given object with given method as R3SendMsgA3(R3OBJ *userobj, R3INT usermth, char *class_name, R3INT classid, void *user_data);

R3CM_SCREENPOSITIONCHANGED

Method

SCREENPOSITIONCHANGED

Identifier

R3CM_SCREENPOSITIONCHANGED

JavaScript

obj.SCREENPOSITIONCHANGED();

Description

window moves on screen

R3CM_ACTIVATE

Method

ACTIVATE

Identifier

R3CM_ACTIVATE

JavaScript

obj.ACTIVATE();

Description

window is activated

R3CM_PALETTECHANGED

Method

PALETTECHANGED

Identifier

R3CM_PALETTECHANGED

JavaScript

obj.PALETTECHANGED();

Description

Palette of the window has changed

R3CM_GETINDEXFORCOLOR

Method

GETINDEXFORCOLOR

Identifier

R3CM_GETINDEXFORCOLOR

Return

R3INT, index

Param 3:

R3FLOATCOLOR, RGB color

JavaScript

rc = obj.GETINDEXFORCOLOR(p3);

Description

get an index for RGB color value.

DoubleBuffer

Attribute

DoubleBuffer

Identifier

R3CA_DoubleBuffer

JavaScript type

Boolean

C type

R3BOOL

Description

double buffering on/off

Syntax


jsobj.SetDoubleBuffer(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_DoubleBuffer, value, R3TAG_END);

Main

Attribute

Main

Identifier

R3CA_Main

JavaScript type

Boolean

C type

R3BOOL

Description

main buffer on/off

Syntax


jsobj.SetMain(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_Main, value, R3TAG_END);

Overlays

Attribute

Overlays

Identifier

R3CA_Overlays

JavaScript type

Boolean

C type

R3BOOL

Description

allocate two 1 bit overlay buffers

Syntax


jsobj.SetOverlays(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_Overlays, value, R3TAG_END);

DoubleBufferOverlays

Attribute

DoubleBufferOverlays

Identifier

R3CA_DoubleBufferOverlays

JavaScript type

Boolean

C type

R3BOOL

Description

double buffered overlays

Syntax


jsobj.SetDoubleBufferOverlays(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_DoubleBufferOverlays, value, R3TAG_END);

BackDrop

Attribute

BackDrop

Identifier

R3CA_BackDrop

JavaScript type

Boolean

C type

R3BOOL

Description

backdrop (underlay) buffer

Syntax


jsobj.SetBackDrop(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_BackDrop, value, R3TAG_END);

BackDropImage

Attribute

BackDropImage

Identifier

R3CA_BackDropImage

JavaScript type

Boolean

C type

R3BOOL

Description

image for backdrop buffer

Syntax


jsobj.SetBackDropImage(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_BackDropImage, value, R3TAG_END);

Shaded

Attribute

Shaded

Identifier

R3CA_Shaded

JavaScript type

Boolean

C type

R3BOOL

Description

if true, shaded otherwise wireframe

Syntax


jsobj.SetShaded(value);
value = jsobj.GetShaded();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_Shaded, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3CA_Shaded, &value, R3TAG_END);

Backup

Attribute

Backup

Identifier

R3CA_Backup

JavaScript type

Boolean

C type

R3BOOL

Description

if true damaged areas are restored automatically by canvas

Syntax


jsobj.SetBackup(value);


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_Backup, value, R3TAG_END);

TrueColor

Attribute

TrueColor

Identifier

R3CA_TrueColor

JavaScript type

Boolean

C type

R3BOOL

Description

rgb/indexed

Syntax


jsobj.SetTrueColor(value);
value = jsobj.GetTrueColor();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3CA_TrueColor, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3CA_TrueColor, &value, R3TAG_END);

Palette

Attribute

Palette

Identifier

R3CA_Palette

JavaScript type

Object

C type

R3OBJ*

Description

get PALETTE object

Syntax


value = jsobj.GetPalette();


R3OBJ* value;
R3GetAttrs(r3obj, R3CA_Palette, &value, R3TAG_END);

ClipLeft

Attribute

ClipLeft

Identifier

R3CA_ClipLeft

JavaScript type

Integer

C type

R3INT

Description

clipping region for optimized update

Syntax


jsobj.SetClipLeft(value);
value = jsobj.GetClipLeft();


R3INT value = ...;
R3SetAttrs(r3obj, R3CA_ClipLeft, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3CA_ClipLeft, &value, R3TAG_END);

ClipRight

Attribute

ClipRight

Identifier

R3CA_ClipRight

JavaScript type

Integer

C type

R3INT

Description

'R3CA_ClipRight' not documented

Syntax


jsobj.SetClipRight(value);
value = jsobj.GetClipRight();


R3INT value = ...;
R3SetAttrs(r3obj, R3CA_ClipRight, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3CA_ClipRight, &value, R3TAG_END);

ClipTop

Attribute

ClipTop

Identifier

R3CA_ClipTop

JavaScript type

Integer

C type

R3INT

Description

'R3CA_ClipTop' not documented

Syntax


jsobj.SetClipTop(value);
value = jsobj.GetClipTop();


R3INT value = ...;
R3SetAttrs(r3obj, R3CA_ClipTop, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3CA_ClipTop, &value, R3TAG_END);

ClipBottom

Attribute

ClipBottom

Identifier

R3CA_ClipBottom

JavaScript type

Integer

C type

R3INT

Description

'R3CA_ClipBottom' not documented

Syntax


jsobj.SetClipBottom(value);
value = jsobj.GetClipBottom();


R3INT value = ...;
R3SetAttrs(r3obj, R3CA_ClipBottom, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3CA_ClipBottom, &value, R3TAG_END);

DrawContextClass

Attribute

DrawContextClass

Identifier

R3CA_DrawContextClass

JavaScript type

Integer

C type

R3INT

Description

Class id of the drawing context object to be created

Syntax


jsobj.SetDrawContextClass(value);


R3INT value = ...;
R3SetAttrs(r3obj, R3CA_DrawContextClass, value, R3TAG_END);

Semaphore

Attribute

Semaphore

Identifier

R3CA_Semaphore

JavaScript type

Object

C type

R3OBJ*

Description

for internal use only

Syntax


jsobj.SetSemaphore(value);


R3OBJ* value = ...;
R3SetAttrs(r3obj, R3CA_Semaphore, value, R3TAG_END);

Depth

Attribute

Depth

Identifier

R3CA_Depth

JavaScript type

Integer

C type

R3INT

Description

depth of the canvas

Syntax


jsobj.SetDepth(value);


R3INT value = ...;
R3SetAttrs(r3obj, R3CA_Depth, value, R3TAG_END);

Modes

R3GM_TRUECOLOR
R3GM_PALETTE

Tags

Tags

R3CCA_DefaultBackgroundColorRGB