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 / workbench / workbench.h < prev   
Encoding:
C/C++ Source or Header  |  1999-10-20  |  15.3 KB  |  454 lines

  1. #ifndef WORKBENCH_WORKBENCH_H
  2. #define WORKBENCH_WORKBENCH_H
  3. /*
  4. **    $VER: workbench.h 44.30 (27.9.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    workbench.library general definitions
  8. **
  9. **    Copyright © 1985-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TASKS_H
  14. #include <exec/tasks.h>
  15. #endif
  16.  
  17. #ifndef DOS_DOS_H
  18. #include <dos/dos.h>
  19. #endif
  20.  
  21. #ifndef INTUITION_INTUITION_H
  22. #include <intuition/intuition.h>
  23. #endif
  24.  
  25. #define    WBDISK        1
  26. #define    WBDRAWER    2
  27. #define    WBTOOL        3
  28. #define    WBPROJECT    4
  29. #define    WBGARBAGE    5
  30. #define    WBDEVICE    6
  31. #define    WBKICK        7
  32. #define WBAPPICON    8
  33.  
  34. struct OldDrawerData { /* pre V36 definition */
  35.     struct NewWindow    dd_NewWindow;    /* args to open window */
  36.     LONG        dd_CurrentX;    /* current x coordinate of origin */
  37.     LONG        dd_CurrentY;    /* current y coordinate of origin */
  38. };
  39. /* the amount of DrawerData actually written to disk */
  40. #define OLDDRAWERDATAFILESIZE    (sizeof(struct OldDrawerData))
  41.  
  42. struct DrawerData {
  43.     struct NewWindow    dd_NewWindow;    /* args to open window */
  44.     LONG        dd_CurrentX;    /* current x coordinate of origin */
  45.     LONG        dd_CurrentY;    /* current y coordinate of origin */
  46.     ULONG        dd_Flags;    /* flags for drawer */
  47.     UWORD        dd_ViewModes;    /* view mode for drawer */
  48. };
  49. /* the amount of DrawerData actually written to disk */
  50. #define DRAWERDATAFILESIZE    (sizeof(struct DrawerData))
  51.  
  52. /* definitions for dd_ViewModes */
  53. #define DDVM_BYDEFAULT        0    /* default (inherit parent's view mode) */
  54. #define DDVM_BYICON        1    /* view as icons */
  55. #define DDVM_BYNAME        2    /* view as text, sorted by name */
  56. #define DDVM_BYDATE        3    /* view as text, sorted by date */
  57. #define DDVM_BYSIZE        4    /* view as text, sorted by size */
  58. #define DDVM_BYTYPE        5    /* view as text, sorted by type */
  59.  
  60. /* definitions for dd_Flags */
  61. #define    DDFLAGS_SHOWDEFAULT    0    /* default (show only icons) */
  62. #define    DDFLAGS_SHOWICONS    1    /* show only icons */
  63. #define    DDFLAGS_SHOWALL        2    /* show all files */
  64.  
  65. struct DiskObject {
  66.     UWORD        do_Magic; /* a magic number at the start of the file */
  67.     UWORD        do_Version; /* a version number, so we can change it */
  68.     struct Gadget     do_Gadget;    /* a copy of in core gadget */
  69.     UBYTE        do_Type;
  70.     STRPTR        do_DefaultTool;
  71.     STRPTR *        do_ToolTypes;
  72.     LONG        do_CurrentX;
  73.     LONG        do_CurrentY;
  74.     struct DrawerData *    do_DrawerData;
  75.     STRPTR        do_ToolWindow;    /* only applies to tools */
  76.     LONG        do_StackSize;    /* only applies to tools */
  77.  
  78. };
  79.  
  80. #define WB_DISKMAGIC    0xe310    /* a magic number, not easily impersonated */
  81. #define WB_DISKVERSION    1    /* our current version number */
  82. #define WB_DISKREVISION    1    /* our current revision number */
  83. /* I only use the lower 8 bits of Gadget.UserData for the revision # */
  84. #define WB_DISKREVISIONMASK    255
  85.  
  86. struct FreeList {
  87.     WORD        fl_NumFree;
  88.     struct List        fl_MemList;
  89. };
  90.  
  91. /* workbench does different complement modes for its gadgets.
  92. ** It supports separate images, complement mode, and backfill mode.
  93. ** The first two are identical to intuitions GFLG_GADGIMAGE and GFLG_GADGHCOMP.
  94. ** backfill is similar to GFLG_GADGHCOMP, but the region outside of the
  95. ** image (which normally would be color three when complemented)
  96. ** is flood-filled to color zero.
  97. */
  98. #define GFLG_GADGBACKFILL 0x0001
  99. #define GADGBACKFILL      0x0001    /* an old synonym */
  100.  
  101. /* if an icon does not really live anywhere, set its current position
  102. ** to here
  103. */
  104. #define NO_ICON_POSITION    (0x80000000)
  105.  
  106. /* workbench now is a library.  this is it's name */
  107. #define WORKBENCH_NAME        "workbench.library"
  108.  
  109. /****************************************************************************/
  110.  
  111. /* If you find am_Version >= AM_VERSION, you know this structure has
  112.  * at least the fields defined in this version of the include file
  113.  */
  114. #define    AM_VERSION    1
  115.  
  116. struct AppMessage {
  117.     struct Message am_Message;    /* standard message structure */
  118.     UWORD am_Type;        /* message type */
  119.     ULONG am_UserData;        /* application specific */
  120.     ULONG am_ID;        /* application definable ID */
  121.     LONG am_NumArgs;        /* # of elements in arglist */
  122.     struct WBArg *am_ArgList;    /* the arguments themselves */
  123.     UWORD am_Version;        /* will be >= AM_VERSION */
  124.     UWORD am_Class;        /* message class */
  125.     WORD am_MouseX;        /* mouse x position of event */
  126.     WORD am_MouseY;        /* mouse y position of event */
  127.     ULONG am_Seconds;        /* current system clock time */
  128.     ULONG am_Micros;        /* current system clock time */
  129.     ULONG am_Reserved[8];    /* avoid recompilation */
  130. };
  131.  
  132. /* types of app messages */
  133. #define AMTYPE_APPWINDOW        7    /* app window message    */
  134. #define AMTYPE_APPICON            8    /* app icon message      */
  135. #define AMTYPE_APPMENUITEM      9    /* app menu item message */
  136. #define AMTYPE_APPWINDOWZONE   10    /* app window drop zone message    */
  137.  
  138. /* Classes of AppIcon messages (V44) */
  139. #define AMCLASSICON_Open    0    /* The "Open" menu item was invoked,
  140.                      * the icon got double-clicked or an
  141.                      * icon got dropped on it.
  142.                      */
  143. #define AMCLASSICON_Copy    1    /* The "Copy" menu item was invoked */
  144. #define AMCLASSICON_Rename    2    /* The "Rename" menu item was invoked */
  145. #define AMCLASSICON_Information    3    /* The "Information" menu item was invoked */
  146. #define AMCLASSICON_Snapshot    4    /* The "Snapshot" menu item was invoked */
  147. #define AMCLASSICON_UnSnapshot    5    /* The "UnSnapshot" menu item was invoked */
  148. #define AMCLASSICON_LeaveOut    6    /* The "Leave Out" menu item was invoked */
  149. #define AMCLASSICON_PutAway    7    /* The "Put Away" menu item was invoked */
  150. #define AMCLASSICON_Delete    8    /* The "Delete" menu item was invoked */
  151. #define AMCLASSICON_FormatDisk    9    /* The "Format Disk" menu item was invoked */
  152. #define AMCLASSICON_EmptyTrash    10    /* The "Empty Trash" menu item was invoked */
  153.  
  154. #define AMCLASSICON_Selected    11    /* The icon is now selected */
  155. #define AMCLASSICON_Unselected    12    /* The icon is now unselected */
  156.  
  157. /*
  158.  * The following structures are private.  These are just stub
  159.  * structures for code compatibility...
  160.  */
  161. struct AppWindow        { void * aw_PRIVATE;   };
  162. struct AppWindowDropZone    { void * awdz_PRIVATE; };
  163. struct AppIcon            { void * ai_PRIVATE;   };
  164. struct AppMenuItem        { void * ami_PRIVATE;  };
  165.  
  166. /****************************************************************************/
  167.  
  168. #define    WBA_Dummy (TAG_USER+0xA000)
  169.  
  170. /****************************************************************************/
  171.  
  172. /* Tags for use with AddAppIconA() */
  173.  
  174. /* AppIcon responds to the "Open" menu item (BOOL). */
  175. #define WBAPPICONA_SupportsOpen        (WBA_Dummy+1)
  176.  
  177. /* AppIcon responds to the "Copy" menu item (BOOL). */
  178. #define WBAPPICONA_SupportsCopy        (WBA_Dummy+2)
  179.  
  180. /* AppIcon responds to the "Rename" menu item (BOOL). */
  181. #define WBAPPICONA_SupportsRename    (WBA_Dummy+3)
  182.  
  183. /* AppIcon responds to the "Information" menu item (BOOL). */
  184. #define WBAPPICONA_SupportsInformation    (WBA_Dummy+4)
  185.  
  186. /* AppIcon responds to the "Snapshot" menu item (BOOL). */
  187. #define WBAPPICONA_SupportsSnapshot    (WBA_Dummy+5)
  188.  
  189. /* AppIcon responds to the "UnSnapshot" menu item (BOOL). */
  190. #define WBAPPICONA_SupportsUnSnapshot    (WBA_Dummy+6)
  191.  
  192. /* AppIcon responds to the "LeaveOut" menu item (BOOL). */
  193. #define WBAPPICONA_SupportsLeaveOut    (WBA_Dummy+7)
  194.  
  195. /* AppIcon responds to the "PutAway" menu item (BOOL). */
  196. #define WBAPPICONA_SupportsPutAway    (WBA_Dummy+8)
  197.  
  198. /* AppIcon responds to the "Delete" menu item (BOOL). */
  199. #define WBAPPICONA_SupportsDelete    (WBA_Dummy+9)
  200.  
  201. /* AppIcon responds to the "FormatDisk" menu item (BOOL). */
  202. #define WBAPPICONA_SupportsFormatDisk    (WBA_Dummy+10)
  203.  
  204. /* AppIcon responds to the "EmptyTrash" menu item (BOOL). */
  205. #define WBAPPICONA_SupportsEmptyTrash    (WBA_Dummy+11)
  206.  
  207. /* AppIcon position should be propagated back to original DiskObject (BOOL). */
  208. #define WBAPPICONA_PropagatePosition    (WBA_Dummy+12)
  209.  
  210. /* Callback hook to be invoked when rendering this icon (struct Hook *). */
  211. #define WBAPPICONA_RenderHook        (WBA_Dummy+13)
  212.  
  213. /* AppIcon wants to be notified when its select state changes (BOOL). */
  214. #define    WBAPPICONA_NotifySelectState    (WBA_Dummy+14)
  215.  
  216. /****************************************************************************/
  217.  
  218. /* Tags for use with AddAppMenuA() */
  219.  
  220. /* Command key string for this AppMenu (STRPTR). */
  221. #define    WBAPPMENUA_CommandKeyString     (WBA_Dummy+15)
  222.  
  223. /****************************************************************************/
  224.  
  225. /* Tags for use with OpenWorkbenchObjectA() */
  226.  
  227. /* Corresponds to the wa_Lock member of a struct WBArg */
  228. #define WBOPENA_ArgLock            (WBA_Dummy+16)
  229.  
  230. /* Corresponds to the wa_Name member of a struct WBArg */
  231. #define WBOPENA_ArgName            (WBA_Dummy+17)
  232.  
  233. /****************************************************************************/
  234.  
  235. /* Tags for use with WorkbenchControlA() */
  236.  
  237. /* Check if the named drawer is currently open (LONG *). */
  238. #define WBCTRLA_IsOpen            (WBA_Dummy+18)
  239.  
  240. /* Create a duplicate of the Workbench private search path list (BPTR *). */
  241. #define WBCTRLA_DuplicateSearchPath    (WBA_Dummy+19)
  242.  
  243. /* Free the duplicated search path list (BPTR). */
  244. #define WBCTRLA_FreeSearchPath        (WBA_Dummy+20)
  245.  
  246. /* Get the default stack size for launching programs with (ULONG *). */
  247. #define WBCTRLA_GetDefaultStackSize    (WBA_Dummy+21)
  248.  
  249. /* Set the default stack size for launching programs with (ULONG). */
  250. #define WBCTRLA_SetDefaultStackSize    (WBA_Dummy+22)
  251.  
  252. /* Cause an AppIcon to be redrawn (struct AppIcon *). */
  253. #define WBCTRLA_RedrawAppIcon        (WBA_Dummy+23)
  254.  
  255. /* Get a list of currently running Workbench programs (struct List **). */
  256. #define WBCTRLA_GetProgramList        (WBA_Dummy+24)
  257.  
  258. /* Release the list of currently running Workbench programs (struct List *). */
  259. #define WBCTRLA_FreeProgramList        (WBA_Dummy+25)
  260.  
  261. /* Get a list of currently selected icons (struct List **). */
  262. #define    WBCTRLA_GetSelectedIconList    (WBA_Dummy+36)
  263.  
  264. /* Release the list of currently selected icons (struct List *). */
  265. #define    WBCTRLA_FreeSelectedIconList    (WBA_Dummy+37)
  266.  
  267. /* Get a list of currently open drawers (struct List **). */
  268. #define    WBCTRLA_GetOpenDrawerList    (WBA_Dummy+38)
  269.  
  270. /* Release the list of currently open icons (struct List *). */
  271. #define    WBCTRLA_FreeOpenDrawerList    (WBA_Dummy+39)
  272.  
  273. /* Get the list of hidden devices (struct List **). */
  274. #define    WBCTRLA_GetHiddenDeviceList    (WBA_Dummy+42)
  275.  
  276. /* Release the list of hidden devices (struct List *). */
  277. #define    WBCTRLA_FreeHiddenDeviceList    (WBA_Dummy+43)
  278.  
  279. /* Add the name of a device which Workbench should never try to
  280.  * read a disk icon from (STRPTR).
  281.  */
  282. #define    WBCTRLA_AddHiddenDeviceName    (WBA_Dummy+44)
  283.  
  284. /* Remove a name from list of hidden devices (STRPTR). */
  285. #define    WBCTRLA_RemoveHiddenDeviceName    (WBA_Dummy+45)
  286.  
  287. /* Get the number of seconds that have to pass before typing
  288.  * the next character in a drawer window will restart
  289.  * with a new file name (ULONG *).
  290.  */
  291. #define    WBCTRLA_GetTypeRestartTime    (WBA_Dummy+47)
  292.  
  293. /* Set the number of seconds that have to pass before typing
  294.  * the next character in a drawer window will restart
  295.  * with a new file name (ULONG).
  296.  */
  297. #define    WBCTRLA_SetTypeRestartTime    (WBA_Dummy+48)
  298.  
  299. /****************************************************************************/
  300.  
  301. /* Tags for use with AddAppWindowDropZoneA() */
  302.  
  303. /* Zone left edge (WORD) */
  304. #define WBDZA_Left    (WBA_Dummy+26)
  305.  
  306. /* Zone left edge, if relative to the right edge of the window (WORD) */
  307. #define WBDZA_RelRight    (WBA_Dummy+27)
  308.  
  309. /* Zone top edge (WORD) */
  310. #define WBDZA_Top    (WBA_Dummy+28)
  311.  
  312. /* Zone top edge, if relative to the bottom edge of the window (WORD) */
  313. #define WBDZA_RelBottom    (WBA_Dummy+29)
  314.  
  315. /* Zone width (WORD) */
  316. #define WBDZA_Width    (WBA_Dummy+30)
  317.  
  318. /* Zone width, if relative to the window width (WORD) */
  319. #define WBDZA_RelWidth    (WBA_Dummy+31)
  320.  
  321. /* Zone height (WORD) */
  322. #define WBDZA_Height    (WBA_Dummy+32)
  323.  
  324. /* Zone height, if relative to the window height (WORD) */
  325. #define WBDZA_RelHeight    (WBA_Dummy+33)
  326.  
  327. /* Zone position and size (struct IBox *). */
  328. #define WBDZA_Box    (WBA_Dummy+34)
  329.  
  330. /* Hook to invoke when the mouse enters or leave a drop zone (struct Hook *). */
  331. #define WBDZA_Hook    (WBA_Dummy+35)
  332.  
  333. /****************************************************************************/
  334.  
  335. /* Reserved tags; don't use! */
  336. #define    WBA_Reserved1    (WBA_Dummy+40)
  337. #define    WBA_Reserved2    (WBA_Dummy+41)
  338. #define    WBA_Reserved3    (WBA_Dummy+46)
  339. #define    WBA_Reserved4    (WBA_Dummy+49)
  340. #define    WBA_Reserved5    (WBA_Dummy+50)
  341. #define    WBA_Reserved6    (WBA_Dummy+51)
  342. #define    WBA_Reserved7    (WBA_Dummy+52)
  343. #define    WBA_Reserved8    (WBA_Dummy+53)
  344. #define    WBA_Reserved9    (WBA_Dummy+54)
  345. #define    WBA_Reserved10    (WBA_Dummy+55)
  346. #define    WBA_Reserved11    (WBA_Dummy+56)
  347. #define    WBA_Reserved12    (WBA_Dummy+57)
  348. #define    WBA_Reserved13    (WBA_Dummy+58)
  349. #define    WBA_Reserved14    (WBA_Dummy+59)
  350. #define    WBA_Reserved15    (WBA_Dummy+60)
  351. #define    WBA_Reserved16    (WBA_Dummy+61)
  352. #define    WBA_Reserved17    (WBA_Dummy+62)
  353. #define    WBA_Reserved18    (WBA_Dummy+63)
  354. #define    WBA_Reserved19    (WBA_Dummy+64)
  355.  
  356. /****************************************************************************/
  357.  
  358. #define    WBA_LAST_TAG (WBA_Dummy+63)
  359.  
  360. /****************************************************************************/
  361.  
  362. /* The message your AppIcon rendering hook gets invoked with. */
  363. struct AppIconRenderMsg
  364. {
  365.     struct RastPort *    arm_RastPort;    /* RastPort to render into */
  366.     struct DiskObject *    arm_Icon;    /* The icon to be rendered */
  367.     STRPTR            arm_Label;    /* The icon label txt */
  368.     struct TagItem *    arm_Tags;    /* Further tags to be passed on
  369.                          * to DrawIconStateA().
  370.                          */
  371.  
  372.     WORD            arm_Left;    /* \ Rendering origin, not taking the */
  373.     WORD            arm_Top;    /* / button border into account. */
  374.  
  375.     WORD            arm_Width;    /* \ Limit your rendering to */
  376.     WORD            arm_Height;    /* / this area. */
  377.  
  378.     ULONG            arm_State;    /* IDS_SELECTED, IDS_NORMAL, etc. */
  379. };
  380.  
  381. /****************************************************************************/
  382.  
  383. /* The message your drop zone hook gets invoked with. */
  384. struct AppWindowDropZoneMsg
  385. {
  386.     struct RastPort *    adzm_RastPort;        /* RastPort to render into. */
  387.     struct IBox        adzm_DropZoneBox;    /* Limit your rendering to this area. */
  388.     ULONG            adzm_ID;        /* \ These come from straight */
  389.     ULONG            adzm_UserData;        /* / from AddAppWindowDropZoneA(). */
  390.     LONG            adzm_Action;        /* See below for a list of actions. */
  391. };
  392.  
  393. #define ADZMACTION_Enter    (0)
  394. #define ADZMACTION_Leave    (1)
  395.  
  396. /****************************************************************************/
  397.  
  398. /* The message your icon selection change hook is invoked with. */
  399. struct IconSelectMsg
  400. {
  401.     /* Size of this data structure (in bytes). */
  402.     ULONG            ism_Length;
  403.  
  404.     /* Lock on the drawer this object resides in,
  405.      * NULL for Workbench backdrop (devices).
  406.      */
  407.     BPTR            ism_Drawer;
  408.  
  409.     /* Name of the object in question. */
  410.     STRPTR            ism_Name;
  411.  
  412.     /* One of WBDISK, WBDRAWER, WBTOOL, WBPROJECT,
  413.      * WBGARBAGE, WBDEVICE, WBKICK or WBAPPICON.
  414.      */
  415.     UWORD            ism_Type;
  416.  
  417.     /* TRUE if currently selected, FALSE otherwise. */
  418.     BOOL            ism_Selected;
  419.  
  420.     /* Pointer to the list of tag items passed to
  421.      * ChangeWorkbenchSelectionA().
  422.      */
  423.     struct TagItem *    ism_Tags;
  424.  
  425.     /* Pointer to the window attached to this icon,
  426.      * if the icon is a drawer-like object.
  427.      */
  428.     struct Window *        ism_DrawerWindow;
  429.  
  430.     /* Pointer to the window the icon resides in. */
  431.     struct Window *        ism_ParentWindow;
  432.  
  433.     /* Position and size of the icon; note that the
  434.      * icon may not entirely reside within the visible
  435.      * bounds of the parent window.
  436.      */
  437.     WORD            ism_Left;
  438.     WORD            ism_Top;
  439.     WORD            ism_Width;
  440.     WORD            ism_Height;
  441. };
  442.  
  443. /* These are the values your hook code can return. */
  444. #define ISMACTION_Unselect    (0)    /* Unselect the icon */
  445. #define ISMACTION_Select    (1)    /* Select the icon */
  446. #define ISMACTION_Ignore    (2)    /* Do not change the selection state. */
  447. #define ISMACTION_Stop        (3)    /* Do not invoke the hook code again,
  448.                      * leave the icon as it is.
  449.                      */
  450.  
  451. /****************************************************************************/
  452.  
  453. #endif  /* !WORKBENCH_WORKBENCH_H */
  454.