Download type modem, Xmodem/CRC, one? a 82 blocks in file Transfer time: 1 minutes, 34 seconds * aborts suspends * ASCII SEND ready. Press [ENTER] to start? 10-Apr-86 11:08:23-PST,10333;000000000001 Return-Path: Received: from hanauma ([36.51.0.16].#Internet) by SUMEX-AIM.ARPA with TCP; Thu 10 Apr 86 11:08:11-PST Date: Thu, 10 Apr 86 11:07:54 pst From: Richard Ottolini To: info-mac@sumex Subject: MacDraw format Every couple of months someone requests this information on info-mac. Attached is the front end to a MacDraw-to-Imagen translator. It is in the C language header format. Microsoft graphics programs also output MacDraw format. /* *Description of MacDraw file * * ::= HeadPacket * ::= | * ::= | * ::= * ::= HeadWord * ::= endObject | textObject | gridlineObject | * lineObject | rectObject | roundrectObject | * ovalObject | arcObject | freehandObject | * polyObject | nestObject * ::= HeadWord nestObject * ::= HeadWord endObject */ /* integer types */ typedefunsigned charint8; typedefshort intint16; typedeflong intint32; #defineNOBJECTS11 /* packet at head of MacDraw file */ structHeadPacket{ int16unknown1[85]; int16PlotWidth; int16PlotHeight; int16PageWidth; int16PageHeight; int16unknown2[167]; } HeadPacket; /* word at beginning of each graphical object */ structHeadWord{ int8ObjectType; int8Lock; int16unknown; } HeadWord; /* ObjectType values */ #defineendObject0 #definetextObject1 #definegridlineObject2 #definelineObject3 #definerectObject4 #defineroundrectObject5 #defineovalObject6 #definearcObject7 #definefreehandObject8 #definepolyObject9 #definenestObject10 /* Object #11, Paint format bitmaps is not defined here */ /* Lock values */ #defineunlocked0 #definelocked1 /* end object delimiter */ structEnd{ int8LineFat; int8LinePat; int8FillPat; int8unknown; } End; /* LineFat values */ #defineNFat6 #defineinvisibleLine1 #definethinLine2 #definemediumLine3 #definethickLine4 #definefatLine5 #definedefaultLine2 /* fatness in rasters */ float FatTable[NFat] = {0.,0.,1.,2.,3.5,5.}; /* LinePat, FillPat values */ #defineNPat37 #definenoPat1 #definewhitePat2 #defineblackPat3 #definedarkgrayPat4 #definemedgrayPat5 #definelightgrayPat6 #definecoarsedotsPat7 #definedotsPat8 #definesparsedotsPat9 #definetopshinglePat10 #definebrickPat11 #defineslantbrickPat12 #defineleftdiagPat13 #definethickleftdiagPat14 #definedashleftdiagPat15 #definenarrowleftdiagPat16 #defineheavyleftdiagPat17 #definedualdiagPat18 #definehorzdashpat19 #definehorzlinePat20 #definecirclePat21 #definefourwayPat22 #definesmallhatchedPat23 #definesmalldiamondPat24 #definerightdiagPat25 #definethickrightdiagPat26 #definedashrightdiagPat27 #definenarrowrightdiagPat28 #defineheavyrightdiagPat29 #definetrianglePat30 #definevertdashpat31 #definevertlinePat32 #definerightshinglePat33 #defineheartPat34 #definelargehatchedPat35 #definelargediamondPat36 /* pattern masks */ #defineMPat8 unsigned char Pat[NPat][MPat] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,0xBB,0xEE, 0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, 0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22, 0x88,0x00,0x22,0x00,0x88,0x00,0x22,0x00, 0x80,0x00,0x08,0x00,0x80,0x00,0x08,0x00, 0x08,0x00,0x00,0x00,0x80,0x00,0x00,0x00, 0x80,0x80,0x41,0x3E,0x08,0x08,0x14,0xE3, 0x08,0x1C,0x22,0x41,0x80,0x01,0x02,0x04, 0xFF,0x80,0x80,0x80,0xFF,0x08,0x08,0x08, 0x01,0x80,0x40,0x20,0x10,0x08,0x04,0x02, 0x81,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03, 0x11,0x88,0x44,0x00,0x11,0x88,0x44,0x00, 0x11,0x88,0x44,0x22,0x11,0x88,0x44,0x22, 0x33,0x99,0xCC,0x66,0x33,0x99,0xCC,0x66, 0x01,0x80,0x40,0x00,0x02,0x04,0x08,0x00, 0x66,0x00,0x00,0x00,0x99,0x00,0x00,0x00, 0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00, 0x50,0x20,0x20,0x20,0x50,0x88,0x27,0x88, 0x84,0x9F,0x80,0x80,0x04,0x04,0xE7,0x84, 0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0xFF, 0x55,0x88,0x55,0x22,0x55,0x88,0x55,0x22, 0x80,0x01,0x02,0x04,0x08,0x10,0x20,0x40, 0xC0,0x81,0x03,0x06,0x0C,0x18,0x30,0x60, 0x88,0x11,0x22,0x00,0x88,0x11,0x22,0x00, 0x88,0x11,0x22,0x44,0x88,0x11,0x22,0x44, 0xCC,0x99,0x33,0x66,0xCC,0x99,0x33,0x66, 0x20,0x50,0x00,0x00,0x02,0x05,0x00,0x00, 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x04,0x04,0x40,0x40,0x04,0x04,0x40,0x40, 0x03,0x84,0x48,0x30,0x0C,0x02,0x01,0x01, 0x0A,0x11,0xA0,0x40,0x00,0xB1,0x4A,0x4A, 0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40, 0x41,0x22,0x14,0x08,0x14,0x22,0x41,0x80 }; /* text object */ structText{ int8LineFat; int8LinePat; int8FillPat; int8unknown1; int16BoxDx; int16BoxDy; int8Style; int8Font; int8Size; int8LineSpace; int8Justify; int8Orient; int8unknown2; int8CharCount; int16Top; int16Left; int16Bottom; int16Right; /* plus CharCount bytes */ } Text; charTextString[256]; /* Style values */ #defineplainStyle0 #defineboldStyle1 #defineitalicStyle2 #defineunderlineStyle4 #defineoutlineStyle8 #defineshadowStyle16 #definedefaultStyle0 /* Font values */ #defineChicagoFont1 #defineGenevaFont2 #defineNewYorkFont3 #defineMonocoFont4 #defineVeniceFont5 #defineLondonFont6 #defineAthensFont7 #definedefaultFont1 /* Size values */ #definesize91 #definesize102 #definesize123 #definesize144 #definesize185 #definesize246 #definesize367 #definesize488 #defineNTextSize9 /* LineSpace values */ #definesingleSpace1 #definehalfSpace2 #definedoubleSpace3 #definedefaultSpace1 /* Justify values */ #defineleftJustify1 #definecenterJustify2 #definerightJustify3 #definedefaultJustify1 /* Orient values */ #definedeg0Orient0 #definedeg90Orient3 #definedeg180Orient2 #definedeg270Orient1 #definereflect0Orient4 #definereflect90Orient6 #definereflect180Orient5 #definereflect270Orient7 /* grid line object */ structGridLine{ int8LineFat; int8LinePat; int8FillPat; int8Arrow; int16y1; int16unknown1; int16x1; int16unknown2; int16y2; int16unknown3; int16x2; int16unknown4; } GridLine; /* Arrow values */ #definenoArrow0 #definerightArrow1 #defineleftArrow2 #definebothArrow3 #definedefaultArrow0 /* arrow length in rasters */ float ArrowSize[NFat] = {0.,0.,5.,10.,17.,25.}; /* arrow angle in radians */ #defineARROW_ANGLE.5 /* line object */ structLine{ int8LineFat; int8LinePat; int8FillPat; int8Arrow; int16y1; int16unknown1; int16x1; int16unknown2; int16y2; int16unknown3; int16x2; int16unknown4; } Line; /* rectangle object */ structRect{ int8LineFat; int8LinePat; int8FillPat; int8Corner; int16Top; int16unknown1; int16Left; int16unknown2; int16Bottom; int16unknown3; int16Right; int16unknown4; } Rect; /* Corner values */ #defineNCorner6 #definezeroCorner0 #defineone8Corner1 #definethree16Corner2 #defineone4Corner3 #definefive16Corner4 #definethree8Corner5 /* radii in inches */ float RadiusTable[NCorner] = {0.,.125,.1875,.25,.3125,.375}; /* rounded rectangle object */ structRoundRect{ int8LineFat; int8LinePat; int8FillPat; int8Corner; int16Top; int16unknown1; int16Left; int16unknown2; int16Bottom; int16unknown3; int16Right; int16unknown4; } RoundRect; /* oval object */ structOval{ int8LineFat; int8LinePat; int8FillPat; int8unknown; int16Top; int16unknown1; int16Left; int16unknown2; int16Bottom; int16unknown3; int16Right; int16unknown4; } Oval; /* arc object */ structArc{ int8LineFat; int8LinePat; int8FillPat; int8unknown; int16Top; int16unknown1; int16Left; int16unknown2; int16Bottom; int16unknown3; int16Right; int16unknown4; int16StartAngle; int16NDegree; } Arc; /* point objects */ #defineNPoint256 structPoint{ int16y; int16unknown1; int16x; int16unknown2; } Point[NPoint]; struct Delta{ chardx; chardy; } Delta[NPoint]; /* freehand line object */ structFreeHand{ int8LineFat; int8LinePat; int8FillPat; int8unknown1; int16unknown2; int16Bytes; int16PointCount; int16Top; int16unknown3; int16Left; int16unknown4; int16Bottom; int16unknown5; int16Right; int16unknown6; int16unknown7; int16y1; int16unknown8; int16x1; int16unknown9; /* plus Bytes-28 bytes or Bytes/2-14 dx,dy pairs */ } FreeHand; /* polygon object */ structPoly{ int8LineFat; int8LinePat; int8FillPat; int8unknown1; int16unknown2; int16Bytes; int16PointCount; int16unknown3; int16unknown4; int16Top; int16unknown5; int16Left; int16unknown6; int16Bottom; int16unknown7; int16Right; /* plus Bytes-20 or PointCount*4 bytes, PointCount x,y pairs */ } Poly; /* nest object delimiter */ structNest{ int8LineFat; int8LinePat; int8FillPat; int8unknown1; int16unknown2; int16ObjectCount; int16unknown3; int16Bytes; int16Top; int16unknown4; int16Left; int16unknown5; int16Bottom; int16unknown6; int16Right; int16unknown7[5]; } Nest; /* *count Object lengths * *#include "MacDraw.h" *main(){ *printf ("HeadPacket=%d\n",sizeof(HeadPacket)); *printf ("HeadWord=%d\n",sizeof(HeadWord)); *printf ("End=%d\n",sizeof(End)); *printf ("Text=%d\n",sizeof(Text)); *printf ("GridLine=%d\n",sizeof(GridLine)); *printf ("Line=%d\n",sizeof(Line)); *printf ("Rect=%d\n",sizeof(Rect)); *printf ("RoundRect=%d\n",sizeof(RoundRect)); *printf ("Oval=%d\n",sizeof(Oval)); *printf ("Arc=%d\n",sizeof(Arc)); *printf ("FreeHand=%d\n",sizeof(FreeHand)); *printf ("Poly=%d\n",sizeof(Poly)); *printf ("Nest=%d\n",sizeof(Nest)); *}; */