Update to lasso handling. Adjust scroll amount based on difference between mouse...
[AROS.git] / rom / intuition / queryoverscan.c
blob78e955b1cc3c1a44cac87886cab97715cc4c0075
1 /*
2 Copyright © 1995-2007, 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 DimensionInfo diminfo;
63 LONG retval = FALSE;
65 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: displayid 0x%lx rect 0x%lx oscantype 0x%lx\n",
66 displayid,
67 rect,
68 oscantype));
70 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: %ld %ld %ld %ld\n",
71 rect->MinX,
72 rect->MinY,
73 rect->MaxX,
74 rect->MaxY));
75 ASSERT_VALID_PTR(rect);
77 if (GetDisplayInfoData(NULL, (UBYTE *)&diminfo, sizeof(diminfo), DTAG_DIMS, displayid) > 0)
79 retval = TRUE;
81 switch(oscantype)
83 case OSCAN_TEXT:
84 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_TEXT\n"));
85 memcpy(rect,&diminfo.TxtOScan,sizeof(struct Rectangle));
86 break;
88 case OSCAN_STANDARD:
89 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_STANDARD\n"));
90 memcpy(rect,&diminfo.StdOScan,sizeof(struct Rectangle));
91 break;
93 case OSCAN_MAX:
94 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_MAX\n"));
95 memcpy(rect,&diminfo.MaxOScan,sizeof(struct Rectangle));
96 break;
98 case OSCAN_VIDEO:
99 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_VIDEO\n"));
100 memcpy(rect,&diminfo.VideoOScan,sizeof(struct Rectangle));
101 break;
103 default:
104 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: OSCAN_????\n"));
105 /* or should we assume OSCAN_TEXT? */
106 retval = FALSE;
107 break;
109 } /* switch(oscantype) */
111 } /* if (GetDisplayInfoData(NULL, &diminfo, sizeof(diminfo), DTAG_DIMS, displayid) > 0) */
113 DEBUG_QUERYOVERSCAN(dprintf("LIB_QueryOverscan: retval %ld, %ld %ld %ld %ld\n",
114 retval,
115 rect->MinX,
116 rect->MinY,
117 rect->MaxX,
118 rect->MaxY));
120 return retval;
122 AROS_LIBFUNC_EXIT
124 } /* QueryOverscan */