|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <Fl_File_Icon.H>
Public Types | |
| enum | { ANY, PLAIN, FIFO, DEVICE, LINK, DIRECTORY } |
| enum | { END, COLOR, LINE, CLOSEDLINE, POLYGON, OUTLINEPOLYGON, VERTEX } |
Public Member Functions | |
| Fl_File_Icon (const char *p, int t, int nd=0, short *d=0) | |
| ~Fl_File_Icon () | |
| short * | add (short d) |
| short * | add_color (Fl_Color c) |
| short * | add_vertex (int x, int y) |
| short * | add_vertex (float x, float y) |
| void | clear () |
| void | draw (int x, int y, int w, int h, Fl_Color ic, int active=1) |
| void | label (Fl_Widget *w) |
| void | load (const char *f) |
| int | load_fti (const char *fti) |
| int | load_image (const char *i) |
| Fl_File_Icon * | next () |
| const char * | pattern () |
| int | size () |
| int | type () |
| short * | value () |
Static Public Member Functions | |
| static void | labeltype (const Fl_Label *o, int x, int y, int w, int h, Fl_Align a) |
| static Fl_File_Icon * | find (const char *filename, int filetype=ANY) |
| static Fl_File_Icon * | first () |
| static void | load_system_icons (void) |
The Fl_File_Icon class manages icon images that can be used as labels in other widgets and as icons in the FileBrowser widget.
Definition at line 56 of file Fl_File_Icon.H.
| anonymous enum |
Definition at line 68 of file Fl_File_Icon.H.
| anonymous enum |
Definition at line 78 of file Fl_File_Icon.H.
| Fl_File_Icon::Fl_File_Icon | ( | const char * | p, |
| int | t, | ||
| int | nd = 0, |
||
| short * | d = 0 |
||
| ) |
Creates a new Fl_File_Icon with the specified information.
| [in] | p | filename pattern |
| [in] | t | file type |
| [in] | nd | number of data values |
| [in] | d | data values |
Definition at line 91 of file Fl_File_Icon.cxx.
Referenced by load_system_icons().
| Fl_File_Icon::~Fl_File_Icon | ( | ) |
The destructor destroys the icon and frees all memory that has been allocated for it.
Definition at line 124 of file Fl_File_Icon.cxx.
| short * Fl_File_Icon::add | ( | short | d | ) |
Adds a keyword value to the icon array, returning a pointer to it.
| [in] | d | data value |
Definition at line 154 of file Fl_File_Icon.cxx.
Referenced by load_fti(), and load_image().
| short* Fl_File_Icon::add_color | ( | Fl_Color | c | ) | [inline] |
Adds a color value to the icon array, returning a pointer to it.
| [in] | c | color value |
Definition at line 98 of file Fl_File_Icon.H.
Referenced by load_fti(), and load_image().
| short* Fl_File_Icon::add_vertex | ( | float | x, |
| float | y | ||
| ) | [inline] |
Adds a vertex value to the icon array, returning a pointer to it. The floating point version goes from 0.0 to 1.0. The origin (0.0) is in the lower-lefthand corner of the icon.
| [in] | x,y | vertex coordinates |
Definition at line 116 of file Fl_File_Icon.H.
| short* Fl_File_Icon::add_vertex | ( | int | x, |
| int | y | ||
| ) | [inline] |
Adds a vertex value to the icon array, returning a pointer to it. The integer version accepts coordinates from 0 to 10000. The origin (0.0) is in the lower-lefthand corner of the icon.
| [in] | x,y | vertex coordinates |
Definition at line 107 of file Fl_File_Icon.H.
Referenced by load_fti(), and load_image().
| void Fl_File_Icon::clear | ( | ) | [inline] |
Clears all icon data from the icon.
Definition at line 121 of file Fl_File_Icon.H.
| void Fl_File_Icon::draw | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| Fl_Color | ic, | ||
| int | active = 1 |
||
| ) |
Draws an icon in the indicated area.
| [in] | x,y,w,h | position and size |
| [in] | ic | icon color |
| [in] | active | status, default is active [non-zero] |
Definition at line 257 of file Fl_File_Icon.cxx.
References CLOSEDLINE, COLOR, END, fl_begin_complex_polygon(), fl_begin_line(), fl_begin_loop(), fl_color(), fl_end_complex_polygon(), fl_end_line(), fl_end_loop(), fl_end_polygon(), FL_ICON_COLOR, fl_inactive(), fl_pop_matrix(), fl_push_matrix(), fl_scale(), fl_translate(), fl_vertex(), h, LINE, NULL, OUTLINEPOLYGON, POLYGON, and VERTEX.
Referenced by labeltype().
| Fl_File_Icon * Fl_File_Icon::find | ( | const char * | filename, |
| int | filetype = ANY |
||
| ) | [static] |
Finds an icon that matches the given filename and file type.
| [in] | filename | name of file |
| [in] | filetype | enumerated file type |
Definition at line 190 of file Fl_File_Icon.cxx.
References ANY, DEVICE, DIRECTORY, FIFO, fl_filename_isdir(), fl_filename_match(), fl_filename_name(), fl_stat(), LINK, name, PLAIN, S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, and S_ISLNK.
Referenced by Fl_File_Browser::load().
| static Fl_File_Icon* Fl_File_Icon::first | ( | ) | [inline, static] |
Returns a pointer to the first icon in the list.
Definition at line 160 of file Fl_File_Icon.H.
| void Fl_File_Icon::label | ( | Fl_Widget * | w | ) |
Applies the icon to the widget, registering the Fl_File_Icon label type as needed.
| [in] | w | widget for which this icon will become the label |
Definition at line 459 of file Fl_File_Icon.cxx.
References _FL_ICON_LABEL, Fl_Widget::label(), labeltype(), and Fl::set_labeltype().
| void Fl_File_Icon::labeltype | ( | const Fl_Label * | o, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| Fl_Align | a | ||
| ) | [static] |
Draw the icon label.
| [in] | o | label data |
| [in] | x,y,w,h | position and size of label |
| [in] | a | label alignment [not used] |
Definition at line 473 of file Fl_File_Icon.cxx.
References Fl_Label::color, draw(), Fl_Label::value, and void().
Referenced by label().
| void Fl_File_Icon::load | ( | const char * | f | ) |
Loads the specified icon image. The format is deduced from the filename.
| [in] | f | filename |
Definition at line 106 of file Fl_File_Icon2.cxx.
References fl_filename_ext(), i, load_fti(), load_image(), and Fl::warning.
| int Fl_File_Icon::load_fti | ( | const char * | fti | ) |
Loads an SGI icon file.
| [in] | fti | icon filename |
Definition at line 133 of file Fl_File_Icon2.cxx.
References add(), add_color(), add_vertex(), CLOSEDLINE, END, Fl::error, f, FL_BLACK, fl_color_average(), FL_DARK3, fl_fopen(), FL_ICON_COLOR, fp, i, LINE, NULL, OUTLINEPOLYGON, params, POLYGON, ptr, x, and y.
Referenced by load(), and load_system_icons().
| int Fl_File_Icon::load_image | ( | const char * | ifile | ) |
Load an image icon file from an image filename.
| [in] | ifile | image filename |
Definition at line 350 of file Fl_File_Icon2.cxx.
References add(), add_color(), add_vertex(), Fl_Image::count(), Fl_Image::d(), Fl_Image::data(), END, FL_BLACK, FL_GRAY, fl_rgb_color(), FL_WHITE, Fl_Shared_Image::get(), green, Fl_Image::h(), i, Fl_Image::ld(), NULL, POLYGON, ptr, red, Fl_Shared_Image::release(), row, val, Fl_Image::w(), x, and y.
Referenced by load(), and load_system_icons().
| void Fl_File_Icon::load_system_icons | ( | void | ) | [static] |
Loads all system-defined icons. This call is useful when using the FileChooser widget and should be used when the application starts:
Definition at line 600 of file Fl_File_Icon2.cxx.
References COLOR, DIRECTORY, END, FL_BLACK, FL_BLUE, Fl_File_Icon(), FL_GRAY, FL_GREEN, FL_PATH_MAX, FL_RED, fl_register_images(), FL_WHITE, i, image, LINE, LINK, load_fti(), load_image(), NULL, OUTLINEPOLYGON, PLAIN, POLYGON, snprintf, and VERTEX.
Referenced by main().
| Fl_File_Icon* Fl_File_Icon::next | ( | ) | [inline] |
Returns next file icon object. See Fl_File_Icon::first()
Definition at line 133 of file Fl_File_Icon.H.
| const char* Fl_File_Icon::pattern | ( | ) | [inline] |
Returns the filename matching pattern for the icon.
Definition at line 136 of file Fl_File_Icon.H.
| int Fl_File_Icon::size | ( | ) | [inline] |
Returns the number of words of data used by the icon.
Definition at line 139 of file Fl_File_Icon.H.
| int Fl_File_Icon::type | ( | ) | [inline] |
Returns the filetype associated with the icon, which can be one of the following:
Definition at line 152 of file Fl_File_Icon.H.
Referenced by Fl_File_Browser::load().
| short* Fl_File_Icon::value | ( | ) | [inline] |
Returns the data array for the icon.
Definition at line 155 of file Fl_File_Icon.H.