1 /*
2  *  Include file for Xtacy
3  *
4  */
5 
6 struct particle
7 {
8   double x,y;
9   double vx,vy;
10   int mass;
11   int color;
12 };
13 
14 
15 typedef enum {kaleid,boxes,bozo,test,circ,wandering,qix,qix4,clover,tunnel,plasma,rose,spiral,gravity,off,spheres,funky,ripple,life,xstatic,maxh,fields,starback,mixer,cells,taffy,bez,swarm,dogplasma,blob,rot_shape,cube,tet,oct,waves,radial,fracrect,tag,sunrise,dline,dcurve,lunch,flush,blur,lightning,newton,mandel,julia,munch,sunflower} modes;
16 
17 #define MIR_VERT 0x1
18 #define MIR_HORIZ 0x2
19 
20 #if defined (__cplusplus) || defined (c_plusplus)
21 extern "C" {
22 #endif
23 
24 XPoint *wrecked(int,int,int,int);
25 XPoint *make_tri (int,int,int,int,int,int);
26 XPoint *make_circle(int,int,int,int);
27 XPoint *Bezier(XPoint*, int);
28 
29 unsigned long StrColor(char *,unsigned long);
30 void parse_options(int,char**);
31 void bounce(int);
32 void draw_lines(int);
33 void draw_bozo(int);
34 void draw_boxes(int);
35 void draw_qix(int);
36 void draw_circ(int);
37 void draw_kaleid(int);
38 void draw_test(int);
39 void draw_off(int);
40 void draw_static(int);
41 void draw_sphere(int);
42 void draw_clover(int);
43 void draw_rose(int);
44 void draw_plasma(int);
45 void twiddle_plasma(int,int,int,int,int);
46 
47 void draw_sunrise(int);
48 void draw_spiral(int);
49 void draw_max(int);
50 int draw_gravity(int);
51 void init_gravity(int);
52 void set_part(int,int,int,struct particle*);
53 void init_field(int);
54 void draw_field(int);
55 void fill_tris(int);
56 void fill_rects(int);
57 void fill_circles(int);
58 void init_frame(int);
59 void move_frame(int);
60 void draw_tunnel(int);
61 void draw_mandel(int,int,int,int,int);
62 void draw_julia(int,double,double);
63 void draw_newton(int);
64 void draw_ripple(int);
65 void rotate_colors();
66 void randomize_colors();
67 int randomize_color();
68 void get_them_colors();
69 void wander(int,int *,int *);
70 void draw_funky(int);
71 void randomize_kal(int);
72 void usage();
73 /* void EndofTunnel(); */
74 void initTables();
75 void makeBlankCursor();
76 int init_kaleid(int);
77 void initBlob(int);
78 void getALife(int);
79 void init_galaxy(int);
80 void init_swarm(int);
81 void init_playground(int);
82 /* void draw_xload(int); */
83 void moveBlob(int);
84 void rotate_shape(int);
85 void lightning_strike(int);
86 void de_strike(int);
87 void drawLife(int);
88 void draw_stars(int);
89 void draw_playground(int);
90 void draw_swarm(int);
91 void setup_windows();
92 void draw_fracrect(int,int,int,int,int,int,int);
93 void draw_taffymaker(int);
94 void draw_mixer(int);
95 void draw_cells(int);
96 void draw_dogplasma(int);
97 void draw_bez(int);
98 void draw_qix4(int);
99 void moveQueen(int,long,long);
100 void moveIt(int,long,long);
101 void dropACell(int,int,int);
102 void init_rose(void);
103   XPoint* mirror(int, int,  int, int, int);
104   void init_munch(int);
105   void init_flush(int);
106   void init_blur(int);
107   void draw_munch(int,int);
108   void draw_flush(int);
109   void draw_blur(int);
110   void draw_lunch(int,int*);
111   void draw_sunflower(int);
112   void draw_dline(int);
113   void draw_dcurve(int);
114   void exit_blur();
115   void exit_flush();
116   void blobAddFood(int,int,int);
117   void make_white(int);
118 
119 #if 0
120 void init_oscill(int);
121 void draw_oscill(int);
122 #endif
123 void handle_event(XEvent *);
124 
125 void exit_blob();
126 void exit_fields();
127 void exit_frame(int winno);
128 void exit_bozo(int winno);
129 void exit_circ(int winno);
130 void exit_qix(int winno);
131 void exit_qix4(int winno);
132 void exit_bez(int winno);
133 void exit_gravity();
134 void exit_kaleid();
135 void exit_life();
136 void exit_lightning();
137 void exit_oscill(int winno);
138 void exit_lunch()	/* HUWAARRRF! */;
139 void exit_plasma();
140 void exit_dogplasma();
141 void exit_fracrect();
142 void exit_spiral();
143 void exit_mandel();
144 void exit_julia();
145 void exit_newton();
146 void exit_wandering();
147 void exit_funky();
148 void exit_ripple();
149 void exit_xstatic();
150 void exit_mixer();
151 void exit_cells();
152 void exit_dcurve();
153 void exit_dline();
154 void exit_sunrise();
155 void exit_taffy();
156 void exit_tunnel();
157 void exit_clover();
158 void exit_test();
159 void exit_sphere();
160 void exit_off();
161 void exit_munch();
162 void exit_munch();
163 void exit_rose();
164 void exit_maxh();
165 void exit_cube();
166 void exit_oct();
167 void exit_tet();
168 void exit_shape();
169 void exit_maxh();
170 void exit_cube();
171 void exit_oct();
172 void exit_tet();
173 void exit_shape();
174 void exit_starback();
175 void exit_swarm();
176 void exit_playground(int winno);
177 void exit_tag();
178 void exit_waves();
179 void exit_radial();
180 void exit_xload();
181 #define NCOLORS 258
182 #ifdef SYSV
183 #define rndm(x) (rand()%(x?x:1))
184 #define srndm(x) (srand(x))
185 #else
186 #define rndm(x) (random()%(x?x:1))
187 #define srndm(x) (srandom(x))
188 #endif
189 #define max(x,y) ((x>y)?x:y)
190 #define min(x,y) ((x<y)?x:y)
191 
192 Display *display;
193 Screen *scr;
194 
195 int screen;
196 int nwindows, nvisible;
197 int *visible;
198 Window *window;
199 Colormap colmap; /* One map to bind them... */
200 unsigned int *CX, *CY, *M, *HC;
201 
202 int numcolors;
203 int share_colors;
204 GC *color_gcs;
205 long** colors; /* [NCOLORS][3]; */
206 double SinTbl[32];
207 extern Cursor mycursor ;
208 
209 char *progname;
210 
211 #if defined (__cplusplus) || defined (c_plusplus)
212 }
213 #endif
214 
215 /* opt1 is a catch-all 2nd option number */
216 #define numparts opt1
217 #define trell opt1
218 #define norect opt1
219 
220 struct foo
221 {
222   unsigned long bgcolor;
223   unsigned long bdcolor;
224   int palette; /* wheee! different palettes */
225   int bwidth;  /* border width */
226   int number;  /* number of whatevers */
227   int opt1;    /* secondary option thingy */
228   float delayvalue;
229   int noclear;
230   int annoy_tefler;
231   int doroot;
232   int mono;
233   int multi;
234   int dynamic_colors;
235   int totalrand;
236   int tryfor;
237   int perfect;
238   int inqPassword; /* inquire password instead of getting it from system */
239   int allowroot; /* allowroot password as well (when inqPassword is 0) */
240   int debug;
241   int lock;  /* Lock the Display */
242   int rillybig;
243   int windows;
244   int mirrors;
245   int maxcycles;
246   modes mode;
247   long win;
248   char *displayname;
249   char *geomstring;
250   char *background;
251   char *border;
252   char *boxc;
253   char *palette_filename;
254 #ifdef JPEG_SUPPORT
255   char *loadfile;
256 #endif
257 };
258 
259 extern struct foo options;
260 
261