desktop swipe is done
[livewp] / applet / src / livewp-common.h
1 /* vim: set sw=4 ts=4 et: */
2 /*
3  * This file is part of Live Wallpaper (livewp)
4  * 
5  * Copyright (C) 2010 Vlad Vasiliev
6  * Copyright (C) 2010 Tanya Makova
7  *       for the code
8  * 
9  * This software is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1 of
12  * the License, or (at your option) any later version.
13  * 
14  * This software is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  * 
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this software; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23 */
24 /*******************************************************************************/
25 #ifndef _livewp_common_h
26 #define _livewp_common_h 1
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30
31 #include <gtk/gtk.h>
32 #include <hildon/hildon.h>
33 #include <locale.h>
34 #include <libhildondesktop/libhildondesktop.h>
35 #include <libosso.h>
36 #include <gconf/gconf-client.h>
37
38 #define GETTEXT_PACKAGE "livewp"
39 #include <glib/gi18n-lib.h>
40
41 /* Position of plugin on desktop */
42 #define Xstartposition 800
43 #define Ystartposition 480 
44
45 #define THEME_PATH "/usr/share/livewp/theme"
46 #define SHORT_TIMER 75 /* 100 milisecond */
47 //#define LONG_TIMER 5*60*1000 /* 10 minutes */
48 #define LONG_TIMER  20*1000 /* 10 minutes */
49 enum { SHORT_TIMER_TYPE, LONG_TIMER_TYPE };
50 #define SKY_LEVEL 0 
51 #define SUN_LEVEL 0 
52 #define TOWN_LEVEL 0 
53 #define TRAM_LEVEL 20 
54
55 typedef struct _Scene Scene;
56 struct _Scene 
57 {
58     GSList * actors;
59     gint daytime;
60     gint timer_type;
61     gint wind_orientation; // +/- 1
62     double wind_angle; // [-1 .. 1]
63     guint seed; /* init value for random  */
64     guint notification;
65 };
66
67 typedef struct _AWallpaperPlugin AWallpaperPlugin;
68 typedef struct _AWallpaperPluginClass AWallpaperPluginClass;
69 typedef struct _Animation_WallpaperPrivate Animation_WallpaperPrivate;
70
71
72
73 struct _Animation_WallpaperPrivate
74 {
75     gint long_timer;
76     gint short_timer;
77     gchar *theme;
78     gboolean visible;
79     gboolean rich_animation;
80     GtkWidget *main_widget;
81     GtkWidget *window;
82     GtkWidget *right_corner;
83     AWallpaperPlugin *desktop_plugin;
84     DBusConnection      *dbus_conn;
85     DBusConnection      *dbus_conn_session;
86     osso_context_t      *osso;
87     gint xapplet;
88     gint yapplet;
89     Scene *scene;
90     GHashTable * hash_scene_func;
91     GKeyFile *config_file;
92     gint view;
93     pid_t  pid;
94     guint view_notify;
95 };
96
97 struct _AWallpaperPlugin
98 {
99     HDHomePluginItem parent;
100     Animation_WallpaperPrivate *priv;
101 };
102
103 struct _AWallpaperPluginClass
104 {
105   HDHomePluginItemClass parent_class;
106 };
107
108
109 #define LIVEWP_SIGNAL_INTERFACE "org.maemo.livewp"
110 #define LIVEWP_SIGNAL_PATH "/org/maemo/livewp"
111 #define LIVEWP_SIGNAL_RELOAD_CONFIG_INTERFACE "org.maemo.livewp.reload_config"
112 #define LIVEWP_SIGNAL_RELOAD_CONFIG_PATH "/org/maemo/livewp/reload_config"
113 #define LIVEWP_RELOAD_CONFIG "reload_config"
114 #define LIVEWP_RELOAD_PLUGIN "reload_plugin"
115 #define LIVEWP_STOP_LIVEBG_ON_VIEW1 "stop_livebg_on_view1"
116 #define LIVEWP_STOP_LIVEBG_ON_VIEW2 "stop_livebg_on_view2"
117 #define LIVEWP_STOP_LIVEBG_ON_VIEW3 "stop_livebg_on_view3"
118 #define LIVEWP_STOP_LIVEBG_ON_VIEW4 "stop_livebg_on_view4"
119
120 /* For DBUS notification */
121 #define NOTIFY_SIGNAL_INTERFACE "org.freedesktop.Notifications"
122 #define NOTIFY_SIGNAL_PATH "/org/freedesktop/Notifications"
123 #define NOTIFY_MEMBER "Notify"
124 #define CLOSENOTIFY_MEMBER "NotificationClosed"
125
126 #endif