1 #ifndef WORKBENCH_WORKBENCH_H
    2 #define WORKBENCH_WORKBENCH_H
    3 
    4 /*
    5 	workbench.library include (V50)
    6 
    7 	Copyright © 2002-2010 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TASKS_H
   11 # include <exec/tasks.h>
   12 #endif
   13 
   14 #ifndef DOS_DOS_H
   15 # include <dos/dos.h>
   16 #endif
   17 
   18 #ifndef INTUITION_INTUITION_H
   19 # include <intuition/intuition.h>
   20 #endif
   21 
   22 #pragma pack(2)
   23 
   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 
   35 struct OldDrawerData
   36 {
   37 	struct NewWindow dd_NewWindow;
   38 	LONG             dd_CurrentX;
   39 	LONG             dd_CurrentY;
   40 };
   41 
   42 #define OLDDRAWERDATAFILESIZE  (sizeof(struct OldDrawerData))
   43 
   44 struct DrawerData
   45 {
   46 	struct NewWindow dd_NewWindow;
   47 	LONG             dd_CurrentX;
   48 	LONG             dd_CurrentY;
   49 	ULONG            dd_Flags;
   50 	UWORD            dd_ViewModes;
   51 };
   52 
   53 #define DRAWERDATAFILESIZE  (sizeof(struct DrawerData))
   54 
   55 
   56 #define DDVM_BYDEFAULT  0
   57 #define DDVM_BYICON     1
   58 #define DDVM_BYNAME     2
   59 #define DDVM_BYDATE     3
   60 #define DDVM_BYSIZE     4
   61 #define DDVM_BYTYPE     5
   62 
   63 
   64 #define DDFLAGS_SHOWDEFAULT  0
   65 #define DDFLAGS_SHOWICONS    1
   66 #define DDFLAGS_SHOWALL      2
   67 
   68 
   69 struct DiskObject
   70 {
   71 	UWORD              do_Magic;
   72 	UWORD              do_Version;
   73 	struct Gadget      do_Gadget;
   74 	UBYTE              do_Type;
   75 	STRPTR             do_DefaultTool;
   76 	STRPTR            *do_ToolTypes;
   77 	LONG               do_CurrentX;
   78 	LONG               do_CurrentY;
   79 	struct DrawerData *do_DrawerData;
   80 	STRPTR             do_ToolWindow;
   81 	LONG               do_StackSize;
   82 };
   83 
   84 
   85 #define WB_DISKMAGIC         0xe310
   86 #define WB_DISKVERSION       1
   87 #define WB_DISKREVISION      1
   88 #define WB_DISKREVISIONMASK  255
   89 
   90 
   91 struct FreeList
   92 {
   93 	WORD        fl_NumFree;
   94 	struct List fl_MemList;
   95 };
   96 
   97 
   98 #define GFLG_GADGBACKFILL  0x0001
   99 #define GADGBACKFILL  GFLG_GADGBACKFILL
  100 
  101 
  102 #define NO_ICON_POSITION  (0x80000000)
  103 
  104 #define WORKBENCH_NAME  "workbench.library"
  105 
  106 
  107 #define AM_VERSION 1
  108 
  109 struct AppMessage
  110 {
  111 	struct Message am_Message;
  112 	UWORD          am_Type;
  113 	ULONG          am_UserData;
  114 	ULONG          am_ID;
  115 	LONG           am_NumArgs;
  116 	struct WBArg  *am_ArgList;
  117 	UWORD          am_Version;
  118 	UWORD          am_Class;
  119 	WORD           am_MouseX;
  120 	WORD           am_MouseY;
  121 	ULONG          am_Seconds;
  122 	ULONG          am_Micros;
  123 	ULONG          am_Reserved[8];
  124 };
  125 
  126 
  127 #define AMTYPE_APPWINDOW      7
  128 #define AMTYPE_APPICON        8
  129 #define AMTYPE_APPMENUITEM    9
  130 #define AMTYPE_APPWINDOWZONE  10
  131 
  132 
  133 /*** V44 ***/
  134 
  135 
  136 #define AMCLASSICON_Open         0
  137 #define AMCLASSICON_Copy         1
  138 #define AMCLASSICON_Rename       2
  139 #define AMCLASSICON_Information  3
  140 #define AMCLASSICON_Snapshot     4
  141 #define AMCLASSICON_UnSnapshot   5
  142 #define AMCLASSICON_LeaveOut     6
  143 #define AMCLASSICON_PutAway      7
  144 #define AMCLASSICON_Delete       8
  145 #define AMCLASSICON_FormatDisk   9
  146 #define AMCLASSICON_EmptyTrash   10
  147 
  148 #define AMCLASSICON_Selected     11
  149 #define AMCLASSICON_Unselected   12
  150 
  151 
  152 struct AppWindow          { APTR aw_PRIVATE; };
  153 struct AppWindowDropZone  { APTR awdz_PRIVATE; };
  154 struct AppIcon            { APTR ai_PRIVATE; };
  155 struct AppMenuItem        { APTR ami_PRIVATE; };
  156 struct AppMenu            { APTR am_PRIVATE; };
  157 
  158 
  159 #define WBA_Dummy                       (TAG_USER + 0xA000)
  160 #define WBAPPICONA_SupportsOpen         (WBA_Dummy + 1)
  161 #define WBAPPICONA_SupportsCopy         (WBA_Dummy + 2)
  162 #define WBAPPICONA_SupportsRename       (WBA_Dummy + 3)
  163 #define WBAPPICONA_SupportsInformation  (WBA_Dummy + 4)
  164 #define WBAPPICONA_SupportsSnapshot     (WBA_Dummy + 5)
  165 #define WBAPPICONA_SupportsUnSnapshot   (WBA_Dummy + 6)
  166 #define WBAPPICONA_SupportsLeaveOut     (WBA_Dummy + 7)
  167 #define WBAPPICONA_SupportsPutAway      (WBA_Dummy + 8)
  168 #define WBAPPICONA_SupportsDelete       (WBA_Dummy + 9)
  169 #define WBAPPICONA_SupportsFormatDisk   (WBA_Dummy + 10)
  170 #define WBAPPICONA_SupportsEmptyTrash   (WBA_Dummy + 11)
  171 #define WBAPPICONA_PropagatePosition    (WBA_Dummy + 12)
  172 #define WBAPPICONA_RenderHook           (WBA_Dummy + 13)
  173 #define WBAPPICONA_NotifySelectState    (WBA_Dummy + 14)
  174 
  175 #define WBAPPMENUA_CommandKeyString     (WBA_Dummy + 15)
  176 
  177 #define WBOPENA_ArgLock                 (WBA_Dummy + 16)
  178 #define WBOPENA_ArgName                 (WBA_Dummy + 17)
  179 
  180 #define WBCTRLA_IsOpen                  (WBA_Dummy + 18)
  181 #define WBCTRLA_DuplicateSearchPath     (WBA_Dummy + 19)
  182 #define WBCTRLA_FreeSearchPath          (WBA_Dummy + 20)
  183 #define WBCTRLA_GetDefaultStackSize     (WBA_Dummy + 21)
  184 #define WBCTRLA_SetDefaultStackSize     (WBA_Dummy + 22)
  185 #define WBCTRLA_RedrawAppIcon           (WBA_Dummy + 23)
  186 #define WBCTRLA_GetProgramList          (WBA_Dummy + 24)
  187 #define WBCTRLA_FreeProgramList         (WBA_Dummy + 25)
  188 
  189 #define WBDZA_Left                      (WBA_Dummy + 26)
  190 #define WBDZA_RelRight                  (WBA_Dummy + 27)
  191 #define WBDZA_Top                       (WBA_Dummy + 28)
  192 #define WBDZA_RelBottom                 (WBA_Dummy + 29)
  193 #define WBDZA_Width                     (WBA_Dummy + 30)
  194 #define WBDZA_RelWidth                  (WBA_Dummy + 31)
  195 #define WBDZA_Height                    (WBA_Dummy + 32)
  196 #define WBDZA_RelHeight                 (WBA_Dummy + 33)
  197 #define WBDZA_Box                       (WBA_Dummy + 34)
  198 #define WBDZA_Hook                      (WBA_Dummy + 35)
  199 
  200 #define WBCTRLA_GetSelectedIconList     (WBA_Dummy + 36)
  201 #define WBCTRLA_FreeSelectedIconList    (WBA_Dummy + 37)
  202 #define WBCTRLA_GetOpenDrawerList       (WBA_Dummy + 38)
  203 #define WBCTRLA_FreeOpenDrawerList      (WBA_Dummy + 39)
  204 
  205 #define WBA_Reserved1                   (WBA_Dummy + 40)
  206 #define WBA_Reserved2                   (WBA_Dummy + 41)
  207 
  208 #define WBCTRLA_GetHiddenDeviceList     (WBA_Dummy + 42)
  209 #define WBCTRLA_FreeHiddenDeviceList    (WBA_Dummy + 43)
  210 #define WBCTRLA_AddHiddenDeviceName     (WBA_Dummy + 44)
  211 #define WBCTRLA_RemoveHiddenDeviceName  (WBA_Dummy + 45)
  212 
  213 #define WBA_Reserved3                   (WBA_Dummy + 46)
  214 
  215 #define WBCTRLA_GetTypeRestartTime      (WBA_Dummy + 47)
  216 #define WBCTRLA_SetTypeRestartTime      (WBA_Dummy + 48)
  217 
  218 #define WBA_Reserved4                   (WBA_Dummy + 49)
  219 
  220 #define WBA_Reserved5                   (WBA_Dummy + 50)
  221 #define WBA_Reserved6                   (WBA_Dummy + 51)
  222 #define WBA_Reserved7                   (WBA_Dummy + 52)
  223 #define WBA_Reserved8                   (WBA_Dummy + 53)
  224 #define WBA_Reserved9                   (WBA_Dummy + 54)
  225 #define WBA_Reserved10                  (WBA_Dummy + 55)
  226 #define WBA_Reserved11                  (WBA_Dummy + 56)
  227 #define WBA_Reserved12                  (WBA_Dummy + 57)
  228 #define WBA_Reserved13                  (WBA_Dummy + 58)
  229 #define WBA_Reserved14                  (WBA_Dummy + 59)
  230 #define WBA_Reserved15                  (WBA_Dummy + 60)
  231 #define WBA_Reserved16                  (WBA_Dummy + 61)
  232 #define WBA_Reserved17                  (WBA_Dummy + 62)
  233 #define WBA_Reserved18                  (WBA_Dummy + 63)
  234 #define WBA_Reserved19                  (WBA_Dummy + 64)
  235 
  236 #define WBAPPMENUA_GetKey               (WBA_Dummy + 65)
  237 #define WBAPPMENUA_UseKey               (WBA_Dummy + 66)
  238 
  239 #define WBA_Reserved20                  (WBA_Dummy + 67)
  240 #define WBA_Reserved21                  (WBA_Dummy + 68)
  241 
  242 /*** V45 ***/
  243 
  244 #define WBCTRLA_GetCopyHook             (WBA_Dummy + 69)
  245 #define WBCTRLA_SetCopyHook             (WBA_Dummy + 70)
  246 #define WBCTRLA_GetDeleteHook           (WBA_Dummy + 71)
  247 #define WBCTRLA_SetDeleteHook           (WBA_Dummy + 72)
  248 #define WBCTRLA_GetTextInputHook        (WBA_Dummy + 73)
  249 #define WBCTRLA_SetTextInputHook        (WBA_Dummy + 74)
  250 
  251 #define WBOPENA_Show                    (WBA_Dummy + 75)
  252 #define WBOPENA_ViewBy                  (WBA_Dummy + 76)
  253 
  254 #define WBAPPMENUA_GetTitleKey          (WBA_Dummy + 77)
  255 
  256 #define WBCTRLA_AddSetupCleanupHook     (WBA_Dummy + 78)
  257 #define WBCTRLA_RemSetupCleanupHook     (WBA_Dummy + 79)
  258 
  259 /*** V50 ***/
  260 
  261 #define WBAPPICONA_Clone                (WBA_Dummy + 80) /* V50 Clone appicon (default: FALSE) */
  262 #define WBCREATEDRAWER_CreateIcon       (WBA_Dummy + 81) /* Create icon: defaults to TRUE */
  263 #define WBCREATEDRAWER_IgnoreFile       (WBA_Dummy + 88) /* ignore name component: defaults to FALSE */
  264 
  265 #ifdef SYSTEM_PRIVATE
  266 #define WBCREATEDRAWER_CreateHook       (WBA_Dummy + 82)
  267 #define WBCREATEDRAWER_ErrorHook        (WBA_Dummy + 83)
  268 #endif
  269 
  270 
  271 #define WBCREATEICON_MimeType           (WBA_Dummy + 84)
  272 #define WBCREATEICON_File               (WBA_Dummy + 85)
  273 #define WBCREATEICON_DefIcon            (WBA_Dummy + 86) /* Default is TRUE */
  274 #define WBCREATEICON_AppendInfo         (WBA_Dummy + 87) /* Default is FALSE */
  275 
  276 #define WBCREATEDRAWER_NoIcons          (WBA_Dummy + 81) /* DO NOT USE */
  277 
  278 #define WBA_LAST_TAG  WBCREATEDRAWER_IgnoreFile
  279 
  280 /*
  281  * ManageDesktopObject actions
  282  */
  283 #define DESKACTION_AddShortcut             0 /* V50 add shortcut */
  284 #define DESKACTION_RemoveShortcut          1 /* V50 remove shortcut */
  285 
  286 
  287 struct SetupCleanupHookMsg
  288 {
  289 	ULONG schm_Length;
  290 	LONG  schm_State;
  291 };
  292 
  293 
  294 #define SCHMSTATE_TryCleanup  0
  295 #define SCHMSTATE_Cleanup     1
  296 #define SCHMSTATE_Setup       2
  297 
  298 
  299 struct AppIconRenderMsg
  300 {
  301 	struct RastPort   *arm_RastPort;
  302 	struct DiskObject *arm_Icon;
  303 	STRPTR             arm_Label;
  304 	struct TagItem    *arm_Tags;
  305 
  306 	WORD               arm_Left;
  307 	WORD               arm_Top;
  308 
  309 	WORD               arm_Width;
  310 	WORD               arm_Height;
  311 
  312 	ULONG              arm_State;
  313 };
  314 
  315 
  316 struct AppWindowDropZoneMsg
  317 {
  318 	struct RastPort *adzm_RastPort;
  319 	struct IBox      adzm_DropZoneBox;
  320 	ULONG            adzm_ID;
  321 	ULONG            adzm_UserData;
  322 	LONG             adzm_Action;
  323 };
  324 
  325 #define ADZMACTION_Enter  (0)
  326 #define ADZMACTION_Leave  (1)
  327 
  328 
  329 struct IconSelectMsg
  330 {
  331 	ULONG           ism_Length;
  332 	BPTR            ism_Drawer;
  333 	STRPTR          ism_Name;
  334 	UWORD           ism_Type;
  335 	BOOL            ism_Selected;
  336 	struct TagItem *ism_Tags;
  337 	struct Window  *ism_DrawerWindow;
  338 	struct Window  *ism_ParentWindow;
  339 
  340 	WORD            ism_Left;
  341 	WORD            ism_Top;
  342 	WORD            ism_Width;
  343 	WORD            ism_Height;
  344 };
  345 
  346 #define ISMACTION_Unselect  (0)
  347 #define ISMACTION_Select    (1)
  348 #define ISMACTION_Ignore    (2)
  349 #define ISMACTION_Stop      (3)
  350 
  351 
  352 struct CopyBeginMsg
  353 {
  354 	ULONG cbm_Length;
  355 	LONG  cbm_Action;
  356 	BPTR  cbm_SourceDrawer;
  357 	BPTR  cbm_DestinationDrawer;
  358 };
  359 
  360 struct CopyDataMsg
  361 {
  362 	ULONG  cdm_Length;
  363 	LONG   cdm_Action;
  364 
  365 	BPTR   cdm_SourceLock;
  366 	STRPTR cdm_SourceName;
  367 
  368 	BPTR   cdm_DestinationLock;
  369 	STRPTR cdm_DestinationName;
  370 	LONG   cdm_DestinationX;
  371 	LONG   cdm_DestinationY;
  372 };
  373 
  374 struct CopyEndMsg
  375 {
  376 	ULONG cem_Length;
  377 	LONG  cem_Action;
  378 };
  379 
  380 #define CPACTION_Begin  (0)
  381 #define CPACTION_Copy   (1)
  382 #define CPACTION_End    (2)
  383 
  384 
  385 struct DeleteBeginMsg
  386 {
  387 	ULONG dbm_Length;
  388 	LONG  dbm_Action;
  389 };
  390 
  391 struct DeleteDataMsg
  392 {
  393 	ULONG  ddm_Length;
  394 	LONG   ddm_Action;
  395 	BPTR   ddm_Lock;
  396 	STRPTR ddm_Name;
  397 };
  398 
  399 struct DeleteEndMsg
  400 {
  401 	ULONG dem_Length;
  402 	LONG  dem_Action;
  403 };
  404 
  405 #define DLACTION_BeginDiscard     (0)
  406 #define DLACTION_BeginEmptyTrash  (1)
  407 #define DLACTION_DeleteContents   (3)
  408 #define DLACTION_DeleteObject     (4)
  409 #define DLACTION_End              (5)
  410 
  411 
  412 struct TextInputMsg
  413 {
  414 	ULONG  tim_Length;
  415 	LONG   tim_Action;
  416 	STRPTR tim_Prompt;
  417 };
  418 
  419 #define TIACTION_Rename         (0)
  420 #define TIACTION_RelabelVolume  (1)
  421 #define TIACTION_NewDrawer      (2)
  422 #define TIACTION_Execute        (3)
  423 
  424 
  425 #define UPDATEWB_ObjectRemoved  (0)
  426 #define UPDATEWB_ObjectAdded    (1)
  427 
  428 
  429 #pragma pack()
  430 
  431 #endif /* WORKBENCH_WORKBENCH_H */