GEOS SDK TechDocs
|
|
1.2 Fields That Affect the View
|
1.4 Fields That Affect Input Events
VCNI_docOrigin, VCNI_scaleFactor, MSG_VIS_CONTENT_SET_DOC_BOUNDS, MSG_VIS_CONTENT_RECALC_SIZE_BASED_ON_VIEW
The GenView object maintains quite a bit of information about the document as managed by the content object. The content must also keep information about the document and how the view is displaying it. This information is stored in two fields,
VCNI_docOrigin
and
VCNI_scaleFactor
, both detailed below.
The document bounds of the content are typically equal to the bounds of the VisContent itself. The content's bounds are stored in the
VI_bounds
field inherited from
VisClass
. When a content is managing layers or large documents, however, its bounds are set to zero. It then manages its document bounds within the layer objects and the GenView. When the document bounds change, a
MSG_VIS_CONTENT_SET_DOC_BOUNDS
should be sent to the content to get it to notify all its layer children and the GenView of the new bounds. This message is shown at the end of this section.
If the content is not a large document and is set up to follow the GenView's geometry (it has either or both of VCNA_SAME_WIDTH_AS_VIEW or VCNA_SAME_HEIGHT_AS_VIEW set), it will be affected by changes in the view's geometry. During geometry updates, the view will send it a
MSG_VIS_CONTENT_RECALC_SIZE_BASED_ON_VIEW
. This message sets the content's width and/or height and therefore affects its
VI_bounds
field. This message is also shown at the end of this section.
VCNI_docOrigin
PointDWord
, which has the following structure:typedef struct {
sdword PD_x; /* x coordinate of origin */
sdword PD_y; /* y coordinate of origin */
} PointDWord;
MSG_META_CONTENT_VIEW_ORIGIN_CHANGED
to indicate the origin is different from its current setting.
VCNI_scaleFactor
PointWWFixed
structure, as follows:typedef struct {
WWFixed PF_x; /* horizontal scale factor */
WWFixed PF_y; /* vertical scale factor */
} PointWWFixed;
WWFixed
structures that determine the scale factor in each dimension consist of two elements. This structure is shown below:typedef struct {
word WWF_frac; /* fractional portion */
word WWF_int; /* integral portion */
} WWFixed;
VCNI_scaleFactor
field in the content is never set directly by the application; instead, it is set with
MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
whenever the view's scale factor changes.Messages that set these fields are discussed in Messages Received from the View .
void MSG_VIS_CONTENT_SET_DOC_BOUNDS(@stack
sdword bottom,
sdword right,
sdword top,
sdword left);
This message is used to set the document bounds of a content's large document. The content will send
MSG_GEN_VIEW_SET_DOC_BOUNDS
to its view and
MSG_VIS_LAYER_SET_DOC_BOUNDS
to each of its children with the new bounds. The recipient content
must
have the flag
VCNA_LARGE_DOCUMENT_MODEL
set in
VCNI_attrs
.
Source: Unrestricted.
Destination: Any large VisContent object--if the content is not using the large document model, an error will result.
Parameters:
bottom, right, top, left
The new document bounds in 32-bit document coordinates.
Return: Nothing.
Interception: Unlikely.
Warnings: You may only send this message to a content that is using the large document model. All other contents will not handle this message but will result in a fatal error.
SizeAsDWord MSG_VIS_CONTENT_RECALC_SIZE_BASED_ON_VIEW();
This message causes the content to recalculate its size based on the view's geometry. It will try to set its width if it has VCNA_SAME_WIDTH_AS_VIEW set, and it will try to set its height if it has VCNA_SAME_HEIGHT_AS_VIEW set.
Source: Unrestricted--typically sent by the view or by the content to itself during geometry updates.
Destination: Any VisContent object.
Parameters: None.
Return: A
SizeAsDWord
value indicating the new size of the content. Use the macros DWORD_HEIGHT and DWORD_WIDTH to extract the appropriate values.
GEOS SDK TechDocs
|
|
1.2 Fields That Affect the View
|
1.4 Fields That Affect Input Events