fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fl_symbols.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Symbol drawing code for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 // These are small graphics drawn by the normal label-drawing
20 // code when the string starts with an '@' sign.
21 
22 // Adapted from original code written by:
23 
24 // Written by Mark Overmars
25 // Version 2.1 a
26 // Date: Oct 2, 1992
27 
28 #include <FL/Fl.H>
29 #include <FL/fl_draw.H>
30 #include <FL/math.h>
31 #include "flstring.h"
32 
33 typedef struct {
34  const char *name;
35  void (*drawit)(Fl_Color);
36  char scalable;
37  char notempty;
38 } SYMBOL;
39 
40 #define MAXSYMBOL 211
41  /* Maximal number of symbols in table. Only half of them are
42  used. Should be prime. */
43 
44 static SYMBOL symbols[MAXSYMBOL]; /* The symbols */
45 static int symbnumb = -1; /* Their number */
46 
47 static int find(const char *name) {
48 // returns hash entry if it exists, or first empty slot:
49  int pos = name[0] ? (
50  name[1] ? (
51  name[2] ? 71*name[0]+31*name[1]+name[2] : 31*name[0]+name[1]
52  ) :
53  name[0]
54  ) : 0;
55  pos %= MAXSYMBOL;
56  int hh2 = name[0] ? (
57  (name[1]) ? 51*name[0]+3*name[1] : 3*name[0]
58  ) : 1;
59  hh2 %= MAXSYMBOL; if (!hh2) hh2 = 1;
60  for (;;) {
61  if (!symbols[pos].notempty) return pos;
62  if (!strcmp(symbols[pos].name,name)) return pos;
63  pos = (pos + hh2) % MAXSYMBOL;
64  }
65 }
66 
67 static void fl_init_symbols(void);
68 
69 /**************** The routines seen by the user *************************/
70 
78 int fl_add_symbol(const char *name, void (*drawit)(Fl_Color), int scalable)
79 {
81  int pos;
82  if (symbnumb > MAXSYMBOL / 2) return 0; // table is full
83  pos = find(name);
84  symbols[pos].name = name;
85  symbols[pos].drawit = drawit;
86  symbols[pos].notempty = 1;
87  symbols[pos].scalable = scalable;
88  symbnumb++;
89  return 1;
90 }
91 
92 int fl_return_arrow(int x,int y,int w,int h);
93 
102 // provided for back compatibility:
103 int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) {
104  const char *p = label;
105  if (*p++ != '@') return 0;
106  fl_init_symbols();
107  int equalscale = 0;
108  if (*p == '#') {equalscale = 1; p++;}
109  if (*p == '-' && p[1]>='1' && p[1]<='9') {
110  int n = p[1]-'0';
111  x += n; y += n; w -= 2*n; h -= 2*n;
112  p += 2;
113  } else if (*p == '+' && p[1]>='1' && p[1]<='9') {
114  int n = p[1]-'0';
115  x -= n; y -= n; w += 2*n; h += 2*n;
116  p += 2;
117  }
118  if (w < 10) {x -= (10-w)/2; w = 10;}
119  if (h < 10) {y -= (10-h)/2; h = 10;}
120  w = (w-1)|1; h = (h-1)|1;
121  char flip_x = 0, flip_y = 0;
122  if (*p=='$') {
123  flip_x = 1;
124  p++;
125  }
126  if (*p=='%') {
127  flip_y = 1;
128  p++;
129  }
130  int rotangle;
131  switch (*p++) {
132  case '0':
133  rotangle = 1000*(p[1]-'0') + 100*(p[2]-'0') + 10*(p[3]-'0');
134  p += 4;
135  break;
136  case '1': rotangle = 2250; break;
137  case '2': rotangle = 2700; break;
138  case '3': rotangle = 3150; break;
139  case '4': rotangle = 1800; break;
140  case '5':
141  case '6': rotangle = 0; break;
142  case '7': rotangle = 1350; break;
143  case '8': rotangle = 900; break;
144  case '9': rotangle = 450; break;
145  default: rotangle = 0; p--; break;
146  }
147  int pos = find(p);
148  if (!symbols[pos].notempty) return 0;
149  if (symbols[pos].scalable == 3) { // kludge to detect return arrow
150  fl_return_arrow(x,y,w,h);
151  return 1;
152  }
153  fl_push_matrix();
154  fl_translate(x+w/2,y+h/2);
155  if (symbols[pos].scalable) {
156  if (equalscale) {if (w<h) h = w; else w = h;}
157  fl_scale(0.5*w, 0.5*h);
158  fl_rotate(rotangle/10.0);
159  if (flip_x) fl_scale(-1.0, 1.0);
160  if (flip_y) fl_scale(1.0, -1.0);
161  }
162  (symbols[pos].drawit)(col);
163  fl_pop_matrix();
164  return 1;
165 }
166 
167 /******************** THE DEFAULT SYMBOLS ****************************/
168 
169 /* Some help stuff */
170 
171 #define BP fl_begin_polygon()
172 #define EP fl_end_polygon()
173 #define BCP fl_begin_complex_polygon()
174 #define ECP fl_end_complex_polygon()
175 #define BL fl_begin_line()
176 #define EL fl_end_line()
177 #define BC fl_begin_loop()
178 #define EC fl_end_loop()
179 #define vv(x,y) fl_vertex(x,y)
180 
181 //for the outline color
182 static void set_outline_color(Fl_Color c) {
183  fl_color(fl_darker(c));
184 }
185 
186 static void rectangle(double x,double y,double x2,double y2,Fl_Color col) {
187  fl_color(col);
188  BP; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EP;
189  set_outline_color(col);
190  BC; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EC;
191 }
192 
193 /* The drawing routines */
194 
195 static void draw_fltk(Fl_Color col)
196 {
197  fl_color(col);
198  // F fill
199  BCP; vv(-2.0, -0.5); vv(-1.0, -0.5); vv(-1.0, -0.3); vv(-1.8, -0.3);
200  vv(-1.8, -0.1); vv(-1.2, -0.1); vv(-1.2, 0.1); vv(-1.8, 0.1);
201  vv(-1.8, 0.5); vv(-2.0, 0.5); ECP;
202  // L fill
203  BCP; vv(-1.0, -0.5); vv(-0.8, -0.5); vv(-0.8, 0.3); vv(0.0, 0.3);
204  vv(0.0, 0.5); vv(-1.0, 0.5); ECP;
205  // T outline
206  BCP; vv(-0.1, -0.5); vv(1.1, -0.5); vv(1.1, -0.3); vv(0.6, -0.3);
207  vv(0.6, 0.5); vv(0.4, 0.5); vv(0.4, -0.3); vv(-0.1, -0.3); ECP;
208  // K outline
209  BCP; vv(1.1, -0.5); vv(1.3, -0.5); vv(1.3, -0.15); vv(1.70, -0.5);
210  vv(2.0, -0.5); vv(1.43, 0.0); vv(2.0, 0.5); vv(1.70, 0.5);
211  vv(1.3, 0.15); vv(1.3, 0.5); vv(1.1, 0.5); ECP;
212  set_outline_color(col);
213  // F outline
214  BC; vv(-2.0, -0.5); vv(-1.0, -0.5); vv(-1.0, -0.3); vv(-1.8, -0.3);
215  vv(-1.8, -0.1); vv(-1.2, -0.1); vv(-1.2, 0.1); vv(-1.8, 0.1);
216  vv(-1.8, 0.5); vv(-2.0, 0.5); EC;
217  // L outline
218  BC; vv(-1.0, -0.5); vv(-0.8, -0.5); vv(-0.8, 0.3); vv(0.0, 0.3);
219  vv(0.0, 0.5); vv(-1.0, 0.5); EC;
220  // T outline
221  BC; vv(-0.1, -0.5); vv(1.1, -0.5); vv(1.1, -0.3); vv(0.6, -0.3);
222  vv(0.6, 0.5); vv(0.4, 0.5); vv(0.4, -0.3); vv(-0.1, -0.3); EC;
223  // K outline
224  BC; vv(1.1, -0.5); vv(1.3, -0.5); vv(1.3, -0.15); vv(1.70, -0.5);
225  vv(2.0, -0.5); vv(1.43, 0.0); vv(2.0, 0.5); vv(1.70, 0.5);
226  vv(1.3, 0.15); vv(1.3, 0.5); vv(1.1, 0.5); EC;
227 }
228 
229 static void draw_search(Fl_Color col)
230 {
231  fl_color(col);
232  BP; vv(-.4, .13); vv(-1.0, .73); vv(-.73, 1.0); vv(-.13, .4); EP;
233  set_outline_color(col);
234  fl_line_style(FL_SOLID, 3, 0);
235  BC; fl_circle(.2, -.2, .6); EC;
236  fl_line_style(FL_SOLID, 1, 0);
237  BC; vv(-.4, .13); vv(-1.0, .73); vv(-.73, 1.0); vv(-.13, .4); EC;
238 }
239 
240 static void draw_arrow1(Fl_Color col)
241 {
242  fl_color(col);
243  BP; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,-0.4); EP;
244  BP; vv(0.0,0.8); vv(0.8,0.0); vv(0.0,-0.8); vv(0.0,-0.4); vv(0.0,0.4); EP;
245  set_outline_color(col);
246  BC; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,0.8); vv(0.8,0.0);
247  vv(0.0,-0.8); vv(0.0,-0.4); EC;
248 }
249 
250 static void draw_arrow1bar(Fl_Color col)
251 {
252  draw_arrow1(col);
253  rectangle(.6,-.8,.9,.8,col);
254 }
255 
256 static void draw_arrow2(Fl_Color col)
257 {
258  fl_color(col);
259  BP; vv(-0.3,0.8); vv(0.50,0.0); vv(-0.3,-0.8); EP;
260  set_outline_color(col);
261  BC; vv(-0.3,0.8); vv(0.50,0.0); vv(-0.3,-0.8); EC;
262 }
263 
264 static void draw_arrow3(Fl_Color col)
265 {
266  fl_color(col);
267  BP; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EP;
268  BP; vv(-0.7,0.8); vv(0.1,0.0); vv(-0.7,-0.8); EP;
269  set_outline_color(col);
270  BC; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EC;
271  BC; vv(-0.7,0.8); vv(0.1,0.0); vv(-0.7,-0.8); EC;
272 }
273 
274 static void draw_arrowbar(Fl_Color col)
275 {
276  fl_color(col);
277  BP; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EP;
278  BP; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EP;
279  set_outline_color(col);
280  BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC;
281  BC; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EC;
282 }
283 
284 static void draw_arrowbox(Fl_Color col)
285 {
286  fl_color(col);
287  BP; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EP;
288  BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC;
289  set_outline_color(col);
290  BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC;
291  BC; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EC;
292 }
293 
294 static void draw_bararrow(Fl_Color col)
295 {
296  fl_color(col);
297  BP; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EP;
298  BP; vv(-0.5,0.8); vv(-0.1,0.8); vv(-0.1,-0.8); vv(-0.5,-0.8); EP;
299  set_outline_color(col);
300  BC; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EC;
301  BC; vv(-0.5,0.8); vv(-0.1,0.8); vv(-0.1,-0.8); vv(-0.5,-0.8); EC;
302 }
303 
304 static void draw_doublebar(Fl_Color col) {
305  rectangle(-0.6,-0.8,-.1,.8,col);
306  rectangle(.1,-0.8,.6,.8,col);
307 }
308 
309 static void draw_arrow01(Fl_Color col)
310  { fl_rotate(180); draw_arrow1(col); }
311 
312 static void draw_arrow02(Fl_Color col)
313  { fl_rotate(180); draw_arrow2(col); }
314 
315 static void draw_arrow03(Fl_Color col)
316  { fl_rotate(180); draw_arrow3(col); }
317 
318 static void draw_0arrowbar(Fl_Color col)
319  { fl_rotate(180); draw_arrowbar(col); }
320 
321 static void draw_0arrowbox(Fl_Color col)
322  { fl_rotate(180); draw_arrowbox(col); }
323 
324 static void draw_0bararrow(Fl_Color col)
325  { fl_rotate(180); draw_bararrow(col); }
326 
327 static void draw_doublearrow(Fl_Color col)
328 {
329  fl_color(col);
330  BP; vv(-0.35,-0.4); vv(-0.35,0.4); vv(0.35,0.4); vv(0.35,-0.4); EP;
331  BP; vv(0.15,0.8); vv(0.95,0.0); vv(0.15,-0.8); EP;
332  BP; vv(-0.15,0.8); vv(-0.95,0.0); vv(-0.15,-0.8); EP;
333  set_outline_color(col);
334  BC; vv(-0.15,0.4); vv(0.15,0.4); vv(0.15,0.8); vv(0.95,0.0);
335  vv(0.15,-0.8); vv(0.15,-0.4); vv(-0.15,-0.4); vv(-0.15,-0.8);
336  vv(-0.95,0.0); vv(-0.15,0.8); EC;
337 }
338 
339 static void draw_arrow(Fl_Color col)
340 {
341  fl_color(col);
342  BP; vv(0.65,0.1); vv(1.0,0.0); vv(0.65,-0.1); EP;
343  BL; vv(-1.0,0.0); vv(0.65,0.0); EL;
344  set_outline_color(col);
345  BL; vv(-1.0,0.0); vv(0.65,0.0); EL;
346  BC; vv(0.65,0.1); vv(1.0,0.0); vv(0.65,-0.1); EC;
347 }
348 
349 static void draw_square(Fl_Color col)
350  { rectangle(-1,-1,1,1,col); }
351 
352 static void draw_circle(Fl_Color col) {
353  fl_color(col); BP; fl_circle(0,0,1); EP;
354  set_outline_color(col);
355  BC; fl_circle(0,0,1); EC;
356 }
357 
358 static void draw_line(Fl_Color col)
359  { fl_color(col); BL; vv(-1.0,0.0); vv(1.0,0.0); EL; }
360 
361 static void draw_plus(Fl_Color col)
362 {
363  fl_color(col);
364  BP; vv(-0.9,-0.15); vv(-0.9,0.15); vv(0.9,0.15); vv(0.9,-0.15); EP;
365  BP; vv(-0.15,-0.9); vv(-0.15,0.9); vv(0.15,0.9); vv(0.15,-0.9); EP;
366  set_outline_color(col);
367  BC;
368  vv(-0.9,-0.15); vv(-0.9,0.15); vv(-0.15,0.15); vv(-0.15,0.9);
369  vv(0.15,0.9); vv(0.15,0.15); vv(0.9,0.15); vv(0.9,-0.15);
370  vv(0.15,-0.15); vv(0.15,-0.9); vv(-0.15,-0.9); vv(-0.15,-0.15);
371  EC;
372 }
373 
374 static void draw_uparrow(Fl_Color) {
376  BL; vv(-.8,.8); vv(-.8,-.8); vv(.8,0); EL;
378  BL; vv(-.8,.8); vv(.8, 0); EL;
379 }
380 
381 static void draw_downarrow(Fl_Color) {
383  BL; vv(-.8,.8); vv(-.8,-.8); vv(.8,0); EL;
385  BL; vv(-.8,.8); vv(.8, 0); EL;
386 }
387 
388 static void draw_menu(Fl_Color col)
389 {
390  rectangle(-0.65, 0.85, 0.65, -0.25, col);
391  rectangle(-0.65, -0.6, 0.65, -1.0, col);
392 }
393 
394 // Standard UI icons...
395 static void draw_filenew(Fl_Color c) {
396  fl_color(c);
397  BCP;
398  vv(-0.7, -1.0);
399  vv(0.1, -1.0);
400  vv(0.1, -0.4);
401  vv(0.7, -0.4);
402  vv(0.7, 1.0);
403  vv(-0.7, 1.0);
404  ECP;
405 
406  fl_color(fl_lighter(c));
407  BP;
408  vv(0.1, -1.0);
409  vv(0.1, -0.4);
410  vv(0.7, -0.4);
411  EP;
412 
413  fl_color(fl_darker(c));
414  BC;
415  vv(-0.7, -1.0);
416  vv(0.1, -1.0);
417  vv(0.1, -0.4);
418  vv(0.7, -0.4);
419  vv(0.7, 1.0);
420  vv(-0.7, 1.0);
421  EC;
422 
423  BL;
424  vv(0.1, -1.0);
425  vv(0.7, -0.4);
426  EL;
427 }
428 
429 static void draw_fileopen(Fl_Color c) {
430  fl_color(c);
431  BP;
432  vv(-1.0, -0.7);
433  vv(-0.9, -0.8);
434  vv(-0.4, -0.8);
435  vv(-0.3, -0.7);
436  vv(0.6, -0.7);
437  vv(0.6, 0.7);
438  vv(-1.0, 0.7);
439  EP;
440 
441  fl_color(fl_darker(c));
442  BC;
443  vv(-1.0, -0.7);
444  vv(-0.9, -0.8);
445  vv(-0.4, -0.8);
446  vv(-0.3, -0.7);
447  vv(0.6, -0.7);
448  vv(0.6, 0.7);
449  vv(-1.0, 0.7);
450  EC;
451 
452  fl_color(fl_lighter(c));
453  BP;
454  vv(-1.0, 0.7);
455  vv(-0.6, -0.3);
456  vv(1.0, -0.3);
457  vv(0.6, 0.7);
458  EP;
459 
460  fl_color(fl_darker(c));
461  BC;
462  vv(-1.0, 0.7);
463  vv(-0.6, -0.3);
464  vv(1.0, -0.3);
465  vv(0.6, 0.7);
466  EC;
467 }
468 
469 static void draw_filesave(Fl_Color c) {
470  fl_color(c);
471  BP;
472  vv(-0.9, -1.0);
473  vv(0.9, -1.0);
474  vv(1.0, -0.9);
475  vv(1.0, 0.9);
476  vv(0.9, 1.0);
477  vv(-0.9, 1.0);
478  vv(-1.0, 0.9);
479  vv(-1.0, -0.9);
480  EP;
481 
482  fl_color(fl_lighter(c));
483  BP;
484  vv(-0.7, -1.0);
485  vv(0.7, -1.0);
486  vv(0.7, -0.4);
487  vv(-0.7, -0.4);
488  EP;
489 
490  BP;
491  vv(-0.7, 0.0);
492  vv(0.7, 0.0);
493  vv(0.7, 1.0);
494  vv(-0.7, 1.0);
495  EP;
496 
497  fl_color(c);
498  BP;
499  vv(-0.5, -0.9);
500  vv(-0.3, -0.9);
501  vv(-0.3, -0.5);
502  vv(-0.5, -0.5);
503  EP;
504 
505  fl_color(fl_darker(c));
506  BC;
507  vv(-0.9, -1.0);
508  vv(0.9, -1.0);
509  vv(1.0, -0.9);
510  vv(1.0, 0.9);
511  vv(0.9, 1.0);
512  vv(-0.9, 1.0);
513  vv(-1.0, 0.9);
514  vv(-1.0, -0.9);
515  EC;
516 }
517 
518 static void draw_filesaveas(Fl_Color c) {
519  draw_filesave(c);
520 
522  BP;
523  vv(0.6, -0.8);
524  vv(1.0, -0.4);
525  vv(0.0, 0.6);
526  vv(-0.4, 0.6);
527  vv(-0.4, 0.2);
528  EP;
529 
530  fl_color(fl_darker(c));
531  BC;
532  vv(0.6, -0.8);
533  vv(1.0, -0.4);
534  vv(0.0, 0.6);
535  vv(-0.4, 0.6);
536  vv(-0.4, 0.2);
537  EC;
538 
539  BP;
540  vv(-0.1, 0.6);
541  vv(-0.4, 0.6);
542  vv(-0.4, 0.3);
543  EP;
544 }
545 
546 static void draw_fileprint(Fl_Color c) {
547  fl_color(c);
548  BP;
549  vv(-0.8, 0.0);
550  vv(0.8, 0.0);
551  vv(1.0, 0.2);
552  vv(1.0, 1.0);
553  vv(-1.0, 1.0);
554  vv(-1.0, 0.2);
555  EP;
556 
558  BP;
559  vv(-0.6, 0.0);
560  vv(-0.6, -1.0);
561  vv(0.6, -1.0);
562  vv(0.6, 0.0);
563  EP;
564 
565  fl_color(fl_lighter(c));
566  BP;
567  vv(-0.6, 0.6);
568  vv(0.6, 0.6);
569  vv(0.6, 1.0);
570  vv(-0.6, 1.0);
571  EP;
572 
573  fl_color(fl_darker(c));
574  BC;
575  vv(-0.8, 0.0);
576  vv(-0.6, 0.0);
577  vv(-0.6, -1.0);
578  vv(0.6, -1.0);
579  vv(0.6, 0.0);
580  vv(0.8, 0.0);
581  vv(1.0, 0.2);
582  vv(1.0, 1.0);
583  vv(-1.0, 1.0);
584  vv(-1.0, 0.2);
585  EC;
586 
587  BC;
588  vv(-0.6, 0.6);
589  vv(0.6, 0.6);
590  vv(0.6, 1.0);
591  vv(-0.6, 1.0);
592  EC;
593 }
594 
595 static void draw_round_arrow(Fl_Color c, float da=5.0) {
596  double a, r, dr1=0.005, dr2=0.015;
597  int i, j;
598  for (j=0; j<2; j++) {
599  if (j&1) {
600  fl_color(c);
602  BC;
603  } else {
604  fl_color(c);
605  BCP;
606  }
607  vv(-0.1, 0.0);
608  vv(-1.0, 0.0);
609  vv(-1.0, 0.9);
610  for (i=27, a=140.0, r=1.0; i>0; i--, a-=da, r-=dr1) {
611  double ar = a/180.0 * M_PI;
612  vv(cos(ar)*r, sin(ar)*r);
613  }
614  for (i=27; i>=0; a+=da, i--, r-=dr2) {
615  double ar = a/180.0 * M_PI;
616  vv(cos(ar)*r, sin(ar)*r);
617  }
618  if (j&1) {
619  EC;
620  } else {
621  ECP;
622  }
623  }
624 }
625 
626 static void draw_refresh(Fl_Color c) {
627  draw_round_arrow(c);
628  fl_rotate(180.0);
629  draw_round_arrow(c);
630  fl_rotate(-180.0);
631 }
632 
633 static void draw_reload(Fl_Color c) {
634  fl_rotate(-135.0);
635  draw_round_arrow(c, 10);
636  fl_rotate(135.0);
637 }
638 
639 static void draw_undo(Fl_Color c) {
640  fl_translate(0.0, 0.2);
641  fl_scale(1.0, -1.0);
642  draw_round_arrow(c, 6);
643  fl_scale(1.0, -1.0);
644  fl_translate(0.0, -0.2);
645 }
646 
647 static void draw_redo(Fl_Color c) {
648  fl_scale(-1.0, 1.0);
649  draw_undo(c);
650  fl_scale(-1.0, 1.0);
651 }
652 
653 static void fl_init_symbols(void) {
654  static char beenhere;
655  if (beenhere) return;
656  beenhere = 1;
657  symbnumb = 0;
658 
659  fl_add_symbol("", draw_arrow1, 1);
660  fl_add_symbol("->", draw_arrow1, 1);
661  fl_add_symbol(">", draw_arrow2, 1);
662  fl_add_symbol(">>", draw_arrow3, 1);
663  fl_add_symbol(">|", draw_arrowbar, 1);
664  fl_add_symbol(">[]", draw_arrowbox, 1);
665  fl_add_symbol("|>", draw_bararrow, 1);
666  fl_add_symbol("<-", draw_arrow01, 1);
667  fl_add_symbol("<", draw_arrow02, 1);
668  fl_add_symbol("<<", draw_arrow03, 1);
669  fl_add_symbol("|<", draw_0arrowbar, 1);
670  fl_add_symbol("[]<", draw_0arrowbox, 1);
671  fl_add_symbol("<|", draw_0bararrow, 1);
672  fl_add_symbol("<->", draw_doublearrow, 1);
673  fl_add_symbol("-->", draw_arrow, 1);
674  fl_add_symbol("+", draw_plus, 1);
675  fl_add_symbol("->|", draw_arrow1bar, 1);
676  fl_add_symbol("arrow", draw_arrow, 1);
677  fl_add_symbol("returnarrow", 0, 3);
678  fl_add_symbol("square", draw_square, 1);
679  fl_add_symbol("circle", draw_circle, 1);
680  fl_add_symbol("line", draw_line, 1);
681  fl_add_symbol("plus", draw_plus, 1);
682  fl_add_symbol("menu", draw_menu, 1);
683  fl_add_symbol("UpArrow", draw_uparrow, 1);
684  fl_add_symbol("DnArrow", draw_downarrow, 1);
685  fl_add_symbol("||", draw_doublebar, 1);
686  fl_add_symbol("search", draw_search, 1);
687  fl_add_symbol("FLTK", draw_fltk, 1);
688 
689  fl_add_symbol("filenew", draw_filenew, 1);
690  fl_add_symbol("fileopen", draw_fileopen, 1);
691  fl_add_symbol("filesave", draw_filesave, 1);
692  fl_add_symbol("filesaveas", draw_filesaveas, 1);
693  fl_add_symbol("fileprint", draw_fileprint, 1);
694 
695  fl_add_symbol("refresh", draw_refresh, 1);
696  fl_add_symbol("reload", draw_reload, 1);
697  fl_add_symbol("undo", draw_undo, 1);
698  fl_add_symbol("redo", draw_redo, 1);
699 
700 // fl_add_symbol("file", draw_file, 1);
701 }
702 
703 //
704 // End of "$Id$".
705 //
BL
#define BL
Definition: fl_symbols.cxx:175
Fl.H
draw_doublebar
static void draw_doublebar(Fl_Color col)
Definition: fl_symbols.cxx:304
EL
#define EL
Definition: fl_symbols.cxx:176
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
SYMBOL::name
const char * name
Definition: fl_symbols.cxx:34
SYMBOL::notempty
char notempty
Definition: fl_symbols.cxx:37
draw_reload
static void draw_reload(Fl_Color c)
Definition: fl_symbols.cxx:633
M_PI
#define M_PI
Definition: math.h:38
FL_WHITE
const Fl_Color FL_WHITE
Definition: Enumerations.H:971
fl_rotate
void fl_rotate(double d)
Definition: fl_draw.H:350
fl_push_matrix
void fl_push_matrix()
Definition: fl_draw.H:326
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
fl_darker
Fl_Color fl_darker(Fl_Color c)
Definition: Enumerations.H:994
symbnumb
static int symbnumb
Definition: fl_symbols.cxx:45
FL_SOLID
line style: ___________
Definition: fl_draw.H:179
fl_init_symbols
static void fl_init_symbols(void)
Definition: fl_symbols.cxx:653
draw_arrow
static void draw_arrow(Fl_Color col)
Definition: fl_symbols.cxx:339
draw_menu
static void draw_menu(Fl_Color col)
Definition: fl_symbols.cxx:388
draw_downarrow
static void draw_downarrow(Fl_Color)
Definition: fl_symbols.cxx:381
draw_arrow2
static void draw_arrow2(Fl_Color col)
Definition: fl_symbols.cxx:256
draw_arrow1
static void draw_arrow1(Fl_Color col)
Definition: fl_symbols.cxx:240
draw_arrowbox
static void draw_arrowbox(Fl_Color col)
Definition: fl_symbols.cxx:284
draw_arrow02
static void draw_arrow02(Fl_Color col)
Definition: fl_symbols.cxx:312
BC
#define BC
Definition: fl_symbols.cxx:177
fl_draw_symbol
int fl_draw_symbol(const char *label, int x, int y, int w, int h, Fl_Color col)
Definition: fl_symbols.cxx:103
draw_arrow03
static void draw_arrow03(Fl_Color col)
Definition: fl_symbols.cxx:315
draw_square
static void draw_square(Fl_Color col)
Definition: fl_symbols.cxx:349
vv
#define vv(x, y)
Definition: fl_symbols.cxx:179
fl_translate
void fl_translate(double x, double y)
Definition: fl_draw.H:345
math.h
draw_arrow01
static void draw_arrow01(Fl_Color col)
Definition: fl_symbols.cxx:309
draw_filesaveas
static void draw_filesaveas(Fl_Color c)
Definition: fl_symbols.cxx:518
ECP
#define ECP
Definition: fl_symbols.cxx:174
p
static menustate * p
Definition: Fl_Menu.cxx:606
fl_circle
void fl_circle(double x, double y, double r)
Definition: fl_draw.H:424
BCP
#define BCP
Definition: fl_symbols.cxx:173
draw_refresh
static void draw_refresh(Fl_Color c)
Definition: fl_symbols.cxx:626
fl_draw.H
utility header to pull drawing functions together
fl_add_symbol
int fl_add_symbol(const char *name, void(*drawit)(Fl_Color), int scalable)
Definition: fl_symbols.cxx:78
find
static int find(const char *name)
Definition: fl_symbols.cxx:47
fl_return_arrow
int fl_return_arrow(int x, int y, int w, int h)
Definition: Fl_Return_Button.cxx:23
draw_fileprint
static void draw_fileprint(Fl_Color c)
Definition: fl_symbols.cxx:546
draw_bararrow
static void draw_bararrow(Fl_Color col)
Definition: fl_symbols.cxx:294
MAXSYMBOL
#define MAXSYMBOL
Definition: fl_symbols.cxx:40
draw_arrow1bar
static void draw_arrow1bar(Fl_Color col)
Definition: fl_symbols.cxx:250
draw_fltk
static void draw_fltk(Fl_Color col)
Definition: fl_symbols.cxx:195
draw_fileopen
static void draw_fileopen(Fl_Color c)
Definition: fl_symbols.cxx:429
fl_line_style
void fl_line_style(int style, int width=0, char *dashes=0)
Definition: fl_draw.H:177
draw_doublearrow
static void draw_doublearrow(Fl_Color col)
Definition: fl_symbols.cxx:327
draw_search
static void draw_search(Fl_Color col)
Definition: fl_symbols.cxx:229
FL_LIGHT3
const Fl_Color FL_LIGHT3
Definition: Enumerations.H:952
draw_filenew
static void draw_filenew(Fl_Color c)
Definition: fl_symbols.cxx:395
draw_arrowbar
static void draw_arrowbar(Fl_Color col)
Definition: fl_symbols.cxx:274
symbols
static SYMBOL symbols[211]
Definition: fl_symbols.cxx:44
draw_redo
static void draw_redo(Fl_Color c)
Definition: fl_symbols.cxx:647
x
int x
Definition: test.c:73
draw_arrow3
static void draw_arrow3(Fl_Color col)
Definition: fl_symbols.cxx:264
draw_plus
static void draw_plus(Fl_Color col)
Definition: fl_symbols.cxx:361
draw_line
static void draw_line(Fl_Color col)
Definition: fl_symbols.cxx:358
draw_circle
static void draw_circle(Fl_Color col)
Definition: fl_symbols.cxx:352
draw_0arrowbar
static void draw_0arrowbar(Fl_Color col)
Definition: fl_symbols.cxx:318
y
int y
Definition: test.c:74
fl_pop_matrix
void fl_pop_matrix()
Definition: fl_draw.H:330
draw_uparrow
static void draw_uparrow(Fl_Color)
Definition: fl_symbols.cxx:374
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
draw_filesave
static void draw_filesave(Fl_Color c)
Definition: fl_symbols.cxx:469
draw_undo
static void draw_undo(Fl_Color c)
Definition: fl_symbols.cxx:639
flstring.h
EP
#define EP
Definition: fl_symbols.cxx:172
fl_lighter
Fl_Color fl_lighter(Fl_Color c)
Definition: Enumerations.H:991
rectangle
static void rectangle(double x, double y, double x2, double y2, Fl_Color col)
Definition: fl_symbols.cxx:186
draw_0arrowbox
static void draw_0arrowbox(Fl_Color col)
Definition: fl_symbols.cxx:321
fl_color_average
Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight)
Definition: fl_color.cxx:402
BP
#define BP
Definition: fl_symbols.cxx:171
name
static const char * name
Definition: Fl_arg.cxx:53
EC
#define EC
Definition: fl_symbols.cxx:178
draw_round_arrow
static void draw_round_arrow(Fl_Color c, float da=5.0)
Definition: fl_symbols.cxx:595
draw_0bararrow
static void draw_0bararrow(Fl_Color col)
Definition: fl_symbols.cxx:324
SYMBOL::drawit
void(* drawit)(Fl_Color)
Definition: fl_symbols.cxx:35
SYMBOL::scalable
char scalable
Definition: fl_symbols.cxx:36
beenhere
static uchar beenhere
Definition: fl_color.cxx:57
fl_scale
void fl_scale(double x, double y)
Definition: fl_draw.H:335
set_outline_color
static void set_outline_color(Fl_Color c)
Definition: fl_symbols.cxx:182
FL_DARK3
const Fl_Color FL_DARK3
Definition: Enumerations.H:946
SYMBOL
Definition: fl_symbols.cxx:33