1 /* WMGlobe 0.5 - All the Earth on a WMaker Icon
2 * copyright (C) 1998,99 Jerome Dumonteil <jerome.dumonteil@capway.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 ***************************************************************************/
18 /* it uses some functions of : Xglobe, Xearth, wmgeneral, wmaker/wrlib
19 ***************************************************************************/
25 /* customization : see wmgoption.h */
34 #include <ctype.h> /*toupper */
37 #include <sys/timeb.h>
39 #include <sys/types.h>
42 #include <X11/Xutil.h>
43 #include <X11/extensions/shape.h>
45 #include <X11/Xatom.h>
50 #include "wmgoption.h"
54 #define MAX(x, y) ((x) < (y) ? (y) : (x))
55 #define MIN(x, y) ((x) > (y) ? (y) : (x))
56 #define ABS(a) ((a) < 0 ? -(a) : (a))
63 #define PI 3.141592653
74 #define MAX_MOUSE_REGION (8)
84 MOUSE_REGION mouse_region
[MAX_MOUSE_REGION
];
92 double soluce
[DIAMETRE
/ 2][DIAMETRE
][4];
100 XpmAttributes attributes
;
108 char *dayfile
, *nightfile
, *dpy_name
;
114 RImage
*map
, *small
, *mapnight
;
116 XpmIcon screenpos
, scrdate
, scrdiv
, numpix
, txtpix
, wmg
;
119 int onlyshape
, option_iw
;
122 /********* rendering********/
124 double delay
, time_multi
;
126 * struct timeval delta_tim, last_tim, next_tim, render_tim, base_tim,
129 * time_t beg_time, ini_time,t1901;
131 struct timeval tlast
, tnext
, trend
, tdelay
, tini
, tbase
;
134 int sens
, fun
, funx
, funy
, oknimap
, mratiox
, mratioy
, gotoscr
;
136 int typecadre
, p_type
, use_nightmap
, use_nmap_ini
, firstTime
, stoprand
,
139 double v_lat
, v_long
, old_dvlat
, old_dvlong
, dv_lat
, dv_long
;
140 double dlat
, dlong
, addlat
, addlong
, ratiox
, ratioy
, dawn
;
147 double proj_dist
; /* distance to projection plane */
149 double center_dist
; /* distance to center of earth */
151 double ambient_light
; /* how dark is the dark side? */
153 double light_x
, light_y
, light_z
; /* vector of sunlight with lengt 1 */
155 double c_coef
, b_coef
;
157 int radius_proj
, aml
; /* radius of sphere on screen */
164 /****************************************************************/
165 /* Function Prototypes */
166 /****************************************************************/
167 int main(int argc
, char *argv
[]);
168 /****************************************************************/
169 void AddMouseRegion(int index
, int left
, int top
, int right
, int bottom
);
170 int CheckMouseRegion(int x
, int y
);
171 void RedrawWindowXYWH(int x
, int y
, int w
, int h
);
173 void loadxpm(Window drawable
);
174 void cmdline(int argc
, char *argv
[]);
176 void rotation_terre(int x
, int y
, int lat_flag
);
177 void zooming(int facto
);
178 struct timeval
diftimev(struct timeval t1
, struct timeval t2
);
179 struct timeval
addtimev(struct timeval t1
, struct timeval t2
);
180 struct timeval
getimev();
182 /***************************************************************/
183 void setZoom(double z
);
186 void initmyconvert();
187 int myRConvertImage(RContext
* context
, RImage
* image
, Pixmap
* pixmap
);
188 RContext
*myRCreateContext
189 (Display
* dpy
, int screen_number
, RContextAttributes
* attribs
);
190 void setTime(struct timeval t
);
191 void recalc(int calme
);
192 void GetSunPos(time_t ssue
, double *lat
, double *lon
);
193 void setViewPos(double lat
, double lon
);
195 /***************************************************************/