disable debug
[AROS.git] / rom / intuition / openscreentaglist.c
blob846d75d84dd116da9adc926f14e2601201634c69
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include "intuition_intern.h"
9 /*****************************************************************************
11 NAME */
12 #include <utility/tagitem.h>
13 #include <intuition/screens.h>
14 #include <proto/intuition.h>
16 AROS_LH2(struct Screen *, OpenScreenTagList,
18 /* SYNOPSIS */
19 AROS_LHA(struct NewScreen *, newScreen, A0),
20 AROS_LHA(struct TagItem *, tagList, A1),
22 /* LOCATION */
23 struct IntuitionBase *, IntuitionBase, 102, Intuition)
25 /* FUNCTION
26 Open a screen
28 INPUTS
29 newScreen - struct with screen specification. This is for compatibility
30 with OpenScreen() and usually set to NULL.
31 tagList - tags which specify the screen
33 TAGS
34 SA_Left
35 Default: 0
37 SA_Top
38 Default: 0
40 SA_Width
41 Default depends on display clip
43 SA_Height
44 Default depends on display clip
46 SA_Depth
47 Select depth of screen. This specifies how many
48 colors the screen can display.
49 Default: 1
51 SA_DetailPen
52 Pen number for details.
53 Default: 0
55 SA_BlockPen
56 Pen number for block fills.
57 Default: 1
59 SA_Title (STRPTR)
60 Default: NULL
62 SA_Font (struct TextAttr *)
63 Default: NULL, meaning user's preferred monospace font
65 SA_BitMap (struct BitMap *)
66 Provide a custom bitmap.
68 SA_ShowTitle (BOOL)
69 Default: TRUE
71 SA_Behind (BOOL)
72 Screen will be created behind other open screens.
73 Default: FALSE
75 SA_Quiet (BOOL)
76 Intuition doesn't draw system gadgets and screen title.
77 Defaults: FALSE
79 SA_Type
80 PUBLICSCREEN or CUSTOMSCREEN.
82 SA_DisplayID
83 32-bit display mode ID, as defined in the <graphics/modeid.h>.
85 SA_Overscan
86 Set an overscan mode.
88 Possible values:
90 OSCAN_TEXT - A region which is fully visible.
91 Recommended for text display.
93 OSCAN_STANDARD - A region whose edges are "just out of view."
94 Recommended for games and presentations.
96 OSCAN_MAX - Largest region which Intuition can handle comfortably.
98 OSCAN_VIDEO - Largest region the graphics.library can display.
100 Default: OSCAN_TEXT
102 SA_DClip (struct Rectangle *)
103 Define a DisplayClip region. See QueryOverscan().
104 It's easier to use SA_Overscan.
106 SA_AutoScroll (BOOL)
107 Screens can be larger than the DisplayClip region. Set this tag
108 to TRUE if you want to enable automatic scrolling when you reach
109 the edge of the screen with the mouse pointer.
111 SA_PubName (STRPTR)
112 Make this screen a public screen with the given name.
113 Screen is opened in "private" mode.
115 SA_Pens (UWORD *)
116 Define the pen array for struct DrawInfo. This enables
117 the 3D look.
119 This array contains often just the terminator ~0.
120 You define a list of pens which overwrite the DrawInfo pens.
121 The pen arrayy must be terminated with ~0.
123 SA_PubTask (struct Task *)
124 Task to be signalled, when last visitor window of a public
125 screen is closed.
127 SA_PubSig (UBYTE)
128 Signal number used to notify a task when the last visitor window
129 of a public screen is closed.
131 SA_Colors (struct ColorSpec *)
132 Screen's initial color palette. Array must be terminated
133 with ColorIndex = -1.
135 SA_FullPalette (BOOL)
136 Intuition maintains a set of 32 preference colors.
137 Default: FALSE
139 SA_ErrorCode (ULONG *)
140 Intuition puts additional error code in this field when
141 opening the screen failed.
142 OSERR_NOMONITOR - monitor for display mode not available.
143 OSERR_NOCHIPS - you need newer custom chips for display mode.
144 OSERR_NOMEM - couldn't get normal memory
145 OSERR_NOCHIPMEM - couldn't get chip memory
146 OSERR_PUBNOTUNIQUE - public screen name already used
147 OSERR_UNKNOWNMODE - don't recognize display mode requested
148 OSERR_TOODEEP - screen too deep to be displayed on
149 this hardware (V39)
150 OSERR_ATTACHFAIL - An illegal attachment of screens was
151 requested (V39)
153 SA_SysFont
154 Select screen font type. This overwrites SA_Font.
156 Values:
157 0 - Fixed-width font (old-style)
158 1 - Font which is set by font preferences editor. Note:
159 windows opened on this screen will still have the rastport
160 initialized with the fixed-width font (sysfont 0).
162 Default: 0
164 SA_Parent (struct Screen *)
165 Attach the screen to the given parent screen.
167 SA_FrontChild (struct Screen *)
168 Attach given child screen to this screen. Child screen
169 must already be open. The child screen will go to the
170 front of the screen group.
172 SA_BackChild (struct Screen *)
173 Attach given child screen to this screen. Child screen
174 must already be open. The child screen will go behind other
175 child screens.
177 SA_BackFill (struct Hook *)
178 Backfill hook (see layers.library/InstallLayerInfoHook() ).
180 SA_Draggable (BOOL)
181 Make screen draggable.
182 Default: TRUE
184 SA_Exclusive (BOOL)
185 Set to TRUE if the screen must not share the display with
186 other screens. The screen will not be draggable and doesn't
187 appear behind other screens, but it still is depth arrangeable.
188 Default: FALSE
190 SA_SharePens (BOOL)
191 Per default, Intuition obtains the pens of a public screen with
192 PENF_EXCLUSIVE. Set this to TRUE to instruct Intuition to leave
193 the pens unallocated.
194 Default: FALSE
196 SA_Colors32 (ULONG *)
197 Data is forwarded to graphics.library/LoadRGB32().
198 Overwrites values which were set by SA_Colors.
200 SA_Interleaved (BOOL)
201 Request interleaved bimap. It this fails a non-interleaved
202 bitmap will be allocated.
203 Default: FALSE
205 SA_VideoControl (struct TagItem *)
206 Taglist which will be passed to VideoControl() after the
207 screen is open.
209 SA_ColorMapEntries:
210 Number of entries of the ColorMap.
211 Default: 1<<depth, but not less than 32
213 SA_LikeWorkbench (BOOL)
214 Inherit depth, colors, pen-array, screen mode, etc. from
215 the Workbench screen. Individual attributes can be overridden
216 with tags.
217 Default: FALSE
219 SA_MinimizeISG (BOOL)
220 Minimize the Inter-Screen-Gap. For compatibility,
222 RESULT
223 Pointer to screen or NULL if opening fails.
225 NOTES
226 If you need a pointer to the screen's bitmap use
227 Screen->RastPort.BitMap instead of &Screen->BitMap.
229 If you want DOS requester to appear on your screen you have to do:
230 process = FindTask(0);
231 process->pr_WindowPtr = (APTR) window;
232 The old value of pr->WindowPtr must be reset before you quit your
233 program.
235 EXAMPLE
237 BUGS
239 SEE ALSO
241 INTERNALS
243 *****************************************************************************/
245 AROS_LIBFUNC_INIT
247 struct ExtNewScreen ns =
249 0, 0, -1, -1, 1, /* left, top, width, height, depth */
250 0, 1, /* DetailPen, BlockPen */
251 HIRES | LACE, /* ViewModes */
252 CUSTOMSCREEN | SHOWTITLE, /* Type */
253 NULL, /* Font */
254 NULL, /* DefaultTitle */
255 NULL, /* Gadgets */
256 NULL, /* CustomBitMap */
257 NULL /* Extension (taglist) */
260 DEBUG_OPENSCREENTAGLIST(dprintf("OpenScreenTagList: NewScreen 0x%lx Tags 0x%lx\n",
261 newScreen, tagList));
262 ns.DetailPen = GetPrivIBase(IntuitionBase)->DriPens4[DETAILPEN];
263 ns.BlockPen = GetPrivIBase(IntuitionBase)->DriPens4[BLOCKPEN];
265 if (newScreen)
266 CopyMem (newScreen, &ns, (newScreen->Type & NS_EXTENDED) ? sizeof (struct ExtNewScreen) :
267 sizeof (struct NewScreen));
269 if (tagList)
271 ns.Extension = tagList;
272 ns.Type |= NS_EXTENDED;
275 #ifdef __MORPHOS__
276 /* calling OpenScreen through the library vector causes a loop with cgx's patch. */
278 extern ULONG LIB_OpenScreen(void);
280 REG_A0 = (LONG)&ns;
281 REG_A6 = (LONG)IntuitionBase;
283 return (struct Screen *) LIB_OpenScreen();
285 #else
286 return OpenScreen ((struct NewScreen *)&ns);
287 #endif
289 AROS_LIBFUNC_EXIT
291 } /* OpenScreenTagList */