File: global.h

package info (click to toggle)
baken 0.5.3-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 824 kB
  • ctags: 281
  • sloc: ansic: 2,938; makefile: 107; sh: 9
file content (274 lines) | stat: -rw-r--r-- 7,197 bytes parent folder | download | duplicates (2)
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
/*
 *   Copyright (C) 1999-2001 by Jonathan Naylor G4KLX
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#define	MAP_BEGIN_LONG	-10.0
#define	MAP_BEGIN_LAT	42.0

#define	MAP_END_LONG	26.0
#define	MAP_END_LAT	60.0

#define	MAIN_MAP_WIDTH		700
#define	MAIN_MAP_HEIGHT		500

#define	DETAIL_MAP_WIDTH	600
#define	DETAIL_MAP_HEIGHT	400
#define	DETAIL_MAP_TEXT_HEIGHT	53

#define	TEXT_LINE1	15
#define	TEXT_LINE2	30
#define	TEXT_LINE3	45

#define	TEXT_CALL	5
#define	TEXT_FREQUENCY	150
#define	TEXT_TYPE	200
#define	TEXT_LOCATOR	300
#define	TEXT_HEIGHT	425

#define	TEXT_QTH	5
#define	TEXT_ANTENNA	150
#define	TEXT_POWER	425

#define	TEXT_BEARING	5
#define	TEXT_DISTANCE	150
#define	TEXT_OPERATOR	300

#define	BORDER_WIDTH	10
#define	BORDER_ITEM	5

#define	LIST_WIDTH	450
#define	LIST_HEIGHT	400

#define	BAND_50MHZ	0
#define	BAND_70MHZ	1
#define	BAND_144MHZ	2
#define	BAND_432MHZ	3
#define	BAND_1_3GHZ	4
#define	BAND_2_3GHZ	5
#define	BAND_3_4GHZ	6
#define	BAND_5_7GHZ	7
#define	BAND_10GHZ	8
#define	BAND_24GHZ	9
#define	BAND_47GHZ	10
#define	BAND_76GHZ	11
#define	MAX_BANDS	12

#define	TYPE_IARU	0
#define	TYPE_NONIARU	1
#define	TYPE_REPEATER	2
#define	TYPE_LINEAR	3
#define	TYPE_MAILBOX	4
#define	TYPE_TV		5
#define	TYPE_DXCLUSTER	6
#define	TYPE_NODE	7
#define	TYPE_RS		8
#define	TYPE_MISC	9
#define	MAX_TYPES	10

#define	LIST_FREQUENCY		0
#define	LIST_DISTANCE		1
#define	LIST_BEARING		2

#define	COLOUR_BACKGROUND	0
#define	COLOUR_BEACONS		1
#define	COLOUR_CITIES		2
#define	COLOUR_LAND		3
#define	COLOUR_SQUARES		4
#define	COLOUR_USER		5

#ifndef TRUE
#define	TRUE		1
#endif

#ifndef FALSE
#define	FALSE		0
#endif

#define	FIELD_WIDTH	20.0			/* A - R */
#define	FIELD_HEIGHT	10.0			/* A - R */
#define	SQUARE_WIDTH	(FIELD_WIDTH / 10.0)	/* 0 - 9 */
#define	SQUARE_HEIGHT	(FIELD_HEIGHT / 10.0)	/* 0 - 9 */
#define	SUB_WIDTH	(SQUARE_WIDTH / 24.0)	/* A - X */
#define	SUB_HEIGHT	(SQUARE_HEIGHT / 24.0)	/* A - X */
#define	SUB_SUB_WIDTH	(SUB_WIDTH / 10.0)	/* 0 - 9 */
#define	SUB_SUB_HEIGHT	(SUB_HEIGHT / 10.0)	/* 0 - 9 */

#ifndef PI
#define	PI		3.141592654
#endif

/* International ellipsoid of 1924 */
#define	RA		6378.388		/* Semi-major axis */
#define	RB		6356.912		/* Semi-minor axis */

struct Beacon_Struct {
	int    Type;
	char   Callsign[21];
	double Frequency;
	char   Locator[10];
	double Latitude;
	double Longitude;
	char   QTH[51];
	char   Antenna[51];
	int    Angle[10];
	int    Angle_Count;
	int    Height;
	char   Power[51];
	char   Operator[21];
};

struct User_Struct {
	char   Callsign[21];
	char   Locator[10];
	double Latitude;
	double Longitude;
	int    Bands[MAX_BANDS];
	int    Types[MAX_TYPES];
	GdkColor Colours[6];
};

struct City_Struct {
	char   Name[51];
	double Latitude;
	double Longitude;
};

/************************************************************************/
/* In Baken.C								*/
/************************************************************************/

extern GSList *Beacon_List;

extern struct User_Struct User_Data;

extern GSList *City_List;

extern GtkWidget *MainMap;

extern void Error_Box(char *);

extern void Warning_Box(char *);

extern void Message_Box(char *);

extern void Info_Box(char *);

extern void YN_Box(char *, void (*)(void), void (*)(void));

extern int  Check_Beacon(struct Beacon_Struct *);

/************************************************************************/
/* In Choose.C								*/
/************************************************************************/

extern void ChooseCb(GtkWidget *, gpointer);

/************************************************************************/
/* In Colour.C								*/
/************************************************************************/

extern GdkColor Text_Bg_Colour;
extern GdkColor Text_Fg_Colour;

extern void ColourCb(GtkWidget *, gpointer);

extern void Allocate_Colours(void);

/************************************************************************/
/* In Data_Ed.C								*/
/************************************************************************/

extern void EditCb(GtkWidget *, gpointer);

/************************************************************************/
/* In Distance.C							*/
/************************************************************************/

extern void DistCb(GtkWidget *, gpointer);

/************************************************************************/
/* In Reflection.C							*/
/************************************************************************/

extern void ReflCb(GtkWidget *, gpointer);

/************************************************************************/
/* In Get_Data.C							*/
/************************************************************************/

extern void Read_User_Data(void);

extern void Read_Beacon_Data(int, char *);

extern void Read_City_Data(void);

extern int  Write_User_Data(void);

/************************************************************************/
/* In List.C								*/
/************************************************************************/

extern void ListCb(GtkWidget *, gpointer);

/************************************************************************/
/* In Main_Map.C							*/
/************************************************************************/

extern GdkGC *MainBackgroundGC;
extern GdkGC *MainBeaconsGC;
extern GdkGC *MainLandGC;
extern GdkGC *MainSquaresGC;
extern GdkGC *MainUserGC;

extern void Draw_Main_Map(void);

extern gint MainMapExposeCb(GtkWidget *, GdkEventExpose *);

extern gint MainMapClickCb(GtkWidget *, GdkEventButton *);

/************************************************************************/
/* In Utils.C								*/
/************************************************************************/

extern double RAD(double);

extern double DEG(double);

extern int Convert_Locator(char *, double *, double *);

extern int  Convert_Angles(double, double, char *);

extern void Calc_Distance_Bearing(double, double, double, double, double *, double *);

extern int  Calc_Scatter_Point(double, double, double, double, double, double, double *, double *, double *, double *);

/************************************************************************/
/* In Detail_Map.C							*/
/************************************************************************/

extern GdkGC *DetailBackgroundGC;
extern GdkGC *DetailBeaconsGC;
extern GdkGC *DetailCitiesGC;
extern GdkGC *DetailLandGC;
extern GdkGC *DetailUserGC;

extern GdkGC *DetailTextFgGC;
extern GdkGC *DetailTextBgGC;

extern void Draw_Detail_Map(double, double);

extern void Redraw_Detail_Map(void);