[Previous] [Contents] [Index] [Next]

PhWindowQueryVisible()

Query a visible extent

Synopsis:

int PhWindowQueryVisible( unsigned flag,
                          PhRid_t rid,
                          unsigned input_group,
                          PhRect_t *rect );

Description:

If rid is zero, this function calculates the visible extent based on the region type specified in flag.

If rid is nonzero, PhWindowQueryVisible() calculates the visible extent by finding every region intersecting with rid that matches the region type specified in flag.

The input_group argument indicates which input group the visible extent must intersect with:

You must set flags to one of the following:

Ph_QUERY_GRAPHICS
Return a graphics driver rectangle.
Ph_QUERY_INPUT_GROUP
Return input_group's rectangle.
Ph_QUERY_EXACT
The visible extent that the function finds must match both input_group and rid; otherwise, rid is a hint.
Ph_QUERY_IG_POINTER
Use the current location of input_group's pointer (rid is ignored).
Ph_QUERY_IG_REGION
Use input_group's rectangle.

If flags is 0, Ph_QUERY_GRAPHICS is assumed.

PhWindowQueryVisible() places the visible extent in rect.

Returns:

0
The rect argument is valid.
-1
The rect argument is invalid.

Examples:

Determine the absolute coordinates of the current console:

PhRect_t extent;

if( PhWindowQueryVisible( Ph_QUERY_GRAPHICS, 0, 
        input_group, &extent ) == 0 ) {
     printf( "Upper left: (%d,%d) Lower right: (%d,%d)\n",
             extent.ul.x, extent.ul.y,
             extent.lr.x, extent.lr.y );
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

[Previous] [Contents] [Index] [Next]