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)  

fluid.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // FLUID main entry for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2017 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 #include <FL/Fl.H>
20 #include <FL/Fl_Double_Window.H>
21 #include <FL/Fl_Box.H>
22 #include <FL/Fl_Button.H>
23 #include <FL/Fl_File_Icon.H>
24 #include <FL/Fl_Help_Dialog.H>
25 #include <FL/Fl_Hold_Browser.H>
26 #include <FL/Fl_Menu_Bar.H>
27 #include <FL/Fl_Input.H>
28 #include <FL/Fl_Plugin.H>
29 #include <FL/fl_ask.H>
30 #include <FL/fl_draw.H>
31 #include <FL/Fl_File_Chooser.H>
32 #include <FL/Fl_PNG_Image.H>
33 #include <FL/fl_message.H>
34 #include <FL/filename.H>
36 #include <FL/Fl_Printer.H>
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include <errno.h>
40 #include <sys/stat.h>
41 #include <time.h> // time(), localtime(), etc.
42 
43 #include "../src/flstring.h"
44 #include "alignment_panel.h"
45 #include "function_panel.h"
46 #include "template_panel.h"
47 
48 #if defined(WIN32) && !defined(__CYGWIN__)
49 # include <direct.h>
50 # include <windows.h>
51 # include <io.h>
52 # include <fcntl.h>
53 # include <commdlg.h>
54 # include <FL/x.H>
55 # ifndef __WATCOMC__
56 // Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs
57 // on Windows, which is supposed to be POSIX compliant...
58 # define access _access
59 # define chdir _chdir
60 # define getcwd _getcwd
61 # endif // !__WATCOMC__
62 #else
63 # include <unistd.h>
64 #endif
65 #ifdef __EMX__
66 # include <X11/Xlibint.h>
67 #endif
68 
69 #include "about_panel.h"
70 #include "undo.h"
71 
72 #include "Fl_Type.h"
73 
74 extern "C"
75 {
76 #if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ)
77 # include <zlib.h>
78 # ifdef HAVE_PNG_H
79 # include <png.h>
80 # else
81 # include <libpng/png.h>
82 # endif // HAVE_PNG_H
83 #endif // HAVE_LIBPNG && HAVE_LIBZ
84 }
85 
86 //
87 // Globals..
88 //
90 
91 Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid");
92 int gridx = 5;
93 int gridy = 5;
94 int snap = 1;
95 int show_guides = 1;
96 int show_comments = 1;
98 int G_debug = 0;
101 
102 // File history info...
105 
106 void load_history();
107 void update_history(const char *);
108 
109 // Shell command support...
110 void show_shell_window();
111 
116 
118 
119 static const char *filename;
120 void set_filename(const char *c);
121 void set_modflag(int mf);
123 
124 static char* pwd;
125 static char in_source_dir;
127  if (in_source_dir) return;
128  if (!filename || !*filename) return;
129  const char *p = fl_filename_name(filename);
130  if (p <= filename) return; // it is in the current directory
131  char buffer[FL_PATH_MAX];
132  strlcpy(buffer, filename, sizeof(buffer));
133  int n = (int)(p-filename); if (n>1) n--; buffer[n] = 0;
134  if (!pwd) {
135  pwd = getcwd(0,FL_PATH_MAX);
136  if (!pwd) {fprintf(stderr,"getwd : %s\n",strerror(errno)); return;}
137  }
138  if (chdir(buffer)<0) {fprintf(stderr, "Can't chdir to %s : %s\n",
139  buffer, strerror(errno)); return;}
140  in_source_dir = 1;
141 }
142 
144  if (!in_source_dir) return;
145  if (chdir(pwd)<0) {fprintf(stderr, "Can't chdir to %s : %s\n",
146  pwd, strerror(errno));}
147  in_source_dir = 0;
148 }
149 
150 char position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W=0, int H=0 ) {
151  Fl_Preferences pos(fluid_prefs, prefsName);
152  if (prevpos_button->value()) {
153  pos.get("x", X, X);
154  pos.get("y", Y, Y);
155  if ( W!=0 ) {
156  pos.get("w", W, W);
157  pos.get("h", H, H);
158  w->resize( X, Y, W, H );
159  }
160  else
161  w->position( X, Y );
162  }
163  pos.get("visible", Visible, Visible);
164  return Visible;
165 }
166 
167 void save_position(Fl_Window *w, const char *prefsName) {
168  Fl_Preferences pos(fluid_prefs, prefsName);
169  pos.set("x", w->x());
170  pos.set("y", w->y());
171  pos.set("w", w->w());
172  pos.set("h", w->h());
173  pos.set("visible", (int)(w->shown() && w->visible()));
174 }
175 
178 
179 static char* cutfname(int which = 0) {
180  static char name[2][FL_PATH_MAX];
181  static char beenhere = 0;
182 
183  if (!beenhere) {
184  beenhere = 1;
185  fluid_prefs.getUserdataPath(name[0], sizeof(name[0]));
186  strlcat(name[0], "cut_buffer", sizeof(name[0]));
187  fluid_prefs.getUserdataPath(name[1], sizeof(name[1]));
188  strlcat(name[1], "dup_buffer", sizeof(name[1]));
189  }
190 
191  return name[which];
192 }
193 
194 // Timer to watch for external editor modifications
195 // If one or more external editors open, check if their files were modified.
196 // If so: reload to ram, update size/mtime records, and change fluid's 'modified' state.
197 //
198 static void external_editor_timer(void*) {
199  int editors_open = ExternalCodeEditor::editors_open();
200  if ( G_debug ) printf("--- TIMER --- External editors open=%d\n", editors_open);
201  if ( editors_open > 0 ) {
202  // Walk tree looking for files modified by external editors.
203  int modified = 0;
204  for (Fl_Type *p = Fl_Type::first; p; p = p->next) {
205  if ( p->is_code() ) {
207  // Code changed by external editor?
208  if ( code->handle_editor_changes() ) { // updates ram, file size/mtime
209  modified++;
210  }
211  if ( code->is_editing() ) { // editor open?
212  code->reap_editor(); // Try to reap; maybe it recently closed
213  }
214  }
215  }
216  if ( modified ) set_modflag(1);
217  }
218  // Repeat timeout if editors still open
219  // The ExternalCodeEditor class handles start/stopping timer, we just
220  // repeat_timeout() if it's already on. NOTE: above code may have reaped
221  // only open editor, which would disable further timeouts. So *recheck*
222  // if editors still open, to ensure we don't accidentally re-enable them.
223  //
226  }
227 }
228 
229 void save_cb(Fl_Widget *, void *v) {
231  const char *c = filename;
232  if (v || !c || !*c) {
233  fnfc.title("Save To:");
235  fnfc.filter("FLUID Files\t*.f[ld]");
236  if (fnfc.show() != 0) return;
237  c = fnfc.filename();
238  if (!access(c, 0)) {
239  const char *basename;
240  if ((basename = strrchr(c, '/')) != NULL)
241  basename ++;
242 #if defined(WIN32) || defined(__EMX__)
243  if ((basename = strrchr(c, '\\')) != NULL)
244  basename ++;
245 #endif // WIN32 || __EMX__
246  else
247  basename = c;
248 
249  if (fl_choice("The file \"%s\" already exists.\n"
250  "Do you want to replace it?", "Cancel",
251  "Replace", NULL, basename) == 0) return;
252  }
253 
254  if (v != (void *)2) set_filename(c);
255  }
256  if (!write_file(c)) {
257  fl_alert("Error writing %s: %s", c, strerror(errno));
258  return;
259  }
260 
261  if (v != (void *)2) {
262  set_modflag(0);
264  }
265 }
266 
267 void save_template_cb(Fl_Widget *, void *) {
268  // Setup the template panel...
270 
271  template_clear();
272  template_browser->add("New Template");
273  template_load();
274 
275  template_name->show();
276  template_name->value("");
277 
279 
282 
283  template_submit->label("Save");
285 
286  template_panel->label("Save Template");
287 
288  // Show the panel and wait for the user to do something...
289  template_panel->show();
290  while (template_panel->shown()) Fl::wait();
291 
292  // Get the template name, return if it is empty...
293  const char *c = template_name->value();
294  if (!c || !*c) return;
295 
296  // Convert template name to filename_with_underscores
297  char safename[FL_PATH_MAX], *safeptr;
298  strlcpy(safename, c, sizeof(safename));
299  for (safeptr = safename; *safeptr; safeptr ++) {
300  if (isspace(*safeptr)) *safeptr = '_';
301  }
302 
303  // Find the templates directory...
304  char filename[FL_PATH_MAX];
306 
307  strlcat(filename, "templates", sizeof(filename));
308 #if defined(WIN32) && !defined(__CYGWIN__)
309  if (access(filename, 0)) mkdir(filename);
310 #else
311  if (access(filename, 0)) mkdir(filename, 0777);
312 #endif // WIN32 && !__CYGWIN__
313 
314  strlcat(filename, "/", sizeof(filename));
315  strlcat(filename, safename, sizeof(filename));
316 
317  char *ext = filename + strlen(filename);
318  if (ext >= (filename + sizeof(filename) - 5)) {
319  fl_alert("The template name \"%s\" is too long!", c);
320  return;
321  }
322 
323  // Save the .fl file...
324  strcpy(ext, ".fl");
325 
326  if (!access(filename, 0)) {
327  if (fl_choice("The template \"%s\" already exists.\n"
328  "Do you want to replace it?", "Cancel",
329  "Replace", NULL, c) == 0) return;
330  }
331 
332  if (!write_file(filename)) {
333  fl_alert("Error writing %s: %s", filename, strerror(errno));
334  return;
335  }
336 
337 #if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ)
338  // Get the screenshot, if any...
339  Fl_Type *t;
340 
341  for (t = Fl_Type::first; t; t = t->next) {
342  // Find the first window...
343  if (t->is_window()) break;
344  }
345 
346  if (!t) return;
347 
348  // Grab a screenshot...
349  Fl_Window_Type *wt = (Fl_Window_Type *)t;
350  uchar *pixels;
351  int w, h;
352 
353  if ((pixels = wt->read_image(w, h)) == NULL) return;
354 
355  // Save to a PNG file...
356  strcpy(ext, ".png");
357 
358  FILE *fp;
359 
360  if ((fp = fl_fopen(filename, "wb")) == NULL) {
361  delete[] pixels;
362  fl_alert("Error writing %s: %s", filename, strerror(errno));
363  return;
364  }
365 
367  png_infop iptr = png_create_info_struct(pptr);
368  png_bytep ptr = (png_bytep)pixels;
369 
370  png_init_io(pptr, fp);
371  png_set_IHDR(pptr, iptr, w, h, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
374 
375  png_write_info(pptr, iptr);
376 
377  for (int i = h; i > 0; i --, ptr += w * 3) {
378  png_write_row(pptr, ptr);
379  }
380 
381  png_write_end(pptr, iptr);
382  png_destroy_write_struct(&pptr, &iptr);
383 
384  fclose(fp);
385 
386 # if 0 // The original PPM output code...
387  strcpy(ext, ".ppm");
388  fp = fl_fopen(filename, "wb");
389  fprintf(fp, "P6\n%d %d 255\n", w, h);
390  fwrite(pixels, w * h, 3, fp);
391  fclose(fp);
392 # endif // 0
393 
394  delete[] pixels;
395 #endif // HAVE_LIBPNG && HAVE_LIBZ
396 }
397 
398 void revert_cb(Fl_Widget *,void *) {
399  if (modflag) {
400  if (!fl_choice("This user interface has been changed. Really revert?",
401  "Cancel", "Revert", NULL)) return;
402  }
403  undo_suspend();
404  if (!read_file(filename, 0)) {
405  undo_resume();
406  fl_message("Can't read %s: %s", filename, strerror(errno));
407  return;
408  }
409  undo_resume();
410  set_modflag(0);
411  undo_clear();
412 }
413 
414 void exit_cb(Fl_Widget *,void *) {
415 
416  // Stop any external editor update timers
418 
419  if (modflag)
420  switch (fl_choice("Do you want to save changes to this user\n"
421  "interface before exiting?", "Cancel",
422  "Save", "Don't Save"))
423  {
424  case 0 : /* Cancel */
425  return;
426  case 1 : /* Save */
427  save_cb(NULL, NULL);
428  if (modflag) return; // Didn't save!
429  }
430 
431  save_position(main_window,"main_window_pos");
432 
433  if (widgetbin_panel) {
434  save_position(widgetbin_panel,"widgetbin_pos");
435  delete widgetbin_panel;
436  }
437  if (sourceview_panel) {
438  Fl_Preferences svp(fluid_prefs, "sourceview");
439  svp.set("autorefresh", sv_autorefresh->value());
440  svp.set("autoposition", sv_autoposition->value());
441  svp.set("tab", sv_tab->find(sv_tab->value()));
442  save_position(sourceview_panel,"sourceview_pos");
443  delete sourceview_panel;
444  sourceview_panel = 0;
445  }
446  if (about_panel)
447  delete about_panel;
448  if (help_dialog)
449  delete help_dialog;
450 
451  undo_clear();
452 
453  // Destroy tree
454  // Doing so causes dtors to automatically close all external editors
455  // and cleans up editor tmp files. Then remove fluid tmpdir /last/.
456  delete_all();
458 
459  exit(0);
460 }
461 
462 #ifdef __APPLE__
463 # include <FL/x.H>
464 
465 void
466 apple_open_cb(const char *c) {
467  if (modflag) {
468  switch (fl_choice("Do you want to save changes to this user\n"
469  "interface before opening another one?", "Don't Save",
470  "Save", "Cancel"))
471  {
472  case 0 : /* Cancel */
473  return;
474  case 1 : /* Save */
475  save_cb(NULL, NULL);
476  if (modflag) return; // Didn't save!
477  }
478  }
479  const char *oldfilename;
480  oldfilename = filename;
481  filename = NULL;
482  set_filename(c);
483  undo_suspend();
484  if (!read_file(c, 0)) {
485  undo_resume();
486  fl_message("Can't read %s: %s", c, strerror(errno));
487  free((void *)filename);
488  filename = oldfilename;
490  return;
491  }
492 
493  // Loaded a file; free the old filename...
494  set_modflag(0);
495  undo_resume();
496  undo_clear();
497  if (oldfilename) free((void *)oldfilename);
498 }
499 #endif // __APPLE__
500 
501 void open_cb(Fl_Widget *, void *v) {
502  if (!v && modflag) {
503  switch (fl_choice("Do you want to save changes to this user\n"
504  "interface before opening another one?", "Cancel",
505  "Save", "Don't Save"))
506  {
507  case 0 : /* Cancel */
508  return;
509  case 1 : /* Save */
510  save_cb(NULL, NULL);
511  if (modflag) return; // Didn't save!
512  }
513  }
514  const char *c;
515  const char *oldfilename;
517  fnfc.title("Open:");
519  fnfc.filter("FLUID Files\t*.f[ld]\n");
520  if (fnfc.show() != 0) return;
521  c = fnfc.filename();
522  oldfilename = filename;
523  filename = NULL;
524  set_filename(c);
525  if (v != 0) undo_checkpoint();
526  undo_suspend();
527  if (!read_file(c, v!=0)) {
528  undo_resume();
529  fl_message("Can't read %s: %s", c, strerror(errno));
530  free((void *)filename);
531  filename = oldfilename;
533  return;
534  }
535  undo_resume();
536  if (v) {
537  // Inserting a file; restore the original filename...
538  free((void *)filename);
539  filename = oldfilename;
540  set_modflag(1);
541  } else {
542  // Loaded a file; free the old filename...
543  set_modflag(0);
544  undo_clear();
545  if (oldfilename) free((void *)oldfilename);
546  }
547 }
548 
549 void open_history_cb(Fl_Widget *, void *v) {
550  if (modflag) {
551  switch (fl_choice("Do you want to save changes to this user\n"
552  "interface before opening another one?", "Cancel",
553  "Save", "Don't Save"))
554  {
555  case 0 : /* Cancel */
556  return;
557  case 1 : /* Save */
558  save_cb(NULL, NULL);
559  if (modflag) return; // Didn't save!
560  }
561  }
562  const char *oldfilename = filename;
563  filename = NULL;
564  set_filename((char *)v);
565  undo_suspend();
566  if (!read_file(filename, 0)) {
567  undo_resume();
568  undo_clear();
569  fl_message("Can't read %s: %s", filename, strerror(errno));
570  free((void *)filename);
571  filename = oldfilename;
573  return;
574  }
575  set_modflag(0);
576  undo_resume();
577  undo_clear();
578  if (oldfilename) free((void *)oldfilename);
579 }
580 
581 void new_cb(Fl_Widget *, void *v) {
582  // Check if the current file has been modified...
583  if (!v && modflag) {
584  // Yes, ask the user what to do...
585  switch (fl_choice("Do you want to save changes to this user\n"
586  "interface before creating a new one?", "Cancel",
587  "Save", "Don't Save"))
588  {
589  case 0 : /* Cancel */
590  return;
591  case 1 : /* Save */
592  save_cb(NULL, NULL);
593  if (modflag) return; // Didn't save!
594  }
595  }
596 
597  // Setup the template panel...
599 
600  template_clear();
601  template_browser->add("Blank");
602  template_load();
603 
604  template_name->hide();
605  template_name->value("");
606 
610 
612 
613  template_submit->label("New");
615 
616  template_panel->label("New");
617 
618  if ( template_browser->size() == 1 ) { // only one item?
619  template_browser->value(1); // select it
621  }
622 
623  // Show the panel and wait for the user to do something...
624  template_panel->show();
625  while (template_panel->shown()) Fl::wait();
626 
627  // See if the user chose anything...
628  int item = template_browser->value();
629  if (item < 1) return;
630 
631  // Clear the current data...
632  delete_all();
634 
635  // Load the template, if any...
636  const char *tname = (const char *)template_browser->data(item);
637 
638  if (tname) {
639  // Grab the instance name...
640  const char *iname = template_instance->value();
641 
642  if (iname && *iname) {
643  // Copy the template to a temp file, then read it in...
644  char line[1024], *ptr, *next;
645  FILE *infile, *outfile;
646 
647  if ((infile = fl_fopen(tname, "r")) == NULL) {
648  fl_alert("Error reading template file \"%s\":\n%s", tname,
649  strerror(errno));
650  set_modflag(0);
651  undo_clear();
652  return;
653  }
654 
655  if ((outfile = fl_fopen(cutfname(1), "w")) == NULL) {
656  fl_alert("Error writing buffer file \"%s\":\n%s", cutfname(1),
657  strerror(errno));
658  fclose(infile);
659  set_modflag(0);
660  undo_clear();
661  return;
662  }
663 
664  while (fgets(line, sizeof(line), infile)) {
665  // Replace @INSTANCE@ with the instance name...
666  for (ptr = line; (next = strstr(ptr, "@INSTANCE@")) != NULL; ptr = next + 10) {
667  fwrite(ptr, next - ptr, 1, outfile);
668  fputs(iname, outfile);
669  }
670 
671  fputs(ptr, outfile);
672  }
673 
674  fclose(infile);
675  fclose(outfile);
676 
677  undo_suspend();
678  read_file(cutfname(1), 0);
679  unlink(cutfname(1));
680  undo_resume();
681  } else {
682  // No instance name, so read the template without replacements...
683  undo_suspend();
684  read_file(tname, 0);
685  undo_resume();
686  }
687  }
688 
689  set_modflag(0);
690  undo_clear();
691 }
692 
693 int exit_early = 0;
694 int update_file = 0; // fluid -u
695 int compile_file = 0; // fluid -c
696 int compile_strings = 0; // fluic -cs
697 int batch_mode = 0; // if set (-c, -u) don't open display
700 const char* header_file_name = ".h";
701 const char* code_file_name = ".cxx";
702 int i18n_type = 0;
703 const char* i18n_include = "";
704 const char* i18n_function = "";
705 const char* i18n_file = "";
706 const char* i18n_set = "";
708 
709 void write_cb(Fl_Widget *, void *) {
710  if (!filename) {
711  save_cb(0,0);
712  if (!filename) return;
713  }
714  char cname[FL_PATH_MAX];
715  char hname[FL_PATH_MAX];
718  if (*code_file_name == '.' && strchr(code_file_name, '/') == NULL) {
719  strlcpy(cname, fl_filename_name(filename), sizeof(cname));
720  fl_filename_setext(cname, sizeof(cname), code_file_name);
721  } else {
722  strlcpy(cname, code_file_name, sizeof(hname));
723  }
724  if (*header_file_name == '.' && strchr(header_file_name, '/') == NULL) {
725  strlcpy(hname, fl_filename_name(filename), sizeof(hname));
726  fl_filename_setext(hname, sizeof(hname), header_file_name);
727  } else {
728  strlcpy(hname, header_file_name, sizeof(hname));
729  }
730  if (!batch_mode) goto_source_dir();
731  int x = write_code(cname,hname);
733  strlcat(cname, " and ", sizeof(cname));
734  strlcat(cname, hname, sizeof(cname));
735  if (batch_mode) {
736  if (!x) {fprintf(stderr,"%s : %s\n",cname,strerror(errno)); exit(1);}
737  } else {
738  if (!x) {
739  fl_message("Can't write %s: %s", cname, strerror(errno));
740  } else if (completion_button->value()) {
741  fl_message("Wrote %s", cname);
742  }
743  }
744 }
745 
746 void write_strings_cb(Fl_Widget *, void *) {
747  static const char *exts[] = { ".txt", ".po", ".msg" };
748  if (!filename) {
749  save_cb(0,0);
750  if (!filename) return;
751  }
752  char sname[FL_PATH_MAX];
753  strlcpy(sname, fl_filename_name(filename), sizeof(sname));
754  fl_filename_setext(sname, sizeof(sname), exts[i18n_type]);
755  if (!batch_mode) goto_source_dir();
756  int x = write_strings(sname);
758  if (batch_mode) {
759  if (x) {fprintf(stderr,"%s : %s\n",sname,strerror(errno)); exit(1);}
760  } else {
761  if (x) {
762  fl_message("Can't write %s: %s", sname, strerror(errno));
763  } else if (completion_button->value()) {
764  fl_message("Wrote %s", sname);
765  }
766  }
767 }
768 
769 void openwidget_cb(Fl_Widget *, void *) {
770  if (!Fl_Type::current) {
771  fl_message("Please select a widget");
772  return;
773  }
775 }
776 
777 void toggle_overlays(Fl_Widget *,void *);
778 
779 void select_all_cb(Fl_Widget *,void *);
780 void select_none_cb(Fl_Widget *,void *);
781 
782 void group_cb(Fl_Widget *, void *);
783 
784 void ungroup_cb(Fl_Widget *, void *);
785 
786 extern int pasteoffset;
787 static int ipasteoffset;
788 
789 void copy_cb(Fl_Widget*, void*) {
790  if (!Fl_Type::current) {
791  fl_beep();
792  return;
793  }
794  ipasteoffset = 10;
795  if (!write_file(cutfname(),1)) {
796  fl_message("Can't write %s: %s", cutfname(), strerror(errno));
797  return;
798  }
799 }
800 
801 extern void select_only(Fl_Type *);
802 void cut_cb(Fl_Widget *, void *) {
803  if (!Fl_Type::current) {
804  fl_beep();
805  return;
806  }
807  if (!write_file(cutfname(),1)) {
808  fl_message("Can't write %s: %s", cutfname(), strerror(errno));
809  return;
810  }
811  undo_checkpoint();
812  set_modflag(1);
813  ipasteoffset = 0;
815  while (p && p->selected) p = p->parent;
816  delete_all(1);
817  if (p) select_only(p);
818 }
819 
820 void delete_cb(Fl_Widget *, void *) {
821  if (!Fl_Type::current) {
822  fl_beep();
823  return;
824  }
825  undo_checkpoint();
826  set_modflag(1);
827  ipasteoffset = 0;
829  while (p && p->selected) p = p->parent;
830  delete_all(1);
831  if (p) select_only(p);
832 }
833 
834 extern int force_parent;
835 
836 void paste_cb(Fl_Widget*, void*) {
837  //if (ipasteoffset) force_parent = 1;
839  if (gridx>1) pasteoffset = ((pasteoffset-1)/gridx+1)*gridx;
840  if (gridy>1) pasteoffset = ((pasteoffset-1)/gridy+1)*gridy;
841  undo_checkpoint();
842  undo_suspend();
843  if (!read_file(cutfname(), 1)) {
844  fl_message("Can't read %s: %s", cutfname(), strerror(errno));
845  }
846  undo_resume();
847  pasteoffset = 0;
848  ipasteoffset += 10;
849  force_parent = 0;
850 }
851 
852 // Duplicate the selected widgets...
853 void duplicate_cb(Fl_Widget*, void*) {
854  if (!Fl_Type::current) {
855  fl_beep();
856  return;
857  }
858 
859  if (!write_file(cutfname(1),1)) {
860  fl_message("Can't write %s: %s", cutfname(1), strerror(errno));
861  return;
862  }
863 
864  pasteoffset = 0;
865  force_parent = 1;
866 
867  undo_checkpoint();
868  undo_suspend();
869  if (!read_file(cutfname(1), 1)) {
870  fl_message("Can't read %s: %s", cutfname(1), strerror(errno));
871  }
872  unlink(cutfname(1));
873  undo_resume();
874 
875  force_parent = 0;
876 }
877 
878 void earlier_cb(Fl_Widget*,void*);
879 
880 void later_cb(Fl_Widget*,void*);
881 
882 Fl_Type *sort(Fl_Type *parent);
883 
884 static void sort_cb(Fl_Widget *,void *) {
885  sort((Fl_Type*)0);
886 }
887 
888 void show_project_cb(Fl_Widget *, void *);
889 void show_grid_cb(Fl_Widget *, void *);
890 void show_settings_cb(Fl_Widget *, void *);
891 void show_global_settings_cb(Fl_Widget *, void *);
892 
893 void align_widget_cb(Fl_Widget *, long);
894 void widget_size_cb(Fl_Widget *, long);
895 
896 void about_cb(Fl_Widget *, void *) {
898  about_panel->show();
899 }
900 
901 void show_help(const char *name) {
902  const char *docdir;
903  char helpname[FL_PATH_MAX];
904 
905  if (!help_dialog) help_dialog = new Fl_Help_Dialog();
906 
907  if ((docdir = getenv("FLTK_DOCDIR")) == NULL) {
908 #ifdef __EMX__
909  // Doesn't make sense to have a hardcoded fallback
910  static char fltk_docdir[FL_PATH_MAX];
911 
912  strlcpy(fltk_docdir, __XOS2RedirRoot("/XFree86/lib/X11/fltk/doc"),
913  sizeof(fltk_docdir));
914 
915  docdir = fltk_docdir;
916 #else
917  docdir = FLTK_DOCDIR;
918 #endif // __EMX__
919  }
920  snprintf(helpname, sizeof(helpname), "%s/%s", docdir, name);
921 
922  // make sure that we can read the file
923  FILE *f = fopen(helpname, "rb");
924  if (f) {
925  fclose(f);
926  help_dialog->load(helpname);
927  } else {
928  // if we can not read the file, we display the canned version instead
929  // or ask the native browser to open the page on www.fltk.org
930  if (strcmp(name, "fluid.html")==0) {
931  if (!Fl_Shared_Image::find("embedded:/fluid-org.png"))
932  new Fl_PNG_Image("embedded:/fluid-org.png", fluid_org_png, sizeof(fluid_org_png));
934  (
935  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
936  "<html><head><title>FLTK: Programming with FLUID</title></head><body>\n"
937  "<h2>What is FLUID?</h2>\n"
938  "The Fast Light User Interface Designer, or FLUID, is a graphical editor "
939  "that is used to produce FLTK source code. FLUID edits and saves its state "
940  "in <code>.fl</code> files. These files are text, and you can (with care) "
941  "edit them in a text editor, perhaps to get some special effects.<p>\n"
942  "FLUID can \"compile\" the <code>.fl</code> file into a <code>.cxx</code> "
943  "and a <code>.h</code> file. The <code>.cxx</code> file defines all the "
944  "objects from the <code>.fl</code> file and the <code>.h</code> file "
945  "declares all the global ones. FLUID also supports localization "
946  "(Internationalization) of label strings using message files and the GNU "
947  "gettext or POSIX catgets interfaces.<p>\n"
948  "A simple program can be made by putting all your code (including a <code>"
949  "main()</code> function) into the <code>.fl</code> file and thus making the "
950  "<code>.cxx</code> file a single source file to compile. Most programs are "
951  "more complex than this, so you write other <code>.cxx</code> files that "
952  "call the FLUID functions. These <code>.cxx</code> files must <code>"
953  "#include</code> the <code>.h</code> file or they can <code>#include</code> "
954  "the <code>.cxx</code> file so it still appears to be a single source file.<p>"
955  "<img src=\"embedded:/fluid-org.png\"></p>"
956  "<p>More information is available online at <a href="
957  "\"http://www.fltk.org/doc-1.3/fluid.html\">http://www.fltk.org/</a>"
958  "</body></html>"
959  );
960  } else if (strcmp(name, "license.html")==0) {
961  fl_open_uri("http://www.fltk.org/doc-1.3/license.html");
962  return;
963  } else if (strcmp(name, "index.html")==0) {
964  fl_open_uri("http://www.fltk.org/doc-1.3/index.html");
965  return;
966  } else {
967  snprintf(helpname, sizeof(helpname), "http://www.fltk.org/%s", name);
968  fl_open_uri(helpname);
969  return;
970  }
971  }
972  help_dialog->show();
973 }
974 
975 void help_cb(Fl_Widget *, void *) {
976  show_help("fluid.html");
977 }
978 
979 void manual_cb(Fl_Widget *, void *) {
980  show_help("index.html");
981 }
982 
983 
985 void print_menu_cb(Fl_Widget *, void *) {
986  int w, h, ww, hh;
987  int frompage, topage;
988  Fl_Type *t; // Current widget
989  int num_windows; // Number of windows
990  Fl_Window_Type *windows[1000]; // Windows to print
991  int winpage; // Current window page
992  Fl_Window *win;
993 
994  for (t = Fl_Type::first, num_windows = 0; t; t = t->next) {
995  if (t->is_window()) {
996  windows[num_windows] = (Fl_Window_Type *)t;
997  if (!((Fl_Window*)(windows[num_windows]->o))->shown()) continue;
998  num_windows ++;
999  }
1000  }
1001 
1002  Fl_Printer printjob;
1003  if ( printjob.start_job(num_windows, &frompage, &topage) ) return;
1004  int pagecount = 0;
1005  for (winpage = 0; winpage < num_windows; winpage++) {
1006  float scale = 1, scale_x = 1, scale_y = 1;
1007  if (winpage+1 < frompage || winpage+1 > topage) continue;
1008  printjob.start_page();
1009  printjob.printable_rect(&w, &h);
1010  // Get the time and date...
1011  time_t curtime = time(NULL);
1012  struct tm *curdate = localtime(&curtime);
1013  char date[1024];
1014  strftime(date, sizeof(date), "%c", curdate);
1015  fl_font(FL_HELVETICA, 12);
1016  fl_color(FL_BLACK);
1017  fl_draw(date, (w - (int)fl_width(date))/2, fl_height());
1018  sprintf(date, "%d/%d", ++pagecount, topage-frompage+1);
1019  fl_draw(date, w - (int)fl_width(date), fl_height());
1020  // Get the base filename...
1021  const char *basename = strrchr(filename,
1022 #ifdef WIN32
1023  '\\'
1024 #else
1025  '/'
1026 #endif
1027  );
1028  if (basename) basename ++;
1029  else basename = filename;
1030  sprintf(date, "%s", basename);
1031  fl_draw(date, 0, fl_height());
1032 // print centered and scaled to fit in the page
1033  win = (Fl_Window*)windows[winpage]->o;
1034  ww = win->decorated_w();
1035  if(ww > w) scale_x = float(w)/ww;
1036  hh = win->decorated_h();
1037  if(hh > h) scale_y = float(h)/hh;
1038  if (scale_x < scale) scale = scale_x;
1039  if (scale_y < scale) scale = scale_y;
1040  if (scale < 1) {
1041  printjob.scale(scale);
1042  printjob.printable_rect(&w, &h);
1043  }
1044  printjob.origin(w/2, h/2);
1045  printjob.print_window(win, -ww/2, -hh/2);
1046  printjob.end_page();
1047  }
1048  printjob.end_job();
1049 }
1050 
1052 
1053 extern Fl_Menu_Item New_Menu[];
1054 
1055 void toggle_widgetbin_cb(Fl_Widget *, void *);
1056 void toggle_sourceview_cb(Fl_Double_Window *, void *);
1057 
1059 {"&File",0,0,0,FL_SUBMENU},
1060  {"&New...", FL_COMMAND+'n', new_cb, 0},
1061  {"&Open...", FL_COMMAND+'o', open_cb, 0},
1062  {"&Insert...", FL_COMMAND+'i', open_cb, (void*)1, FL_MENU_DIVIDER},
1063  {"&Save", FL_COMMAND+'s', save_cb, 0},
1064  {"Save &As...", FL_COMMAND+FL_SHIFT+'s', save_cb, (void*)1},
1065  {"Sa&ve A Copy...", 0, save_cb, (void*)2},
1066  {"Save &Template...", 0, save_template_cb},
1067  {"&Revert...", 0, revert_cb, 0, FL_MENU_DIVIDER},
1068  {"&Print...", FL_COMMAND+'p', print_menu_cb},
1069  {"Write &Code...", FL_COMMAND+FL_SHIFT+'c', write_cb, 0},
1070  {"&Write Strings...", FL_COMMAND+FL_SHIFT+'w', write_strings_cb, 0, FL_MENU_DIVIDER},
1081  {"&Quit", FL_COMMAND+'q', exit_cb},
1082  {0},
1083 {"&Edit",0,0,0,FL_SUBMENU},
1084  {"&Undo", FL_COMMAND+'z', undo_cb},
1085  {"&Redo", FL_COMMAND+FL_SHIFT+'z', redo_cb, 0, FL_MENU_DIVIDER},
1086  {"C&ut", FL_COMMAND+'x', cut_cb},
1087  {"&Copy", FL_COMMAND+'c', copy_cb},
1088  {"&Paste", FL_COMMAND+'v', paste_cb},
1089  {"Dup&licate", FL_COMMAND+'u', duplicate_cb},
1090  {"&Delete", FL_Delete, delete_cb, 0, FL_MENU_DIVIDER},
1091  {"Select &All", FL_COMMAND+'a', select_all_cb},
1092  {"Select &None", FL_COMMAND+FL_SHIFT+'a', select_none_cb, 0, FL_MENU_DIVIDER},
1093  {"Pr&operties...", FL_F+1, openwidget_cb},
1094  {"&Sort",0,sort_cb},
1095  {"&Earlier", FL_F+2, earlier_cb},
1096  {"&Later", FL_F+3, later_cb},
1097  {"&Group", FL_F+7, group_cb},
1098  {"Ung&roup", FL_F+8, ungroup_cb,0, FL_MENU_DIVIDER},
1099  {"Hide O&verlays",FL_COMMAND+FL_SHIFT+'o',toggle_overlays},
1100  {"Show Widget &Bin...",FL_ALT+'b',toggle_widgetbin_cb},
1101  {"Show Source Code...",FL_ALT+FL_SHIFT+'s', (Fl_Callback*)toggle_sourceview_cb, 0, FL_MENU_DIVIDER},
1102  {"Pro&ject Settings...",FL_ALT+'p',show_project_cb},
1103  {"GU&I Settings...",FL_ALT+FL_SHIFT+'p',show_settings_cb,0,FL_MENU_DIVIDER},
1104  {"Global &FLTK Settings...",FL_ALT+FL_SHIFT+'g',show_global_settings_cb},
1105  {0},
1106 {"&New", 0, 0, (void *)New_Menu, FL_SUBMENU_POINTER},
1107 {"&Layout",0,0,0,FL_SUBMENU},
1108  {"&Align",0,0,0,FL_SUBMENU},
1109  {"&Left",0,(Fl_Callback *)align_widget_cb,(void*)10},
1110  {"&Center",0,(Fl_Callback *)align_widget_cb,(void*)11},
1111  {"&Right",0,(Fl_Callback *)align_widget_cb,(void*)12},
1112  {"&Top",0,(Fl_Callback *)align_widget_cb,(void*)13},
1113  {"&Middle",0,(Fl_Callback *)align_widget_cb,(void*)14},
1114  {"&Bottom",0,(Fl_Callback *)align_widget_cb,(void*)15},
1115  {0},
1116  {"&Space Evenly",0,0,0,FL_SUBMENU},
1117  {"&Across",0,(Fl_Callback *)align_widget_cb,(void*)20},
1118  {"&Down",0,(Fl_Callback *)align_widget_cb,(void*)21},
1119  {0},
1120  {"&Make Same Size",0,0,0,FL_SUBMENU},
1121  {"&Width",0,(Fl_Callback *)align_widget_cb,(void*)30},
1122  {"&Height",0,(Fl_Callback *)align_widget_cb,(void*)31},
1123  {"&Both",0,(Fl_Callback *)align_widget_cb,(void*)32},
1124  {0},
1125  {"&Center In Group",0,0,0,FL_SUBMENU},
1126  {"&Horizontal",0,(Fl_Callback *)align_widget_cb,(void*)40},
1127  {"&Vertical",0,(Fl_Callback *)align_widget_cb,(void*)41},
1128  {0},
1129  {"Set &Widget Size",0,0,0,FL_SUBMENU|FL_MENU_DIVIDER},
1130  {"&Tiny",FL_ALT+'1',(Fl_Callback *)widget_size_cb,(void*)8,0,FL_NORMAL_LABEL,FL_HELVETICA,8},
1131  {"&Small",FL_ALT+'2',(Fl_Callback *)widget_size_cb,(void*)11,0,FL_NORMAL_LABEL,FL_HELVETICA,11},
1132  {"&Normal",FL_ALT+'3',(Fl_Callback *)widget_size_cb,(void*)14,0,FL_NORMAL_LABEL,FL_HELVETICA,14},
1133  {"&Medium",FL_ALT+'4',(Fl_Callback *)widget_size_cb,(void*)18,0,FL_NORMAL_LABEL,FL_HELVETICA,18},
1134  {"&Large",FL_ALT+'5',(Fl_Callback *)widget_size_cb,(void*)24,0,FL_NORMAL_LABEL,FL_HELVETICA,24},
1135  {"&Huge",FL_ALT+'6',(Fl_Callback *)widget_size_cb,(void*)32,0,FL_NORMAL_LABEL,FL_HELVETICA,32},
1136  {0},
1137  {"&Grid and Size Settings...",FL_COMMAND+'g',show_grid_cb},
1138  {0},
1139 {"&Shell",0,0,0,FL_SUBMENU},
1140  {"Execute &Command...",FL_ALT+'x',(Fl_Callback *)show_shell_window},
1141  {"Execute &Again...",FL_ALT+'g',(Fl_Callback *)do_shell_command},
1142  {0},
1143 {"&Help",0,0,0,FL_SUBMENU},
1144  {"&Rapid development with FLUID...",0,help_cb},
1145  {"&FLTK Programmers Manual...",0,manual_cb, 0, FL_MENU_DIVIDER},
1146  {"&About FLUID...",0,about_cb},
1147  {0},
1148 {0}};
1149 
1150 #define BROWSERWIDTH 300
1151 #define BROWSERHEIGHT 500
1152 #define WINWIDTH 300
1153 #define MENUHEIGHT 25
1154 #define WINHEIGHT (BROWSERHEIGHT+MENUHEIGHT)
1155 
1156 extern void fill_in_New_Menu();
1157 
1158 void scheme_cb(Fl_Choice *, void *) {
1159  if (batch_mode)
1160  return;
1161 
1162  switch (scheme_choice->value()) {
1163  case 0 : // Default
1164  Fl::scheme(NULL);
1165  break;
1166  case 1 : // None
1167  Fl::scheme("none");
1168  break;
1169  case 2 : // Plastic
1170  Fl::scheme("plastic");
1171  break;
1172  case 3 : // GTK+
1173  Fl::scheme("gtk+");
1174  break;
1175  case 4 : // Gleam
1176  Fl::scheme("gleam");
1177  break;
1178  }
1179 
1180  fluid_prefs.set("scheme", scheme_choice->value());
1181 }
1182 
1184  if (!widgetbin_panel) {
1185  make_widgetbin();
1186  if (!position_window(widgetbin_panel,"widgetbin_pos", 1, 320, 30)) return;
1187  }
1188 
1189  if (widgetbin_panel->visible()) {
1190  widgetbin_panel->hide();
1191  widgetbin_item->label("Show Widget &Bin...");
1192  } else {
1193  widgetbin_panel->show();
1194  widgetbin_item->label("Hide Widget &Bin");
1195  }
1196 }
1197 
1198 
1200  if (!sourceview_panel) {
1201  make_sourceview();
1203  Fl_Preferences svp(fluid_prefs, "sourceview");
1204  int autorefresh;
1205  svp.get("autorefresh", autorefresh, 1);
1206  sv_autorefresh->value(autorefresh);
1207  int autoposition;
1208  svp.get("autoposition", autoposition, 1);
1209  sv_autoposition->value(autoposition);
1210  int tab;
1211  svp.get("tab", tab, 0);
1212  if (tab>=0 && tab<sv_tab->children()) sv_tab->value(sv_tab->child(tab));
1213  if (!position_window(sourceview_panel,"sourceview_pos", 0, 320, 120, 550, 500)) return;
1214  }
1215 
1216  if (sourceview_panel->visible()) {
1218  sourceview_item->label("Show Source Code...");
1219  } else {
1221  sourceview_item->label("Hide Source Code...");
1222  update_sourceview_cb(0,0);
1223  }
1224 }
1225 
1227  toggle_sourceview_cb(0,0);
1228 }
1229 
1231  if (!batch_mode) {
1232  fluid_prefs.get("snap", snap, 1);
1233  fluid_prefs.get("gridx", gridx, 5);
1234  fluid_prefs.get("gridy", gridy, 5);
1235  fluid_prefs.get("show_guides", show_guides, 0);
1236  fluid_prefs.get("widget_size", Fl_Widget_Type::default_size, 14);
1237  fluid_prefs.get("show_comments", show_comments, 1);
1240  }
1241 
1242  if (!main_window) {
1243  Fl_Widget *o;
1247  o->box(FL_FLAT_BOX);
1248  o->tooltip("Double-click to view or change an item.");
1249  main_window->resizable(o);
1252  // quick access to all dynamic menu items
1257  main_menubar->global();
1258  fill_in_New_Menu();
1259  main_window->end();
1260  }
1261 
1262  if (!batch_mode) {
1263  load_history();
1266  }
1267 }
1268 
1269 // Load file history from preferences...
1271  int i; // Looping var
1272  int max_files;
1273 
1274 
1275  fluid_prefs.get("recent_files", max_files, 5);
1276  if (max_files > 10) max_files = 10;
1277 
1278  for (i = 0; i < max_files; i ++) {
1279  fluid_prefs.get( Fl_Preferences::Name("file%d", i), absolute_history[i], "", sizeof(absolute_history[i]));
1280  if (absolute_history[i][0]) {
1281  // Make a relative version of the filename for the menu...
1283  absolute_history[i]);
1284 
1285  if (i == 9) history_item[i].flags = FL_MENU_DIVIDER;
1286  else history_item[i].flags = 0;
1287  } else break;
1288  }
1289 
1290  for (; i < 10; i ++) {
1291  if (i) history_item[i-1].flags |= FL_MENU_DIVIDER;
1292  history_item[i].hide();
1293  }
1294 }
1295 
1296 // Update file history from preferences...
1297 void update_history(const char *flname) {
1298  int i; // Looping var
1299  char absolute[FL_PATH_MAX];
1300  int max_files;
1301 
1302 
1303  fluid_prefs.get("recent_files", max_files, 5);
1304  if (max_files > 10) max_files = 10;
1305 
1306  fl_filename_absolute(absolute, sizeof(absolute), flname);
1307 
1308  for (i = 0; i < max_files; i ++)
1309 #if defined(WIN32) || defined(__APPLE__)
1310  if (!strcasecmp(absolute, absolute_history[i])) break;
1311 #else
1312  if (!strcmp(absolute, absolute_history[i])) break;
1313 #endif // WIN32 || __APPLE__
1314 
1315  if (i == 0) return;
1316 
1317  if (i >= max_files) i = max_files - 1;
1318 
1319  // Move the other flnames down in the list...
1320  memmove(absolute_history + 1, absolute_history,
1321  i * sizeof(absolute_history[0]));
1322  memmove(relative_history + 1, relative_history,
1323  i * sizeof(relative_history[0]));
1324 
1325  // Put the new file at the top...
1326  strlcpy(absolute_history[0], absolute, sizeof(absolute_history[0]));
1327 
1329  absolute_history[0]);
1330 
1331  // Update the menu items as needed...
1332  for (i = 0; i < max_files; i ++) {
1334  if (absolute_history[i][0]) {
1335  if (i == 9) history_item[i].flags = FL_MENU_DIVIDER;
1336  else history_item[i].flags = 0;
1337  } else break;
1338  }
1339 
1340  for (; i < 10; i ++) {
1341  fluid_prefs.set( Fl_Preferences::Name("file%d", i), "");
1342  if (i) history_item[i-1].flags |= FL_MENU_DIVIDER;
1343  history_item[i].hide();
1344  }
1345  fluid_prefs.flush();
1346 }
1347 
1348 // ********** portable process class definition **********
1349 
1350 class Fl_Process {
1351 public:
1352  // construction / destruction
1354  ~Fl_Process() {if (_fpt) close();}
1355 
1356  // FIXME: popen needs the UTF-8 equivalent fl_popen
1357  FILE * popen (const char *cmd, const char *mode="r");
1358  //not necessary here: FILE * fl_fopen (const char *file, const char *mode="r");
1359  int close();
1360 
1361  FILE * desc() const { return _fpt;} // non null if file is open
1362  char * get_line(char * line, size_t s) const {return _fpt ? fgets(line, s, _fpt) : NULL;}
1363 
1364 #if defined(WIN32) && !defined(__CYGWIN__)
1365 protected:
1366  HANDLE pin[2], pout[2], perr[2];
1367  char ptmode;
1368  PROCESS_INFORMATION pi;
1369  STARTUPINFO si;
1370 
1371  static bool createPipe(HANDLE * h, BOOL bInheritHnd=TRUE);
1372 
1373 private:
1374  FILE * freeHandles() {
1375  clean_close(pin[0]); clean_close(pin[1]);
1376  clean_close(pout[0]); clean_close(pout[1]);
1377  clean_close(perr[0]); clean_close(perr[1]);
1378  return NULL; // convenient for error management
1379  }
1380  static void clean_close(HANDLE& h);
1381 #endif
1382 
1383 protected:
1384  FILE * _fpt;
1385 };
1386 
1387 #if defined(WIN32) && !defined(__CYGWIN__)
1388 bool Fl_Process::createPipe(HANDLE * h, BOOL bInheritHnd) {
1389  SECURITY_ATTRIBUTES sa;
1390  sa.nLength = sizeof(sa);
1391  sa.lpSecurityDescriptor = NULL;
1392  sa.bInheritHandle = bInheritHnd;
1393  return CreatePipe (&h[0],&h[1],&sa,0) ? true : false;
1394 }
1395 #endif
1396 // portable open process:
1397 FILE * Fl_Process::popen(const char *cmd, const char *mode) {
1398 #if defined(WIN32) && !defined(__CYGWIN__)
1399  // PRECONDITIONS
1400  if (!mode || !*mode || (*mode!='r' && *mode!='w') ) return NULL;
1401  if (_fpt) close(); // close first before reuse
1402 
1403  ptmode = *mode;
1404  pin[0] = pin[1] = pout[0] = pout[1] = perr[0] = perr[1] = INVALID_HANDLE_VALUE;
1405  // stderr to stdout wanted ?
1406  int fusion = (strstr(cmd,"2>&1") !=NULL);
1407 
1408  // Create windows pipes
1409  if (!createPipe(pin) || !createPipe(pout) || (!fusion && !createPipe(perr) ) )
1410  return freeHandles(); // error
1411 
1412  // Initialize Startup Info
1413  ZeroMemory(&si, sizeof(STARTUPINFO));
1414  si.cb = sizeof(STARTUPINFO);
1415  si.dwFlags = STARTF_USESTDHANDLES;
1416  si.hStdInput = pin[0];
1417  si.hStdOutput = pout[1];
1418  si.hStdError = fusion ? pout[1] : perr [1];
1419 
1420  if ( CreateProcess(NULL, (LPTSTR) cmd,NULL,NULL,TRUE,
1421  DETACHED_PROCESS,NULL,NULL, &si, &pi)) {
1422  // don't need theses handles inherited by child process:
1423  clean_close(pin[0]); clean_close(pout[1]); clean_close(perr[1]);
1424  HANDLE & h = *mode == 'r' ? pout[0] : pin[1];
1425  _fpt = _fdopen(_open_osfhandle((fl_intptr_t) h,_O_BINARY),mode);
1426  h= INVALID_HANDLE_VALUE; // reset the handle pointer that is shared
1427  // with _fpt so we don't free it twice
1428  }
1429 
1430  if (!_fpt) freeHandles();
1431  return _fpt;
1432 #else
1433  _fpt=::popen(cmd,mode);
1434  return _fpt;
1435 #endif
1436 }
1437 
1439 #if defined(WIN32) && !defined(__CYGWIN__)
1440  if (_fpt) {
1441  fclose(_fpt);
1442  clean_close(perr[0]);
1443  clean_close(pin[1]);
1444  clean_close(pout[0]);
1445  _fpt = NULL;
1446  return 0;
1447  }
1448  return -1;
1449 #else
1450  int ret = ::pclose(_fpt);
1451  _fpt=NULL;
1452  return ret;
1453 #endif
1454 }
1455 
1456 #if defined(WIN32) && !defined(__CYGWIN__)
1457 void Fl_Process::clean_close(HANDLE& h) {
1458  if (h!= INVALID_HANDLE_VALUE) CloseHandle(h);
1459  h = INVALID_HANDLE_VALUE;
1460 }
1461 #endif
1462 // ********** Fl_Process class end **********
1463 
1465 
1466 // Shell command support...
1467 
1468 static bool prepare_shell_command(const char * &command) { // common pre-shell command code all platforms
1469  shell_window->hide();
1470  if (s_proc.desc()) {
1471  fl_alert("Previous shell command still running!");
1472  return false;
1473  }
1474  if ((command = shell_command_input->value()) == NULL || !*command) {
1475  fl_alert("No shell command entered!");
1476  return false;
1477  }
1478  if (shell_savefl_button->value()) {
1479  save_cb(0, 0);
1480  }
1481  if (shell_writecode_button->value()) {
1482  batch_mode = 1;
1483  write_cb(0, 0);
1484  batch_mode = 0;
1485  }
1486  if (shell_writemsgs_button->value()) {
1487  batch_mode = 1;
1488  write_strings_cb(0, 0);
1489  batch_mode = 0;
1490  }
1491  return true;
1492 }
1493 
1494 #if !defined(__MWERKS__)
1495 // Support the full piped shell command...
1496 void
1498  char line[1024]=""; // Line from command output...
1499 
1500  if (s_proc.get_line(line, sizeof(line)) != NULL) {
1501  // Add the line to the output list...
1502  shell_run_buffer->append(line);
1503  } else {
1504  // End of file; tell the parent...
1505  Fl::remove_fd(fileno(s_proc.desc()));
1506  s_proc.close();
1507  shell_run_buffer->append("... END SHELL COMMAND ...\n");
1508  }
1509 
1511  shell_run_buffer->length(), 1), 0);
1512 }
1513 
1514 void
1516  const char *command=NULL; // Command to run
1517 
1518  if (!prepare_shell_command(command)) return;
1519 
1520  // Show the output window and clear things...
1521  shell_run_buffer->text("");
1523  shell_run_buffer->append("\n");
1524  shell_run_window->label("Shell Command Running...");
1525 
1526  if (s_proc.popen((char *)command) == NULL) {
1527  fl_alert("Unable to run shell command: %s", strerror(errno));
1528  return;
1529  }
1530 
1534 
1535  Fl::add_fd(fileno(s_proc.desc()), shell_pipe_cb);
1536 
1537  while (s_proc.desc()) Fl::wait();
1538 
1540  shell_run_window->label("Shell Command Complete");
1541  fl_beep();
1542 
1543  while (shell_run_window->shown()) Fl::wait();
1544 }
1545 #else
1546 // Just do basic shell command stuff, no status window...
1547 void
1549  const char *command; // Command to run
1550  int status; // Status from command...
1551 
1552  if (!prepare_shell_command(command)) return;
1553 
1554  if ((status = system(command)) != 0) {
1555  fl_alert("Shell command returned status %d!", status);
1556  } else if (completion_button->value()) {
1557  fl_message("Shell command completed successfully!");
1558  }
1559 }
1560 #endif // !__MWERKS__
1561 
1562 void
1565  shell_window->show();
1566 }
1567 
1568 void set_filename(const char *c) {
1569  if (filename) free((void *)filename);
1570  filename = c ? strdup(c) : NULL;
1571 
1572  if (filename && !batch_mode)
1574 
1576 }
1577 
1578 //
1579 // The Source View system offers an immediate preview of the code
1580 // files that will be generated by FLUID. It also marks the code
1581 // generated for the last selected item in the header and the source
1582 // file.
1583 //
1584 // Can we patent this? ;-) - Matt, mm@matthiasm.com
1585 //
1586 
1587 //
1588 // Update the header and source code highlighting depending on the
1589 // currently selected object
1590 //
1592 {
1594  return;
1595  if (sv_autoposition->value()==0)
1596  return;
1598  int pos0, pos1;
1599  if (sv_source->visible_r()) {
1602  if (pos0>=0) {
1603  if (pos1<pos0)
1604  pos1 = pos0;
1605  sv_source->buffer()->highlight(pos0, pos1);
1606  int line = sv_source->buffer()->count_lines(0, pos0);
1607  sv_source->scroll(line, 0);
1608  }
1609  }
1610  if (sv_header->visible_r()) {
1613  if (pos0>=0) {
1614  if (pos1<pos0)
1615  pos1 = pos0;
1616  sv_header->buffer()->highlight(pos0, pos1);
1617  int line = sv_header->buffer()->count_lines(0, pos0);
1618  sv_header->scroll(line, 0);
1619  }
1620  }
1621  }
1622 }
1623 
1625 {
1627 }
1628 
1629 static char *sv_source_filename = 0;
1630 static char *sv_header_filename = 0;
1631 
1632 //
1633 // Generate a header and source file in a temporary directory and
1634 // load those into the Code Viewer widgets.
1635 //
1637 {
1639  return;
1640  // generate space for the source and header file filenames
1641  if (!sv_source_filename) {
1644  strlcat(sv_source_filename, "source_view_tmp.cxx", FL_PATH_MAX);
1645  }
1646  if (!sv_header_filename) {
1649  strlcat(sv_header_filename, "source_view_tmp.h", FL_PATH_MAX);
1650  }
1651 
1654  const char *code_file_name_bak = code_file_name;
1656  const char *header_file_name_bak = header_file_name;
1658 
1659  // generate the code and load the files
1660  write_sourceview = 1;
1661  // generate files
1663  {
1664  // load file into source editor
1665  int pos = sv_source->top_line();
1666  sv_source->buffer()->loadfile(sv_source_filename);
1667  sv_source->scroll(pos, 0);
1668  // load file into header editor
1669  pos = sv_header->top_line();
1670  sv_header->buffer()->loadfile(sv_header_filename);
1671  sv_header->scroll(pos, 0);
1672  // update the source code highlighting
1674  }
1675  write_sourceview = 0;
1676 
1677  code_file_name = code_file_name_bak;
1678  header_file_name = header_file_name_bak;
1679 }
1680 
1682 {
1683  update_sourceview_cb(0,0);
1684 }
1685 
1686 // Set the "modified" flag and update the title of the main window...
1687 void set_modflag(int mf) {
1688  const char *basename;
1689  static char title[FL_PATH_MAX];
1690 
1691  modflag = mf;
1692 
1693  if (main_window) {
1694  if (!filename) basename = "Untitled.fl";
1695  else if ((basename = strrchr(filename, '/')) != NULL) basename ++;
1696 #if defined(WIN32) || defined(__EMX__)
1697  else if ((basename = strrchr(filename, '\\')) != NULL) basename ++;
1698 #endif // WIN32 || __EMX__
1699  else basename = filename;
1700 
1701  if (modflag) {
1702  snprintf(title, sizeof(title), "%s (modified)", basename);
1704  } else main_window->label(basename);
1705  }
1706  // if the UI was modified in any way, update the Source View panel
1708  {
1709  // we will only update earliest 0.5 seconds after the last change, and only
1710  // if no other change was made, so dragging a widget will not generate any
1711  // CPU load
1714  }
1715 
1716  // Enable/disable the Save menu item...
1717  if (modflag) save_item->activate();
1718  else save_item->deactivate();
1719 }
1720 
1722 
1723 static int arg(int argc, char** argv, int& i) {
1724  if (argv[i][1] == 'u' && !argv[i][2]) {update_file++; batch_mode++; i++; return 1;}
1725  if (argv[i][1] == 'c' && !argv[i][2]) {compile_file++; batch_mode++; i++; return 1;}
1726  if (argv[i][1] == 'c' && argv[i][2] == 's' && !argv[i][3]) {compile_file++; compile_strings++; batch_mode++; i++; return 1;}
1727  if (argv[i][1] == 'o' && !argv[i][2] && i+1 < argc) {
1728  code_file_name = argv[i+1];
1729  code_file_set = 1;
1730  i += 2;
1731  return 2;
1732  }
1733  if (argv[i][1] == 'h' && !argv[i][2]) {
1734  header_file_name = argv[i+1];
1735  header_file_set = 1;
1736  i += 2;
1737  return 2;
1738  }
1739  Fl_Plugin_Manager pm("commandline");
1740  int j, n = pm.plugins();
1741  for (j=0; j<n; j++) {
1743  int r = pi->arg(argc, argv, i);
1744  if (r) return r;
1745  }
1746  return 0;
1747 }
1748 
1749 #if ! (defined(WIN32) && !defined (__CYGWIN__))
1750 
1751 int quit_flag = 0;
1752 #include <signal.h>
1753 #ifdef _sigargs
1754 #define SIGARG _sigargs
1755 #else
1756 #ifdef __sigargs
1757 #define SIGARG __sigargs
1758 #else
1759 #define SIGARG int // you may need to fix this for older systems
1760 #endif
1761 #endif
1762 
1763 extern "C" {
1764 static void sigint(SIGARG) {
1765  signal(SIGINT,sigint);
1766  quit_flag = 1;
1767 }
1768 }
1769 #endif
1770 
1771 int main(int argc,char **argv) {
1772  int i = 1;
1773 
1774  if (!Fl::args(argc,argv,i,arg) || i < argc-1) {
1775  static const char *msg =
1776  "usage: %s <switches> name.fl\n"
1777  " -u : update .fl file and exit (may be combined with '-c' or '-cs')\n"
1778  " -c : write .cxx and .h and exit\n"
1779  " -cs : write .cxx and .h and strings and exit\n"
1780  " -o <name> : .cxx output filename, or extension if <name> starts with '.'\n"
1781  " -h <name> : .h output filename, or extension if <name> starts with '.'\n";
1782  int len = (int)(strlen(msg) + strlen(argv[0]) + strlen(Fl::help));
1783  Fl_Plugin_Manager pm("commandline");
1784  int i, n = pm.plugins();
1785  for (i=0; i<n; i++) {
1787  if (pi) len += strlen(pi->help());
1788  }
1789  char *buf = (char*)malloc(len+1);
1790  sprintf(buf, msg, argv[0]);
1791  for (i=0; i<n; i++) {
1793  if (pi) strcat(buf, pi->help());
1794  }
1795  strcat(buf, Fl::help);
1796 #ifdef _MSC_VER
1797  fl_message("%s\n", buf);
1798 #else
1799  fprintf(stderr, "%s\n", buf);
1800 #endif
1801  free(buf);
1802  return 1;
1803  }
1804  if (exit_early)
1805  exit(0);
1806 
1807  const char *c = argv[i];
1808 
1810 
1811  make_main_window();
1812 
1813 
1814  if (c) set_filename(c);
1815  if (!batch_mode) {
1816 #ifdef __APPLE__
1817  fl_open_callback(apple_open_cb);
1818 #endif // __APPLE__
1822  position_window(main_window,"main_window_pos", 1, 10, 30, WINWIDTH, WINHEIGHT );
1823  main_window->show(argc,argv);
1824  toggle_widgetbin_cb(0,0);
1825  toggle_sourceview_cb(0,0);
1826  if (!c && openlast_button->value() && absolute_history[0][0]) {
1827  // Open previous file when no file specified...
1829  }
1830  }
1831  undo_suspend();
1832  if (c && !read_file(c,0)) {
1833  if (batch_mode) {
1834  fprintf(stderr,"%s : %s\n", c, strerror(errno));
1835  exit(1);
1836  }
1837  fl_message("Can't read %s: %s", c, strerror(errno));
1838  }
1839  undo_resume();
1840 
1841  if (update_file) { // fluid -u
1842  write_file(c,0);
1843  if (!compile_file)
1844  exit(0);
1845  }
1846 
1847  if (compile_file) { // fluid -c[s]
1848  if (compile_strings)
1849  write_strings_cb(0,0);
1850  write_cb(0,0);
1851  exit(0);
1852  }
1853  set_modflag(0);
1854  undo_clear();
1855 #ifndef WIN32
1856  signal(SIGINT,sigint);
1857 #endif
1858 
1859  // Set (but do not start) timer callback for external editor updates
1861 
1862  grid_cb(horizontal_input, 0); // Makes sure that windows get snap params...
1863 
1864 #ifdef WIN32
1865  Fl::run();
1866 #else
1867  while (!quit_flag) Fl::wait();
1868 
1869  if (quit_flag) exit_cb(0,0);
1870 #endif // WIN32
1871 
1872  undo_clear();
1873 
1874  return (0);
1875 }
1876 
1877 //
1878 // End of "$Id$".
1879 //
fl_filename_relative
int fl_filename_relative(char *to, int tolen, const char *from)
Definition: filename_absolute.cxx:128
make_template_panel
Fl_Double_Window * make_template_panel()
Definition: template_panel.cxx:135
Fl_Text_Display::buffer
void buffer(Fl_Text_Buffer *buf)
Definition: Fl_Text_Display.cxx:384
absolute_history
char absolute_history[10][FL_PATH_MAX]
Definition: fluid.cxx:103
make_shell_window
Fl_Double_Window * make_shell_window()
Definition: alignment_panel.cxx:367
WINWIDTH
#define WINWIDTH
Definition: fluid.cxx:1152
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
Fl_Native_File_Chooser::type
void type(int t)
Definition: Fl_Native_File_Chooser_FLTK.cxx:77
Fl_Help_Dialog::show
void show()
Definition: Fl_Help_Dialog.cxx:237
update_sourceview_timer
void update_sourceview_timer(void *)
Definition: fluid.cxx:1681
Fl_Help_Dialog.H
fl_width
FL_EXPORT double fl_width(const char *txt)
Definition: fl_font.cxx:65
select_all_cb
void select_all_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:775
update_sourceview_position_cb
void update_sourceview_position_cb(Fl_Tabs *, void *)
Definition: fluid.cxx:1624
Fl_Choice
A button that is used to pop up a menu.
Definition: Fl_Choice.H:83
template_delete
Fl_Button * template_delete
Definition: template_panel.cxx:112
shell_writecode_button
Fl_Check_Button * shell_writecode_button
Definition: alignment_panel.cxx:335
in_source_dir
static char in_source_dir
Definition: fluid.cxx:125
Fl.H
Fl_Widget::activate
void activate()
Definition: Fl_Widget.cxx:241
shell_run_window
Fl_Double_Window * shell_run_window
Definition: alignment_panel.cxx:357
buf
static char * buf
Definition: fl_encoding_mac_roman.cxx:76
Fl_Plugin_Manager::plugins
int plugins()
Return the number of plugins in the klass.
Definition: Fl_Plugin.H:80
header_file_set
int header_file_set
Definition: fluid.cxx:698
save_position
void save_position(Fl_Window *w, const char *prefsName)
Definition: fluid.cxx:167
widget_size_cb
void widget_size_cb(Fl_Widget *, long)
Definition: align_widget.cxx:503
show_global_settings_cb
void show_global_settings_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:239
position_window
char position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W=0, int H=0)
Definition: fluid.cxx:150
Fl_Window::show
virtual void show()
Definition: Fl_win32.cxx:2542
Fl_Button::value
int value(int v)
Definition: Fl_Button.cxx:41
Fl_Menu_Item::flags
int flags
menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
Definition: Fl_Menu_Item.H:117
Fl_Native_File_Chooser
Definition: Fl_Native_File_Chooser.H:111
exit_cb
void exit_cb(Fl_Widget *, void *)
Definition: fluid.cxx:414
Fl_Group::find
int find(const Fl_Widget *) const
Definition: Fl_Group.cxx:52
gridy
int gridy
Definition: fluid.cxx:93
modflag
int modflag
Definition: fluid.cxx:122
Fl_Type::current
static Fl_Type * current
Definition: Fl_Type.h:114
Fl_Type::next
Fl_Type * next
Definition: Fl_Type.h:71
code_file_name
const char * code_file_name
Definition: fluid.cxx:701
copy_cb
void copy_cb(Fl_Widget *, void *)
Definition: fluid.cxx:789
Fl_Group::end
void end()
Definition: Fl_Group.cxx:75
png_destroy_write_struct
PNG_IMPEXP void() png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
Definition: pngwrite.c:979
Fl_Menu_::menu
const Fl_Menu_Item * menu() const
Definition: Fl_Menu_.H:110
header_file_name
const char * header_file_name
Definition: fluid.cxx:700
fl_message
void fl_message(const char *,...)
Definition: fl_ask.cxx:338
Fl_Plugin.H
write_code
static Fl_Type * write_code(Fl_Type *p)
Definition: code.cxx:287
SIGARG
#define SIGARG
Definition: fluid.cxx:1759
ipasteoffset
static int ipasteoffset
Definition: fluid.cxx:787
history_item
Fl_Menu_Item * history_item
Definition: fluid.cxx:113
Fl_Process
Definition: fluid.cxx:1350
about_cb
void about_cb(Fl_Widget *, void *)
Definition: fluid.cxx:896
sigint
static void sigint(int)
Definition: fluid.cxx:1764
main_window
Fl_Window * main_window
Definition: fluid.cxx:176
Main_Menu
Fl_Menu_Item Main_Menu[]
Definition: fluid.cxx:1058
undo_resume
void undo_resume()
Definition: undo.cxx:172
Fl_Menu_Item::activate
void activate()
Definition: Fl_Menu_Item.H:343
Fl_Input.H
widgetbin_panel
Fl_Window * widgetbin_panel
Definition: function_panel.cxx:714
FL_SUBMENU_POINTER
Indicates user_data() is a pointer to another menu array.
Definition: Fl_Menu_Item.H:38
Fl_Help_Dialog
Definition: Fl_Help_Dialog.H:38
undo_cb
void undo_cb(Fl_Widget *, void *)
Definition: undo.cxx:97
Fl_Widget::show
virtual void show()
Definition: Fl_Widget.cxx:271
function_panel.h
shell_writemsgs_button
Fl_Check_Button * shell_writemsgs_button
Definition: alignment_panel.cxx:341
Fl_Window::hotspot
void hotspot(int x, int y, int offscreen=0)
Definition: Fl_Window_hotspot.cxx:24
set_modflag
void set_modflag(int mf)
Definition: fluid.cxx:1687
undo_save
int undo_save
Definition: undo.cxx:57
Fl_Type::parent
Fl_Type * parent
Definition: Fl_Type.h:63
exit_early
int exit_early
Definition: fluid.cxx:693
Fl::args
static int args(int argc, char **argv, int &i, Fl_Args_Handler cb=0)
Definition: Fl_arg.cxx:282
fl_ask.H
Fl_Printer::printable_rect
int printable_rect(int *w, int *h)
Computes the width and height of the printable area of the page.
Definition: Fl_Printer.cxx:123
Fl_Preferences::USER
Preferences apply only to the current user.
Definition: Fl_Preferences.H:68
Fl_Mode
Fl_Mode
Definition: Enumerations.H:1084
Fl_Menu_Bar
Definition: Fl_Menu_Bar.H:67
load_history
void load_history()
Definition: fluid.cxx:1270
Fl_Input_::value
int value(const char *)
Definition: Fl_Input_.cxx:1284
quit_flag
int quit_flag
Definition: fluid.cxx:1751
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
leave_source_dir
void leave_source_dir()
Definition: fluid.cxx:143
read_file
int read_file(const char *filename, int merge)
Definition: file.cxx:493
Fl_Button
Buttons generate callbacks when they are clicked by the user.
Definition: Fl_Button.H:79
Fl_Native_File_Chooser::title
void title(const char *t)
Definition: Fl_Native_File_Chooser_FLTK.cxx:161
ungroup_cb
void ungroup_cb(Fl_Widget *, void *)
Definition: Fl_Group_Type.cxx:85
horizontal_input
Fl_Int_Input * horizontal_input
Definition: alignment_panel.cxx:424
update_history
void update_history(const char *)
Definition: fluid.cxx:1297
FL_SHIFT
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:557
PNG_INTERLACE_NONE
#define PNG_INTERLACE_NONE
Definition: png.h:828
Fl_Menu_Item::label
const char * label() const
Definition: Fl_Menu_Item.H:148
x.H
fl_open_callback
void fl_open_callback(void(*cb)(const char *))
Register a function called for each file dropped onto an application icon. cb will be called with a s...
Definition: win32.H:157
template_name
Fl_Input * template_name
Definition: template_panel.cxx:101
filename.H
Fl_Native_File_Chooser::filter
const char * filter() const
Definition: Fl_Native_File_Chooser_FLTK.cxx:173
free
void free()
H
static int H
Definition: Fl_Tooltip.cxx:76
Fl_Commandline_Plugin::arg
virtual int arg(int argc, char **argv, int &i)=0
FL_SUBMENU
This item is a submenu to other items.
Definition: Fl_Menu_Item.H:39
delete_cb
void delete_cb(Fl_Widget *, void *)
Definition: fluid.cxx:820
Fl::visual
static int visual(int)
Definition: Fl_visual.cxx:118
do_shell_command
void do_shell_command(Fl_Return_Button *, void *)
Definition: fluid.cxx:1515
Fl_Process::Fl_Process
Fl_Process()
Definition: fluid.cxx:1353
make_about_panel
Fl_Double_Window * make_about_panel()
Definition: about_panel.cxx:267
batch_mode
int batch_mode
Definition: fluid.cxx:697
fl_height
int fl_height()
Definition: fl_draw.H:527
about_panel.h
Fl_Browser::value
int value() const
Definition: Fl_Browser.cxx:826
png_bytep
png_byte * png_bytep
Definition: pngconf.h:600
Fl_Help_Dialog::value
void value(const char *f)
Definition: Fl_Help_Dialog.cxx:271
NULL
#define NULL
Definition: forms.H:34
goto_source_dir
void goto_source_dir()
Definition: fluid.cxx:126
prepare_shell_command
static bool prepare_shell_command(const char *&command)
Definition: fluid.cxx:1468
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Definition: fl_font.cxx:70
Fl_Preferences::getUserdataPath
char getUserdataPath(char *path, int pathlen)
Creates a path that is related to the preferences file and that is usable for additional application ...
Definition: Fl_Preferences.cxx:885
main
int main(int argc, char **argv)
Definition: fluid.cxx:1771
ExternalCodeEditor::set_update_timer_callback
static void set_update_timer_callback(Fl_Timeout_Handler)
Definition: ExternalCodeEditor_UNIX.cxx:451
MENUHEIGHT
#define MENUHEIGHT
Definition: fluid.cxx:1153
sv_header
CodeViewer * sv_header
Definition: function_panel.cxx:1075
earlier_cb
void earlier_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:873
Fl_Tabs
Definition: Fl_Tabs.H:201
Fl_File_Icon::load_system_icons
static void load_system_icons(void)
Definition: Fl_File_Icon2.cxx:596
Fl_Widget::do_callback
void do_callback()
Definition: Fl_Widget.H:861
relative_history
char relative_history[10][FL_PATH_MAX]
Definition: fluid.cxx:104
Fl_Hold_Browser.H
fl_fopen
FILE * fl_fopen(const char *f, const char *mode)
Definition: fl_utf8.cxx:498
Fl_Text_Buffer::length
int length() const
Returns the number of bytes in the buffer.
Definition: Fl_Text_Buffer.H:180
show_help
void show_help(const char *name)
Definition: fluid.cxx:901
png_set_sRGB
PNG_IMPEXP void() png_set_sRGB(png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)
Definition: pngset.c:580
Fl_Callback
void() Fl_Callback(Fl_Widget *, void *)
Definition: Fl_Widget.H:49
FL_BLACK
const Fl_Color FL_BLACK
Definition: Enumerations.H:956
snprintf
#define snprintf
Definition: flstring.h:64
G_external_editor_command
char G_external_editor_command[512]
Definition: fluid.cxx:99
PNG_FILTER_TYPE_DEFAULT
#define PNG_FILTER_TYPE_DEFAULT
Definition: png.h:825
Fl_Double_Window.H
scheme_choice
Fl_Choice * scheme_choice
Definition: alignment_panel.cxx:149
CodeEditor::top_line
int top_line()
Definition: CodeEditor.h:58
Fl_Type::first
static Fl_Type * first
Definition: Fl_Type.h:70
fill_in_New_Menu
void fill_in_New_Menu()
Definition: factory.cxx:1069
show_shell_window
void show_shell_window()
Definition: fluid.cxx:1563
New_Menu
Fl_Menu_Item New_Menu[]
Definition: factory.cxx:976
shell_savefl_button
Fl_Check_Button * shell_savefl_button
Definition: alignment_panel.cxx:347
fl_choice
int fl_choice(const char *q, const char *b0, const char *b1, const char *b2,...)
Definition: fl_ask.cxx:459
Fl_Printer::scale
void scale(float scale_x, float scale_y=0.)
Changes the scaling of page coordinates.
Definition: Fl_Printer.cxx:143
pwd
static char * pwd
Definition: fluid.cxx:124
sv_source
CodeViewer * sv_source
Definition: function_panel.cxx:1073
make_widgetbin
Fl_Window * make_widgetbin()
Definition: function_panel.cxx:723
Fl_Text_Display::scroll
void scroll(int topLineNum, int horizOffset)
Scrolls the current buffer to start at the specified line and column.
Definition: Fl_Text_Display.cxx:2830
i18n_set
const char * i18n_set
Definition: fluid.cxx:706
Fl_Type.h
shell_pipe_cb
void shell_pipe_cb(FL_SOCKET, void *)
Definition: fluid.cxx:1497
buffer
static char * buffer
Definition: file.cxx:215
fl_register_images
void fl_register_images()
Register the image formats.
Definition: fl_images_core.cxx:54
PNG_COLOR_TYPE_RGB
#define PNG_COLOR_TYPE_RGB
Definition: png.h:811
BROWSERWIDTH
#define BROWSERWIDTH
Definition: fluid.cxx:1150
G_use_external_editor
int G_use_external_editor
Definition: fluid.cxx:97
Fl_Type::header_position_end
int header_position_end
Definition: Fl_Type.h:77
redo_cb
void redo_cb(Fl_Widget *, void *)
Definition: undo.cxx:74
about_panel
Fl_Double_Window * about_panel
Definition: about_panel.cxx:24
Fl::add_fd
static void add_fd(int fd, int when, Fl_FD_Handler cb, void *=0)
undo_suspend
void undo_suspend()
Definition: undo.cxx:177
sourceview_item
Fl_Menu_Item * sourceview_item
Definition: fluid.cxx:115
Fl_Text_Display::count_lines
int count_lines(int start, int end, bool start_pos_is_line_start) const
Count the number of lines between two positions.
Definition: Fl_Text_Display.cxx:1407
s_proc
static Fl_Process s_proc
Definition: fluid.cxx:1464
p
static menustate * p
Definition: Fl_Menu.cxx:606
Fl_Widget_Type::default_size
static int default_size
Definition: Fl_Type.h:398
Fl_Box.H
Fl_Widget::position
void position(int X, int Y)
Definition: Fl_Widget.H:332
Fl_Widget::w
void w(int v)
Definition: Fl_Widget.H:143
Fl_Code_Type
Definition: Fl_Type.h:194
show_guides
int show_guides
Definition: fluid.cxx:95
toggle_overlays
void toggle_overlays(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:1117
Fl_Printer::end_page
int end_page(void)
To be called at the end of each page.
Definition: Fl_Printer.cxx:163
TRUE
Definition: jmorecfg.h:317
Fl_Widget::x
void x(int v)
Definition: Fl_Widget.H:139
openwidget_cb
void openwidget_cb(Fl_Widget *, void *)
Definition: fluid.cxx:769
FL_FLAT_BOX
a flat box
Definition: Enumerations.H:606
Fl_Process::~Fl_Process
~Fl_Process()
Definition: fluid.cxx:1354
undo_checkpoint
void undo_checkpoint()
Definition: undo.cxx:125
fluid_prefs
Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid")
FL_ALT
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:560
command
static unsigned int command(const char *cmd)
Definition: Fl_Help_View.cxx:3018
write_strings
int write_strings(const char *sfile)
Definition: code.cxx:466
FL_PATH_MAX
#define FL_PATH_MAX
Definition: filename.H:38
show_coredevmenus
int show_coredevmenus
Definition: fluid.cxx:100
Fl_Native_File_Chooser::BROWSE_SAVE_FILE
browse to save a file
Definition: Fl_Native_File_Chooser.H:118
fl_draw.H
utility header to pull drawing functions together
align_widget_cb
void align_widget_cb(Fl_Widget *, long)
Definition: align_widget.cxx:32
undo.h
filename
static const char * filename
Definition: fluid.cxx:119
fl_filename_name
const char * fl_filename_name(const char *filename)
Definition: Fl_win32.cxx:2179
FL_HELVETICA
const Fl_Font FL_HELVETICA
Helvetica (or Arial) normal (0)
Definition: Enumerations.H:879
openlast_button
Fl_Check_Button * openlast_button
Definition: alignment_panel.cxx:173
png_info_def
Definition: pnginfo.h:56
Fl_Window::decorated_h
int decorated_h()
Definition: Fl_win32.cxx:2764
Fl_Process::close
int close()
Definition: fluid.cxx:1438
Fl_Native_File_Chooser::filename
const char * filename() const
Definition: Fl_Native_File_Chooser_FLTK.cxx:126
arg
static int arg(int argc, char **argv, int &i)
Definition: fluid.cxx:1723
open_history_cb
void open_history_cb(Fl_Widget *, void *v)
Definition: fluid.cxx:549
save_template_cb
void save_template_cb(Fl_Widget *, void *)
Definition: fluid.cxx:267
Fl_Shared_Image::find
static Fl_Shared_Image * find(const char *name, int W=0, int H=0)
Definition: Fl_Shared_Image.cxx:479
i18n_function
const char * i18n_function
Definition: fluid.cxx:704
Fl_Widget_Type::o
Fl_Widget * o
Definition: Fl_Type.h:401
template_load
void template_load()
Definition: template_panel.cxx:214
strlcpy
#define strlcpy
Definition: flstring.h:84
FL_COMMAND
#define FL_COMMAND
An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X.
Definition: Enumerations.H:580
shell_window
Fl_Double_Window * shell_window
Definition: alignment_panel.cxx:327
Fl_Preferences::get
char get(const char *entry, int &value, int defaultValue)
Definition: Fl_Preferences.cxx:509
Fl_Preferences::set
char set(const char *entry, int value)
Definition: Fl_Preferences.cxx:525
FLTK_DOCDIR
#define FLTK_DOCDIR
Definition: config.h:24
fl_beep
void fl_beep(int type=FL_BEEP_DEFAULT)
Definition: fl_ask.cxx:283
Fl_Widget::visible
unsigned int visible() const
Definition: Fl_Widget.H:660
Fl_Type::is_window
virtual int is_window() const
Definition: Fl_Type.cxx:759
duplicate_cb
void duplicate_cb(Fl_Widget *, void *)
Definition: fluid.cxx:853
Fl_Choice::value
int value() const
Definition: Fl_Choice.H:95
Fl_Window
Definition: Fl_Window.H:57
Fl_Window::resize
virtual void resize(int X, int Y, int W, int H)
Definition: Fl_win32.cxx:1643
fl_filename_absolute
int fl_filename_absolute(char *to, int tolen, const char *from)
Definition: filename_absolute.cxx:56
help_cb
void help_cb(Fl_Widget *, void *)
Definition: fluid.cxx:975
Fl_Return_Button
Definition: Fl_Return_Button.H:33
Fl_Double_Window::hide
void hide()
Definition: Fl_Double_Window.cxx:505
Fl_Widget::hide
virtual void hide()
Definition: Fl_Widget.cxx:283
Fl_File_Chooser.H
pasteoffset
int pasteoffset
Definition: Fl_Widget_Type.cxx:2537
revert_cb
void revert_cb(Fl_Widget *, void *)
Definition: fluid.cxx:398
widgetbin_item
Fl_Menu_Item * widgetbin_item
Definition: fluid.cxx:114
Fl_Type
Definition: Fl_Type.h:43
print_menu_cb
void print_menu_cb(Fl_Widget *, void *)
Definition: fluid.cxx:985
later_cb
void later_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:891
shell_run_display
Fl_Text_Display * shell_run_display
Definition: alignment_panel.cxx:359
png_create_info_struct
png_infop png_create_info_struct(png_const_structrp png_ptr)
Definition: png.c:327
Fl_Process::desc
FILE * desc() const
Definition: fluid.cxx:1361
PNG_sRGB_INTENT_PERCEPTUAL
#define PNG_sRGB_INTENT_PERCEPTUAL
Definition: png.h:856
Fl_Menu_Item::deactivate
void deactivate()
Definition: Fl_Menu_Item.H:348
Fl_Menu_Item::hide
void hide()
Definition: Fl_Menu_Item.H:337
PNG_COMPRESSION_TYPE_DEFAULT
#define PNG_COMPRESSION_TYPE_DEFAULT
Definition: png.h:820
Fl::remove_timeout
static void remove_timeout(Fl_Timeout_Handler, void *=0)
Definition: Fl.cxx:368
png_write_row
PNG_IMPEXP void() png_write_row(png_structrp png_ptr, png_const_bytep row)
Definition: pngwrite.c:681
completion_button
Fl_Check_Button * completion_button
Definition: alignment_panel.cxx:167
Fl::repeat_timeout
static void repeat_timeout(double t, Fl_Timeout_Handler, void *=0)
Definition: Fl.cxx:334
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Widget::deactivate
void deactivate()
Definition: Fl_Widget.cxx:253
help_dialog
static Fl_Help_Dialog * help_dialog
Definition: fluid.cxx:89
Fl_Printer.H
declaration of classes Fl_Printer, Fl_System_Printer and Fl_PostScript_Printer.
fl_intptr_t
long fl_intptr_t
Definition: Fl_Widget.H:39
show_project_cb
void show_project_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:182
alignment_panel.h
FL_NO_BOX
nothing is drawn at all, this box is invisible
Definition: Enumerations.H:605
Fl_Type::open
virtual void open()
Definition: Fl_Type.cxx:727
toggle_sourceview_b_cb
void toggle_sourceview_b_cb(Fl_Button *, void *)
Definition: fluid.cxx:1226
Fl_Printer::start_job
int start_job(int pagecount, int *frompage=NULL, int *topage=NULL)
Definition: Fl_Printer.cxx:113
delete_all
void delete_all(int selected_only)
Definition: Fl_Type.cxx:833
show_grid_cb
void show_grid_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:217
prevpos_button
Fl_Check_Button * prevpos_button
Definition: alignment_panel.cxx:179
select_none_cb
void select_none_cb(Fl_Widget *, void *)
Definition: Fl_Type.cxx:799
Fl_Widget::box
Fl_Boxtype box() const
Definition: Fl_Widget.H:363
make_widget_browser
Fl_Widget * make_widget_browser(int x, int y, int w, int h)
Definition: Fl_Type.cxx:228
Fl_Process::_fpt
FILE * _fpt
Definition: fluid.cxx:1384
Fl_Preferences::Name
Definition: Fl_Preferences.H:159
snap
int snap
Definition: fluid.cxx:94
Fl_Window::shown
int shown()
Definition: Fl_Window.H:485
Fl_Process::popen
FILE * popen(const char *cmd, const char *mode="r")
Definition: fluid.cxx:1397
Fl_File_Icon.H
template_browser
Fl_Browser * template_browser
Definition: template_panel.cxx:50
Fl_Window::hide
virtual void hide()
Definition: Fl.cxx:1546
Fl_Widget::h
void h(int v)
Definition: Fl_Widget.H:145
i18n_program
char i18n_program[FL_PATH_MAX]
Definition: fluid.cxx:707
Fl_Widget::label
const char * label() const
Definition: Fl_Widget.H:421
write_strings_cb
void write_strings_cb(Fl_Widget *, void *)
Definition: fluid.cxx:746
png_struct_def
Definition: pngstruct.h:144
Fl_Text_Buffer::append
void append(const char *t)
Definition: Fl_Text_Buffer.H:251
Fl_Help_Dialog::load
void load(const char *f)
Definition: Fl_Help_Dialog.cxx:223
Fl_Window::label
const char * label() const
Definition: Fl_Window.H:450
G_debug
int G_debug
Definition: fluid.cxx:98
Fl_Widget::y
void y(int v)
Definition: Fl_Widget.H:141
cutfname
static char * cutfname(int which=0)
Definition: fluid.cxx:179
compile_strings
int compile_strings
Definition: fluid.cxx:696
FL_MENU_DIVIDER
Creates divider line below this item. Also ends a group of radio buttons.
Definition: Fl_Menu_Item.H:40
Fl_Text_Buffer::text
char * text() const
Get a copy of the entire contents of the text buffer. Memory is allocated to contain the returned str...
Definition: Fl_Text_Buffer.cxx:153
undo_clear
void undo_clear()
Definition: undo.cxx:156
Fl::run
static int run()
Definition: Fl.cxx:637
Fl_Plugin_Manager
Fl_Plugin_Manager manages link-time and run-time plugin binaries.
Definition: Fl_Plugin.H:73
ExternalCodeEditor::tmpdir_clear
static void tmpdir_clear()
Definition: ExternalCodeEditor_UNIX.cxx:225
Fl_Menu_::global
void global()
Definition: Fl_Menu_global.cxx:44
Fl_Printer::end_job
void end_job(void)
To be called at the end of a print job.
Definition: Fl_Printer.cxx:168
x
int x
Definition: test.c:73
sv_autorefresh
Fl_Light_Button * sv_autorefresh
Definition: function_panel.cxx:1077
Fl_Widget::callback
Fl_Callback_p callback() const
Definition: Fl_Widget.H:561
Fl_Widget::visible_r
int visible_r() const
Definition: Fl_Widget.cxx:295
PNG_LIBPNG_VER_STRING
#define PNG_LIBPNG_VER_STRING
Definition: png.h:426
i18n_include
const char * i18n_include
Definition: fluid.cxx:703
Fl::wait
static int wait()
Definition: Fl.cxx:666
Fl_Menu_::find_item
const Fl_Menu_Item * find_item(const char *name)
Definition: Fl_Menu_.cxx:151
Fl_Printer::start_page
int start_page(void)
Starts a new printed page.
Definition: Fl_Printer.cxx:118
cut_cb
void cut_cb(Fl_Widget *, void *)
Definition: fluid.cxx:802
write_file
int write_file(const char *filename, int selected_only)
Definition: file.cxx:312
Fl_Browser::add
void add(const char *newtext, void *d=0)
Definition: Fl_Browser.cxx:710
sv_source_filename
static char * sv_source_filename
Definition: fluid.cxx:1629
select_only
void select_only(Fl_Type *)
Definition: Fl_Type.cxx:245
shell_run_button
Fl_Return_Button * shell_run_button
Definition: alignment_panel.cxx:361
Fl::add_timeout
static void add_timeout(double t, Fl_Timeout_Handler, void *=0)
Definition: Fl.cxx:329
make_settings_window
Fl_Double_Window * make_settings_window()
Definition: alignment_panel.cxx:221
shell_run_buffer
Fl_Text_Buffer * shell_run_buffer
Definition: alignment_panel.cxx:24
template_clear
void template_clear()
Definition: template_panel.cxx:182
Fl_Type::code_position_end
int code_position_end
Definition: Fl_Type.h:77
Fl_Double_Window
Definition: Fl_Double_Window.H:40
toggle_sourceview_cb
void toggle_sourceview_cb(Fl_Double_Window *, void *)
Definition: fluid.cxx:1199
Fl_Menu_Item
Definition: Fl_Menu_Item.H:112
png_write_info
PNG_IMPEXP void() png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngwrite.c:191
Fl_Preferences::flush
void flush()
Definition: Fl_Preferences.cxx:896
Fl_Process::get_line
char * get_line(char *line, size_t s) const
Definition: fluid.cxx:1362
Fl::remove_fd
static void remove_fd(int, int when)
Definition: Fl_win32.cxx:323
grid_cb
void grid_cb(Fl_Int_Input *, long)
Definition: Fl_Window_Type.cxx:78
make_layout_window
Fl_Double_Window * make_layout_window()
Definition: alignment_panel.cxx:438
template_instance
Fl_Input * template_instance
Definition: template_panel.cxx:110
open_cb
void open_cb(Fl_Widget *, void *v)
Definition: fluid.cxx:501
paste_cb
void paste_cb(Fl_Widget *, void *)
Definition: fluid.cxx:836
i18n_file
const char * i18n_file
Definition: fluid.cxx:705
Fl_Widget::tooltip
const char * tooltip() const
Definition: Fl_Widget.H:552
FL_NORMAL_LABEL
draws the text (0)
Definition: Enumerations.H:764
sourceview_panel
Fl_Double_Window * sourceview_panel
Definition: function_panel.cxx:1069
Fl_Plugin_Manager::plugin
Fl_Plugin * plugin(int index)
Return the address of a plugin by index.
Definition: Fl_Preferences.cxx:1664
Fl_Preferences
Fl_Preferences provides methods to store user settings between application starts.
Definition: Fl_Preferences.H:60
undo_current
int undo_current
Definition: undo.cxx:54
make_main_window
void make_main_window()
Definition: fluid.cxx:1230
Fl_Type::code_position
int code_position
Definition: Fl_Type.h:76
FL_INDEX
Definition: Enumerations.H:1086
shell_command_input
Fl_Input * shell_command_input
Definition: alignment_panel.cxx:329
scheme_cb
void scheme_cb(Fl_Choice *, void *)
Definition: fluid.cxx:1158
sv_autoposition
Fl_Light_Button * sv_autoposition
Definition: function_panel.cxx:1079
Fl_Native_File_Chooser::BROWSE_FILE
browse files (lets user choose one file)
Definition: Fl_Native_File_Chooser.H:114
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
BROWSERHEIGHT
#define BROWSERHEIGHT
Definition: fluid.cxx:1151
malloc
voidp malloc()
Fl_Native_File_Chooser.H
Fl_Group::child
Fl_Widget * child(int n) const
Definition: Fl_Group.H:79
Fl_Button.H
compile_file
int compile_file
Definition: fluid.cxx:695
write_sourceview
int write_sourceview
Definition: code.cxx:282
Fl_Printer::origin
void origin(int *x, int *y)
Computes the page coordinates of the current origin of graphics functions.
Definition: Fl_Printer.cxx:133
Y
static int Y
Definition: Fl_Tooltip.cxx:76
gridx
int gridx
Definition: fluid.cxx:92
Fl_Double_Window::show
void show()
Definition: Fl_Double_Window.cxx:79
fl_filename_setext
char * fl_filename_setext(char *to, int tolen, const char *ext)
Definition: filename_setext.cxx:40
Fl_Window_Type
Definition: Fl_Type.h:584
title
static const char * title
Definition: Fl_arg.cxx:55
save_item
Fl_Menu_Item * save_item
Definition: fluid.cxx:112
fluid_org_png
unsigned char fluid_org_png[27580]
Definition: about_panel.cxx:303
ExternalCodeEditor::editors_open
static int editors_open()
Definition: ExternalCodeEditor_UNIX.cxx:458
new_cb
void new_cb(Fl_Widget *, void *v)
Definition: fluid.cxx:581
Fl_Printer
OS-independent print support.
Definition: Fl_Printer.H:176
Fl_Paged_Device::print_window
void print_window(Fl_Window *win, int x_offset=0, int y_offset=0)
Definition: Fl_win32.cxx:2772
write_cb
void write_cb(Fl_Widget *, void *)
Definition: fluid.cxx:709
Fl_Browser::data
void * data(int line) const
Definition: Fl_Browser.cxx:735
sort
Fl_Type * sort(Fl_Type *parent)
Definition: Fl_Widget_Type.cxx:270
template_panel
Fl_Double_Window * template_panel
Definition: template_panel.cxx:37
Fl_Menu_Bar.H
sort_cb
static void sort_cb(Fl_Widget *, void *)
Definition: fluid.cxx:884
Fl_Window_Type::read_image
uchar * read_image(int &ww, int &hh)
Definition: Fl_Window_Type.cxx:427
strlcat
#define strlcat
Definition: flstring.h:79
Fl::scheme
static const char * scheme()
Definition: Fl.H:339
png_write_end
PNG_IMPEXP void() png_write_end(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngwrite.c:347
update_sourceview_cb
void update_sourceview_cb(Fl_Button *, void *)
Definition: fluid.cxx:1636
Fl_PNG_Image.H
Fl_Commandline_Plugin::help
virtual const char * help()=0
set_filename
void set_filename(const char *c)
Definition: fluid.cxx:1568
Fl_Tabs::value
Fl_Widget * value()
Definition: Fl_Tabs.cxx:297
FL_F
#define FL_F
One of the function keys; use FL_F + n for function key n.
Definition: Enumerations.H:495
code
Definition: inftrees.h:24
show_settings_cb
void show_settings_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:234
fl_message.H
png.h
uchar
unsigned char uchar
Definition: fl_types.h:30
external_editor_timer
static void external_editor_timer(void *)
Definition: fluid.cxx:198
Fl_Browser::size
int size() const
Definition: Fl_Browser.H:141
save_cb
void save_cb(Fl_Widget *, void *v)
Definition: fluid.cxx:229
name
static const char * name
Definition: Fl_arg.cxx:53
fl_alert
void fl_alert(const char *,...)
Definition: fl_ask.cxx:361
main_menubar
Fl_Menu_Bar * main_menubar
Definition: fluid.cxx:177
FL_Delete
#define FL_Delete
The delete key.
Definition: Enumerations.H:506
png_set_IHDR
PNG_IMPEXP void() png_set_IHDR(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)
Definition: pngset.c:206
force_parent
int force_parent
Definition: Fl_Widget_Type.cxx:41
manual_cb
void manual_cb(Fl_Widget *, void *)
Definition: fluid.cxx:979
WINHEIGHT
#define WINHEIGHT
Definition: fluid.cxx:1154
make_global_settings_window
Fl_Double_Window * make_global_settings_window()
Definition: alignment_panel.cxx:728
Fl_Window::decorated_w
int decorated_w()
Definition: Fl_win32.cxx:2757
FL_DOUBLE
Definition: Enumerations.H:1088
Fl_Native_File_Chooser::show
int show()
Definition: Fl_Native_File_Chooser_FLTK.cxx:242
png_init_io
void png_init_io(png_structrp png_ptr, png_FILE_p fp)
Definition: png.c:658
Fl_PNG_Image
Definition: Fl_PNG_Image.H:32
i18n_type
int i18n_type
Definition: fluid.cxx:702
FL_SOCKET
#define FL_SOCKET
Definition: Fl.H:56
group_cb
void group_cb(Fl_Widget *, void *)
Definition: Fl_Group_Type.cxx:62
template_panel.h
toggle_widgetbin_cb
void toggle_widgetbin_cb(Fl_Widget *, void *)
Definition: fluid.cxx:1183
zlib.h
fl_open_uri
int fl_open_uri(const char *uri, char *msg, int msglen)
Definition: fl_open_uri.cxx:98
Fl::help
static const char *const help
Definition: Fl.H:315
code_file_set
int code_file_set
Definition: fluid.cxx:699
sv_tab
Fl_Tabs * sv_tab
Definition: function_panel.cxx:1071
beenhere
static uchar beenhere
Definition: fl_color.cxx:57
Fl_Type::header_position
int header_position
Definition: Fl_Type.h:76
make_sourceview
Fl_Double_Window * make_sourceview()
Definition: function_panel.cxx:1081
ExternalCodeEditor::stop_update_timer
static void stop_update_timer()
Definition: ExternalCodeEditor_UNIX.cxx:441
Fl_Group::resizable
void resizable(Fl_Widget &o)
Definition: Fl_Group.H:117
sv_header_filename
static char * sv_header_filename
Definition: fluid.cxx:1630
update_file
int update_file
Definition: fluid.cxx:694
png_create_write_struct
PNG_IMPEXP png_structp() png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
Definition: pngwrite.c:482
template_submit
Fl_Return_Button * template_submit
Definition: template_panel.cxx:125
show_comments
int show_comments
Definition: fluid.cxx:96
update_sourceview_position
void update_sourceview_position()
Definition: fluid.cxx:1591
Fl_Commandline_Plugin
Definition: Fl_Type.h:895