home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD2.1 / includes / intuition / screens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-11  |  13.7 KB  |  408 lines

  1. #ifndef INTUITION_SCREENS_H
  2. #define INTUITION_SCREENS_H TRUE
  3. /*
  4. **  $VER: screens.h 36.36 (07.10.91)
  5. **  Includes Release 38.56
  6. **
  7. **  The Screen and NewScreen structures and attributes
  8. **
  9. **  (C) Copyright 1985-1992 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifndef GRAPHICS_GFX_H
  18. #include <graphics/gfx.h>
  19. #endif
  20.  
  21. #ifndef GRAPHICS_CLIP_H
  22. #include <graphics/clip.h>
  23. #endif
  24.  
  25. #ifndef GRAPHICS_VIEW_H
  26. #include <graphics/view.h>
  27. #endif
  28.  
  29. #ifndef GRAPHICS_RASTPORT_H
  30. #include <graphics/rastport.h>
  31. #endif
  32.  
  33. #ifndef GRAPHICS_LAYERS_H
  34. #include <graphics/layers.h>
  35. #endif
  36.  
  37. #ifndef UTILITY_TAGITEM_H
  38. #include <utility/tagitem.h>
  39. #endif
  40.  
  41. /*
  42.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  43.  */
  44.  
  45. /* ======================================================================== */
  46. /* === DrawInfo ========================================================= */
  47. /* ======================================================================== */
  48.  
  49. /* This is a packet of information for graphics rendering.  It originates
  50.  * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  51.  */
  52.  
  53. /* If you find dri_Version >= DRI_VERSION, you know this structure
  54.  * has at least the fields defined in this version of the include file
  55.  */
  56. #define RI_VERSION    (1)    /* obsolete, will be removed        */
  57. #define DRI_VERSION    (1)
  58.  
  59. struct DrawInfo
  60. {
  61.     UWORD    dri_Version;    /* will be  DRI_VERSION            */
  62.     UWORD    dri_NumPens;    /* guaranteed to be >= numDrIPens    */
  63.     UWORD    *dri_Pens;    /* pointer to pen array            */
  64.  
  65.     struct TextFont    *dri_Font;    /* screen default font        */
  66.     UWORD    dri_Depth;    /* (initial) depth of screen bitmap    */
  67.  
  68.     struct {      /* from DisplayInfo database for initial display mode    */
  69.     UWORD    X;
  70.     UWORD    Y;
  71.     }        dri_Resolution;
  72.  
  73.     ULONG    dri_Flags;        /* defined below        */
  74.     ULONG    dri_Reserved[7];    /* avoid recompilation ;^)    */
  75. };
  76.  
  77. #define DRIF_NEWLOOK    0x00000001    /* specified SA_Pens, full treatment */
  78.  
  79. /* rendering pen number indexes into DrawInfo.dri_Pens[]    */
  80. #define DETAILPEN     (0x0000)    /* compatible Intuition rendering pens    */
  81. #define BLOCKPEN     (0x0001)    /* compatible Intuition rendering pens    */
  82. #define TEXTPEN         (0x0002)    /* text on background            */
  83. #define SHINEPEN     (0x0003)    /* bright edge on 3D objects        */
  84. #define SHADOWPEN     (0x0004)    /* dark edge on 3D objects        */
  85. #define FILLPEN         (0x0005)    /* active-window/selected-gadget fill    */
  86. #define FILLTEXTPEN     (0x0006)    /* text over FILLPEN            */
  87. #define BACKGROUNDPEN     (0x0007)    /* always color 0            */
  88. #define HIGHLIGHTTEXTPEN (0x0008)    /* special color text, on background    */
  89.  
  90. #define NUMDRIPENS     (0x0009)
  91.  
  92.  
  93. /* ======================================================================== */
  94. /* === Screen ============================================================= */
  95. /* ======================================================================== */
  96. struct Screen
  97. {
  98.     struct Screen *NextScreen;        /* linked list of screens */
  99.     struct Window *FirstWindow;        /* linked list Screen's Windows */
  100.  
  101.     WORD LeftEdge, TopEdge;        /* parameters of the screen */
  102.     WORD Width, Height;            /* parameters of the screen */
  103.  
  104.     WORD MouseY, MouseX;        /* position relative to upper-left */
  105.  
  106.     UWORD Flags;            /* see definitions below */
  107.  
  108.     UBYTE *Title;            /* null-terminated Title text */
  109.     UBYTE *DefaultTitle;        /* for Windows without ScreenTitle */
  110.  
  111.     /* Bar sizes for this Screen and all Window's in this Screen */
  112.     /* Note that BarHeight is one less than the actual menu bar
  113.      * height.    We're going to keep this in V36 for compatibility,
  114.      * although V36 artwork might use that extra pixel
  115.      *
  116.      * Also, the title bar height of a window is calculated from the
  117.      * screen's WBorTop field, plus the font height, plus one.
  118.      */
  119.     BYTE BarHeight, BarVBorder, BarHBorder, MenuVBorder, MenuHBorder;
  120.     BYTE WBorTop, WBorLeft, WBorRight, WBorBottom;
  121.  
  122.     struct TextAttr *Font;        /* this screen's default font       */
  123.  
  124.     /* the display data structures for this Screen */
  125.     struct ViewPort ViewPort;        /* describing the Screen's display */
  126.     struct RastPort RastPort;        /* describing Screen rendering       */
  127.     struct BitMap BitMap;        /* extra copy of RastPort BitMap   */
  128.     struct Layer_Info LayerInfo;    /* each screen gets a LayerInfo    */
  129.  
  130.     /* Only system gadgets may be attached to a screen.
  131.      *    You get the standard system Screen Gadgets automatically
  132.      */
  133.     struct Gadget *FirstGadget;
  134.  
  135.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  136.  
  137.     /* the following variable(s) are maintained by Intuition to support the
  138.      * DisplayBeep() color flashing technique
  139.      */
  140.     UWORD SaveColor0;
  141.  
  142.     /* This layer is for the Screen and Menu bars */
  143.     struct Layer *BarLayer;
  144.  
  145.     UBYTE *ExtData;
  146.  
  147.     UBYTE *UserData;    /* general-purpose pointer to User data extension */
  148.  
  149.     /**** Data below this point are SYSTEM PRIVATE ****/
  150. };
  151.  
  152.  
  153. /* --- FLAGS SET BY INTUITION --------------------------------------------- */
  154. /* The SCREENTYPE bits are reserved for describing various Screen types
  155.  * available under Intuition.
  156.  */
  157. #define SCREENTYPE    0x000F    /* all the screens types available    */
  158. /* --- the definitions for the Screen Type ------------------------------- */
  159. #define WBENCHSCREEN    0x0001    /* identifies the Workbench screen    */
  160. #define PUBLICSCREEN    0x0002    /* public shared (custom) screen    */
  161. #define CUSTOMSCREEN    0x000F    /* original custom screens        */
  162.  
  163. #define SHOWTITLE    0x0010    /* this gets set by a call to ShowTitle() */
  164.  
  165. #define BEEPING        0x0020    /* set when Screen is beeping (private)    */
  166.  
  167. #define CUSTOMBITMAP    0x0040    /* if you are supplying your own BitMap */
  168.  
  169. #define SCREENBEHIND    0x0080    /* if you want your screen to open behind
  170.                  * already open screens
  171.                  */
  172. #define SCREENQUIET    0x0100    /* if you do not want Intuition to render
  173.                  * into your screen (gadgets, title)
  174.                  */
  175. #define SCREENHIRES    0x0200    /* do not use lowres gadgets  (private)    */
  176.  
  177. #define NS_EXTENDED    0x1000        /* ExtNewScreen.Extension is valid    */
  178. /* V36 applications can use OpenScreenTagList() instead of NS_EXTENDED    */
  179.  
  180. #define AUTOSCROLL    0x4000    /* screen is to autoscoll        */
  181.  
  182. #define STDSCREENHEIGHT -1    /* supply in NewScreen.Height        */
  183. #define STDSCREENWIDTH -1    /* supply in NewScreen.Width        */
  184.  
  185. /*
  186.  * Screen attribute tag ID's.  These are used in the ti_Tag field of
  187.  * TagItem arrays passed to OpenScreenTagList() (or in the
  188.  * ExtNewScreen.Extension field).
  189.  */
  190.  
  191. /* Screen attribute tags.  Please use these versions, not those in
  192.  * iobsolete.h.
  193.  */
  194.  
  195. #define SA_Dummy    (TAG_USER + 32)
  196. /*
  197.  * these items specify items equivalent to fields in NewScreen
  198.  */
  199. #define SA_Left        (SA_Dummy + 0x0001)
  200. #define SA_Top        (SA_Dummy + 0x0002)
  201. #define SA_Width    (SA_Dummy + 0x0003)
  202. #define SA_Height    (SA_Dummy + 0x0004)
  203.             /* traditional screen positions    and dimensions    */
  204. #define SA_Depth    (SA_Dummy + 0x0005)
  205.             /* screen bitmap depth                */
  206. #define SA_DetailPen    (SA_Dummy + 0x0006)
  207.             /* serves as default for windows, too        */
  208. #define SA_BlockPen    (SA_Dummy + 0x0007)
  209. #define SA_Title    (SA_Dummy + 0x0008)
  210.             /* default screen title                */
  211. #define SA_Colors    (SA_Dummy + 0x0009)
  212.             /* ti_Data is an array of struct ColorSpec,
  213.              * terminated by ColorIndex = -1.  Specifies
  214.              * initial screen palette colors.
  215.              */
  216. #define SA_ErrorCode    (SA_Dummy + 0x000A)
  217.             /* ti_Data points to LONG error code (values below)*/
  218. #define SA_Font        (SA_Dummy + 0x000B)
  219.             /* equiv. to NewScreen.Font            */
  220. #define SA_SysFont    (SA_Dummy + 0x000C)
  221.             /* Selects one of the preferences system fonts:
  222.              *    0 - old DefaultFont, fixed-width
  223.              *    1 - WB Screen preferred font
  224.              */
  225. #define SA_Type        (SA_Dummy + 0x000D)
  226.             /* equiv. to NewScreen.Type            */
  227. #define SA_BitMap    (SA_Dummy + 0x000E)
  228.             /* ti_Data is pointer to custom BitMap.  This
  229.              * implies type of CUSTOMBITMAP
  230.              */
  231. #define SA_PubName    (SA_Dummy + 0x000F)
  232.             /* presence of this tag means that the screen
  233.              * is to be a public screen.  Please specify
  234.              * BEFORE the two tags below
  235.              */
  236. #define SA_PubSig    (SA_Dummy + 0x0010)
  237. #define SA_PubTask    (SA_Dummy + 0x0011)
  238.             /* Task ID and signal for being notified that
  239.              * the last window has closed on a public screen.
  240.              */
  241. #define SA_DisplayID    (SA_Dummy + 0x0012)
  242.             /* ti_Data is new extended display ID from
  243.              * <graphics/displayinfo.h>.
  244.              */
  245. #define SA_DClip    (SA_Dummy + 0x0013)
  246.             /* ti_Data points to a rectangle which defines
  247.              * screen display clip region
  248.              */
  249. #define SA_Overscan    (SA_Dummy + 0x0014)
  250.             /* was S_STDDCLIP.  Set to one of the OSCAN_
  251.              * specifiers below to get a system standard
  252.              * overscan region for your display clip,
  253.              * screen dimensions (unless otherwise specified),
  254.              * and automatically centered position (partial
  255.              * support only so far).
  256.              * If you use this, you shouldn't specify
  257.              * SA_DClip.  SA_Overscan is for "standard"
  258.              * overscan dimensions, SA_DClip is for
  259.              * your custom numeric specifications.
  260.              */
  261. #define SA_Obsolete1    (SA_Dummy + 0x0015)
  262.             /* obsolete S_MONITORNAME            */
  263.  
  264. /** booleans **/
  265. #define SA_ShowTitle    (SA_Dummy + 0x0016)
  266.             /* boolean equivalent to flag SHOWTITLE        */
  267. #define SA_Behind    (SA_Dummy + 0x0017)
  268.             /* boolean equivalent to flag SCREENBEHIND    */
  269. #define SA_Quiet    (SA_Dummy + 0x0018)
  270.             /* boolean equivalent to flag SCREENQUIET    */
  271. #define SA_AutoScroll    (SA_Dummy + 0x0019)
  272.             /* boolean equivalent to flag AUTOSCROLL    */
  273. #define SA_Pens        (SA_Dummy + 0x001A)
  274.             /* pointer to ~0 terminated UWORD array, as
  275.              * found in struct DrawInfo
  276.              */
  277. #define SA_FullPalette    (SA_Dummy + 0x001B)
  278.             /* boolean: initialize color table to entire
  279.              *  preferences palette (32 for V36), rather
  280.              * than compatible pens 0-3, 17-19, with
  281.              * remaining palette as returned by GetColorMap()
  282.              */
  283.  
  284. /* this is an obsolete tag included only for compatibility with V35
  285.  * interim release for the A2024 and Viking monitors
  286.  */
  287. #ifndef NSTAG_EXT_VPMODE
  288. #define NSTAG_EXT_VPMODE (TAG_USER | 1)
  289. #endif
  290.  
  291.  
  292. /* OpenScreen error codes, which are returned in the (optional) LONG
  293.  * pointed to by ti_Data for the SA_ErrorCode tag item
  294.  */
  295. #define OSERR_NOMONITOR    (1)    /* named monitor spec not available    */
  296. #define OSERR_NOCHIPS    (2)    /* you need newer custom chips        */
  297. #define OSERR_NOMEM    (3)    /* couldn't get normal memory        */
  298. #define OSERR_NOCHIPMEM    (4)    /* couldn't get chipmem            */
  299. #define OSERR_PUBNOTUNIQUE (5)    /* public screen name already used    */
  300. #define OSERR_UNKNOWNMODE (6)    /* don't recognize mode asked for    */
  301.  
  302. /* ======================================================================== */
  303. /* === NewScreen ========================================================== */
  304. /* ======================================================================== */
  305. /* note: to use the Extended field, you must use the
  306.  * new ExtNewScreen structure, below
  307.  */
  308. struct NewScreen
  309. {
  310.     WORD LeftEdge, TopEdge, Width, Height, Depth;  /* screen dimensions */
  311.  
  312.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering    */
  313.  
  314.     UWORD ViewModes;        /* the Modes for the ViewPort (and View) */
  315.  
  316.     UWORD Type;            /* the Screen type (see defines above)    */
  317.  
  318.     struct TextAttr *Font;    /* this Screen's default text attributes */
  319.  
  320.     UBYTE *DefaultTitle;    /* the default title for this Screen    */
  321.  
  322.     struct Gadget *Gadgets;    /* UNUSED:  Leave this NULL        */
  323.  
  324.     /* if you are opening a CUSTOMSCREEN and already have a BitMap
  325.      * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  326.      * the Type field and you set this variable to point to your BitMap
  327.      * structure.  The structure will be copied into your Screen structure,
  328.      * after which you may discard your own BitMap if you want
  329.      */
  330.     struct BitMap *CustomBitMap;
  331. };
  332.  
  333. /*
  334.  * For compatibility reasons, we need a new structure for extending
  335.  * NewScreen.  Use this structure is you need to use the new Extension
  336.  * field.
  337.  *
  338.  * NOTE: V36-specific applications should use the
  339.  * OpenScreenTagList( newscreen, tags ) version of OpenScreen().
  340.  * Applications that want to be V34-compatible as well may safely use the
  341.  * ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.
  342.  *
  343.  */
  344. struct ExtNewScreen
  345. {
  346.     WORD LeftEdge, TopEdge, Width, Height, Depth;
  347.     UBYTE DetailPen, BlockPen;
  348.     UWORD ViewModes;
  349.     UWORD Type;
  350.     struct TextAttr *Font;
  351.     UBYTE *DefaultTitle;
  352.     struct Gadget *Gadgets;
  353.     struct BitMap *CustomBitMap;
  354.  
  355.     struct TagItem    *Extension;
  356.                 /* more specification data, scanned if
  357.                  * NS_EXTENDED is set in NewScreen.Type
  358.                  */
  359. };
  360.  
  361. /* === Overscan Types ===    */
  362. #define OSCAN_TEXT    (1)    /* entirely visible    */
  363. #define OSCAN_STANDARD    (2)    /* just past edges    */
  364. #define OSCAN_MAX    (3)    /* as much as possible    */
  365. #define OSCAN_VIDEO    (4)    /* even more than is possible    */
  366.  
  367.  
  368. /* === Public Shared Screen Node ===    */
  369.  
  370. /* This is the representative of a public shared screen.
  371.  * This is an internal data structure, but some functions may
  372.  * present a copy of it to the calling application.  In that case,
  373.  * be aware that the screen pointer of the structure can NOT be
  374.  * used safely, since there is no guarantee that the referenced
  375.  * screen will remain open and a valid data structure.
  376.  *
  377.  * Never change one of these.
  378.  */
  379.  
  380. struct PubScreenNode    {
  381.     struct Node        psn_Node;    /* ln_Name is screen name */
  382.     struct Screen    *psn_Screen;
  383.     UWORD        psn_Flags;    /* below        */
  384.     WORD        psn_Size;    /* includes name buffer    */
  385.     WORD        psn_VisitorCount; /* how many visitor windows */
  386.     struct Task        *psn_SigTask;    /* who to signal when visitors gone */
  387.     UBYTE        psn_SigBit;    /* which signal    */
  388. };
  389.  
  390. #define PSNF_PRIVATE    (0x0001)
  391.  
  392. /* NOTE: Due to a bug in NextPubScreen(), make sure your buffer
  393.  * actually has MAXPUBSCREENNAME+1 characters in it!
  394.  */
  395. #define MAXPUBSCREENNAME    (139)    /* names no longer, please    */
  396.  
  397. /* pub screen modes    */
  398. #define SHANGHAI    0x0001    /* put workbench windows on pub screen */
  399. #define POPPUBSCREEN    0x0002    /* pop pub screen to front when visitor opens */
  400.  
  401.  
  402. /* Include obsolete identifiers: */
  403. #ifndef INTUITION_IOBSOLETE_H
  404. #include <intuition/iobsolete.h>
  405. #endif
  406.  
  407. #endif
  408.