[Top] [Prev] [Next]

context - graphics environment

include "draw.m";
draw:= load Draw Draw->PATH;
Context: adt
{
  screen:  ref Screen;
  display: ref Display;
  cir:     chan of int;
  ckbd:    chan of int;
  cptr:    chan of ref Pointer;
  ctoappl: chan of int;
  ctomux:  chan of int;
};

Description

The Context abstract data type encapsulates the data types and channels used by an interactive application. A reference to the Context is passed as the first argument to an application when it begins execution:

include "draw.m"; 
Command: module 
{
     init:  fn(nil: ref Draw->Context; nil: list of string);
};

Most programs do not create a Context but inherit one from their parent, typically a shell or window system.

General Interfaces
screen

The Screen adt to which the application is connected; can be nil. See screen - type to define the abstract data structures for the windows on a display.

display

The Display adt to which the application is connected; can be nil. See display - connection to draw device.

MUX Interfaces
cir

A channel of type int that delivers events from an infrared remote control device, if one is present. See the following discussion and ir for more information.

ckbd

A channel of type int that delivers keystrokes from a keyboard.

cptr

A channel of type ref Pointer that delivers events from a pointing device such as a mouse.

ctoappl

A channel of type int that delivers control messages to the application from the Mux application multiplexer. One message is defined:

MAtop

Requests the application to make its set of windows fully visible.

ctomux

A channel of type int used by the application to send messages to the Mux regarding the application's use of system devices. The defined messages are:

AMstartir

The application is ready to accept IR-data on the cir channel.

AMstartkbd

The application is ready to accept keyboard data on the ckbd channel.

AMstartptr

The application is ready to accept Pointer data on the cptr channel.

AMnewpin

The application needs a PIN.

AMexit

An application should send this message before it exits, to allow Mux to recover resources.

See Also
ir - infrared remote control in Chapter 15



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.