Module interface:gfx - Graphics infrastructure interface

Graphics infrastructure interface. The constants, protocols and types defined in gfxproto.inc provide the general graphics infrastructure for RMoX.

Index

Declarations

gfxproto.inc:27Data type GFX.CR

DATA TYPE GFX.CR

Clipping rectangle, as array of [x, y, width, height].

gfxproto.inc:29Data type GFX.ARGB

DATA TYPE GFX.ARGB

ARGB pixel data type, arranged as (a << 24) \/ (r << 16) \/ (g << 8) \/ b.

gfxproto.inc:31Data type GFX.POINT

DATA TYPE GFX.POINT

Single point, arranged as [x, y].

gfxproto.inc:33Data type GFX.POINTPAIR

DATA TYPE GFX.POINTPAIR

Pair of points, arranged as [x1, y1, x2, y2].

gfxproto.inc:35Data type GFX.RECT

DATA TYPE GFX.RECT

General rectangle, arranged as [x, y, width, height].

gfxproto.inc:37Data type GFX.DIM

DATA TYPE GFX.DIM

General dimension, arranged as [width, height].

gfxproto.inc:39Data type GFX.XYR

DATA TYPE GFX.XYR

General point and radius, arranged as [x, y, radius].

gfxproto.inc:41Data type GFX.XY2R

DATA TYPE GFX.XY2R

General point and two radii, arranged as [x, y, x-radius, y-radius].

gfxproto.inc:43Data type GFX.APAIR

DATA TYPE GFX.APAIR

General angle pair, arranged as [t0, t1].

gfxproto.inc:46Data type GFX.CID

DATA TYPE GFX.CID

Canvas identifier type (hardware buffer ID where relevant).

gfxproto.inc:49Record GFX.CANVAS

DATA TYPE GFX.CANVAS

Graphics canvas descriptor.

gfxproto.inc:51Variable id

GFX.CID

Canvas ID.

gfxproto.inc:52Variable size

GFX.RECT

Canvas size.

gfxproto.inc:53Variable bpp

INT

Canvas bits-per-pixel.

gfxproto.inc:54Variable capabilities

INT

Canvas flags (see GUI.FB.FEAT).

gfxproto.inc:58Constant GFX.CANVAS.DEFAULT.ID

VAL INT GFX.CANVAS.DEFAULT.ID

Default canvas ID (however that is interpreted by devices).

gfxproto.inc:61Data type GFX.UPD

DATA TYPE GFX.UPD

Graphics canvas update type, arranged as [canvas-ID, dst-x, dst-y, width, height].

gfxproto.inc:64Protocol P.GFXUPDATE.IN

PROTOCOL P.GFXUPDATE.IN

Graphics update input protocol.

gfxproto.inc:66Tag update

update; GFX.UPD

IDs of buffers/canvasses that want to redraw.

gfxproto.inc:67Tag disconnect

disconnect

Disconnecting canvas (shut-down update handler).

gfxproto.inc:71Channel type CT.GFXUPDATE

CHAN TYPE CT.GFXUPDATE

Graphics update channel-type.

gfxproto.inc:73Variable in?

CHAN P.GFXUPDATE.IN

Update notifications.

gfxproto.inc:77Protocol P.GFXCANVAS.IN

PROTOCOL P.GFXCANVAS.IN

Graphics canvas input protocol.

gfxproto.inc:80Tag disconnect

disconnect

Disconnect/destroy canvas, responds with (ok |~| error).

gfxproto.inc:82Tag query

query

Query canvas, responds with query.

gfxproto.inc:86Tag clear

clear; GFX.ARGB; GFX.CR

Clear canvas.

Parameters:

GFX.ARGB colour Colour to clear to.
GFX.CR cr Clip-rectangle.

gfxproto.inc:91Tag line

line; GFX.POINTPAIR; GFX.ARGB; GFX.CR

Draw a line on the canvas.

Parameters:

GFX.POINTPAIR points Pair of points to draw line between.
GFX.ARGB colour Colour of the line.
GFX.CR cr Clip-rectangle.

gfxproto.inc:97Tag linestop

linestop; GFX.POINTPAIR; GFX.ARGB; GFX.ARGB; GFX.CR

Draw a line on the canvas until a particular coloured pixel is encountered, responds with linestop.

Parameters:

GFX.POINTPAIR points Pair of points to draw line between.
GFX.ARGB colour Colour of the line.
GFX.ARGB stop.colour Colour to stop at.
GFX.CR cr Clip-rectangle.

gfxproto.inc:102Tag rectangle

rectangle; GFX.RECT; GFX.ARGB; GFX.CR

Draw a filled rectangle on the canvas.

Parameters:

GFX.RECT rect Rectangle position and size.
GFX.ARGB colour Colour of the rectangle.
GFX.CR cr Clip-rectangle.

gfxproto.inc:108Tag set.bitmap

set.bitmap; GFX.POINT; GFX.ARGB; MOBILE [][]INT32; GFX.CR

Draw a bitmap on the canvas.

Parameters:

GFX.POINT pos Position at which to draw the graphic.
GFX.ARGB t.colour Transparency colour.
MOBILE [][]INT32 bitmap Bitmap to draw.
GFX.CR cr Clip-rectangle.

gfxproto.inc:113Tag circle

circle; GFX.XYR; GFX.ARGB; GFX.CR

Draw a filled circle on the canvas.

Parameters:

GFX.XYR circ Circle centre and radius.
GFX.ARGB colour Colour of the circle.
GFX.CR cr Clip-rectangle.

gfxproto.inc:118Tag ellipse

ellipse; GFX.XY2R; GFX.ARGB; GFX.CR

Draw a filled ellipse on the canvas.

Parameters:

