yapplet = Ystartposition;
}
g_free (position_key);
- modified = g_strdup_printf ("%ld", 0);
+ modified = g_strdup_printf ("%i", 0);
modified_key = g_strdup_printf (GCONF_KEY_MODIFIED, PLUGIN_NAME);
gconf_client_set_string (gconf_client,
modified_key,
actor->opacity = opacity;
actor->filename = g_strdup(filename);
actor->name = g_strdup(name);
- actor->func_change = pfunc_change;
- actor->func_probability = pfunc_probability;
+ actor->func_change = (gpointer)pfunc_change;
+ actor->func_probability = (gpointer)pfunc_probability;
if (visible)
create_hildon_actor(actor, desktop_plugin);
else
void
change_moon(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
- gint x, y, z, daytime, phase;
+ gint daytime, phase;
char *newfile;
if (actor){
change_sun(Actor * actor, AWallpaperPlugin *desktop_plugin)
{
double alt, azm;
- gint x, y, z, daytime;
+ gint x, y, daytime;
if (actor){
daytime = get_daytime();
scale = path_line(scale0, scale1, t);
//fprintf(stderr, "change tram t=%f x=%d y=%d scale=%d\n", t, x, y, scale);
actor_set_position_full(actor->widget, x, y, actor->z);
- hildon_animation_actor_set_scale(actor->widget, (double)scale/100, (double)scale/100);
+ hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
if (t >= 1){
/* stop animation */
actor->visible = FALSE;
gtk_container_add (GTK_CONTAINER (ha), image);
}
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);
+ hildon_animation_actor_set_show (HILDON_ANIMATION_ACTOR(ha), actor->visible);
+ hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(ha), (double)actor->scale/100, (double)actor->scale/100);
realize(ha);
gtk_widget_show_all(ha);
g_object_set_data(G_OBJECT(ha), "opacity", opacity);
g_object_set_data(G_OBJECT(ha), "func", pfunc);
*/
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), desktop_plugin);
+ hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), GTK_WINDOW(desktop_plugin));
actor->widget = ha;
}
g_signal_connect(G_OBJECT(image), "expose_event",
G_CALLBACK(expose_event), pixbuf);
if (g_object_get_data(G_OBJECT(actor->widget), "image")){
- gtk_container_remove(actor->widget, g_object_get_data(G_OBJECT(actor->widget), "image"));
+ gtk_container_remove(GTK_CONTAINER(actor->widget), g_object_get_data(G_OBJECT(actor->widget), "image"));
}
g_object_set_data(G_OBJECT(actor->widget), "image", image);
gtk_container_add (GTK_CONTAINER (actor->widget), image);
-
+/*
static gint
get_time(gint t){
// уравнение изменения времени
return t*1.1;
}
-
+*/
static void
destroy_scene(void){
GSList * tmp = scene.actors;
scene.actors = NULL;
actor = init_object(desktop_plugin, "sky", "sky0.png", 0, 0, 5, 800, 480,
- TRUE, 100, 255, &change_static_actor, NULL);
+ TRUE, 100, 255, (gpointer)&change_static_actor, 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,
- TRUE, 100, 255, &change_sun, &probability_sun);
+ TRUE, 100, 255, (gpointer)&change_sun, &probability_sun);
actor->time_start_animation = time(NULL);
actor->duration_animation = G_MAXINT;
change_sun(actor, desktop_plugin);
actor = init_object(desktop_plugin, "town", "town0.png", 0, 0, 7, 800, 480,
- TRUE, 100, 255, &change_static_actor, NULL);
+ TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
change_static_actor(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
actor = init_object(desktop_plugin, "tram", "tram.png", -300, 225, 8, 350, 210,
- FALSE, 100, 255, &change_tram, NULL);
+ FALSE, 100, 255, (gpointer)&change_tram, NULL);
actor->time_start_animation = time(NULL) + 10;
actor->duration_animation = 60;
scene.actors = g_slist_append(scene.actors, actor);
actor = init_object(desktop_plugin, "border", "border0.png", 0, 480-79, 9, 800, 79,
- TRUE, 100, 255, &change_static_actor, NULL);
+ TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
change_static_actor(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 20, 10, 60, 60,
- FALSE, 100, 255, &change_moon, NULL);
+ FALSE, 100, 255, (gpointer)&change_moon, NULL);
change_moon(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
scene.actors = NULL;
actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
- TRUE, 100, 255, &change_static_actor, NULL);
+ TRUE, 100, 255, (gpointer)&change_static_actor, 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,
- TRUE, 100, 255, &change_sun, &probability_sun);
+ TRUE, 100, 255, (gpointer)&change_sun, &probability_sun);
actor->time_start_animation = time(NULL);
actor->duration_animation = G_MAXINT;
change_sun(actor, desktop_plugin);
actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 7, 800, 480,
- TRUE, 100, 255, &change_static_actor, NULL);
+ TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
change_static_actor(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 8, 60, 60,
- FALSE, 100, 255, &change_moon, NULL);
+ FALSE, 100, 255, (gpointer)&change_moon, NULL);
change_moon(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
//scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
get_sun_screen_pos(double alt, double azm, gint * x, gint * y)
{
gint y0 = 365;// - уровень горизонта
- gint o_width = 128,
- o_height = 128;
*x = (int)(azm * 800) - 64;
*y = (int)((1 - alt) * y0) - 64;
//fprintf(stderr, "sun pos alt=%f azm=%f x=%d y=%d\n", alt, azm, *x, *y);
{
gint daytime = get_daytime();
GSList * tmp;
- gchar * name;
void (*pfunc)(gpointer, gpointer);
time_t now;
- gint t;
Actor *actor;
gboolean stop_flag = TRUE;
{
gint daytime = get_daytime();
GSList * tmp;
- gchar * name;
void (*pfunc)(gpointer, gpointer);
time_t now;
- gint t;
Actor *actor;
/* TODO remove timeout */
&& desktop_plugin->priv->short_timer == 0){
actor->time_start_animation = now;
/* fprintf(stderr, "start short timer act = %s %d\n", actor->name, now); */
- desktop_plugin->priv->short_timer = g_timeout_add(SHORT_TIMER, short_timeout, desktop_plugin);
+ desktop_plugin->priv->short_timer = g_timeout_add(SHORT_TIMER, (GtkFunction)short_timeout, desktop_plugin);
}
tmp = g_slist_next(tmp);
}
init_scene(desktop_plugin);
else if (!strcmp(priv->theme,"Berlin"))
init_scene1(desktop_plugin);
- priv->long_timer = g_timeout_add(LONG_TIMER, long_timeout, desktop_plugin);
+ priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
priv->short_timer = 0;
/* TODO Move scene to priv */
scene.timer_type = LONG_TIMER_TYPE;
GtkObjectClass *gobject_class = GTK_OBJECT_CLASS (klass);
/* gobject */
- gobject_class->destroy = lw_applet_finalize;
+ gobject_class->destroy = (gpointer)lw_applet_finalize;
widget_class->realize = lw_applet_realize;
widget_class->expose_event = lw_applet_expose_event;