#include <QD/QD.h>

//work


/*NewDMDisplayModeListIteratorUPP

(Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

DMDisplayModeListIteratorUPP NewDMDisplayModeListIteratorUPP (
   DMDisplayModeListIteratorProcPtr userRoutine
);
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
DMDisplayModeListIteratorUPP NewDMDisplayModeListIteratorUPP (
   DMDisplayModeListIteratorProcPtr userRoutine
){};


/*DMEndConfigureDisplays

Ends configuration begun by DMBeginConfigureDisplays. You should generally never need to use this function. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMEndConfigureDisplays (
   Handle displayState
);
Parameters
displayState

Supply this parameter with the handle obtained by the DMBeginConfigureDisplays function.
Return Value

A result code. See “Display Manager Result Codes”.
Discussion

The function DMEndConfigureDisplays resumes Display Manager configuration checking, the rebuilding of desktop regions, and Apple event notification of Display Manager changes, all of which are postponed when you use the function DMBeginConfigureDisplays. Your application will then receive a single Display Notice event notifying your application of Display Manager changes, and your application can manage its windows accordingly. 
Special Considerations

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

Applications generally never need to use this function. In case you find a compelling need to change the user’s display configuration, this function is described here for completeness. Note that if your application uses Display Manager functions to change the display configuration of the user’s video devices, your application should make these changes only with the consent of the user. If your application must have a specific pixel depth, for example, it should display a dialog box that offers the user a choice between changing to that depth or canceling display of the image. 
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMEndConfigureDisplays (
   Handle displayState
){};


/*DMGetDisplayMode

Obtains the current display mode of a specified video display. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMGetDisplayMode (
   GDHandle theDevice,
   VDSwitchInfoPtr switchInfo
);
Parameters
theDevice

A handle to the GDevice structure for the video device whose display mode you wish to obtain. 
switchInfo

On return, a pointer to an internal Display Manager structure containing display mode information. 
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMGetDisplayMode (
   GDHandle theDevice,
   VDSwitchInfoPtr switchInfo
){};

/*DMBeginConfigureDisplays

Allows your application to configure displays. You should generally never need to use this function. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMBeginConfigureDisplays (
   Handle * displayState
);
Parameters
displayState

On return, a pointer to a handle to internal Display Manager information about the current display state. The DMEndConfigureDisplays function and many other functions require this parameter.
Return Value

A result code. See “Display Manager Result Codes”.
Discussion

The DMBeginConfigureDisplays function tells the Display Manager to postpone Display Manager configuration checking, the rebuilding of desktop regions, and Apple event notification of Display Manager changes until your application uses the DMEndConfigureDisplays function.

You should call the function DMBeginConfigureDisplays before calling other Display Manager functions that configure the user’s display. When calling functions that configure displays, you should pass the handle obtained by the DMBeginConfigureDisplays function. DMBeginConfigureDisplays causes system software to wait for your application to complete display changes before managing additional Display Manager events. When your application completes configuring the display environment, call the function DMEndConfigureDisplays. 
Special Considerations

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

Applications generally never need to use this function. In case you find a compelling need to change the user’s display configuration, this function is described here for completeness. Note that if your application uses Display Manager functions to change the display configuration of the user’s video devices, your application should make these changes only with the consent of the user. If your application must have a specific pixel depth, for example, it should display a dialog box that offers the user a choice between changing to that depth or canceling display of the image. 
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMBeginConfigureDisplays (
   Handle * displayState
){};


/*DMNewDisplayModeList

Builds a new display mode list for a specified video device. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMNewDisplayModeList (
   DisplayIDType displayID,
   unsigned long modeListFlags,
   unsigned long reserved,
   DMListIndexType * thePanelCount,
   DMListType * thePanelList
);
Parameters
displayID

The display ID for the video device that will have a new display mode list. 
modeListFlags

Reserved for future expansion. Pass NULL in this parameter. 
reserved

Reserved for future expansion. Pass NULL in this parameter.
thePanelCount

The number of entries in the display mode list specified by the theList parameter. 
thePanelList

The display mode list for the specified video device. 
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

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

Generally, your application should not use this function, but should instead allow system software to maintain the device list. This function is described here for completeness only. 
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMNewDisplayModeList (
   DisplayIDType displayID,
   unsigned long modeListFlags,
   unsigned long reserved,
   DMListIndexType * thePanelCount,
   DMListType * thePanelList
){};

/*DMDisposeList

Disposes of a display mode list built by DMNewDisplayModeList. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMDisposeList (
   DMListType panelList
);
Parameters
panelList

A value that specifies the display mode list you want to delete. 
Return Value

A result code. See “Display Manager Result Codes”.
Discussion

You should call the DMDisposeList function after you have iterated the mode list.
Special Considerations

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

Generally, your application should not use this function, but should instead allow system software to maintain the device list. This function is described here for completeness only.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMDisposeList (
   DMListType panelList
){};

/*DMSetDisplayMode

Sets the display mode and pixel depth for a video device. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMSetDisplayMode (
   GDHandle theDevice,
   unsigned long mode,
   unsigned long * depthMode,
   unsigned long reserved,
   Handle displayState
);
Parameters
theDevice

A handle to the GDevice structure for the video device whose display mode and pixel depth you wish to set. 
mode

The number used by a video device to identify its display mode. If you supply the value 0 in this parameter, DMSetDisplayMode uses the current display mode. To specify another display mode, use the function DMNewDisplayModeList. 
depthMode

A pointer to the desired pixel depth for the video device specified by theDevice. If you pass a pointer to 0, DMSetDisplayMode attempts to keep the current depth. If you pass a pointer to 1, 2, 4, 8, 16, or 32, DMSetDisplayMode attempts to set the device to use your specified pixel depth. If you supply a pointer to a value of 128 or greater, then DMSetDisplayMode sets the depth to the depth mode represented by the Video Depth Mode values. See “Video Depth Mode Values” for more information.

On return, this parameter contains a pointer to the new pixel depth. This value represents the depth mode closest to the one you requested when calling DMSetDisplayMode.
reserved

Reserved for future expansion. Pass NULL in this parameter.
displayState

If your aDMSetDisplayMode

Sets the display mode and pixel depth for a video device. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMSetDisplayMode (
   GDHandle theDevice,
   unsigned long mode,
   unsigned long * depthMode,
   unsigned long reserved,
   Handle displayState
);
Parameters
theDevice

A handle to the GDevice structure for the video device whose display mode and pixel depth you wish to set. 
mode

The number used by a video device to identify its display mode. If you supply the value 0 in this parameter, DMSetDisplayMode uses the current display mode. To specify another display mode, use the function DMNewDisplayModeList. 
depthMode

A pointer to the desired pixel depth for the video device specified by theDevice. If you pass a pointer to 0, DMSetDisplayMode attempts to keep the current depth. If you pass a pointer to 1, 2, 4, 8, 16, or 32, DMSetDisplayMode attempts to set the device to use your specified pixel depth. If you supply a pointer to a value of 128 or greater, then DMSetDisplayMode sets the depth to the depth mode represented by the Video Depth Mode values. See “Video Depth Mode Values” for more information.

On return, this parameter contains a pointer to the new pixel depth. This value represents the depth mode closest to the one you requested when calling DMSetDisplayMode.
reserved

Reserved for future expansion. Pass NULL in this parameter.
displayState

If your application called DMBeginConfigureDisplays, you must pass the displayState handle obtained. Otherwise pass NULL in this parameter.
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.hpplication called DMBeginConfigureDisplays, you must pass the displayState handle obtained. Otherwise pass NULL in this parameter.
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMSetDisplayMode (
   GDHandle theDevice,
   unsigned long mode,
   unsigned long * depthMode,
   unsigned long reserved,
   Handle displayState
){};

/*DMCheckDisplayMode

Determines if a video device supports a particular display mode and pixel depth. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMCheckDisplayMode (
   GDHandle theDevice,
   unsigned long mode,
   unsigned long depthMode,
   unsigned long * switchFlags,
   unsigned long reserved,
   Boolean * modeOk
);
Parameters
theDevice

A handle to the GDevice structure for the video device whose display mode and pixel depth you wish to check. 
mode

The display mode you wish to check. You get a list of display modes by calling DMGetDisplayMode. 
depthMode

The pixel depth you wish to check. See “Video Depth Mode Values” for list of possible values.
switchFlags

On return, a pointer to a long integer that indicates if a video device will support the mode specified by the mode parameter and the pixel depth specified by the depthMode parameter. See “Switch Flags” for a description.
reserved

Reserved for future expansion. Pass NULL in this parameter.
modeOk

On return, a pointer to a Boolean. If modeOk points to a value of true, the user or your application can switch the display mode for the video device to the one specified by mode.
Return Value

A result code. See “Display Manager Result Codes”.
Discussion

Usually, your application only needs to know if a video device supports a specific pixel depth. Thus your application can use the Color QuickDraw function HasDepth. The function DMCheckDisplayMode is essentially obsolete, and is here for completeness. 
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMCheckDisplayMode (
   GDHandle theDevice,
   unsigned long mode,
   unsigned long depthMode,
   unsigned long * switchFlags,
   unsigned long reserved,
   Boolean * modeOk
){};

/*DMGetIndexedDisplayModeFromList

Obtains a display mode from the display mode list built by DMNewDisplayModeList. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMGetIndexedDisplayModeFromList (
   DMListType panelList,
   DMListIndexType itemIndex,
   unsigned long reserved,
   DMDisplayModeListIteratorUPP listIterator,
   void * userData
);
Parameters
panelList

A value that specifies the list from which to obtain information about the display modes created by the function DMNewDisplayModeList. 
itemIndex

A value that specifies the index of the display mode you wish to obtain. 
reserved

Reserved for future expansion. Pass NULL in this parameter. 
listIterator

A universal procedure pointer. The iterator this pointer specifies supplies the function to be called with the information about the display mode specified by theListCount. 
userData

A pointer you pass for listIterator usually used to obtain information about the display mode from the UPP and return it to the caller of DMGetIndexedDisplayModeFromList. 
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

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

Generally, your application should not use this function, but should instead allow system software to maintain the device list. This function is described here for completeness only. 
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMGetIndexedDisplayModeFromList (
   DMListType panelList,
   DMListIndexType itemIndex,
   unsigned long reserved,
   DMDisplayModeListIteratorUPP listIterator,
   void * userData
){};

/*DMGetFirstScreenDevice

Returns a handle for the first video device in the device list. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

GDHandle DMGetFirstScreenDevice (
   Boolean activeOnly
);
Parameters
activeOnly

If true, the DMGetFirstScreenDevice function returns a handle to the first of all active video devices. If false, the function returns a handle to the first of all video devices, active or not. You may use the Active Device Constants in this parameter. See “Active Device Only Values”.
Return Value

If activeOnly is true, a handle to the GDevice structure for the first active video device. If activeOnly is false, a handle to the GDevice structure for the first video device. See the QuickDraw Manager documentation for a description of the GDHandle data type.
Discussion

The DMGetFirstScreenDevice function is useful if you want to find out more about the current mode.

You can use the function DMGetNextScreenDevice to loop through all of the video devices in the device list.

The DMGetFirstScreenDevice function is similar to the QuickDraw function GetDeviceList, except that when returning GDevice structures, GetDeviceList does not distinguish between inactive and active video devices or between the GDevice structures for video devices and the GDevice structures associated with no video devices. 
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/

GDHandle DMGetFirstScreenDevice (
   Boolean activeOnly
){};

/*DMGetDisplayIDByGDevice

Obtains the display ID number for a video device. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMGetDisplayIDByGDevice (
   GDHandle displayDevice,
   DisplayIDType * displayID,
   Boolean failToMain
);
Parameters
displayDevice

A handle to the GDevice structure for the video device whose display ID you wish to obtain. 
displayID

On return, a pointer to the display ID for the video device specified by the displayDevice parameter. 
failToMain

If true and the specified video device does not have a display ID, on return the function sets the displayID parameter to a pointer to the display ID of the video device for the main screen. If false and the specified video device does not have a display ID, the function returns the kDMDisplayNotFoundErr result code. 
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMGetDisplayIDByGDevice (
   GDHandle displayDevice,
   DisplayIDType * displayID,
   Boolean failToMain
){};


/*DMGetNextScreenDevice

Returns a handle for the next video device in the device list. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

GDHandle DMGetNextScreenDevice (
   GDHandle theDevice,
   Boolean activeOnly
);
Parameters
theDevice

A handle to the GDevice structure at which you want the function to begin. You can supply the handle returned by the function DMGetFirstScreenDevice or DMGetNextScreenDevice. 
activeOnly

If true, the DMGetNextScreenDevice function returns a handle for the next active video device. If false, DMGetNextScreenDevice returns a handle for the next video device, active or not. You may use the Active Device Constants in this parameter. See “Active Device Only Values”.
Return Value

If activeOnly is true, a handle to the next GDevice structure for an active video device. If activeOnly is false, a handle to the next GDevice structure for a video device. If there are no more GDevice structures in the list, DMGetNextScreenDevice returns NULL. See the QuickDraw Manager documentation for a description of the GDHandle data type.
Discussion

The DMGetNextScreenDevice function is similar to the QuickDraw function GetNextDevice, except that when returning GDevice structures, GetNextDevice does not distinguish between inactive and active video devices or between the GDevice structures for video devices and the GDevice structures associated with no video devices. 
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
GDHandle DMGetNextScreenDevice (
   GDHandle theDevice,
   Boolean activeOnly
){};


/*DMGetGDeviceByDisplayID

Obtains a handle for the video device with a specified display ID. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMGetGDeviceByDisplayID (
   DisplayIDType displayID,
   GDHandle * displayDevice,
   Boolean failToMain
);
Parameters
displayID

The display ID for the video device whose handle you wish to obtain. 
displayDevice

On return, a pointer to the handle to the GDevice structure for the video device specified by the displayID parameter. 
failToMain

If true and there is no video device associated with the displayID parameter, on return the function sets displayDevice to a pointer to the handle for the video device for the main screen. If false and there is no video device associated with the displayID parameter, the function returns the kDMDisplayNotFoundErr result code.
Return Value

A result code. See “Display Manager Result Codes”.
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMGetGDeviceByDisplayID (
   DisplayIDType displayID,
   GDHandle * displayDevice,
   Boolean failToMain
){};
/*NewDMExtendedNotificationUPP

(Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

DMExtendedNotificationUPP NewDMExtendedNotificationUPP (
   DMExtendedNotificationProcPtr userRoutine
);
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
DMExtendedNotificationUPP NewDMExtendedNotificationUPP (
   DMExtendedNotificationProcPtr userRoutine
){};


/*DMRegisterExtendedNotifyProc

Registers a function that responds to a Display Notice event outside of an event loop. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

OSErr DMRegisterExtendedNotifyProc (
   DMExtendedNotificationUPP notifyProc,
   void * notifyUserData,
   unsigned short notifyOnFlags,
   DMProcessInfoPtr whichPSN
);
Parameters
notifyProc

A pointer to your function that handles a Display Notice event. 
notifyUserData

A pointer to caller-specific information which the Display Manager will return to your application when you request it. 
notifyOnFlags

Reserved for future expansion. You should pass kNilOptions in this parameter. 
whichPSN

A pointer to the Process Serial Number associated with your Display Notice event-handling function. If this process terminates, the Display Notice event-handling function is automatically removed. For example, the Monitors control panel supplies the Finder’s process number when registering its Display Notice event-handling function. 
Return Value

A result code. See “Display Manager Result Codes”.
Discussion

When the Display Manager sends your function the Display Notice event, your application or utility should respond by moving or resizing its windows and updating any internally-maintained video device information as appropriate.

When you are finished with your notification function, remove it by calling DMRemoveExtendedNotifyProc. 
Special Considerations

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
OSErr DMRegisterExtendedNotifyProc (
   DMExtendedNotificationUPP notifyProc,
   void * notifyUserData,
   unsigned short notifyOnFlags,
   DMProcessInfoPtr whichPSN
){};

/*DisposeDMExtendedNotificationUPP

(Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)

void DisposeDMExtendedNotificationUPP (
   DMExtendedNotificationUPP userUPP
);
Availability
Available in Mac OS X v10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
Displays.h*/
void DisposeDMExtendedNotificationUPP (
   DMExtendedNotificationUPP userUPP
){};






