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_File_Browser.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Fl_File_Browser routines.
5 //
6 // Copyright 1999-2010 by Michael Sweet.
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 // Contents:
19 //
20 // Fl_File_Browser::full_height() - Return the height of the list.
21 // Fl_File_Browser::item_height() - Return the height of a list item.
22 // Fl_File_Browser::item_width() - Return the width of a list item.
23 // Fl_File_Browser::item_draw() - Draw a list item.
24 // Fl_File_Browser::Fl_File_Browser() - Create a Fl_File_Browser widget.
25 // Fl_File_Browser::load() - Load a directory into the browser.
26 // Fl_File_Browser::filter() - Set the filename filter.
27 //
28 
29 //
30 // Include necessary header files...
31 //
32 
33 #include <FL/Fl_File_Browser.H>
34 #include <FL/fl_draw.H>
35 #include <FL/filename.H>
36 #include <FL/Fl_Image.H> // icon
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include "flstring.h"
40 
41 #ifdef __CYGWIN__
42 # include <mntent.h>
43 #elif defined(WIN32)
44 # include <windows.h>
45 # include <direct.h>
46 // Apparently Borland C++ defines DIRECTORY in <direct.h>, which
47 // interfers with the Fl_File_Icon enumeration of the same name.
48 # ifdef DIRECTORY
49 # undef DIRECTORY
50 # endif // DIRECTORY
51 #endif // __CYGWIN__
52 
53 #ifdef __EMX__
54 # define INCL_DOS
55 # define INCL_DOSMISC
56 # include <os2.h>
57 #endif // __EMX__
58 
59 #if defined(__APPLE__)
60 # include <sys/param.h>
61 # include <sys/ucred.h>
62 # include <sys/mount.h>
63 #endif // __APPLE__
64 
65 #if defined(_AIX)
66 extern "C" {
67 # include <sys/types.h>
68 # include <sys/vmount.h>
69 # include <sys/mntctl.h>
70  // Older AIX versions don't expose this prototype
71  int
72  mntctl(int, int, char *);
73 }
74 #endif // _AIX
75 
76 #if defined(__NetBSD__)
77 extern "C" {
78 # include <sys/param.h> // For '__NetBSD_Version__' definition
79 # if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 300000000)
80 # include <sys/types.h>
81 # include <sys/statvfs.h>
82 # if defined(HAVE_PTHREAD) && defined(HAVE_PTHREAD_H)
83 # include <pthread.h>
84 # endif // HAVE_PTHREAD && HAVE_PTHREAD_H
85 # ifdef HAVE_PTHREAD
86  static pthread_mutex_t getvfsstat_mutex = PTHREAD_MUTEX_INITIALIZER;
87 # endif // HAVE_PTHREAD/
88 # endif // __NetBSD_Version__
89 }
90 #endif // __NetBSD__
91 
92 //
93 // FL_BLINE definition from "Fl_Browser.cxx"...
94 //
95 
96 #define SELECTED 1
97 #define NOTDISPLAYED 2
98 
99 // TODO -- Warning: The definition of FL_BLINE here is a hack.
100 // Fl_File_Browser should not do this. PLEASE FIX.
101 // FL_BLINE should be private to Fl_Browser, and not re-defined here.
102 // For now, make sure this struct is precisely consistent with Fl_Browser.cxx.
103 //
104 struct FL_BLINE // data is in a linked list of these
105 {
106  FL_BLINE *prev; // Previous item in list
107  FL_BLINE *next; // Next item in list
108  void *data; // Pointer to data (function)
109  Fl_Image *icon; // Pointer to optional icon
110  short length; // sizeof(txt)-1, may be longer than string
111  char flags; // selected, displayed
112  char txt[1]; // start of allocated array
113 };
114 
115 
116 //
117 // 'Fl_File_Browser::full_height()' - Return the height of the list.
118 //
119 
120 int // O - Height in pixels
122 {
123  int i, // Looping var
124  th; // Total height of list.
125 
126 
127  for (i = 0, th = 0; i < size(); i ++)
128  th += item_height(find_line(i));
129 
130  return (th);
131 }
132 
133 
134 //
135 // 'Fl_File_Browser::item_height()' - Return the height of a list item.
136 //
137 
138 int // O - Height in pixels
139 Fl_File_Browser::item_height(void *p) const // I - List item data
140 {
141  FL_BLINE *line; // Pointer to line
142  char *t; // Pointer into text
143  int height; // Width of line
144  int textheight; // Height of text
145 
146 
147  // Figure out the standard text height...
148  fl_font(textfont(), textsize());
149  textheight = fl_height();
150 
151  // We always have at least 1 line...
152  height = textheight;
153 
154  // Scan for newlines...
155  line = (FL_BLINE *)p;
156 
157  if (line != NULL)
158  for (t = line->txt; *t != '\0'; t ++)
159  if (*t == '\n')
160  height += textheight;
161 
162  // If we have enabled icons then add space for them...
163  if (Fl_File_Icon::first() != NULL && height < iconsize_)
164  height = iconsize_;
165 
166  // Add space for the selection border..
167  height += 2;
168 
169  // Return the height
170  return (height);
171 }
172 
173 
174 //
175 // 'Fl_File_Browser::item_width()' - Return the width of a list item.
176 //
177 
178 int // O - Width in pixels
179 Fl_File_Browser::item_width(void *p) const // I - List item data
180 {
181  int i; // Looping var
182  FL_BLINE *line; // Pointer to line
183  char *t, // Pointer into text
184  *ptr, // Pointer into fragment
185  fragment[10240]; // Fragment of text
186  int width, // Width of line
187  tempwidth; // Width of fragment
188  int column; // Current column
189  const int *columns; // Columns
190 
191 
192  // Scan for newlines...
193  line = (FL_BLINE *)p;
194  columns = column_widths();
195 
196  // Set the font and size...
197  if (line->txt[strlen(line->txt) - 1] == '/')
198  fl_font(textfont() | FL_BOLD, textsize());
199  else
200  fl_font(textfont(), textsize());
201 
202  if (strchr(line->txt, '\n') == NULL &&
203  strchr(line->txt, column_char()) == NULL)
204  {
205  // Do a fast width calculation...
206  width = (int)fl_width(line->txt);
207  }
208  else
209  {
210  // More than 1 line or have columns; find the maximum width...
211  width = 0;
212  tempwidth = 0;
213  column = 0;
214 
215  for (t = line->txt, ptr = fragment; *t != '\0'; t ++)
216  if (*t == '\n')
217  {
218  // Newline - nul terminate this fragment and get the width...
219  *ptr = '\0';
220 
221  tempwidth += (int)fl_width(fragment);
222 
223  // Update the max width as needed...
224  if (tempwidth > width)
225  width = tempwidth;
226 
227  // Point back to the start of the fragment...
228  ptr = fragment;
229  tempwidth = 0;
230  column = 0;
231  }
232  else if (*t == column_char())
233  {
234  // Advance to the next column...
235  column ++;
236  if (columns)
237  {
238  for (i = 0, tempwidth = 0; i < column && columns[i]; i ++)
239  tempwidth += columns[i];
240  }
241  else
242  tempwidth = column * (int)(fl_height() * 0.6 * 8.0);
243 
244  if (tempwidth > width)
245  width = tempwidth;
246 
247  ptr = fragment;
248  }
249  else
250  *ptr++ = *t;
251 
252  if (ptr > fragment)
253  {
254  // Nul terminate this fragment and get the width...
255  *ptr = '\0';
256 
257  tempwidth += (int)fl_width(fragment);
258 
259  // Update the max width as needed...
260  if (tempwidth > width)
261  width = tempwidth;
262  }
263  }
264 
265  // If we have enabled icons then add space for them...
266  if (Fl_File_Icon::first() != NULL)
267  width += iconsize_ + 8;
268 
269  // Add space for the selection border..
270  width += 2;
271 
272  // Return the width
273  return (width);
274 }
275 
276 
277 //
278 // 'Fl_File_Browser::item_draw()' - Draw a list item.
279 //
280 
281 void
282 Fl_File_Browser::item_draw(void *p, // I - List item data
283  int X, // I - Upper-lefthand X coordinate
284  int Y, // I - Upper-lefthand Y coordinate
285  int W, // I - Width of item
286  int) const // I - Height of item
287 {
288  int i; // Looping var
289  FL_BLINE *line; // Pointer to line
290  Fl_Color c; // Text color
291  char *t, // Pointer into text
292  *ptr, // Pointer into fragment
293  fragment[10240]; // Fragment of text
294  int width, // Width of line
295  height; // Height of line
296  int column; // Current column
297  const int *columns; // Columns
298 
299 
300  // Draw the list item text...
301  line = (FL_BLINE *)p;
302 
303  if (line->txt[strlen(line->txt) - 1] == '/')
304  fl_font(textfont() | FL_BOLD, textsize());
305  else
306  fl_font(textfont(), textsize());
307 
308  if (line->flags & SELECTED)
309  c = fl_contrast(textcolor(), selection_color());
310  else
311  c = textcolor();
312 
313  if (Fl_File_Icon::first() == NULL)
314  {
315  // No icons, just draw the text...
316  X ++;
317  W -= 2;
318  }
319  else
320  {
321  // Draw the icon if it is set...
322  if (line->data)
323  ((Fl_File_Icon *)line->data)->draw(X, Y, iconsize_, iconsize_,
324  (line->flags & SELECTED) ? FL_YELLOW :
325  FL_LIGHT2,
326  active_r());
327 
328  // Draw the text offset to the right...
329  X += iconsize_ + 9;
330  W -= iconsize_ - 10;
331 
332  // Center the text vertically...
333  height = fl_height();
334 
335  for (t = line->txt; *t != '\0'; t ++)
336  if (*t == '\n')
337  height += fl_height();
338 
339  if (height < iconsize_)
340  Y += (iconsize_ - height) / 2;
341  }
342 
343  // Draw the text...
344  line = (FL_BLINE *)p;
345  columns = column_widths();
346  width = 0;
347  column = 0;
348 
349  if (active_r())
350  fl_color(c);
351  else
352  fl_color(fl_inactive(c));
353 
354  for (t = line->txt, ptr = fragment; *t != '\0'; t ++) {
355  if (*t == '\n') {
356  // Newline - nul terminate this fragment and draw it...
357  *ptr = '\0';
358 
359  fl_draw(fragment, X + width, Y, W - width, fl_height(),
361 
362  // Point back to the start of the fragment...
363  ptr = fragment;
364  width = 0;
365  Y += fl_height();
366  column = 0;
367  } else if (*t == column_char()) {
368  // Tab - nul terminate this fragment and draw it...
369  *ptr = '\0';
370 
371  int cW = W - width; // Clip width...
372 
373  if (columns) {
374  // Try clipping inside this column...
375  for (i = 0; i < column && columns[i]; i ++) { ; }
376 
377  if (columns[i])
378  cW = columns[i];
379  }
380 
381  fl_draw(fragment, X + width, Y, cW, fl_height(),
383 
384  // Advance to the next column...
385  column ++;
386  if (columns) {
387  for (i = 0, width = 0; i < column && columns[i]; i ++)
388  width += columns[i];
389  }
390  else
391  width = column * (int)(fl_height() * 0.6 * 8.0);
392  ptr = fragment;
393  }
394  else
395  *ptr++ = *t;
396  }
397  if (ptr > fragment) {
398  // Nul terminate this fragment and draw it...
399  *ptr = '\0';
400 
401  fl_draw(fragment, X + width, Y, W - width, fl_height(),
403  }
404 }
405 
406 
407 //
408 // 'Fl_File_Browser::Fl_File_Browser()' - Create a Fl_File_Browser widget.
409 //
410 
411 Fl_File_Browser::Fl_File_Browser(int X, // I - Upper-lefthand X coordinate
412  int Y, // I - Upper-lefthand Y coordinate
413  int W, // I - Width in pixels
414  int H, // I - Height in pixels
415  const char *l) // I - Label text
416  : Fl_Browser(X, Y, W, H, l)
417 {
418  // Initialize the filter pattern, current directory, and icon size...
419  pattern_ = "*";
420  directory_ = "";
421  iconsize_ = (uchar)(3 * textsize() / 2);
422  filetype_ = FILES;
423 }
424 
425 
426 //
427 // 'Fl_File_Browser::load()' - Load a directory into the browser.
428 //
429 
430 int // O - Number of files loaded
431 Fl_File_Browser::load(const char *directory,// I - Directory to load
432  Fl_File_Sort_F *sort) // I - Sort function to use
433 {
434  int i; // Looping var
435  int num_files; // Number of files in directory
436  int num_dirs; // Number of directories in list
437  char filename[4096]; // Current file
438  Fl_File_Icon *icon; // Icon to use
439 
440 
441 // printf("Fl_File_Browser::load(\"%s\")\n", directory);
442 
443  clear();
444 
445  directory_ = directory;
446 
447  if (!directory)
448  return (0);
449 
450  if (directory_[0] == '\0')
451  {
452  //
453  // No directory specified; for UNIX list all mount points. For DOS
454  // list all valid drive letters...
455  //
456 
457  num_files = 0;
460 
461 #ifdef WIN32
462 # ifdef __CYGWIN__
463  //
464  // Cygwin provides an implementation of setmntent() to get the list
465  // of available drives...
466  //
467  FILE *m = setmntent("/-not-used-", "r");
468  struct mntent *p;
469 
470  while ((p = getmntent (m)) != NULL) {
471  add(p->mnt_dir, icon);
472  num_files ++;
473  }
474 
475  endmntent(m);
476 # else
477  //
478  // Normal WIN32 code uses drive bits...
479  //
480  DWORD drives; // Drive available bits
481 
482  drives = GetLogicalDrives();
483  for (i = 'A'; i <= 'Z'; i ++, drives >>= 1)
484  if (drives & 1)
485  {
486  sprintf(filename, "%c:/", i);
487 
488  if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32
489  add(filename, icon);
490  else
491  add(filename, icon);
492 
493  num_files ++;
494  }
495 # endif // __CYGWIN__
496 #elif defined(__EMX__)
497  //
498  // OS/2 code uses drive bits...
499  //
500  ULONG curdrive; // Current drive
501  ULONG drives; // Drive available bits
502  int start = 3; // 'C' (MRS - dunno if this is correct!)
503 
504 
505  DosQueryCurrentDisk(&curdrive, &drives);
506  drives >>= start - 1;
507  for (i = 'A'; i <= 'Z'; i ++, drives >>= 1)
508  if (drives & 1)
509  {
510  sprintf(filename, "%c:/", i);
511  add(filename, icon);
512 
513  num_files ++;
514  }
515 #elif defined(__APPLE__)
516  // MacOS X and Darwin use getfsstat() system call...
517  int numfs; // Number of file systems
518  struct statfs *fs; // Buffer for file system info
519 
520 
521  // We always have the root filesystem.
522  add("/", icon);
523 
524  // Get the mounted filesystems...
525  numfs = getfsstat(NULL, 0, MNT_NOWAIT);
526  if (numfs > 0) {
527  // We have file systems, get them...
528  fs = new struct statfs[numfs];
529  getfsstat(fs, sizeof(struct statfs) * numfs, MNT_NOWAIT);
530 
531  // Add filesystems to the list...
532  for (i = 0; i < numfs; i ++) {
533  // Ignore "/", "/dev", and "/.vol"...
534  if (fs[i].f_mntonname[1] && strcmp(fs[i].f_mntonname, "/dev") &&
535  strcmp(fs[i].f_mntonname, "/.vol")) {
536  snprintf(filename, sizeof(filename), "%s/", fs[i].f_mntonname);
537  add(filename, icon);
538  }
539  num_files ++;
540  }
541 
542  // Free the memory used for the file system info array...
543  delete[] fs;
544  }
545 #elif defined(_AIX)
546  // AIX don't write the mounted filesystems to a file like '/etc/mnttab'.
547  // But reading the list of mounted filesystems from the kernel is possible:
548  // http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.basetechref/doc/basetrf1/mntctl.htm
549  int res = -1, len;
550  char *list = NULL, *name;
551  struct vmount *vp;
552 
553  // We always have the root filesystem
554  add("/", icon);
555  // Get the required buffer size for the vmount structures
556  res = mntctl(MCTL_QUERY, sizeof(len), (char *) &len);
557  if (!res) {
558  // Allocate buffer ...
559  list = (char *) malloc((size_t) len);
560  if (NULL == list) {
561  res = -1;
562  } else {
563  // ... and read vmount structures from kernel
564  res = mntctl(MCTL_QUERY, len, list);
565  if (0 >= res) {
566  res = -1;
567  } else {
568  for (i = 0, vp = (struct vmount *) list; i < res; ++i) {
569  name = (char *) vp + vp->vmt_data[VMT_STUB].vmt_off;
570  strlcpy(filename, name, sizeof(filename));
571  // Skip the already added root filesystem
572  if (strcmp("/", filename) != 0) {
573  strlcat(filename, "/", sizeof(filename));
574  add(filename, icon);
575  }
576  vp = (struct vmount *) ((char *) vp + vp->vmt_length);
577  }
578  }
579  }
580  }
581  // Note: Executing 'free(NULL)' is allowed and simply do nothing
582  free((void *) list);
583 #elif defined(__NetBSD__) && defined(__NetBSD_Version__) \
584  && (__NetBSD_Version__ >= 300000000)
585  // NetBSD don't write the mounted filesystems to a file like '/etc/mnttab'.
586  // Since NetBSD 3.0 the system call getvfsstat(2) has replaced getfsstat(2)
587  // that is used by getmntinfo(3):
588  // http://www.daemon-systems.org/man/getmntinfo.3.html
589  int res = -1;
590  struct statvfs *list;
591 
592  // We always have the root filesystem
593  add("/", icon);
594 # ifdef HAVE_PTHREAD
595  // Lock mutex for thread safety
596  if (!pthread_mutex_lock(&getvfsstat_mutex)) {
597 # endif // HAVE_PTHREAD
598  // Get list of statvfs structures
599  res = getmntinfo(&list, ST_WAIT);
600  if(0 < res) {
601  for (i = 0; i < res; ++i) {
602  strlcpy(filename, list[i].f_mntonname, sizeof(filename));
603  // Skip the already added root filesystem
604  if (strcmp("/", filename) != 0) {
605  strlcat(filename, "/", sizeof(filename));
606  add(filename, icon);
607  }
608  }
609  } else {
610  res = -1;
611  }
612 # ifdef HAVE_PTHREAD
613  pthread_mutex_unlock(&getvfsstat_mutex);
614  }
615 # endif // HAVE_PTHREAD
616 #else
617  //
618  // UNIX code uses /etc/fstab or similar...
619  //
620  FILE *mtab; // /etc/mtab or /etc/mnttab file
621  char line[FL_PATH_MAX]; // Input line
622 
623  //
624  // Open the file that contains a list of mounted filesystems...
625  //
626 
627  mtab = fl_fopen("/etc/mnttab", "r"); // Fairly standard
628  if (mtab == NULL)
629  mtab = fl_fopen("/etc/mtab", "r"); // More standard
630  if (mtab == NULL)
631  mtab = fl_fopen("/etc/fstab", "r"); // Otherwise fallback to full list
632  if (mtab == NULL)
633  mtab = fl_fopen("/etc/vfstab", "r"); // Alternate full list file
634 
635  if (mtab != NULL)
636  {
637  // We always have the root filesystem
638  add("/", icon);
639  num_files ++;
640  while (fgets(line, sizeof(line), mtab) != NULL)
641  {
642  if (line[0] == '#' || line[0] == '\n')
643  continue;
644  if (sscanf(line, "%*s%4095s", filename) != 1)
645  continue;
646 
647  if (strcmp("/", filename) == 0) continue; // root was added before
648  // Add a trailing slash (except for the root filesystem)
649  strlcat(filename, "/", sizeof(filename));
650 
651 // printf("Fl_File_Browser::load() - adding \"%s\" to list...\n", filename);
652  add(filename, icon);
653  num_files ++;
654  }
655 
656  fclose(mtab);
657  } else {
658  // Every Unix has a root filesystem '/'.
659  // This last stage fallback ensures that the user don't get an empty
660  // window after requesting filesystem list.
661  add("/", icon);
662  }
663 #endif // WIN32 || __EMX__ || __APPLE__ || _AIX || ...
664  }
665  else
666  {
667  dirent **files; // Files in in directory
668 
669 
670  //
671  // Build the file list...
672  //
673 
674 #if (defined(WIN32) && !defined(__CYGWIN__)) || defined(__EMX__)
675  strlcpy(filename, directory_, sizeof(filename));
676  i = (int) (strlen(filename) - 1);
677 
678  if (i == 2 && filename[1] == ':' &&
679  (filename[2] == '/' || filename[2] == '\\'))
680  filename[2] = '/';
681  else if (filename[i] != '/' && filename[i] != '\\')
682  strlcat(filename, "/", sizeof(filename));
683 
684  num_files = fl_filename_list(filename, &files, sort);
685 #else
686  num_files = fl_filename_list(directory_, &files, sort);
687 #endif /* WIN32 || __EMX__ */
688 
689  if (num_files <= 0)
690  return (0);
691 
692  for (i = 0, num_dirs = 0; i < num_files; i ++) {
693  if (strcmp(files[i]->d_name, "./")) {
694  snprintf(filename, sizeof(filename), "%s/%s", directory_,
695  files[i]->d_name);
696 
698  if ((icon && icon->type() == Fl_File_Icon::DIRECTORY) ||
700  num_dirs ++;
701  insert(num_dirs, files[i]->d_name, icon);
702  } else if (filetype_ == FILES &&
703  fl_filename_match(files[i]->d_name, pattern_)) {
704  add(files[i]->d_name, icon);
705  }
706  }
707 
708  free(files[i]);
709  }
710 
711  free(files);
712  }
713 
714  return (num_files);
715 }
716 
717 
718 //
719 // 'Fl_File_Browser::filter()' - Set the filename filter.
720 //
721 
722 void
723 Fl_File_Browser::filter(const char *pattern) // I - Pattern string
724 {
725  // If pattern is NULL set the pattern to "*"...
726  if (pattern)
727  pattern_ = pattern;
728  else
729  pattern_ = "*";
730 }
731 
732 
733 //
734 // End of "$Id$".
735 //
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
Fl_File_Icon
Definition: Fl_File_Icon.H:47
fl_width
FL_EXPORT double fl_width(const char *txt)
Definition: fl_font.cxx:65
FL_ALIGN_LEFT
const Fl_Align FL_ALIGN_LEFT
Definition: Enumerations.H:839
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
Fl_Image
Base class for image caching and drawing.
Definition: Fl_Image.H:55
Fl_File_Browser::directory_
const char * directory_
Definition: Fl_File_Browser.H:42
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
FL_BLINE::next
FL_BLINE * next
Definition: Fl_Browser.cxx:50
Fl_File_Browser::filetype_
int filetype_
Definition: Fl_File_Browser.H:41
filename.H
Fl_Browser::insert
void insert(int line, FL_BLINE *item)
Definition: Fl_Browser.cxx:243
free
void free()
H
static int H
Definition: Fl_Tooltip.cxx:76
fl_height
int fl_height()
Definition: fl_draw.H:527
NULL
#define NULL
Definition: forms.H:34
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Definition: fl_font.cxx:70
Fl_Browser_::sort
void sort(int flags=0)
Definition: Fl_Browser_.cxx:993
Fl_File_Browser::item_draw
void item_draw(void *, int, int, int, int) const
Definition: Fl_File_Browser.cxx:282
fl_contrast
Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg)
Definition: fl_color.cxx:435
Fl_Browser
Definition: Fl_Browser.H:80
Fl_File_Icon::first
static Fl_File_Icon * first()
Definition: Fl_File_Icon.H:151
fl_fopen
FILE * fl_fopen(const char *f, const char *mode)
Definition: fl_utf8.cxx:498
Fl_File_Browser::iconsize_
uchar iconsize_
Definition: Fl_File_Browser.H:43
snprintf
#define snprintf
Definition: flstring.h:64
Fl_Browser::icon
void icon(int line, Fl_Image *icon)
Definition: Fl_Browser.cxx:896
Fl_File_Browser::full_height
int full_height() const
Definition: Fl_File_Browser.cxx:121
Fl_File_Icon::find
static Fl_File_Icon * find(const char *filename, int filetype=ANY)
Definition: Fl_File_Icon.cxx:181
Fl_File_Browser::textsize
Fl_Fontsize textsize() const
Definition: Fl_File_Browser.H:88
FL_BLINE::length
short length
Definition: Fl_Browser.cxx:53
p
static menustate * p
Definition: Fl_Menu.cxx:606
FL_BLINE::txt
char txt[1]
Definition: Fl_Browser.cxx:55
FL_BLINE::icon
Fl_Image * icon
Definition: Fl_Browser.cxx:52
SELECTED
#define SELECTED
Definition: Fl_File_Browser.cxx:96
Fl_File_Browser::Fl_File_Browser
Fl_File_Browser(int, int, int, int, const char *=0)
Definition: Fl_File_Browser.cxx:411
FL_PATH_MAX
#define FL_PATH_MAX
Definition: filename.H:38
FL_YELLOW
const Fl_Color FL_YELLOW
Definition: Enumerations.H:959
fl_filename_match
int fl_filename_match(const char *name, const char *pattern)
Definition: filename_match.cxx:44
fl_filename_list
int fl_filename_list(const char *d, dirent ***list, Fl_File_Sort_F *sort)
Definition: filename_list.cxx:75
fl_draw.H
utility header to pull drawing functions together
filename
static const char * filename
Definition: fluid.cxx:119
Fl_File_Browser::pattern_
const char * pattern_
Definition: Fl_File_Browser.H:44
fl_inactive
Fl_Color fl_inactive(Fl_Color c)
Definition: fl_color.cxx:423
strlcpy
#define strlcpy
Definition: flstring.h:84
Fl_File_Browser::FILES
Definition: Fl_File_Browser.H:53
FL_BLINE::flags
char flags
Definition: Fl_Browser.cxx:54
sort
Fl_Type * sort(Fl_Type *parent)
Definition: Fl_Widget_Type.cxx:270
Fl_File_Browser::filter
const char * filter() const
Definition: Fl_File_Browser.H:77
FL_LIGHT2
const Fl_Color FL_LIGHT2
Definition: Enumerations.H:951
Fl_File_Icon::DIRECTORY
Definition: Fl_File_Icon.H:66
FL_BLINE::data
void * data
Definition: Fl_Browser.cxx:51
_fl_filename_isdir_quick
int _fl_filename_isdir_quick(const char *n)
Definition: filename_isdir.cxx:35
Fl_File_Browser::load
int load(const char *directory, Fl_File_Sort_F *sort=fl_numericsort)
Definition: Fl_File_Browser.cxx:431
Fl_File_Sort_F
int() Fl_File_Sort_F(struct dirent **, struct dirent **)
Definition: filename.H:116
FL_BOLD
const Fl_Font FL_BOLD
add this to helvetica, courier, or times
Definition: Enumerations.H:897
Fl_File_Browser.H
Fl_File_Icon::DEVICE
Definition: Fl_File_Icon.H:64
Fl_Browser::add
void add(const char *newtext, void *d=0)
Definition: Fl_Browser.cxx:710
Fl_Browser::find_line
FL_BLINE * find_line(int line) const
Definition: Fl_Browser.cxx:147
Fl_File_Browser::item_width
int item_width(void *) const
Definition: Fl_File_Browser.cxx:179
malloc
voidp malloc()
FL_BLINE::prev
FL_BLINE * prev
Definition: Fl_Browser.cxx:49
Y
static int Y
Definition: Fl_Tooltip.cxx:76
Fl_Image.H
flstring.h
Fl_Browser::clear
void clear()
Definition: Fl_Browser.cxx:685
strlcat
#define strlcat
Definition: flstring.h:79
Fl_Align
unsigned Fl_Align
Definition: Enumerations.H:828
start
static int start(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int w, int h, int &cx, int &cy, int &X, int &Y, int &W, int &H)
Definition: Fl_Image.cxx:655
uchar
unsigned char uchar
Definition: fl_types.h:30
Fl_Browser::size
int size() const
Definition: Fl_Browser.H:141
name
static const char * name
Definition: Fl_arg.cxx:53
FL_BLINE
Definition: Fl_Browser.cxx:48
Fl_File_Browser::item_height
int item_height(void *) const
Definition: Fl_File_Browser.cxx:139
dirent
#define dirent
Definition: numericsort.c:31
FL_ALIGN_CLIP
const Fl_Align FL_ALIGN_CLIP
Definition: Enumerations.H:849