1 #ifndef INTUITION_MONITORCLASS_H
    2 #define INTUITION_MONITORCLASS_H
    3 
    4 /*
    5 	intuition monitorclass definitions
    6 
    7 	Copyright � 2004-2008 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 # include <exec/types.h>
   12 #endif
   13 
   14 /*
   15 
   16 	MONITORCLASS introduced 1st in intuition.library 51 is an interface
   17 	that allows obtaining various information about monitors (gfx cards)
   18 	installed in system. You are not allowed to create your own MONITORCLASS
   19 	objects, you may only get attrs and call methods defined below.
   20 
   21 	To get the list of monitor objects installed in system please use
   22 	GetMonitorList() function. You may also GetAttr the specific monitor
   23 	of a screen by using GetAttr(SA_MonitorObject,screen,&monitor);
   24 
   25 	Once you got a pointer to monitor object you may use it all the time
   26 	without any need for locking any intuition semaphore - once installed
   27 	the monitor cannot be removed from system, so the pointer is guaranteed
   28 	to remain valid all the time.	
   29 
   30 */
   31 
   32 #define MONITOR_MAXPIXELFORMATS 14
   33 
   34 #define MA_Dummy                        (TAG_USER)
   35 #define MA_MonitorName                  (MA_Dummy + 1)
   36 /* CONST_STRPTR. Returns a pointer to a string with monitor name. Similar to
   37 ** SA_MonitorName.
   38 */
   39 
   40 #define MA_Manufacturer                 (MA_Dummy + 2)
   41 /* CONST_STRPTR. Return info about hardware manufacturer */
   42 
   43 #define MA_ManufacturerID               (MA_Dummy + 3)
   44 /* ULONG */
   45 
   46 #define MA_ProductID                    (MA_Dummy + 4)
   47 /* ULONG */
   48 
   49 #define MA_MemorySize                   (MA_Dummy + 5)
   50 /* ULONG. Returns the approx amount of gfx card own's memory */
   51 
   52 #define MA_PixelFormats                 (MA_Dummy + 6)
   53 /* ULONG *. Returns a READ ONLY array of size MONITOR_MAXPIXELFORMATS.
   54 ** To check which pixel format is supported on the gfx card you check
   55 ** the TRUE/FALSE value stored in the array at an offset defined with
   56 ** PIXFMT_ define from cybergraphx/cybergraphics.h
   57 **
   58 ** EXAMPLE:
   59 ** ULONG *pixfmtarray;
   60 ** GetAttr(MA_PixelFormats,monitor,&pixfmtarray);
   61 ** if (pixfmtarray[PIXFMT_LUT8]) printf("Monitor supports LUT8!\n");
   62 */
   63 
   64 #define MA_TopLeftMonitor               (MA_Dummy + 7)
   65 #define MA_TopMiddleMonitor             (MA_Dummy + 8)
   66 #define MA_TopRightMonitor              (MA_Dummy + 9)
   67 #define MA_MiddleLeftMonitor            (MA_Dummy + 10)
   68 #define MA_MiddleRightMonitor           (MA_Dummy + 11)
   69 #define MA_BottomLeftMonitor            (MA_Dummy + 12)
   70 #define MA_BottomMiddleMonitor          (MA_Dummy + 13)
   71 #define MA_BottomRightMonitor           (MA_Dummy + 14)
   72 /* Object *. Returns a monitor placed in a position relative to the
   73 ** current one or NULL if no monitor is present. Use this to obtain
   74 ** information about current monitor placement in user's work environment.
   75 ** BUGS: the methods returned a modeid instead of a pointer prior to 50.51
   76 */
   77 
   78 #define MA_GammaControl                 (MA_Dummy + 15)
   79 /* BOOL. Check whether a monitor supports gamma control or not */
   80 
   81 #define MA_PointerType                  (MA_Dummy + 16)
   82 /* ULONG. Returns the supported pointer type(s) as flags */
   83 #define PointerType_3Plus1              1 /* col 0 transparent, 1-3 visible */
   84 #define PointerType_2Plus1              2 /* col 0 transparent, 2-3 visible, 1 undefined/clear/inverse */
   85 #define PointerType_ARGB                4 /* 32bit ARGB pointer */
   86 
   87 #define MA_DriverName                   (MA_Dummy + 17)
   88 /* CONST_STRPTR. Returns the CGX driver name */
   89 
   90 #define MA_MemoryClock                  (MA_Dummy + 18)
   91 /* ULONG. Returns card's memory clock in Hz. Will be 0 if unknown */
   92 
   93 #define MA_BacklightControl             (MA_Dummy + 19)
   94 /* BOOL. Returns TRUE if lcd backlight level control is available */
   95 
   96 #define MA_BacklightLevelSteps          (MA_Dummy + 20)
   97 /* ULONG. Returns the number of steps MA_BacklightLevel supports */
   98 
   99 #define MA_BacklightLevel               (MA_Dummy + 21)
  100 /* ULONG. Changes the backlight level. Allowed values are from 0 (backlight disabled)
  101 ** up to MA_BacklightLevelSteps - 1
  102 */
  103 
  104 #define MA_EngineClock                  (MA_Dummy + 22)
  105 /* ULONG. Returns card's engine clock in Hz. Will be 0 if unknown */
  106 
  107 #define MA_Outputs                      (MA_Dummy + 23)
  108 /* LONG. Returns the number of outputs associated with the monitor. Separate outputs
  109 ** are treated as separate monitors by intuition */
  110 
  111 #define MA_Output                       (MA_Dummy + 24)
  112 /* LONG. Returns the output number or 1 if this monitor isn't associated with a
  113 ** driver capable of handling multiple outputs */
  114 
  115 #define MA_Display_Manufacturer         (MA_Dummy + 25)
  116 /* CONST_STRPTR, 3 character manufacturer code (if available) */
  117 
  118 #define MA_Display_ProductCode          (MA_Dummy + 26)
  119 /* ULONG, Manufacturer code (if available) */
  120 
  121 #define MA_Display_SerialNumber         (MA_Dummy + 27)
  122 /* ULONG, Display serial number (if available) */
  123 
  124 #define MA_Display_Width                (MA_Dummy + 28)
  125 /* ULONG, Display width in cm (if available) */
  126 
  127 #define MA_Display_Height               (MA_Dummy + 29)
  128 /* ULONG, Display height in cm (if available) */
  129 
  130 #define MA_Output_LinkType              (MA_Dummy + 30)
  131 /* MONITOR_LINKTYPE */
  132 
  133 #define MA_Display_Name                 (MA_Dummy + 31)
  134 /* CONST_STRPTR, Name of connected display (if available) */
  135 
  136 #define MA_IsDefault                    (MA_Dummy + 32)
  137 /* BOOL. True if this is the default display */
  138 
  139 #define MONITOR_LINKTYPE_UNKNOWN         0
  140 #define MONITOR_LINKTYPE_ANALOG          1
  141 #define MONITOR_LINKTYPE_UNKNOWN_DIGITAL 2
  142 #define MONITOR_LINKTYPE_DVI             3
  143 #define MONITOR_LINKTYPE_HDMI_A          4
  144 #define MONITOR_LINKTYPE_HDMI_B          5
  145 #define MONITOR_LINKTYPE_DISPLAYPORT     6
  146 #define MONITOR_LINKTYPE_MDDI            7
  147 
  148 
  149 /**************** METHODS ****************************************************/
  150 #define MM_GetRootBitMap                0x401
  151 /* Obtain driver's root bitmap which can be used as friend bitmap in AllocBitMap()
  152 ** call in order to allocate a bitmap in gfx card's memory. The bitmap will be of
  153 ** queried pixelformat. The result will be NULL if a pixelformat is unsupported by
  154 ** the card (not displayable) or if bitmap allocation failed internaly.
  155 ** You must NOT use this bitmap in any other way than for reference with AllocBitMap()
  156 ** Do NOT try to FreeBitMap() it!
  157 **
  158 ** EXAMPLE:
  159 ** struct BitMap *rootbitmap;
  160 ** struct BitMap *bitmap = NULL;
  161 **
  162 ** DoMethod(monitor,MM_GetRootBitMap,PIXFMT_BGRA32,&rootbitmap);
  163 **
  164 ** if (rootbitmap)
  165 ** {
  166 **     bitmap = AllocBitMap(width,height,GetBitMapAttr(rootbitmap,BMA_DEPTH),
  167 							BMF_REQUESTVMEM,rootbitmap);
  168 ** }
  169 */
  170 
  171 struct msGetRootBitMap
  172 {
  173 	ULONG   MethodID;
  174 	ULONG   PixelFormat;
  175 	ULONG  *Store;
  176 };
  177 
  178 #define MM_Query3DSupport               0x402
  179 /* Check whether a gfx card supports hardware 3d acceleration for a given
  180 ** pixel format. Store ptr will be filled with one of the MSQUERY3D defines
  181 ** below.
  182 */
  183 
  184 struct msQuery3DSupport
  185 {
  186 	ULONG  MethodID;
  187 	ULONG  PixelFormat;
  188 	ULONG *Store;
  189 };
  190 
  191 #define MSQUERY3D_UNKNOWN  (0) /* unsupported pixel format or other pb */
  192 #define MSQUERY3D_NODRIVER (1) /* no driver found for this pixel mode  */
  193 #define MSQUERY3D_SWDRIVER (2) /* only software 3d driver available    */
  194 #define MSQUERY3D_HWDRIVER (3) /* hardware acceleration available      */
  195 
  196 #define MM_GetDefaultGammaTables        0x403
  197 /* Use this function to obtain the default gamma/brightness/contrast settings
  198 ** of a monitor. You should check if gamma control is supported with
  199 ** MA_GammaControl attribute. You may change those values per screen as long
  200 ** as you are the owner of the screen. Changing it for Ambient screen will
  201 ** NOT be supported. It's OK for any of the gammatable pointers to be NULL.
  202 */
  203 
  204 struct msGetDefaultGammaTables
  205 {
  206 	ULONG  MethodID;
  207 	UBYTE *Red; /* pointer to a 256 byte array to fill */
  208 	UBYTE *Green;
  209 	UBYTE *Blue;
  210 };
  211 
  212 #define MM_GetDefaultPixelFormat        0x404
  213 /* Use this to get the best pixel format for a given depth. Returns -1 for an
  214 ** unsupported depth.
  215 */
  216 
  217 struct msGetDefaultPixelFormat
  218 {
  219 	ULONG MethodID;
  220 	ULONG Depth;
  221 	ULONG *Store;
  222 };
  223 
  224 #define MM_GetPointerBounds            0x405
  225 /* Use this to obtain the supported size of a mouse pointer for the given type.
  226 ** Returns FALSE if the type isn't supported, otherwise TRUE.
  227 */
  228 
  229 struct msGetPointerBounds
  230 {
  231 	ULONG MethodID;
  232 	ULONG PointerType;
  233 	ULONG *Width;
  234 	ULONG *Height;
  235 };
  236 
  237 #define MM_RunBlanker                  0x406
  238 /* Starts a blanker for this monitor (if there is one configured)
  239 */
  240 
  241 #define MM_EnterPowerSaveMode          0x407
  242 /* Starts the monitor power saving routines
  243 */
  244 
  245 #define MM_ExitBlanker                 0x408
  246 /* Aborts a running blanker/power saving mode
  247 */
  248 
  249 #define MM_Authorization               0x409
  250 /* Opens the user password authorization screen, added in 51.68
  251 */
  252 
  253 
  254 #define MA_Mode_Dummy                  (TAG_USER)
  255 #define MA_Mode_ModeID                 (MA_Mode_Dummy + 1)
  256 #define MA_Mode_Name                   (MA_Mode_Dummy + 2)
  257 #define MA_Mode_MonitorObject          (MA_Mode_Dummy + 3)
  258 #define MA_Mode_Width                  (MA_Mode_Dummy + 4)
  259 #define MA_Mode_Height                 (MA_Mode_Dummy + 5)
  260 #define MA_Mode_Depth                  (MA_Mode_Dummy + 6)
  261 #define MA_Mode_PixelFormat            (MA_Mode_Dummy + 7)
  262 #define MA_Mode_3DSupport              (MA_Mode_Dummy + 8)
  263 
  264 #define MA_Mode_NominalDimensions          (MA_Mode_Dummy + 10)
  265 #define MA_Mode_MaxOverscanDimensions      (MA_Mode_Dummy + 11)
  266 #define MA_Mode_VideoOverscanDimensions    (MA_Mode_Dummy + 12)
  267 #define MA_Mode_TextOverscanDimensions     (MA_Mode_Dummy + 13)
  268 #define MA_Mode_StandardOverscanDimensions (MA_Mode_Dummy + 14)
  269 
  270 #define MM_Mode_GetBitsPerColor        (0x450)
  271 
  272 struct msmGetBitsPerColor
  273 {
  274 	ULONG  MethodID;
  275 	ULONG *Red;
  276 	ULONG *Green;
  277 	ULONG *Blue;
  278 };
  279 
  280 #define MM_Mode_GetRefreshFrequencies  (0x451)
  281 
  282 struct msmGetRefreshFrequecies
  283 {
  284 	ULONG  MethodID;
  285 	FLOAT *HorizontalFrequencykHz;
  286 	FLOAT *VerticalFrequencyHz;
  287 };
  288 
  289 #define MM_Mode_GetRasterSizeLimits    (0x452)
  290 
  291 struct msmGetRasterSizeLimits
  292 {
  293 	ULONG  MethodID;
  294 	ULONG *MinWidth;
  295 	ULONG *MinHeight;
  296 	ULONG *MaxWidth;
  297 	ULONG *MaxHeight;
  298 };
  299 
  300 #endif /* INTUITION_MONITORCLASS_H */