DeviceLoop
void DeviceLoop( drawingRgn, drawingProc, userData, flags ); RgnHandle drawingRgn ; Region in which you want to draw ProcPtr drawingProc ; Pointer to your drawing procedure (see below) long userData ; Data forwarded to your drawing procedure
DeviceLoopFlags flags ; Flags described below
returns none
The DeviceLoop procedure searches all active screen devices, calling your drawing procedure whenever it en counters a screen that intersects your
drawing region. You supply a handle to the region in which you wish to draw
and a pointer to your drawing procedure. The drawing region is in local
coordinates, and is the same as a window port's visRgn value, for example, after a BeginUpdate call. In the userData parameter, you pass a long integer of data that is forwarded to your drawing procedure.
If the DeviceLoop procedure en counters similar devices - having the same pixel depth, black-and-white/color setting, and matching color table seeds - it
makes only one call to your drawing procedure, pointing to the first such device
en countered. You can modify this behavior by supplying a flags parameter with
one of the following values.
Flag Meaning
singleDevices If you set the singleDevices flag, then similar devices
are not grouped together when the drawing procedure is
called. If this flag is not set, DeviceLoop only calls your drawing procedure once for each set of similar
devices, and the first one found is passed as the target
device. It is assumed to be representative of all of the
other similar devices.
dontMatchSeeds If you set the dontMatchSeeds flag, then DeviceLoop doesn't consider color table seeds when comparing
devices for similarity. DeviceLoop ignores this flag if the singleDevices flag is set.
allDevices If you set the allDevices flag, the drawingRgn
drawing procedure for all active screens. The current
port's visRgn value is not affected when this flag is set. Each time your drawing procedure is called, the current port's visRgn will have been set to the intersection of the original port's visRgn and the intersecting portion of the target device.
Your drawing procedure should be declared as follows:
typedef pascal void (*DeviceLoopDrawingProcPtr)(short depth, short
deviceFlags, GDHandle targetDevice, long userData);
The depth parameter contains the pixel size of the target device, the
deviceFlags parameter contains the gdFlags values from the target device's
graphics device record, and the targetDevice parameter is a handle to the
target device.
The long integer of user data passed to DeviceLoop is passed on to your drawing procedure.
parameter is set to NULL.