renamed dbus constants
[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
37 #define GETTEXT_PACKAGE "livewp"
38 #include <glib/gi18n-lib.h>
39
40 /* Position of plugin on desktop */
41 #define Xstartposition 700 
42 #define Ystartposition 448 
43
44 #define THEME_PATH "/usr/share/livewp/theme"
45 #define SHORT_TIMER 75 /* 100 milisecond */
46 //#define LONG_TIMER 5*60*1000 /* 10 minutes */
47 #define LONG_TIMER  20*1000 /* 10 minutes */
48 enum { SHORT_TIMER_TYPE, LONG_TIMER_TYPE };
49 #define SKY_LEVEL 0 
50 #define SUN_LEVEL 0 
51 #define TOWN_LEVEL 0 
52 #define TRAM_LEVEL 20 
53
54 typedef struct _Scene Scene;
55 struct _Scene 
56 {
57     GSList * actors;
58     gint daytime;
59     gint timer_type;
60     gint wind_orientation; // +/- 1
61     double wind_angle; // [-1 .. 1]
62     guint seed; /* init value for random  */
63 };
64 typedef struct _AWallpaperPlugin AWallpaperPlugin;
65 typedef struct _AWallpaperPluginClass AWallpaperPluginClass;
66 typedef struct _Animation_WallpaperPrivate Animation_WallpaperPrivate;
67
68 struct _Animation_WallpaperPrivate
69 {
70     gint long_timer;
71     gint short_timer;
72     gchar *theme;
73     gboolean visible;
74     gboolean rich_animation;
75     GtkWidget *main_widget;
76     GtkWidget *right_corner;
77     AWallpaperPlugin *desktop_plugin;
78     DBusConnection      *dbus_conn;
79     DBusConnection      *dbus_conn_session;
80     osso_context_t      *osso;
81     gint xapplet;
82     gint yapplet;
83     Scene *scene;
84     GHashTable * hash_scene_func;
85 };
86
87 struct _AWallpaperPlugin
88 {
89     HDHomePluginItem parent;
90     Animation_WallpaperPrivate *priv;
91 };
92
93 struct _AWallpaperPluginClass
94 {
95     HDHomePluginItemClass parent_class;
96
97 };
98
99
100 #define LIVEWP_SIGNAL_INTERFACE "org.maemo.livewp"
101 #define LIVEWP_SIGNAL_PATH "/org/maemo/livewp"
102 #define LIVEWP_SIGNAL_RELOAD_CONFIG_INTERFACE "org.maemo.livewp.reload_config"
103 #define LIVEWP_SIGNAL_RELOAD_CONFIG_PATH "/org/maemo/livewp/reload_config"
104 #define LIVEWP_RELOAD_CONFIG "reload_config"
105 #define LIVEWP_RELOAD_PLUGIN "reload_plugin"
106
107 /* For DBUS notification */
108 #define NOTIFY_SIGNAL_INTERFACE "org.freedesktop.Notifications"
109 #define NOTIFY_SIGNAL_PATH "/org/freedesktop/Notifications"
110 #define NOTIFY_MEMBER "Notify"
111
112 #define CLOSENOTIFY_SIGNAL_INTERFACE "org.freedesktop.Notifications"
113 #define CLOSENOTIFY_SIGNAL_PATH "/org/freedesktop/Notifications"
114 #define CLOSENOTIFY_MEMBER "CloseNotification"
115
116 #endif