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

PhRegionQuery()

Retrieve information about a region

Synopsis:

int PhRegionQuery( PhRid_t rid,
                   PhRegion_t *region,
                   PhRect_t *rect,
                   void *data,
                   unsigned data_len );

Description:

This function returns information about the region identified by rid. Upon completion, region and rect contain a description of the region.

If the region has data attached to it, then the data, up to data_len bytes, is copied into data. This data may consist of smaller blocks of data of different types, each preceded by a PhRegionDataHdr_t structure. To find a specific type of data in the region's data, call PhRegionDataFindType().

Returns:

0
Success.
-1
An error occurred.

Examples:

The following example gets information about the device region:

PhRegion_t region; PhRect_t rect;

if( !PhRegionQuery( Ph_DEV_RID, &region,
                    &rect, NULL, 0 ) ) {
  printf( "Sensitive to: %.8x Opaque to: %.8x\n", 
    region.events_sense, region.events_opaque );
  printf( "Located at: {(%d,%d),(%d,%d)}\n", 
     region.origin.x + rect.ul.x,
     region.origin.y + rect.ul.y, 
     region.origin.x + rect.lr.x,
     region.origin.y + rect.lr.y );
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhRegion_t, PhRegionChange(), PhRegionOpen()


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