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)  

Fl_File_Icon Class Reference

#include <Fl_File_Icon.H>

Collaboration diagram for Fl_File_Icon:

List of all members.

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_Iconnext ()
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_Iconfind (const char *filename, int filetype=ANY)
static Fl_File_Iconfirst ()
static void load_system_icons (void)

Detailed Description

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.


Member Enumeration Documentation

anonymous enum
Enumerator:
ANY 
PLAIN 
FIFO 
DEVICE 
LINK 
DIRECTORY 

Definition at line 68 of file Fl_File_Icon.H.

anonymous enum
Enumerator:
END 
COLOR 
LINE 
CLOSEDLINE 
POLYGON 
OUTLINEPOLYGON 
VERTEX 

Definition at line 78 of file Fl_File_Icon.H.


Constructor & Destructor Documentation

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.

Parameters:
[in]pfilename pattern
[in]tfile type
[in]ndnumber of data values
[in]ddata 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.


Member Function Documentation

short * Fl_File_Icon::add ( short  d)

Adds a keyword value to the icon array, returning a pointer to it.

Parameters:
[in]ddata value

Definition at line 154 of file Fl_File_Icon.cxx.

References END, and NULL.

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.

Parameters:
[in]ccolor 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.

Parameters:
[in]x,yvertex 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.

Parameters:
[in]x,yvertex 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.

Parameters:
[in]x,y,w,hposition and size
[in]icicon color
[in]activestatus, 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.

Parameters:
[in]filenamename of file
[in]filetypeenumerated file type
Returns:
matching file icon or NULL

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.

Parameters:
[in]wwidget 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.

Parameters:
[in]olabel data
[in]x,y,w,hposition and size of label
[in]alabel 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.

Parameters:
[in]ffilename

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.

Parameters:
[in]ftiicon filename
Returns:
0 on success, non-zero on error

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.

Parameters:
[in]ifileimage filename
Returns:
0 on success, non-zero on error

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.


The documentation for this class was generated from the following files: