PhQueryRids()

Get a list of regions

Synopsis:

int PhQueryRids( unsigned flags,
                 PhRid_t rid,
                 unsigned input_group,
                 unsigned type,
                 unsigned sense,
                 PhRid_t emitter,
                 const PhRect_t *rect,
                 PhRid_t rids[],
                 int num );

Library:

ph

Description:

This function builds a list of up to num regions in the rids array. The other parameters specify which regions are to be included in the list:

flags
The possible flag bits are:
rid
Consider regions that intersect with the region with this ID. Set rid to 0 to consider all regions.
input_group
Consider regions that belong to this input group (0 means any).

To determine the current input group, call PhInputGroup(), passing to it the current event, if any.

type
Consider regions of these types:

Set type to 0 (i.e. all bits off) to consider all types of regions.

sense
Consider regions that are sensitive or opaque to these event types. The possible bits are:

Set sense to 0 (i.e. all bits off) to consider regions regardless of their sensitivity.

emitter
The region to begin the query from.
rect
A pointer to a PhRect_t structure that specifies the area (relative to emitter's origin) that other regions must intersect to be considered in the query. This can be NULL.

Returns:

The number of regions found, or -1 if an error occurred.


Note: If this function returns -1, check errno. If it's ENOMSG, there are no pending Photon events; this isn't really an error.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhEvent_t, PhRect_t