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_Type.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Widget type code for the Fast Light Tool Kit (FLTK).
5 //
6 // Each object described by Fluid is one of these objects. They
7 // are all stored in a double-linked list.
8 //
9 // They "type" of the object is covered by the virtual functions.
10 // There will probably be a lot of these virtual functions.
11 //
12 // The type browser is also a list of these objects, but they
13 // are "factory" instances, not "real" ones. These objects exist
14 // only so the "make" method can be called on them. They are
15 // not in the linked list and are not written to files or
16 // copied or otherwise examined.
17 //
18 // Copyright 1998-2016 by Bill Spitzak and others.
19 //
20 // This library is free software. Distribution and use rights are outlined in
21 // the file "COPYING" which should have been included with this file. If this
22 // file is missing or damaged, see the license at:
23 //
24 // http://www.fltk.org/COPYING.php
25 //
26 // Please report all bugs and problems on the following page:
27 //
28 // http://www.fltk.org/str.php
29 //
30 
31 #include <FL/Fl.H>
32 #include <FL/Fl_Browser_.H>
33 #include <FL/fl_draw.H>
34 #include <stdlib.h>
35 #include "../src/flstring.h"
36 #include <stdio.h>
37 
38 #include "Fl_Type.h"
39 #include "undo.h"
40 
41 #include <FL/Fl_Pixmap.H>
42 #include "pixmaps/lock.xpm"
43 #include "pixmaps/protected.xpm"
44 //#include "pixmaps/unlock.xpm"
45 
46 static Fl_Pixmap lock_pixmap(lock_xpm);
47 static Fl_Pixmap protected_pixmap(protected_xpm);
48 //static Fl_Pixmap unlock_pixmap(unlock_xpm);
49 
50 #include "pixmaps/flWindow.xpm"
51 #include "pixmaps/flButton.xpm"
52 #include "pixmaps/flCheckButton.xpm"
53 #include "pixmaps/flRoundButton.xpm"
54 #include "pixmaps/flBox.xpm"
55 #include "pixmaps/flGroup.xpm"
56 #include "pixmaps/flFunction.xpm"
57 #include "pixmaps/flCode.xpm"
58 #include "pixmaps/flCodeBlock.xpm"
59 #include "pixmaps/flComment.xpm"
60 #include "pixmaps/flData.xpm"
61 #include "pixmaps/flDeclaration.xpm"
62 #include "pixmaps/flDeclarationBlock.xpm"
63 #include "pixmaps/flClass.xpm"
64 #include "pixmaps/flTabs.xpm"
65 #include "pixmaps/flInput.xpm"
66 #include "pixmaps/flChoice.xpm"
67 #include "pixmaps/flMenuitem.xpm"
68 #include "pixmaps/flMenubar.xpm"
69 #include "pixmaps/flSubmenu.xpm"
70 #include "pixmaps/flScroll.xpm"
71 #include "pixmaps/flTile.xpm"
72 #include "pixmaps/flWizard.xpm"
73 #include "pixmaps/flPack.xpm"
74 #include "pixmaps/flReturnButton.xpm"
75 #include "pixmaps/flLightButton.xpm"
76 #include "pixmaps/flRepeatButton.xpm"
77 #include "pixmaps/flMenuButton.xpm"
78 #include "pixmaps/flOutput.xpm"
79 #include "pixmaps/flTextDisplay.xpm"
80 #include "pixmaps/flTextEdit.xpm"
81 #include "pixmaps/flFileInput.xpm"
82 #include "pixmaps/flBrowser.xpm"
83 #include "pixmaps/flCheckBrowser.xpm"
84 #include "pixmaps/flFileBrowser.xpm"
85 #include "pixmaps/flClock.xpm"
86 #include "pixmaps/flHelp.xpm"
87 #include "pixmaps/flProgress.xpm"
88 #include "pixmaps/flSlider.xpm"
89 #include "pixmaps/flScrollBar.xpm"
90 #include "pixmaps/flValueSlider.xpm"
91 #include "pixmaps/flAdjuster.xpm"
92 #include "pixmaps/flCounter.xpm"
93 #include "pixmaps/flDial.xpm"
94 #include "pixmaps/flRoller.xpm"
95 #include "pixmaps/flValueInput.xpm"
96 #include "pixmaps/flValueOutput.xpm"
97 #include "pixmaps/flSpinner.xpm"
98 #include "pixmaps/flWidgetClass.xpm"
99 #include "pixmaps/flTree.xpm"
100 #include "pixmaps/flTable.xpm"
101 
102 static Fl_Pixmap window_pixmap(flWindow_xpm);
103 static Fl_Pixmap button_pixmap(flButton_xpm);
104 static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm);
105 static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm);
106 static Fl_Pixmap box_pixmap(flBox_xpm);
107 static Fl_Pixmap group_pixmap(flGroup_xpm);
108 static Fl_Pixmap function_pixmap(flFunction_xpm);
109 static Fl_Pixmap code_pixmap(flCode_xpm);
110 static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm);
111 static Fl_Pixmap comment_pixmap(flComment_xpm);
112 static Fl_Pixmap declaration_pixmap(flDeclaration_xpm);
113 static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm);
114 static Fl_Pixmap class_pixmap(flClass_xpm);
115 static Fl_Pixmap tabs_pixmap(flTabs_xpm);
116 static Fl_Pixmap input_pixmap(flInput_xpm);
117 static Fl_Pixmap choice_pixmap(flChoice_xpm);
118 static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm);
119 static Fl_Pixmap menubar_pixmap(flMenubar_xpm);
120 static Fl_Pixmap submenu_pixmap(flSubmenu_xpm);
121 static Fl_Pixmap scroll_pixmap(flScroll_xpm);
122 static Fl_Pixmap tile_pixmap(flTile_xpm);
123 static Fl_Pixmap wizard_pixmap(flWizard_xpm);
124 static Fl_Pixmap pack_pixmap(flPack_xpm);
125 static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm);
126 static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm);
127 static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm);
128 static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm);
129 static Fl_Pixmap output_pixmap(flOutput_xpm);
130 static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm);
131 static Fl_Pixmap textedit_pixmap(flTextEdit_xpm);
132 static Fl_Pixmap fileinput_pixmap(flFileInput_xpm);
133 static Fl_Pixmap browser_pixmap(flBrowser_xpm);
134 static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm);
135 static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm);
136 static Fl_Pixmap clock_pixmap(flClock_xpm);
137 static Fl_Pixmap help_pixmap(flHelp_xpm);
138 static Fl_Pixmap progress_pixmap(flProgress_xpm);
139 static Fl_Pixmap slider_pixmap(flSlider_xpm);
140 static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm);
141 static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm);
142 static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm);
143 static Fl_Pixmap counter_pixmap(flCounter_xpm);
144 static Fl_Pixmap dial_pixmap(flDial_xpm);
145 static Fl_Pixmap roller_pixmap(flRoller_xpm);
146 static Fl_Pixmap valueinput_pixmap(flValueInput_xpm);
147 static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm);
148 static Fl_Pixmap spinner_pixmap(flSpinner_xpm);
149 static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm);
150 static Fl_Pixmap data_pixmap(flData_xpm);
151 static Fl_Pixmap tree_pixmap(flTree_xpm);
152 static Fl_Pixmap table_pixmap(flTable_xpm);
153 
164 
165 extern int show_comments;
166 
168 
169 // Copy the given string str to buffer p with no more than maxl characters.
170 // Add "..." if string was truncated.
171 // If parameter quote is true (not 0) the string is quoted with "".
172 // Quote characters are NOT counted.
173 // The returned buffer (string) is terminated with a null byte.
174 // Returns pointer to end of string (before terminating null byte).
175 // Note: the buffer p must be large enough to hold (4 * (maxl+1) + 1) bytes
176 // or (4 * (maxl+1) + 3) bytes if quoted, e.g. "123..." because each UTF-8
177 // character can consist of 4 bytes, "..." adds 3 bytes, quotes '""' add two
178 // bytes, and the terminating null byte adds another byte.
179 // This supports Unicode code points up to U+10FFFF (standard as of 10/2016).
180 // Sanity checks for illegal UTF-8 sequences are included.
181 
182 static char *copy_trunc(char *p, const char *str, int maxl, int quote) {
183 
184  int size = 0; // truncated string size in characters
185  int bs; // size of UTF-8 character in bytes
186  const char *end = str + strlen(str); // end of input string
187  if (quote) *p++ = '"'; // opening quote
188  while (size < maxl) { // maximum <maxl> characters
189  if (!(*str & (-32))) break; // end of string (0 or control char)
190  bs = fl_utf8len(*str); // size of next character
191  if (bs <= 0) break; // some error - leave
192  if (str + bs > end) break; // UTF-8 sequence beyond end of string
193  while (bs--) *p++ = *str++; // copy that character into the buffer
194  size++; // count copied characters
195  }
196  if (*str) { // string was truncated
197  strcpy(p,"..."); p += 3;
198  }
199  if (quote) *p++ = '"'; // closing quote
200  *p = 0; // terminating null byte
201  return p;
202 }
203 
205 
206 class Widget_Browser : public Fl_Browser_ {
207  friend class Fl_Type;
208 
209  // required routines for Fl_Browser_ subclass:
210  void *item_first() const ;
211  void *item_next(void *) const ;
212  void *item_prev(void *) const ;
213  int item_selected(void *) const ;
214  void item_select(void *,int);
215  int item_width(void *) const ;
216  int item_height(void *) const ;
217  void item_draw(void *,int,int,int,int) const ;
218  int incr_height() const ;
219 
220 public:
221 
222  int handle(int);
223  void callback();
224  Widget_Browser(int,int,int,int,const char * =0);
225 };
226 
228 Fl_Widget *make_widget_browser(int x,int y,int w,int h) {
229  return (widget_browser = new Widget_Browser(x,y,w,h));
230 }
231 
233 {
234  if (caller) {
235  widget_browser->display(caller);
236  }
238 }
239 
240 void select(Fl_Type *o, int v) {
241  widget_browser->select(o,v,1);
242  // Fl_Type::current = o;
243 }
244 
247 }
248 
249 void deselect() {
251  //Fl_Type::current = 0; // this breaks the paste & merge functions
252 }
253 
256 
257 static void Widget_Browser_callback(Fl_Widget *o,void *) {
258  ((Widget_Browser *)o)->callback();
259 }
260 
261 Widget_Browser::Widget_Browser(int X,int Y,int W,int H,const char*l)
262 : Fl_Browser_(X,Y,W,H,l) {
266 }
267 
269 
270 void *Widget_Browser::item_next(void *l) const {return ((Fl_Type*)l)->next;}
271 
272 void *Widget_Browser::item_prev(void *l) const {return ((Fl_Type*)l)->prev;}
273 
274 int Widget_Browser::item_selected(void *l) const {return ((Fl_Type*)l)->new_selected;}
275 
276 void Widget_Browser::item_select(void *l,int v) {((Fl_Type*)l)->new_selected = v;}
277 
278 int Widget_Browser::item_height(void *l) const {
279  Fl_Type *t = (Fl_Type*)l;
280  if (t->visible) {
281  if (show_comments && t->comment())
282  return textsize()*2+4;
283  else
284  return textsize()+5;
285  }
286  return 0;
287 }
288 
289 int Widget_Browser::incr_height() const {return textsize()+2;}
290 
292 
293 // Generate a descriptive text for this item, to put in browser & window titles
294 const char* Fl_Type::title() {
295  const char* c = name(); if (c) return c;
296  return type_name();
297 }
298 
299 extern const char* subclassname(Fl_Type*);
300 
301 
323 void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const {
324  // cast to a more general type
325  Fl_Type *l = (Fl_Type *)v;
326 
327  char buf[340]; // edit buffer: large enough to hold 80 UTF-8 chars + nul
328 
329  // calculate the horizontal start position of this item
330  // 3 is the edge of the browser
331  // 13 is the width of the arrow that indicates children for the item
332  // 18 is the width of the icon
333  // 12 is the indent per level
334  X += 3 + 13 + 18 + l->level * 12;
335 
336  // calculate the horizontal start position and width of the separator line
337  int x1 = X;
338  int w1 = w() - x1;
339 
340  // items can contain a comment. If they do, the comment gets a second text
341  // line inside this browser line
342  int comment_incr = 0;
343  if (show_comments && l->comment()) {
344  copy_trunc(buf, l->comment(), 80, 0);
345  comment_incr = textsize()-1;
349  fl_draw(buf, X, Y+12);
350  Y += comment_incr/2;
351  comment_incr -= comment_incr/2;
352  }
353 
356 
357  // Width=10: Draw the triangle that indicates possible children
358  if (l->is_parent()) {
359  X = X - 18 - 13;
360  if (!l->next || l->next->level <= l->level) {
361  if (l->open_!=(l==pushedtitle)) {
362  // an outlined triangle to the right indicates closed item, no children
363  fl_loop(X,Y+7,X+5,Y+12,X+10,Y+7);
364  } else {
365  // an outlined triangle to the bottom indicates open item, no children
366  fl_loop(X+2,Y+2,X+7,Y+7,X+2,Y+12);
367  }
368  } else {
369  if (l->open_!=(l==pushedtitle)) {
370  // a filled triangle to the right indicates closed item, with children
371  fl_polygon(X,Y+7,X+5,Y+12,X+10,Y+7);
372  } else {
373  // a filled triangle to the bottom indicates open item, with children
374  fl_polygon(X+2,Y+2,X+7,Y+7,X+2,Y+12);
375  }
376  }
377  X = X + 13 + 18;
378  }
379 
380  // Width=18: Draw the icon associated with the type.
381  Fl_Pixmap *pm = pixmap[l->pixmapID()];
382  if (pm) pm->draw(X-18, Y);
383 
384  // Add tags on top of the icon for locked and protected types.
385  switch (l->is_public()) {
386  case 0: lock_pixmap.draw(X - 17, Y); break;
387  case 2: protected_pixmap.draw(X - 17, Y); break;
388  }
389 
390  // Indent=12 per level: Now write the text that comes after the graphics representation
391  Y += comment_incr;
392  if (l->is_widget() || l->is_class()) {
393  const char* c = subclassname(l);
394  if (!strncmp(c,"Fl_",3)) c += 3;
395  fl_font(textfont(), textsize());
396  fl_draw(c, X, Y+13);
397  X += int(fl_width(c)+fl_width('n'));
398  c = l->name();
399  if (c) {
401  fl_draw(c, X, Y+13);
402  } else if ((c = l->label())) {
403  copy_trunc(buf, c, 20, 1); // quoted string
404  fl_draw(buf, X, Y+13);
405  }
406  } else {
407  copy_trunc(buf, l->title(), 55, 0);
408  fl_font(textfont() | (l->is_code_block() && (l->level==0 || l->parent->is_class())?0:FL_BOLD), textsize());
409  fl_draw(buf, X, Y+13);
410  }
411 
412  // draw a thin line below the item if this item is not selected
413  // (if it is selected this additional line would look bad)
414  if (!l->new_selected) {
416  fl_line(x1,Y+16,x1+w1,Y+16);
417  }
418 }
419 
420 int Widget_Browser::item_width(void *v) const {
421 
422  char buf[340]; // edit buffer: large enough to hold 80 UTF-8 chars + nul
423 
424  Fl_Type *l = (Fl_Type *)v;
425 
426  if (!l->visible) return 0;
427 
428  int W = 3 + 13 + 18 + l->level * 12;
429 
430  if (l->is_widget() || l->is_class()) {
431  const char* c = l->type_name();
432  if (!strncmp(c,"Fl_",3)) c += 3;
433  fl_font(textfont(), textsize());
434  W += int(fl_width(c) + fl_width('n'));
435  c = l->name();
436  if (c) {
438  W += int(fl_width(c));
439  } else if (l->label()) {
440  copy_trunc(buf, l->label(), 20, 1); // quoted string
441  W += int(fl_width(buf));
442  }
443  } else {
444  copy_trunc(buf, l->title(), 55, 0);
445  fl_font(textfont() | (l->is_code_block() && (l->level==0 || l->parent->is_class())?0:FL_BOLD), textsize());
446  W += int(fl_width(buf));
447  }
448 
449  return W;
450 }
451 
454 }
455 
458 }
459 
460 
476  static Fl_Type *title;
477  Fl_Type *l;
478  int X,Y,W,H; bbox(X,Y,W,H);
479  switch (e) {
480  case FL_PUSH:
481  if (!Fl::event_inside(X,Y,W,H)) break;
482  l = (Fl_Type*)find_item(Fl::event_y());
483  if (l) {
484  X += 3 + 12*l->level - hposition();
485  if (l->is_parent() && Fl::event_x()>X && Fl::event_x()<X+13) {
486  title = pushedtitle = l;
487  redraw_line(l);
488  return 1;
489  }
490  }
491  break;
492  case FL_DRAG:
493  if (!title) break;
494  l = (Fl_Type*)find_item(Fl::event_y());
495  if (l) {
496  X += 3 + 12*l->level - hposition();
497  if (l->is_parent() && Fl::event_x()>X && Fl::event_x()<X+13) ;
498  else l = 0;
499  }
500  if (l != pushedtitle) {
502  if (l) redraw_line(l);
503  pushedtitle = l;
504  }
505  return 1;
506  case FL_RELEASE:
507  if (!title) {
508  l = (Fl_Type*)find_item(Fl::event_y());
509  if (l && l->new_selected && (Fl::event_clicks() || Fl::event_state(FL_CTRL)))
510  l->open();
511  break;
512  }
513  l = pushedtitle;
514  title = pushedtitle = 0;
515  if (l) {
516  if (l->open_) {
517  l->open_ = 0;
518  for (Fl_Type*k = l->next; k&&k->level>l->level; k = k->next)
519  k->visible = 0;
520  } else {
521  l->open_ = 1;
522  for (Fl_Type*k=l->next; k&&k->level>l->level;) {
523  k->visible = 1;
524  if (k->is_parent() && !k->open_) {
525  Fl_Type *j;
526  for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/}
527  k = j;
528  } else
529  k = k->next;
530  }
531  }
532  redraw();
533  }
534  return 1;
535  }
536  return Fl_Browser_::handle(e);
537 }
538 
540  factory = 0;
541  parent = 0;
542  next = prev = 0;
543  selected = new_selected = 0;
544  visible = 0;
545  name_ = 0;
546  label_ = 0;
547  user_data_ = 0;
548  user_data_type_ = 0;
549  callback_ = 0;
550  comment_ = 0;
551  rtti = 0;
552  level = 0;
555 }
556 
557 static void fixvisible(Fl_Type *p) {
558  Fl_Type *t = p;
559  for (;;) {
560  if (t->parent) t->visible = t->parent->visible && t->parent->open_;
561  else t->visible = 1;
562  t = t->next;
563  if (!t || t->level <= p->level) break;
564  }
565 }
566 
567 // turn a click at x,y on this into the actual picked object:
568 Fl_Type* Fl_Type::click_test(int,int) {return 0;}
572 
573 // add a list of widgets as a new child of p:
575  if (p && parent == p) return;
576  undo_checkpoint();
577  parent = p;
578  Fl_Type *end = this;
579  while (end->next) end = end->next;
580  Fl_Type *q;
581  int newlevel;
582  if (p) {
583  for (q = p->next; q && q->level > p->level; q = q->next) {/*empty*/}
584  newlevel = p->level+1;
585  } else {
586  q = 0;
587  newlevel = 0;
588  }
589  for (Fl_Type *t = this->next; t; t = t->next) t->level += (newlevel-level);
590  level = newlevel;
591  if (q) {
592  prev = q->prev;
593  prev->next = this;
594  q->prev = end;
595  end->next = q;
596  } else if (first) {
597  prev = last;
598  prev->next = this;
599  end->next = 0;
600  last = end;
601  } else {
602  first = this;
603  last = end;
604  prev = end->next = 0;
605  }
606  if (p) p->add_child(this,0);
607  open_ = 1;
608  fixvisible(this);
609  set_modflag(1);
611 }
612 
613 // add to a parent before another widget:
615  Fl_Type *end = this;
616  while (end->next) end = end->next;
617  parent = g->parent;
618  int newlevel = g->level;
619  visible = g->visible;
620  for (Fl_Type *t = this->next; t; t = t->next) t->level += newlevel-level;
621  level = newlevel;
622  prev = g->prev;
623  if (prev) prev->next = this; else first = this;
624  end->next = g;
625  g->prev = end;
626  fixvisible(this);
627  if (parent) parent->add_child(this, g);
629 }
630 
631 // Return message number for I18N...
632 int
634  int count;
635  Fl_Type *p;
636 
637  for (count = 0, p = this; p;) {
638  if (p->label()) count ++;
639  if (p != this && p->is_widget() && ((Fl_Widget_Type *)p)->tooltip()) count ++;
640 
641  if (p->prev) p = p->prev;
642  else p = p->parent;
643  }
644 
645  return count;
646 }
647 
648 
649 // delete from parent:
651  Fl_Type *end = this;
652  for (;;) {
653  if (!end->next || end->next->level <= level) break;
654  end = end->next;
655  }
656  if (prev) prev->next = end->next;
657  else first = end->next;
658  if (end->next) end->next->prev = prev;
659  else last = prev;
660  Fl_Type *r = end->next;
661  prev = end->next = 0;
662  if (parent) parent->remove_child(this);
663  parent = 0;
666  return r;
667 }
668 
669 // update a string member:
670 int storestring(const char *n, const char * & p, int nostrip) {
671  if (n == p) return 0;
672  undo_checkpoint();
673  int length = 0;
674  if (n) { // see if blank, strip leading & trailing blanks
675  if (!nostrip) while (isspace((int)(unsigned char)*n)) n++;
676  const char *e = n + strlen(n);
677  if (!nostrip) while (e > n && isspace((int)(unsigned char)*(e-1))) e--;
678  length = e-n;
679  if (!length) n = 0;
680  }
681  if (n == p) return 0;
682  if (n && p && !strncmp(n,p,length) && !p[length]) return 0;
683  if (p) free((void *)p);
684  if (!n || !*n) {
685  p = 0;
686  } else {
687  char *q = (char *)malloc(length+1);
688  strlcpy(q,n,length+1);
689  p = q;
690  }
691  set_modflag(1);
692  return 1;
693 }
694 
695 void Fl_Type::name(const char *n) {
696  int nostrip = is_comment();
697  if (storestring(n,name_,nostrip)) {
698  if (visible) widget_browser->redraw();
699  }
700 }
701 
702 void Fl_Type::label(const char *n) {
703  if (storestring(n,label_,1)) {
704  setlabel(label_);
705  if (visible && !name_) widget_browser->redraw();
706  }
707 }
708 
709 void Fl_Type::callback(const char *n) {
711 }
712 
713 void Fl_Type::user_data(const char *n) {
715 }
716 
717 void Fl_Type::user_data_type(const char *n) {
719 }
720 
721 void Fl_Type::comment(const char *n) {
722  if (storestring(n,comment_,1)) {
723  if (visible) widget_browser->redraw();
724  }
725 }
726 
728  printf("Open of '%s' is not yet implemented\n",type_name());
729 }
730 
731 void Fl_Type::setlabel(const char *) {}
732 
734  // warning: destructor only works for widgets that have been add()ed.
736  if (prev) prev->next = next; else first = next;
737  if (next) next->prev = prev; else last = prev;
738  if (current == this) current = 0;
739  if (parent) parent->remove_child(this);
740  if (name_) free((void*)name_);
741  if (label_) free((void*)label_);
742  if (callback_) free((void*)callback_);
743  if (user_data_) free((void*)user_data_);
744  if (user_data_type_) free((void*)user_data_type_);
745  if (comment_) free((void*)comment_);
746 }
747 
748 int Fl_Type::is_parent() const {return 0;}
749 int Fl_Type::is_widget() const {return 0;}
750 int Fl_Type::is_valuator() const {return 0;}
751 int Fl_Type::is_spinner() const {return 0;}
752 int Fl_Type::is_button() const {return 0;}
753 int Fl_Type::is_input() const {return 0;}
754 int Fl_Type::is_value_input() const {return 0;}
755 int Fl_Type::is_text_display() const {return 0;}
756 int Fl_Type::is_menu_item() const {return 0;}
757 int Fl_Type::is_menu_button() const {return 0;}
758 int Fl_Type::is_group() const {return 0;}
759 int Fl_Type::is_window() const {return 0;}
760 int Fl_Type::is_code() const {return 0;}
761 int Fl_Type::is_code_block() const {return 0;}
762 int Fl_Type::is_decl_block() const {return 0;}
763 int Fl_Type::is_comment() const {return 0;}
764 int Fl_Type::is_class() const {return 0;}
765 int Fl_Type::is_public() const {return 1;}
766 
767 int Fl_Code_Type::is_public()const { return -1; }
768 int Fl_CodeBlock_Type::is_public()const { return -1; }
769 
770 
772 
773 Fl_Type *in_this_only; // set if menu popped-up in window
774 
775 void select_all_cb(Fl_Widget *,void *) {
777  if (in_this_only) {
778  Fl_Type *t = p;
779  for (; t && t != in_this_only; t = t->parent) {/*empty*/}
780  if (t != in_this_only) p = in_this_only;
781  }
782  for (;;) {
783  if (p) {
784  int foundany = 0;
785  for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) {
786  if (!t->new_selected) {widget_browser->select(t,1,0); foundany = 1;}
787  }
788  if (foundany) break;
789  p = p->parent;
790  } else {
791  for (Fl_Type *t = Fl_Type::first; t; t = t->next)
792  widget_browser->select(t,1,0);
793  break;
794  }
795  }
797 }
798 
799 void select_none_cb(Fl_Widget *,void *) {
801  if (in_this_only) {
802  Fl_Type *t = p;
803  for (; t && t != in_this_only; t = t->parent) {/*empty*/}
804  if (t != in_this_only) p = in_this_only;
805  }
806  for (;;) {
807  if (p) {
808  int foundany = 0;
809  for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) {
810  if (t->new_selected) {widget_browser->select(t,0,0); foundany = 1;}
811  }
812  if (foundany) break;
813  p = p->parent;
814  } else {
815  for (Fl_Type *t = Fl_Type::first; t; t = t->next)
816  widget_browser->select(t,0,0);
817  break;
818  }
819  }
821 }
822 
823 static void delete_children(Fl_Type *p) {
824  Fl_Type *f;
825  for (f = p; f && f->next && f->next->level > p->level; f = f->next) {/*empty*/}
826  for (; f != p; ) {
827  Fl_Type *g = f->prev;
828  delete f;
829  f = g;
830  }
831 }
832 
833 void delete_all(int selected_only) {
834  for (Fl_Type *f = Fl_Type::first; f;) {
835  if (f->selected || !selected_only) {
837  Fl_Type *g = f->next;
838  delete f;
839  f = g;
840  } else f = f->next;
841  }
842  if(!selected_only) {
844  use_FL_COMMAND=0;
845  }
846 
848 }
849 
850 // move f (and it's children) into list before g:
851 // returns pointer to whatever is after f & children
853  if (level != g->level) printf("move_before levels don't match! %d %d\n",
854  level, g->level);
855  Fl_Type* n;
856  for (n = next; n && n->level > level; n = n->next) {/*empty*/}
857  if (n == g) return;
858  Fl_Type *l = n ? n->prev : Fl_Type::last;
859  prev->next = n;
860  if (n) n->prev = prev; else Fl_Type::last = prev;
861  prev = g->prev;
862  l->next = g;
863  if (prev) prev->next = this; else Fl_Type::first = this;
864  g->prev = l;
865  if (parent && is_widget()) parent->move_child(this,g);
866  widget_browser->inserting(g, this);
867  widget_browser->display(this);
869 }
870 
871 
872 // move selected widgets in their parent's list:
873 void earlier_cb(Fl_Widget*,void*) {
874  Fl_Type *f;
875  int mod = 0;
876  for (f = Fl_Type::first; f; ) {
877  Fl_Type* nxt = f->next;
878  if (f->selected) {
879  Fl_Type* g;
880  for (g = f->prev; g && g->level > f->level; g = g->prev) {/*empty*/}
881  if (g && g->level == f->level && !g->selected) {
882  f->move_before(g);
883  mod = 1;
884  }
885  }
886  f = nxt;
887  }
888  if (mod) set_modflag(1);
889 }
890 
891 void later_cb(Fl_Widget*,void*) {
892  Fl_Type *f;
893  int mod = 0;
894  for (f = Fl_Type::last; f; ) {
895  Fl_Type* prv = f->prev;
896  if (f->selected) {
897  Fl_Type* g;
898  for (g = f->next; g && g->level > f->level; g = g->next) {/*empty*/}
899  if (g && g->level == f->level && !g->selected) {
900  g->move_before(f);
901  mod = 1;
902  }
903  }
904  f = prv;
905  }
906  if (mod) set_modflag(1);
907 }
908 
910 
911 // write a widget and all it's children:
915 
916  if (is_class()) {
917  const char * p = ((Fl_Class_Type*)this)->prefix();
918  if (p && strlen(p))
919  write_word(p);
920  }
921 
922  write_word(name());
923  write_open(level);
926  if (!is_parent()) return;
927  // now do children:
928  write_open(level);
929  Fl_Type *child;
930  for (child = next; child && child->level > level; child = child->next)
931  if (child->level == level+1) child->write();
933 }
934 
936  // repeat this for each attribute:
937  if (label()) {
938  write_indent(level+1);
939  write_word("label");
940  write_word(label());
941  }
942  if (user_data()) {
943  write_indent(level+1);
944  write_word("user_data");
946  }
947  if (user_data_type()) {
948  write_word("user_data_type");
950  }
951  if (callback()) {
952  write_indent(level+1);
953  write_word("callback");
954  write_word(callback());
955  }
956  if (comment()) {
957  write_indent(level+1);
958  write_word("comment");
959  write_word(comment());
960  }
961  if (is_parent() && open_) write_word("open");
962  if (selected) write_word("selected");
963 }
964 
965 void Fl_Type::read_property(const char *c) {
966  if (!strcmp(c,"label"))
967  label(read_word());
968  else if (!strcmp(c,"user_data"))
969  user_data(read_word());
970  else if (!strcmp(c,"user_data_type"))
972  else if (!strcmp(c,"callback"))
973  callback(read_word());
974  else if (!strcmp(c,"comment"))
975  comment(read_word());
976  else if (!strcmp(c,"open"))
977  open_ = 1;
978  else if (!strcmp(c,"selected"))
979  select(this,1);
980  else
981  read_error("Unknown property \"%s\"", c);
982 }
983 
984 int Fl_Type::read_fdesign(const char*, const char*) {return 0;}
985 
989 int has_toplevel_function(const char *rtype, const char *sig) {
990  Fl_Type *child;
991  for (child = Fl_Type::first; child; child = child->next) {
992  if (!child->is_in_class() && strcmp(child->type_name(), "Function")==0) {
993  const Fl_Function_Type *fn = (const Fl_Function_Type*)child;
994  if (fn->has_signature(rtype, sig))
995  return 1;
996  }
997  }
998  return 0;
999 }
1000 
1004 void Fl_Type::write_comment_h(const char *pre)
1005 {
1006  if (comment() && *comment()) {
1007  write_h("%s/**\n", pre);
1008  const char *s = comment();
1009  write_h("%s ", pre);
1010  while(*s) {
1011  if (*s=='\n') {
1012  if (s[1]) {
1013  write_h("\n%s ", pre);
1014  }
1015  } else {
1016  write_h("%c", *s); // FIXME this is much too slow!
1017  }
1018  s++;
1019  }
1020  write_h("\n%s*/\n", pre);
1021  }
1022 }
1023 
1027 void Fl_Type::write_comment_c(const char *pre)
1028 {
1029  if (comment() && *comment()) {
1030  write_c("%s/**\n", pre);
1031  const char *s = comment();
1032  write_c("%s ", pre);
1033  while(*s) {
1034  if (*s=='\n') {
1035  if (s[1]) {
1036  write_c("\n%s ", pre);
1037  }
1038  } else {
1039  write_c("%c", *s); // FIXME this is much too slow!
1040  }
1041  s++;
1042  }
1043  write_c("\n%s*/\n", pre);
1044  }
1045 }
1046 
1050 void Fl_Type::write_comment_inline_c(const char *pre)
1051 {
1052  if (comment() && *comment()) {
1053  const char *s = comment();
1054  if (strchr(s, '\n')==0L) {
1055  // single line comment
1056  if (pre) write_c("%s", pre);
1057  write_c("// %s\n", s);
1058  if (!pre) write_c("%s ", indent());
1059  } else {
1060  write_c("%s/*\n", pre?pre:"");
1061  if (pre) write_c("%s ", pre); else write_c("%s ", indent());
1062  while(*s) {
1063  if (*s=='\n') {
1064  if (s[1]) {
1065  if (pre) write_c("\n%s ", pre); else write_c("\n%s ", indent());
1066  }
1067  } else {
1068  write_c("%c", *s); // FIXME this is much too slow!
1069  }
1070  s++;
1071  }
1072  if (pre) write_c("\n%s */\n", pre); else write_c("\n%s */\n", indent());
1073  if (!pre) write_c("%s ", indent());
1074  }
1075  }
1076 }
1077 
1083  Fl_Type *p = t->parent;
1084  if (p) {
1085  for (;;) {
1086  if (!p->open_)
1087  p->open_ = 1;
1088  if (!p->parent) break;
1089  p = p->parent;
1090  }
1091  fixvisible(p);
1092  }
1093  widget_browser->display(t);
1094  redraw_browser();
1095 }
1096 
1103  return 0L;
1104 }
1105 
1111 }
1112 
1117 }
1118 
1127 int Fl_Type::user_defined(const char* cbname) const {
1128  for (Fl_Type* p = Fl_Type::first; p ; p = p->next)
1129  if (strcmp(p->type_name(), "Function") == 0 && p->name() != 0)
1130  if (strncmp(p->name(), cbname, strlen(cbname)) == 0)
1131  if (p->name()[strlen(cbname)] == '(')
1132  return 1;
1133  return 0;
1134 }
1135 
1136 
1137 //
1138 // End of "$Id$".
1139 //
write_open
void write_open(int)
Definition: file.cxx:110
valueoutput_pixmap
static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm)
Fl_Type::callback
const char * callback() const
Definition: Fl_Type.h:100
select
void select(Fl_Type *o, int v)
Definition: Fl_Type.cxx:240
include_H_from_C
int include_H_from_C
Definition: Fl_Window_Type.cxx:42
Fl_Type::title
virtual const char * title()
Definition: Fl_Type.cxx:294
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
roller_pixmap
static Fl_Pixmap roller_pixmap(flRoller_xpm)
Fl_Pixmap.H
fl_width
FL_EXPORT double fl_width(const char *txt)
Definition: fl_font.cxx:65
Fl_Browser_::display
void display(void *item)
Definition: Fl_Browser_.cxx:245
Widget_Browser::callback
void callback()
Definition: Fl_Type.cxx:456
Fl_Browser_::select
int select(void *item, int val=1, int docallbacks=0)
Definition: Fl_Browser_.cxx:608
pixmap
Fl_Pixmap * pixmap[]
Definition: Fl_Type.cxx:154
Fl.H
use_FL_COMMAND
int use_FL_COMMAND
Definition: Fl_Window_Type.cxx:43
buf
static char * buf
Definition: fl_encoding_mac_roman.cxx:76
Fl_Widget_Type
Definition: Fl_Type.h:374
fl_line
void fl_line(int x, int y, int x1, int y1)
Definition: fl_draw.H:223
Fl_Type::callback_
const char * callback_
Definition: Fl_Type.h:56
Fl_Type::current
static Fl_Type * current
Definition: Fl_Type.h:114
Fl_Type::next
Fl_Type * next
Definition: Fl_Type.h:71
box_pixmap
static Fl_Pixmap box_pixmap(flBox_xpm)
widget_browser
static Widget_Browser * widget_browser
Definition: Fl_Type.cxx:227
Fl_Browser_::bbox
void bbox(int &X, int &Y, int &W, int &H) const
Definition: Fl_Browser_.cxx:68
Fl_Type::is_public
virtual int is_public() const
Definition: Fl_Type.cxx:765
FL_ITALIC
const Fl_Font FL_ITALIC
add this to helvetica, courier, or times
Definition: Enumerations.H:898
Fl_Type::is_text_display
virtual int is_text_display() const
Definition: Fl_Type.cxx:755
Fl_Browser_::deleting
void deleting(void *item)
Definition: Fl_Browser_.cxx:510
Fl_Type::user_defined
int user_defined(const char *cbname) const
Definition: Fl_Type.cxx:1127
submenu_pixmap
static Fl_Pixmap submenu_pixmap(flSubmenu_xpm)
Fl_Type::write_properties
virtual void write_properties()
Definition: Fl_Type.cxx:935
reveal_in_browser
void reveal_in_browser(Fl_Type *t)
Definition: Fl_Type.cxx:1082
Widget_Browser::Widget_Browser
Widget_Browser(int, int, int, int, const char *=0)
Definition: Fl_Type.cxx:261
Fl_Type::user_data_type
const char * user_data_type() const
Definition: Fl_Type.h:104
Fl_Type::rtti
char rtti
Definition: Fl_Type.h:68
Fl_Type::is_parent
virtual int is_parent() const
Definition: Fl_Type.cxx:748
Fl_Type::parent
Fl_Type * parent
Definition: Fl_Type.h:63
Fl_Type::comment_
const char * comment_
Definition: Fl_Type.h:59
read_error
void read_error(const char *format,...)
Definition: file.cxx:151
lock_pixmap
static Fl_Pixmap lock_pixmap(lock_xpm)
Fl_Type::is_code_block
virtual int is_code_block() const
Definition: Fl_Type.cxx:761
Fl_Type::enter_live_mode
virtual Fl_Widget * enter_live_mode(int top=0)
Definition: Fl_Type.cxx:1102
Fl::event_state
static int event_state()
Definition: Fl.H:704
textedit_pixmap
static Fl_Pixmap textedit_pixmap(flTextEdit_xpm)
browser_pixmap
static Fl_Pixmap browser_pixmap(flBrowser_xpm)
Fl_Type::move_child
virtual void move_child(Fl_Type *, Fl_Type *beforethis)
Definition: Fl_Type.cxx:570
fileinput_pixmap
static Fl_Pixmap fileinput_pixmap(flFileInput_xpm)
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
Fl_Type::add
void add(Fl_Type *parent)
Definition: Fl_Type.cxx:574
Widget_Browser::item_prev
void * item_prev(void *) const
Definition: Fl_Type.cxx:272
FL_WHEN_RELEASE
Do the callback when the button or key is released and the value changes.
Definition: Enumerations.H:443
FL_DRAG
Definition: Enumerations.H:268
fl_utf8len
int fl_utf8len(char c)
Definition: fl_utf8.cxx:111
adjuster_pixmap
static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm)
output_pixmap
static Fl_Pixmap output_pixmap(flOutput_xpm)
Widget_Browser::item_select
void item_select(void *, int)
Definition: Fl_Type.cxx:276
code_pixmap
static Fl_Pixmap code_pixmap(flCode_xpm)
lightbutton_pixmap
static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm)
pack_pixmap
static Fl_Pixmap pack_pixmap(flPack_xpm)
Fl_Type::level
int level
Definition: Fl_Type.h:69
free
void free()
H
static int H
Definition: Fl_Tooltip.cxx:76
roundbutton_pixmap
static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm)
Widget_Browser_callback
static void Widget_Browser_callback(Fl_Widget *o, void *)
Definition: Fl_Type.cxx:257
in_this_only
Fl_Type * in_this_only
Definition: Fl_Type.cxx:773
Fl_Type::is_widget
virtual int is_widget() const
Definition: Fl_Type.cxx:749
Fl_Type::name_
const char * name_
Definition: Fl_Type.h:54
tree_pixmap
static Fl_Pixmap tree_pixmap(flTree_xpm)
Fl_Type::user_data_
const char * user_data_
Definition: Fl_Type.h:57
Fl_Type::is_menu_item
virtual int is_menu_item() const
Definition: Fl_Type.cxx:756
show_comments
int show_comments
Definition: fluid.cxx:96
Fl_Type::open_
char open_
Definition: Fl_Type.h:66
tabs_pixmap
static Fl_Pixmap tabs_pixmap(flTabs_xpm)
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Definition: fl_font.cxx:70
Fl_Type::write
virtual void write()
Definition: Fl_Type.cxx:912
subclassname
const char * subclassname(Fl_Type *)
Definition: Fl_Widget_Type.cxx:55
function_pixmap
static Fl_Pixmap function_pixmap(flFunction_xpm)
Fl_Type::is_decl_block
virtual int is_decl_block() const
Definition: Fl_Type.cxx:762
Fl_Type::Fl_Type
Fl_Type()
Definition: Fl_Type.cxx:539
Fl_Widget::when
Fl_When when() const
Definition: Fl_Widget.H:621
fl_contrast
Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg)
Definition: fl_color.cxx:435
counter_pixmap
static Fl_Pixmap counter_pixmap(flCounter_xpm)
protected_pixmap
static Fl_Pixmap protected_pixmap(protected_xpm)
Widget_Browser::item_selected
int item_selected(void *) const
Definition: Fl_Type.cxx:274
write_c
void write_c(const char *format,...)
Definition: code.cxx:265
Fl_Type::leave_live_mode
virtual void leave_live_mode()
Definition: Fl_Type.cxx:1110
Widget_Browser::item_height
int item_height(void *) const
Definition: Fl_Type.cxx:278
Fl_Type::is_in_class
const class Fl_Class_Type * is_in_class() const
Definition: Fl_Function_Type.cxx:1318
Fl_Type::first
static Fl_Type * first
Definition: Fl_Type.h:70
checkbutton_pixmap
static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm)
select_none_cb
void select_none_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:799
clock_pixmap
static Fl_Pixmap clock_pixmap(flClock_xpm)
Fl_Type::insert
void insert(Fl_Type *n)
Definition: Fl_Type.cxx:614
Fl_Type::~Fl_Type
virtual ~Fl_Type()
Definition: Fl_Type.cxx:733
Fl::event_x
static int event_x()
Definition: Fl.H:598
Fl_Type::is_comment
virtual int is_comment() const
Definition: Fl_Type.cxx:763
Fl_Type::is_button
virtual int is_button() const
Definition: Fl_Type.cxx:752
Fl_Browser_::textsize
Fl_Fontsize textsize() const
Definition: Fl_Browser_.H:301
Fl_Type::add_child
virtual void add_child(Fl_Type *, Fl_Type *beforethis)
Definition: Fl_Type.cxx:569
Fl_Browser_::deselect
int deselect(int docallbacks=0)
Definition: Fl_Browser_.cxx:650
Widget_Browser::item_width
int item_width(void *) const
Definition: Fl_Type.cxx:420
Fl_Widget::w
int w() const
Definition: Fl_Widget.H:294
textdisplay_pixmap
static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm)
Fl_Type::is_group
virtual int is_group() const
Definition: Fl_Type.cxx:758
FL_FOREGROUND_COLOR
const Fl_Color FL_FOREGROUND_COLOR
the default foreground color (0) used for labels and text
Definition: Enumerations.H:937
Widget_Browser::incr_height
int incr_height() const
Definition: Fl_Type.cxx:289
Fl_Type.h
window_pixmap
static Fl_Pixmap window_pixmap(flWindow_xpm)
Fl_Type::header_position_end
int header_position_end
Definition: Fl_Type.h:77
delete_children
static void delete_children(Fl_Type *p)
Definition: Fl_Type.cxx:823
Fl_Widget::color
Fl_Color color() const
Definition: Fl_Widget.H:378
Widget_Browser::item_draw
void item_draw(void *, int, int, int, int) const
Definition: Fl_Type.cxx:323
p
static menustate * p
Definition: Fl_Menu.cxx:606
Fl_Type::comment
const char * comment()
Definition: Fl_Type.h:106
earlier_cb
void earlier_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:873
filebrowser_pixmap
static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm)
Fl_Type::Widget_Browser
friend class Widget_Browser
Definition: Fl_Type.h:45
Fl_Type::new_selected
char new_selected
Definition: Fl_Type.h:64
FL_DARK_GREEN
const Fl_Color FL_DARK_GREEN
Definition: Enumerations.H:965
Fl_Type::copy_properties
virtual void copy_properties()
Definition: Fl_Type.cxx:1116
undo_checkpoint
void undo_checkpoint()
Definition: undo.cxx:125
FL_MULTI_BROWSER
#define FL_MULTI_BROWSER
Definition: Fl_Browser_.H:36
Fl_Type::is_class
virtual int is_class() const
Definition: Fl_Type.cxx:764
Fl_Type::label_
const char * label_
Definition: Fl_Type.h:55
fl_loop
void fl_loop(int x, int y, int x1, int y1, int x2, int y2)
Definition: fl_draw.H:233
Fl_Type::user_data
const char * user_data() const
Definition: Fl_Type.h:102
fl_draw.H
utility header to pull drawing functions together
Fl_Pixmap
Definition: Fl_Pixmap.H:41
scrollbar_pixmap
static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm)
undo.h
Fl_Browser_.H
Fl_Type::type_name
virtual const char * type_name()=0
Widget_Browser
Definition: Fl_Type.cxx:206
strlcpy
#define strlcpy
Definition: flstring.h:84
copy_trunc
static char * copy_trunc(char *p, const char *str, int maxl, int quote)
Definition: Fl_Type.cxx:182
Fl_Type::is_window
virtual int is_window() const
Definition: Fl_Type.cxx:759
group_pixmap
static Fl_Pixmap group_pixmap(flGroup_xpm)
redraw_widget_browser
void redraw_widget_browser(Fl_Type *caller)
Definition: Fl_Type.cxx:232
data_pixmap
static Fl_Pixmap data_pixmap(flData_xpm)
Fl_Type::user_data_type_
const char * user_data_type_
Definition: Fl_Type.h:58
Fl_Type
Definition: Fl_Type.h:43
Fl_Type::write_comment_h
void write_comment_h(const char *ind="")
Definition: Fl_Type.cxx:1004
indent
const char * indent()
Definition: code.cxx:99
FL_PUSH
Definition: Enumerations.H:236
Fl_Browser_::hposition
int hposition() const
Definition: Fl_Browser_.H:238
declarationblock_pixmap
static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm)
write_close
void write_close(int n)
Definition: file.cxx:117
Fl_Widget::redraw
void redraw()
Definition: Fl.cxx:1782
menubutton_pixmap
static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm)
Fl_Widget
Definition: Fl_Widget.H:101
slider_pixmap
static Fl_Pixmap slider_pixmap(flSlider_xpm)
write_word
void write_word(const char *w)
Definition: file.cxx:58
Fl_Type::open
virtual void open()
Definition: Fl_Type.cxx:727
delete_all
void delete_all(int selected_only)
Definition: Fl_Type.cxx:833
Fl_Type::setlabel
virtual void setlabel(const char *)
Definition: Fl_Type.cxx:731
make_widget_browser
Fl_Widget * make_widget_browser(int x, int y, int w, int h)
Definition: Fl_Type.cxx:228
Fl_Browser_::find_item
void * find_item(int ypos)
Definition: Fl_Browser_.cxx:583
Widget_Browser::item_next
void * item_next(void *) const
Definition: Fl_Type.cxx:270
Fl_Browser_
Definition: Fl_Browser_.H:77
Fl_Type::is_menu_button
virtual int is_menu_button() const
Definition: Fl_Type.cxx:757
Fl::event_y
static int event_y()
Definition: Fl.H:603
dial_pixmap
static Fl_Pixmap dial_pixmap(flDial_xpm)
Fl_Type::read_property
virtual void read_property(const char *)
Definition: Fl_Type.cxx:965
scroll_pixmap
static Fl_Pixmap scroll_pixmap(flScroll_xpm)
deselect
void deselect()
Definition: Fl_Type.cxx:249
input_pixmap
static Fl_Pixmap input_pixmap(flInput_xpm)
Fl_Type::msgnum
int msgnum()
Definition: Fl_Type.cxx:633
Fl_Type::read_fdesign
virtual int read_fdesign(const char *, const char *)
Definition: Fl_Type.cxx:984
FL_SELECTION_COLOR
const Fl_Color FL_SELECTION_COLOR
the default selection/highlight color
Definition: Enumerations.H:940
comment_pixmap
static Fl_Pixmap comment_pixmap(flComment_xpm)
Fl_Pixmap::draw
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Definition: Fl_Pixmap.cxx:72
Fl_Browser_::inserting
void inserting(void *a, void *b)
Definition: Fl_Browser_.cxx:572
write_h
void write_h(const char *format,...)
Definition: code.cxx:272
help_pixmap
static Fl_Pixmap help_pixmap(flHelp_xpm)
Fl_Type::click_test
virtual Fl_Type * click_test(int, int)
Definition: Fl_Type.cxx:568
Fl::event_clicks
static int event_clicks()
Definition: Fl.H:645
FL_BOLD
const Fl_Font FL_BOLD
add this to helvetica, courier, or times
Definition: Enumerations.H:897
Fl_Type::move_before
void move_before(Fl_Type *)
Definition: Fl_Type.cxx:852
set_modflag
void set_modflag(int mf)
Definition: fluid.cxx:1687
Fl_Function_Type::has_signature
int has_signature(const char *, const char *) const
Definition: Fl_Function_Type.cxx:419
Fl_Type::last
static Fl_Type * last
Definition: Fl_Type.h:70
x
int x
Definition: test.c:73
button_pixmap
static Fl_Pixmap button_pixmap(flButton_xpm)
Fl_Widget::callback
Fl_Callback_p callback() const
Definition: Fl_Widget.H:561
Fl_Browser_::redraw_line
void redraw_line(void *item)
Definition: Fl_Browser_.cxx:126
storestring
int storestring(const char *n, const char *&p, int nostrip)
Definition: Fl_Type.cxx:670
Fl_Browser_::selection
void * selection() const
Definition: Fl_Browser_.H:185
Fl_Type::visible
char visible
Definition: Fl_Type.h:67
choice_pixmap
static Fl_Pixmap choice_pixmap(flChoice_xpm)
Fl_Type::remove_child
virtual void remove_child(Fl_Type *)
Definition: Fl_Type.cxx:571
Fl_Type::code_position_end
int code_position_end
Definition: Fl_Type.h:77
read_word
const char * read_word(int wantbrace)
Definition: file.cxx:230
select_all_cb
void select_all_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:775
Fl_Type::label
const char * label() const
Definition: Fl_Type.h:98
Fl_Type::name
const char * name() const
Definition: Fl_Type.h:96
y
int y
Definition: test.c:74
Fl_Type::write_comment_inline_c
void write_comment_inline_c(const char *ind=0L)
Definition: Fl_Type.cxx:1050
tile_pixmap
static Fl_Pixmap tile_pixmap(flTile_xpm)
spinner_pixmap
static Fl_Pixmap spinner_pixmap(flSpinner_xpm)
Fl_Type::is_value_input
virtual int is_value_input() const
Definition: Fl_Type.cxx:754
FL_GRAY
#define FL_GRAY
Definition: Enumerations.H:978
Fl_Type::code_position
int code_position
Definition: Fl_Type.h:76
Fl_Type::is_spinner
virtual int is_spinner() const
Definition: Fl_Type.cxx:751
Fl_Browser_::select_only
int select_only(void *item, int docallbacks=0)
Definition: Fl_Browser_.cxx:672
Fl_Widget::type
uchar type() const
Definition: Fl_Widget.H:274
Fl_Type::is_code
virtual int is_code() const
Definition: Fl_Type.cxx:760
pushedtitle
static Fl_Type * pushedtitle
Definition: Fl_Type.cxx:291
Widget_Browser::handle
int handle(int)
Definition: Fl_Type.cxx:475
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
selection_changed
void selection_changed(Fl_Type *new_current)
Definition: Fl_Widget_Type.cxx:1921
class_pixmap
static Fl_Pixmap class_pixmap(flClass_xpm)
malloc
voidp malloc()
Fl_Type::write_comment_c
void write_comment_c(const char *ind="")
Definition: Fl_Type.cxx:1027
valueslider_pixmap
static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm)
Y
static int Y
Definition: Fl_Tooltip.cxx:76
fixvisible
static void fixvisible(Fl_Type *p)
Definition: Fl_Type.cxx:557
Fl_CodeBlock_Type::is_public
virtual int is_public() const
Definition: Fl_Type.cxx:768
Fl_Browser_::textfont
Fl_Font textfont() const
Definition: Fl_Browser_.H:292
Fl_Type::prev
Fl_Type * prev
Definition: Fl_Type.h:71
repeatbutton_pixmap
static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm)
title
static const char * title
Definition: Fl_arg.cxx:55
Fl_Type::selected
char selected
Definition: Fl_Type.h:65
has_toplevel_function
int has_toplevel_function(const char *rtype, const char *sig)
Definition: Fl_Type.cxx:989
fl_lighter
Fl_Color fl_lighter(Fl_Color c)
Definition: Enumerations.H:991
redraw_browser
void redraw_browser()
Definition: Fl_Type.cxx:452
later_cb
void later_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:891
write_indent
void write_indent(int n)
Definition: file.cxx:103
menuitem_pixmap
static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm)
declaration_pixmap
static Fl_Pixmap declaration_pixmap(flDeclaration_xpm)
widgetclass_pixmap
static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm)
Fl_Type::factory
Fl_Type * factory
Definition: Fl_Type.h:73
length
png_uint_32 length
Definition: png.c:2173
valueinput_pixmap
static Fl_Pixmap valueinput_pixmap(flValueInput_xpm)
FL_RELEASE
Definition: Enumerations.H:244
codeblock_pixmap
static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm)
Widget_Browser::item_first
void * item_first() const
Definition: Fl_Type.cxx:268
Fl_Type::is_valuator
virtual int is_valuator() const
Definition: Fl_Type.cxx:750
FL_CTRL
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:559
checkbrowser_pixmap
static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm)
table_pixmap
static Fl_Pixmap table_pixmap(flTable_xpm)
select_only
void select_only(Fl_Type *o)
Definition: Fl_Type.cxx:245
wizard_pixmap
static Fl_Pixmap wizard_pixmap(flWizard_xpm)
Fl_Type::is_input
virtual int is_input() const
Definition: Fl_Type.cxx:753
menubar_pixmap
static Fl_Pixmap menubar_pixmap(flMenubar_xpm)
Fl_Type::remove
Fl_Type * remove()
Definition: Fl_Type.cxx:650
Fl_Class_Type
Definition: Fl_Type.h:338
Fl_Function_Type
Definition: Fl_Type.h:165
Fl_Code_Type::is_public
virtual int is_public() const
Definition: Fl_Type.cxx:767
Fl_Browser_::handle
int handle(int event)
Definition: Fl_Browser_.cxx:693
fl_polygon
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Definition: fl_draw.H:244
Fl_Type::header_position
int header_position
Definition: Fl_Type.h:76
Fl::event_inside
static int event_inside(int, int, int, int)
Definition: Fl.cxx:227
progress_pixmap
static Fl_Pixmap progress_pixmap(flProgress_xpm)
returnbutton_pixmap
static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm)
Fl_Type::pixmapID
virtual int pixmapID()
Definition: Fl_Type.h:159