-
Notifications
You must be signed in to change notification settings - Fork 0
/
winobj.h
1011 lines (833 loc) · 26.2 KB
/
winobj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***********************************************************************
*
* Copyright 1996, University Corporation for Atmospheric Research.
*
* winobj.h
*
* Main window header file. The big cahuna.
*
* History:
*
* 11/96 COMET Original copy
* 1/97 COMET Added object type UPPERAIRPROFILEOBJECT.
* 3/97 COMET Added XSECTIONGRIDFILLOBJECT macro
* 4/97 COMET Added "scale" parameter to VECTORGRIDOBJECT.
* 6/97 COMET Cleaned up image-related objects
* 8/97 COMET Added DataTimeObject for time matching.
* 9/97 COMET Added type and label to surface object, tfilter
* to Upperair objects, model to grid data objects.
* 10/97 COMET Added nstations to surface, upperair objects
* 10/97 COMET Added LATLONGRIDOBJECT, LatLonGridObjectType,
* changed contents of MapObjectType
* 11/97 COMET Removed drawMapFlag, overlayMapFlag and numMaps from
* pixmapObject. Removed mapIndex from MapObjectType
* 11/97 COMET Redefined and enabled titleObject. Added field_label
* model_label and model_name to some metObjects.
* 12/97 COMET Added scale to image objects
* 2/98 COMET Added ABORTtype macros
*
***********************************************************************/
#ifndef _WINOBJ_H
#define _WINOBJ_H
#include <assert.h>
#include <math.h>
#include "gendef.h"
#include "gui.h"
#include <X11/X.h>
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#define ABORTNONE 0
#define ABORTCLEAR 1
#define ABORTRESET 2
#define STDSTRINGSIZE (80 + 1)
#define GEMPAKSTRING (80 + 1)
#define FILENAMESTRING (512 + 1)
/*
* MetObjectTypes
*/
#define ANYOBJECT 0
#define SURFACEOBJECT 1
#define RADAROBJECT 2
#define SATOBJECT 3
#define MAPOBJECT 4
#define MARKEROBJECT 5
#define RADARRINGOBJECT 6
#define SCALARGRIDOBJECT 7
#define VECTORGRIDOBJECT 8
#define NOWRADOBJECT 9
#define UPPERAIROBJECT 10
#define XSECTIONGRIDOBJECT 11
#define WINDPROFILEROBJECT 12
#define SCALARGRIDFILLOBJECT 13
#define TIMEHEIGHTOBJECT 14
#define VERTICALPROFILEOBJECT 15
#define UPPERAIRPROFILEOBJECT 16
#define XSECTIONGRIDFILLOBJECT 17
#define BACKGROUNDIMAGEOBJECT 18
#define LATLONGRIDOBJECT 19
/*
* Generic descriptive terms for data types
*/
#define STATICOBJECT 0 /* Static object, map, overlay.. */
#define NONSTATICOBJECT 1 /* non-static (data) */
/*
* View types
*/
#define PLAN 1
#define SPATIALCROSSSECTION 2
#define TIMEHEIGHTCROSSSECTION 3
#define TIMESERIES 4
#define VERTICALPROFILE 5
/*
* Overlay class - order is important here. These define the order in
* which met objects get drawn. LASTCLASS is not really a class but a value
* indicating what the last class value is. If you add a class, change
* LASTCLASS appropriately.
*/
#define UNDEFINED 0 /* nothing */
#define BACKGROUND 1 /* background image */
#define IMAGE 2 /* data image */
#define COLORFILL 3 /* color fill, duh */
#define MAP 4 /* map graphic */
#define GRAPHICS 5 /* data graphics */
#define OVERLAY 6 /* overlay graphics */
#define LASTCLASS 6
/*
* Compile time storage allocation constraints
*/
#define MAXMETOBJS 512
#define MAXPIXMAPOBJS 128
#define MAXMAPOBJS 8
typedef struct {
int viewType;
char proj[GEMPAKSTRING];
char garea[GEMPAKSTRING];
char filename[FILENAMESTRING];
int prevViewType;
char prevProj[GEMPAKSTRING];
char prevGarea[GEMPAKSTRING];
char prevFilename[FILENAMESTRING];
} GeoRefObjectType;
/*
* Structure containing information that describes a map
* projection.
*/
typedef struct {
float angle1; /* reference angles 1, 2, 3 */
float angle2;
float angle3;
float latll; /* lower left lat, lon */
float lonll;
float latur; /* upper right lat, lon */
float lonur;
} MapProjType;
/*
* Structure containing information that describes a
* satellite projection for MCIDAS AREA files
*/
typedef struct {
char imgnam [80]; /* image name */
int area [64]; /* area block */
int nav [640]; /* nav block */
int ilef; /* left image coord */
int itop; /* top image coord */
int irit; /* right image coord */
int ibot; /* bottom image coord */
} SatProjType;
/*
* Structure containing the x, y coordinates and associated latitude and
* longitude of two reference points on the display used for verifying
* mapping between successive pixmapObjects.
*/
typedef struct {
float x1;
float y1;
float x2;
float y2;
float lat1;
float lon1;
float lat2;
float lon2;
} ReferencePts;
typedef struct {
Dimension x1;
Dimension x2;
Dimension y1;
Dimension y2;
} RectangularRegionType;
/*
* Animation Object definition. Created on the fly for series
* pixmap objects that are loaded. Destroyed during a clear.
*/
typedef struct {
Display *display;
XtAppContext appContext;
Window windowID;
XtIntervalId xtIntervalID;
GC gc;
int command;
int direction;
int isAnimating;
int dwellFirst;
int dwellMiddle;
int dwellLast;
int dwellRate;
int activePixmapIndex;
struct WindowObjectS *windowObject;
unsigned int width;
unsigned int height;
int numPixmaps;
Pixmap *pixmaps;
} AnimationObjectType;
/*
* Contains title string information for each pixmap object.
*/
typedef struct TitleObjectS {
/*
GC gc;
int displayState;
unsigned int xOrigin;
unsigned int yOrigin;
unsigned int width;
unsigned int height;
Widget dialogWidget;
Widget listWidget;
XmString *xmStrings;
*/
unsigned int numTitles;
RectangularRegionType region[20];
} TitleObjectType;
typedef struct {
AbsTime *refTimes;
AbsTime *fcstTimes;
AbsTime *validTimes;
int numTimes;
int matchType;
int forecastType;
} DataTimeObjectType;
typedef struct {
int pad;
} AnyObjectType;
/*
* Struct for holding image information (least common
* denominator of all the image-related objects)
*/
typedef struct {
int imftyp; /* The following items mirror the */
int imbank; /* GEMPAK image common block */
int imdoff; /* (imgdef.cmn) */
int imldat; /* ... */
int imnpix;
int imnlin;
int imdpth;
float rmxres;
float rmyres;
int imleft;
int imtop;
int imrght;
int imbot;
float rmxysc;
int imbswp;
int imnchl;
int imprsz;
int imdcsz;
int imclsz;
int imlvsz;
int imvald;
int imrdfl;
int immnpx;
int immxpx;
int imsorc;
int imtype;
int imradf;
float rmbelv;
int imdate;
int imtime;
int imndlv;
char cmblev[256][9];
char cmbunt[9];
char cmsorc[21];
char cmtype[9];
char cmlutf[17];
char cmfile[133];
char cmcalb[9]; /* ... end of GEMPAK image common */
char colorbar[GEMPAKSTRING];
char scale[GEMPAKSTRING];
unsigned char *imageData;
} ImageCommonType;
/*
* Specific image objects. Includes ImageCommonType and whatever
* else makes them unique.
*/
typedef struct {
ImageCommonType imgCmn;
} SatObjectType;
typedef struct {
ImageCommonType imgCmn;
} RadarObjectType;
typedef struct {
ImageCommonType imgCmn;
} BackgroundImageObjectType;
/*
* This one is useful as a generic image object.
*/
typedef struct {
ImageCommonType imgCmn;
} AnyImageObjectType;
typedef struct {
char ftime[GEMPAKSTRING];
char vcoord[GEMPAKSTRING];
char field[GEMPAKSTRING];
char field_label[GEMPAKSTRING];
char vector[GEMPAKSTRING];
char point[GEMPAKSTRING];
char cint[GEMPAKSTRING];
char cmin[GEMPAKSTRING];
char cmax[GEMPAKSTRING];
char line_color[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
char label_freq[GEMPAKSTRING];
char text[GEMPAKSTRING];
char scale[GEMPAKSTRING];
char yaxis[GEMPAKSTRING];
char taxis[GEMPAKSTRING];
char ptype[GEMPAKSTRING];
char refvec[GEMPAKSTRING];
char wind_symbol[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
char symbol_type[GEMPAKSTRING];
char symbol_headsize[GEMPAKSTRING];
char model_name[GEMPAKSTRING];
char model_label[GEMPAKSTRING];
} TimeHeightObjectType;
typedef struct {
char ftime[GEMPAKSTRING];
char vcoord[GEMPAKSTRING];
char field[GEMPAKSTRING];
char field_label[GEMPAKSTRING];
char vector[GEMPAKSTRING];
char point[GEMPAKSTRING];
char cint[GEMPAKSTRING];
char cmin[GEMPAKSTRING];
char cmax[GEMPAKSTRING];
char line_color[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
char label_freq[GEMPAKSTRING];
char text[GEMPAKSTRING];
char scale[GEMPAKSTRING];
char xaxis[GEMPAKSTRING];
char yaxis[GEMPAKSTRING];
char ptype[GEMPAKSTRING];
char refvec[GEMPAKSTRING];
char thtaln[GEMPAKSTRING];
char thteln[GEMPAKSTRING];
char mixrln[GEMPAKSTRING];
char filter[GEMPAKSTRING];
char winpos[GEMPAKSTRING];
char wind_symbol[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
char symbol_type[GEMPAKSTRING];
char symbol_headsize[GEMPAKSTRING];
char model_name[GEMPAKSTRING];
char model_label[GEMPAKSTRING];
} VertProfileObjectType;
typedef struct {
int type;
char gdatim[GEMPAKSTRING];
char gvcord[GEMPAKSTRING];
char gfunc[GEMPAKSTRING];
char field_label[GEMPAKSTRING];
char gvect[GEMPAKSTRING];
char cxstns[GEMPAKSTRING];
char cint[GEMPAKSTRING];
char cmin[GEMPAKSTRING];
char cmax[GEMPAKSTRING];
char line_color[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
char label_freq[GEMPAKSTRING];
char text[GEMPAKSTRING];
char scale[GEMPAKSTRING];
char clrbar[GEMPAKSTRING];
char contur[GEMPAKSTRING];
char skip[GEMPAKSTRING];
char fint[GEMPAKSTRING];
char fmin[GEMPAKSTRING];
char fmax[GEMPAKSTRING];
char fline[GEMPAKSTRING];
char yaxis[GEMPAKSTRING];
char ptype[GEMPAKSTRING];
char refvec[GEMPAKSTRING];
char wind_symbol[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
char symbol_type[GEMPAKSTRING];
char symbol_headsize[GEMPAKSTRING];
char model_name[GEMPAKSTRING];
char model_label[GEMPAKSTRING];
BooleanType contour;
BooleanType fill;
} XSectionGridObjectType;
typedef struct {
char gdatim[GEMPAKSTRING];
char glevel[GEMPAKSTRING];
char gvcord[GEMPAKSTRING];
char gfunc[1024];
char field_label[GEMPAKSTRING];
char cint[GEMPAKSTRING];
char cmin[GEMPAKSTRING];
char cmax[GEMPAKSTRING];
char line_color[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
char label_freq[GEMPAKSTRING];
char scale[GEMPAKSTRING];
char hilo[GEMPAKSTRING];
char hlsym[GEMPAKSTRING];
char clrbar[GEMPAKSTRING];
char contur[GEMPAKSTRING];
char skip_contour[GEMPAKSTRING];
char skip_plot_x[GEMPAKSTRING];
char skip_plot_y[GEMPAKSTRING];
char fint[GEMPAKSTRING];
char fmin[GEMPAKSTRING];
char fmax[GEMPAKSTRING];
char fline[GEMPAKSTRING];
char text[GEMPAKSTRING];
char gridtype[GEMPAKSTRING];
char model_name[GEMPAKSTRING];
char model_label[GEMPAKSTRING];
int nfunction;
BooleanType contour;
BooleanType value;
BooleanType fill;
BooleanType symbol;
} ScalarGridObjectType;
typedef struct {
char gdatim[GEMPAKSTRING];
char glevel[GEMPAKSTRING];
char gvcord[GEMPAKSTRING];
char gvect[1024];
char field_label[GEMPAKSTRING];
char wind_symbol[GEMPAKSTRING];
char symbol_color[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
char symbol_type[GEMPAKSTRING];
char symbol_headsize[GEMPAKSTRING];
char refvec[GEMPAKSTRING];
char scale[GEMPAKSTRING];
char skip_contour[GEMPAKSTRING];
char skip_plot_x[GEMPAKSTRING];
char skip_plot_y[GEMPAKSTRING];
char text[GEMPAKSTRING];
char gridtype[GEMPAKSTRING];
char model_name[GEMPAKSTRING];
char model_label[GEMPAKSTRING];
int nfunction;
} VectorGridObjectType;
typedef struct {
char cxstn[GEMPAKSTRING];
char snfiles[20][FILENAMESTRING];
char dattim[GEMPAKSTRING];
char yaxis[GEMPAKSTRING];
char taxis[GEMPAKSTRING];
char fint[GEMPAKSTRING];
char text[GEMPAKSTRING];
char wind_symbol[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
int nfiles;
} WindProfilerObjectType;
typedef struct {
BooleanType plot_stn;
BooleanType plot_marker;
char stations[LLSTFL*GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
char text[GEMPAKSTRING];
float lat[LLSTFL];
float lon[LLSTFL];
int stidlen;
int color;
int marker;
int nstn;
} MarkerObjectType;
typedef struct {
char stations[LLSTFL*GEMPAKSTRING];
char stid[GEMPAKSTRING];
char units[GEMPAKSTRING];
float lat[LLSTFL];
float lon[LLSTFL];
float increment;
float minimum;
int color;
int number;
int nstn;
} RadarRingObjectType;
typedef struct {
char sfparm[FILENAMESTRING];
char dattim[GEMPAKSTRING];
char colors[GEMPAKSTRING];
char filter[GEMPAKSTRING];
char text[GEMPAKSTRING];
char type[GEMPAKSTRING];
char label[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
int marker;
int pmarker;
int skpmis;
int nstations;
} SurfaceObjectType;
typedef struct {
char snparm[GEMPAKSTRING];
char dattim[GEMPAKSTRING];
char levels[GEMPAKSTRING];
char vcoord[GEMPAKSTRING];
char colors[GEMPAKSTRING];
char marker[GEMPAKSTRING];
char filter[GEMPAKSTRING];
char text[GEMPAKSTRING];
int skpmis;
BooleanType tfilter;
int nstations;
} UpperairObjectType;
typedef struct {
char dattim[GEMPAKSTRING];
char stndex[GEMPAKSTRING];
char stncol[GEMPAKSTRING];
char vcoord[GEMPAKSTRING];
char colors[GEMPAKSTRING];
char wind_symbol[GEMPAKSTRING];
char symbol_size[GEMPAKSTRING];
char symbol_width[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
char winpos[GEMPAKSTRING];
char ptype[GEMPAKSTRING];
char xaxis[GEMPAKSTRING];
char yaxis[GEMPAKSTRING];
char marker[GEMPAKSTRING];
char filter[GEMPAKSTRING];
char text[GEMPAKSTRING];
BooleanType tfilter;
} UpaProfileObjectType;
typedef struct {
char line_color[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
char lat_inc[GEMPAKSTRING];
char lon_inc[GEMPAKSTRING];
char label_freq[GEMPAKSTRING];
} LatLonGridObjectType;
typedef struct {
char mapfile[FILENAMESTRING];
char line_color[GEMPAKSTRING];
char line_type[GEMPAKSTRING];
char line_width[GEMPAKSTRING];
} MapObjectType;
typedef union {
AnyObjectType anyObj;
SatObjectType satObj;
RadarObjectType radObj;
RadarRingObjectType rringObj;
SurfaceObjectType surfaceObj;
MapObjectType mapObj;
UpaProfileObjectType upapObj;
UpperairObjectType upaObj;
MarkerObjectType mrkObj;
WindProfilerObjectType wproObj;
VectorGridObjectType vgribObj;
ScalarGridObjectType sgribObj;
XSectionGridObjectType xsecObj;
VertProfileObjectType vprofObj;
TimeHeightObjectType thObj;
BackgroundImageObjectType bgimgObj;
} MetObjectContentType;
/*
* Enumerated type of available graphics data that can be
* drawn into a pixmap. More than one of these can be
* associated with a pixmaps to overlay grahics.
*/
typedef struct {
int type;
int inUse; /* in use? */
int drawnFlag; /* has been drawn? */
int toggledOn; /* clicked off by user? */
int titleIndex;
AbsTime refTime;
AbsTime fcstTime;
AbsTime validTime;
char timestamp[32];
char filename[FILENAMESTRING];
char template[FILENAMESTRING];
int (*displayFunc)();
void (*destroyFunc)();
char proj[GEMPAKSTRING];
char area[GEMPAKSTRING];
char garea[GEMPAKSTRING];
char titleString[FILENAMESTRING];
MetObjectContentType *metObjectContent;
} MetObjectType;
typedef struct {
int inUse; /* 0 if not in use, !0 otherwise */
int inLoop; /* 1 = include this frame in a loop */
/* 0 = omit from loop */
Display *display;
Dimension width;
Dimension height;
Pixmap pixmap;
char proj [10];
MapProjType mapProjection;
SatProjType satProjection;
ReferencePts referenceLatLons;
int numMetObjects;
MetObjectType *metObjects[MAXMETOBJS];
} PixmapObjectType;
/*
* Per X window (or drawing area) data structure.
*/
typedef struct WindowObjectS {
/* window background color? */
int inUse; /* 0 if in use; !0 otherwise */
char windowName[STDSTRINGSIZE];
Widget canvas;
int abortFlag;
int processExposeEventsFlag;
BooleanType showPartialFrameFlag;
XtAppContext appContext;
Window windowID;
Display *display;
Dimension width;
Dimension height;
GC gc;
int root;
int depth;
Pixmap backgroundPixmap;
int numPixmapObjects;
int activePixmapObjectIndex;
PixmapObjectType *pixmapObjects[MAXPIXMAPOBJS];
GeoRefObjectType *geoRefObject;
AnimationObjectType *animationObject;
TitleObjectType *titleObject;
DataTimeObjectType *dataTimeObject;
} WindowObjectType;
typedef struct {
time_t timestamp;
int metObjectType;
MetObjectType *metObject;
} TimestampInfoType;
/*
* Macro's to access "hidden" elements of the WindowObject
* data structure.
*/
#define GetActivePixmapObjectIndex(w) ((w)->activePixmapObjectIndex)
#define GetWindowObjectNumPixmapObjects(w) ((w)->numPixmapObjects)
#define GetWindowObjectPixmapObjects(w) ((w)->pixmapObjects)
#define SetWindowObjectCanvas(w,c) ((w)->canvas = (c))
#define GetWindowObjectCanvas(w) ((w)->canvas)
#define SetWindowObjectDisplay(w,c) ((w)->display = (c))
#define GetWindowObjectDisplay(w) ((w)->display)
#define GetWindowObjectAppContext(w) ((w)->appContext)
#define SetWindowObjectName(w,c) (strcpy((w)->windowName, (c))
#define GetWindowObjectName(w) ((w)->windowName)
#define SetWindowObjectWidth(w,c) ((w)->width = (c))
#define GetWindowObjectWidth(w) ((w)->width)
#define SetWindowObjectHeight(w,c) ((w)->height = (c))
#define GetWindowObjectHeight(w) ((w)->height)
#define SetWindowObjectRoot(w,c) ((w)->root = (c))
#define GetWindowObjectRoot(w) ((w)->root)
#define SetWindowObjectDepth(w,c) ((w)->depth = (c))
#define GetWindowObjectDepth(w) ((w)->depth)
#define SetWindowObjectGC(w,c) ((w)->gc = (c))
#define GetWindowObjectGC(w) ((w)->gc)
#define SetWindowObjectWindowID(w,c) ((w)->windowID = (c))
#define GetWindowObjectWindowID(w) ((w)->windowID)
#define SetWindowObjectAbortFlag(w,c) ((w)->abortFlag = (c))
/* #define GetWindowObjectAbortFlag(w) ((w)->abortFlag) */
/*
* Global data
*/
extern WindowObjectType mainWindow[];
/*
* WindowObjectType access functions.
*/
void SetWindowObjectXstuff( WindowObjectType *wo );
void InitWindowObjects( WindowObjectType *wo, int cnt );
Pixmap CreatePixmapFromWindowObject( WindowObjectType *wo );
Pixmap GetWindowObjectBackgroundPixmap(WindowObjectType *wo);
Pixmap GetActivePixmap(WindowObjectType *wo);
void SetActivePixmapObjectIndex( WindowObjectType *wo, int index );
void SetActivePixmapObject( WindowObjectType *wo, Pixmap pixmap );
Pixmap *GetWindowObjectPixmapList( WindowObjectType *wo );
WindowObjectType *CreateWindowObject( char *windowName );
WindowObjectType *GetActiveWindowObject();
WindowObjectType *GetWindowObjectByName( char *windowName );
WindowObjectType *SetActiveWindowObject( WindowObjectType *wo );
WindowObjectType *SetActiveWindowObjectByName( char *windowName );
WindowObjectType *GetWindowObjectByWidget( Widget w );
void WindowObjectResize( WindowObjectType *wo,
Dimension width, Dimension height );
/*
* PixmapObjectType access functions
*
*/
PixmapObjectType *GetNextPot( WindowObjectType *wo );
PixmapObjectType *GetActivePixmapObject( WindowObjectType *wo );
void PixmapObjectResize( WindowObjectType *wo,
PixmapObjectType *pot,
Dimension width,
Dimension height);
#define GetPixmapObjectPixmaps(p) ((p)->pixmap)
/*
* MetObjectType access functions
*
*/
MetObjectType *GetNextMot( PixmapObjectType *pot );
void FreeMot( MetObjectType *m);
void ReleaseMot( MetObjectType *m);
MetObjectType *AllocateMot();
MetObjectType *CloneMot();
int GetMetObjectClass( int metObjectType );
#define GetMetObjectType(x) ((x)->type)
#define GetMetObjectDrawnFlag(x) ((x)->drawnFlag)
#define SetMetObjectDrawnFlag(x,c) ((x)->drawnFlag = (c))
/*
*
* MetObject functions.
*/
void DestroySurfaceObject( MetObjectType *mot );
void DestroyUpperairObject( MetObjectType *mot );
void DestroyUpaProfileObject( MetObjectType *mot );
void DestroyMapObject( MetObjectType *mot );
void DestroyLatLonGridObject( MetObjectType *mot );
void DestroyTimeHeight ( MetObjectType *mot );
void DestroyVerticalProfile ( MetObjectType *mot );
void DestroySatObject ( MetObjectType *mot );
void DestroyRadarObject ( MetObjectType *mot );
void DestroyBackgroundImageObject ( MetObjectType *mot );
void DoImageObjects( int metObjectType, char *path, int cnt, char **filev );
MetObjectType *MakeSatObject( int, char *, char *, char *, int, char *);
MetObjectType *MakeRadarObject( int, char *, char *, char *, int, char *);
MetObjectType *MakeBackgroundImageObject( int, char *, char *, char *, int, char *);
MetObjectType *MakeBackgroundMapObject( int, char * );
MetObjectType **MakeImageObjectList( int, int, char **, char ** );
MetObjectType *MakeMapObject( char *, char *, char *, char *, char * );
MetObjectType *MakeLatLonGridObject( char *, char *, char *, char *,
char *, char * );
MetObjectType *MakeRadarRingObject ( int, int, float, float,
char*, char *, int, int * );
MetObjectType *MakeSurfaceObject ( char *, char *, char *, char *,
char *, char *,
char *,char *, int, int, int, int );
MetObjectType *MakeUpperairObject ( char *, char *, char *, char *,
char *, char *, char *, char *,
char *, char *, int, int, BooleanType );
MetObjectType *MakeUpaProfileObject ( char *, char *, char *, char *,
char *, char *, char *, char *,
char *, char *, char *, char *,
char *, char *, char *, char *,
char *, char *, char *, int ,
BooleanType );
MetObjectType *
MakeHorizontalScalarGridObject( char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, int ,
int , BooleanType,
BooleanType, BooleanType, BooleanType );
MetObjectType *
MakeTimeHeightObject ( char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, int );
MetObjectType *
MakeVerticalProfileObject ( char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, int );
MetObjectType *
MakeXSectionGridObject (char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *,
int , BooleanType, BooleanType );
MetObjectType *
MakeHorizontalVectorGridObject ( char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *,
char *, int , int );
MetObjectType *
MakeWindProfilerObject (char *, char **,int , char *, char *,
char *, char *, char *, char *, char *,
char *, int );
/*
*
* Object Management routines
*
*/
void
AddTimeMatchedObjects( WindowObjectType *wo, int cnt, TimestampInfoType *tsi);
void AddObjectListToDisplay( int cnt, MetObjectType **mlist );
PixmapObjectType *GetTimeMatchedPot( WindowObjectType *wo, time_t timestamp );
GeoRefObjectType *GetGeoRefObject( WindowObjectType *wo );
GeoRefObjectType *CreateGeoRefObject();
void UpdateTitleObject( WindowObjectType *wo );
void GetMetObjectTitles( PixmapObjectType *pot, int *cnt, char ***titlev);
/*
* Callbacks that interface with GEMPAK libraries.
*
*/
int DisplaySurface( WindowObjectType *mw, MetObjectType *mot );
int DisplayUpperair( WindowObjectType *mw, MetObjectType *mot );
int DisplayUpaProfile( WindowObjectType *mw, MetObjectType *mot );
int DisplayScalarGrid ( WindowObjectType *mw, MetObjectType *mot );
int DisplayVectorGrid ( WindowObjectType *mw, MetObjectType *mot );
int DisplayWindProfiler ( WindowObjectType *mw, MetObjectType *mot );
int DisplayTimeHeight ( WindowObjectType *mw, MetObjectType *mot );
int DisplayVerticalProfile ( WindowObjectType *mw, MetObjectType *mot );
int DisplayXSection ( WindowObjectType *mw, MetObjectType *mot );
int DisplayBackgroundImage( WindowObjectType *mw, MetObjectType *mot );
int DisplayRadar( WindowObjectType *mw, MetObjectType *mot );
int DisplaySat( WindowObjectType *mw, MetObjectType *mot );
int DisplayBackgroundObject( WindowObjectType *mw, MetObjectType *mot );
int DisplayMarker( WindowObjectType *mw, MetObjectType *mot );
int DisplayRadarRing( WindowObjectType *mw, MetObjectType *mot );
/*
* Animation control functions
*/
void AnimateCB( Widget w, XtPointer client, XtPointer calldata );
void AnimationObjectStop( WindowObjectType *wo );
void AnimationObjectPlayFwd( WindowObjectType *wo );
void AnimationObjectPlayBack( WindowObjectType *wo );
void AnimationObjectStepFwd( WindowObjectType *wo );
void AnimationObjectStepBack( WindowObjectType *wo );
AnimationObjectType *AnimationObjectCreate( WindowObjectType *wo );
/*
* External Macro's for animation control
*/
#define AnimationRunning(x) ( ( (x)->animationObject) && \
( (x)->animationObject->isAnimating) )