1 /* vim: set sw=4 ts=4 et: */
3 * This file is part of Live Wallpaper (livewp)
5 * Copyright (C) 2010 Vlad Vasiliev
6 * Copyright (C) 2010 Tanya Makova
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
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.
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
24 /*******************************************************************************/
25 #ifndef _livewp_common_h
26 #define _livewp_common_h 1
32 #include <hildon/hildon.h>
34 #include <libhildondesktop/libhildondesktop.h>
36 #include <gconf/gconf-client.h>
38 #include <X11/extensions/Xrender.h>
41 #include <X11/Xatom.h>
44 #include <gst/interfaces/xoverlay.h>
46 #define GETTEXT_PACKAGE "livewp"
47 #include <glib/gi18n-lib.h>
49 /* Position of plugin on desktop */
50 #define Xstartposition 800
51 #define Ystartposition 480
53 #define THEME_PATH "/usr/share/livewp/theme"
54 #define EXTHEME_PATH "/usr/share/livewp/external_themes/"
55 #define SHORT_TIMER 75 /* 100 milisecond */
56 //#define LONG_TIMER 5*60*1000 /* 10 minutes */
57 #define LONG_TIMER 20*1000 /* 20 seconds */
58 enum { SHORT_TIMER_TYPE, LONG_TIMER_TYPE };
64 typedef struct _Scene Scene;
70 gint wind_orientation; // +/- 1
71 double wind_angle; // [-1 .. 1]
72 guint seed; /* init value for random */
76 typedef struct _AWallpaperPlugin AWallpaperPlugin;
77 typedef struct _AWallpaperPluginClass AWallpaperPluginClass;
78 typedef struct _Animation_WallpaperPrivate Animation_WallpaperPrivate;
82 struct _Animation_WallpaperPrivate
88 gboolean rich_animation;
89 gboolean one_in_all_view;
90 GtkWidget *main_widget;
92 GtkWidget *right_corner;
93 AWallpaperPlugin *desktop_plugin;
94 DBusConnection *dbus_conn;
95 DBusConnection *dbus_conn_session;
100 //GHashTable * hash_scene_func;
101 void (*scene_func)(gpointer);
102 GKeyFile *config_file;
108 time_t last_alive_event;
109 gchar *theme_string_parametr1;
110 guint theme_int_parametr1;
111 gboolean theme_bool_parametr1;
112 GstElement *pipeline;
114 GSList *extheme_list;
115 GHashTable *hash_theme;
118 struct _AWallpaperPlugin
120 HDHomePluginItem parent;
121 Animation_WallpaperPrivate *priv;
124 struct _AWallpaperPluginClass
126 HDHomePluginItemClass parent_class;
130 #define LIVEWP_SIGNAL_INTERFACE "org.maemo.livewp"
131 #define LIVEWP_SIGNAL_PATH "/org/maemo/livewp"
132 #define LIVEWP_SIGNAL_RELOAD_CONFIG_INTERFACE "org.maemo.livewp.reload_config"
133 #define LIVEWP_SIGNAL_RELOAD_CONFIG_PATH "/org/maemo/livewp/reload_config"
134 #define LIVEWP_RELOAD_CONFIG "reload_config"
135 #define LIVEWP_RELOAD_PLUGIN "reload_plugin"
136 #define LIVEWP_STOP_LIVEBG_ON_VIEW1 "stop_livebg_on_view1"
137 #define LIVEWP_STOP_LIVEBG_ON_VIEW2 "stop_livebg_on_view2"
138 #define LIVEWP_STOP_LIVEBG_ON_VIEW3 "stop_livebg_on_view3"
139 #define LIVEWP_STOP_LIVEBG_ON_VIEW4 "stop_livebg_on_view4"
140 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW1 "pause_livebg_on_view1"
141 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW2 "pause_livebg_on_view2"
142 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW3 "pause_livebg_on_view3"
143 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW4 "pause_livebg_on_view4"
144 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW "pause_livebg_on_view"
145 #define LIVEWP_PLAY_LIVEBG_ON_VIEW1 "play_livebg_on_view1"
146 #define LIVEWP_PLAY_LIVEBG_ON_VIEW2 "play_livebg_on_view2"
147 #define LIVEWP_PLAY_LIVEBG_ON_VIEW3 "play_livebg_on_view3"
148 #define LIVEWP_PLAY_LIVEBG_ON_VIEW4 "play_livebg_on_view4"
149 #define LIVEWP_PLAY_LIVEBG_ON_VIEW "play_livebg_on_view"
150 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW1 "alive_livebg_on_view1"
151 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW2 "alive_livebg_on_view2"
152 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW3 "alive_livebg_on_view3"
153 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW4 "alive_livebg_on_view4"
158 /* For DBUS notification */
159 #define NOTIFY_SIGNAL_INTERFACE "org.freedesktop.Notifications"
160 #define NOTIFY_SIGNAL_PATH "/org/freedesktop/Notifications"
161 #define NOTIFY_MEMBER "Notify"
162 #define CLOSENOTIFY_MEMBER "NotificationClosed"