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
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _Fl_Fl_File_Icon_H_
00036 # define _Fl_Fl_File_Icon_H_
00037
00038 # include "Fl.H"
00039
00040
00041
00042
00043
00044
00045 # define FL_ICON_COLOR (Fl_Color)0xffffffff
00048 //
00049
00050
00051
00056 class FL_EXPORT Fl_File_Icon
00057 {
00058 static Fl_File_Icon *first_;
00059 Fl_File_Icon *next_;
00060 const char *pattern_;
00061 int type_;
00062 int num_data_;
00063 int alloc_data_;
00064 short *data_;
00065
00066 public:
00067
00068 enum
00069 {
00070 ANY,
00071 PLAIN,
00072 FIFO,
00073 DEVICE,
00074 LINK,
00075 DIRECTORY
00076 };
00077
00078 enum
00079 {
00080 END,
00081 COLOR,
00082 LINE,
00083 CLOSEDLINE,
00084 POLYGON,
00085 OUTLINEPOLYGON,
00086 VERTEX
00087 };
00088
00089 Fl_File_Icon(const char *p, int t, int nd = 0, short *d = 0);
00090 ~Fl_File_Icon();
00091
00092 short *add(short d);
00093
00098 short *add_color(Fl_Color c)
00099 { short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); }
00100
00107 short *add_vertex(int x, int y)
00108 { short *d = add((short)VERTEX); add((short)x); add((short)y); return (d); }
00109
00116 short *add_vertex(float x, float y)
00117 { short *d = add((short)VERTEX); add((short)(x * 10000.0));
00118 add((short)(y * 10000.0)); return (d); }
00119
00121 void clear() { num_data_ = 0; }
00122
00123 void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
00124
00125 void label(Fl_Widget *w);
00126
00127 static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
00128 void load(const char *f);
00129 int load_fti(const char *fti);
00130 int load_image(const char *i);
00131
00133 Fl_File_Icon *next() { return (next_); }
00134
00136 const char *pattern() { return (pattern_); }
00137
00139 int size() { return (num_data_); }
00140
00152 int type() { return (type_); }
00153
00155 short *value() { return (data_); }
00156
00157 static Fl_File_Icon *find(const char *filename, int filetype = ANY);
00158
00160 static Fl_File_Icon *first() { return (first_); }
00161 static void load_system_icons(void);
00162 };
00163
00164 #endif // !_Fl_Fl_File_Icon_H_
00165
00166
00167
00168