home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff321.lzh
/
Ifs
/
source
/
ifsout.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-02-27
|
17KB
|
425 lines
/*
*
*
* IFSout.h - Header file for the Iterated Function System
* uses IFS to create a IFS-Construction Image
* Released to the Public Domain - 1990 The Software Glen Company
*
*
*/
#include <stdio.h>
#include <exec/libraries.h>
#include <graphics/display.h>
#include <graphics/gfxbase.h>
#include <graphics/text.h>
#include <math.h>
#include <limits.h>
UBYTE stxt[NUMSTRS][GSTRLEN]; /* For the String Gadget Text */
struct GfxBase *GfxBase; /* Export the library pointers */
struct IntuitionBase *IntuitionBase;
struct RastPort *rp; /* Graphics structures */
struct ViewPort *vp;
struct TextAttr StdFont = {
"topaz.font", /* Standard system font */
8, 0, 0
};
struct Window *w, *adjwin; /* Intuition structures */
struct Screen *screen;
struct IntuiMessage *message;
struct Gadget gads[NUMGADS];
struct Image PImages[NUMPROPS]; /* dummy AUTOKNOB Images are required */
struct PropInfo PInfos[NUMPROPS]; /* These get copies of TPropInfo */
struct StringInfo SInfo[NUMSTRS];
struct IntuiText StrngText[NUMSTRS] = {
{2, 0, JAM2, -30, 0, NULL, "WN= ", NULL},
{2, 0, JAM2, -30, 0, NULL, "A = ", NULL},
{2, 0, JAM2, -30, 0, NULL, "B = ", NULL},
{2, 0, JAM2, -30, 0, NULL, "C = ", NULL},
{2, 0, JAM2, -30, 0, NULL, "D = ", NULL},
{2, 0, JAM2, -30, 0, NULL, "E = ", NULL},
{2, 0, JAM2, -30, 0, NULL, "F = ", NULL},
{2, 0, JAM2, -30, 0, NULL, "% = ", NULL}
};
struct IntuiText MenuItemText[3][7] = {
{
{0, 1, JAM2, 0, 0, NULL, "About...", NULL},
{0, 1, JAM2, 0, 0, NULL, "Save IFS", NULL},
{0, 1, JAM2, 0, 0, NULL, "Get IFS", NULL},
{0, 1, JAM2, 0, 0, NULL, "To WB ", NULL},
{0, 1, JAM2, 0, 0, NULL, "Quit ", NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
},
{
{0, 1, JAM2, 0, 0, NULL, "Zoom to Fit ", NULL},
{0, 1, JAM2, 0, 0, NULL, "Zoom Out X 2 ", NULL},
{0, 1, JAM2, 0, 0, NULL, "Adjust Func ", NULL},
{0, 1, JAM2, 0, 0, NULL, "Add Another ", NULL},
{0, 1, JAM2, 0, 0, NULL, "Erase Current", NULL},
{0, 1, JAM2, 0, 0, NULL, "Erase All ", NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
},
{
{0, 1, JAM2, CHECKWIDTH, 0, NULL, "Boxes ", NULL},
{0, 1, JAM2, CHECKWIDTH, 0, NULL, "Numbers", NULL},
{0, 1, JAM2, CHECKWIDTH, 0, NULL, "Pause ", NULL},
{0, 1, JAM2, CHECKWIDTH, 0, NULL, "BlkGrnd", NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
}
};
struct MenuItem MenuItem[3][7] = {
{
{&MenuItem[0][1], 0, 0, 64, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[0][0], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[0][2], 0, 20, 64, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[0][1], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[0][3], 0, 40, 64, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[0][2], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[0][4], 0, 60, 64, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[0][3], NULL, NULL, NULL, 0xFFFF},
{NULL, 0, 80, 64, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[0][4], NULL, NULL, NULL, 0xFFFF},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
},
{
{&MenuItem[1][1], 0, 0, 104, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[1][0], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[1][2], 0, 20, 104, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[1][1], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[1][3], 0, 40, 104, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[1][2], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[1][4], 0, 60, 104, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[1][3], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[1][5], 0, 80, 104, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[1][4], NULL, NULL, NULL, 0xFFFF},
{NULL, 0,100, 104, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP,
0, (APTR)&MenuItemText[1][5], NULL, NULL, NULL, 0xFFFF},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
},
{
{&MenuItem[2][1], 0, 0, 56+CHECKWIDTH, 10,
ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT|MENUTOGGLE,
0, (APTR)&MenuItemText[2][0], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[2][2], 0, 20, 56+CHECKWIDTH, 10,
ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT|CHECKED|MENUTOGGLE,
0, (APTR)&MenuItemText[2][1], NULL, NULL, NULL, 0xFFFF},
{&MenuItem[2][3], 0, 40, 56+CHECKWIDTH, 10,
ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT|MENUTOGGLE,
0, (APTR)&MenuItemText[2][2], NULL, NULL, NULL, 0xFFFF},
{NULL, 0, 60, 56+CHECKWIDTH, 10,
ITEMTEXT|ITEMENABLED|HIGHCOMP|CHECKIT|CHECKED|MENUTOGGLE,
0, (APTR)&MenuItemText[2][3], NULL, NULL, NULL, 0xFFFF},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
}
};
struct Menu Menu[3] = {
{&Menu[1], 0, 0, 60, 0, MENUENABLED, "Project", &MenuItem[0][0]},
{&Menu[2], 81, 0, 76, 0, MENUENABLED, "Functions", &MenuItem[1][0]},
{NULL, 171, 0, 60, 0, MENUENABLED, "Control", &MenuItem[2][0]}
};
struct PropInfo TPropInfo = {
AUTOKNOB | FREEHORIZ, /* Flags */
0, 0, /* Pots: Horiz, Vert: both start at 0 */
0x00D4, 0x00D4, /* Bodies: Horiz is 1/300, Vert is 1/300 */
0, 0, 0, 0, 0, 0 /* System usage stuff */
};
/* this is the template for the Gadget of a horizonal */
/* Proportional Gadget */
struct Gadget TPropGadget = {
NULL, /* pointer to NextGadget */
110, GADSIZE, (WIDTH/4), GADSIZE, /* Select Box L T W H */
GADGHCOMP, /* Flags */
GADGIMMEDIATE | RELVERIFY | FOLLOWMOUSE, /* Activation flags */
PROPGADGET, /* Type */
NULL, /* pointer to Image filled in later */
NULL, /* no pointer to SelectRender filled later */
NULL, /* no pointer to GadgetText */
0, /* no MutualExclude */
NULL, /* SpecialInfo proportional data filled later */
0, /* no ID */
NULL /* no pointer to special data */
};
struct Gadget ZoomGadget = {
NULL, /* pointer to NextGadget */
340, (2*GADSIZE), (2*GADSIZE), 80, /* Select Box L T W H */
GADGHCOMP, /* Flags */
GADGIMMEDIATE | RELVERIFY | FOLLOWMOUSE, /* Activation flags */
PROPGADGET, /* Type */
NULL, /* pointer to Image filled in later */
NULL, /* no pointer to SelectRender */
NULL, /* no pointer to GadgetText */
0, /* no MutualExclude */
NULL, /* SpecialInfo proportional filled in later*/
0, /* no ID */
NULL /* no pointer to special data */
};
struct Gadget CenterGadget = {
NULL, /* pointer to NextGadget */
440, GADSIZE*2, (WIDTH/4), 80, /* Select Box L T W H */
GADGHCOMP, /* Flags */
GADGIMMEDIATE | RELVERIFY | FOLLOWMOUSE, /* Activation flags */
PROPGADGET, /* Type */
NULL, /* pointer to Image filled in later */
NULL, /* no pointer to SelectRender */
NULL, /* no pointer to GadgetText */
0, /* no MutualExclude */
NULL, /* SpecialInfo proportional filled in later*/
0, /* no ID */
NULL /* no pointer to special data */
};
struct Gadget TStrngGadget = {
NULL, /* pointer to NextGadget */
40, GADSIZE, 50, GADSIZE, /* Select Box L T W H */
GADGHCOMP, /* Flags */
RELVERIFY | ENDGADGET, /* Activation flags */
STRGADGET, /* Type */
NULL, /* pointer to Image filled in later */
NULL, /* no pointer to SelectRender filled later */
NULL, /* no pointer to GadgetText */
0, /* no MutualExclude */
NULL, /* SpecialInfo proportional data filled later */
0, /* no ID */
NULL /* no pointer to special data filled in later*/
};
/* This is the text for the About requester */
#define TXT01 ""
#define TXT02 " AMIGA IFSOUT V1.5"
#define TXT03 "Public Domain by Software Glen Co."
#define TXT04 "An Iterated Function System Viewer"
#define TXT05 ""
#define TXT06 "I would be interested in any new &"
#define TXT07 "interesting functions you find. "
#define TXT08 ""
#define TXT09 " Glen Fullmer"
#define TXT10 " email fullmer@alfalfa.sps.mot.com"
#define TXT11 ""
#define TXT12 ""
#define TXT13 "Algorithm from FRACTALS EVERYWHERE"
#define TXT14 " by Michael Barnsley"
struct IntuiText ReqText14 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
133, /* Top */
&StdFont, /* pointer to TextFont */
TXT14,
NULL /* next */
};
struct IntuiText ReqText13 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
123, /* Top */
&StdFont, /* pointer to TextFont */
TXT13,
&ReqText14 /* next */
};
struct IntuiText ReqText12 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
113, /* Top */
&StdFont, /* pointer to TextFont */
TXT12,
&ReqText13 /* next */
};
struct IntuiText ReqText11 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
103, /* Top */
&StdFont, /* pointer to TextFont */
TXT11,
&ReqText12 /* next */
};
struct IntuiText ReqText10 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
93, /* Top */
&StdFont, /* pointer to TextFont */
TXT10,
&ReqText11 /* next */
};
struct IntuiText ReqText9 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
83, /* Top */
&StdFont, /* pointer to TextFont */
TXT09,
&ReqText10 /* next */
};
struct IntuiText ReqText8 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
73, /* Top */
&StdFont, /* pointer to TextFont */
TXT08,
&ReqText9 /* next */
};
struct IntuiText ReqText7 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
63, /* Top */
&StdFont, /* pointer to TextFont */
TXT07,
&ReqText8 /* next */
};
struct IntuiText ReqText6 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
53, /* Top */
&StdFont, /* pointer to TextFont */
TXT06,
&ReqText7 /* next */
};
struct IntuiText ReqText5 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
43, /* Top */
&StdFont, /* pointer to TextFont */
TXT05,
&ReqText6 /* next */
};
struct IntuiText ReqText4 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
33, /* Top */
&StdFont, /* pointer to TextFont */
TXT04,
&ReqText5 /* next */
};
struct IntuiText ReqText3 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
23, /* Top */
&StdFont, /* pointer to TextFont */
TXT03,
&ReqText4 /* next */
};
struct IntuiText ReqText2 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
13, /* Top */
&StdFont, /* pointer to TextFont */
TXT02,
&ReqText3 /* next */
};
struct IntuiText ReqText1 = {
0, /* Front Pen */
1, /* Back pen */
JAM2, /* Draw Mode */
5, /* Left Edge */
3, /* Top */
&StdFont, /* pointer to TextFont */
TXT01,
&ReqText2 /* next */
};
struct IntuiText OKIText = {
0, 1 , /* FrontPen, BackPen */
JAM2, /* DrawMode */
6, 3, /* LeftEdge, TopEdge (relative to gadget) */
&StdFont, /* pointer to TextFont */
"OK", /* pointer to Text */
NULL /* no pointer to NextText */
};
struct NewScreen ns = {
0, 0, /* start position */
640, 400, 4, /* width, height, depth */
0, 1, /* detail pen, block pen */
HIRES|INTERLACE, /* Normal ViewMode */
CUSTOMSCREEN, /* screen type */
&StdFont, /* font to use */
SCREENTITLE, /* default title for screen */
NULL /* pointer to additional gadgets */
};
struct NewWindow nw = {
0, 0, /* start position */
WIDTH, HEIGHT, /* width, height */
-1, -1, /* detail pen, block pen */
CLOSEWINDOW|MOUSEBUTTONS|MENUPICK|INTUITICKS, /* IDCMP flags */
/* Window flags*/
WINDOWCLOSE|ACTIVATE|BORDERLESS|SMART_REFRESH|NOCAREREFRESH,
NULL, /* Pointer to FirstGadget */
NULL, /* pointer to user checkmark */
NULL, /* window title */
NULL, /* pointer to screen (set below) */
NULL, /* pointer to superbitmap */
0, 0, 640, 373, /* ignored since not sizeable */
CUSTOMSCREEN /* type of screen desired */
};
struct NewWindow nadjwin = {
0, 20, /* start position */
WIDTH,(((NUMPROPS-2) * GADSIZE)+30),/* width, height */
2,1, /* detail pen, block pen */
CLOSEWINDOW | GADGETUP, /* IDCMP flags */
WINDOWCLOSE|WINDOWDRAG|SMART_REFRESH|NOCAREREFRESH, /* window flags */
&gads[NUMGADS-1], /* Pointer to FirstGadget */
NULL, /* pointer to user checkmark */
"Coefficients Adjust Zoom Reposition ",/* window title */
NULL, /* pointer to screen (set below) */
NULL, /* pointer to superbitmap */
0, 0, 0, 0, /* ignored since not sizeable */
CUSTOMSCREEN /* type of screen desired */
};