GEOS SDK TechDocs
|
|
|
5 Working with Visible Object Trees
|
7 VisClass Error Checking
MSG_VIS_LAYER_SET_DOC_BOUNDS, MSG_VIS_LAYER_GET_DOC_BOUNDS, MSG_VIS_LAYER_INSERT_OR_DELETE_SPACE
The GEOS graphic space is built on a basis of 16-bit coordinates. A few applications, however, will require much more space for their documents. GEOS also supports the special use of 32-bit coordinates; applications using these coordinates are said to be using the "large document" model.
The visible object library was originally designed with 16-bit coordinates in the default GEOS graphics space. All instance data, message parameters and return values, and coordinates are assumed to be word-sized integers. A large-document visible object library is not provided primarily because there is no single visible model that works well with large coordinates, and also because no single large model works efficiently for all applications.
It is possible, however, for applications to subclass the standard visible classes in order to get them to support the large document model. In order to do this, however, you must understand the basic issues involved with the large model and with using 32-bit coordinates.
As the application developer, you should read the following sections if you will be using the large document model. Each one deals with a different problem facing applications that want large documents.
In addition, some complex applications may offer several different visible layers in the program. For example, a spreadsheet might want to include a graphic object layer for graphics and charts. The content object of the visible tree can be set up to have several different children, each of which is a "layer" that manages its own objects in the window.
The content in charge of the layers must occasionally set and retrieve the document bounds of its children. For example, if the user wants to set the page size of the spreadsheet that has a graphical layer, the content object must set the new size for all its children. To retrieve the current document bounds of a particular object, send it a
MSG_VIS_LAYER_GET_DOC_BOUNDS
. To set the document bounds, send a
MSG_VIS_LAYER_SET_DOC_BOUNDS
. In addition, the application may add or delete space into a layer with
MSG_VIS_LAYER_INSERT_OR_DELETE_SPACE
; for example, if a spreadsheet needs to resize a column, it must send this message to the graphic layer to ensure the layers handle the sizing properly.
void MSG_VIS_LAYER_SET_DOC_BOUNDS(@stack
sdword bottom,
sdword right,
sdword top,
sdword left);
This message sets the 32-bit document bounds for a particular layer object. This message is typically sent by a VisContent object to its children, which are assumed to be layer objects.
Source: Unrestricted--typically sent by a VisContent to its large children.
Destination: Any large (32-bit) visible object or composite.
Parameters:
all
The four parameters describe the new bounds of the large document. Since layer objects typically cover the entire document, the layer object will set its bounds to these values.
Return: Nothing.
Interception: All layer objects and large objects must subclass this message. There is no default handler.
void MSG_VIS_LAYER_GET_DOC_BOUNDS(
RectDWord *bounds);
This message returns the 32-bit document bounds of a particular large visible object. Typically, a VisContent will query its large children with this message when it needs to know their bounds.
Source: Unrestricted--typically sent by a VisContent to its large children.
Destination: Any large (32-bit) visible object or composite.
Parameters:
bounds
A pointer to an empty
RectDWord
structure that describes a set of large bounds.
Return: The pointer to the filled
RectDWord
structure. The structure should, upon return, contain the 32-bit bounds of the large visible object.
Interception: All layer objects and large objects must subclass this message. There is no default handler.
Structures: The
RectDWord
structure is show below for convenience:
typedef struct {
sdword RD_left;
sdword RD_top;
sdword RD_right;
sdword RD_bottom;
} RectDWord;
void MSG_VIS_LAYER_INSERT_OR_DELETE_SPACE(
InsertDeleteSpaceTypes type,
DWFixed spaceY,
DWFixed spaceX,
DWFixed positionY,
DWFixed positionX)
This message should be sent by one layer to another when it changes sizes. An example would be a spreadsheet application with a graphic layer; when a column in the spreadsheet resizes, the graphic layer must resize accordingly.
Source: Any visible layer object.
Destination: The visible layer object requiring resizing.
Parameters:
type
InsertDeleteSpaceType
specifying what sort of operation is taking place.
Return: Nothing.
Interception: This message must be intercepted; it has no default behavior.
The 16-Bit Limit on Visual Bounds
GEOS SDK TechDocs
|
|
|
5 Working with Visible Object Trees
|
7 VisClass Error Checking