am__DEPENDENCIES_1 =
liblivewp_home_widget_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_liblivewp_home_widget_la_OBJECTS = livewp-home-widget.lo \
- livewp-astro.lo livewp-rules.lo livewp-settings.lo
+ livewp-astro.lo livewp-rules.lo livewp-settings.lo \
+ livewp-multiactor.lo
liblivewp_home_widget_la_OBJECTS = \
$(am_liblivewp_home_widget_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/livewp-astro.Plo \
./$(DEPDIR)/livewp-home-widget.Plo \
+ ./$(DEPDIR)/livewp-multiactor.Plo \
./$(DEPDIR)/livewp-rules.Plo \
./$(DEPDIR)/livewp-settings.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
liblivewp_home_widget_la_SOURCES = livewp-home-widget.c livewp-home-widget.h \
livewp-astro.c livewp-astro.h \
livewp-rules.c livewp-rules.h \
- livewp-settings.c livewp-settings.h livewp-common.h
+ livewp-settings.c livewp-settings.h livewp-common.h \
+ livewp-multiactor.c livewp-multiactor.h
liblivewp_home_widget_la_LIBADD = $(EXAMPLE_LIBS)
AM_CFLAGS = -Wall $(EXAMPLE_CFLAGS)
include ./$(DEPDIR)/livewp-astro.Plo
include ./$(DEPDIR)/livewp-home-widget.Plo
+include ./$(DEPDIR)/livewp-multiactor.Plo
include ./$(DEPDIR)/livewp-rules.Plo
include ./$(DEPDIR)/livewp-settings.Plo
liblivewp_home_widget_la_SOURCES = livewp-home-widget.c livewp-home-widget.h \
livewp-astro.c livewp-astro.h \
livewp-rules.c livewp-rules.h \
- livewp-settings.c livewp-settings.h livewp-common.h
+ livewp-settings.c livewp-settings.h livewp-common.h \
+ livewp-multiactor.c livewp-multiactor.h
liblivewp_home_widget_la_LIBADD = $(EXAMPLE_LIBS)
#include "livewp-home-widget.h"
#include <gconf/gconf-client.h>
#include "livewp-rules.h"
+#include "livewp-multiactor.h"
#define PLUGIN_NAME "livewp-home-widget.desktop-0"
#define GCONF_KEY_POSITION "/apps/osso/hildon-desktop/applets/%s/position"
gint xapplet = 0, yapplet = 0;
GSList * objects_list = NULL;
+MultiActor * multiactor1;
Scene scene;
static void
static GtkWidget*
init_object(gchar * name, gint x, gint y, gint z, gint width, gint height)
{
- Actor a;
GtkWidget *actor;
GdkPixbuf *pixbuf;
GtkWidget *image;
actor = hildon_animation_actor_new();
gchar str[256];
snprintf(str, 255, "/usr/share/anwall/%s.png", name);
- /* fprintf(stderr, "!!!init object !!!!\nname = %s file = %s\n", name, str); */
+ //fprintf(stderr, "!!!init object !!!!\nname = %s file = %s\n", name, str);
pixbuf = gdk_pixbuf_new_from_file_at_size (str,
width,
height,
g_object_set_data(G_OBJECT(actor), "y", y);
g_object_set_data(G_OBJECT(actor), "z", z);
g_object_set_data(G_OBJECT(actor), "scale", 10);
+ g_object_set_data(G_OBJECT(actor), "visible", 1);
+
+ hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (actor), scene.window);
/*
a.widget = actor;
a.name = name;
get_sun_screen_pos(alt, azm, &x, &y);
fprintf(stderr, "init scene\n");
actor = init_object("sun", x, y, 20, 88, 88);
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (actor), window);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
actor = init_object("sky", 0, 0, 0, 800, 480);
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (actor), window);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
actor = init_object("town", 0, 0, 10, 800, 480);
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (actor), window);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
actor = init_object("cloud1", 400, 150, 2, 200, 150);
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (actor), window);
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
+ GSList * list = NULL;
+ actor = init_object("sun", 10, 10, 50, 88, 88);
+ list = g_slist_append(list, G_OBJECT(actor));
+ actor = init_object("cloud1", 50, 50, 49, 150, 100);
+ list = g_slist_append(list, G_OBJECT(actor));
+
+ multiactor1 = multiactor_init("multi", list, 0, 0, 50, 1.0, TRUE);
+ fprintf(stderr, "create multiactor ma=%p name=%s\n", multiactor1, multiactor1->name);
+ //objects_list = g_slist_append(objects_list, G_OBJECT(ma));
+
+
}
void
*y = (int)((1 - alt) * y0) - 64;
}
+void change_multiactor()
+{
+ //fprintf(stderr, "change multiactotr p=%p name= %s x=%d\n", multiactor1, multiactor1->name, multiactor1->x);
+}
+
static void
change_actor(GtkWidget * actor)
{
GSList * tmp;
fprintf(stderr, "on timeout\n");
+ //change_multiactor();
+ //fprintf(stderr, "create multiactor ma=%p name=%s\n", multiactor1, multiactor1->name);
+
if (scene.daytime == daytime){
/* Change dynamic actors */
tmp = scene.dynamic_actors;
--- /dev/null
+/* 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 Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 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-multiactor.h"
+
+MultiActor * multiactor_init(gchar * name, GSList * child, gint x, gint y, gint z, double scale, gboolean visible)
+{
+ MultiActor ma, *p;
+ ma.name = name;
+ ma.child = child;
+ ma.x = x;
+ ma.y = y;
+ ma.z = z;
+ ma.scale = scale;
+ ma.visible = visible;
+
+ p = &ma;
+ fprintf(stderr, "init multiactor p=%p name=%s\n", p, p->name);
+
+ return p;
+}
+
+void multiactor_set_visible(MultiActor *ma, gboolean visible)
+{
+ GSList * tmp = ma->child;
+ gboolean cur_visible;
+ while (tmp != NULL){
+ if (visible == FALSE){
+ // hide all
+ hildon_animate_actor_set_show(tmp->data, visible);
+ }else {
+ // show only needed
+ cur_visible = g_object_get_data(G_OBJECT(tmp->data), "visible");
+ if (cur_visible) hildon_animate_actor_set_show(tmp->data, visible);
+ }
+ tmp = g_slist_next(tmp);
+ }
+ ma->visible = visible;
+}
+void multiactor_set_scale(MultiActor *ma, double scale)
+{
+ GSList * tmp = ma->child;
+ while (tmp != NULL){
+ hildon_animate_actor_set_scale(tmp->data, scale, scale);
+ tmp = g_slist_next(tmp);
+ }
+ ma->scale = scale;
+}
--- /dev/null
+/* 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 Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 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
+*/
+/*******************************************************************************/
+#ifndef _livewp_multiactor_h
+#define _livewp_multiactor_h 1
+/*******************************************************************************/
+#include <glib-object.h>
+
+#include <libhildondesktop/libhildondesktop.h>
+
+typedef struct {
+ gchar * name;
+ GSList * child;
+ gint x;
+ gint y;
+ gint z;
+ double scale;
+ gboolean visible;
+
+} MultiActor;
+/*******************************************************************************/
+MultiActor * multiactor_init(gchar * name, GSList * child, gint x, gint y, gint z, double scale, gboolean visible);
+void multiactor_set_visible(MultiActor *ma, gboolean visible);
+void multiactor_set_scale(MultiActor *ma, double scale);
+#endif