-#SOURCE_FILES = livewp-main.c \
-# 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-config.c livewp-config.h \
-# livewp-dbus.c livewp-dbus.h
+SOURCE_FILES = livewp-main.c \
+ 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-config.c livewp-config.h \
+ livewp-dbus.c livewp-dbus.h \
+ livewp-actor.c livewp-actor.h \
+ livewp-scene.c livewp-scene.h
+
+
+bin_PROGRAMS = livewp
+livewp_SOURCES = $(SOURCE_FILES)
#
-#bin_PROGRAMS = livewp
-#livewp_SOURCES = $(SOURCE_FILES)
+livewp_CFLAGS = -Wall $(EXAMPLE_CFLAGS) $(OSSO_CFLAGS) -DAPPLICATION
#
-#livewp_CFLAGS = -Wall $(EXAMPLE_CFLAGS) $(OSSO_CFLAGS) -DAPPLICATION
-#
-#livewp_LDADD = $(EXAMPLE_LIBS) $(OSSO_LIBS)
+livewp_LDADD = $(EXAMPLE_LIBS) $(OSSO_LIBS)
# We invent desktoplib_LTLIBRARIES instead of the normal lib_LTLIBRARIES,
# so we can specify the non-standard installation directory.
//g_object_set_data(G_OBJECT(ha), "image", image);
actor->image = label;
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), GTK_WINDOW(desktop_plugin));
+ hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), GTK_WINDOW(desktop_plugin->priv->window));
actor->widget = ha;
set_actor_position(actor, actor->x, actor->y, actor->z, desktop_plugin);
set_actor_scale(actor, (double)actor->scale/100, (double)actor->scale/100);
actor->width,
actor->height,
NULL);
- /*fprintf(stderr, "create_hildon_actor %s %s\n", actor->name, str);*/
+ /* fprintf(stderr, "create_hildon_actor %s %s\n", actor->name, str); */
if (str)
g_free(str);
if (pixbuf){
//g_object_set_data(G_OBJECT(ha), "image", image);
actor->image = image;
- hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), GTK_WINDOW(desktop_plugin));
+ hildon_animation_actor_set_parent (HILDON_ANIMATION_ACTOR (ha), GTK_WINDOW(desktop_plugin->priv->window));
actor->widget = ha;
set_actor_position(actor, actor->x, actor->y, actor->z, desktop_plugin);
}
-static gboolean
+gboolean
long_timeout (AWallpaperPlugin *desktop_plugin)
{
/* fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer); */
livewp_initialize_dbus(priv);
priv->desktop_plugin = desktop_plugin;
+ priv->window = desktop_plugin;
priv->visible = TRUE;
priv->short_timer = 0;
priv->xapplet = 0;
*/
/*******************************************************************************/
#include "livewp-common.h"
+#include "livewp-scene.h"
#include "livewp-settings.h"
+#include "livewp-home-widget.h"
/*******************************************************************************/
+#include <X11/extensions/Xrender.h>
+#include <gdk/gdkx.h>
+
+#include <X11/Xatom.h>
void
btn_setting_clicked(HildonButton *btn, gpointer data)
else
hildon_button_set_text(HILDON_BUTTON(btn), _("Stop"), "stop");
}
+static void set_live_bg (Display *display, Window xwindow, int mode)
+{
+ Atom atom;
+
+ atom = XInternAtom (display, "_HILDON_LIVE_DESKTOP_BACKGROUND", False);
+ fprintf (stderr, "XID: 0x%x\n", (unsigned)xwindow);
+
+ XChangeProperty (display,
+ xwindow,
+ atom,
+ XA_INTEGER, 32, PropModeReplace,
+ (unsigned char *) &mode, 1);
+}
+
int
main(int argc, char *argv[])
{
gint result;
HildonProgram *app;
+ AWallpaperPlugin *desktop_plugin = g_new0 (AWallpaperPlugin, 1);
Animation_WallpaperPrivate *priv = g_new0 (Animation_WallpaperPrivate, 1);
+ desktop_plugin->priv = priv;
+
-#ifdef ENABLE_NLS
- setlocale(LC_ALL, "");
- bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
- textdomain(GETTEXT_PACKAGE);
-#endif
/* Ininitializing */
hildon_gtk_init (&argc, &argv);
app = HILDON_PROGRAM (hildon_program_get_instance());
return 1;
}
+#ifdef ENABLE_NLS
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
+#endif
+/* Create Main GUI */
+ main_widget = hildon_window_new ();
+ gtk_window_set_title(GTK_WINDOW(main_widget), PACKAGE);
+
+ gtk_widget_show_all(GTK_WIDGET(main_widget));
+
+ priv->hash_scene_func = g_hash_table_new(g_str_hash, g_str_equal);
+ g_hash_table_insert(priv->hash_scene_func, g_strdup("Berlin"), (gpointer)&init_scene_Berlin);
+ g_hash_table_insert(priv->hash_scene_func, g_strdup("Modern"), (gpointer)&init_scene_Modern);
+ g_hash_table_insert(priv->hash_scene_func, g_strdup("Matrix"), (gpointer)&init_scene_Matrix);
+
+ priv->scene = NULL;
+ priv->window = main_widget;
+
+ priv->view = 2;
/* Load config */
read_config(priv);
-
/* Initialize DBUS */
livewp_initialize_dbus(priv);
+ set_live_bg(GDK_WINDOW_XDISPLAY (main_widget->window), GDK_WINDOW_XID (main_widget->window), 1);
+ init_scene_theme(desktop_plugin);
+
+ priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
- /* Create Main GUI */
- main_widget = hildon_stackable_window_new ();
- gtk_window_set_title(GTK_WINDOW(main_widget), PACKAGE);
-
- vbox = gtk_vbox_new(FALSE, 5);
- btn_setting = hildon_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
- HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
- hildon_button_set_text(HILDON_BUTTON(btn_setting), _("Settings"), "");
- g_signal_connect(btn_setting, "clicked", G_CALLBACK(btn_setting_clicked), priv);
- //gtk_container_add(GTK_CONTAINER(main_widget), button);
- gtk_box_pack_start(vbox, btn_setting, FALSE, FALSE, 0);
- btn_power = hildon_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
- HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
- if (1)/* if applet started*/{
- hildon_button_set_text(HILDON_BUTTON(btn_power), _("Stop"), "stop");
- }
- else{
- hildon_button_set_text(HILDON_BUTTON(btn_power), _("Start"), "start");
- }
- g_signal_connect(btn_power, "clicked", G_CALLBACK(btn_power_clicked), priv);
- //gtk_container_add(GTK_CONTAINER(main_widget), button);
- gtk_box_pack_start(vbox, btn_power, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER(main_widget), vbox);
- g_signal_connect(main_widget, "destroy", G_CALLBACK(gtk_main_quit), NULL);
- hildon_program_add_window(app, HILDON_WINDOW(main_widget));
-
- gtk_widget_show_all(GTK_WIDGET(main_widget));
- gtk_main();
+ gtk_main();
return 0;
}