fltk
1.3.5-source
About:
FLTK
(Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
Fossies
Dox
:
fltk-1.3.5-source.tar.bz2
("inofficial" and yet experimental doxygen-generated source code documentation)
Fl_File_Icon.H
Go to the documentation of this file.
1
//
2
// "$Id$"
3
//
4
// Fl_File_Icon definitions.
5
//
6
// Copyright 1999-2010 by Michael Sweet.
7
//
8
// This library is free software. Distribution and use rights are outlined in
9
// the file "COPYING" which should have been included with this file. If this
10
// file is missing or damaged, see the license at:
11
//
12
// http://www.fltk.org/COPYING.php
13
//
14
// Please report all bugs and problems on the following page:
15
//
16
// http://www.fltk.org/str.php
17
//
18
19
/* \file
20
Fl_File_Icon widget . */
21
22
//
23
// Include necessary header files...
24
//
25
26
#ifndef _Fl_Fl_File_Icon_H_
27
# define _Fl_Fl_File_Icon_H_
28
29
# include "
Fl.H
"
30
31
32
//
33
// Special color value for the icon color.
34
//
35
36
# define FL_ICON_COLOR (Fl_Color)0xffffffff
39
//
40
// Fl_File_Icon class...
41
//
42
47
class
FL_EXPORT
Fl_File_Icon
{
48
49
static
Fl_File_Icon
*
first_
;
// Pointer to first icon/filetype
50
Fl_File_Icon
*
next_
;
// Pointer to next icon/filetype
51
const
char
*
pattern_
;
// Pattern string
52
int
type_
;
// Match only if directory or file?
53
int
num_data_
;
// Number of data elements
54
int
alloc_data_
;
// Number of allocated elements
55
short
*
data_
;
// Icon data
56
57
public
:
58
59
enum
// File types
60
{
61
ANY
,
// Any kind of file
62
PLAIN
,
// Only plain files
63
FIFO
,
// Only named pipes
64
DEVICE
,
// Only character and block devices
65
LINK
,
// Only symbolic links
66
DIRECTORY
// Only directories
67
};
68
69
enum
// Data opcodes
70
{
71
END
,
// End of primitive/icon
72
COLOR
,
// Followed by color value (2 shorts)
73
LINE
,
// Start of line
74
CLOSEDLINE
,
// Start of closed line
75
POLYGON
,
// Start of polygon
76
OUTLINEPOLYGON
,
// Followed by outline color (2 shorts)
77
VERTEX
// Followed by scaled X,Y
78
};
79
80
Fl_File_Icon
(
const
char
*
p
,
int
t,
int
nd = 0,
short
*d = 0);
81
~
Fl_File_Icon
();
82
83
short
*add(
short
d);
84
89
short
*
add_color
(
Fl_Color
c)
90
{
short
*d = add((
short
)COLOR); add((
short
)(c >> 16)); add((
short
)c);
return
(d); }
91
98
short
*
add_vertex
(
int
x
,
int
y
)
99
{
short
*d = add((
short
)VERTEX); add((
short
)
x
); add((
short
)
y
);
return
(d); }
100
107
short
*
add_vertex
(
float
x
,
float
y
)
108
{
short
*d = add((
short
)VERTEX); add((
short
)(
x
* 10000.0));
109
add((
short
)(
y
* 10000.0));
return
(d); }
110
112
void
clear
() { num_data_ = 0; }
113
114
void
draw
(
int
x
,
int
y
,
int
w,
int
h,
Fl_Color
ic,
int
active = 1);
115
116
void
label(
Fl_Widget
*w);
117
118
static
void
labeltype(
const
Fl_Label
*o,
int
x
,
int
y
,
int
w,
int
h,
Fl_Align
a);
119
void
load(
const
char
*
f
);
120
int
load_fti(
const
char
*fti);
121
int
load_image(
const
char
*i);
122
124
Fl_File_Icon
*
next
() {
return
(next_); }
125
127
const
char
*
pattern
() {
return
(pattern_); }
128
130
int
size
() {
return
(num_data_); }
131
143
int
type
() {
return
(type_); }
144
146
short
*
value
() {
return
(data_); }
147
148
static
Fl_File_Icon
*
find
(
const
char
*
filename
,
int
filetype = ANY);
149
151
static
Fl_File_Icon
*
first
() {
return
(first_); }
152
static
void
load_system_icons(
void
);
153
};
154
155
#endif // !_Fl_Fl_File_Icon_H_
156
157
//
158
// End of "$Id$".
159
//
Fl_File_Icon::next
Fl_File_Icon * next()
Definition:
Fl_File_Icon.H:124
Fl_File_Icon
Definition:
Fl_File_Icon.H:47
Fl_File_Icon::add_vertex
short * add_vertex(float x, float y)
Definition:
Fl_File_Icon.H:107
Fl.H
Fl_File_Icon::num_data_
int num_data_
Definition:
Fl_File_Icon.H:53
Fl_File_Icon::ANY
Definition:
Fl_File_Icon.H:61
Fl_Color
unsigned int Fl_Color
Definition:
Enumerations.H:934
Fl_File_Icon::type_
int type_
Definition:
Fl_File_Icon.H:52
Fl_File_Icon::next_
Fl_File_Icon * next_
Definition:
Fl_File_Icon.H:50
Fl_File_Icon::type
int type()
Definition:
Fl_File_Icon.H:143
Fl_File_Icon::alloc_data_
int alloc_data_
Definition:
Fl_File_Icon.H:54
find
static Fl_Font_Descriptor * find(Fl_Font fnum, Fl_Fontsize size)
Definition:
fl_font_mac.cxx:250
Fl_File_Icon::clear
void clear()
Definition:
Fl_File_Icon.H:112
Fl_File_Icon::value
short * value()
Definition:
Fl_File_Icon.H:146
Fl_File_Icon::PLAIN
Definition:
Fl_File_Icon.H:62
Fl_File_Icon::first
static Fl_File_Icon * first()
Definition:
Fl_File_Icon.H:151
Fl_File_Icon::pattern
const char * pattern()
Definition:
Fl_File_Icon.H:127
FL_EXPORT
#define FL_EXPORT
Definition:
Fl_Export.H:35
Fl_File_Icon::OUTLINEPOLYGON
Definition:
Fl_File_Icon.H:76
Fl_File_Icon::first_
static Fl_File_Icon * first_
Definition:
Fl_File_Icon.H:49
Fl_File_Icon::add_color
short * add_color(Fl_Color c)
Definition:
Fl_File_Icon.H:89
p
static menustate * p
Definition:
Fl_Menu.cxx:606
draw
static void draw(int which, int x, int y, int w, int h, int inset)
Definition:
fl_gtk.cxx:166
filename
static const char * filename
Definition:
fluid.cxx:119
Fl_Label
Definition:
Fl_Widget.H:65
Fl_File_Icon::FIFO
Definition:
Fl_File_Icon.H:63
Fl_Widget
Definition:
Fl_Widget.H:101
Fl_File_Icon::add_vertex
short * add_vertex(int x, int y)
Definition:
Fl_File_Icon.H:98
Fl_File_Icon::pattern_
const char * pattern_
Definition:
Fl_File_Icon.H:51
Fl_File_Icon::LINE
Definition:
Fl_File_Icon.H:73
Fl_File_Icon::LINK
Definition:
Fl_File_Icon.H:65
Fl_File_Icon::POLYGON
Definition:
Fl_File_Icon.H:75
x
int x
Definition:
test.c:73
Fl_File_Icon::DEVICE
Definition:
Fl_File_Icon.H:64
Fl_File_Icon::size
int size()
Definition:
Fl_File_Icon.H:130
y
int y
Definition:
test.c:74
f
Fl_Box_Draw_F * f
Definition:
fl_boxtype.cxx:285
Fl_Align
unsigned Fl_Align
Definition:
Enumerations.H:828
Fl_File_Icon::data_
short * data_
Definition:
Fl_File_Icon.H:55
Fl_File_Icon::COLOR
Definition:
Fl_File_Icon.H:72
Fl_File_Icon::END
Definition:
Fl_File_Icon.H:71
Fl_File_Icon::CLOSEDLINE
Definition:
Fl_File_Icon.H:74
FL
Fl_File_Icon.H
Generated by
1.8.16