;
; ** $VER: datatypes.h 39.6 (22.4.93)
; ** Includes Release 40.15
; **
; ** (C) Copyright 1991-1993 Commodore-Amiga, Inc.
; **     All Rights Reserved
; 

; ***************************************************************************

IncludePath  "PureInclude:"
XIncludeFile "exec/types.pb"
XIncludeFile "exec/lists.pb"
XIncludeFile "exec/nodes.pb"
XIncludeFile "exec/libraries.pb"
XIncludeFile "libraries/iffparse.pb"
XIncludeFile "dos/dos.pb"

; ***************************************************************************

; #ID_DTYP = MAKE_ID('D','T','Y','P')

; ***************************************************************************

; #ID_DTHD = MAKE_ID('D','T','H','D')

Structure DataTypeHeader

    *dth_Name.b      ;  Descriptive name of the data type
    *dth_BaseName.b  ;  Base name of the data type
    *dth_Pattern.b   ;  Match pattern for file name.
    *dth_Mask.w      ;  Comparision mask
    dth_GroupID.l    ;  Group that the DataType is in 
    dth_ID.l         ;  ID for DataType (same as IFF FORM type)
    dth_MaskLen.w    ;  Length of comparision mask 
    dth_Pad.w        ;  Unused at present (must be 0)
    dth_Flags.w      ;  Flags
    dth_Priority.w   ;  Priority
EndStructure

; #DTHSIZE = sizeof(Structure DataTypeHeader)

; ***************************************************************************

;  Basic type 
#DTF_TYPE_MASK = $000F
#DTF_BINARY = $0000
#DTF_ASCII = $0001
#DTF_IFF  = $0002
#DTF_MISC = $0003

;  Set if case is important 
#DTF_CASE = $0010

;  Reserved for system use 
#DTF_SYSTEM1 = $1000

; ****************************************************************************
;  *
;  * GROUP ID and ID
;  *
;  * This is used for filtering out objects that you don't want. For
;  * example, you could make a filter for the ASL file requester so
;  * that it only showed the files that were pictures, or even to
;  * narrow it down to only show files that were ILBM pictures.
;  *
;  * Note that the Group ID's are in lower case, and always the first
;  * four characters of the word.
;  *
;  * For ID's; If it is an IFF file, then the ID is the same as the
;  * FORM type.  If it isn't an IFF file, then the ID would be the
;  * first four characters of name for the file type.
;  *
;  ****************************************************************************

;  System file, such as; directory, executable, library, device, font, etc. 
;#GID_SYSTEM = MAKE_ID ('s','y','s','t')

;  Formatted or unformatted text 
;#GID_TEXT = MAKE_ID ('t','e','x','t')

;  Formatted text with graphics or other DataTypes 
;#GID_DOCUMENT = MAKE_ID ('d','o','c','u')

;  Sound 
;#GID_SOUND = MAKE_ID ('s','o','u','n')

;  Musical instruments used for musical scores 
;#GID_INSTRUMENT = MAKE_ID ('i','n','s','t')

;  Musical score 
;#GID_MUSIC = MAKE_ID ('m','u','s','i')

;  Still picture 
;#GID_PICTURE = MAKE_ID ('p','i','c','t')

;  Animated picture 
;#GID_ANIMATION = MAKE_ID ('a','n','i','m')

;  Animation with audio track 
;#GID_MOVIE = MAKE_ID ('m','o','v','i')

; ***************************************************************************

;  A code chunk contains an embedded executable that can be loaded
;  * with InternalLoadSeg. 
;#ID_CODE = MAKE_ID('D','T','C','D')

;  DataTypes comparision hook context (Read-Only).  This is the
;  * argument that is passed to a custom comparision routine. 
Structure DTHookContext

    ;  Libraries that are already opened for your use 
     *dthc_SysBase.l
     *dthc_DOSBase.l
     *dthc_IFFParseBase.l
     *dthc_UtilityBase.l

    ;  File context 
    *dthc_Lock.b  ;  Lock on the file
    *dthc_FIB.FileInfoBlock  ;  Pointer to a FileInfoBlock 
    *dthc_FileHandle.l ;  Pointer to the file handle (may be NULL)
    *dthc_IFF.IFFHandle  ;  Pointer to an IFFHandle (may be NULL) 
    *dthc_Buffer.b  ;  Buffer 
    dthc_BufferLength.l ;  Length of the buffer 
EndStructure

; ***************************************************************************

#ID_TOOL = MAKE_ID('D','T','T','L')

Structure Tool

    tn_Which.w    ;  Which tool is this 
    tn_Flags.w    ;  Flags 
    *tn_Program.b    ;  Application to use 
EndStructure

; #TSIZE = sizeof(Structure Tool)

;  defines for tn_Which 
#TW_INFO   = 1
#TW_BROWSE  = 2
#TW_EDIT   = 3
#TW_PRINT  = 4
#TW_MAIL   = 5

;  defines for tn_Flags 
#TF_LAUNCH_MASK  = $000F
#TF_SHELL  = $0001
#TF_WORKBENCH  = $0002
#TF_RX   = $0003

; ***************************************************************************

; #ID_TAGS = MAKE_ID('D','T','T','G')

; ***************************************************************************

Structure DataType

    dtn_Node1.Node  ;  Reserved for system use 
    dtn_Node2.Node  ;  Reserved for system use 
    *dtn_Header.DataTypeHeader  ;  Pointer to the DataTypeHeader 
    dtn_ToolList.List  ;  List of tool nodes 
    *dtn_FunctionName.b ;  Name of comparision routine 
    *dtn_AttrList.TagItem  ;  Object creation tags 
    dtn_Length.l  ;  Length of the memory block 
EndStructure

; #DTNSIZE = sizeof(Structure DataType)

; ***************************************************************************

Structure ToolNode

    tn_Node.Node    ;  Embedded node 
    tn_Tool.Tool    ;  Embedded tool 
    tn_Length.l    ;  Length of the memory block 
EndStructure

; #TNSIZE = sizeof(Structure ToolNode)

; ***************************************************************************

; #ID_NAME = MAKE_ID('N','A','M','E')

; ***************************************************************************

;  text ID's 
#DTERROR_UNKNOWN_DATATYPE  = 2000
#DTERROR_COULDNT_SAVE   = 2001
#DTERROR_COULDNT_OPEN   = 2002
#DTERROR_COULDNT_SEND_MESSAGE  = 2003

;  new for V40 
#DTERROR_COULDNT_OPEN_CLIPBOARD  = 2004
#DTERROR_Reserved   = 2005
#DTERROR_UNKNOWN_COMPRESSION  = 2006
#DTERROR_NOT_ENOUGH_DATA   = 2007
#DTERROR_INVALID_DATA   = 2008

;  Offset for types 
#DTMSG_TYPE_OFFSET   = 2100

; ***************************************************************************

