GdkPixbuf *pixbuf = (GdkPixbuf *) data;
cr = gdk_cairo_create(widget->window);
- gdk_cairo_region(cr, event->region);
- cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
- gdk_cairo_set_source_pixbuf(cr, pixbuf, 0.0, 0.0);
- cairo_paint(cr);
- cairo_destroy(cr);
+ if (cr){
+ gdk_cairo_region(cr, event->region);
+ cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+ gdk_cairo_set_source_pixbuf(cr, pixbuf, 0.0, 0.0);
+ cairo_paint(cr);
+ cairo_destroy(cr);
+ }
return TRUE;
}
void
destroy_hildon_actor(Actor *actor)
{
+ fprintf(stderr, "estroy_hildon_actor %p\n",actor->widget);
gtk_widget_destroy(actor->widget);
actor->widget = NULL;
}
if (daytime == TIME_NIGHT){
if (!actor->visible){
actor->visible = TRUE;
-#if 0
phase = get_moon_phase();
- fprintf(stderr, "change moon %d\n", phase);
- fprintf(stderr, "actor name %s\n", actor->name);
- fprintf(stderr, "actor ytghg %s\n", desktop_plugin->priv->theme);
newfile = g_strdup_printf( "%s/%s/%s%d.png", THEME_PATH, desktop_plugin->priv->theme, actor->name, phase);
-#endif
create_hildon_actor(actor, desktop_plugin);
- //actor->filename = newfile;
- //change_hildon_actor(actor, desktop_plugin);
+ actor->filename = newfile;
+ change_hildon_actor(actor, desktop_plugin);
}
//actor->x = 400;
double alt, azm;
gint x, y, z, daytime;
- fprintf(stderr, "change sun %d\n", actor->time_start_animation);
if (actor){
daytime = get_daytime();
if (daytime != TIME_NIGHT){
if (!actor->visible){
actor->visible = TRUE;
- create_hildon_actor(desktop_plugin, actor);
+
+ create_hildon_actor(actor, desktop_plugin);
}
get_sun_pos(&alt, &azm);
get_sun_screen_pos(alt, azm, &x, &y);
actor->y = y;
actor_set_position_full(actor->widget, x, y, actor->z);
probability_sun(actor);
- fprintf(stderr, "after change sun %d\n", actor->time_start_animation);
}else if (actor->visible){
actor->visible = FALSE;
destroy_hildon_actor(actor);
GtkWidget *ha = NULL;
GdkPixbuf *pixbuf = NULL;
GtkWidget *image = NULL;
+ gchar *str;
+ fprintf(stderr, "create_hildon_actor %s\n", actor->name);
ha = hildon_animation_actor_new();
- gchar str[256];
- snprintf(str, 255, "%s/%s/%s", THEME_PATH, desktop_plugin->priv->theme, actor->filename);
- fprintf(stderr, "!!!create ha !!!!file = %s\n", str);
+ 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,
G_CALLBACK(expose_event), pixbuf);
gtk_container_add (GTK_CONTAINER (ha), image);
}
-fprintf(stderr, "creage ha x=%d y=%d z=%d visible=%d w=%i h=>%i ", actor->x, actor->y, actor->z, actor->visible, actor->width, actor->height);
actor_set_position_full(ha, actor->x, actor->y, actor->z);
hildon_animation_actor_set_show (ha, actor->visible);
hildon_animation_actor_set_scale(ha, (double)actor->scale/100, (double)actor->scale/100);
g_object_set_data(G_OBJECT(ha), "func", pfunc);
*/
hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), desktop_plugin);
- fprintf(stderr, "image %p\n", desktop_plugin);
+ fprintf(stderr, "ha %p\n", ha);
actor->widget = ha;
}
change_static_actor(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
gint daytime;
- gchar newfile[2048];
+ gchar *newfile;
if (!actor) return;
daytime = get_daytime();
- fprintf(stderr,"Name %s\n", actor->name);
- fprintf(stderr,"daytime %i\n", daytime);
- fprintf(stderr,"theme %s\n", desktop_plugin->priv->theme);
- snprintf(newfile, 2047, "%s/%s/%s%d.png", THEME_PATH, desktop_plugin->priv->theme, actor->name, daytime);
- fprintf(stderr, "11%s\n", newfile);
+ newfile = g_strdup_printf("%s/%s/%s%d.png", THEME_PATH, desktop_plugin->priv->theme, actor->name, daytime);
actor->filename = newfile;
change_hildon_actor(actor, desktop_plugin);
}
x = path_line(x0, x1, t);
y = path_line(y0, y1, t);
scale = path_line(scale0, scale1, t);
- fprintf(stderr, "path tram: t=%f, x=%d, y=%d, scale=%d\n", t, x, y, scale);
actor_set_position_full(actor, x, y, g_object_get_data(G_OBJECT(actor), "z"));
hildon_animation_actor_set_scale(actor, (double)scale/100, (double)scale/100);
}
GSList * list = NULL;
gchar str[256];
-fprintf(stderr, "init scene modern\n");
+fprintf(stderr, "init scene \n");
scene.daytime = get_daytime();
scene.actors = NULL;
//get_sun_pos(&alt, &azm);