00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _Fl_Fl_File_Icon_H_
00027 # define _Fl_Fl_File_Icon_H_
00028
00029 # include "Fl.H"
00030
00031
00032
00033
00034
00035
00036 # define FL_ICON_COLOR (Fl_Color)0xffffffff
00039 //
00040
00041
00042
00047 class FL_EXPORT Fl_File_Icon {
00048
00049 static Fl_File_Icon *first_;
00050 Fl_File_Icon *next_;
00051 const char *pattern_;
00052 int type_;
00053 int num_data_;
00054 int alloc_data_;
00055 short *data_;
00056
00057 public:
00058
00059 enum
00060 {
00061 ANY,
00062 PLAIN,
00063 FIFO,
00064 DEVICE,
00065 LINK,
00066 DIRECTORY
00067 };
00068
00069 enum
00070 {
00071 END,
00072 COLOR,
00073 LINE,
00074 CLOSEDLINE,
00075 POLYGON,
00076 OUTLINEPOLYGON,
00077 VERTEX
00078 };
00079
00080 Fl_File_Icon(const char *p, int t, int nd = 0, short *d = 0);
00081 ~Fl_File_Icon();
00082
00083 short *add(short d);
00084
00089 short *add_color(Fl_Color c)
00090 { short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); }
00091
00098 short *add_vertex(int x, int y)
00099 { short *d = add((short)VERTEX); add((short)x); add((short)y); return (d); }
00100
00107 short *add_vertex(float x, float y)
00108 { short *d = add((short)VERTEX); add((short)(x * 10000.0));
00109 add((short)(y * 10000.0)); return (d); }
00110
00112 void clear() { num_data_ = 0; }
00113
00114 void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
00115
00116 void label(Fl_Widget *w);
00117
00118 static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
00119 void load(const char *f);
00120 int load_fti(const char *fti);
00121 int load_image(const char *i);
00122
00124 Fl_File_Icon *next() { return (next_); }
00125
00127 const char *pattern() { return (pattern_); }
00128
00130 int size() { return (num_data_); }
00131
00143 int type() { return (type_); }
00144
00146 short *value() { return (data_); }
00147
00148 static Fl_File_Icon *find(const char *filename, int filetype = ANY);
00149
00151 static Fl_File_Icon *first() { return (first_); }
00152 static void load_system_icons(void);
00153 };
00154
00155 #endif // !_Fl_Fl_File_Icon_H_
00156
00157
00158
00159