Mapper
redraw_legend_display.c
Go to the documentation of this file.
1 
2 #include "prototypes_new.h"
3 void redraw_legend_display(Drawable pixm)
4 
5 {
6 
7 
8 extern Display *display;
9 extern GC gc;
10 extern unsigned long qmap[16];
11 extern Widget drawing_area;
12 extern int rs;
13 extern int legendysize,legendxsize;
14 extern Pixmap logo[2];
15 extern XFontStruct *info_font[10];
16 extern Font font[10];
17 char buf[50];
18 int text_width,maxtopo;
19 Dimension width,height;
20 Arg args[10];
21 int legendystart;
22 
24 
25 XtSetArg(args[0],XtNwidth,&width);
26 XtSetArg(args[1],XtNheight,&height);
27 XtGetValues(drawing_area,args,2);
28 
29 XSetFunction(display,gc,GXcopy);
30 
31 XSetForeground(display,gc,0);
32 XSetBackground(display,gc,0);
33 XFillRectangle(display,pixm,gc,width-legendxsize+1,0,width,height);
34 
35 strcpy(buf,"Legends");
36 XSetFont(display,gc,font[3]);
37 XSetForeground(display,gc,qmap[15]);
38 text_width=XTextWidth(info_font[3],buf,strlen(buf));
39 XDrawString(display,pixm,gc,width-5-text_width,legendystart+5,buf,strlen(buf));
40 XSetFont(display,gc,font[1]);
41 
42 XSetForeground(display,gc,qmap[15]);
43 XSetFillStyle(display,gc,FillStippled);
44 XSetStipple(display,gc,logo[0]);
45 
46 maxtopo=1;
47 XFillRectangle(display,pixm,gc,width-rs-5,legendystart+maxtopo*rs,rs,rs);
48 strcpy(buf,"Topography");
49 text_width=XTextWidth(info_font[1],buf,strlen(buf));
50 XSetFillStyle(display,gc,FillSolid);
51 XDrawString(display,pixm,gc,width-rs-10-text_width,legendystart+maxtopo*rs+rs/2+3,buf,strlen(buf));
52 
53 XSetStipple(display,gc,logo[2]);
54 XSetFillStyle(display,gc,FillStippled);
55 XFillRectangle(display,pixm,gc,width-rs-5,legendystart+(maxtopo+1)*rs,rs,rs);
56 strcpy(buf,"Precipitation");
57 text_width=XTextWidth(info_font[1],buf,strlen(buf));
58 XSetFillStyle(display,gc,FillSolid);
59 XDrawString(display,pixm,gc,width-rs-10-text_width,legendystart+(maxtopo+1)*rs+rs/2+3,buf,strlen(buf));
60 
61 XSetStipple(display,gc,logo[0]);
62 XSetFillStyle(display,gc,FillStippled);
63 XFillRectangle(display,pixm,gc,width-rs-5,legendystart+(maxtopo+2)*rs,rs,rs);
64 strcpy(buf,"Rain/Slow");
65 text_width=XTextWidth(info_font[1],buf,strlen(buf));
66 XSetFillStyle(display,gc,FillSolid);
67 XDrawString(display,pixm,gc,width-rs-10-text_width,legendystart+(maxtopo+2)*rs+rs/2+3,buf,strlen(buf));
68 
69 XSetStipple(display,gc,logo[2]);
70 XSetFillStyle(display,gc,FillStippled);
71 XFillRectangle(display,pixm,gc,width-rs-5,legendystart+(maxtopo+3)*rs,rs,rs);
72 strcpy(buf,"Diff");
73 text_width=XTextWidth(info_font[1],buf,strlen(buf));
74 XSetFillStyle(display,gc,FillSolid);
75 XDrawString(display,pixm,gc,width-rs-10-text_width,legendystart+(maxtopo+3)*rs+rs/2+3,buf,strlen(buf));
76 
77 XSetStipple(display,gc,logo[0]);
78 XSetFillStyle(display,gc,FillStippled);
79 XFillRectangle(display,pixm,gc,width-rs-5,legendystart+(maxtopo+4)*rs,rs,rs);
80 strcpy(buf,"Frz Level");
81 text_width=XTextWidth(info_font[1],buf,strlen(buf));
82 XSetFillStyle(display,gc,FillSolid);
83 XDrawString(display,pixm,gc,width-rs-10-text_width,legendystart+(maxtopo+4)*rs+rs/2+3,buf,strlen(buf));
84 
85 XSetStipple(display,gc,logo[2]);
86 XSetFillStyle(display,gc,FillStippled);
87 XFillRectangle(display,pixm,gc,width-rs-5,legendystart+(maxtopo+5)*rs,rs,rs);
88 strcpy(buf,"Temperature");
89 text_width=XTextWidth(info_font[1],buf,strlen(buf));
90 XSetFillStyle(display,gc,FillSolid);
91 XDrawString(display,pixm,gc,width-rs-10-text_width,legendystart+(maxtopo+5)*rs+rs/2+3,buf,strlen(buf));
92 
93 }
94 
XFontStruct * info_font[10]
Definition: mapper.c:195
Display * display
Definition: mapper.c:159
Font font[10]
Definition: mapper.c:161
struct stat buf
Definition: is_file_closed.c:8
void redraw_legend_display(Drawable pixm)
int rs
Definition: mapper.c:103
int legendysize
Definition: mapper.c:103
unsigned long qmap[16]
Definition: mapper.c:116
Pixmap logo[4]
Definition: mapper.c:167
int legendxsize
Definition: mapper.c:103
int legendystart
Definition: mapper.c:103
GC gc
Definition: mapper.c:163
Dimension height
Dimension width
Arg args[10]
Widget drawing_area
Definition: mapper.c:185