00001 // 00002 // info_.h,v 1.2 1997/01/20 18:34:15 ms Exp 00003 // 00004 00005 #ifndef INFO__H 00006 #define INFO__H 00007 00008 00009 #if defined(__BORLANDC__) 00010 #include <strstrea.h> 00011 #else 00012 //#include <strstream.h> //ALFRED - TODO 00013 #endif 00014 00015 #include <string.h> 00016 00017 #include "mytypes.h" 00018 #include "myendian.h" 00019 #include "fformat.h" 00020 #include "smart.h" 00021 #include "sidtune.h" 00022 00023 00024 // Amiga Workbench specific structures. 00025 00026 struct Border 00027 { 00028 ubyte LeftEdge[2]; // uword; initial offsets from the origin 00029 ubyte TopEdge[2]; // uword 00030 ubyte FrontPen, BackPen; // pens numbers for rendering 00031 ubyte DrawMode; // mode for rendering 00032 ubyte Count; // number of XY pairs 00033 ubyte pXY[4]; // sword *XY; vector coordinate pairs rel to LeftTop 00034 ubyte pNextBorder[4]; // Border *NextBorder; pointer to any other Border too 00035 }; 00036 00037 struct Image 00038 { 00039 ubyte LeftEdge[2]; // uword; starting offset relative to some origin 00040 ubyte TopEdge[2]; // uword; starting offsets relative to some origin 00041 ubyte Width[2]; // uword; pixel size (though data is word-aligned) 00042 ubyte Height[2]; // uword 00043 ubyte Depth[2]; // uword; >= 0, for images you create 00044 ubyte pImageData[4]; // uword *ImageData; pointer to the actual word-aligned bits 00045 ubyte PlanePick, PlaneOnOff; 00046 ubyte pNextImage[4]; // Image *NextImage; 00047 }; 00048 00049 struct Gadget 00050 { 00051 ubyte pNextGadget[4]; // Gadget *NextGadget; next gadget in the list 00052 ubyte LeftEdge[2]; // uword; "hit box" of gadget 00053 ubyte TopEdge[2]; // uword 00054 ubyte Width[2]; // uword; "hit box" of gadget 00055 ubyte Height[2]; // uword 00056 ubyte Flags[2]; // uword; see below for list of defines 00057 ubyte Activation[2]; // uword 00058 ubyte GadgetType[2]; // uword; see below for defines 00059 ubyte pGadgetRender[4]; // Image *GadgetRender; 00060 ubyte pSelectRender[4]; // Image *SelectRender; 00061 ubyte pGadgetText[4]; // void *GadgetText; 00062 ubyte MutualExclude[4]; // udword 00063 ubyte pSpecialInfo[4]; // void *SpecialInfo; 00064 ubyte GadgetID[2]; // uword 00065 ubyte UserData[4]; // udword; ptr to general purpose User data 00066 }; 00067 00068 struct DiskObject 00069 { 00070 ubyte Magic[2]; // uword; a magic num at the start of the file 00071 ubyte Version[2]; // uword; a version number, so we can change it 00072 struct Gadget Gadget; // a copy of in core gadget 00073 ubyte Type; 00074 ubyte PAD_BYTE; // Pad it out to the next word boundry 00075 ubyte pDefaultTool[4]; // char *DefaultTool; 00076 ubyte ppToolTypes[4]; // char **ToolTypes; 00077 ubyte CurrentX[4]; // udword 00078 ubyte CurrentY[4]; // udword 00079 ubyte pDrawerData[4]; // char *DrawerData; 00080 ubyte pToolWindow[4]; // char *ToolWindow; only applies to tools 00081 ubyte StackSize[4]; // udword; only applies to tools 00082 }; 00083 00084 00085 // A magic number, not easily impersonated. 00086 #define WB_DISKMAGIC 0xE310 00087 // Our current version number. 00088 #define WB_DISKVERSION 1 00089 // Our current revision number. 00090 #define WB_DISKREVISION 1 00091 // I only use the lower 8 bits of Gadget.UserData for the revision #. 00092 #define WB_DISKREVISIONMASK 0xFF 00093 00094 // The Workbench object types. 00095 #define WB_DISK 1 00096 #define WB_DRAWER 2 00097 #define WB_TOOL 3 00098 #define WB_PROJECT 4 00099 #define WB_GARBAGE 5 00100 #define WB_DEVICE 6 00101 #define WB_KICK 7 00102 #define WB_APPICON 8 00103 00104 // --- Gadget.Flags values --- 00105 // Combinations in these bits describe the highlight technique to be used. 00106 #define GFLG_GADGHIGHBITS 0x0003 00107 // Complement the select box. 00108 #define GFLG_GADGHCOMP 0x0000 00109 // Draw a box around the image. 00110 #define GFLG_GADGHBOX 0x0001 00111 // Blast in this alternate image. 00112 #define GFLG_GADGHIMAGE 0x0002 00113 // Don't highlight. 00114 #define GFLG_GADGHNONE 0x0003 00115 // Set if GadgetRender and SelectRender point to an Image structure, 00116 // clear if they point to Border structures. 00117 #define GFLG_GADGIMAGE 0x0004 00118 00119 00120 #endif