Libraries
Graph Source Code
 previous   up   next 

Function Summary
void
flushGraphic
Flush graphic commands such that the contents of all windows is up to date.
PRIMITIVE_WINDOW
openSubWindow ( in PRIMITIVE_WINDOW: aWindow, ref integer: xPos, ref integer: yPos, ref integer: width, ref integer: height)
Create a sub window inside of parent_window.
void
setWindowName (in PRIMITIVE_WINDOW: aWindow, in string: windowName)
Set the window name (title) of aWindow.
void
setCursorVisible (in PRIMITIVE_WINDOW: aWindow, in boolean: visible)
Set the visibility of the mouse cursor in aWindow.
PRIMITIVE_WINDOW
capturePixmap ( ref integer: left, ref integer: upper, ref integer: width, ref integer: height)
Capture a rectangular area from the screen.
void
copyArea (in PRIMITIVE_WINDOW: sourceWindow, inout PRIMITIVE_WINDOW: destWindow, ref integer: src_x, ref integer: src_y, ref integer: width, ref integer: height, ref integer: dest_x, ref integer: dest_y)
Copy a rectangular area from sourceWindow to destWindow.
pixel
rgbPixel (ref integer: red, ref integer: green, ref integer: blue)
Create a pixel from the red, green and blue colors of light.
integer
screenHeight
Determine the height of the screen in pixels.
integer
screenWidth
Determine the width of the screen in pixels.
integer
height (in PRIMITIVE_WINDOW: aWindow)
Determine the height of the window drawing area in pixels.
integer
width (in PRIMITIVE_WINDOW: aWindow)
Determine the width of the window drawing area in pixels.
integer
xPos (in PRIMITIVE_WINDOW: aWindow)
Determine the X position of the top left corner of a window in pixels.
integer
yPos (in PRIMITIVE_WINDOW: aWindow)
Determine the Y position of the top left corner of a window in pixels.
void
setPos (in PRIMITIVE_WINDOW: aWindow, in integer: xPos, in integer: yPos)
Move the top left corner of a window to the coordinates x/y.
void
setSize (in PRIMITIVE_WINDOW: aWindow, in integer: width, in integer: height)
Set the size of the window aWindow to width and height.
void
toBottom (in PRIMITIVE_WINDOW: aWindow)
Lower a window to the bottom so that it does not obscure any other window.
void
toTop (in PRIMITIVE_WINDOW: aWindow)
Raise a window to the top so that no other window obscures it.
array integer
getBorder (in PRIMITIVE_WINDOW: aWindow)
Determine the border widths of a window in pixels.
integer
pointerXPos (in PRIMITIVE_WINDOW: aWindow)
Return the X position of the pointer relative to the specified window.
integer
pointerYPos (in PRIMITIVE_WINDOW: aWindow)
Return the Y position of the pointer relative to the specified window.
void
setPointerPos (in PRIMITIVE_WINDOW: aWindow, in integer: xPos, in integer: yPos)
Set the pointer x and y position relative to aWindow.
void
selectInput (in PRIMITIVE_WINDOW: aWindow, in char: aKey, in boolean: active)
Select if aKey is returned as key, or if it triggers a default action.
pointList
genPointList (ref array integer: coordinates)
The function 'genPointList' creates a 'pointList'.
array integer
xyArray (ref pointList: aPointList)
Converts a 'pointList' to an array of (X,Y) coordinates.

Function Detail

flushGraphic

const proc: flushGraphic

Flush graphic commands such that the contents of all windows is up to date. An animation can be created by using flushGrapic every time before the program waits for a fraction of a second.


openSubWindow

const func PRIMITIVE_WINDOW: openSubWindow ( in PRIMITIVE_WINDOW: aWindow, ref integer: xPos, ref integer: yPos, ref integer: width, ref integer: height)

Create a sub window inside of parent_window. The new sub window has no window decorations and is not managed by the window manager. If the empty window is used as parent_window an unmanaged top level window without window decorations is generated. The coordinates xPos and yPos are measured relative to the top left corner of the parent_window drawing area (inside of the window decorations). If the empty window is used as parent_window the coordinates xPos and yPos are measured relative to the top left corner of the screen.

Parameters:
parent-window - Parent window (can be the empty window).
xPos - X-position of the left corner of the new window.
yPos - Y-position of the left corner of the new window.
width - Width of the new window.
height - Height of the new window.
Returns:
the new generated window.

setWindowName

const proc: setWindowName (in PRIMITIVE_WINDOW: aWindow, in string: windowName)

Set the window name (title) of aWindow.

Parameters:
aWindow - Window for which the name should be set.
windowName - New name (title) of the window.

setCursorVisible

const proc: setCursorVisible (in PRIMITIVE_WINDOW: aWindow, in boolean: visible)

Set the visibility of the mouse cursor in aWindow.

Parameters:
aWindow - Window for which the mouse cursor visibility is set.
visible - TRUE, if the mouse cursor should be visible in aWindow, or FALSE, if the mouse curser should be invisible in aWindow.

capturePixmap

const func PRIMITIVE_WINDOW: capturePixmap ( ref integer: left, ref integer: upper, ref integer: width, ref integer: height)

Capture a rectangular area from the screen. The function takes a screenshot of the rectangular area. The left and upper coordinates are measured relative to the top left corner of the screen.

Parameters:
left - X-position of the upper left corner of the capture area.
upper - Y-position of the upper left corner of the capture area.
width - Width of the capture area.
height - Height of the capture area.
Returns:
the content of the rectangular screen area as pixmap.
Raises:
RANGE_ERROR - If height or width are negative.

copyArea

