summaryrefslogtreecommitdiff
path: root/FL/Fl_File_Icon.H
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2008-09-14 15:45:27 +0000
committerFabien Costantini <fabien@onepost.net>2008-09-14 15:45:27 +0000
commitce4d0fd5d86a1f725aba6093d9674b993d437d6c (patch)
tree4839ae652332f4ec80de23a21fb0ddd702a20330 /FL/Fl_File_Icon.H
parent7f4e2867e84826d237e48f01f25de168cfdb986b (diff)
Doxygen Documentation WP4 Done. Has all documentation content but should be completed in increment 2. Registered for WP5.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6239 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_File_Icon.H')
-rw-r--r--FL/Fl_File_Icon.H40
1 files changed, 40 insertions, 0 deletions
diff --git a/FL/Fl_File_Icon.H b/FL/Fl_File_Icon.H
index 1e2e2d60f..2f848caa5 100644
--- a/FL/Fl_File_Icon.H
+++ b/FL/Fl_File_Icon.H
@@ -46,6 +46,10 @@
// Fl_File_Icon class...
//
+/**
+ The Fl_File_Icon class manages icon images that can be used
+ as labels in other widgets and as icons in the FileBrowser widget.
+*/
class FL_EXPORT Fl_File_Icon //// Icon data
{
static Fl_File_Icon *first_; // Pointer to first icon/filetype
@@ -83,27 +87,63 @@ class FL_EXPORT Fl_File_Icon //// Icon data
~Fl_File_Icon();
short *add(short d);
+ /** Adds a color value to the icon array, returning a pointer to it.*/
short *add_color(Fl_Color c)
{ short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); }
+ /**
+ Adds a vertex value to the icon array, returning a pointer to it.
+ The integer version accepts coordinates from 0 to 10000, while the
+ floating point version goes from 0.0 to 1.0. The origin (0.0) is in
+ the lower-lefthand corner of the icon.
+ */
short *add_vertex(int x, int y)
{ short *d = add((short)VERTEX); add((short)x); add((short)y); return (d); }
+ /**
+ Adds a vertex value to the icon array, returning a pointer to it.
+ The integer version accepts coordinates from 0 to 10000, while the
+ floating point version goes from 0.0 to 1.0. The origin (0.0) is in
+ the lower-lefthand corner of the icon.
+ */
short *add_vertex(float x, float y)
{ short *d = add((short)VERTEX); add((short)(x * 10000.0));
add((short)(y * 10000.0)); return (d); }
+ /** Clears all icon data from the icon.*/
void clear() { num_data_ = 0; }
+ /** Draws the icon in the indicated area.*/
void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
+ /** Set the widgets label to an icon */
void label(Fl_Widget *w);
+ /** The labeltype function for icons.*/
static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
void load(const char *f);
int load_fti(const char *fti);
int load_image(const char *i);
+ /** Returns next file icon object. See Fl_File_Icon::first() */
Fl_File_Icon *next() { return (next_); }
+ /** Returns the filename matching pattern for the icon.*/
const char *pattern() { return (pattern_); }
+ /** Returns the number of words of data used by the icon.*/
int size() { return (num_data_); }
+ /**
+ Returns the filetype associated with the icon, which can be one of the
+ following:
+
+ <UL>
+ <LI>Fl_File_Icon::ANY, any kind of file.
+ <LI>Fl_File_Icon::PLAIN, plain files.
+ <LI>Fl_File_Icon::FIFO, named pipes.
+ <LI>Fl_File_Icon::DEVICE, character and block devices.
+ <LI>Fl_File_Icon::LINK, symbolic links.
+ <LI>Fl_File_Icon::DIRECTORY, directories.
+ </UL>
+ */
int type() { return (type_); }
+ /** Returns the data array for the icon.*/
short *value() { return (data_); }
static Fl_File_Icon *find(const char *filename, int filetype = ANY);
+
+ /** Returns a pointer to the first icon in the list.*/
static Fl_File_Icon *first() { return (first_); }
static void load_system_icons(void);
};