Mapper
redraw_legend_display.c
Go to the documentation of this file.
1
2
#include "
prototypes.h
"
3
void
redraw_legend_display
(Drawable pixm)
4
5
{
6
7
extern
int
max_legends
;
8
extern
char
*
ls
[];
9
extern
Display *
display
;
10
extern
GC
gc
;
11
extern
unsigned
long
qmap
[16];
12
extern
Widget
drawing_area
;
13
extern
int
rs
;
14
extern
int
legendysize
,
legendxsize
;
15
extern
Pixmap
logo
[2];
16
extern
XFontStruct *
info_font
[10];
17
extern
Font
font
[10];
18
char
buf
[50];
19
int
text_width,maxtopo;
20
Dimension
width
,
height
;
21
Arg
args
[10];
22
int
legendystart
;
23
int
i
;
24
25
legendystart
=
legendysize
+10;
26
27
XtSetArg(
args
[0],XtNwidth,&
width
);
28
XtSetArg(
args
[1],XtNheight,&
height
);
29
XtGetValues(
drawing_area
,
args
,2);
30
31
XSetFunction(
display
,
gc
,GXcopy);
32
33
XSetForeground(
display
,
gc
,0);
34
XSetBackground(
display
,
gc
,0);
35
XFillRectangle(
display
,pixm,
gc
,
width
-
legendxsize
+1,0,
width
,
height
);
36
37
strcpy(
buf
,
"Legends"
);
38
XSetFont(
display
,
gc
,
font
[3]);
39
XSetForeground(
display
,
gc
,
qmap
[15]);
40
text_width=XTextWidth(
info_font
[3],
buf
,strlen(
buf
));
41
XDrawString(
display
,pixm,
gc
,
width
-5-text_width,
legendystart
+5,
buf
,strlen(
buf
));
42
XSetFont(
display
,
gc
,
font
[1]);
43
44
XSetForeground(
display
,
gc
,
qmap
[15]);
45
maxtopo=1;
46
47
for
(
i
=0;
i
<
max_legends
;
i
++) {
48
49
XSetFillStyle(
display
,
gc
,FillStippled);
50
51
if
((
i
/2*2)==
i
)
52
XSetStipple(
display
,
gc
,
logo
[0]);
53
54
else
55
XSetStipple(
display
,
gc
,
logo
[2]);
56
57
XFillRectangle(
display
,pixm,
gc
,
width
-
rs
-5,
legendystart
+(maxtopo+
i
)*
rs
,
rs
,
rs
);
58
strcpy(
buf
,
ls
[
i
]);
59
text_width=XTextWidth(
info_font
[1],
buf
,strlen(
buf
));
60
XSetFillStyle(
display
,
gc
,FillSolid);
61
XDrawString(
display
,pixm,
gc
,
width
-
rs
-10-text_width,
legendystart
+(maxtopo+
i
)*
rs
+
rs
/2+3,
buf
,strlen(
buf
));
62
63
}
64
65
}
66
67
68
i
static int i
Definition:
get_apps_defaults.c:110
info_font
XFontStruct * info_font[10]
Definition:
mapper.c:195
display
Display * display
Definition:
mapper.c:159
font
Font font[10]
Definition:
mapper.c:161
buf
struct stat buf
Definition:
is_file_closed.c:8
redraw_legend_display
void redraw_legend_display(Drawable pixm)
Definition:
redraw_legend_display.c:3
rs
int rs
Definition:
mapper.c:103
legendysize
int legendysize
Definition:
mapper.c:103
ls
char * ls[]
Definition:
mapper.c:10
qmap
unsigned long qmap[16]
Definition:
mapper.c:116
logo
Pixmap logo[4]
Definition:
mapper.c:167
max_legends
int max_legends
Definition:
mapper.c:55
legendxsize
int legendxsize
Definition:
mapper.c:103
legendystart
int legendystart
Definition:
mapper.c:103
gc
GC gc
Definition:
mapper.c:163
height
Dimension height
Definition:
plot_qpf_legend.c:22
width
Dimension width
Definition:
plot_qpf_legend.c:22
args
Arg args[10]
Definition:
plot_qpf_legend.c:23
drawing_area
Widget drawing_area
Definition:
mapper.c:185
prototypes.h
Generated by
1.9.1