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 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.
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 SHORT_TIMER 75 /* 100 milisecond */
55 //#define LONG_TIMER 5*60*1000 /* 10 minutes */
56 #define LONG_TIMER 20*1000 /* 20 seconds */
57 enum { SHORT_TIMER_TYPE, LONG_TIMER_TYPE };
63 typedef struct _Scene Scene;
69 gint wind_orientation; // +/- 1
70 double wind_angle; // [-1 .. 1]
71 guint seed; /* init value for random */
75 typedef struct _AWallpaperPlugin AWallpaperPlugin;
76 typedef struct _AWallpaperPluginClass AWallpaperPluginClass;
77 typedef struct _Animation_WallpaperPrivate Animation_WallpaperPrivate;
81 struct _Animation_WallpaperPrivate
87 gboolean rich_animation;
88 GtkWidget *main_widget;
90 GtkWidget *right_corner;
91 AWallpaperPlugin *desktop_plugin;
92 DBusConnection *dbus_conn;
93 DBusConnection *dbus_conn_session;
98 GHashTable * hash_scene_func;
99 GKeyFile *config_file;
105 time_t last_alive_event;
106 gchar *theme_string_parametr1;
107 guint theme_int_parametr1;
108 GstElement *pipeline;
112 struct _AWallpaperPlugin
114 HDHomePluginItem parent;
115 Animation_WallpaperPrivate *priv;
118 struct _AWallpaperPluginClass
120 HDHomePluginItemClass parent_class;
124 #define LIVEWP_SIGNAL_INTERFACE "org.maemo.livewp"
125 #define LIVEWP_SIGNAL_PATH "/org/maemo/livewp"
126 #define LIVEWP_SIGNAL_RELOAD_CONFIG_INTERFACE "org.maemo.livewp.reload_config"
127 #define LIVEWP_SIGNAL_RELOAD_CONFIG_PATH "/org/maemo/livewp/reload_config"
128 #define LIVEWP_RELOAD_CONFIG "reload_config"
129 #define LIVEWP_RELOAD_PLUGIN "reload_plugin"
130 #define LIVEWP_STOP_LIVEBG_ON_VIEW1 "stop_livebg_on_view1"
131 #define LIVEWP_STOP_LIVEBG_ON_VIEW2 "stop_livebg_on_view2"
132 #define LIVEWP_STOP_LIVEBG_ON_VIEW3 "stop_livebg_on_view3"
133 #define LIVEWP_STOP_LIVEBG_ON_VIEW4 "stop_livebg_on_view4"
134 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW1 "pause_livebg_on_view1"
135 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW2 "pause_livebg_on_view2"
136 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW3 "pause_livebg_on_view3"
137 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW4 "pause_livebg_on_view4"
138 #define LIVEWP_PLAY_LIVEBG_ON_VIEW1 "play_livebg_on_view1"
139 #define LIVEWP_PLAY_LIVEBG_ON_VIEW2 "play_livebg_on_view2"
140 #define LIVEWP_PLAY_LIVEBG_ON_VIEW3 "play_livebg_on_view3"
141 #define LIVEWP_PLAY_LIVEBG_ON_VIEW4 "play_livebg_on_view4"
142 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW1 "alive_livebg_on_view1"
143 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW2 "alive_livebg_on_view2"
144 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW3 "alive_livebg_on_view3"
145 #define LIVEWP_ALIVE_LIVEBG_ON_VIEW4 "alive_livebg_on_view4"
150 /* For DBUS notification */
151 #define NOTIFY_SIGNAL_INTERFACE "org.freedesktop.Notifications"
152 #define NOTIFY_SIGNAL_PATH "/org/freedesktop/Notifications"
153 #define NOTIFY_MEMBER "Notify"
154 #define CLOSENOTIFY_MEMBER "NotificationClosed"