const proc: copyArea (in PRIMITIVE_WINDOW: sourceWindow, inout PRIMITIVE_WINDOW: destWindow, ref integer: src_x, ref integer: src_y, ref integer: width, ref integer: height, ref integer: dest_x, ref integer: dest_y)

Copy a rectangular area from sourceWindow to destWindow. Coordinates are measured relative to the top left corner of the corresponding window drawing area (inside of the window decorations).

Parameters:
sourceWindow - Source window.
destWindow - Destination window.
src_x - X-position of the top left corner of the source area.
src_y - Y-position of the top left corner of the source area.
width - Width of the rectangular area.
height - Height of the rectangular area.
dest_x - X-position of the top left corner of the destination area.
dest_y - Y-position of the top left corner of the destination area.

rgbPixel

const func pixel: rgbPixel (ref integer: red, ref integer: green, ref integer: blue)

Create a pixel from the red, green and blue colors of light. The range for red, green and blue is from 0 to 65535.


screenHeight

const func integer: screenHeight

Determine the height of the screen in pixels.


screenWidth

const func integer: screenWidth

Determine the width of the screen in pixels.


height

const func integer: height (in PRIMITIVE_WINDOW: aWindow)

Determine the height of the window drawing area in pixels. This excludes window decorations at top and bottom. Add top and bottom border widths to get the height inclusive window decorations.


width

const func integer: width (in PRIMITIVE_WINDOW: aWindow)

Determine the width of the window drawing area in pixels. This excludes window declarations left and right. Add left and right border widths to get the width inclusive window decorations.


xPos

const func integer: xPos (in PRIMITIVE_WINDOW: aWindow)

Determine the X position of the top left corner of a window in pixels. If window decorations are present this uses the top left corner of the window decorations. For a sub window the X position is relative to the top left corner of the parent window drawing area (inside of the window decorations). For top level windows the X position is relative to the top left corner of the screen.

Raises:
RANGE_ERROR - If actual_window is a pixmap.

yPos

const func integer: yPos (in PRIMITIVE_WINDOW: aWindow)

Determine the Y position of the top left corner of a window in pixels. If window decorations are present this uses the top left corner of the window decorations. For a sub window the Y position is relative to the top left corner of the parent window drawing area (inside of the window decorations). For top level windows the Y position is relative to the top left corner of the screen.

Raises:
RANGE_ERROR - If actual_window is a pixmap.

setPos

const proc: setPos (in PRIMITIVE_WINDOW: aWindow, in integer: xPos, in integer: yPos)

Move the top left corner of a window to the coordinates x/y. If window decorations are present the top left corner of the window decorations will be at the position x/y. For a sub window the position is relative to the top left corner of the parent window drawing area (inside of the window decorations). For top level windows the position is relative to the top left corner of the screen.


setSize

const proc: setSize (in PRIMITIVE_WINDOW: aWindow, in integer: width, in integer: height)

Set the size of the window aWindow to width and height.


toBottom

const proc: toBottom (in PRIMITIVE_WINDOW: aWindow)

Lower a window to the bottom so that it does not obscure any other window.


toTop

const proc: toTop (in PRIMITIVE_WINDOW: aWindow)

Raise a window to the top so that no other window obscures it.


getBorder

const func array integer: getBorder (in PRIMITIVE_WINDOW: aWindow)

Determine the border widths of a window in pixels. These are the widths of the window decorations in the succession top, right, bottom, left.

Returns:
an array with border widths (top, right, bottom, left).

pointerXPos

const func integer: pointerXPos (in PRIMITIVE_WINDOW: aWindow)

Return the X position of the pointer relative to the specified window. The point of origin is the top left corner of the drawing area of the given 'aWindow' (inside of the window decorations). If 'aWindow' is the empty window the pointer X position is relative to the top left corner of the screen.


pointerYPos

const func integer: pointerYPos (in PRIMITIVE_WINDOW: aWindow)

Return the Y position of the pointer relative to the specified window. The point of origin is the top left corner of the drawing area of the given 'aWindow' (inside of the window decorations). If 'aWindow' is the empty window the pointer Y position is relative to the top left corner of the screen.


setPointerPos

const proc: setPointerPos (in PRIMITIVE_WINDOW: aWindow, in integer: xPos, in integer: yPos)

Set the pointer x and y position relative to aWindow. The point of origin is the top left corner of the drawing area of the given aWindow (inside of the window decorations). If aWindow is the empty window the pointer x and y position is relative to the top left corner of the screen.


selectInput

const proc: selectInput (in PRIMITIVE_WINDOW: aWindow, in char: aKey, in boolean: active)

Select if aKey is returned as key, or if it triggers a default action. A program might be notified when a window is resized. By default, this notification is switched off. It can be switched on with:

selectInput(curr_win, KEY_RESIZE, TRUE);

By default, closing a window terminates the program. To get a notification for a window close (instead of a program termination) do:

selectInput(curr_win, KEY_CLOSE, TRUE);

If the notification is turned on the function getc(GRAPH_KEYBOARD) might return the corresponding notification character (KEY_RESIZE or KEY_CLOSE).

Parameters:
aWindow - Window for which the key behavior is specified.
aKey - KEY_CLOSE or KEY_RESIZE.
active - TRUE if reading from the KEYBOARD returns aKey, or FALSE if aKey triggers a default action.

genPointList

const func pointList: genPointList (ref array integer: coordinates)

The function 'genPointList' creates a 'pointList'. It converts an array of alternate x and y values to a 'pointList'.

Returns:
a pointList with the points from the array.
Raises:
RANGE_ERROR - If the length of the array is odd.

xyArray

const func array integer: xyArray (ref pointList: aPointList)

Converts a 'pointList' to an array of (X,Y) coordinates.

Returns:
an array of alternate x and y values.


 previous   up   next