Table of Contents

_________________________________________________________________

NAME

dm_open - create and manipulate a display manager object.

SYNOPSIS

dm_open [pathName type [options]]

COMMAND LINE OPTIONS

Option:
-N height
Specifies the window's height (i.e number of raster lines).

Option:
-W width
Specifies the window's width.

Option:
-S size
Specifies the window's square size (i.e. width and height).

Option:
-i initproc
Specifies the initialization proc. This proc is called with the pathName as an argument.

Option:
-t 0|1
Specifies the toplevel flag. 0 indicates the display manager object is an internal window, while 1 indicates a toplevel window.

Option:
-d dpy
Specifies the display string in a format understood by X windows.

DESCRIPTION

The dm_open command creates a new window (given by the pathName argument) and makes it into a display manager object for displaying geometry. Additional options, described above, may be specified on the command line to configure aspects of the display manager object. The dm_open command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.

METHODS

The dm_open command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the display manager object. It has the following general form:

pathName option ?arg arg ...?

Option and the args determine the exact behavior of the command. The following commands are possible for display manager objects:

pathName bg ["r g b"]
Set/get the background color. The rgb components are expected to be integers between 0 and 255.

pathName bounds [xmin xmax ymin ymax zmin zmax]
Set/get the window bounds. Some display managers use this to calculate clipping planes (i.e. X).

pathName clear
Clear the drawing area using the background color.

pathName close
Close the display manager object.

pathName configure
Called to handle Configure events.

pathName debug [0|1]
Set/get debug mode. 0 indicates debugging is off while 1 indicates debugging is on.

pathName drawBegin
Begin the drawing sequence.

pathName drawEnd
End the drawing sequence. This will cause the graphics pipe to be flushed.

pathName drawGeom geo_obj(s)
Draw one or more drawable geometry objects.

pathName drawLine x1 y1 x2 y2
Draw the 2D line indicated by endpoints (x1, y1) and (x2, y2). The given coordinates are expected to be in the range [-1, 1].

pathName drawPoint x y
Draw the 2D point at position (x, y).

pathName drawSList slp
Draw the solid list specified by the solid list pointer (i.e.slp).

pathName drawString str x y size use_aspect
Draw the 2D string starting at position (x, y). The x and y coordinates are expected to be in the range [-1, 1]. The size is currently ignored. The use_aspect flag indicates whether or not to use the aspect ratio to modify the starting position.

pathName drawVList vlp
Draw the vector list specified by the vector list pointer (i.e.vlp).

pathName fg ["r g b"]
Set/get the foreground color. The rgb components are expected to be integers between 0 and 255.

pathName flush
Flushes the X server's request buffer.

pathName get_aspect
Get the window's aspect ratio (i.e. width / height).

pathName light [0|1]
Set/get light mode. 0 indicates light is off while 1 indicates light is on.

pathName linestyle [0|1]
Set/get linestyle. 0 indicates solid lines while 1 indicates dashed lines.
pathName linewidth [width]
Set/get linewidth. This setting determines how fat to draw the wireframe lines.

pathName listen [port]
Set/get the port used to listen for framebuffer clients. Port values less than zero turn off listening.

pathName loadmat mat
Load the matrix, mat, into the display manager. This is typically a model2view matrix.

pathName normal
Restore display manager to a normal mode of operation (i.e. not scaled, rotated, displaced, etc.).

pathName observer [subcommand]
This command is used to maintain a list of observers. Observers are objects who have registered an interest in when this display manager object receives pixels in its role as a framebuffer server. Whenever pixel data is received the observers on the list are notified.

pathName observer attach obs [command]
Add the specified observer, obs, to the list of observers. If command is specified then it is executed each time pixel data is received. Otherwise, the observer is expected to have an update method which is called with the name of this display manager object as an argument.

pathName observer detach obs
Remove the specified observer, obs, from the list of observers.

pathName observer show
Return the list of observers for this display manager object.

pathName perspective [0|1]
Set/get perspective mode. 0 indicates perspective is off while 1 indicates perspective is on.

pathName refreshfb
Draws/displays the pixels stored in the widget's framebuffer.

pathName size [width height]
Set/get the window size.

pathName sync
Flushes the X server's request buffer and waits until all events have been processed.

pathName zbuffer [0|1]
Set/get zbuffer mode. 0 indicates that zbuffer is off while 1 indicates zbuffer is on.

pathName zclip [0|1]
Set/get zclipping mode. 0 indicates zclipping is off while 1 indicates zclipping is on.

EXAMPLE

The following sequence creates a display manager object and draws two yellow lines that connect the opposite corners of the window.

cwish> dm_open .d X -t 0 -s 400
.d
cwish> pack .d -expand yes -fill both
cwish> .d drawBegin
cwish> .d fg "255 255 0"
cwish> .d drawLine -1 1 1 -1
cwish> .d drawLine -1 -1 1 1
cwish> .d drawEnd

ACKNOWLEDGEMENTS:

Mark L. Ulferts <mulferts@austin.dsccc.com>
        Basic layout for documenting classes.

AUTHOR

Robert G. Parker


Table of Contents