hildon_animation_actor_set_position_full (HILDON_ANIMATION_ACTOR (actor),x-xapplet, y-yapplet, z);
}
+void func(gpointer data)
+{
+ if (data)
+ fprintf(stderr, "11111111111111111 function %s\n", data);
+}
+
static GtkWidget*
-init_object(gchar * name, gint x, gint y, gint z, gint width, gint height)
+init_object(gchar * name, gint x, gint y, gint z, gint width, gint height, void (*pfunc)(gpointer))
{
GtkWidget *actor;
GdkPixbuf *pixbuf;
hildon_animation_actor_set_show (actor, 1);
realize(actor);
gtk_widget_show_all(actor);
-
g_object_set_data(G_OBJECT(actor), "name", name);
g_object_set_data(G_OBJECT(actor), "image", image);
g_object_set_data(G_OBJECT(actor), "x", x);
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);
+ g_object_set_data(G_OBJECT(actor), "func", pfunc);
hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (actor), scene.window);
/*
get_sun_pos(&alt, &azm);
get_sun_screen_pos(alt, azm, &x, &y);
- fprintf(stderr, "init scene\n");
- actor = init_object("sun", x, y, 20, 88, 88);
+ actor = init_object("sun", x, y, 20, 88, 88, &func);
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);
+ actor = init_object("sky", 0, 0, 0, 800, 480, NULL);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
- actor = init_object("town", 0, 0, 10, 800, 480);
+ actor = init_object("town", 0, 0, 10, 800, 480, NULL);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
- actor = init_object("cloud1", 400, 150, 2, 200, 150);
+ actor = init_object("cloud1", 400, 150, 2, 200, 150, NULL);
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
GSList * list = NULL;
- actor = init_object("sun", 10, 10, 50, 88, 88);
+ actor = init_object("sun", 10, 10, 50, 88, 88, NULL);
list = g_slist_append(list, G_OBJECT(actor));
- actor = init_object("cloud1", 50, 50, 49, 150, 100);
+ actor = init_object("cloud1", 50, 50, 49, 150, 100, NULL);
list = g_slist_append(list, G_OBJECT(actor));
ma1 = multiactor_init("multi", list, 0, 0, 50, 1.0, TRUE);
GtkWidget *image;
GdkPixbuf *pixbuf;
+ void (*pfunc)(gpointer);
+
name = g_object_get_data(G_OBJECT(actor), "name");
fprintf(stderr, "change actor %s\n", name);
if (name == "sun"){
+ pfunc = g_object_get_data(G_OBJECT(actor), "func");
+ if (pfunc)
+ (*pfunc)(g_strdup(name));
daytime = get_daytime();
if (daytime != TIME_NIGHT){
hildon_animation_actor_set_show(actor, 1);