changed license to GPL v2
[livewp] / applet / src / livewp-rules.h
1 /*
2  * This file is part of Live Wallpaper (livewp)
3  * 
4  * Copyright (C) 2010 Vlad Vasiliev
5  * Copyright (C) 2010 Tanya Makova
6  *       for the code
7  * 
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  * 
13  * This software is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  * 
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this software; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22 */
23 /*******************************************************************************/
24 #ifndef _livewp_rules_h
25 #define _livewp_rules_h 1
26 /*******************************************************************************/
27 #include <time.h>
28 #include "livewp-astro.h"
29 #include "livewp-common.h" 
30 /*******************************************************************************/
31 #define TIME_DAY        0
32 #define TIME_NIGHT      3 
33 #define TIME_SUNRISE    1
34 #define TIME_SUNSET     2
35
36 #define MOON_NONE               0
37 #define MOON_GROWS              5
38 #define MOON_GROWSHALF          2
39 #define MOON_FULL               1 
40 #define MOON_DECREASHALF        3
41 #define MOON_DECREAS            4
42
43 /*******************************************************************************/
44 void get_localtime(int * year, int * month, int * day, int * hour, int * min, int * zone);
45 void get_coord(double * lat, double * lon);
46 void get_sun_pos(double * alt, double * azm);
47 int get_daytime();
48 int get_moon_phase();
49 time_t get_next_sunrise();
50 time_t get_next_sunset();
51 gint fast_rnd(gint max);
52 void get_sun_screen_pos(double alt, double azm, gint * x, gint * y);
53
54 /*******************************************************************************/
55 #endif