Carbon


DMDisplayModeListIteratorProcPtr

Header: Displays.h Carbon status: Supported

typedef void(* DMDisplayModeListIteratorProcPtr) (
    void *userData, 
    DMListIndexType itemIndex, 
    DMDisplayModeListEntryPtr displaymodeInfo
);

You would declare your function like this if you were to name it MyDMDisplayModeListIteratorCallback:

void MyDMDisplayModeListIteratorCallback (
    void *userData, 
    DMListIndexType itemIndex, 
    DMDisplayModeListEntryPtr displaymodeInfo
);
Parameter descriptions
userData

A pointer to data about mode changes provided by the user. This is data passed into DMGetIndexedDisplayModeFromList

itemIndex

Specifies the list entry. See DMListIndexType for more information. This is the index passed into DMGetIndexedDisplayModeFromList.

displaymodeInfo

A pointer to a structure of type DMDisplayModeListEntryRec that provides display mode information.

DISCUSSION

The function DMGetIndexedDisplayModeFromList uses this callback function to retrieve and return information about a display mode to the caller of DMGetIndexedDisplayModeFromList.

When you implement this function, the pointer you pass to the DMGetIndexedDisplayModeFromList function should be a universal procedure pointer with the following type definition:

typedef (DMDisplayModeListIteratorProcPtr) DMDisplayModeListIteratorUPP;

To create a universal procedure pointer for your application-defined function, you should use the NewDMDisplayModeListIteratorUPP function as follows:

DMDisplayModeListIteratorUPP MyDMDisplayModeListIteratorUPP;

MyDMDisplayModeListIteratorUPP = NewDMDisplayModeListIteratorUPP (&MyDMDisplayModeListIteratorCallback);

You can then pass MyDMDisplayModeListIteratorUPP in the listIterator parameter of the DMGetIndexedDisplayModeFromList function. When you no longer need the list iterator, you should dispose of the UPP using the DisposeDMDisplayModeListIteratorUPP function:

DisposeDMDisplayModeListIteratorUPP (

MyDMDisplayModeListIteratorUPP);

Using this call ensures that the call is made through a universal procedure pointer.

SPECIAL CONSIDERATIONS

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)