/* include header for pw source generation */ #include "intuition/intuition.h" struct NewScreen NewScreenStructure = { 0,0, /* screen XY origin relative to View */ 320,200, /* screen width and height */ 3, /* screen depth (number of bitplanes) */ 0,1, /* detail and block pens */ NULL, /* display modes for this screen */ CUSTOMSCREEN, /* screen type */ NULL, /* pointer to default screen font */ (UBYTE *)"Pattern Editor by Don Hyde", /* screen title */ NULL, /* first in list of custom screen gadgets */ NULL /* pointer to custom BitMap structure */ }; #define NEWSCREENSTRUCTURE NewScreenStructure USHORT Palette[] = { 0x0000, /* color #0 */ 0x0EED, /* color #1 */ 0x0532, /* color #2 */ 0x0080, /* color #3 */ 0x08B4, /* color #4 */ 0x0FC0, /* color #5 */ 0x0F00, /* color #6 */ 0x022F /* color #7 */ #define PaletteColorCount 8 }; #define PALETTE Palette SHORT BorderVectors1[] = { 0,0, 81,0, 81,17, 0,17, 0,0 }; struct Border Border1 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors1, /* pointer to XY vectors */ NULL /* next border in list */ }; struct IntuiText IText1 = { 3,0,COMPLEMENT, /* front and back text pens, drawmode and fill byte */ 20,4, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Pen 2", /* pointer to text */ NULL /* next IntuiText structure */ }; struct Gadget Pen2Sample = { NULL, /* next gadget */ 225,145, /* origin XY of hit box relative to window TopLeft */ 78,16, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border1, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ &IText1, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors2[] = { 0,0, 81,0, 81,17, 0,17, 0,0 }; struct Border Border2 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors2, /* pointer to XY vectors */ NULL /* next border in list */ }; struct IntuiText IText2 = { 3,0,COMPLEMENT, /* front and back text pens, drawmode and fill byte */ 19,4, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Pen 1", /* pointer to text */ NULL /* next IntuiText structure */ }; struct Gadget Pen1Sample = { &Pen2Sample, /* next gadget */ 123,145, /* origin XY of hit box relative to window TopLeft */ 78,16, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border2, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ &IText2, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors3[] = { 0,0, 67,0, 67,129, 0,129, 0,0 }; struct Border Border3 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors3, /* pointer to XY vectors */ NULL /* next border in list */ }; struct Gadget Grid = { &Pen1Sample, /* next gadget */ 25,23, /* origin XY of hit box relative to window TopLeft */ 64,128, /* hit box width and height */ GADGHBOX+GADGHIMAGE, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border3, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ NULL, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors4[] = { 0,0, 186,0, 186,116, 0,116, 0,0 }; struct Border Border4 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors4, /* pointer to XY vectors */ NULL /* next border in list */ }; struct Gadget Bigsample = { &Grid, /* next gadget */ 121,23, /* origin XY of hit box relative to window TopLeft */ 183,115, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border4, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ NULL, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; struct PropInfo SizerSInfo = { AUTOKNOB+FREEVERT, /* PROPINFO flags */ -1,-32222, /* horizontal and vertical pot values */ -1,1638, /* horizontal and vertical body values */ }; struct Image Image1 = { 0,61, /* XY origin relative to container TopLeft */ 4,4, /* Image width and height in pixels */ 0, /* number of bitplanes in Image */ NULL, /* pointer to ImageData */ 0x0000,0x0000, /* PlanePick and PlaneOnOff */ NULL /* next Image structure */ }; struct Gadget Sizer = { &Bigsample, /* next gadget */ 99,24, /* origin XY of hit box relative to window TopLeft */ 12,128, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ PROPGADGET, /* gadget type flags */ (APTR)&Image1, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ NULL, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ (APTR)&SizerSInfo, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors5[] = { 0,0, 68,0, 68,21, 0,21, 0,0 }; struct Border Border5 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors5, /* pointer to XY vectors */ NULL /* next border in list */ }; struct IntuiText IText3 = { 3,0,JAM2, /* front and back text pens, drawmode and fill byte */ 11,6, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Clear", /* pointer to text */ NULL /* next IntuiText structure */ }; struct Gadget Gadget3 = { &Sizer, /* next gadget */ 24,160, /* origin XY of hit box relative to window TopLeft */ 65,20, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border5, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ &IText3, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors6[] = { 0,0, 83,0, 83,29, 0,29, 0,0 }; struct Border Border6 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors6, /* pointer to XY vectors */ NULL /* next border in list */ }; struct Gadget Pen2 = { &Gadget3, /* next gadget */ 224,165, /* origin XY of hit box relative to window TopLeft */ 80,28, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border6, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ NULL, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors7[] = { 0,0, 83,0, 83,29, 0,29, 0,0 }; struct Border Border7 = { -2,-1, /* XY origin relative to container TopLeft */ 3,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors7, /* pointer to XY vectors */ NULL /* next border in list */ }; struct Gadget Pen1 = { &Pen2, /* next gadget */ 122,165, /* origin XY of hit box relative to window TopLeft */ 80,28, /* hit box width and height */ NULL, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET, /* gadget type flags */ (APTR)&Border7, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ NULL, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; #define GadgetList1 Pen1 struct IntuiText IText4 = { 3,1,COMPLEMENT, /* front and back text pens, drawmode and fill byte */ 0,0, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Quit", /* pointer to text */ NULL /* next IntuiText structure */ }; struct MenuItem MenuItem4 = { NULL, /* next MenuItem structure */ 0,27, /* XY of Item hitbox relative to TopLeft of parent hitbox */ 80,8, /* hit box width and height */ ITEMTEXT+ITEMENABLED+HIGHCOMP, /* Item flags */ 0, /* each bit mutually-excludes a same-level Item */ (APTR)&IText4, /* Item render (IntuiText or Image or NULL) */ NULL, /* Select render */ NULL, /* alternate command-key */ NULL, /* SubItem list */ MENUNULL /* filled in by Intuition for drag selections */ }; struct IntuiText IText5 = { 3,1,COMPLEMENT, /* front and back text pens, drawmode and fill byte */ 0,0, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"About", /* pointer to text */ NULL /* next IntuiText structure */ }; struct MenuItem MenuItem3 = { &MenuItem4, /* next MenuItem structure */ 0,18, /* XY of Item hitbox relative to TopLeft of parent hitbox */ 80,8, /* hit box width and height */ ITEMTEXT+ITEMENABLED+HIGHCOMP, /* Item flags */ 0, /* each bit mutually-excludes a same-level Item */ (APTR)&IText5, /* Item render (IntuiText or Image or NULL) */ NULL, /* Select render */ NULL, /* alternate command-key */ NULL, /* SubItem list */ MENUNULL /* filled in by Intuition for drag selections */ }; struct IntuiText IText6 = { 3,1,COMPLEMENT, /* front and back text pens, drawmode and fill byte */ 0,0, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Save", /* pointer to text */ NULL /* next IntuiText structure */ }; struct MenuItem MenuItem2 = { &MenuItem3, /* next MenuItem structure */ 0,9, /* XY of Item hitbox relative to TopLeft of parent hitbox */ 80,8, /* hit box width and height */ ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP, /* Item flags */ 0, /* each bit mutually-excludes a same-level Item */ (APTR)&IText6, /* Item render (IntuiText or Image or NULL) */ NULL, /* Select render */ 's', /* alternate command-key */ NULL, /* SubItem list */ MENUNULL /* filled in by Intuition for drag selections */ }; struct IntuiText IText7 = { 3,1,COMPLEMENT, /* front and back text pens, drawmode and fill byte */ 0,0, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Load", /* pointer to text */ NULL /* next IntuiText structure */ }; struct MenuItem MenuItem1 = { &MenuItem2, /* next MenuItem structure */ 0,0, /* XY of Item hitbox relative to TopLeft of parent hitbox */ 80,8, /* hit box width and height */ ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP, /* Item flags */ 0, /* each bit mutually-excludes a same-level Item */ (APTR)&IText7, /* Item render (IntuiText or Image or NULL) */ NULL, /* Select render */ 'l', /* alternate command-key */ NULL, /* SubItem list */ MENUNULL /* filled in by Intuition for drag selections */ }; struct Menu Menu1 = { NULL, /* next Menu structure */ 0,0, /* XY origin of Menu hit box relative to screen TopLeft */ 75,0, /* Menu hit box width and height */ MENUENABLED, /* Menu flags */ "Project", /* text of Menu name */ &MenuItem1 /* MenuItem linked list pointer */ }; #define MenuList1 Menu1 struct NewWindow NewWindowStructure1 = { 0,0, /* window XY origin relative to TopLeft of screen */ 320,200, /* window width and height */ 0,1, /* detail and block pens */ MOUSEMOVE+GADGETUP+MENUPICK+REQCLEAR, /* IDCMP flags */ BACKDROP+ACTIVATE+NOCAREREFRESH, /* other window flags */ &Pen1, /* first gadget in gadget list */ NULL, /* custom CHECKMARK imagery */ (UBYTE *)"Pattern Editor by Don Hyde", /* window title */ NULL, /* custom screen pointer */ NULL, /* custom bitmap */ 5,5, /* minimum width and height */ 640,200, /* maximum width and height */ CUSTOMSCREEN /* destination screen type */ }; USHORT ImageData2[] = { 0x01E0,0x0000,0x0000,0x0000,0x0698,0x0000,0x0000,0x0000, 0x0884,0x0000,0x0000,0x0000,0x1082,0x0000,0x4100,0x1000, 0x1081,0x0000,0xC100,0x2800,0x1080,0x8001,0x4100,0x2800, 0x1080,0x4006,0x4100,0x2800,0x1080,0x4000,0x4100,0x2800, 0x0880,0x2000,0x4100,0x2800,0x0680,0x2000,0x4100,0x2800, 0x0180,0x2000,0x4100,0x2800,0x00F0,0x2000,0x4100,0x2800, 0x008F,0xFF00,0x4148,0x18C0,0x0080,0x29F4,0x7FC8,0xF120, 0x3D00,0x5E9A,0x7149,0x1220,0x4380,0x5092,0x494B,0x12C0, 0x8240,0x9092,0x454D,0x1B08,0x8C21,0x0F12,0x4338,0xE4F0, 0x701E,0x0001,0x1108,0x0000,0x0000,0x0000,0xE018,0x0000, 0x0000,0x0000,0x0018,0x0000,0x0000,0x0000,0x0028,0x0000, 0x0000,0x0000,0x0028,0x0000,0x0000,0x0000,0x0028,0x0000, 0x0000,0x0000,0x0010,0x0000,0x01E0,0x0000,0x0000,0x0000, 0x0698,0x0000,0x0000,0x0000,0x0884,0x0000,0x0000,0x0000, 0x1082,0x0000,0x4100,0x1000,0x1081,0x0000,0xC100,0x2800, 0x1080,0x8001,0x4100,0x2800,0x1080,0x4006,0x4100,0x2800, 0x1080,0x4000,0x4100,0x2800,0x0880,0x2000,0x4100,0x2800, 0x0680,0x2000,0x4100,0x2800,0x0180,0x2000,0x4100,0x2800, 0x00F0,0x2000,0x4100,0x2800,0x008F,0xFF00,0x4148,0x18C0, 0x0080,0x29F4,0x7FC8,0xF120,0x3D00,0x5E9A,0x7149,0x1220, 0x4380,0x5092,0x494B,0x12C0,0x8240,0x9092,0x454D,0x1B08, 0x8C21,0x0F12,0x4338,0xE4F0,0x701E,0x0001,0x1108,0x0000, 0x0000,0x0000,0xE018,0x0000,0x0000,0x0000,0x0018,0x0000, 0x0000,0x0000,0x0028,0x0000,0x0000,0x0000,0x0028,0x0000, 0x0000,0x0000,0x0028,0x0000,0x0000,0x0000,0x0010,0x0000, 0x01E0,0x0000,0x0000,0x0000,0x0698,0x0000,0x0000,0x0000, 0x0884,0x0000,0x0000,0x0000,0x1082,0x0000,0x4100,0x1000, 0x1081,0x0000,0xC100,0x2800,0x1080,0x8001,0x4100,0x2800, 0x1080,0x4006,0x4100,0x2800,0x1080,0x4000,0x4100,0x2800, 0x0880,0x2000,0x4100,0x2800,0x0680,0x2000,0x4100,0x2800, 0x0180,0x2000,0x4100,0x2800,0x00F0,0x2000,0x4100,0x2800, 0x008F,0xFF00,0x4148,0x18C0,0x0080,0x29F4,0x7FC8,0xF120, 0x3D00,0x5E9A,0x7149,0x1220,0x4380,0x5092,0x494B,0x12C0, 0x8240,0x9092,0x454D,0x1B08,0x8C21,0x0F12,0x4338,0xE4F0, 0x701E,0x0001,0x1108,0x0000,0x0000,0x0000,0xE018,0x0000, 0x0000,0x0000,0x0018,0x0000,0x0000,0x0000,0x0028,0x0000, 0x0000,0x0000,0x0028,0x0000,0x0000,0x0000,0x0028,0x0000, 0x0000,0x0000,0x0010,0x0000 }; struct Image Image2 = { 0,0, /* XY origin relative to container TopLeft */ 61,25, /* Image width and height in pixels */ 3, /* number of bitplanes in Image */ ImageData2, /* pointer to ImageData */ 0x0007,0x0000, /* PlanePick and PlaneOnOff */ NULL /* next Image structure */ }; struct Gadget Gadget79 = { NULL, /* next gadget */ 115,73, /* origin XY of hit box relative to window TopLeft */ 13,8, /* hit box width and height */ GADGIMAGE, /* gadget flags */ RELVERIFY, /* activation flags */ BOOLGADGET+REQGADGET, /* gadget type flags */ (APTR)&Image2, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ NULL, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; SHORT BorderVectors8[] = { 0,0, 76,0, 76,17, 0,17, 0,0 }; struct Border Border8 = { -2,-1, /* XY origin relative to container TopLeft */ 1,0,JAM1, /* front pen, back pen and drawmode */ 5, /* number of XY vectors */ BorderVectors8, /* pointer to XY vectors */ NULL /* next border in list */ }; struct IntuiText IText8 = { 1,0,JAM2, /* front and back text pens, drawmode and fill byte */ 1,4, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"I read it", /* pointer to text */ NULL /* next IntuiText structure */ }; struct Gadget Gadget78 = { &Gadget79, /* next gadget */ 111,102, /* origin XY of hit box relative to window TopLeft */ 73,16, /* hit box width and height */ NULL, /* gadget flags */ ENDGADGET, /* activation flags */ BOOLGADGET+REQGADGET, /* gadget type flags */ (APTR)&Border8, /* gadget border or image to be rendered */ NULL, /* alternate imagery for selection */ &IText8, /* first IntuiText structure */ NULL, /* gadget mutual-exclude long word */ NULL, /* SpecialInfo structure */ NULL, /* user-definable data */ NULL /* pointer to user-definable data */ }; #define GadgetList2 Gadget78 struct IntuiText IText15 = { 6,0,JAM2, /* front and back text pens, drawmode and fill byte */ 48,6, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"About Patedit", /* pointer to text */ NULL /* next IntuiText structure */ }; struct IntuiText IText14 = { 5,0,JAM2, /* front and back text pens, drawmode and fill byte */ 3,72, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"to SetAfPt.", /* pointer to text */ &IText15 /* next IntuiText structure */ }; struct IntuiText IText13 = { 5,0,JAM2, /* front and back text pens, drawmode and fill byte */ 3,61, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"for the structs to pass", /* pointer to text */ &IText14 /* next IntuiText structure */ }; struct IntuiText IText12 = { 5,0,JAM2, /* front and back text pens, drawmode and fill byte */ 3,50, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"fills. It creates c code", /* pointer to text */ &IText13 /* next IntuiText structure */ }; struct IntuiText IText11 = { 5,0,JAM2, /* front and back text pens, drawmode and fill byte */ 2,38, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"needed for patterned area", /* pointer to text */ &IText12 /* next IntuiText structure */ }; struct IntuiText IText10 = { 5,0,JAM2, /* front and back text pens, drawmode and fill byte */ 4,27, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"help create the patterns", /* pointer to text */ &IText11 /* next IntuiText structure */ }; struct IntuiText IText9 = { 5,0,JAM2, /* front and back text pens, drawmode and fill byte */ 5,17, /* XY origin relative to container TopLeft */ NULL, /* font pointer or NULL for default */ (UBYTE *)"Patedit is a program to", /* pointer to text */ &IText10 /* next IntuiText structure */ }; #define IntuiTextList2 IText9 struct Requester RequesterStructure2 = { NULL, /* previous requester (filled in by Intuition) */ 114,10, /* requester XY origin relative to TopLeft of window */ 206,129, /* requester width and height */ 0,0, /* relative to these mouse offsets if POINTREL is set */ &GadgetList2, /* gadget list */ NULL, /* box's border */ &IntuiTextList2, /* requester text */ NULL, /* requester flags */ 0, /* back-plane fill pen */ NULL, /* leave these alone */ NULL, /* custom bitmap if PREDRAWN is set */ NULL /* leave this alone */ }; void HandleEvent(object) APTR object; { if (object == (APTR)&MenuItem1) { Loadit(object); return; } if (object == (APTR)&MenuItem2) { Saveit(object); return; } if (object == (APTR)&MenuItem3) { tellit(object); return; } if (object == (APTR)&MenuItem4) { quit(object); return; } if (object == (APTR)&Pen1) { DoPen1(object); return; } if (object == (APTR)&Pen2) { DoPen2(object); return; } if (object == (APTR)&Gadget3) { Clearit(object); return; } if (object == (APTR)&Sizer) { SetSize(object); return; } if (object == (APTR)&Grid) { DoGrid(object); return; } } #define HANDLEEVENT HandleEvent /* end of PowerWindows source generation */