1 #ifndef INTUITION_SCREENS_H 2 #define INTUITION_SCREENS_H 3 4 /* 5 intuition screen definitions 6 7 Copyright (C) 2002-2008 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_TYPES_H 11 # include <exec/types.h> 12 #endif 13 14 #ifndef GRAPHICS_GFX_H 15 # include <graphics/gfx.h> 16 #endif 17 18 #ifndef GRAPHICS_CLIP_H 19 # include <graphics/clip.h> 20 #endif 21 22 #ifndef GRAPHICS_VIEW_H 23 # include <graphics/view.h> 24 #endif 25 26 #ifndef GRAPHICS_RASTPORT_H 27 # include <graphics/rastport.h> 28 #endif 29 30 #ifndef GRAPHICS_LAYERS_H 31 # include <graphics/layers.h> 32 #endif 33 34 #ifndef UTILITY_TAGITEM_H 35 # include <utility/tagitem.h> 36 #endif 37 38 #pragma pack(2) 39 40 41 #ifdef INTUI_V50_NOOBSOLETE 42 43 /* As of intuition.library v50 the direct use of struct DrawInfo is considered 44 ** obsolete. Please use the GetDrawInfoAttr() call described in diattr.h. 45 ** 46 ** The old v40 structure is still available in iobsolete.h and included by 47 ** default. To get rid of obsolete structures and tags you should add following 48 ** defines before including any of intuition includes: 49 ** 50 ** #define INTUI_V50_NOOBSOLETE 51 ** #define INTUITION_IOBSOLETE_H and/or #define INTUI_V36_NAMES_ONLY 52 ** 53 ** As of intuition.library 50.75+ SA_DisplayID has been declared OBSOLETE! 54 ** You should NEVER use it for preferences and store: monitor name, display 55 ** width/height, screen width/height (if different than display w/h) and 56 ** screen depth. This ensures the screen you open will match user's request 57 ** even if the gfx cards or display modes are changed. 58 ** 59 ** The correct examples of a flexible OpenScreen(): 60 ** 61 ** Open the screen on a default monitor: 62 ** 63 ** screen = OpenScreenTags(NULL,SA_Width,1024, 64 ** SA_Height,768, 65 ** SA_Depth,24, 66 ** TAG_DONE); 67 ** 68 ** Open the screen on a requested monitor: 69 ** 70 ** screen = OpenScreenTags(NULL,SA_Width,1024, 71 ** SA_Height,768, 72 ** SA_Depth,24, 73 ** SA_MonitorName,"Radeon9000.monitor", 74 ** TAG_DONE); 75 ** 76 ** NOTE: if Radeon9000.monitor is not found intuition will try to open 77 ** the screen on other monitors from Radeon family and if that is not 78 ** possible on the default monitor (or any other matching the requirements). 79 ** 80 ** Open an autoscrolling screen with size 2000x2000 and a 1024x768 display mode: 81 ** 82 ** screen = OpenScreenTags(NULL,SA_Width,2000, 83 ** SA_Height,2000, 84 ** SA_DisplayWidth,1024, 85 ** SA_DisplayHeight,768, 86 ** SA_Depth,24, 87 ** SA_AutoScroll,TRUE, 88 ** TAG_DONE); 89 ** 90 ** See the notes in SA_MonitorName, SA_DisplayWidth, SA_DisplayID for more info. 91 */ 92 93 struct DrawInfo; 94 struct NewScreen; 95 struct ExtNewScreen; 96 97 /* Screen structure is used to describe intuition screens. All fields are READ ONLY and can 98 ** only be modified with intuition's screen functions. 99 ** 100 ** Starting with 50.53 you should use the Set/GetAttr BOOPSI interface to query/set 101 ** screen params. Reading from struct Screen is still allowed though. 102 ** 103 ** NOTE: the old structure is still included in iobsolete.h 104 */ 105 106 struct Screen 107 { 108 /* pointer to the next screen, can only be accessed between LockIBase()/UnlockIBase() */ 109 struct Screen *NextScreen; 110 111 /* pointer to the first opened window on screen, can only be accessed between LockIBase()/UnlockIBase() */ 112 struct Window *FirstWindow; 113 114 /* used for screen movement if the width/height is greater that display width/height, 115 can be modified with MoveScreen() function */ 116 WORD LeftEdge, TopEdge; 117 118 /* dimensions of the screen */ 119 WORD Width, Height; 120 121 /* mouse position on screen */ 122 WORD MouseY, MouseX; 123 124 /* one of the flags defined below */ 125 UWORD Flags; 126 127 /* pointers to the title and default screen title, this fields shouldn't generaly be accessed at all. 128 ** to modify the screen title for your window use SetWindowTitles() 129 ** IMPORTANT: the string you pass is NOT cached in any way, you must NOT modify it while it's being 130 ** used as screen/window title! */ 131 UBYTE *Title; 132 UBYTE *DefaultTitle; 133 134 /* BarHeight can still be read if you need to know the actual size of the bar, even if it's not 135 ** visible due to user configuration. Remember to add 1 to get real height */ 136 BYTE BarHeight; 137 BYTE Obsolete1[4]; 138 BYTE Obsolete2[4]; 139 140 /* default font for this screen */ 141 struct TextAttr *Font; 142 143 /* structure used to describe screen's display mode & state, should not be accessed */ 144 struct ViewPort ViewPort; 145 146 /* main RastPort structure of the screen, should never be used unless the screen is a custom 147 ** screen with no windows on it. */ 148 struct RastPort RastPort; 149 150 /* OBSOLETE, always use screen->RastPort.BitMap */ 151 struct BitMap Obsolete3; 152 153 /* main layer structure of the screen, should only be used for layer lock calls */ 154 struct Layer_Info LayerInfo; 155 156 /* pointer to the first gadget attached to the screen, a private field */ 157 struct Gadget *FirstGadget; 158 159 ULONG Obsolete4; 160 161 /* pointer to the layer of screen's titlebar, private */ 162 struct Layer *BarLayer; 163 164 UBYTE *ExtData; 165 166 /* general purpose pointer to data supplied by user, should only be used on custom screens */ 167 UBYTE *UserData; 168 }; 169 170 #endif 171 172 #define SCREENTYPE 0x000F /* screen type mask */ 173 #define WBENCHSCREEN 0x0001 /* desktop screen */ 174 #define PUBLICSCREEN 0x0002 /* standard intuition screen */ 175 #define CUSTOMSCREEN 0x000F /* custom screen, can't have visitors, only useful for games */ 176 177 #define SCREENBEHIND 0x0080 /* set with SA_Behind, set if you want your screen to open behind other screens */ 178 #define SCREENQUIET 0x0100 /* set with SA_Quiet, set if you don't want a screen titlebar, useful on custom screens */ 179 #define AUTOSCROLL 0x4000 /* set with SA_Autoscroll, set if you want intuition to allow user to scroll the screen with mouse */ 180 #define PENSHARED 0x0400 /* set with SA_SharePens, allows pen allocation routines to work */ 181 182 #define STDSCREENHEIGHT -1 183 #define STDSCREENWIDTH -1 184 /* Use as the value passed for SA_Width/SA_Height to get the default size of the screen 185 ** for a supplied SA_DisplayID */ 186 187 #define SA_Dummy (TAG_USER + 32) 188 189 #define SA_Left /* ISG */ (SA_Dummy + 1) 190 #define SA_Top /* ISG */ (SA_Dummy + 2) 191 /* LONG. Specifies the screen position when the screen dimensions do not 192 ** match the display dimensions. These tags shouldn't usualy be used, 193 ** it's generaly better to open autoscrolling screens. 194 */ 195 196 #define SA_Width /* I*G */ (SA_Dummy + 3) 197 #define SA_Height /* I*G */ (SA_Dummy + 4) 198 /* LONG. Specifies screen width & height. Please note that you should not 199 ** pass STDSCREENWIDTH/STDSCREENHEIGHT if you do not pass SA_DisplayID as 200 ** well. Read the notes in SA_MonitorName and SA_DisplayWidth/Height! 201 */ 202 203 #define SA_Depth /* I*G */ (SA_Dummy + 5) 204 #define SA_DetailPen /* I** */ (SA_Dummy + 6) 205 #define SA_BlockPen /* I** */ (SA_Dummy + 7) 206 #define SA_Title /* I** */ (SA_Dummy + 8) 207 #define SA_Colors /* I** */ (SA_Dummy + 9) 208 #define SA_ErrorCode /* I** */ (SA_Dummy + 10) 209 #define SA_Font /* I** */ (SA_Dummy + 11) 210 #define SA_SysFont /* I** */ (SA_Dummy + 12) 211 #define SA_Type /* I** */ (SA_Dummy + 13) 212 #define SA_BitMap /* I** */ (SA_Dummy + 14) 213 #define SA_PubName /* I*G */ (SA_Dummy + 15) 214 #define SA_PubSig /* I** */ (SA_Dummy + 16) 215 #define SA_PubTask /* I** */ (SA_Dummy + 17) 216 #define SA_DisplayID /* I*G */ (SA_Dummy + 18) 217 #define SA_DClip /* I** */ (SA_Dummy + 19) 218 #define SA_Overscan /* I** */ (SA_Dummy + 20) 219 #define SA_Obsolete1 /* I** */ (SA_Dummy + 21) 220 221 #define SA_ShowTitle /* I** */ (SA_Dummy + 22) 222 #define SA_Behind /* I*G */ (SA_Dummy + 23) 223 #define SA_Quiet /* I** */ (SA_Dummy + 24) 224 #define SA_AutoScroll /* I** */ (SA_Dummy + 25) 225 #define SA_Pens /* I** */ (SA_Dummy + 26) 226 #define SA_FullPalette /* I** */ (SA_Dummy + 27) 227 #define SA_ColorMapEntries /* I** */ (SA_Dummy + 28) 228 #define SA_Parent /* I** */ (SA_Dummy + 29) 229 #define SA_Draggable /* I** */ (SA_Dummy + 30) 230 #define SA_Exclusive /* I** */ (SA_Dummy + 31) 231 #define SA_SharePens /* I** */ (SA_Dummy + 32) 232 #define SA_BackFill /* I** */ (SA_Dummy + 33) 233 #define SA_Interleaved /* I** */ (SA_Dummy + 34) 234 #define SA_Colors32 /* I** */ (SA_Dummy + 35) 235 #define SA_VideoControl /* I** */ (SA_Dummy + 36) 236 #define SA_FrontChild /* I** */ (SA_Dummy + 37) 237 #define SA_BackChild /* I** */ (SA_Dummy + 38) 238 #define SA_LikeWorkbench /* I** */ (SA_Dummy + 39) 239 #define SA_Reserved (SA_Dummy + 40) 240 #define SA_MinimizeISG /* I** */ (SA_Dummy + 41) 241 242 /* V51 */ 243 244 245 #define SA_Displayed /* **G */ (SA_Dummy + 101) 246 /* BOOL. Check whether the screen is currently displayed on one of 247 ** system's gfx cards. */ 248 249 #define SA_MonitorName /* I*G */ (SA_Dummy + 102) 250 /* char *. Should be used to determine on which monitor (gfx card) 251 ** the screen should be opened. Please use this instead of storing ModeIDs 252 ** in prefs files! Overrides SA_DisplayID and will be used to get the 253 ** best available mode together with SA_Depth or SA_Width/Height. 254 ** Will open a screen on other gfx card if the selected one is not 255 ** found. Please note that .monitor prefix is included in the name. 256 ** For autoscrolling and other non-typical screens please read 257 ** SA_DisplayWidth/Height notes. 258 */ 259 260 #define SA_MonitorObject /* **G */ (SA_Dummy + 103) 261 /* Object *. Returns the MONITORCLASS object associated with the 262 ** screen. Use it in order to get more info about the gfx card 263 ** used to display the screen, monitor alignment, etc. 264 */ 265 266 #define SA_TopLeftScreen /* **G */ (SA_Dummy + 112) 267 #define SA_TopMiddleScreen (SA_Dummy + 113) 268 #define SA_TopRightScreen (SA_Dummy + 114) 269 #define SA_MiddleLeftScreen (SA_Dummy + 115) 270 #define SA_MiddleRightScreen (SA_Dummy + 117) 271 #define SA_BottomLeftScreen (SA_Dummy + 118) 272 #define SA_BottomMiddleScreen (SA_Dummy + 119) 273 #define SA_BottomRightScreen (SA_Dummy + 120) 274 /* struct Screen *. Returns a pointer to the displayed screen 275 ** on a monitor positioned relatively to the monitor your screen is 276 ** displayed on. Returns NULL if no screen can be found or the 277 ** frontmost screen is not a public one. You MUST lock the 278 ** public screens lists if you wish to use the pointer: 279 ** 280 ** this example will position a new window on a monitor positioned 281 ** on a left side of the one you have a window on. 282 ** 283 ** struct Screen *newscreen; 284 ** 285 ** LockPubScreenList(); //lock the screens list 286 ** GetAttr(SA_MiddleLeftScreen,(APTR) mywindow->WScreen,(ULONG*) &newscreen); 287 ** 288 ** if (newscreen) 289 ** { 290 ** //open a window on newscreen here 291 ** } 292 ** 293 ** UnlockPubScreenList(); //unlock the screens list 294 */ 295 296 #define SA_StopBlanker /* *S* */ (SA_Dummy + 121) 297 /* BOOL. Setting this tag to TRUE will stop the intuition's 298 ** screensaver/DPMS features. Please note that the call nests, 299 ** you have to set it to FALSE as many times as you set it to TRUE 300 ** to really enable blanking again. 301 ** IMPORTANT: please remember that you're supposed to set SA_StopBlanker 302 ** to FALSE for example when the user presses Pause in your movie player 303 ** and set it to TRUE again once playback is restarted. 304 */ 305 306 #define SA_ShowPointer /* ISG */ (SA_Dummy + 122) 307 /* BOOL. Setting this tag to FALSE will hide the mouse pointer on your 308 ** screen. Please note that this tag is ONLY supported for CUSTOM 309 ** screens. On public screens you're only supposed to modify the pointer 310 ** of your own window(s). Defaults to TRUE. 311 */ 312 313 #define SA_GammaControl /* I** */ (SA_Dummy + 123) 314 /* BOOL. Set to true if you wish to have control of screen's gamma settings. 315 ** This tag enables the use of SA_GammaRed/Blue/Green tags. 316 */ 317 318 #define SA_GammaRed /* ISG */ (SA_Dummy + 124) 319 #define SA_GammaBlue /* ISG */ (SA_Dummy + 125) 320 #define SA_GammaGreen /* ISG */ (SA_Dummy + 126) 321 /* UBYTE *. Pointer to a 256 byte array containing gamma values for 322 ** all color levels. Setting this tag to NULL will cause intuition to 323 ** use the default values defined for screen's monitor. The array is 324 ** NOT copied! Setting the pointer to the current value will cause a 325 ** gamma refresh. 326 */ 327 328 #define SA_3DSupport /* I** */ (SA_Dummy + 127) 329 /* BOOL. Set this tag to TRUE to make intuition pick a screen mode 330 ** with 3d support. Intuition might pick up a different depth for 331 ** you if the one you requested doesn't have 3d support at all. 332 */ 333 334 #define SA_AdaptSize /* I** */ (SA_Dummy + 128) 335 /* BOOL. Will adapt screen's width & height to screen's display 336 ** width/height (note: this is determined by the available modes 337 ** so if someone has wrong modes for his display, it may match 338 ** that). 339 ** EXAMPLE: SA_Width,1280,SA_Height,960,SA_AdaptSize,TRUE on a 340 ** 1280x1024 LCD will increase the screen height to 1024. 341 */ 342 343 #define SA_DisplayWidth /* I*G */ (SA_Dummy + 129) 344 #define SA_DisplayHeight /* I*G */ (SA_Dummy + 130) 345 /* ULONG. Will be used to search for the displayID instead of 346 ** SA_Width/Height. Use this tag if you want to open a screen 347 ** larger or smaller than the display size (for example an 348 ** autoscrolling screen). The new screen will use dimensions 349 ** passed with SA_Width/Height. 350 */ 351 352 #define SA_OpacitySupport /* **G */ (SA_Dummy + 131) 353 #define SA_SourceAlphaSupport /* **G */ (SA_Dummy + 132) 354 355 #define SA_PixelFormat /* **G */ (SA_Dummy + 133) 356 357 #define SA_ScreenbarTextYPos /* **G */ (SA_Dummy + 134) 358 /* LONG. Text Y pos the screenbar plugins should use. Consistent with 359 ** title and clocks embedded plugins. Includes the baseline of the font 360 ** returned with SA_ScreenbarTextFont! You should use this position rather 361 ** than compute it yourself, since it's SkinConfig dependant */ 362 363 #define SA_ScreenbarTextPen /* **G */ (SA_Dummy + 135) 364 /* ULONG. Text pen color used for rendering text on the screenbar */ 365 366 #define SA_ScreenbarTextFont /* **G */ (SA_Dummy + 136) 367 /* struct TextFont *. Font used by screenbar */ 368 369 #define SA_ScreenbarSignal /* **G */ (SA_Dummy + 137) 370 /* ULONG. Returns a common signal bit num (not mask!) that sbars 371 ** may use. Mind that the signal is not yours to free */ 372 373 #define SA_ExactMatchMonitorName /* I** */ (SA_Dummy + 138) 374 /* BOOL. If TRUE, the screen will either be opened on the 375 ** monitor matched by SA_MonitorName or won't open at all */ 376 377 #define SA_CompositingLayers /* I*G */ (SA_Dummy + 139) 378 /* BOOL. Set this to true to request a compositing engine to 379 ** handle layers on your screen. Get this attr to see if this 380 ** succceeded. From v51.30 */ 381 382 #define OSERR_NOMONITOR (1) 383 #define OSERR_NOCHIPS (2) 384 #define OSERR_NOMEM (3) 385 #define OSERR_NOCHIPMEM (4) 386 #define OSERR_PUBNOTUNIQUE (5) 387 #define OSERR_UNKNOWNMODE (6) 388 #define OSERR_TOODEEP (7) 389 #define OSERR_ATTACHFAIL (8) 390 #define OSERR_NOTAVAILABLE (9) 391 392 393 struct PubScreenNode 394 { 395 struct Node psn_Node; 396 struct Screen *psn_Screen; 397 UWORD psn_Flags; 398 WORD psn_Size; 399 WORD psn_VisitorCount; 400 struct Task *psn_SigTask; 401 UBYTE psn_SigBit; 402 }; 403 404 #define PSNF_PRIVATE (0x0001) 405 406 407 #define MAXPUBSCREENNAME (139) 408 409 410 #define SHANGHAI 0x0001 411 #define POPPUBSCREEN 0x0002 412 413 /* ScreenDepth() flags, it's generaly easier to use ScreenToFront()/ScreenToBack() calls */ 414 #define SDEPTH_TOFRONT (0) /* bring the screen to front */ 415 #define SDEPTH_TOBACK (1) /* bring the screen to back */ 416 417 418 #define SPOS_RELATIVE (0) 419 #define SPOS_ABSOLUTE (1) 420 #define SPOS_MAKEVISIBLE (2) 421 #define SPOS_FORCEDRAG (4) 422 423 /* Structure used for double or triple-buffering of screens, can only 424 ** be used on custom screens. The buffers can only be allocated with the 425 ** AllocScreenBuffer() call. 426 */ 427 struct ScreenBuffer 428 { 429 struct BitMap *sb_BitMap; 430 struct DBufInfo *sb_DBufInfo; 431 }; 432 433 /* AllocScreenBuffer flags, documented in AllocScreenBuffer autodoc */ 434 #define SB_SCREEN_BITMAP 1 435 #define SB_COPY_BITMAP 2 436 437 /* Flags for screen's layer opacity + source opacity support */ 438 #define SAOS_OpacitySupport_None 0 /* opacity setting unsupported */ 439 #define SAOS_OpacitySupport_OnOff 1 /* only fully visible/fully invisible supported */ 440 #define SAOS_OpacitySupport_CPU 2 /* opacity is done by the CPU - slow */ 441 #define SAOS_OpacitySupport_HW 3 /* opacity is hardware accelerated */ 442 443 #define SASA_SourceAlphaSupport_None 0 /* source alpha not supported */ 444 #define SASA_SourceAlphaSupport_CPU 1 /* source alpha done by the CPU - slow!!! */ 445 #define SASA_SourceAlphaSupport_HW 2 /* source alpha hardware accelerated */ 446 447 #pragma pack() 448 449 #ifndef INTUITION_IOBSOLETE_H 450 # include <intuition/iobsolete.h> 451 #endif 452 453 #endif /* INTUITION_SCREENS_H */