Jump to content

GreGetBoundsData: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
 
Line 7: Line 7:


== Parameters ==
== Parameters ==
; hdc (HDC) - input : Device context handle.
;hdc (HDC) - input : Device context handle.
; flOptions (ULONG) - input : Option flags.
;flOptions (ULONG) - input : Option flags.
:The option flags define which bounding rectangle the handling routine should return. Valid values are:
:The option flags define which bounding rectangle the handling routine should return. Valid values are:
:*GBD_GPI Return GPI bounds in model space coordinates
:*GBD_GPI Return GPI bounds in model space coordinates
Line 36: Line 36:
#include <os2.h>
#include <os2.h>


HDC      hdc;          /* Device context handle. */
HDC      hdc;          /* Device context handle. */
ULONG    flOptions;    /* Option flags. */
ULONG    flOptions;    /* Option flags. */
PRECTL    pBoundsData;
PRECTL    pBoundsData;
PVOID    pInstance;    /* Pointer to instance data. */
PVOID    pInstance;    /* Pointer to instance data. */
ULONG    lFunction;    /* High-order WORD=flags; low-order WORD=NGreGetBoundsData. */
ULONG    lFunction;    /* High-order WORD=flags; low-order WORD=NGreGetBoundsData. */
BOOL      rc;          /* Return Code. */
BOOL      rc;          /* Return Code. */


rc = GreGetBoundsData(hdc, flOptions, pBoundsData, pInstance, lFunction);
rc = GreGetBoundsData(hdc, flOptions, pBoundsData, pInstance, lFunction);

Latest revision as of 18:30, 4 October 2023

GreGetBoundsData stores the bounding rectangle of previous drawing primitives at the address indicated by pBoundsData.

This function must be supported by the presentation driver. GreGetBoundsData is called by GpiQueryBoundaryData in response to an application's request for the current boundary data for a presentation space and device context pair. This function can be handled by bit-map simulation.

Syntax

GreGetBoundsData(hdc, flOptions, pBoundsData, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
flOptions (ULONG) - input
Option flags.
The option flags define which bounding rectangle the handling routine should return. Valid values are:
  • GBD_GPI Return GPI bounds in model space coordinates
  • GBD_USER Return current user bounds in screen coordinates and reset user bounds to their initial value
pBoundsData (PRECTL) - input
Pointer to the address for the returned RECTL structure that defines the specified bounding rectangle.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreGetBoundsData.

Returns

rc (BOOL) - returns
Return Code.

On completion, the handling routine must return a BOOLEAN value to indicate success or an error.

TRUE Successful
FALSE Error

Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:

PMERR_DEV_FUNC_NOT_INSTALLED
PMERR_INV_HDC

Remarks

Simulation support: None. This function is mandatory for all drivers.

All presentation drivers must support GPI bounds. These bounds should be transformed to model space coordinates when they are accumulated. Display drivers must also support user bounds in screen coordinates. Bounds are inclusive. A NULL boundary is represented by the minimum coordinates of the rectangle, which are greater than its maximum coordinates. If the bounds have been reset, a NULL value is returned for pBoundsData.

Example Code

#define INCL_GRE_DEVMISC3
#include <os2.h>

HDC       hdc;          /* Device context handle. */
ULONG     flOptions;    /* Option flags. */
PRECTL    pBoundsData;
PVOID     pInstance;    /* Pointer to instance data. */
ULONG     lFunction;    /* High-order WORD=flags; low-order WORD=NGreGetBoundsData. */
BOOL      rc;           /* Return Code. */

rc = GreGetBoundsData(hdc, flOptions, pBoundsData, pInstance, lFunction);