videothemedir = $(datadir)/livewp/theme/Video
videotheme_DATA = theme/Video/*
+flashthemedir = $(datadir)/livewp/theme/Flash
+flashtheme_DATA = theme/Flash/*
+
+slideshowthemedir = $(datadir)/livewp/theme/Slideshow
+slideshowtheme_DATA = theme/Slideshow/*
+
xsnowthemedir = $(datadir)/livewp/theme/Xsnow
xsnowtheme_DATA = theme/Xsnow/*
$(crazytheme_DATA) \
$(liqflowtheme_DATA) \
$(videotheme_DATA) \
+ $(flashtheme_DATA) \
+ $(slideshowtheme_DATA) \
$(xshowtheme_DATA) \
$(conkytheme_DATA) \
$(colorfloodtheme_DATA) \
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
-am__installdirs = "$(DESTDIR)$(accelthemedir)" "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(colorfloodthemedir)" "$(DESTDIR)$(conkythemedir)" "$(DESTDIR)$(crazythemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktoppaneldir)" "$(DESTDIR)$(externalthemedir)" "$(DESTDIR)$(fifteenthemedir)" "$(DESTDIR)$(liqflowthemedir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)" "$(DESTDIR)$(videothemedir)" "$(DESTDIR)$(xsnowthemedir)"
+am__installdirs = "$(DESTDIR)$(accelthemedir)" "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(colorfloodthemedir)" "$(DESTDIR)$(conkythemedir)" "$(DESTDIR)$(crazythemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktoppaneldir)" "$(DESTDIR)$(externalthemedir)" "$(DESTDIR)$(fifteenthemedir)" "$(DESTDIR)$(flashthemedir)" "$(DESTDIR)$(liqflowthemedir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)" "$(DESTDIR)$(slideshowthemedir)" "$(DESTDIR)$(videothemedir)" "$(DESTDIR)$(xsnowthemedir)"
accelthemeDATA_INSTALL = $(INSTALL_DATA)
berlinthemeDATA_INSTALL = $(INSTALL_DATA)
colorfloodthemeDATA_INSTALL = $(INSTALL_DATA)
desktoppanelDATA_INSTALL = $(INSTALL_DATA)
externalthemeDATA_INSTALL = $(INSTALL_DATA)
fifteenthemeDATA_INSTALL = $(INSTALL_DATA)
+flashthemeDATA_INSTALL = $(INSTALL_DATA)
liqflowthemeDATA_INSTALL = $(INSTALL_DATA)
matrixthemeDATA_INSTALL = $(INSTALL_DATA)
modernthemeDATA_INSTALL = $(INSTALL_DATA)
+slideshowthemeDATA_INSTALL = $(INSTALL_DATA)
videothemeDATA_INSTALL = $(INSTALL_DATA)
xsnowthemeDATA_INSTALL = $(INSTALL_DATA)
DATA = $(acceltheme_DATA) $(berlintheme_DATA) $(colorfloodtheme_DATA) \
$(conkytheme_DATA) $(crazytheme_DATA) $(dbus_service_DATA) \
$(desktoppanel_DATA) $(externaltheme_DATA) \
- $(fifteentheme_DATA) $(liqflowtheme_DATA) $(matrixtheme_DATA) \
- $(moderntheme_DATA) $(videotheme_DATA) $(xsnowtheme_DATA)
+ $(fifteentheme_DATA) $(flashtheme_DATA) $(liqflowtheme_DATA) \
+ $(matrixtheme_DATA) $(moderntheme_DATA) $(slideshowtheme_DATA) \
+ $(videotheme_DATA) $(xsnowtheme_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
#orrerytheme_DATA = theme/Orrery/*
videothemedir = $(datadir)/livewp/theme/Video
videotheme_DATA = theme/Video/*
+flashthemedir = $(datadir)/livewp/theme/Flash
+flashtheme_DATA = theme/Flash/*
+slideshowthemedir = $(datadir)/livewp/theme/Slideshow
+slideshowtheme_DATA = theme/Slideshow/*
xsnowthemedir = $(datadir)/livewp/theme/Xsnow
xsnowtheme_DATA = theme/Xsnow/*
colorfloodthemedir = $(datadir)/livewp/theme/Colorflood
$(crazytheme_DATA) \
$(liqflowtheme_DATA) \
$(videotheme_DATA) \
+ $(flashtheme_DATA) \
+ $(slideshowtheme_DATA) \
$(xshowtheme_DATA) \
$(conkytheme_DATA) \
$(colorfloodtheme_DATA) \
echo " rm -f '$(DESTDIR)$(fifteenthemedir)/$$f'"; \
rm -f "$(DESTDIR)$(fifteenthemedir)/$$f"; \
done
+install-flashthemeDATA: $(flashtheme_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(flashthemedir)" || $(mkdir_p) "$(DESTDIR)$(flashthemedir)"
+ @list='$(flashtheme_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(flashthemeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(flashthemedir)/$$f'"; \
+ $(flashthemeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(flashthemedir)/$$f"; \
+ done
+
+uninstall-flashthemeDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(flashtheme_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f '$(DESTDIR)$(flashthemedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(flashthemedir)/$$f"; \
+ done
install-liqflowthemeDATA: $(liqflowtheme_DATA)
@$(NORMAL_INSTALL)
test -z "$(liqflowthemedir)" || $(mkdir_p) "$(DESTDIR)$(liqflowthemedir)"
echo " rm -f '$(DESTDIR)$(modernthemedir)/$$f'"; \
rm -f "$(DESTDIR)$(modernthemedir)/$$f"; \
done
+install-slideshowthemeDATA: $(slideshowtheme_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(slideshowthemedir)" || $(mkdir_p) "$(DESTDIR)$(slideshowthemedir)"
+ @list='$(slideshowtheme_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(slideshowthemeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(slideshowthemedir)/$$f'"; \
+ $(slideshowthemeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(slideshowthemedir)/$$f"; \
+ done
+
+uninstall-slideshowthemeDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(slideshowtheme_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f '$(DESTDIR)$(slideshowthemedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(slideshowthemedir)/$$f"; \
+ done
install-videothemeDATA: $(videotheme_DATA)
@$(NORMAL_INSTALL)
test -z "$(videothemedir)" || $(mkdir_p) "$(DESTDIR)$(videothemedir)"
distdir: $(DISTFILES)
- $(mkdir_p) $(distdir)/external_themes $(distdir)/theme/Accel $(distdir)/theme/Berlin $(distdir)/theme/Colorflood $(distdir)/theme/Conky $(distdir)/theme/CrazyChickens $(distdir)/theme/Fifteen $(distdir)/theme/Liqflow $(distdir)/theme/Matrix $(distdir)/theme/Modern $(distdir)/theme/Video
+ $(mkdir_p) $(distdir)/external_themes $(distdir)/theme/Accel $(distdir)/theme/Berlin $(distdir)/theme/Colorflood $(distdir)/theme/Conky $(distdir)/theme/CrazyChickens $(distdir)/theme/Fifteen $(distdir)/theme/Flash $(distdir)/theme/Liqflow $(distdir)/theme/Matrix $(distdir)/theme/Modern $(distdir)/theme/Slideshow $(distdir)/theme/Video
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
check: check-am
all-am: Makefile $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(accelthemedir)" "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(colorfloodthemedir)" "$(DESTDIR)$(conkythemedir)" "$(DESTDIR)$(crazythemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktoppaneldir)" "$(DESTDIR)$(externalthemedir)" "$(DESTDIR)$(fifteenthemedir)" "$(DESTDIR)$(liqflowthemedir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)" "$(DESTDIR)$(videothemedir)" "$(DESTDIR)$(xsnowthemedir)"; do \
+ for dir in "$(DESTDIR)$(accelthemedir)" "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(colorfloodthemedir)" "$(DESTDIR)$(conkythemedir)" "$(DESTDIR)$(crazythemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktoppaneldir)" "$(DESTDIR)$(externalthemedir)" "$(DESTDIR)$(fifteenthemedir)" "$(DESTDIR)$(flashthemedir)" "$(DESTDIR)$(liqflowthemedir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)" "$(DESTDIR)$(slideshowthemedir)" "$(DESTDIR)$(videothemedir)" "$(DESTDIR)$(xsnowthemedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-crazythemeDATA install-data-local \
install-dbus_serviceDATA install-desktoppanelDATA \
install-externalthemeDATA install-fifteenthemeDATA \
- install-liqflowthemeDATA install-matrixthemeDATA \
- install-modernthemeDATA install-videothemeDATA \
+ install-flashthemeDATA install-liqflowthemeDATA \
+ install-matrixthemeDATA install-modernthemeDATA \
+ install-slideshowthemeDATA install-videothemeDATA \
install-xsnowthemeDATA
install-exec-am:
uninstall-colorfloodthemeDATA uninstall-conkythemeDATA \
uninstall-crazythemeDATA uninstall-dbus_serviceDATA \
uninstall-desktoppanelDATA uninstall-externalthemeDATA \
- uninstall-fifteenthemeDATA uninstall-info-am \
- uninstall-liqflowthemeDATA uninstall-local \
+ uninstall-fifteenthemeDATA uninstall-flashthemeDATA \
+ uninstall-info-am uninstall-liqflowthemeDATA uninstall-local \
uninstall-matrixthemeDATA uninstall-modernthemeDATA \
- uninstall-videothemeDATA uninstall-xsnowthemeDATA
+ uninstall-slideshowthemeDATA uninstall-videothemeDATA \
+ uninstall-xsnowthemeDATA
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
install-data-local install-dbus_serviceDATA \
install-desktoppanelDATA install-exec install-exec-am \
install-externalthemeDATA install-fifteenthemeDATA \
- install-info install-info-am install-liqflowthemeDATA \
- install-man install-matrixthemeDATA install-modernthemeDATA \
+ install-flashthemeDATA install-info install-info-am \
+ install-liqflowthemeDATA install-man install-matrixthemeDATA \
+ install-modernthemeDATA install-slideshowthemeDATA \
install-strip install-videothemeDATA install-xsnowthemeDATA \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
uninstall-conkythemeDATA uninstall-crazythemeDATA \
uninstall-dbus_serviceDATA uninstall-desktoppanelDATA \
uninstall-externalthemeDATA uninstall-fifteenthemeDATA \
- uninstall-info-am uninstall-liqflowthemeDATA uninstall-local \
+ uninstall-flashthemeDATA uninstall-info-am \
+ uninstall-liqflowthemeDATA uninstall-local \
uninstall-matrixthemeDATA uninstall-modernthemeDATA \
- uninstall-videothemeDATA uninstall-xsnowthemeDATA
+ uninstall-slideshowthemeDATA uninstall-videothemeDATA \
+ uninstall-xsnowthemeDATA
install-data-local:
<name>Flash</name>
<exec_path>/opt/kmplayer/bin/knpplayer -m application/x-shockwave-flash -p /usr/lib/browser/plugins/libflashplayer.so</exec_path>
<category>LiveWallpaper</category>
- <icon_on>/usr/share/livewp/theme/Conky/icon.png</icon_on>
- <icon_off>/usr/share/livewp/theme/Conky/icond.png</icon_off>
+ <icon_on>/usr/share/livewp/theme/Flash/icon.png</icon_on>
+ <icon_off>/usr/share/livewp/theme/Flash/icond.png</icon_off>
<gtk_socket_id>-wid</gtk_socket_id>
<check_path>/opt/kmplayer/bin/knpplayer</check_path>
<install_file>http://maemo.org/downloads/product/raw/Maemo5/kmplayer/?get_installfile</install_file>
/*vim: set sw=4 ts=4 et: */
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
{
cairo_t *cr;
GdkPixbuf *pixbuf = (GdkPixbuf *) data;
-
+
cr = gdk_cairo_create(widget->window);
if (cr){
gdk_cairo_region(cr, event->region);
}
void
-create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin)
+create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
GtkWidget *ha = NULL;
GtkWidget *label = NULL;
ha = hildon_animation_actor_new();
- label = gtk_label_new(NULL);
+ label = gtk_label_new(NULL);
if (label){
//g_signal_connect(G_OBJECT(label), "expose_event", G_CALLBACK(expose_event), NULL);
gtk_container_add (GTK_CONTAINER (ha), label);
- }
+ }
realize(ha);
gtk_widget_show(label);
gtk_widget_show_all(ha);
-
+
/* TO DO check it */
/* gdk_flush (); */
}
void
-create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin)
+create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
GtkWidget *ha = NULL;
GdkPixbuf *pixbuf = NULL;
ha = hildon_animation_actor_new();
if (!strcmp(actor->name, "original"))
str = g_strdup(actor->filename);
- else
- str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
+ else
+ str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
desktop_plugin->priv->theme, actor->filename);
- pixbuf = gdk_pixbuf_new_from_file_at_size (str,
- actor->width,
- actor->height,
+ /* fprintf(stderr, "create hildon actor file=%s\n", str); */
+ pixbuf = gdk_pixbuf_new_from_file_at_size (str,
+ actor->width,
+ actor->height,
NULL);
if (str)
g_free(str);
g_signal_connect(G_OBJECT(image), "expose_event",
G_CALLBACK(expose_event), pixbuf);
gtk_container_add (GTK_CONTAINER (ha), image);
- }
+ }
realize(ha);
gtk_widget_show_all(ha);
-
+
/* TO DO check it */
/* gdk_flush (); */
GdkPixbuf *pixbuf = NULL;
gchar *str = NULL;
- str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
+ str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
desktop_plugin->priv->theme, actor->filename);
-
- pixbuf = gdk_pixbuf_new_from_file_at_size (str,
- actor->width,
- actor->height,
+
+ pixbuf = gdk_pixbuf_new_from_file_at_size (str,
+ actor->width,
+ actor->height,
NULL);
if(str)
g_free(str);
image = gtk_image_new_from_pixbuf (pixbuf);
g_object_unref(G_OBJECT(pixbuf));
}
- if (image){
+ if (image){
g_signal_connect(G_OBJECT(image), "expose_event",
G_CALLBACK(expose_event), pixbuf);
//if (g_object_get_data(G_OBJECT(actor->widget), "image")){
if (actor->image){
- gtk_container_remove(GTK_CONTAINER(actor->widget), actor->image);
+ gtk_container_remove(GTK_CONTAINER(actor->widget), actor->image);
}
//g_object_set_data(G_OBJECT(actor->widget), "image", image);
actor->image = image;
}
}
-Actor*
-init_object(AWallpaperPlugin *desktop_plugin,
- gchar * name,
- gchar * filename,
- gint x,
- gint y,
- gint z,
- gint width,
- gint height,
- gboolean visible,
+Actor*
+init_object(AWallpaperPlugin *desktop_plugin,
+ gchar * name,
+ gchar * filename,
+ gint x,
+ gint y,
+ gint z,
+ gint width,
+ gint height,
+ gboolean visible,
gboolean load_image,
- gint scale,
- gint opacity,
+ gint scale,
+ gint opacity,
void (*pfunc_change)(Actor*),
void (*pfunc_probability)(Actor*),
GPtrArray *child
actor->opacity = opacity;
actor->filename = g_strdup(filename);
actor->name = g_strdup(name);
- actor->func_change = (gpointer)pfunc_change;
+ actor->func_change = (gpointer)pfunc_change;
actor->func_probability = (gpointer)pfunc_probability;
actor->child = child;
if (load_image){
create_hildon_actor(actor, desktop_plugin);
}
- else
+ else
actor->widget = NULL;
actor->time_start_animation = 0;
actor->duration_animation = 0;
return actor;
}
-void
+void
destroy_actor(Actor *actor)
{
if (actor){
g_free(actor);
}
}
-static gint
+static gint
path_line(gint x0, gint x1, double t)
{
// уравниение прямой
set_actor_scale(Actor *actor, double scalex, double scaley)
{
hildon_animation_actor_set_scale(
- HILDON_ANIMATION_ACTOR(actor->widget),
- scalex,
+ HILDON_ANIMATION_ACTOR(actor->widget),
+ scalex,
scaley
);
}
void
+set_actor_opacity(Actor *actor, gint opacity)
+{
+ hildon_animation_actor_set_opacity(
+ HILDON_ANIMATION_ACTOR(actor->widget),
+ opacity
+ );
+
+}
+
+void
set_actor_rotation(Actor *actor, gint axis, double degrees, gint x, gint y, gint z)
{
hildon_animation_actor_set_rotation(
z
);
}
-void
+void
set_actor_visible(Actor *actor, gboolean visible)
{
hildon_animation_actor_set_show(HILDON_ANIMATION_ACTOR(actor->widget), visible);
set_actor_position(Actor *actor, gint x, gint y, gint z, AWallpaperPlugin *desktop_plugin)
{
//fprintf(stderr, "set actor position %d, %d, %d\n", x, y, z);
- hildon_animation_actor_set_position_full(HILDON_ANIMATION_ACTOR (actor->widget),
- x-desktop_plugin->priv->xapplet,
- y-desktop_plugin->priv->yapplet,
+ hildon_animation_actor_set_position_full(HILDON_ANIMATION_ACTOR (actor->widget),
+ x-desktop_plugin->priv->xapplet,
+ y-desktop_plugin->priv->yapplet,
z);
}
{
gchar *message = "";
gint count = 0;
-
+
fprintf(stderr, "read notification \n");
count = get_notify_count("general_missed");
if (count > 0){
}
-void
+void
change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gint count = 0;
Actor *a = NULL;
-
- //fprintf(stderr, "change_billboard\n");
-
+
+ //fprintf(stderr, "change_billboard\n");
+
if (desktop_plugin->priv->scene->notification < time(NULL)){
count = get_notify_count("general_missed");
a = g_ptr_array_index(actor->child, 0);
if (count > 0){
- set_actor_visible(a, TRUE);
+ set_actor_visible(a, TRUE);
}else {
set_actor_visible(a, FALSE);
}
count = get_notify_count("general_sms");
a = g_ptr_array_index(actor->child, 3);
if (count > 0){
- set_actor_visible(a, TRUE);
+ set_actor_visible(a, TRUE);
}else {
set_actor_visible(a, FALSE);
}
count = get_notify_count("general_chat");
a = g_ptr_array_index(actor->child, 1);
if (count > 0){
- set_actor_visible(a, TRUE);
+ set_actor_visible(a, TRUE);
}else {
set_actor_visible(a, FALSE);
}
count = get_notify_count("qgn_list_messagin");
a = g_ptr_array_index(actor->child, 2);
if (count > 0){
- set_actor_visible(a, TRUE);
+ set_actor_visible(a, TRUE);
}else {
set_actor_visible(a, FALSE);
}
desktop_plugin->priv->scene->notification = FALSE;
}
- actor->time_start_animation = time(NULL) + 20;
+ actor->time_start_animation = time(NULL) + 20;
}
#if 0
-void
+void
change_billboard1(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
GtkWidget *label;
gint call_count=0, sms_count=0, rc=0;
GtkListStore *list = NULL;
PangoFontDescription *pfd = NULL;
-
+
rc = sqlite3_open("/home/user/.rtcom-eventlogger/el.db", &db);
if (rc){
fprintf(stderr, "error open db %d %s\n", rc, sqlite3_errmsg(db));
gtk_widget_modify_font(GTK_WIDGET(label), NULL);
gtk_widget_modify_font(GTK_WIDGET(label), pfd);
pango_font_description_free(pfd);
- actor->time_start_animation = time(NULL) + 20;
+ actor->time_start_animation = time(NULL) + 20;
}
#endif
-void
+void
change_moon(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gint phase;
char *newfile;
gint x0 = 150,
- x1 = 650,
+ x1 = 650,
x, y;
- struct timeval tvb;
+ struct timeval tvb;
suseconds_t ms;
long sec;
double t;
fprintf(stderr, "a=%f, b=%f, c=%f\n", a, b, c);
#endif
gettimeofday(&tvb, NULL);
-
+
ms = tvb.tv_usec;
sec = tvb.tv_sec;
t = (double)((double)sec+(double)ms/1000000 - actor->time_start_animation) / actor->duration_animation;
if (t <= 1)
x = path_line(x0, x1, t);
- else
+ else
x = path_line(x1, x0, t-1);
y = 0.001920*x*x - 1.536*x + 337.2;
//y = a*x*x + b*x + c;
fprintf(stderr, "destroy moon \n");
destroy_hildon_actor(actor);
actor->time_start_animation = 0;
- }
+ }
}
-
+
}
-void
+void
change_sun(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
double alt, azm;
actor->visible = FALSE;
destroy_hildon_actor(actor);
actor->time_start_animation = 0;
- }
+ }
}
-
+
}
-void
+void
change_tram(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gint x0 = -300, y0 = 225, scale0 = 100,
- x1 = 800, y1 = 162, scale1 = 130,
+ x1 = 800, y1 = 162, scale1 = 130,
x, y, scale;
- struct timeval tvb;
+ struct timeval tvb;
suseconds_t ms;
long sec;
double t;
//fprintf(stderr, "change tram\n");
gettimeofday(&tvb, NULL);
-
+
ms = tvb.tv_usec;
sec = tvb.tv_sec;
-
+
if (!actor->visible){
actor->visible = TRUE;
if (desktop_plugin->priv->scene->daytime == TIME_NIGHT){
change_plane1(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
gint x0 = 620, y0 = 233,
- x1 = 79, y1 = -146,
+ x1 = 79, y1 = -146,
x, y;
- struct timeval tvb;
+ struct timeval tvb;
suseconds_t ms;
long sec;
double t;
gettimeofday(&tvb, NULL);
-
+
ms = tvb.tv_usec;
sec = tvb.tv_sec;
// fprintf(stderr, "1 %f - %d\n", sec+(double)ms/100000, now);
-
+
if (desktop_plugin->priv->scene->daytime != TIME_NIGHT){
if (actor->time_start_animation == 0){
actor->time_start_animation = sec + fast_rnd(180);
/* stop animation */
actor->visible = FALSE;
destroy_hildon_actor(actor);
- if (desktop_plugin->priv->scene->daytime == TIME_NIGHT)
+ if (desktop_plugin->priv->scene->daytime == TIME_NIGHT)
actor->time_start_animation = 0;
- else
+ else
actor->time_start_animation = sec + fast_rnd(180);
}
change_plane2(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
gint x0 = -actor->width, y0 = 45,
- x1 = 800, y1 = 20,
+ x1 = 800, y1 = 20,
x, y;
- struct timeval tvb;
+ struct timeval tvb;
suseconds_t ms;
long sec;
double t;
gettimeofday(&tvb, NULL);
-
+
ms = tvb.tv_usec;
sec = tvb.tv_sec;
// fprintf(stderr, "1 %f - %d\n", sec+(double)ms/100000, now);
/* stop animation */
actor->visible = FALSE;
destroy_hildon_actor(actor);
- if (desktop_plugin->priv->scene->daytime == TIME_NIGHT)
+ if (desktop_plugin->priv->scene->daytime == TIME_NIGHT)
actor->time_start_animation = 0;
- else
+ else
actor->time_start_animation = sec + fast_rnd(180);
}
change_cloud(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
gint x0, y0 = 300, scale0 = 100,
- x1, y1 = -actor->height, scale1 = 150,
+ x1, y1 = -actor->height, scale1 = 150,
x, y, scale;
- struct timeval tvb;
+ struct timeval tvb;
suseconds_t ms;
long sec;
double t;
//fprintf(stderr, "change cloud\n");
gettimeofday(&tvb, NULL);
-
+
ms = tvb.tv_usec;
sec = tvb.tv_sec;
-
+
if (!actor->visible){
actor->visible = TRUE;
if (desktop_plugin->priv->scene->daytime == TIME_NIGHT){
newfile = g_strdup_printf("%s_dark.png", actor->name);
}else{
newfile = g_strdup_printf("%s.png", actor->name);
- }
+ }
if (actor->filename)
g_free(actor->filename);
actor->filename = newfile;
-
+
create_hildon_actor(actor, desktop_plugin);
}
t = (double)((double)sec+(double)ms/1000000 - actor->time_start_animation) / actor->duration_animation;
-
+
if (desktop_plugin->priv->scene->wind_orientation == 1){
x0 = -actor->width;
x1 = 800;
x1 = -actor->width;
}
- x = path_line(x0, x1, t);
+ x = path_line(x0, x1, t);
y = -desktop_plugin->priv->scene->wind_angle * (x - x0) + actor->y;
scale = path_line(scale0, scale1, (double)(y - y0)/(y1 - y0));
//fprintf(stderr, "change wind orient = %d angle = %f after = %d\n", scene.wind_orientation, scene.wind_angle, actor->time_start_animation-time(NULL));
}
-void
+void
change_window1(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gint now = time(NULL);
if (!actor->visible)
actor->visible = TRUE;
- else
+ else
actor->visible = FALSE;
set_actor_visible(actor, actor->visible);
actor->time_start_animation = now + fast_rnd(60) + 10;
}
-void
+void
change_signal(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gint now = time(NULL);
a = g_ptr_array_index(actor->child, 0);
if (a->visible)
a->visible = FALSE;
- else
+ else
a->visible = TRUE;
set_actor_visible(a, a->visible);
-
+
a = g_ptr_array_index(actor->child, 1);
if (a->visible)
a->visible = FALSE;
- else
+ else
a->visible = TRUE;
set_actor_visible(a, a->visible);
Actor *a;
if (!desktop_plugin->priv->rich_animation) return;
-
+
char * accel_filename = "/sys/class/i2c-adapter/i2c-3/3-001d/coord";
//char * accel_filename = "/home/tanya/coord";
fd = fopen(accel_filename, "r");
if (fd == NULL){
//fprintf(stderr, "cannot open file\n");
- fd = fopen("/home/user/coord", "r");
+ fd = fopen("/home/user/coord", "r");
}
rs = fscanf((FILE*)fd, "%i %i %i", &ax, &ay, &az);
fclose(fd);
if (a->scale > 360) a->scale = 0;
if (a->scale < 0) a->scale = 360;
}
-
+
x = a->x - (float)cos(a->scale*M_PI/180)*a->z;
y = a->y - (float)sin(a->scale*M_PI/180)*a->z;
//x = round(a->x - (float)cos(a->scale*M_PI/180)*a->z);
//y = round(a->y - (float)sin(a->scale*M_PI/180)*a->z);
//x = a->x - cos(angle)*a->z;
//y = a->y - sin(angle)*a->z;
- if ((a->scale > 270 || a->scale < 90) && x < -a->width*cos(a->scale*M_PI/180)){
- x = 800;
+ if ((a->scale > 270 || a->scale < 90) && x < -a->width*cos(a->scale*M_PI/180)){
+ x = 800;
y = fast_rnd(480);
- }
+ }
if ((a->scale > 90 && a->scale < 270) && x > 800 - a->width*cos(a->scale*M_PI/180)){
x = 0;
y = fast_rnd(480);
a->x = x;
a->y = y;
}
+
+}
+
+void
+change_slideshow(Actor *actor, AWallpaperPlugin *desktop_plugin)
+{
+ gint num, next, prev, now;
+ Actor *a1 = NULL, *a2 = NULL;
+
+ struct timeval tvb;
+ suseconds_t ms;
+ long sec;
+ double t;
+
+ now = time(NULL);
+ num = actor->scale; // total number of images
+ prev = actor->opacity; // number of current image
+ next = actor->z; // number of new image
+ if (next < 0){
+ // new image not selected, first step of animation
+ srand(now);
+ next = rand()%num;
+ while (num > 1 && next == prev)
+ next = rand()%num;
+ a2 = g_ptr_array_index(actor->child, next);
+ a2->visible = TRUE;
+ create_hildon_actor(a2, desktop_plugin);
+ set_actor_opacity(a2, 0);
+ actor->z = next;
+ }else {
+ a2 = g_ptr_array_index(actor->child, next);
+ }
+
+ gettimeofday(&tvb, NULL);
+
+ ms = tvb.tv_usec;
+ sec = tvb.tv_sec;
+
+ t = (double)((double)sec+(double)ms/1000000 - actor->time_start_animation) / actor->duration_animation;
+ set_actor_opacity(a2, path_line(0, 255, t));
+
+ if (prev > -1){
+ a1 = g_ptr_array_index(actor->child, prev);
+ set_actor_opacity(a1, path_line(255, 0, t));
+ }
+ if (t >= 1){
+ // last step of animation
+ actor->opacity = next;
+ actor->z = -1;
+ if (prev > -1){
+ a1->visible = FALSE;
+ destroy_hildon_actor(a1);
+ }
+ actor->time_start_animation = now + desktop_plugin->priv->theme_int_parametr1;
+ }
}
void
if (y > 480) y = -480;
set_actor_position(a, a->x, y, a->z, desktop_plugin);
a->y = y;
-
+
a = g_ptr_array_index(actor->child, 1);
y = a->y + speed1;
if (y > 480) y = -480;
a->y = y;
}
-void
+void
change_static_actor(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gchar *newfile;
- newfile = g_strdup_printf("%s%d.png", actor->name, desktop_plugin->priv->scene->daytime);
+ newfile = g_strdup_printf("%s%d.png", actor->name, desktop_plugin->priv->scene->daytime);
if (actor->filename)
g_free(actor->filename);
actor->filename = newfile;
change_hildon_actor(actor, desktop_plugin);
}
-void
+void
change_static_actor_with_corner(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gchar buffer[2048];
/*vim: set sw=4 ts=4 et: */
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
#ifndef _livewp_actor_h
#define _livewp_actor_h 1
-#include "livewp-common.h"
+#include "livewp-common.h"
#include <sys/time.h>
#include "livewp-rules.h"
#include <sqlite3.h>
gint width;
gint height;
gint scale;
- gint opacity;
+ gint opacity;
gboolean visible;
void (*func_change)(gpointer, gpointer);
time_t time_start_animation;
};
/*******************************************************************************/
-Actor* init_object(AWallpaperPlugin *desktop_plugin,
- gchar * name,
- gchar * filename,
- gint x,
- gint y,
- gint z,
- gint width,
- gint height,
- gboolean visible,
+Actor* init_object(AWallpaperPlugin *desktop_plugin,
+ gchar * name,
+ gchar * filename,
+ gint x,
+ gint y,
+ gint z,
+ gint width,
+ gint height,
+ gboolean visible,
gboolean load_image,
- gint scale,
- gint opacity,
+ gint scale,
+ gint opacity,
void (*pfunc_change)(Actor*),
void (*pfunc_probability)(Actor*),
GPtrArray *child
);
void destroy_hildon_actor(Actor *actor);
-void create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin);
+void create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin);
void create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin);
void change_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin);
void destroy_actor(Actor *actor);
void set_actor_position(Actor *actor, gint x, gint y, gint z, AWallpaperPlugin *desktop_plugin);
void set_actor_scale(Actor *actor, double scalex, double scaley);
+void set_actor_opacity(Actor *actor, gint opacity);
void set_actor_rotation(Actor *actor, gint axis, double degrees, gint x, gint y, gint z);
void set_actor_visible(Actor *actor, gboolean visible);
void change_obj(Actor * actor, AWallpaperPlugin *desktop_plugin);
void change_tape(Actor * actor, AWallpaperPlugin *desktop_plugin);
+void change_slideshow(Actor * actor, AWallpaperPlugin *desktop_plugin);
void change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin);
void change_moon(Actor * actor, AWallpaperPlugin *desktop_plugin);
void change_sun(Actor * actor, AWallpaperPlugin *desktop_plugin);
/* vim: set sw=4 ts=4 et: */
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
/*******************************************************************************/
#include "livewp-config.h"
/*******************************************************************************/
-gint
+gint
current_active_view(void){
GConfClient *gconf_client = NULL;
gint result = -1;
/*******************************************************************************/
#ifdef APPLICATION
-void
+void
fill_priv(Animation_WallpaperPrivate *priv)
{
/* Reset data */
priv->scene_func = (gpointer)&init_scene_Matrix;
if (!strcmp(priv->theme, "Video"))
priv->scene_func = (gpointer)&init_scene_Video;
-
+ if (!strcmp(priv->theme, "Slideshow"))
+ priv->scene_func = (gpointer)&init_scene_Slideshow;
+
priv->extheme_list = get_list_exthemes();
GSList *store = priv->extheme_list;
while (store){
}
#endif
/*******************************************************************************/
-gint
+gint
read_config(Animation_WallpaperPrivate *priv) {
GConfClient *gconf_client = NULL;
str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
tmp = gconf_client_get_string(gconf_client,
str, NULL);
- if (str){
+ if (str){
g_free(str);
str = NULL;
- }
+ }
if (tmp){
priv->theme = tmp;
}else
/* get Rich animation default TRUE */
str = g_strdup_printf("%s%i", GCONF_KEY_RANIMATION, id);
value = gconf_client_get(gconf_client, str, NULL);
- if (str){
+ if (str){
g_free(str);
str = NULL;
- }
+ }
if (value) {
priv->rich_animation = gconf_value_get_bool(value);
gconf_value_free(value);
/* get theme additional bool aparametr 1 default TRUE */
str = g_strdup_printf("%s%i", GCONF_KEY_ADDITIONAL_BOOL_1, id);
value = gconf_client_get(gconf_client, str, NULL);
- if (str){
+ if (str){
g_free(str);
str = NULL;
- }
+ }
if (value) {
priv->theme_bool_parametr1 = gconf_value_get_bool(value);
gconf_value_free(value);
/* get theme additional parameter 1 */
str = g_strdup_printf("%s%i", GCONF_KEY_ADDITIONAL_STRING_1 , id);
value = gconf_client_get(gconf_client, str, NULL);
- if (str){
+ if (str){
g_free(str);
str = NULL;
- }
+ }
if (value) {
priv->theme_string_parametr1 = g_strdup(gconf_value_get_string(value));
gconf_value_free(value);
- }
+ }
+ /* get theme additional int parameter 1 */
+ str = g_strdup_printf("%s%i", GCONF_KEY_ADDITIONAL_INT_1 , id);
+ value = gconf_client_get(gconf_client, str, NULL);
+ if (str){
+ g_free(str);
+ str = NULL;
+ }
+ if (value) {
+ priv->theme_int_parametr1 = gconf_value_get_int(value);
+ gconf_value_free(value);
+ }
+
/* get parameter one theme in all view */
priv->one_in_all_view = get_one_in_all_views_from_config();
return 0;
fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
return;
}
-
+
if (priv->theme){
str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
gconf_client_set_string(gconf_client,
g_free(str);
str = NULL;
}
+ str = g_strdup_printf("%s%i",GCONF_KEY_ADDITIONAL_INT_1, id);
+ if (priv->theme_int_parametr1){
+ gconf_client_set_int(gconf_client,
+ str,
+ priv->theme_int_parametr1, NULL);
+ }else
+ gconf_client_unset(gconf_client, str, NULL);
+ if (str){
+ g_free(str);
+ str = NULL;
+ }
}
/*******************************************************************************/
for (i=1; i<=9; i++){
str = g_strdup_printf("%s%i", GCONF_KEY_THEME, i);
value = gconf_client_get_string(gconf_client, str, NULL);
- if (str){
+ if (str){
g_free(str);
str = NULL;
- }
+ }
if (value && !strcmp(value, theme_name)){
count++;
}
/* vim: set sw=4 ts=4 et: */
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
#define GCONF_KEY_RANIMATION GCONF_KEY_PREFIX"/rich_animation"
#define GCONF_KEY_ADDITIONAL_STRING_1 GCONF_KEY_PREFIX"/additional_string_1"
#define GCONF_KEY_ADDITIONAL_BOOL_1 GCONF_KEY_PREFIX"/additional_bool_1"
+#define GCONF_KEY_ADDITIONAL_INT_1 GCONF_KEY_PREFIX"/additional_int_1"
void init_scene_Modern(AWallpaperPlugin *desktop_plugin);
void init_scene_Berlin(AWallpaperPlugin *desktop_plugin);
void init_scene_Matrix(AWallpaperPlugin *desktop_plugin);
void init_scene_theme(AWallpaperPlugin *desktop_plugin);
void init_scene_Conky(AWallpaperPlugin *desktop_plugin);
void init_scene_Flash(AWallpaperPlugin *desktop_plugin);
-gint read_config(Animation_WallpaperPrivate *priv);
-void save_config(Animation_WallpaperPrivate *priv);
+void init_scene_Slideshow(AWallpaperPlugin *desktop_plugin);
+gint read_config(Animation_WallpaperPrivate *priv);
+void save_config(Animation_WallpaperPrivate *priv);
void fill_priv(Animation_WallpaperPrivate *priv);
gint current_active_view(void);
GSList * get_list_exthemes(void);
/* vim: set sw=4 ts=4 et: */
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
void conky_visible(AWallpaperPlugin *desktop_plugin);
void flash_visible(AWallpaperPlugin *desktop_plugin);
-void
+void
set_live_bg (Display *display, Window xwindow, int mode){
Atom atom;
atom = XInternAtom (display, "_HILDON_LIVE_DESKTOP_BACKGROUND", False);
view_state_changed (Animation_WallpaperPrivate *priv)
{
fprintf(stderr," VIew %i State %i\n", priv->view, priv->visible);
- if (priv->visible){
+ if (priv->visible){
/* ToDo make undependent function */
/* For Video */
if (!strcmp(priv->theme,"Video")){
}
/*******************************************************************************/
gboolean
-check_alive_event(Animation_WallpaperPrivate *priv)
+check_alive_event(Animation_WallpaperPrivate *priv)
{
if ( time(NULL) - priv->last_alive_event > 10*60) /* If last event later 10 minute */
quit_from_program(priv);
fprintf(stderr,"quit_from_program\n");
if (priv){
livewp_deinitialize_dbus(priv);
- if (priv->view_notify != 0) {
+ if (priv->view_notify != 0) {
gconf_client_notify_remove (gconf_client_get_default (), priv->view_notify);
priv->view_notify = 0;
}
priv->desktop_plugin = NULL;
g_free(priv);
priv = NULL;
- }
+ }
fprintf(stderr,"end of quit_from_program\n");
gtk_main_quit();;
}
tmp = desktop_plugin->priv->scene->actors;
while (tmp != NULL){
actor = tmp->data;
- if (now >= actor->time_start_animation
+ if (now >= actor->time_start_animation
&& actor->time_start_animation > 0
/* && now - actor->time_start_animation <= actor->duration_animation*/){
pfunc = actor->func_change;
- if (pfunc){
+ if (pfunc){
(*pfunc)(actor, desktop_plugin);
stop_flag = FALSE;
}
void
run_long_timeout(AWallpaperPlugin *desktop_plugin)
{
-
- gint daytime = get_daytime();
+ gint daytime = get_daytime();
GSList * tmp;
void (*pfunc)(gpointer, gpointer);
time_t now;
tmp = g_slist_next(tmp);
}
}
-
+
now = time(NULL);
//fprintf(stderr, "Now %d\n", now);
tmp = desktop_plugin->priv->scene->actors;
while (tmp != NULL){
actor = tmp->data;
- if (now >= actor->time_start_animation
+ if (now >= actor->time_start_animation
&& actor->time_start_animation > 0
&& desktop_plugin->priv->short_timer == 0){
/* fprintf(stderr, "start short timer act = %s %d\n", actor->name, now); */
}
tmp = g_slist_next(tmp);
}
-
+
}
/*******************************************************************************/
gboolean
gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
desktop_plugin->priv->pipeline = NULL;
}
- return TRUE;
+ return TRUE;
}
if (desktop_plugin->priv->long_timer == 0 )
HildonProgram *app;
int view = 1;
-
- if (argc == 2)
+
+ if (argc == 2)
view = atoi(argv[1]);
if (view < 1 || view > 9)
view = 1;
AWallpaperPlugin *desktop_plugin = g_new0 (AWallpaperPlugin, 1);
Animation_WallpaperPrivate *priv = g_new0 (Animation_WallpaperPrivate, 1);
- desktop_plugin->priv = priv;
+ desktop_plugin->priv = priv;
/* Ininitializing */
hildon_gtk_init (&argc, &argv);
app = HILDON_PROGRAM (hildon_program_get_instance());
g_set_application_name (PACKAGE);
-
+
priv->osso = osso_initialize("org.maemo.livewp", VERSION, TRUE, NULL);
if(!priv->osso){
fprintf(stderr,"osso_initialize failed\n");
/* Check activity of opition "One theme in all views" */
if (priv->one_in_all_view && view >1)
- return -1;
+ return -1;
- if (current_active_view() == view && !priv->one_in_all_view)
+ if (current_active_view() == view && !priv->one_in_all_view)
priv->visible = TRUE;
- else
+ else
priv->visible = FALSE;
create_xwindow(priv);
/* Initialize DBUS */
livewp_initialize_dbus(priv);
-
- priv->view_notify = 0;
+
+ priv->view_notify = 0;
/* fprintf(stderr,"VISIBLE %i %i\n",priv->visible, current_active_view()); */
gconf_client_add_dir(gconf_client_get_default (), "/apps/osso/hildon-desktop/views", GCONF_CLIENT_PRELOAD_NONE, NULL);
priv->view_notify = gconf_client_notify_add(gconf_client_get_default (),"/apps/osso/hildon-desktop/views/current",
}
init_scene_theme(desktop_plugin);
-
+
priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
- priv->alive_timer = g_timeout_add(60000*10, (GtkFunction)check_alive_event, priv); /* One per 10 minute */
+ priv->alive_timer = g_timeout_add(60000*10, (GtkFunction)check_alive_event, priv); /* One per 10 minute */
gtk_main();
return 0;
}
/* vim: set sw=4 ts=4 et: */
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
/*******************************************************************************/
-#include "livewp-scene.h"
+#include "livewp-scene.h"
+
/* This code form X11-utils */
Window Window_With_Name( Display *dpy, Window top, char *name)
{
/*******************************************************************************/
-void
+void
destroy_scene(AWallpaperPlugin *desktop_plugin)
{
int status = 0;
-
+
if (desktop_plugin->priv->scene){
GSList * tmp = desktop_plugin->priv->scene->actors;
while (tmp != NULL){
kill (desktop_plugin->priv->podpid, SIGKILL);
}
while (TRUE){
- if (wait(&status) == desktop_plugin->priv->podpid)
+ if (wait(&status) == desktop_plugin->priv->podpid)
break;
- }
+ }
desktop_plugin->priv->podpid = -1;
desktop_plugin->priv->running = FALSE;
}
void
reload_scene(AWallpaperPlugin *desktop_plugin)
{
- fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
+ fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
destroy_scene(desktop_plugin);
fill_priv(desktop_plugin->priv);
- gtk_widget_destroy(desktop_plugin->priv->window);
+ gtk_widget_destroy(desktop_plugin->priv->window);
if (desktop_plugin->priv->one_in_all_view && desktop_plugin->priv->view >1)
- exit(-1);
+ exit(-1);
create_xwindow(desktop_plugin->priv);
init_scene_theme(desktop_plugin);
}
/*******************************************************************************/
-void
+void
init_scene_Accel(AWallpaperPlugin *desktop_plugin)
{
Actor *actor;
gchar *bgfile = NULL;
gint sizes1[4] = {57, 76, 43, 50},
n, j;
-
+
/* fprintf(stderr, "init scene accel\n"); */
scene = g_new0(Scene, 1);
scene->actors = NULL;
desktop_plugin->priv->scene = scene;
-
+
bgfile = g_strdup_printf("/home/user/.backgrounds/background-%i.png", desktop_plugin->priv->view);
- actor = init_object(desktop_plugin, "original", bgfile,
- 0, 0, 0, 800, 480,
- TRUE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "original", bgfile,
+ 0, 0, 0, 800, 480,
+ TRUE, TRUE, 100, 255,
NULL, NULL, NULL);
scene->actors = g_slist_append(scene->actors, actor);
child = g_ptr_array_sized_new(16);
-
+
for (j= 0; j<4; j++){
for (n=0; n<4; n++){
str = g_strdup_printf("tape%i.png", n+1);
g_free(str);
}
}
- actor = init_object(desktop_plugin, "tape", "",
- 0, 800, 5, 800, 170,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "tape", "",
+ 0, 800, 5, 800, 170,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_tape, NULL, child);
actor->time_start_animation = now;
actor->duration_animation = G_MAXINT;
run_long_timeout(desktop_plugin);
}
/*******************************************************************************/
-void
+void
parsestring(char *line, char **argv)
{
- while (*line != '\0') {
+ while (*line != '\0') {
while (*line == ' ' || *line == '\n')
*line++ = '\0'; /* replace white spaces with 0 */
*argv++ = line; /* save the argument position */
- while (*line != '\0' && *line != ' ' &&
- *line != '\n')
+ while (*line != '\0' && *line != ' ' &&
+ *line != '\n')
line++; /* skip the argument until ... */
}
*argv = '\0'; /* mark the end of argument list */
}
#if 0
-GstBusSyncReply
+GstBusSyncReply
sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
if (!desktop_plugin->priv->visible)
{
switch (GST_MESSAGE_TYPE (msg))
{
- case GST_MESSAGE_EOS:
+ case GST_MESSAGE_EOS:
if (desktop_plugin->priv->rich_animation){
GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
- (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
+ (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
fprintf(stderr,"ERROR in seek\n");
if (desktop_plugin->priv->pipeline){
gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
- }
+ }
}
break;
case GST_MESSAGE_ERROR: break;
Window id_xwindow;
if (!desktop_plugin->priv->visible)
return;
-
+
exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
gtk_socket_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "gtk_socket_id"));
addedstring = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "added_string"));
- if (!exec_path)
+ if (!exec_path)
return;
if (window_id){
strwin = g_strdup_printf(" %s %i", window_id, (gint)GDK_WINDOW_XID(desktop_plugin->priv->window->window));
/* Do 10 trying to search of window */
for (i=0; i<10; i++){
sleep(1);
- id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
+ id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
window_name);
fprintf(stderr,"name %s %i %i\n", window_name, id_xwindow, i);
if (id_xwindow>0){
if (desktop_plugin->priv->one_in_all_view)
- set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
+ set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
id_xwindow, -1);
else
- set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
+ set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
id_xwindow, desktop_plugin->priv->view);
/* gtk_widget_destroy(desktop_plugin->priv->window); */
break;
}
}
/*******************************************************************************/
-gboolean
+gboolean
cb_timeout0(AWallpaperPlugin *desktop_plugin) {
if (!desktop_plugin || !desktop_plugin->priv->pipeline)
return FALSE;
if (desktop_plugin->priv->theme_int_parametr1 == 0){
if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
- GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
+ GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
fprintf(stderr,"Error in seek:\n");
return FALSE;
}
-
- if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
+
+ if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
return TRUE;
else{
if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
- GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
+ GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
fprintf(stderr,"Error in seek:\n");
return FALSE;
}
-}
+}
/*******************************************************************************/
void
init_scene_Video(AWallpaperPlugin *desktop_plugin)
{
- GstElement *bin;
- GstElement *videosink;
+ GstElement *bin;
+ GstElement *videosink;
gchar *file_plus_uri;
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
if (desktop_plugin->priv->visible){
- g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
+ g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
}
-
+
//gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
}
/*******************************************************************************/
void
-init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
+init_scene_Slideshow(AWallpaperPlugin *desktop_plugin)
{
- Actor *actor;
- Scene *scene;
- GPtrArray *child;
- gint now = time(NULL);
- gint y1, y2;
-
- if (desktop_plugin->priv->rich_animation){
- y1 = -480;
- y2 = -480-480;
- }else {
- y1 = 0;
- y2 = -480;
- }
-
- /* fprintf(stderr, "init scene2 \n"); */
- scene = g_new0(Scene, 1);
- //scene.daytime = get_daytime();
- scene->actors = NULL;
- desktop_plugin->priv->scene = scene;
-
- actor = init_object(desktop_plugin, "background", "bg.png",
- 0, 0, 5, 800, 480,
- TRUE, TRUE, 100, 255,
- NULL, NULL, NULL);
- scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "symbols", "symbols.png",
- 0, 0, 10, 800, 480,
- TRUE, TRUE, 100, 255,
- NULL, NULL, NULL);
- scene->actors = g_slist_append(scene->actors, actor);
-
- child = g_ptr_array_sized_new(4);
- actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
- 0, y1, 6, 800, 960,
- TRUE, TRUE, 100, 255,
- NULL, NULL, NULL);
- //actor->time_start_animation = now;
- //actor->duration_animation = G_MAXINT;
- scene->actors = g_slist_append(scene->actors, actor);
- g_ptr_array_add(child, actor);
-
- actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
- 0, y2, 7, 800, 960,
- TRUE, TRUE, 100, 255,
- NULL, NULL, NULL);
- //actor->time_start_animation = now;
- //actor->duration_animation = G_MAXINT;
- scene->actors = g_slist_append(scene->actors, actor);
- g_ptr_array_add(child, actor);
-
- actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
- 0, y1, 8, 800, 960,
- TRUE, TRUE, 100, 255,
- NULL, NULL, NULL);
- //actor->time_start_animation = now;
- //actor->duration_animation = G_MAXINT;
- scene->actors = g_slist_append(scene->actors, actor);
- g_ptr_array_add(child, actor);
+ gchar *ext, *file, *str;
+ Dirent *dp;
+ DIR *dir_fd;
+ int i;
+ Actor *actor;
+ Scene *scene;
+ GPtrArray *child;
+ gint now = time(NULL);
+ GSList *store = NULL;
+ gint num = 0;
+
+ fprintf(stderr, "init scene Slideshow %d %s\n", desktop_plugin->priv->theme_int_parametr1,
+ desktop_plugin->priv->theme_string_parametr1);
+
+ scene = g_new0(Scene, 1);
+ scene->actors = NULL;
+ desktop_plugin->priv->scene = scene;
+
+ dir_fd = opendir(desktop_plugin->priv->theme_string_parametr1);
+ if(dir_fd){
+ while((dp = readdir(dir_fd))){
+ if(!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
+ continue;
+
+ ext = strrchr(dp->d_name, '.') + 1; /* get file extension */
+ if (!ext) continue;
+ /* lowercase string */
+ for(i=0; ext[i]; i++)
+ ext[i] = tolower(ext[i]);
+ if (strcmp(ext, "jpg") && strcmp(ext, "png"))
+ continue;
+ if(dp->d_type == DT_REG || dp->d_type == DT_LNK){
+ str = g_strdup_printf("%s/%s", desktop_plugin->priv->theme_string_parametr1, dp->d_name);
+ store = g_slist_append(store, str);
+ num++;
+ }
+ }
+ closedir(dir_fd);
+ }
- actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
- 0, y2, 9, 800, 960,
- TRUE, TRUE, 100, 255,
- NULL, NULL, NULL);
- //actor->time_start_animation = now;
- //actor->duration_animation = G_MAXINT;
- scene->actors = g_slist_append(scene->actors, actor);
- g_ptr_array_add(child, actor);
+ child = g_ptr_array_sized_new(num);
+ while (store){
+ actor = init_object(desktop_plugin, "original", store->data,
+ 0, 0, 5, 800, 480,
+ FALSE, FALSE, 100, 0,
+ NULL, NULL, NULL);
+ scene->actors = g_slist_append(scene->actors, actor);
+ g_ptr_array_add(child, actor);
+ store = g_slist_next(store);
+ }
+ actor = init_object(desktop_plugin, "images", "",
+ 0, 0, -1, 800, 480,
+ FALSE, FALSE, num, -1,
+ (gpointer)&change_slideshow, NULL, child);
+ actor->time_start_animation = now;
+ actor->duration_animation = 5;
+ scene->actors = g_slist_append(scene->actors, actor);
+ desktop_plugin->priv->rich_animation = TRUE;
+ run_long_timeout(desktop_plugin);
- actor = init_object(desktop_plugin, "layers", "",
- 0, y2, 9, 800, 960,
- FALSE, FALSE, 100, 255,
- (gpointer)&change_layer, NULL, child);
- actor->time_start_animation = now;
- actor->duration_animation = G_MAXINT;
- scene->actors = g_slist_append(scene->actors, actor);
+}
+/*******************************************************************************/
+void
+init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
+{
+ Actor *actor;
+ Scene *scene;
+ GPtrArray *child;
+ gint now = time(NULL);
+ gint y1, y2;
+
+ if (desktop_plugin->priv->rich_animation){
+ y1 = -480;
+ y2 = -480-480;
+ }else {
+ y1 = 0;
+ y2 = -480;
+ }
- run_long_timeout(desktop_plugin);
+ /* fprintf(stderr, "init scene matrix \n"); */
+ scene = g_new0(Scene, 1);
+ //scene.daytime = get_daytime();
+ scene->actors = NULL;
+ desktop_plugin->priv->scene = scene;
+
+ actor = init_object(desktop_plugin, "background", "bg.png",
+ 0, 0, 5, 800, 480,
+ TRUE, TRUE, 100, 255,
+ NULL, NULL, NULL);
+ scene->actors = g_slist_append(scene->actors, actor);
+
+ actor = init_object(desktop_plugin, "symbols", "symbols.png",
+ 0, 0, 10, 800, 480,
+ TRUE, TRUE, 100, 255,
+ NULL, NULL, NULL);
+ scene->actors = g_slist_append(scene->actors, actor);
+
+ child = g_ptr_array_sized_new(4);
+ actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
+ 0, y1, 6, 800, 960,
+ TRUE, TRUE, 100, 255,
+ NULL, NULL, NULL);
+ //actor->time_start_animation = now;
+ //actor->duration_animation = G_MAXINT;
+ scene->actors = g_slist_append(scene->actors, actor);
+ g_ptr_array_add(child, actor);
+
+ actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
+ 0, y2, 7, 800, 960,
+ TRUE, TRUE, 100, 255,
+ NULL, NULL, NULL);
+ //actor->time_start_animation = now;
+ //actor->duration_animation = G_MAXINT;
+ scene->actors = g_slist_append(scene->actors, actor);
+ g_ptr_array_add(child, actor);
+
+ actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
+ 0, y1, 8, 800, 960,
+ TRUE, TRUE, 100, 255,
+ NULL, NULL, NULL);
+ //actor->time_start_animation = now;
+ //actor->duration_animation = G_MAXINT;
+ scene->actors = g_slist_append(scene->actors, actor);
+ g_ptr_array_add(child, actor);
+
+ actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
+ 0, y2, 9, 800, 960,
+ TRUE, TRUE, 100, 255,
+ NULL, NULL, NULL);
+ //actor->time_start_animation = now;
+ //actor->duration_animation = G_MAXINT;
+ scene->actors = g_slist_append(scene->actors, actor);
+ g_ptr_array_add(child, actor);
+
+ actor = init_object(desktop_plugin, "layers", "",
+ 0, y2, 9, 800, 960,
+ FALSE, FALSE, 100, 255,
+ (gpointer)&change_layer, NULL, child);
+ actor->time_start_animation = now;
+ actor->duration_animation = G_MAXINT;
+ scene->actors = g_slist_append(scene->actors, actor);
+
+ run_long_timeout(desktop_plugin);
}
/*******************************************************************************/
gint now = time(NULL);
gint i;
gint winds[13][2];
- GPtrArray *child;
+ GPtrArray *child;
/* fprintf(stderr, "init scene \n"); */
scene = g_new0(Scene, 1);
scene->seed = time(NULL);
scene->notification = TRUE;
desktop_plugin->priv->scene = scene;
- actor = init_object(desktop_plugin, "sky", "sky0.png",
- 0, 0, 5, 800, 480,
- TRUE , TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "sky", "sky0.png",
+ 0, 0, 5, 800, 480,
+ TRUE , TRUE, 100, 255,
(gpointer)&change_static_actor, NULL, NULL);
scene->actors = g_slist_append(scene->actors, actor);
change_static_actor(actor, desktop_plugin);
-
- actor = init_object(desktop_plugin, "sun", "sun.png",
- 0, 0, 6, 88, 88,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "sun", "sun.png",
+ 0, 0, 6, 88, 88,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_sun, NULL, NULL);
actor->time_start_animation = now;
actor->duration_animation = G_MAXINT;
change_sun(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
- //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
+ //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
// TRUE, 100, 255, NULL, NULL);
//scene.actors = g_slist_append(scene.actors, actor);
-
- actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
- 0, fast_rnd(300)-97, 7, 150, 97,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
+ 0, fast_rnd(300)-97, 7, 150, 97,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_cloud, NULL, NULL);
actor->time_start_animation = now + fast_rnd(20);
actor->duration_animation = 3*60;
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
- 0, fast_rnd(300)-75, 7, 188, 75,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
+ 0, fast_rnd(300)-75, 7, 188, 75,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_cloud, NULL, NULL);
actor->time_start_animation = now + fast_rnd(40)+10;
actor->duration_animation = 3*60;
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
- 0, fast_rnd(300)-75, 7, 150, 75,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
+ 0, fast_rnd(300)-75, 7, 150, 75,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_cloud, NULL, NULL);
actor->time_start_animation = now + fast_rnd(60) + 20;
actor->duration_animation = 5*60;
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "town", "town0.png",
- 0, 0, 8, 800, 480,
- TRUE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "town", "town0.png",
+ 0, 0, 8, 800, 480,
+ TRUE, TRUE, 100, 255,
(gpointer)&change_static_actor, NULL, NULL);
change_static_actor(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "stend", "stend0.png",
- 452, 166, 9, 300, 305,
- TRUE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "stend", "stend0.png",
+ 452, 166, 9, 300, 305,
+ TRUE, TRUE, 100, 255,
(gpointer)&change_static_actor, NULL, NULL);
change_static_actor(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
child = g_ptr_array_sized_new(4);
- actor = init_object(desktop_plugin, "call", "call.png",
- 480, 190, 9, 50, 58,
- FALSE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "call", "call.png",
+ 480, 190, 9, 50, 58,
+ FALSE, TRUE, 100, 255,
NULL, NULL, NULL);
scene->actors = g_slist_append(scene->actors, actor);
g_ptr_array_add(child, actor);
- actor = init_object(desktop_plugin, "chat", "chat.png",
- 540, 190, 9, 50, 58,
- FALSE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "chat", "chat.png",
+ 540, 190, 9, 50, 58,
+ FALSE, TRUE, 100, 255,
NULL, NULL, NULL);
scene->actors = g_slist_append(scene->actors, actor);
g_ptr_array_add(child, actor);
- actor = init_object(desktop_plugin, "mail", "mail.png",
- 600, 190, 9, 50, 58,
- FALSE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "mail", "mail.png",
+ 600, 190, 9, 50, 58,
+ FALSE, TRUE, 100, 255,
NULL, NULL, NULL);
scene->actors = g_slist_append(scene->actors, actor);
g_ptr_array_add(child, actor);
-
- actor = init_object(desktop_plugin, "sms", "sms.png",
- 660, 190, 9, 50, 58,
- FALSE, TRUE, 100, 255,
+
+ actor = init_object(desktop_plugin, "sms", "sms.png",
+ 660, 190, 9, 50, 58,
+ FALSE, TRUE, 100, 255,
NULL, NULL, NULL);
scene->actors = g_slist_append(scene->actors, actor);
g_ptr_array_add(child, actor);
change_billboard(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "tram", "tram.png",
- -300, 225, 10, 350, 210,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "tram", "tram.png",
+ -300, 225, 10, 350, 210,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_tram, NULL, NULL);
- actor->time_start_animation = time(NULL) + fast_rnd(10);
+ actor->time_start_animation = time(NULL) + fast_rnd(10);
actor->duration_animation = 60;
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "border", "border0.png",
+ actor = init_object(desktop_plugin, "border", "border0.png",
0, 480-79, 11, 800, 79,
- TRUE, TRUE, 100, 255,
+ TRUE, TRUE, 100, 255,
(gpointer)&change_static_actor_with_corner, NULL, NULL);
change_static_actor_with_corner(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "moon", "moon1.png",
- 400, 20, 6, 60, 60,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "moon", "moon1.png",
+ 400, 20, 6, 60, 60,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_moon, NULL, NULL);
change_moon(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "wind", "",
- 0, 0, 5, 0, 0,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "wind", "",
+ 0, 0, 5, 0, 0,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_wind, NULL, NULL);
change_wind(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
winds[3][0] = 495;
winds[3][1] = 190;
-
+
winds[4][0] = 482;
winds[4][1] = 201;
-
+
winds[5][0] = 495;
winds[5][1] = 210;
-
+
winds[6][0] = 482;
winds[6][1] = 222;
-
+
winds[7][0] = 495;
winds[7][1] = 221;
-
+
winds[8][0] = 459;
winds[8][1] = 203;
-
+
winds[9][0] = 495;
winds[9][1] = 241;
-
+
winds[10][0] = 495;
winds[10][1] = 252;
-
+
winds[11][0] = 482;
winds[11][1] = 273;
-
+
winds[12][0] = 495;
winds[12][1] = 303;
for (i=0; i<13; i++){
- actor = init_object(desktop_plugin, "window1", "window1.png",
- winds[i][0], winds[i][1], 8, 8, 10,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "window1", "window1.png",
+ winds[i][0], winds[i][1], 8, 8, 10,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_window1, NULL, NULL);
//change_window1(actor, desktop_plugin);
actor->time_start_animation = now + fast_rnd(30);
scene->actors = g_slist_append(scene->actors, actor);
}
-
+
/* windows in 1-th house */
-
+
winds[0][0] = 86;
winds[0][1] = 321;
winds[3][0] = 86;
winds[3][1] = 286;
-
+
winds[4][0] = 94;
winds[4][1] = 232;
-
+
winds[5][0] = 94;
winds[5][1] = 243;
-
+
winds[6][0] = 94;
winds[6][1] = 265;
-
+
winds[7][0] = 94;
winds[7][1] = 331;
for (i=0; i<8; i++){
- actor = init_object(desktop_plugin, "window2", "window2.png",
- winds[i][0], winds[i][1], 8, 8, 10,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "window2", "window2.png",
+ winds[i][0], winds[i][1], 8, 8, 10,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_window1, NULL, NULL);
//change_window1(actor, desktop_plugin);
actor->time_start_animation = now + fast_rnd(30);
scene->actors = g_slist_append(scene->actors, actor);
}
-
+
/* windows in 3-th house */
-
+
winds[0][0] = 251;
winds[0][1] = 162;
winds[3][0] = 251;
winds[3][1] = 289;
-
+
winds[4][0] = 313;
winds[4][1] = 173;
-
+
winds[5][0] = 322;
winds[5][1] = 160;
-
+
winds[6][0] = 303;
winds[6][1] = 217;
-
+
winds[7][0] = 322;
winds[7][1] = 224;
-
+
winds[8][0] = 323;
winds[8][1] = 217;
-
+
winds[9][0] = 322;
winds[9][1] = 288;
-
+
for (i=0; i<10; i++){
- actor = init_object(desktop_plugin, "window3", "window3.png",
- winds[i][0], winds[i][1], 8, 8, 10,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "window3", "window3.png",
+ winds[i][0], winds[i][1], 8, 8, 10,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_window1, NULL, NULL);
//change_window1(actor, desktop_plugin);
actor->time_start_animation = now + fast_rnd(30);
}
/* windows in 5-th house */
-
+
winds[0][0] = 610;
winds[0][1] = 224;
winds[3][0] = 610;
winds[3][1] = 301;
-
+
winds[4][0] = 610;
winds[4][1] = 320;
-
+
winds[5][0] = 593;
winds[5][1] = 352;
-
+
winds[6][0] = 610;
winds[6][1] = 368;
-
+
for (i=0; i<7; i++){
- actor = init_object(desktop_plugin, "window4", "window4.png",
- winds[i][0], winds[i][1], 8, 8, 10,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "window4", "window4.png",
+ winds[i][0], winds[i][1], 8, 8, 10,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_window1, NULL, NULL);
//change_window1(actor, desktop_plugin);
actor->time_start_animation = now + fast_rnd(30);
}
/* windows in 6-th house */
-
+
winds[0][0] = 717;
winds[0][1] = 283;
winds[3][0] = 717;
winds[3][1] = 323;
-
+
winds[4][0] = 698;
winds[4][1] = 362;
-
+
winds[5][0] = 698;
winds[5][1] = 400;
-
+
for (i=0; i<6; i++){
- actor = init_object(desktop_plugin, "window5", "window5.png",
- winds[i][0], winds[i][1], 8, 8, 10,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "window5", "window5.png",
+ winds[i][0], winds[i][1], 8, 8, 10,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_window1, NULL, NULL);
//change_window1(actor, desktop_plugin);
actor->time_start_animation = now + fast_rnd(30);
}
run_long_timeout(desktop_plugin);
-#if 0
+#if 0
anim = g_new0(Animation, 1);
anim->count = 1;
anim->actor = actor;
anim->func_change = &change_tram;
anim->func_time = NULL;
- anim->timestart = time(NULL);
+ anim->timestart = time(NULL);
anim->timeall = 10;
-
+
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
-#endif
+#endif
}
/*******************************************************************************/
/* Init Berlin Scene */
Actor *actor, *actor1, *actor2;
Scene *scene;
gint now = time(NULL);
- gint i;
+ gint i;
gint winds[13][2];
GPtrArray *child = NULL;
/* init value for random */
scene->seed = time(NULL);
desktop_plugin->priv->scene = scene;
-
- actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
- TRUE, TRUE, 100, 255,
+
+ actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
+ TRUE, TRUE, 100, 255,
(gpointer)&change_static_actor, NULL, NULL);
change_static_actor(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_sun, NULL, NULL);
actor->time_start_animation = time(NULL);
actor->duration_animation = G_MAXINT;
scene->actors = g_slist_append(scene->actors, actor);
#if 0
- actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
+ actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
TRUE, 100, 255, NULL, NULL);
scene.actors = g_slist_append(scene.actors, actor);
#endif
- actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_moon, NULL, NULL);
change_moon(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_cloud, NULL, NULL);
actor->time_start_animation = now + fast_rnd(30) + 10;
actor->duration_animation = 3*60;
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_cloud, NULL, NULL);
actor->time_start_animation = now + fast_rnd(10);
actor->duration_animation = 3*60;
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_cloud, NULL, NULL);
actor->time_start_animation = now + fast_rnd(60) + 20;
actor->duration_animation = 5*60;
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_plane2, NULL, NULL);
actor->time_start_animation = now + fast_rnd(40) + 20;
actor->duration_animation = 60;
scene->actors = g_slist_append(scene->actors, actor);
-
- actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
- FALSE, FALSE, 100, 255,
+
+ actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_plane1, NULL, NULL);
actor->time_start_animation = now + fast_rnd(20);
actor->duration_animation = 30;
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
- TRUE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
+ TRUE, TRUE, 100, 255,
(gpointer)&change_static_actor_with_corner, NULL, NULL);
change_static_actor_with_corner(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
- actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
- FALSE, FALSE, 100, 255,
+ actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_wind, NULL, NULL);
change_wind(actor, desktop_plugin);
scene->actors = g_slist_append(scene->actors, actor);
- actor1 = init_object(desktop_plugin, "signal_red", "red.png",
- 486, 425, 10, 18, 38,
+ actor1 = init_object(desktop_plugin, "signal_red", "red.png",
+ 486, 425, 10, 18, 38,
FALSE, TRUE, 100, 255, NULL, NULL, NULL);
- //actor->time_start_animation = now + fast_rnd(30) + 10;
+ //actor->time_start_animation = now + fast_rnd(30) + 10;
scene->actors = g_slist_append(scene->actors, actor1);
-
- actor2 = init_object(desktop_plugin, "signal_green", "green.png",
- 486, 425, 10, 18, 38,
+
+ actor2 = init_object(desktop_plugin, "signal_green", "green.png",
+ 486, 425, 10, 18, 38,
TRUE, TRUE, 100, 255, NULL, NULL, NULL);
- //actor->time_start_animation = now + fast_rnd(30) + 10;
+ //actor->time_start_animation = now + fast_rnd(30) + 10;
scene->actors = g_slist_append(scene->actors, actor2);
child = g_ptr_array_sized_new(2);
g_ptr_array_add(child, actor1);
g_ptr_array_add(child, actor2);
actor = init_object(desktop_plugin, "signal", "",
486, 425, 10, 18, 38,
- FALSE, FALSE, 100, 255,
+ FALSE, FALSE, 100, 255,
(gpointer)&change_signal, NULL, child);
actor->time_start_animation = now + fast_rnd(30) + 10;
scene->actors = g_slist_append(scene->actors, actor);
-
+
winds[0][0] = 389;
winds[0][1] = 305;
winds[3][0] = 356;
winds[3][1] = 288;
-
+
winds[4][0] = 337;
winds[4][1] = 269;
-
+
winds[5][0] = 372;
winds[5][1] = 268;
-
+
winds[6][0] = 372;
winds[6][1] = 249;
-
+
winds[7][0] = 388;
winds[7][1] = 249;
-
+
winds[8][0] = 387;
winds[8][1] = 230;
-
+
winds[9][0] = 372;
winds[9][1] = 211;
-
+
winds[10][0] = 355;
winds[10][1] = 159;
-
+
winds[11][0] = 335;
winds[11][1] = 158;
-
+
winds[12][0] = 386;
winds[12][1] = 119;
-
+
for (i=0; i<13; i++){
- actor = init_object(desktop_plugin, "window", "window.png",
- winds[i][0], winds[i][1], 10, 8, 9,
- FALSE, TRUE, 100, 255,
+ actor = init_object(desktop_plugin, "window", "window.png",
+ winds[i][0], winds[i][1], 10, 8, 9,
+ FALSE, TRUE, 100, 255,
(gpointer)&change_window1, NULL, NULL);
//change_window1(actor, desktop_plugin);
actor->time_start_animation = now + fast_rnd(30);
scene->actors = g_slist_append(scene->actors, actor);
}
-
+
run_long_timeout(desktop_plugin);
}
/*******************************************************************************/
-void
+void
init_scene_theme(AWallpaperPlugin *desktop_plugin)
{
#if 0
void (*func)(gpointer);
func = desktop_plugin->priv->scene_func;
if (func){
- fprintf(stderr, "Success init_scene_theme\n");
+ fprintf(stderr, "Success init_scene_theme %s\n", desktop_plugin->priv->theme);
(*func)(desktop_plugin);
}
}
/*
* This file is part of Live Wallpaper (livewp)
- *
+ *
* Copyright (C) 2010 Vlad Vasiliev
* Copyright (C) 2010 Tanya Makova
* for the code
- *
+ *
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
#define _livewp_scene_h 1
#include "livewp-common.h"
-#include "livewp-actor.h"
+#include "livewp-actor.h"
#include <sys/time.h>
#include <sys/wait.h>
#include "livewp-rules.h"
#include <glib-object.h>
#include <unistd.h>
#include <X11/Xlib.h>
+#include <dirent.h>
+#include <linux/fs.h>
+typedef struct dirent Dirent;
void fill_priv(Animation_WallpaperPrivate *priv);
void destroy_scene(AWallpaperPlugin *desktop_plugin);
void init_scene_Matrix(AWallpaperPlugin *desktop_plugin);
void init_scene_Accel(AWallpaperPlugin *desktop_plugin);
void init_scene_Video(AWallpaperPlugin *desktop_plugin);
+void init_scene_Slideshow(AWallpaperPlugin *desktop_plugin);
void init_scene_External(AWallpaperPlugin *desktop_plugin);
void init_scene_theme(AWallpaperPlugin *desktop_plugin);
-void create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin);
+void create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin);
void set_live_bg (Display *display, Window xwindow, int mode);
void create_xwindow (Animation_WallpaperPrivate *priv);
#endif
if (!strcmp(choice, _("Flash"))){
additional_parametr_for_theme_flash(vbox, priv);
}
+ if (!strcmp(choice, _("Slideshow"))){
+ additional_parametr_for_theme_slideshow(vbox, priv);
+ }
}
gtk_widget_show(vbox);
hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Matrix"));
hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Accel"));
hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Video"));
- num = 5;
+ hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Slideshow"));
+ num = 6;
if (theme){
if (!strcmp(theme, "Berlin")){
hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 0);
hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 4);
hildon_button_set_value(HILDON_BUTTON(button), _("Video"));
}
+ if (!strcmp(theme, "Slideshow")){
+ hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 5);
+ hildon_button_set_value(HILDON_BUTTON(button), _("Slideshow"));
+ }
}
}
while (store){
hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 0);
hildon_button_set_value(HILDON_BUTTON(button), "LiveWallpaper");
}
+ if (!strcmp(theme, "Slideshow")){
+ hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 0);
+ hildon_button_set_value(HILDON_BUTTON(button), "LiveWallpaper");
+ }
GSList *store = priv->extheme_list;
num = 1;
while (store){
}
return button;
}
-
+/*******************************************************************************/
+GtkWidget *
+create_time_button (guint *active, gchar *name)
+{
+ GtkWidget *button;
+ GtkWidget *selector;
+ guint values[5] = {20, 40, 60, 120, 300};
+ int i, num = 0;
+ gchar *str;
+
+ button = hildon_picker_button_new (HILDON_SIZE_FINGER_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL);
+ hildon_button_set_title (HILDON_BUTTON (button), name);
+
+ selector = hildon_touch_selector_new_text();
+ for (i=0; i<5; i++){
+ str = g_strdup_printf("%d", values[i]);
+ hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), str);
+ if (values[i] == active) num = i;
+ }
+ hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
+ HILDON_TOUCH_SELECTOR (selector));
+ hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, num);
+ if (active){
+ str = g_strdup_printf("%d", active);
+ hildon_button_set_value(HILDON_BUTTON(button), str);
+ }else
+ hildon_button_set_value(HILDON_BUTTON(button), "");
+ return button;
+}
/*******************************************************************************/
GtkWidget *
create_bool_button (gboolean active, gchar *name)
GSList *stlist = NULL;
GConfClient *gconf_client = NULL;
GConfValue *value = NULL;
- guint count_of_view = 1;
+ guint count_of_view = 1;
guint i;
if (hbox){
gtk_widget_destroy(hbox);
}
-
+
hbox = gtk_hbox_new(FALSE, 0);
g_object_set_data(G_OBJECT(priv->window), "custom_hbox", hbox);
gtk_box_pack_start(GTK_BOX(area_hbox),
gtk_box_pack_start(GTK_BOX(hbox),
theme_button, TRUE, TRUE, 10);
gtk_widget_show (theme_button);
- }
+ }
}
/*******************************************************************************/
void
}
/*******************************************************************************/
void
+folder_button_clicked(GtkButton *button, Animation_WallpaperPrivate *priv){
+
+ GtkWidget *dialog = hildon_file_chooser_dialog_new(GTK_WINDOW (priv->window), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
+
+ if (priv->theme_string_parametr1)
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), priv->theme_string_parametr1);
+
+ gtk_widget_show_all (GTK_WIDGET (dialog));
+
+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
+ {
+ hildon_button_set_value (HILDON_BUTTON(button), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
+ }
+ gtk_widget_destroy (dialog);
+
+}
+/*******************************************************************************/
+void
rich_animation_additional_parametr(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
GtkWidget *rich_animation_button;
gtk_widget_show (file_button);
}
/*******************************************************************************/
+void
+additional_parametr_for_theme_slideshow(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
+
+ GtkWidget *file_button;
+ GtkWidget *time_button;
+
+ if (priv->theme_string_parametr1)
+ file_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+ _("Folder with images"), priv->theme_string_parametr1);
+ else
+ file_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT,HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+ _("Folder with images")," ");
+
+ g_signal_connect (file_button, "clicked", G_CALLBACK (folder_button_clicked), priv);
+
+ gtk_box_pack_start(GTK_BOX(vbox), file_button, TRUE, TRUE, 5);
+ g_object_set_data(G_OBJECT(priv->window), "filename_button", file_button);
+
+ if (priv->theme_int_parametr1)
+ time_button = create_time_button(priv->theme_int_parametr1, _("Time to change image"));
+ else
+ time_button = create_time_button(0, _("Time to change image"));
+ gtk_box_pack_start(GTK_BOX(vbox), time_button, TRUE, TRUE, 5);
+ g_object_set_data(G_OBJECT(priv->window), "time_button", time_button);
+
+ gtk_widget_show (time_button);
+ gtk_widget_show (file_button);
+}
+/*******************************************************************************/
void
show_problem_package (GtkWidget *widget, gchar *package_name){
GtkWidget *vbox;
GtkWidget *area_vbox;
GtkWidget *temp_button;
- GtkWidget *button1 = NULL;
+ GtkWidget *button1 = NULL, *button2 = NULL;
GtkWidget *rich_animation_button = NULL;
GtkWidget *confirm;
gint view = priv->view;
- gint count;
+ gint count, int_param;
gchar *text;
window = gtk_dialog_new();
/* Check theme */
if (hildon_button_get_value(HILDON_BUTTON (theme_button)) &&
strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "")){
-#if 0
- /* Check Xsnow program */
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Xsnow"))){
- if (access("/usr/bin/xsnow", F_OK) != 0){
- show_problem_package(button, "Xsnow");
- /* if not scuccess exit from wthout saving */
- break;
- }
- }
- /* Check Shermans program */
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "Shermans Aquarium")){
- if (access("/usr/bin/shermans", F_OK) != 0){
- show_problem_package(button,"'Sherman's Aquarium'");
- /* if not scuccess exit from wthout saving */
- break;
- }
- }
- /* Check Conky program */
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "Conky")){
- if (access("/usr/bin/conky", F_OK) != 0){
- show_problem_package(button,"'Conky'");
- /* if not scuccess exit from wthout saving */
- break;
- }
- }
- /* Check Orrery program */
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "Orrery")){
- if (access("/opt/maemo/usr/bin/orrery", F_OK) != 0){
- show_problem_package(button,"'Orrery'");
- /* if not scuccess exit from wthout saving */
- break;
- }
- }
- /* Check CrazyChickens program */
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "CrazyChickens")){
- if (access("/usr/bin/crazychickens", F_OK) != 0){
- show_problem_package(button,"'Crazy Chickens'");
- /* if not scuccess exit from wthout saving */
- break;
- }
- }
- /* Check Colorflood program */
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "Colorflood")){
- if (access("/usr/bin/colorflood", F_OK) != 0){
- show_problem_package(button,"'Colorflood'");
- /* if not scuccess exit from wthout saving */
- break;
- }
- }
-#endif
if (priv->theme_string_parametr1){
g_free(priv->theme_string_parametr1);
priv->theme_string_parametr1 = NULL;
priv->theme_string_parametr1 = g_strdup((gchar*)hildon_button_get_value (HILDON_BUTTON(button1)));
}
}
+ if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Slideshow"))){
+ priv->theme = g_strdup("Slideshow");
+ button1 = g_object_get_data(G_OBJECT(priv->window), "filename_button");
+ if (button1){
+ if (priv->theme_string_parametr1)
+ g_free(priv->theme_string_parametr1);
+ priv->theme_string_parametr1 = g_strdup((gchar*)hildon_button_get_value (HILDON_BUTTON(button1)));
+ }
+ button2 = g_object_get_data(G_OBJECT(priv->window), "time_button");
+ if (button2){
+ //if (priv->theme_int_parametr1)
+ // g_free(priv->theme_int_parametr1);
+ int_param = atoi(hildon_button_get_value (HILDON_BUTTON(button2)));
+ priv->theme_int_parametr1 = int_param;
+ }
+ }
/* Check external themes */
GSList *store = priv->extheme_list;
while (store){
}
store = g_slist_next(store);
}
-
+ fprintf(stderr, "theme = %s\n", priv->theme);
}
rich_animation_button = g_object_get_data(G_OBJECT(priv->window), "rich_animation_button");