GFX.XY2R ellip Ellipse centre and radii.
GFX.ARGB colour Colour of the ellipse.
GFX.CR cr Clip-rectangle.

gfxproto.inc:126Tag text

text; INT; GFX.POINT; MOBILE []BYTE; GFX.ARGB; GFX.ARGB; GFX.CR

Draw some text on the canvas.

Parameters:

INT font.id Font id to use (from font-service).
GFX.POINT pos Position to draw text at.
MOBILE []BYTE string Text string.
GFX.ARGB fg.colour Foreground colour.
GFX.ARGB bg.colour Background colour.
GFX.CR cr Clip-rectangle.

gfxproto.inc:128Tag render.getbuf

render.getbuf

Get render buffer, responds with render.buf.

gfxproto.inc:131Tag render.return

render.return; MOBILE [][]INT32

Return render better.

Parameters:

MOBILE [][]INT32 buf Framebuffer.

gfxproto.inc:134Tag hold.update

hold.update; BOOL

Control hold of graphics updates.

Parameters:

BOOL hold Whether to hold graphics updates or not.

gfxproto.inc:141Protocol P.GFXCANVAS.OUT

PROTOCOL P.GFXCANVAS.OUT

Graphics canvas output protocol.

gfxproto.inc:143Tag ok

ok

Generic ok where required.

gfxproto.inc:144Tag error

error; INT

Generic error where required.

gfxproto.inc:145Tag query

query; GFX.CANVAS

Response to query message.

gfxproto.inc:146Tag render.buf

render.buf; MOBILE [][]INT32

Returned render buffer from render.getbuf.

gfxproto.inc:147Tag linestop

linestop; GFX.POINT

Returned position where linestop stopped.

gfxproto.inc:148Tag winmgr

winmgr; SHARED MOBILE.CHAN

Returned handle for window manager control (see CT.WINPROTO).

gfxproto.inc:152Protocol P.GFXCANVAS.CTL

PROTOCOL P.GFXCANVAS.CTL

Graphics canvas control protocol.

gfxproto.inc:154Tag update.grab

update.grab; CT.GFXUPDATE!

Re-direct canvas updates to here.

gfxproto.inc:155Tag update.ungrab

update.ungrab

Stop re-directing canvas updates.

gfxproto.inc:156Tag get.winmgr

get.winmgr

Request window-management connection (provides events, window control, etc.), responds with (winmgr |~| error).

gfxproto.inc:160Channel type CT.GFXCANVAS

CHAN TYPE CT.GFXCANVAS

Graphics canvas channel-type.

gfxproto.inc:162Variable in?

CHAN P.GFXCANVAS.IN

Commands sent to the graphics canvas.

gfxproto.inc:163Variable out!

CHAN P.GFXCANVAS.OUT

Responses from graphics canvas.

gfxproto.inc:164Variable ctl?

CHAN P.GFXCANVAS.CTL

Control messages for graphics canvas (not for applications typically).

gfxproto.inc:171Protocol P.GFXPROTO.IN

PROTOCOL P.GFXPROTO.IN EXTENDS P.GFXCANVAS.IN

Graphics input protocol. This provides input to the core graphics process. The protocol extends , which provides drawing capabilities, applied to the default canvas (background).

gfxproto.inc:192Tag set.pointer

set.pointer; GFX.POINT

Set pointer position.

Parameters:

GFX.POINT pos Position.

gfxproto.inc:195Tag new.canvas

new.canvas; GFX.RECT

Create a new canvas, responds with (canvas |~| error).

Parameters:

GFX.RECT dim Canvas dimensions.

gfxproto.inc:199Tag blit

blit; [2]GFX.CID; [6]INT

Copies bits from one canvas to another.

Parameters:

[2]GFX.CID cids Source and destination canvas IDs.
[6]INT pos Blit position, as array of [source X, source Y, destination X, destination Y, width, height].

gfxproto.inc:206Protocol P.GFXPROTO.OUT

PROTOCOL P.GFXPROTO.OUT EXTENDS P.GFXCANVAS.OUT

Graphics output protocol. This provides output from the core graphics process. The protocol extends , which provides responses to drawing and other commands, applied to the default canvas (background).

gfxproto.inc:220Tag canvas

canvas; GFX.CANVAS; SHARED CT.GFXCANVAS!

Returned canvas.

Parameters:

GFX.CANVAS cnvinfo Information about the new canvas.
SHARED CT.GFXCANVAS! canvas Connection to new canvas.

gfxproto.inc:224Protocol P.GFXPROTO.EVENTS

PROTOCOL P.GFXPROTO.EVENTS

Graphics event protocol.

gfxproto.inc:226Tag pointer.enter

pointer.enter; GFX.POINT

Pointer entering window, provides position.

gfxproto.inc:227Tag pointer.leave

pointer.leave; GFX.POINT

Pointer leaving window, provides last position.

gfxproto.inc:228Tag pointer.click

pointer.click; GFX.POINT; INT

Button click in window, provides position and button.

gfxproto.inc:229Tag pointer.unclick

pointer.unclick; GFX.POINT; INT

Button unclick in window, provides position and button.

gfxproto.inc:231Tag expose

expose; GFX.RECT

Window area exposed, provides affected rectangle.

gfxproto.inc:235Channel type CT.GFXPROTO

CHAN TYPE CT.GFXPROTO

Graphics protocol channel-type.

gfxproto.inc:237Variable in?

CHAN P.GFXPROTO.IN

Requests to graphics core.

gfxproto.inc:238Variable out!

CHAN P.GFXPROTO.OUT

Responses from graphics core.

gfxproto.inc:239Variable e.out!

CHAN P.GFXPROTO.EVENTS

Events from graphics core.