Name
GetMonitorInfo -- get information about monitor hardware (V6.0, optional)
Synopsis
int error = GetMonitorInfo(int what, int monitor, APTR *data,
                struct hwTagList *tags);
Function
This function must query all available monitors and return information about their configuration and capabilities. Hollywood will use the what parameter to tell your implementation which information about the monitor hardware the program wants to have. what can be one of the following values:

HWGMITYPE_MONITORS:
Hollywood wants to have information about all monitors available to the system and their positions on the extended desktop relative to the primary monitor. If what has been set to HWGMITYPE_MONITORS, your GetMonitorInfo() implementation must allocate a list of all available monitors as an array of struct hwMonitorInfo elements. The list must be terminated by a last struct hwMonitorInfo element with all structure members set to zero. Here is what struct hwMonitorInfo looks like:

 
struct hwMonitorInfo
{
    int X;        // [out]
    int Y;        // [out]
    int Width;    // [out]
    int Height;   // [out]
};

Hollywood expects the following information in the individual structure members:

X:
Must be set to the x position of this monitor on the extended desktop.

Y:
Must be set to the y position of this monitor on the extended desktop.

Width:
This monitor's width on the extended desktop.

Height:
This monitor's height on the extended desktop.

All values must be specified in pixels. The pointer to the list of struct hwMonitorInfo elements must be written to the data pointer that is passed to GetMonitorInfo() as parameter 3. Hollywood will call FreeMonitorInfo() to give you a chance to free the list you've allocated.

The monitor parameter is ignored if what is HWGMITYPE_MONITORS.

HWGMITYPE_VIDEOMODES:
Hollywood wants to know about all video modes that a specific monitor supports. The number of the monitor to examine is passed in the monitor parameter. Monitors are counted from 0 which describes the primary monitor. Your GetMonitorInfo() implementation must allocate a list of all available video modes for this monitor as an array of struct hwVideoModeInfo elements. The list must be terminated by a last struct hwVideoModeInfo element with all structure members set to zero. Here is what struct hwVideoModeInfo looks like:

 
struct hwVideoModeInfo
{
    int Width;    // [out]
    int Height;   // [out]
    int Depth;    // [out]
};

Hollywood expects the following information in the individual structure members:

Width:
Width of video mode in pixels.

Height:
Height of video mode in pixels.

Depth:
Depth of video mode.

The pointer to the list of struct hwVideoModeInfo elements must be written to the data pointer that is passed to GetMonitorInfo() as parameter 3. Hollywood will call FreeMonitorInfo() to give you a chance to free the list you've allocated.

GetMonitorInfo() is an optional API and must only be implemented if HWSDAFLAGS_MONITORINFO has been passed to hw_SetDisplayAdapter(). See hw_SetDisplayAdapter for details.

Inputs
what
which information to query (see above)
monitor
monitor index to query
data
pointer to store this function's return data
tags
taglist containing additional parameters (currently always NULL)
Results
error
error code or 0 for success

Show TOC