1 #ifndef DATATYPES_DATATYPES_H
    2 #define DATATYPES_DATATYPES_H
    3 
    4 /*
    5 	datatypes.library include (V45)
    6 
    7 	Copyright © 2002 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 # include <exec/types.h>
   12 #endif
   13 
   14 #ifndef EXEC_LISTS_H
   15 # include <exec/lists.h>
   16 #endif
   17 
   18 #ifndef EXEC_NODES_H
   19 # include <exec/nodes.h>
   20 #endif
   21 
   22 #ifndef EXEC_LIBRARIES_H
   23 # include <exec/libraries.h>
   24 #endif
   25 
   26 #ifndef LIBRARIES_IFFPARSE_H
   27 # include <libraries/iffparse.h>
   28 #endif
   29 
   30 #ifndef DOS_DOS_H
   31 # include <dos/dos.h>
   32 #endif
   33 
   34 #pragma pack(2)
   35 
   36 
   37 #define ID_DTYP MAKE_ID('D','T','Y','P')
   38 #define ID_DTHD MAKE_ID('D','T','H','D')
   39 
   40 struct DataTypeHeader
   41 {
   42 	STRPTR   dth_Name;
   43 	STRPTR   dth_BaseName;
   44 	STRPTR   dth_Pattern;
   45 	WORD    *dth_Mask;
   46 	ULONG    dth_GroupID;
   47 	ULONG    dth_ID;
   48 	WORD     dth_MaskLen;
   49 	WORD     dth_Pad;
   50 	UWORD    dth_Flags;
   51 	UWORD    dth_Priority;
   52 };
   53 
   54 #define DTHSIZE  sizeof(struct DataTypeHeader)
   55 
   56 
   57 /* Basic types */
   58 
   59 #define DTF_TYPE_MASK  0x000F
   60 #define DTF_BINARY     0x0000
   61 #define DTF_ASCII      0x0001
   62 #define DTF_IFF        0x0002
   63 #define DTF_MISC       0x0003
   64 #define DTF_CASE       0x0010
   65 #define DTF_SYSTEM1    0x1000
   66 
   67 
   68 #define GID_SYSTEM      MAKE_ID ('s','y','s','t')
   69 #define GID_TEXT        MAKE_ID ('t','e','x','t')
   70 #define GID_DOCUMENT    MAKE_ID ('d','o','c','u')
   71 #define GID_SOUND       MAKE_ID ('s','o','u','n')
   72 #define GID_INSTRUMENT  MAKE_ID ('i','n','s','t')
   73 #define GID_MUSIC       MAKE_ID ('m','u','s','i')
   74 #define GID_PICTURE     MAKE_ID ('p','i','c','t')
   75 #define GID_ANIMATION   MAKE_ID ('a','n','i','m')
   76 #define GID_MOVIE       MAKE_ID ('m','o','v','i')
   77 
   78 
   79 #define ID_CODE  MAKE_ID('D','T','C','D')
   80 
   81 struct DTHookContext
   82 {
   83 	struct Library       *dthc_SysBase;
   84 	struct Library       *dthc_DOSBase;
   85 	struct Library       *dthc_IFFParseBase;
   86 	struct Library       *dthc_UtilityBase;
   87 
   88 	BPTR                  dthc_Lock;
   89 	struct FileInfoBlock *dthc_FIB;
   90 	BPTR                  dthc_FileHandle;
   91 	struct IFFHandle     *dthc_IFF;
   92 	STRPTR                dthc_Buffer;
   93 	ULONG                 dthc_BufferLength;
   94 };
   95 
   96 
   97 #define ID_TOOL  MAKE_ID('D','T','T','L')
   98 
   99 struct Tool
  100 {
  101 	UWORD  tn_Which;
  102 	UWORD  tn_Flags;
  103 	STRPTR tn_Program;
  104 };
  105 
  106 #define TSIZE  sizeof(struct Tool)
  107 
  108 
  109 /* tn_Which defines */
  110 
  111 #define TW_INFO    1
  112 #define TW_BROWSE  2
  113 #define TW_EDIT    3
  114 #define TW_PRINT   4
  115 #define TW_MAIL    5
  116 
  117 
  118 /* tn_Flags defines */
  119 
  120 #define TF_LAUNCH_MASK  0x000F
  121 #define TF_SHELL        0x0001
  122 #define TF_WORKBENCH    0x0002
  123 #define TF_RX           0x0003
  124 
  125 
  126 #define ID_TAGS  MAKE_ID('D','T','T','G')
  127 
  128 
  129 #ifndef DATATYPE
  130 #define DATATYPE
  131 
  132 struct DataType
  133 {
  134 	struct Node            dtn_Node1;
  135 	struct Node            dtn_Node2;
  136 	struct DataTypeHeader *dtn_Header;
  137 	struct List            dtn_ToolList;
  138 	STRPTR                 dtn_FunctionName;
  139 	struct TagItem        *dtn_AttrList;
  140 	ULONG                  dtn_Length;
  141 };
  142 #endif /* DATATYPE */
  143 
  144 #define DTNSIZE  sizeof(struct DataType)
  145 
  146 
  147 struct ToolNode
  148 {
  149 	struct Node tn_Node;
  150 	struct Tool tn_Tool;
  151 	ULONG       tn_Length;
  152 };
  153 
  154 #define TNSIZE  sizeof(struct ToolNode)
  155 
  156 
  157 #ifndef ID_NAME
  158 # define ID_NAME  MAKE_ID('N','A','M','E')
  159 #endif
  160 
  161 
  162 /* Text IDs */
  163 
  164 #define DTERROR_UNKNOWN_DATATYPE        2000
  165 #define DTERROR_COULDNT_SAVE            2001
  166 #define DTERROR_COULDNT_OPEN            2002
  167 #define DTERROR_COULDNT_SEND_MESSAGE    2003
  168 #define DTERROR_COULDNT_OPEN_CLIPBOARD  2004
  169 #define DTERROR_Reserved                2005
  170 #define DTERROR_UNKNOWN_COMPRESSION     2006
  171 #define DTERROR_NOT_ENOUGH_DATA         2007
  172 #define DTERROR_INVALID_DATA            2008
  173 
  174 /*** V44 ***/
  175 
  176 #define DTERROR_NOT_AVAILABLE           2009
  177 
  178 
  179 /* Offset for types */
  180 
  181 #define DTMSG_TYPE_OFFSET               2100
  182 
  183 
  184 #pragma pack()
  185 
  186 #endif /* DATATYPES_DATATYPES_H */