home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / intuition / imageclass.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-30  |  9.2 KB  |  311 lines

  1. #ifndef INTUITION_IMAGECLASS_H
  2. #define INTUITION_IMAGECLASS_H
  3. /*
  4. **    $VER: imageclass.h 44.1 (19.10.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    definitions for the system image classes
  8. **
  9. **    (C) Copyright 1987-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. /******************************************************/
  14.  
  15. #ifndef INTUITION_INTUITION_H
  16. #include <intuition/intuition.h>
  17. #endif
  18.  
  19. /*
  20.  * NOTE:  <intuition/iobsolete.h> is included at the END of this file!
  21.  */
  22.  
  23. #define CUSTOMIMAGEDEPTH    (-1)
  24. /* if image.Depth is this, it's a new Image class object */
  25.  
  26. /* some convenient macros and casts */
  27. #define GADGET_BOX( g )    ( (struct IBox *) &((struct Gadget *)(g))->LeftEdge )
  28. #define IM_BOX( im )    ( (struct IBox *) &((struct Image *)(im))->LeftEdge )
  29. #define IM_FGPEN( im )    ( (im)->PlanePick )
  30. #define IM_BGPEN( im )    ( (im)->PlaneOnOff )
  31.  
  32. /******************************************************/
  33. #define IA_Dummy        (TAG_USER + 0x20000)
  34. #define IA_Left            (IA_Dummy + 0x01)
  35. #define IA_Top            (IA_Dummy + 0x02)
  36. #define IA_Width        (IA_Dummy + 0x03)
  37. #define IA_Height        (IA_Dummy + 0x04)
  38. #define IA_FGPen        (IA_Dummy + 0x05)
  39.             /* IA_FGPen also means "PlanePick"    */
  40. #define IA_BGPen        (IA_Dummy + 0x06)
  41.             /* IA_BGPen also means "PlaneOnOff"    */
  42. #define IA_Data            (IA_Dummy + 0x07)
  43.             /* bitplanes, for classic image,
  44.              * other image classes may use it for other things
  45.              */
  46. #define IA_LineWidth        (IA_Dummy + 0x08)
  47. #define IA_Pens            (IA_Dummy + 0x0E)
  48.             /* pointer to UWORD pens[],
  49.              * ala DrawInfo.Pens, MUST be
  50.              * terminated by ~0.  Some classes can
  51.              * choose to have this, or SYSIA_DrawInfo,
  52.              * or both.
  53.              */
  54. #define IA_Resolution        (IA_Dummy + 0x0F)
  55.             /* packed uwords for x/y resolution into a longword
  56.              * ala DrawInfo.Resolution
  57.              */
  58.  
  59. /**** see class documentation to learn which    *****/
  60. /**** classes recognize these            *****/
  61. #define IA_APattern        (IA_Dummy + 0x10)
  62. #define IA_APatSize        (IA_Dummy + 0x11)
  63. #define IA_Mode            (IA_Dummy + 0x12)
  64. #define IA_Font            (IA_Dummy + 0x13)
  65. #define IA_Outline        (IA_Dummy + 0x14)
  66. #define IA_Recessed        (IA_Dummy + 0x15)
  67. #define IA_DoubleEmboss        (IA_Dummy + 0x16)
  68. #define IA_EdgesOnly        (IA_Dummy + 0x17)
  69.  
  70. /**** "sysiclass" attributes            *****/
  71. #define SYSIA_Size        (IA_Dummy + 0x0B)
  72.             /* #define's below        */
  73. #define SYSIA_Depth        (IA_Dummy + 0x0C)
  74.             /* this is unused by Intuition.  SYSIA_DrawInfo
  75.              * is used instead for V36
  76.              */
  77. #define SYSIA_Which        (IA_Dummy + 0x0D)
  78.             /* see #define's below    */
  79. #define SYSIA_DrawInfo        (IA_Dummy + 0x18)
  80.             /* pass to sysiclass, please */
  81.  
  82. /*****    obsolete: don't use these, use IA_Pens    *****/
  83. #define SYSIA_Pens        IA_Pens
  84. #define IA_ShadowPen        (IA_Dummy + 0x09)
  85. #define IA_HighlightPen        (IA_Dummy + 0x0A)
  86.  
  87. /* New for V39: */
  88. #define SYSIA_ReferenceFont    (IA_Dummy + 0x19)
  89.             /* Font to use as reference for scaling
  90.              * certain sysiclass images
  91.              */
  92. #define IA_SupportsDisable    (IA_Dummy + 0x1a)
  93.             /* By default, Intuition ghosts gadgets itself,
  94.              * instead of relying on IDS_DISABLED or
  95.              * IDS_SELECTEDDISABLED.  An imageclass that
  96.              * supports these states should return this attribute
  97.              * as TRUE.  You cannot set or clear this attribute,
  98.              * however.
  99.              */
  100.  
  101. #define IA_FrameType        (IA_Dummy + 0x1b)
  102.             /* Starting with V39, FrameIClass recognizes
  103.              * several standard types of frame.  Use one
  104.              * of the FRAME_ specifiers below.    Defaults
  105.              * to FRAME_DEFAULT.
  106.              */
  107.  
  108. #define IA_Underscore        (IA_Dummy + 0x1c)
  109.             /* V44, Indicate underscore keyboard shortcut for image labels.
  110.              * (UBYTE) Defaults to '_'
  111.              */
  112.  
  113. #define IA_Scalable            (IA_Dummy + 0x1d)
  114.             /* V44, Attribute indicates this image is allowed
  115.              * to/can scale its rendering.
  116.              * (BOOL) Defaults to FALSE.
  117.              */
  118.  
  119. #define IA_ActivateKey            (IA_Dummy + 0x1e)
  120.             /* V44, Used to get an underscored label shortcut.
  121.              * Useful for labels attached to string gadgets.
  122.              * (UBYTE) Defaults to NULL.
  123.              */
  124.  
  125. #define IA_Screen            (IA_Dummy + 0x1f)
  126.             /* V44 Screen pointer, may be useful/required by certain classes.
  127.              * (struct Screen *)
  128.              */
  129.  
  130. #define IA_Precision            (IA_Dummy + 0x20)
  131.             /* V44 Precision value, typically pen precision but may be
  132.              * used for similar custom purposes.
  133.              * (ULONG)
  134.              */
  135.  
  136. /** next attribute: (IA_Dummy + 0x21)    **/
  137. /*************************************************/
  138.  
  139. /* data values for SYSIA_Size    */
  140. #define SYSISIZE_MEDRES    (0)
  141. #define SYSISIZE_LOWRES    (1)
  142. #define SYSISIZE_HIRES    (2)
  143.  
  144. /*
  145.  * SYSIA_Which tag data values:
  146.  * Specifies which system gadget you want an image for.
  147.  * Some numbers correspond to internal Intuition #defines
  148.  */
  149. #define DEPTHIMAGE    (0x00L)    /* Window depth gadget image */
  150. #define ZOOMIMAGE    (0x01L)    /* Window zoom gadget image */
  151. #define SIZEIMAGE    (0x02L)    /* Window sizing gadget image */
  152. #define CLOSEIMAGE    (0x03L)    /* Window close gadget image */
  153. #define SDEPTHIMAGE    (0x05L)    /* Screen depth gadget image */
  154. #define LEFTIMAGE    (0x0AL)    /* Left-arrow gadget image */
  155. #define UPIMAGE        (0x0BL)    /* Up-arrow gadget image */
  156. #define RIGHTIMAGE    (0x0CL)    /* Right-arrow gadget image */
  157. #define DOWNIMAGE    (0x0DL)    /* Down-arrow gadget image */
  158. #define CHECKIMAGE    (0x0EL)    /* GadTools checkbox image */
  159. #define MXIMAGE        (0x0FL)    /* GadTools mutual exclude "button" image */
  160. /* New for V39: */
  161. #define    MENUCHECK    (0x10L)    /* Menu checkmark image */
  162. #define AMIGAKEY    (0x11L)    /* Menu Amiga-key image */
  163.  
  164. /* Data values for IA_FrameType (recognized by FrameIClass)
  165.  *
  166.  * FRAME_DEFAULT:  The standard V37-type frame, which has
  167.  *    thin edges.
  168.  * FRAME_BUTTON:  Standard button gadget frames, having thicker
  169.  *    sides and nicely edged corners.
  170.  * FRAME_RIDGE:  A ridge such as used by standard string gadgets.
  171.  *    You can recess the ridge to get a groove image.
  172.  * FRAME_ICONDROPBOX: A broad ridge which is the standard imagery
  173.  *    for areas in AppWindows where icons may be dropped.
  174.  */
  175.  
  176. #define FRAME_DEFAULT        0
  177. #define FRAME_BUTTON        1
  178. #define FRAME_RIDGE        2
  179. #define FRAME_ICONDROPBOX    3
  180.  
  181.  
  182. /* image message id's    */
  183. #define    IM_DRAW    0x202L    /* draw yourself, with "state" */
  184. #define    IM_HITTEST    0x203L    /* return TRUE if click hits image    */
  185. #define    IM_ERASE    0x204L    /* erase yourself */
  186. #define    IM_MOVE    0x205L    /* draw new and erase old, smoothly    */
  187.  
  188. #define    IM_DRAWFRAME    0x206L    /* draw with specified dimensions */
  189. #define    IM_FRAMEBOX    0x207L    /* get recommended frame around some box*/
  190. #define    IM_HITFRAME    0x208L    /* hittest with dimensions */
  191. #define    IM_ERASEFRAME 0x209L    /* erase with dimensions */
  192. #define    IM_DOMAINFRAME    0x20AL  /* query image for its domain info (V44) */
  193.  
  194.  
  195. /* image draw states or styles, for IM_DRAW */
  196. /* Note that they have no bitwise meanings (unfortunately) */
  197. #define    IDS_NORMAL        (0L)
  198. #define    IDS_SELECTED        (1L)    /* for selected gadgets        */
  199. #define    IDS_DISABLED        (2L)    /* for disabled gadgets        */
  200. #define       IDS_BUSY        (3L)    /* for future functionality */
  201. #define    IDS_INDETERMINATE    (4L)    /* for future functionality */
  202. #define    IDS_INACTIVENORMAL    (5L)    /* normal, in inactive window border */
  203. #define    IDS_INACTIVESELECTED    (6L)    /* selected, in inactive border */
  204. #define    IDS_INACTIVEDISABLED    (7L)    /* disabled, in inactive border */
  205. #define       IDS_SELECTEDDISABLED (8L)    /* disabled and selected    */
  206.  
  207. /* oops, please forgive spelling error by jimm */
  208. #define IDS_INDETERMINANT IDS_INDETERMINATE
  209.  
  210. /* IM_FRAMEBOX    */
  211. struct impFrameBox {
  212.     ULONG        MethodID;
  213.     struct IBox    *imp_ContentsBox;    /* input: relative box of contents */
  214.     struct IBox    *imp_FrameBox;        /* output: rel. box of encl frame  */
  215.     struct DrawInfo    *imp_DrInfo;    /* NB: May be NULL */
  216.     ULONG    imp_FrameFlags;
  217. };
  218.  
  219. #define FRAMEF_SPECIFY    (1<<0)    /* Make do with the dimensions of FrameBox
  220.                  * provided.
  221.                  */
  222.  
  223. /* IM_DRAW, IM_DRAWFRAME    */
  224. struct impDraw
  225. {
  226.     ULONG        MethodID;
  227.     struct RastPort    *imp_RPort;
  228.     struct
  229.     {
  230.     WORD    X;
  231.     WORD    Y;
  232.     }            imp_Offset;
  233.  
  234.     ULONG        imp_State;
  235.     struct DrawInfo    *imp_DrInfo;    /* NB: May be NULL */
  236.  
  237.     /* these parameters only valid for IM_DRAWFRAME */
  238.     struct
  239.     {
  240.     WORD    Width;
  241.     WORD    Height;
  242.     }            imp_Dimensions;
  243. };
  244.  
  245. /* IM_ERASE, IM_ERASEFRAME    */
  246. /* NOTE: This is a subset of impDraw    */
  247. struct impErase
  248. {
  249.     ULONG        MethodID;
  250.     struct RastPort    *imp_RPort;
  251.     struct
  252.     {
  253.     WORD    X;
  254.     WORD    Y;
  255.     }            imp_Offset;
  256.  
  257.     /* these parameters only valid for IM_ERASEFRAME */
  258.     struct
  259.     {
  260.     WORD    Width;
  261.     WORD    Height;
  262.     }            imp_Dimensions;
  263. };
  264.  
  265. /* IM_HITTEST, IM_HITFRAME    */
  266. struct impHitTest
  267. {
  268.     ULONG        MethodID;
  269.     struct
  270.     {
  271.     WORD    X;
  272.     WORD    Y;
  273.     }            imp_Point;
  274.  
  275.     /* these parameters only valid for IM_HITFRAME */
  276.     struct
  277.     {
  278.     WORD    Width;
  279.     WORD    Height;
  280.     }            imp_Dimensions;
  281. };
  282.  
  283.  
  284. /* The IM_DOMAINFRAME method is used to obtain the sizing
  285.  * requirements of an image object within a layout group.
  286.  */
  287.  
  288. /* IM_DOMAINFRAME */
  289. struct impDomainFrame
  290. {
  291.     ULONG         MethodID;
  292.     struct DrawInfo    *imp_DrInfo;    /* DrawInfo */
  293.     struct RastPort    *imp_RPort;    /* RastPort to layout for */
  294.     LONG          imp_Which;    /* what size - min/nominal/max */
  295.     struct IBox         imp_Domain;    /* Resulting domain */
  296.     struct TagItem    *imp_Attrs;    /* Additional attributes */
  297. };
  298.  
  299. /* Accepted vales for imp_Which.
  300.  */
  301. #define IDOMAIN_MINIMUM        (0)
  302. #define IDOMAIN_NOMINAL        (1)
  303. #define IDOMAIN_MAXIMUM        (2)
  304.  
  305. /* Include obsolete identifiers: */
  306. #ifndef INTUITION_IOBSOLETE_H
  307. #include <intuition/iobsolete.h>
  308. #endif
  309.  
  310. #endif
  311.