HUNKF_FAST | HUNKF_CHIP = next long is memory flag. HUNKF_ADVISORY = ignore following...
[AROS.git] / rom / intuition / queryoverscan.c
blob904716fa29f379dd56011a47cd98c2ba5a9e6600
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <graphics/displayinfo.h>
8 #include <proto/graphics.h>
9 #include "intuition_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/intuition.h>
16 AROS_LH3(LONG, QueryOverscan,
18 /* SYNOPSIS */
19 AROS_LHA(ULONG , displayid, A0),
20 AROS_LHA(struct Rectangle *, rect , A1),
21 AROS_LHA(WORD , oscantype, D0),
23 /* LOCATION */
24 struct IntuitionBase *, IntuitionBase, 79, Intuition)
26 /* FUNCTION
27 Query overscan dimensions. The resulting rectangle can be used
28 with SA_DisplayID.
30 Overscan types:
31 OSCAN_TEXT: completely visible. Left/Top is always 0,0.
32 OSCAN_STANDARD: visible bounds of monitor. Left/Top may be negative.
33 OSCAN_MAX: The largest displayable region.
34 OSCAN_VIDEO: The absolute largest region that the graphics.library
35 can display. This region must be used as-is.
37 INPUTS
38 displayid - ID to be queried
39 rect - Pointer to struct Rectangle to store result
40 oscantype - OSCAN_TEXT, OSCAN_STANDARD, OSCAN_MAX, OSCAN_VIDEO
42 RESULT
43 TRUE - Monitorspec exists
44 FALSE - Monitorspec doesn't exist
46 NOTES
48 EXAMPLE
50 BUGS
52 SEE ALSO
54 INTERNALS
56 HISTORY
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 struct GfxBase *GfxBase = GetPrivIBase(IntuitionBase)->GfxBase;
63 struct DimensionInfo diminfo;
64 LONG retval = FALSE;
66 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: displayid 0x%lx rect 0x%lx oscantype 0x%lx\n",
67 displayid,
68 rect,
69 oscantype));
71 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: %ld %ld %ld %ld\n",
72 rect->MinX,
73 rect->MinY,
74 rect->MaxX,
75 rect->MaxY));
76 ASSERT_VALID_PTR(rect);
78 if (GetDisplayInfoData(NULL, (UBYTE *)&diminfo, sizeof(diminfo), DTAG_DIMS, displayid) > 0)
80 retval = TRUE;
82 switch(oscantype)
84 case OSCAN_TEXT:
85 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_TEXT\n"));
86 memcpy(rect,&diminfo.TxtOScan,sizeof(struct Rectangle));
87 break;
89 case OSCAN_STANDARD:
90 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_STANDARD\n"));
91 memcpy(rect,&diminfo.StdOScan,sizeof(struct Rectangle));
92 break;
94 case OSCAN_MAX:
95 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_MAX\n"));
96 memcpy(rect,&diminfo.MaxOScan,sizeof(struct Rectangle));
97 break;
99 case OSCAN_VIDEO:
100 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_VIDEO\n"));
101 memcpy(rect,&diminfo.VideoOScan,sizeof(struct Rectangle));
102 break;
104 default:
105 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_????\n"));
106 /* or should we assume OSCAN_TEXT? */
107 retval = FALSE;
108 break;
110 } /* switch(oscantype) */
112 } /* if (GetDisplayInfoData(NULL, &diminfo, sizeof(diminfo), DTAG_DIMS, displayid) > 0) */
114 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: retval %ld, %ld %ld %ld %ld\n",
115 retval,
116 rect->MinX,
117 rect->MinY,
118 rect->MaxX,
119 rect->MaxY));
121 return retval;
123 AROS_LIBFUNC_EXIT
125 } /* QueryOverscan */