

*********************************************************************
*
* workbenchbase.i
*
* $Header: workbenchbase.i,v 31.4 85/09/04 01:02:46 neil Exp $
*
* $Locker:  $
*
*********************************************************************

   IFND   EXEC_TYPES_I
   INCLUDE   "exec/types.i"
   ENDC

   IFND   EXEC_LISTS_I
   INCLUDE   "exec/lists.i"
   ENDC

   IFND   EXEC_PORTS_I
   INCLUDE   "exec/ports.i"
   ENDC

   IFND   EXEC_LIBRARIES_I
   INCLUDE   "exec/libraries.i"
   ENDC

   IFND   LIBRARIES_DOS_I
   INCLUDE   "libraries/dos.i"
   ENDC

   IFND   GRAPHICS_RASTPORT_I
   INCLUDE   "graphics/rastport.i"
   ENDC

   IFND   DEVICES_TIMER_I
   INCLUDE   "devices/timer.i"
   ENDC

   IFND   INTUITION_INTUITION_I
   INCLUDE   "intuition/intuition.i"
   ENDC

; a pointer to the workbenchbase is kept in A5
WBBASE   EQUR   A5

WBBUFSIZE   EQU   260
PKT_LENGTH      EQU   10      ; allow five arguments

; sendpkt uses this structure
 STRUCTURE SendPacket,0
    UWORD       sp_Type        ; for ioloop
    STRUCT   sp_Message,MN_SIZE
    UWORD       sp_pad
    STRUCT      sp_Data,PKT_LENGTH*4
    LABEL   SendPacket_SIZEOF



 STRUCTURE WorkbenchBase,0
    STRUCT   wb_Library,LIB_SIZE

    ; the work bench status flags
    UWORD   wb_Flags

    ; our three major lists.  Every object is on the master list.
    ; The highlighted (selected) icons are on the select list.
    ; all disks that we have "active" are on the active list.
    STRUCT    wb_MasterList,LH_SIZE
    STRUCT    wb_SelectList,LH_SIZE
    STRUCT    wb_ActiveDisks,LH_SIZE
    STRUCT    wb_UtilityList,LH_SIZE

    ; two string buffers to save us from allocating memory
    ; THESE TWO BUFFERS MUST BE LONGWORD ALLIGNED
    STRUCT   wb_Buf0,WBBUFSIZE
    STRUCT   wb_Buf1,WBBUFSIZE
    STRUCT   wb_SendPacket,SendPacket_SIZEOF

    ; longword allign this stuff
    BYTE   wb_UpdateNestCnt
    BYTE   wb_DiskIONestCnt

    ; all of our library bases
    APTR   wb_SysBase
    APTR   wb_GfxBase
    APTR   wb_IntuitionBase
    APTR   wb_IconBase
    APTR   wb_DOSBase
    APTR   wb_MathBase
    APTR   wb_LayersBase
    APTR   wb_TimerBase

    ; we really want the device list, but it changes too often
    APTR   wb_DosInfo

    ; a pointer to a timer request, so we can free it later
    APTR   wb_TimerRequest

    ; the mouse position of the last select press
    UWORD   wb_XOffset
    UWORD   wb_YOffset

    ; the base of the workbench object tree
    APTR   wb_RootObject

    ; some current pointers -- some of these should be deleted
    APTR   wb_CurrentGadget
    APTR   wb_CurrentWindow
    APTR   wb_CurrentObject

    ; alternate pointer images
    APTR   wb_SelectPointer
    APTR   wb_WaitPointer

    ; misc stuff
    APTR   wb_MenuStrip
    APTR   wb_CurrentError
    ULONG   wb_LastFreeMem
    APTR   wb_TextFont
    APTR   wb_CoCurrent

    ; images must be in chip memory
    STRUCT   wb_GadgetImage,ig_SIZEOF*4
    STRUCT   wb_GadgetData,2*4*8

    ; two message ports -- one for intuition, and one for all reasonable
    ; applications that let you allocate your messages yourself....
    STRUCT   wb_WorkbenchPort,MP_SIZE
    STRUCT   wb_IntuiPort,MP_SIZE

    ; the last time we saw a key-down
    STRUCT   wb_Tick,TV_SIZE

    ; the screen title
    STRUCT   wb_ScreenTitle,60

    ; what we need to paint text
    STRUCT   wb_TextRast,rp_SIZEOF

    ; the argument that we were initialized with
    ULONG      wb_Argument

    ; the workbench task
    ULONG   wb_Task

    LABEL   wb_SIZEOF


    ; flags in wb_Flags
    BITDEF   WB,Shifted,15      ; the shift key is down
    BITDEF   WB,Dragging,14      ; not used??
    BITDEF   WB,DoubleClick,13   ; we just double clicked
    BITDEF   WB,SpecialGadget,12   ; last gadget was special
    BITDEF   WB,InputTrashed,11   ; Don't believe SELECTUP
    BITDEF   WB,ErrorDisplayed,10   ; ErrorTitle is up
    BITDEF   WB,NameChanged,9   ; NameChange win is up
    BITDEF   WB,Closed,8      ; all windows closed
    BITDEF   WB,KPrintfOK,7      ; OK to send kprintfs to serial port

    ; wb_Argument bits
    BITDEF   WBARG,DEBUGON,1      ; turn on debugging menus

 STRUCTURE   ActiveDisk,0
    STRUCT   ad_Node,LN_SIZE
    UBYTE   ad_Active
    UBYTE   ad_pad
    APTR   ad_Handler
    APTR   ad_Name
    APTR   ad_Object
    BPTR    ad_Volume
    STRUCT   ad_Info,id_SIZEOF
    STRUCT   ad_CreateTime,ds_SIZEOF
    LABEL   ad_SIZEOF
