page%swap@Sun.COM (Bob Page) (05/17/89)
Submitted-by: u211344@hnykun11.bitnet (Olaf 'Rhialto' Seibert) Posting-number: Volume 89, Issue 145 Archive-name: graphics/mandel180.4 # This is a shell archive. # Remove anything above and including the cut line. # Then run the rest of the file through 'sh'. # Unpacked files will be owned by you and have default permissions. #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: SHell ARchive # Run the following text through 'sh' to create: # Notice # Palette.c # Select.blk # Select.c # Select.req # minrexx.h # This is archive 4 of a 4-part kit. # This archive created: Wed May 17 20:45:14 1989 echo "extracting Notice" sed 's/^X//' << \SHAR_EOF > Notice X/* X * +-----------------------------+ X * | Mandelbrot Construction Set | X * +-----------------------------+ X * X * (C) By Olaf {* KosmoSoft *} Seibert X * 15 September 1987 V1.0 X * 22 January 1989 V1.1 X * 28 January 1989 V1.2 X * 16 April 1989 V1.3 X * X * X * Copyright 1987, 1989 by Olaf Seibert, KosmoSoft Productions. X * X * Notice: The palette and the file requester were written by others. X * (=RJ= Mical and C. Heath respectively) X * These packages were adapted to be more generally usable, and to X * conform more to my own taste. X * I had to remove a number of bugs from Jim Kents IFF routines. X * For the 'select' requester I used Stuart Ferguson's blk 2.0 (which I X * extended to generate code for longint string requesters) X * X * Mind you: _I_ didn't mention ShareWare! (though donations are X * not unwelcome...) X */ X XThis software is (C) Copyright 1989 by Olaf Seibert. All Rights Reserved. X XThis software is NOT in the public domain. It may not be sold or used for Xprofit without prior written consent from the author, Olaf Seibert. X XConditions for redistribution are: X X- This notice must remain included at all times. It may not be modified in X any way. X X- No charge may be made for distribution above media and transportation X costs, except by Fred Fish when included in his library. X X- The source and documentation of the program must always be distributed X with the binary, unless the distributor of said binary agrees to supply X the source and documentation on request, with no expiration date on X availability of said source and documentation. X X- If any part of this program (source or binary) or its documentation is X included in any other software package, either integrated or separately, X these redistribution conditions automatically apply to the entire X package, unless prior written permission is obtained from the author. X X- No claim is made regarding the quality of this software or its X documentation. It is supplied purely as-is. The author cannot be held X responsible for any damages occurring directly or indirectly from using X or not using this program. X X/************************************************************************ X* .-------------------------------------------------------------------. * X* | --- >>> AUTHOR INFORMATION <<< --- | * X* `-------------------------------------------------------------------' * X*=======================================================================* X* || * X* Study address || Home address * X* (might vary) || (safe way to send fanmail) * X* || * X* Olaf Seibert || Olaf Seibert * X* Vossendijk 149 || Beek 5 * X* 6534 TN Nijmegen || 5815 CS Merselo * X* The Netherlands || The Netherlands * X* || * X* International +31-80561045 || International +31-4786205 * X* or National 080-561045 || or National 04786-205 * X* || * X*=======================================================================* X************************************************************************/ SHAR_EOF echo "extracting Palette.c" sed 's/^X//' << \SHAR_EOF > Palette.c X#define DEBUG X X/* X MAND.H -- The Constants and Definitions X Mandelbrot Self-Squared Dragon Generator X For the Commodore Amiga X Version 2.01 X X Accompanied MAND.C X X Copyright (c) 1985, Robert S. French X Placed in the Public Domain X X Vastly Enhanced by =RJ Mical= 1985 X Manxified by Olaf Seibert 1987 X XThis program may be distributed free of charge as long as the above Xnotice is retained. X X*/ X X X/*-------------------*/ X/* Lots of includes! */ X X#include <exec/types.h> X#include <exec/memory.h> X/* #include <exec/tasks.h> */ X/* #include <exec/libraries.h> */ X/* #include <exec/devices.h> */ X/* #include <devices/keymap.h> */ X/* #include <graphics/copper.h> */ X/* #include <graphics/display.h> */ X/* #include <graphics/gfxbase.h> */ X/* #include <graphics/text.h> */ X/* #include <graphics/view.h> */ X/* #include <graphics/gels.h> */ X/* #include <graphics/regions.h> */ X/* #include <hardware/blit.h> */ X#include <intuition/intuition.h> X/* #include <intuition/intuitionbase.h> */ X#ifdef DEBUG X# include <stdio.h> X# undef STATIC /* Empty string */ X# define STATIC X#endif X X/* #include <libraries/dos.h> */ X X/* #include <workbench/workbench.h> */ X X#include "mandel.h" X X/*---------------------------------*/ X#define NOT ! X#define FOREVER for(;;) X X/* === the definitions for the ColorWindow =============================== */ X#define COLOR_KNOB_BODY 0x1000 /* 0x1111 */ X X#define COLORWINDOW_WIDTH 208 X#define COLORWINDOW_HEIGHT 101 /* 91 */ X X#define DEFAULT_WINDOW_LEFT (320 - COLORWINDOW_WIDTH) X#define DEFAULT_WINDOW_TOP (200 - COLORWINDOW_HEIGHT) X X#define CHARACTER_WIDTH 8 X#define CHARACTER_HEIGHT 8 X X#define COLOR_BOX_LEFT 7 X#define COLOR_BOX_TOP 16 /* 6 */ X#define COLOR_BOX_RIGHT (COLOR_BOX_LEFT + 15) X#define COLOR_BOX_BOTTOM (COLOR_BOX_TOP + 29) X#define COLOR_COLOR_TOP 55 /* 45 */ X#define COLOR_COLOR_WIDTH 15 X#define COLOR_COLOR_HEIGHT 10 X#define COLOR_PROP_LEFT 38 X#define COLOR_PROP_TOP 14 /* 4 */ X#define COLOR_PROP_WIDTH 165 X#define COLOR_PROP_HEIGHT 10 X#define COLOR_CLUSTER_LEFT 141 X#define COLOR_CLUSTER_TOP 51 /* 41 */ X#define COLOR_CLUSTER_WIDTH (CHARACTER_WIDTH * 6 + 4) X#define COLOR_CLUSTER_HEIGHT 9 X#define COLOR_AIN_TOP (COLOR_BOX_TOP - 2) X#define COLOR_AIN_LEFT (COLOR_BOX_RIGHT + 3) X X/* GREEN and RED are out of order. Do you wonder why? Some day I'll X * tell you. =RJ= X */ X#define COLOR_COPY MAXCOL X#define COLOR_RANGE MAXCOL+1 X#define COLOR_OK MAXCOL+2 X#define COLOR_CANCEL MAXCOL+3 X#define COLOR_GREEN MAXCOL+4 X#define COLOR_RED MAXCOL+5 X#define COLOR_BLUE MAXCOL+6 X#define COLOR_AIN_RGB MAXCOL+7 X#define COLOR_GADGETS_COUNT MAXCOL+8 X X#define RAIN_MAX_DISTANCE (MaxColor - 2) X#define RAIN_MIN_DISTANCE 1 X X#define ONE_HALF (0x8000L) X X#define SafeFont Topaz80 X X/**************************************************************************** X * MAND6.C - Color Window Data X * Mandelbrot Self-Squared Dragon Generator X * For the Commodore Amiga X * Version 2.01 X * X * Copyright (C) 1986, =Robert J. Mical= X * Placed in the Public Domain X * X * This program may be distributed free of charge as long as the above X * notice is retained. You may extract any or all information contained X * in this file for use in your own programs X * X ***************************************************************************/ X X X/**************************************************************************** X * X * Color window template initialization and routines, X * for colorwindow and cyclewindow X * X * Throughout this file, the COLOR_RED and COLOR_GREEN gadgets are in the X * opposite order you would expect. X * X ***************************************************************************/ X XSTATIC USHORT RGBData[] = X{ X 0x0000, 0xFC00, 0x6600, 0x6600, 0x7C00, 0x6C00, 0x6600, 0xE300, X 0x0000, 0x0000, 0x0000, 0x0000, 0x3C00, 0x6600, 0xC000, 0xCE00, X 0xC600, 0x6600, 0x3E00, 0x0000, 0x0000, 0x0000, 0x0000, 0xFC00, X 0x6600, 0x6600, 0x7C00, 0x6600, 0x6600, 0xFC00, 0x0000, X /* The rest is for the Rainbow Image */ X ~0x0000, ~0xFC00, ~0x6600, ~0x6600, ~0x7C00, ~0x6C00, ~0x6600, ~0xE300, X ~0x0000, ~0x0000, ~0x0000, ~0x0000, ~0x3C00, ~0x6600, ~0xC000, ~0xCE00, X ~0xC600, ~0x6600, ~0x3E00, ~0x0000, ~0x0000, ~0x0000, ~0x0000, ~0xFC00, X ~0x6600, ~0x6600, ~0x7C00, ~0x6600, ~0x6600, ~0xFC00, ~0x0000 X}; X X#define MID_RGB_AIN (sizeof(RGBData)/sizeof(RGBData[0])/2) X X XSTATIC struct Image ColorRGBImage = X{ X 3, 0, X 8, X 31, X 1, X &RGBData[0], X 0x1, 0x0, X NULL, X}; X XSTATIC struct Image ColorRAINImage = X{ X 3, 0, X 8, X 31, X 1, X &RGBData[MID_RGB_AIN], X 0x1, 0x0, X NULL, X}; X XSTATIC SHORT ClusterBorderVectors[] = X{ X -1, -1, X -1, COLOR_CLUSTER_HEIGHT, X COLOR_CLUSTER_WIDTH, COLOR_CLUSTER_HEIGHT, X COLOR_CLUSTER_WIDTH, -1, X -1, -1, X}; X X XSTATIC struct Border ColorClusterBorder = X{ X 0, 0, X 1, 0, X JAM1, X 5, X &ClusterBorderVectors[0], X NULL, X}; X XSTATIC struct IntuiText ColorClusterText[4] = X{ /* "COPY" */ X { X 1, 0, X JAM2, X 2 + CHARACTER_WIDTH, 1, X &SafeFont, X (UBYTE *) "COPY", X NULL, X }, /* "RANGE" */ X { X 1, 0, X JAM2, X 2 + (CHARACTER_WIDTH >> 1), 1, X &SafeFont, X (UBYTE *) "RANGE", X NULL, X }, /* "OK" */ X { X 1, 0, X JAM2, X 2 + (CHARACTER_WIDTH << 1), 1, X &SafeFont, X (UBYTE *) "OK", X NULL, X }, /* "CANCEL" */ X { X 1, 0, X JAM2, X 2, 1, X &SafeFont, X (UBYTE *) "CANCEL", X NULL, X }, X}; X XSTATIC struct IntuiText LessMoreText = X/* "COPY" "<>" */ X{ X 1, 0, X JAM2, X 2 + (CHARACTER_WIDTH >> 1), 1, X &SafeFont, X (UBYTE *) " <-> ", X NULL, X}; XSTATIC struct IntuiText MoreLessText = X{ /* "RANGE" "><" */ X 1, 0, X JAM2, X 2 + (CHARACTER_WIDTH >> 1), 1, X &SafeFont, X (UBYTE *) " >-< ", X NULL, X}; X X/* ======================================================================= */ X/* ======================================================================= */ X/* ======================================================================= */ X X/* RJM anchor */ XSTATIC struct Image ColorPropsImages[3]; XSTATIC struct Image SuperColorImages[MAXCOL]; X X XSTATIC struct PropInfo ColorPropsInfos[3] = X{ X { /* COLOR_GREEN */ X AUTOKNOB | FREEHORIZ, X 0, X 0, X COLOR_KNOB_BODY, X 0, X 0, 0, 0, 0, 0, 0, X }, X { /* COLOR_RED */ X AUTOKNOB | FREEHORIZ, X 0, X 0, X COLOR_KNOB_BODY, X 0, X 0, 0, 0, 0, 0, 0, X }, X { /* COLOR_BLUE */ X AUTOKNOB | FREEHORIZ, X 0, X 0, X COLOR_KNOB_BODY, X 0, X 0, 0, 0, 0, 0, 0, X } X}; X X XSTATIC struct Gadget ColorTemplateGadgets[COLOR_GADGETS_COUNT] = X{ X { /* COLOR_00 */ X NULL, X COLOR_BOX_LEFT + ((00 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((00 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[00], X (APTR)&SuperColorImages[00], X NULL, X NULL, X NULL, X 00, X NULL, X }, X { /* COLOR_01 */ X &ColorTemplateGadgets[00], X COLOR_BOX_LEFT + ((01 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((01 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[01], X (APTR)&SuperColorImages[01], X NULL, X NULL, X NULL, X 01, X NULL, X }, X { /* COLOR_02 */ X &ColorTemplateGadgets[01], X COLOR_BOX_LEFT + ((02 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((02 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[02], X (APTR)&SuperColorImages[02], X NULL, X NULL, X NULL, X 02, X NULL, X }, X { /* COLOR_03 */ X &ColorTemplateGadgets[02], X COLOR_BOX_LEFT + ((03 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((03 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[03], X (APTR)&SuperColorImages[03], X NULL, X NULL, X NULL, X 03, X NULL, X }, X { /* COLOR_04 */ X &ColorTemplateGadgets[03], X COLOR_BOX_LEFT + ((04 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((04 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[04], X (APTR)&SuperColorImages[04], X NULL, X NULL, X NULL, X 04, X NULL, X }, X { /* COLOR_05 */ X &ColorTemplateGadgets[04], X COLOR_BOX_LEFT + ((05 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((05 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[05], X (APTR)&SuperColorImages[05], X NULL, X NULL, X NULL, X 05, X NULL, X }, X { /* COLOR_06 */ X &ColorTemplateGadgets[05], X COLOR_BOX_LEFT + ((06 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((06 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[06], X (APTR)&SuperColorImages[06], X NULL, X NULL, X NULL, X 06, X NULL, X }, X { /* COLOR_07 */ X &ColorTemplateGadgets[06], X COLOR_BOX_LEFT + ((07 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((07 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[07], X (APTR)&SuperColorImages[07], X NULL, X NULL, X NULL, X 07, X NULL, X }, X { /* COLOR_08 */ X &ColorTemplateGadgets[07], X COLOR_BOX_LEFT + ((8 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((8 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[8], X (APTR)&SuperColorImages[8], X NULL, X NULL, X NULL, X 8, X NULL, X }, X { /* COLOR_09 */ X &ColorTemplateGadgets[8], X COLOR_BOX_LEFT + ((9 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((9 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[9], X (APTR)&SuperColorImages[9], X NULL, X NULL, X NULL, X 9, X NULL, X }, X { /* COLOR_10 */ X &ColorTemplateGadgets[9], X COLOR_BOX_LEFT + ((10 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((10 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[10], X (APTR)&SuperColorImages[10], X NULL, X NULL, X NULL, X 10, X NULL, X }, X { /* COLOR_11 */ X &ColorTemplateGadgets[10], X COLOR_BOX_LEFT + ((11 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((11 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[11], X (APTR)&SuperColorImages[11], X NULL, X NULL, X NULL, X 11, X NULL, X }, X { /* COLOR_12 */ X &ColorTemplateGadgets[11], X COLOR_BOX_LEFT + ((12 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((12 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[12], X (APTR)&SuperColorImages[12], X NULL, X NULL, X NULL, X 12, X NULL, X }, X { /* COLOR_13 */ X &ColorTemplateGadgets[12], X COLOR_BOX_LEFT + ((13 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((13 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[13], X (APTR)&SuperColorImages[13], X NULL, X NULL, X NULL, X 13, X NULL, X }, X { /* COLOR_14 */ X &ColorTemplateGadgets[13], X COLOR_BOX_LEFT + ((14 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((14 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[14], X (APTR)&SuperColorImages[14], X NULL, X NULL, X NULL, X 14, X NULL, X }, X { /* COLOR_15 */ X &ColorTemplateGadgets[14], X COLOR_BOX_LEFT + ((15 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((15 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[15], X (APTR)&SuperColorImages[15], X NULL, X NULL, X NULL, X 15, X NULL, X }, X { /* COLOR_16 */ X &ColorTemplateGadgets[15], X COLOR_BOX_LEFT + ((16 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((16 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[16], X (APTR)&SuperColorImages[16], X NULL, X NULL, X NULL, X 16, X NULL, X }, X { /* COLOR_17 */ X &ColorTemplateGadgets[16], X COLOR_BOX_LEFT + ((17 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((17 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[17], X (APTR)&SuperColorImages[17], X NULL, X NULL, X NULL, X 17, X NULL, X }, X { /* COLOR_18 */ X &ColorTemplateGadgets[17], X COLOR_BOX_LEFT + ((18 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((18 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[18], X (APTR)&SuperColorImages[18], X NULL, X NULL, X NULL, X 18, X NULL, X }, X { /* COLOR_19 */ X &ColorTemplateGadgets[18], X COLOR_BOX_LEFT + ((19 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((19 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[19], X (APTR)&SuperColorImages[19], X NULL, X NULL, X NULL, X 19, X NULL, X }, X { /* COLOR_20 */ X &ColorTemplateGadgets[19], X COLOR_BOX_LEFT + ((20 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((20 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[20], X (APTR)&SuperColorImages[20], X NULL, X NULL, X NULL, X 20, X NULL, X }, X { /* COLOR_21 */ X &ColorTemplateGadgets[20], X COLOR_BOX_LEFT + ((21 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((21 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[21], X (APTR)&SuperColorImages[21], X NULL, X NULL, X NULL, X 21, X NULL, X }, X { /* COLOR_22 */ X &ColorTemplateGadgets[21], X COLOR_BOX_LEFT + ((22 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((22 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[22], X (APTR)&SuperColorImages[22], X NULL, X NULL, X NULL, X 22, X NULL, X }, X { /* COLOR_23 */ X &ColorTemplateGadgets[22], X COLOR_BOX_LEFT + ((23 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((23 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[23], X (APTR)&SuperColorImages[23], X NULL, X NULL, X NULL, X 23, X NULL, X }, X { /* COLOR_24 */ X &ColorTemplateGadgets[23], X COLOR_BOX_LEFT + ((24 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((24 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[24], X (APTR)&SuperColorImages[24], X NULL, X NULL, X NULL, X 24, X NULL, X }, X { /* COLOR_25 */ X &ColorTemplateGadgets[24], X COLOR_BOX_LEFT + ((25 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((25 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[25], X (APTR)&SuperColorImages[25], X NULL, X NULL, X NULL, X 25, X NULL, X }, X { /* COLOR_26 */ X &ColorTemplateGadgets[25], X COLOR_BOX_LEFT + ((26 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((26 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[26], X (APTR)&SuperColorImages[26], X NULL, X NULL, X NULL, X 26, X NULL, X }, X { /* COLOR_27 */ X &ColorTemplateGadgets[26], X COLOR_BOX_LEFT + ((27 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((27 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[27], X (APTR)&SuperColorImages[27], X NULL, X NULL, X NULL, X 27, X NULL, X }, X { /* COLOR_28 */ X &ColorTemplateGadgets[27], X COLOR_BOX_LEFT + ((28 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((28 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[28], X (APTR)&SuperColorImages[28], X NULL, X NULL, X NULL, X 28, X NULL, X }, X { /* COLOR_29 */ X &ColorTemplateGadgets[28], X COLOR_BOX_LEFT + ((29 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((29 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[29], X (APTR)&SuperColorImages[29], X NULL, X NULL, X NULL, X 29, X NULL, X }, X { /* COLOR_30 */ X &ColorTemplateGadgets[29], X COLOR_BOX_LEFT + ((30 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((30 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[30], X (APTR)&SuperColorImages[30], X NULL, X NULL, X NULL, X 30, X NULL, X }, X { /* COLOR_31 */ X &ColorTemplateGadgets[30], X COLOR_BOX_LEFT + ((31 & 0x7) * COLOR_COLOR_WIDTH), X COLOR_COLOR_TOP + ((31 >> 3) * COLOR_COLOR_HEIGHT), X COLOR_COLOR_WIDTH, X COLOR_COLOR_HEIGHT, X GADGIMAGE | GADGHNONE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&SuperColorImages[31], X (APTR)&SuperColorImages[31], X NULL, X NULL, X NULL, X 31, X NULL, X }, X { /* COLOR_COPY */ X &ColorTemplateGadgets[31], X COLOR_CLUSTER_LEFT, X COLOR_CLUSTER_TOP + (00 * (COLOR_CLUSTER_HEIGHT + 3)), X COLOR_CLUSTER_WIDTH, X COLOR_CLUSTER_HEIGHT, X GADGHCOMP, X RELVERIFY, X BOOLGADGET, X (APTR)&ColorClusterBorder, X NULL, X &ColorClusterText[00], X NULL, X NULL, X COLOR_COPY, X NULL, X }, X { /* COLOR_RANGE */ X &ColorTemplateGadgets[COLOR_COPY], X COLOR_CLUSTER_LEFT, X COLOR_CLUSTER_TOP + (01 * (COLOR_CLUSTER_HEIGHT + 3)), X COLOR_CLUSTER_WIDTH, X COLOR_CLUSTER_HEIGHT, X GADGHCOMP, X RELVERIFY, X BOOLGADGET, X (APTR)&ColorClusterBorder, X NULL, X &ColorClusterText[01], X NULL, X NULL, X COLOR_RANGE, X NULL, X }, X { /* COLOR_OK */ X &ColorTemplateGadgets[COLOR_RANGE], X COLOR_CLUSTER_LEFT, X COLOR_CLUSTER_TOP + (02 * (COLOR_CLUSTER_HEIGHT + 3)), X COLOR_CLUSTER_WIDTH, X COLOR_CLUSTER_HEIGHT, X GADGHCOMP, X RELVERIFY, X BOOLGADGET, X (APTR)&ColorClusterBorder, X NULL, X &ColorClusterText[02], X NULL, X NULL, X COLOR_OK, X NULL, X }, X { /* COLOR_CANCEL */ X &ColorTemplateGadgets[COLOR_OK], X COLOR_CLUSTER_LEFT, X COLOR_CLUSTER_TOP + (03 * (COLOR_CLUSTER_HEIGHT + 3)), X COLOR_CLUSTER_WIDTH, X COLOR_CLUSTER_HEIGHT, X GADGHCOMP, X RELVERIFY, X BOOLGADGET, X (APTR)&ColorClusterBorder, X NULL, X &ColorClusterText[03], X NULL, X NULL, X COLOR_CANCEL, X NULL, X }, X { /* COLOR_GREEN */ X &ColorTemplateGadgets[COLOR_CANCEL], X COLOR_PROP_LEFT, X COLOR_PROP_TOP + (01 * (COLOR_PROP_HEIGHT + 1)), X COLOR_PROP_WIDTH, X COLOR_PROP_HEIGHT, X GADGIMAGE | GADGHNONE, /* GADGHNONE doesn't seem to work! */ X FOLLOWMOUSE, /* The knob still reverses when selected */ X PROPGADGET, /* even if I GADGHIMAGE with 2 of the */ X (APTR)&ColorPropsImages[01], /* same ColorPropsImages */ X NULL, X NULL, X NULL, X (APTR)&ColorPropsInfos[01], X COLOR_GREEN, X NULL, X }, X { /* COLOR_RED */ X &ColorTemplateGadgets[COLOR_GREEN], X COLOR_PROP_LEFT, X COLOR_PROP_TOP + (00 * (COLOR_PROP_HEIGHT + 1)), X COLOR_PROP_WIDTH, X COLOR_PROP_HEIGHT, X GADGIMAGE | GADGHNONE, X FOLLOWMOUSE, X PROPGADGET, X (APTR)&ColorPropsImages[00], X NULL, X NULL, X NULL, X (APTR)&ColorPropsInfos[00], X COLOR_RED, X NULL, X }, X { /* COLOR_BLUE */ X &ColorTemplateGadgets[COLOR_RED], X COLOR_PROP_LEFT, X COLOR_PROP_TOP + (02 * (COLOR_PROP_HEIGHT + 1)), X COLOR_PROP_WIDTH, X COLOR_PROP_HEIGHT, X GADGIMAGE | GADGHNONE, X FOLLOWMOUSE, X PROPGADGET, X (APTR)&ColorPropsImages[02], X NULL, X NULL, X NULL, X (APTR)&ColorPropsInfos[02], X COLOR_BLUE, X NULL, X }, X { /* COLOR_AIN_RGB */ X &ColorTemplateGadgets[COLOR_BLUE], X COLOR_AIN_LEFT, X COLOR_AIN_TOP, X CHARACTER_WIDTH + 5, X COLOR_BOX_BOTTOM - COLOR_BOX_TOP + 1, X GADGHIMAGE | GADGIMAGE /*| SELECTED*/, X TOGGLESELECT | RELVERIFY, X BOOLGADGET, X (APTR)&ColorRGBImage, X (APTR)&ColorRAINImage, X NULL, X NULL, X NULL, X COLOR_AIN_RGB, X NULL, X } X}; X X X X/**************************************************************************** X * MAND5.C - Color Window X * Mandelbrot Self-Squared Dragon Generator X * For the Commodore Amiga X * Version 2.01 X * X * Copyright (C) 1986, =Robert J. Mical= X * Placed in the Public Domain X * X * This program may be distributed free of charge as long as the above X * notice is retained. You may extract any or all information contained X * in this file for use in your own programs X * X ***************************************************************************/ X X X/**************************************************************************** X * X * Color initialization and routines X * X ***************************************************************************/ X X#define COPYCOLOR 1 X#define RANGE_FIRST 2 X#define RANGE_SECOND 3 XSTATIC USHORT ColorMode; X XSTATIC USHORT SavePalette[MAXCOL]; X X#define COLOR_IDCMP_FLAGS (GADGETDOWN | GADGETUP | MOUSEMOVE) X X#define MIN(x,y) (x<y ? x : y) X X XSTATIC struct NewWindow ColorNewWindow = X{ X/* SHORT LeftEdge, TopEdge; /* screen dimensions of window */ X/* SHORT Width, Height; /* screen dimensions of window */ X DEFAULT_WINDOW_LEFT, DEFAULT_WINDOW_TOP, X COLORWINDOW_WIDTH, COLORWINDOW_HEIGHT, X X/* UBYTE DetailPen, BlockPen; /* for bar/border/gadget rendering */ X -1, -1, X X/* ULONG IDCMPFlags; /* User-selected IDCMP flags */ X NULL, X X/* ULONG Flags; /* see Window struct for defines */ X SMART_REFRESH | NOCAREREFRESH | WINDOWDRAG | WINDOWDEPTH | ACTIVATE, X X/* struct Gadget *FirstGadget;*/ X NULL, X X/* struct Image *CheckMark;*/ X NULL, X X/* UBYTE *Title; /* the title text for this window */ X (UBYTE *)"Palette \xE0 la =RJ=", /* a` \340 */ X X/* struct Screen *Screen;*/ X NULL, X X/* struct BitMap *BitMap;*/ X NULL, X X/* SHORT MinWidth, MinHeight; /* minimums */ X 0, 0, X/* SHORT MaxWidth, MaxHeight; /* maximums */ X 0, 0, X X/* USHORT Type;*/ X CUSTOMSCREEN, X}; X XSTATIC SHORT CurrentColor; XSTATIC SHORT RangeFirst; /* the first selection of the range-color pair */ XSTATIC SHORT MaxColor; XSTATIC BOOL RainbowMode = FALSE; XSHORT RainbowDistance = 0; XSHORT RainbowRMax = 1000; XSHORT RainbowGMax = 1000; XSHORT RainbowBMax = 1000; XSHORT RRMax = -1, RGMax = -1, RBMax = -1; X X Xstruct Window *ColorWindow = NULL; XSTATIC struct ViewPort *vp; X X/* ======================================================================= */ X/* ======================================================================= */ X/* ======================================================================= */ X XBOOL OpenColorWindow(w) Xregister struct Window *w; X{ X register LONG i; X extern LONG TypeOfMem(); X X vp = &w->WScreen->ViewPort; X ColorMode = NULL; X X if (ColorWindow) { X WindowToFront(ColorWindow); X return TRUE; X } X X MaxColor = (1 << w->WScreen->BitMap.Depth) - 1; X if (MaxColor > MAXCOL-1) MaxColor = MAXCOL-1; X for (i = 0; i < MAXCOL; i++) SavePalette[i] = GetRGB4(vp->ColorMap, i); X X /* In case we have uninitialised or dumb values */ X if (RainbowDistance < RAIN_MIN_DISTANCE || X RainbowDistance > RAIN_MAX_DISTANCE) { X RainbowDistance = 1 + MaxColor / 3; X goto defaults; X } X if (RainbowRMax > MaxColor || X RainbowGMax > MaxColor || X RainbowBMax > MaxColor) { Xdefaults: X RainbowRMax = 0; X RainbowGMax = (MaxColor+2) / 3; X RainbowBMax = 2 * (MaxColor+2) / 3; X } X X ColorTemplateGadgets[COLOR_AIN_RGB].Flags &= ~SELECTED; X RainbowMode = FALSE; X ColorTemplateGadgets[COLOR_COPY].GadgetText = &ColorClusterText[0]; X ColorTemplateGadgets[COLOR_RANGE].GadgetText = &ColorClusterText[1]; X X /* Make sure the image data is in CHIP memory */ X if (TypeOfMem(&RGBData[61]) & MEMF_CHIP) { X ColorRGBImage.ImageData = &RGBData[0]; X ColorRAINImage.ImageData = &RGBData[MID_RGB_AIN]; X } else { X#ifdef DEBUG2 X fprintf(stderr, "Allocate CHIP memory (%d bytes) for RGBData\n", X sizeof(RGBData)); X#endif X if ((ColorRGBImage.ImageData = AllocMem((ULONG)sizeof(RGBData), MEMF_CHIP)) X == NULL) return FALSE; X ColorRAINImage.ImageData = ColorRGBImage.ImageData + MID_RGB_AIN; X /* Copy the data */ X for (i=0; i< sizeof(RGBData)/sizeof(RGBData[0]); i++) X ColorRGBImage.ImageData[i] = RGBData[i]; X } X X ColorNewWindow.Screen = w->WScreen; X ColorNewWindow.Type = w->WScreen->Flags & SCREENTYPE; X ColorNewWindow.IDCMPFlags = NULL; X ColorNewWindow.FirstGadget X = &ColorTemplateGadgets[COLOR_GADGETS_COUNT - 1]; X ColorTemplateGadgets[COLOR_COPY].NextGadget = X &ColorTemplateGadgets[MaxColor]; X X if (ColorNewWindow.LeftEdge+ColorNewWindow.Width > w->WScreen->Width) { X ColorNewWindow.LeftEdge = (w->WScreen->Width-ColorNewWindow.Width) / 2; X } X if (ColorNewWindow.TopEdge+ColorNewWindow.Height > w->WScreen->Height) { X ColorNewWindow.TopEdge = (w->WScreen->Height-ColorNewWindow.Height) / 2; X } X CurrentColor = 0; X SetColorProps(); X InitSuperColors(); X X if ((ColorWindow = (struct Window *)OpenWindow(&ColorNewWindow)) == NULL) { X /* fputs("no memory!\n", console); */ X return FALSE; X } X ColorWindow->UserPort = w->UserPort; X ModifyIDCMP(ColorWindow, COLOR_IDCMP_FLAGS); X X DrawColorWindow(); X X return TRUE; X} X X XVOID CloseColorWindow(accept) XBOOL accept; X{ X /* register LONG i; */ X X if (ColorWindow == NULL) return; X X /* ClearMenuStrip(ColorWindow); */ X ColorNewWindow.LeftEdge = ColorWindow->LeftEdge; X ColorNewWindow.TopEdge = ColorWindow->TopEdge; X X /* ColorWindow->UserPort = NULL; */ X /* CloseWindow(ColorWindow); */ X CloseWindowSafely(ColorWindow); X ColorWindow = NULL; X X /* Return the allocated CHIP memory */ X if (ColorRGBImage.ImageData != &RGBData) { X#ifdef DEBUG2 X fprintf(stderr,"Freeing CHIP mem of RGBData\n"); X#endif X FreeMem(ColorRGBImage.ImageData, (ULONG)sizeof(RGBData)); X } X X if (NOT accept) LoadRGB4(vp, &SavePalette[0], MaxColor + 1L); X} X X XSTATIC VOID ColorRange(first, last) XSHORT first, last; X{ X USHORT i; X LONG whole, redfraction, greenfraction, bluefraction; X USHORT rgb; X SHORT firstred, firstgreen, firstblue; X SHORT lastred, lastgreen, lastblue; X SHORT workred, workgreen, workblue; X X if (first > last) { X i = first; X first = last; X last = i; X } X X /* I need to see a spread of at least two, where there's at least one X * spot between the endpoints, else there's no work to do so I X * might as well just return now. X */ X if (first >= last - 1) return; X X rgb = GetRGB4(vp->ColorMap, (ULONG) first); X firstred = (rgb >> 8) & 0xF; X firstgreen = (rgb >> 4) & 0xF; X firstblue = (rgb >> 0) & 0xF; X X rgb = GetRGB4(vp->ColorMap, (ULONG) last); X lastred = (rgb >> 8) & 0xF; X lastgreen = (rgb >> 4) & 0xF; X lastblue = (rgb >> 0) & 0xF; X X whole = ((LONG) lastred - firstred) << 16; X redfraction = whole / (last - first); X whole = ((LONG) lastgreen - firstgreen) << 16; X greenfraction = whole / (last - first); X whole = ((LONG) lastblue - firstblue) << 16; X bluefraction = whole / (last - first); X X for (i = first + 1; i < last; i++) { X lastred = (redfraction * (i - first) + ONE_HALF) >> 16; X workred = firstred + lastred; X lastgreen = (greenfraction * (i - first) + ONE_HALF) >> 16; X workgreen = firstgreen + lastgreen; X lastblue = (bluefraction * (i - first) + ONE_HALF) >> 16; X workblue = firstblue + lastblue; X SetRGB4(vp, (ULONG) i, (ULONG) workred, (ULONG) workgreen, X (ULONG) workblue); X } X} X X XSTATIC BOOL ColorGadgetGotten(gadget) Xstruct Gadget *gadget; X{ X ULONG rgb, pen; X struct RastPort *RPort; X SHORT green, red, blue; X X RPort = ColorWindow->RPort; X X /* Have we got a color specifier? */ X if (NOT RainbowMode && gadget->GadgetID <= MaxColor) { X /* Yes, it's a color gadget. Set this pen number */ X pen = gadget->GadgetID; X /* First, were we in COPY COLOR mode? */ X if (ColorMode == COPYCOLOR) { X /* Ok, copy old color here first! */ X rgb = GetRGB4(vp->ColorMap, (ULONG) CurrentColor); X SetRGB4(vp, pen, rgb >> 8, rgb >> 4, rgb); X ColorMode = NULL; X } X else if (ColorMode == RANGE_FIRST) { X ColorMode = RANGE_SECOND; X RangeFirst = pen; X } X else if (ColorMode == RANGE_SECOND) { X ColorMode = NULL; X ColorRange(RangeFirst, (SHORT) pen); X } X CurrentColor = pen; X ColorRectFill(RPort, (SHORT) pen); X X red = RemoveGadget(ColorWindow, &ColorTemplateGadgets[COLOR_RED]); X green = RemoveGadget(ColorWindow,&ColorTemplateGadgets[COLOR_GREEN]); X blue = RemoveGadget(ColorWindow, &ColorTemplateGadgets[COLOR_BLUE]); X SetColorProps(); X AddGadget(ColorWindow, &ColorTemplateGadgets[COLOR_BLUE], X (LONG) blue); X AddGadget(ColorWindow, &ColorTemplateGadgets[COLOR_GREEN], X (LONG) green); X AddGadget(ColorWindow, &ColorTemplateGadgets[COLOR_RED], X (LONG) red); X RefreshGadgets(&ColorTemplateGadgets[COLOR_GADGETS_COUNT - 1], X ColorWindow); X } X X else if (RainbowMode && gadget->GadgetID <= MaxColor) { X /* Yes, it's a color gadget. Get its old color back. */ X pen = gadget->GadgetID; X red = (SavePalette[pen] & 0xF00) >> 8; X green = (SavePalette[pen] & 0x0F0) >> 4; X blue = (SavePalette[pen] & 0x00F) >> 0; X SetRGB4(vp, pen, (LONG) red, (LONG) green, (LONG) blue); X } X X else switch (gadget->GadgetID) { X case COLOR_OK: X CloseColorWindow((BOOL) TRUE); X return FALSE; X break; X case COLOR_CANCEL: X CloseColorWindow((BOOL) FALSE); X return FALSE; X break; X case COLOR_COPY: X if (RainbowMode) { /* Gadget now has an alternate meaning */ X if (++RainbowDistance > RAIN_MAX_DISTANCE) X RainbowDistance = RAIN_MAX_DISTANCE; X RRMax = -2; /* Force color updating */ X ModifyColors(); X } X else ColorMode = COPYCOLOR; X break; X case COLOR_RANGE: X if (RainbowMode) { X if (--RainbowDistance < RAIN_MIN_DISTANCE) X RainbowDistance = RAIN_MIN_DISTANCE; X RRMax = -3; /* Force color updating */ X ModifyColors(); X } X else ColorMode = RANGE_FIRST; X break; X case COLOR_AIN_RGB: X /* blue = RemoveGList(ColorWindow, X &ColorTemplateGadgets[COLOR_BLUE], 3L); */ X red = RemoveGadget(ColorWindow, &ColorTemplateGadgets[COLOR_RED]); X green = RemoveGadget(ColorWindow,&ColorTemplateGadgets[COLOR_GREEN]); X blue = RemoveGadget(ColorWindow, &ColorTemplateGadgets[COLOR_BLUE]); X if (gadget->Flags & SELECTED) { /* We want Rainbow Mode */ X RainbowMode = TRUE; X ColorTemplateGadgets[COLOR_COPY].GadgetText = &LessMoreText; X ColorTemplateGadgets[COLOR_RANGE].GadgetText = &MoreLessText; X RRMax = -4; /* Force color updating */ X SetColorProps(); X ModifyColors(); X } else { /* We want our normal RGB mode back */ X RainbowMode = FALSE; X ColorTemplateGadgets[COLOR_COPY].GadgetText = X &ColorClusterText[0]; X ColorTemplateGadgets[COLOR_RANGE].GadgetText = X &ColorClusterText[1]; X SetColorProps(); X } X /* AddGList(ColorWindow, &ColorTemplateGadgets[COLOR_BLUE], X (LONG) blue, 3L, NULL); */ X AddGadget(ColorWindow, &ColorTemplateGadgets[COLOR_BLUE], X (LONG) blue); X AddGadget(ColorWindow, &ColorTemplateGadgets[COLOR_GREEN], X (LONG) green); X AddGadget(ColorWindow, &ColorTemplateGadgets[COLOR_RED], X (LONG) red); X RefreshGadgets(&ColorTemplateGadgets[COLOR_GADGETS_COUNT - 1], X ColorWindow); X break; X X } X return TRUE; X} X XSHORT mod(a,b) XSHORT a,b; X{ X if (a < 0) return a+b; X if (a >= b) return a-b; X return a; X} X XModifyColors() X{ X ULONG newred, newgreen, newblue; X X newred = ((struct PropInfo *) X ColorTemplateGadgets[COLOR_RED].SpecialInfo)->HorizPot; X newgreen = ((struct PropInfo *) X ColorTemplateGadgets[COLOR_GREEN].SpecialInfo)->HorizPot; X newblue = ((struct PropInfo *) X ColorTemplateGadgets[COLOR_BLUE].SpecialInfo)->HorizPot; X X if (RainbowMode) { X USHORT NewPalette[MAXCOL]; X SHORT i; X SHORT distance; X X for (i=0; i<MAXCOL; i++) NewPalette[i] = 0; X NewPalette[0] = GetRGB4(vp->ColorMap, 0L); X RainbowRMax = (newred * MaxColor + ONE_HALF) >> 16; X RainbowGMax = (newgreen * MaxColor + ONE_HALF) >> 16; X RainbowBMax = (newblue * MaxColor + ONE_HALF) >> 16; X X if (RainbowRMax == RRMax && RainbowGMax == RGMax && X RainbowBMax == RBMax) return; X X#ifdef DEBUG2 X fprintf(stderr, "ModifyColors: d/r/g/b = %d %d %d %d\n", X RainbowDistance, X RainbowRMax, X RainbowGMax, X RainbowBMax); X#endif X X RRMax = RainbowRMax; X RGMax = RainbowGMax; X RBMax = RainbowBMax; X X for (distance=0; distance < RainbowDistance; distance++) { X i = 15 - (16.0 * ((float) distance / RainbowDistance)) + 0.5; X /* i = 15 - ((distance<<16)/RainbowDistance + (1<<11)) >> 12; */ X if (i < 0) i = 0; X X NewPalette[1 + mod(RainbowBMax + distance, MaxColor)] |= i; X NewPalette[1 + mod(RainbowBMax - distance, MaxColor)] |= i; X i <<= 4; X NewPalette[1 + mod(RainbowGMax + distance, MaxColor)] |= i; X NewPalette[1 + mod(RainbowGMax - distance, MaxColor)] |= i; X i <<= 4; X NewPalette[1 + mod(RainbowRMax + distance, MaxColor)] |= i; X NewPalette[1 + mod(RainbowRMax - distance, MaxColor)] |= i; X } X X LoadRGB4(vp, &NewPalette[0], MaxColor + 1L); X } else { /* Normal RGB mode */ X SetRGB4(vp, (ULONG) CurrentColor, newred >> 12, newgreen >> 12, X newblue >> 12); X } X} X X X XSTATIC DrawColorWindow() X{ X struct RastPort *RPort; X X RPort = ColorWindow->RPort; X X ColorRectFill(RPort, CurrentColor); X SetAPen(RPort, 1L); X SetDrMd(RPort, JAM1); X X /* Border around ColorBox */ X RectDraw(RPort, (SHORT) (COLOR_BOX_LEFT-2), (SHORT) (COLOR_BOX_TOP-2), X (SHORT) (COLOR_BOX_RIGHT+2), (SHORT) (COLOR_BOX_BOTTOM+2)); X /* Border around ColorTemplateGadgets */ X RectDraw(RPort, (SHORT) (COLOR_BOX_LEFT-2), (SHORT) (COLOR_COLOR_TOP-2), X (SHORT) (COLOR_BOX_LEFT+((MIN(MaxColor+1,8)*COLOR_COLOR_WIDTH)+1)), X (SHORT) (COLOR_COLOR_TOP+(((MaxColor+8)/8)*COLOR_COLOR_HEIGHT)+1)); X} X X X XSTATIC SetColorProps() X{ X ULONG rgb, red, green, blue; X X if (RainbowMode) { X red = ((ULONG) RainbowRMax << 16) / MaxColor; X green = ((ULONG) RainbowGMax << 16) / MaxColor; X blue = ((ULONG) RainbowBMax << 16) / MaxColor; X } else { X rgb = GetRGB4(vp->ColorMap, (ULONG) CurrentColor); X red = (rgb & 0xF00) << 4 | (rgb & 0xF00) << 0; X green = (rgb & 0x0F0) << 8 | (rgb & 0x0F0) << 4; X blue = (rgb & 0x00F) << 12 | (rgb & 0x00F) << 8; X } X X ((struct PropInfo *)ColorTemplateGadgets[COLOR_RED] X .SpecialInfo)->HorizPot X = red; X ((struct PropInfo *)ColorTemplateGadgets[COLOR_GREEN] X .SpecialInfo)->HorizPot X = green; X ((struct PropInfo *)ColorTemplateGadgets[COLOR_BLUE] X .SpecialInfo)->HorizPot X = blue; X} X X XSTATIC ColorRectFill(RPort, pen) Xstruct RastPort *RPort; XSHORT pen; X{ X SetAPen(RPort, (ULONG) pen); X SetDrMd(RPort, (ULONG) JAM2); X WaitBOVP(vp); X RectFill(RPort, (ULONG) COLOR_BOX_LEFT, (ULONG) COLOR_BOX_TOP, X (ULONG) COLOR_BOX_RIGHT, (ULONG) COLOR_BOX_BOTTOM); X} X X#ifdef notdef X Xvoid Palette(w) /* DoColorWindow() */ Xstruct Window *w; X{ X struct IntuiMessage *message; X ULONG class; X struct Gadget *gadget; X X if (NOT OpenColorWindow(w)) return; X X FOREVER { X Wait( 1L << ColorWindow->UserPort->mp_SigBit ); X while (message = (struct IntuiMessage *) X GetMsg(ColorWindow->UserPort)) { X class = message->Class; X gadget = (struct Gadget *)(message->IAddress); X ReplyMsg(message); X X switch (class) { X case GADGETDOWN: X case GADGETUP: X if (ColorGadgetGotten(gadget) == FALSE) return; X break; X case MOUSEMOVE: X ModifyColors(); X break; X } X } X } X} X X#else X Xvoid HandleColorWindow(message) Xstruct IntuiMessage *message; X{ X ULONG class; X struct Gadget *gadget; X X class = message->Class; X gadget = (struct Gadget *)(message->IAddress); X ReplyMsg(message); X X if (ColorWindow == NULL) X return; X X switch (class) { X case GADGETDOWN: X case GADGETUP: X if (ColorGadgetGotten(gadget) == FALSE) return; X break; X case MOUSEMOVE: X ModifyColors(); X break; X } X} X X#endif X XSTATIC InitSuperColors() X{ X SHORT i; X X /* OK, initialize those Super Color Gadgets! */ X for (i = 0; i < MAXCOL; i++) X { X SuperColorImages[i].LeftEdge = 0; X SuperColorImages[i].TopEdge = 0; X SuperColorImages[i].Width = COLOR_COLOR_WIDTH; X SuperColorImages[i].Height = 10; X SuperColorImages[i].Depth = 0; X SuperColorImages[i].ImageData = NULL; X SuperColorImages[i].PlanePick = 0; X SuperColorImages[i].PlaneOnOff = i; X SuperColorImages[i].NextImage = NULL; X } X} SHAR_EOF echo "extracting Select.blk" sed 's/^X//' << \SHAR_EOF > Select.blk X/* X * Select requester structure described in blk 2.0. X */ X X#define hbox(color, space, contents) \ X (h (| 1 color) (v (- 1 color) (b 0 space) (h (b space 0) \ X contents \ X (b space 0)) (b 0 space) (- 1 color) ) (| 1 color)) X X#define tighthbox(color, contents) \ X (h f (| 1 color) (v (- 1 color) \ X (h contents) \ X (- 1 color)) (| 1 color) f ) X X#define stringgad(num) \ X (h (t" 11") (b 10 0) (t"----"):num) X X Xselect 3 2 1 X X(v X (b 0 8) X (h f (b 10 0) (t"Select pen numbers per depth") f (b 10 0) ) X (b 0 10) X (h X (b 10 0) X hbox(0, 3, X (v X stringgad(10) (b 0 2) X stringgad(11) (b 0 2) X stringgad(12) (b 0 2) X stringgad(13) (b 0 2) X stringgad(14) (b 0 2) X stringgad(15) (b 0 2) X stringgad(16) (b 0 2) X stringgad(17) (b 0 2) X stringgad(18) (b 0 2) X stringgad(19) X ) X ) X (b 10 0) X hbox(0, 3, X (v X stringgad(20) (b 0 2) X stringgad(21) (b 0 2) X stringgad(22) (b 0 2) X stringgad(23) (b 0 2) X stringgad(24) (b 0 2) X stringgad(25) (b 0 2) X stringgad(26) (b 0 2) X stringgad(27) (b 0 2) X stringgad(28) (b 0 2) X stringgad(29) X ) X ) X (b 8 0) X (v X (h f X hbox(3, 1, hbox(0, 1, (b 12 68):1 )) X f X ) X f X hbox(3, 1, hbox(0, 2, (t" OK ")):3 ) X ) X (b 10 0) X f X ) X (b 0 8) X) X X1 pv ,0 2700 :"PROPGADGETID" "v" X3 :"POSGADGETID" "ve" X X10 s :"VALUEGADGETID+ 0" "vl" X11 s :"VALUEGADGETID+ 1" "vl" X12 s :"VALUEGADGETID+ 2" "vl" X13 s :"VALUEGADGETID+ 3" "vl" X14 s :"VALUEGADGETID+ 4" "vl" X15 s :"VALUEGADGETID+ 5" "vl" X16 s :"VALUEGADGETID+ 6" "vl" X17 s :"VALUEGADGETID+ 7" "vl" X18 s :"VALUEGADGETID+ 8" "vl" X19 s :"VALUEGADGETID+ 9" "vl" X20 s :"VALUEGADGETID+10" "vl" X21 s :"VALUEGADGETID+11" "vl" X22 s :"VALUEGADGETID+12" "vl" X23 s :"VALUEGADGETID+13" "vl" X24 s :"VALUEGADGETID+14" "vl" X25 s :"VALUEGADGETID+15" "vl" X26 s :"VALUEGADGETID+16" "vl" X27 s :"VALUEGADGETID+17" "vl" X28 s :"VALUEGADGETID+18" "vl" X29 s :"VALUEGADGETID+19" "vl" SHAR_EOF echo "extracting Select.c" sed 's/^X//' << \SHAR_EOF > Select.c X/* X * M A N D E L B R O T C O N S T R U C T I O N S E T X * X * (C) Copyright 1989 by Olaf Seibert. X * Mandel may be freely distributed. See file 'doc/Notice' for details. X * X * Select() requester, as generated by blk 2.0 (by Stuart Ferguson). X * Necessary changes to the generated file: X * - delete definition of select_nbuf[][] X */ X X#include <exec/types.h> X#include <intuition/intuition.h> X#include "mandel.h" X#ifdef DEBUG X# include <stdio.h> X# undef STATIC X# define STATIC /* EMPTY */ X#endif X X#define NUMCHR 5 X X/*extern UBYTE Buffer[5][20]; /* We want to re-use it for the X * string gadgets here. X */ Xextern UBYTE Buffer[20][5]; XUBYTE undo[NUMCHR]; X#define select_nbuf Buffer X X#define ta Topaz80 X#define ITXT_BPEN REQ_BF X#define ITXT_DRMD JAM2 X#define BRD_DRMD JAM1 X#define REQ_LE 0 X#define REQ_TE 0 X#define REQ_FLG 0 X#define REQ_BF 1 X X#define PROPGADGETID (NEGGADGETID+3) X#define VALUEGADGETID (NEGGADGETID+10) X X#include "select.req" X X#define FIRST_STRGAD 0 X#define FIRST_SINFO 0 X#define FIRST_ITEXT 1 X#define NUMVALUES 20 X#define MAXVAL (MAXDEPTH - NUMVALUES) X Xvoid fillin(from, window) Xregister int from; Xregister struct Window *window; X{ X register int to = from+20; X register int i; X X if (window) { X RemoveGList(window, &select_gad[FIRST_STRGAD], 20L); X } X X for (i = 0; from < to; from++, i++) { X sprintf(select_txt[FIRST_ITEXT+i].IText, "%4d", from); X sprintf(select_sinfo[FIRST_SINFO+i].Buffer, "%d", (int)PenTable[from]); X select_sinfo[FIRST_SINFO+i].LongInt = PenTable[from]; X } X X if (window) { X AddGList(window, &select_gad[FIRST_STRGAD], 0L, 20L, &select_req); X RefreshGList(&select_gad[FIRST_STRGAD], window, &select_req, 20L); X PrintIText(select_req.ReqLayer->rp, &select_txt[FIRST_ITEXT], 0L, 0L); X } X} X Xvoid Select() X{ X register int ID; X register int base; X register struct Window *window = NULL; X int value; X X base = (select_pinfo[0].VertPot * (long) MAXVAL + 0x8000) >> 16; X fillin(base, NULL); X select_pinfo[0].VertBody = (MAXBODY * NUMVALUES) / (5*MAXVAL/4); X X window = MyRequest(&select_req, MainWindow); X X do { X ID = WaitMyRequest(window); X switch(ID) { X case POSGADGETID: /* OK */ X break; X case PROPGADGETID: X base = (select_pinfo[0].VertPot * (long) MAXVAL + 0x8000) >> 16; X fillin(base, window); X break; X default: /* some value */ X ID -= VALUEGADGETID; X value = select_sinfo[FIRST_SINFO+ID].LongInt; X if (value >= 0 && value < NumColors) X PenTable[base + ID] = value; X else X DisplayBeep(MandelScreen); X } X } while (ID != POSGADGETID); X X EndMyRequest(&select_req, window, MainWindow); X} SHAR_EOF echo "extracting Select.req" sed 's/^X//' << \SHAR_EOF > Select.req X#ifndef BRD_DRMD X# define BRD_DRMD JAM1 X#endif X X#ifndef ITXT_BPEN X# define ITXT_BPEN 0 X#endif X X#ifndef ITXT_DRMD X# define ITXT_DRMD JAM1 X#endif X X#ifndef REQ_LE X# define REQ_LE 0 X#endif X X#ifndef REQ_TE X# define REQ_TE 0 X#endif X X#ifndef REQ_FLG X# define REQ_FLG 0 X#endif X Xstatic struct StringInfo select_sinfo[] = { X {&select_nbuf[0][0],undo,0,NUMCHR,0}, X {&select_nbuf[1][0],undo,0,NUMCHR,0}, X {&select_nbuf[2][0],undo,0,NUMCHR,0}, X {&select_nbuf[3][0],undo,0,NUMCHR,0}, X {&select_nbuf[4][0],undo,0,NUMCHR,0}, X {&select_nbuf[5][0],undo,0,NUMCHR,0}, X {&select_nbuf[6][0],undo,0,NUMCHR,0}, X {&select_nbuf[7][0],undo,0,NUMCHR,0}, X {&select_nbuf[8][0],undo,0,NUMCHR,0}, X {&select_nbuf[9][0],undo,0,NUMCHR,0}, X {&select_nbuf[10][0],undo,0,NUMCHR,0}, X {&select_nbuf[11][0],undo,0,NUMCHR,0}, X {&select_nbuf[12][0],undo,0,NUMCHR,0}, X {&select_nbuf[13][0],undo,0,NUMCHR,0}, X {&select_nbuf[14][0],undo,0,NUMCHR,0}, X {&select_nbuf[15][0],undo,0,NUMCHR,0}, X {&select_nbuf[16][0],undo,0,NUMCHR,0}, X {&select_nbuf[17][0],undo,0,NUMCHR,0}, X {&select_nbuf[18][0],undo,0,NUMCHR,0}, X {&select_nbuf[19][0],undo,0,NUMCHR,0} X}; X Xstatic struct Image select_pimg[1]; X Xstatic struct PropInfo select_pinfo[] = { X {13,32768,0,32768,2700} X}; X Xstatic struct Gadget select_gad[] = { X {&select_gad[1],56,30,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[0],VALUEGADGETID+ 0}, X {&select_gad[2],56,40,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[1],VALUEGADGETID+ 1}, X {&select_gad[3],56,50,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[2],VALUEGADGETID+ 2}, X {&select_gad[4],56,60,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[3],VALUEGADGETID+ 3}, X {&select_gad[5],56,70,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[4],VALUEGADGETID+ 4}, X {&select_gad[6],56,80,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[5],VALUEGADGETID+ 5}, X {&select_gad[7],56,90,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[6],VALUEGADGETID+ 6}, X {&select_gad[8],56,100,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[7],VALUEGADGETID+ 7}, X {&select_gad[9],56,110,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[8],VALUEGADGETID+ 8}, X {&select_gad[10],56,120,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[9],VALUEGADGETID+ 9}, X {&select_gad[11],148,30,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[10],VALUEGADGETID+10}, X {&select_gad[12],148,40,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[11],VALUEGADGETID+11}, X {&select_gad[13],148,50,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[12],VALUEGADGETID+12}, X {&select_gad[14],148,60,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[13],VALUEGADGETID+13}, X {&select_gad[15],148,70,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[14],VALUEGADGETID+14}, X {&select_gad[16],148,80,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[15],VALUEGADGETID+15}, X {&select_gad[17],148,90,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[16],VALUEGADGETID+16}, X {&select_gad[18],148,100,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[17],VALUEGADGETID+17}, X {&select_gad[19],148,110,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[18],VALUEGADGETID+18}, X {&select_gad[20],148,120,32,8,0,2049,4100,NULL, X NULL,NULL,0,(APTR)&select_sinfo[19],VALUEGADGETID+19}, X {&select_gad[21],207,30,12,68,0,1,4099,(APTR)&select_pimg[0], X NULL,NULL,0,(APTR)&select_pinfo[0],PROPGADGETID}, X {NULL,194,116,38,14,0,5,4097,NULL, X NULL,NULL,0,(APTR)NULL,POSGADGETID} X}; X Xstatic struct IntuiText select_txt[] = { X {2,ITXT_BPEN,ITXT_DRMD,10,8,&ta,(UBYTE*)"Select pen numbers per depth",&select_txt[1]}, X {2,ITXT_BPEN,ITXT_DRMD,14,30,&ta,(UBYTE*)" 11",&select_txt[2]}, X {2,ITXT_BPEN,ITXT_DRMD,14,40,&ta,(UBYTE*)" 11",&select_txt[3]}, X {2,ITXT_BPEN,ITXT_DRMD,14,50,&ta,(UBYTE*)" 11",&select_txt[4]}, X {2,ITXT_BPEN,ITXT_DRMD,14,60,&ta,(UBYTE*)" 11",&select_txt[5]}, X {2,ITXT_BPEN,ITXT_DRMD,14,70,&ta,(UBYTE*)" 11",&select_txt[6]}, X {2,ITXT_BPEN,ITXT_DRMD,14,80,&ta,(UBYTE*)" 11",&select_txt[7]}, X {2,ITXT_BPEN,ITXT_DRMD,14,90,&ta,(UBYTE*)" 11",&select_txt[8]}, X {2,ITXT_BPEN,ITXT_DRMD,14,100,&ta,(UBYTE*)" 11",&select_txt[9]}, X {2,ITXT_BPEN,ITXT_DRMD,14,110,&ta,(UBYTE*)" 11",&select_txt[10]}, X {2,ITXT_BPEN,ITXT_DRMD,14,120,&ta,(UBYTE*)" 11",&select_txt[11]}, X {2,ITXT_BPEN,ITXT_DRMD,106,30,&ta,(UBYTE*)" 11",&select_txt[12]}, X {2,ITXT_BPEN,ITXT_DRMD,106,40,&ta,(UBYTE*)" 11",&select_txt[13]}, X {2,ITXT_BPEN,ITXT_DRMD,106,50,&ta,(UBYTE*)" 11",&select_txt[14]}, X {2,ITXT_BPEN,ITXT_DRMD,106,60,&ta,(UBYTE*)" 11",&select_txt[15]}, X {2,ITXT_BPEN,ITXT_DRMD,106,70,&ta,(UBYTE*)" 11",&select_txt[16]}, X {2,ITXT_BPEN,ITXT_DRMD,106,80,&ta,(UBYTE*)" 11",&select_txt[17]}, X {2,ITXT_BPEN,ITXT_DRMD,106,90,&ta,(UBYTE*)" 11",&select_txt[18]}, X {2,ITXT_BPEN,ITXT_DRMD,106,100,&ta,(UBYTE*)" 11",&select_txt[19]}, X {2,ITXT_BPEN,ITXT_DRMD,106,110,&ta,(UBYTE*)" 11",&select_txt[20]}, X {2,ITXT_BPEN,ITXT_DRMD,106,120,&ta,(UBYTE*)" 11",&select_txt[21]}, X {2,ITXT_BPEN,ITXT_DRMD,197,119,&ta,(UBYTE*)" OK ",NULL}, X}; X Xstatic short select_brd_XY[] = { X 193,131, 233,131, 233,114, 192,114, 192,131, X 195,129, 231,129, 231,116, 194,116, 194,129, X 204,101, 222,101, 222,26, 203,26, 203,101, X 206,99, 220,99, 220,28, 205,28, 205,99, X 103,131, 183,131, 183,26, 102,26, 102,131, X 11,131, 91,131, 91,26, 10,26, 10,131 X}; X Xstatic struct Border select_brd[] = { X {0,0,3,0,BRD_DRMD,5,&select_brd_XY[0],&select_brd[1]}, X {0,0,0,0,BRD_DRMD,5,&select_brd_XY[10],&select_brd[2]}, X {0,0,3,0,BRD_DRMD,5,&select_brd_XY[20],&select_brd[3]}, X {0,0,0,0,BRD_DRMD,5,&select_brd_XY[30],&select_brd[4]}, X {0,0,0,0,BRD_DRMD,5,&select_brd_XY[40],&select_brd[5]}, X {0,0,0,0,BRD_DRMD,5,&select_brd_XY[50],NULL} X}; X Xstatic struct Requester select_req = { X NULL,REQ_LE,REQ_TE,244,140,0,0,select_gad,select_brd,select_txt,REQ_FLG,1, X NULL,{NULL},NULL,NULL,{NULL} X}; SHAR_EOF echo "extracting minrexx.h" sed 's/^X//' << \SHAR_EOF > minrexx.h X/* X * Includes for minrexx.c; please refer to that file for X * further documentation. X */ X#include "rexx/rxslib.h" X/* X * This is the list of functions we can access. (Cheap forward X * declarations, too.) X */ Xlong upRexxPort() ; Xvoid dnRexxPort() ; Xvoid dispRexxPort() ; Xstruct RexxMsg *sendRexxCmd() ; Xstruct RexxMsg *syncRexxCmd() ; Xstruct RexxMsg *asyncRexxCmd() ; Xvoid replyRexxCmd() ; X/* X * Maximum messages that can be pending, and the return codes X * for two bad situations. X */ X#define MAXRXOUTSTANDING (300) X#define RXERRORIMGONE (100) X#define RXERRORNOCMD (30) X/* X * This is the association list you build up (statically or X * dynamically) that should be terminated with an entry with X * NULL for the name . . . X */ Xstruct rexxCommandList { X char *name ; X APTR userdata ; X} ; SHAR_EOF echo "End of archive 4 (of 4)" # if you want to concatenate archives, remove anything after this line exit