livewp-astro.c livewp-astro.h \
livewp-rules.c livewp-rules.h \
livewp-settings.c livewp-settings.h livewp-common.h \
- livewp-multiactor.c livewp-multiactor.h
-
+ livewp-multiactor.c livewp-multiactor.h \
+ livewp-config.c livewp-config.h
liblivewp_home_widget_la_LIBADD = $(EXAMPLE_LIBS)
AM_CFLAGS = -Wall $(EXAMPLE_CFLAGS)
} MultiActor;
+typedef struct _Animation_WallpaperPrivate Animation_WallpaperPrivate;
+struct _Animation_WallpaperPrivate
+{
+ gint timer;
+ gchar *theme;
+};
+
--- /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-config.h"
+/*******************************************************************************/
+gint
+read_config(Animation_WallpaperPrivate *priv) {
+
+ GConfValue *value = NULL;
+ GConfClient *gconf_client = NULL;
+ GSList *stlist = NULL;
+ GError *gerror = NULL;
+ gchar *tmp = NULL;
+
+ gconf_client = gconf_client_get_default();
+ if (!gconf_client) {
+ fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+ return -1;
+ }
+ /* get Theme default Modern */
+ tmp = gconf_client_get_string(gconf_client,
+ GCONF_KEY_THEME, NULL);
+ if (tmp){
+ priv->theme = tmp;
+ }else
+ priv->theme = g_strdup("Modern");
+
+ return 0;
+}
+
+/*******************************************************************************/
+void
+save_config(Animation_WallpaperPrivate *priv) {
+
+ GConfClient *gconf_client;
+ gconf_client = gconf_client_get_default();
+ if (!gconf_client) {
+ fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+ return -1;
+ }
+ /* Save Weather source name. */
+ if (priv->theme)
+ gconf_client_set_string(gconf_client,
+ GCONF_KEY_THEME,
+ priv->theme, NULL);
+}
--- /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-common.h"
+#include <gconf/gconf-client.h>
+
+#define GCONF_KEY_PREFIX "/apps/maemo/livewp"
+#define GCONF_KEY_THEME GCONF_KEY_PREFIX"/theme"
+gint read_config(Animation_WallpaperPrivate *priv);
+void save_config(Animation_WallpaperPrivate *priv);
+
static void
animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
{
- GtkWidget *label;
- Animation_WallpaperPrivate *priv = Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
- desktop_plugin->priv = Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
- label = gtk_label_new ("");
- //desktop_plugin->priv->main_widget = label;
- gtk_widget_set_size_request(label, 95, 30);
- gtk_widget_show (label);
- hd_home_plugin_item_set_settings (HD_HOME_PLUGIN_ITEM (desktop_plugin), TRUE);
- g_signal_connect (desktop_plugin, "show-settings",
+ GtkWidget *label;
+
+ Animation_WallpaperPrivate *priv = Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
+ desktop_plugin->priv = Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
+ /* Load config */
+ read_config(priv);
+ label = gtk_label_new ("");
+ gtk_widget_set_size_request(label, 95, 30);
+ gtk_widget_show (label);
+ hd_home_plugin_item_set_settings (HD_HOME_PLUGIN_ITEM (desktop_plugin), TRUE);
+ g_signal_connect (desktop_plugin, "show-settings",
G_CALLBACK (lw_settings), NULL);
- g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
+ g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
G_CALLBACK (desktop_plugin_visible_notify), desktop_plugin);
- gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
- init_applet_position();
- init_scene(desktop_plugin);
- priv->timer = g_timeout_add(50, plugin_on_timeout, desktop_plugin);
+ gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
+ init_applet_position();
+ init_scene(desktop_plugin);
+ priv->timer = g_timeout_add(50, plugin_on_timeout, desktop_plugin);
}
static void
g_source_remove(priv->timer);
priv->timer = NULL;
}
+ /* Save config */
+ save_config(priv);
}
static void
#define Animation_Wallpaper_HOME_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
Animation_Wallpaper_TYPE_HOME_PLUGIN, AWallpaperPluginClass))
-typedef struct _Animation_WallpaperPrivate Animation_WallpaperPrivate;
struct _AWallpaperPlugin
{
G_END_DECLS
-struct _Animation_WallpaperPrivate
-{
- gint timer;
- gchar *theme;
-};
void lw_settings(GtkWidget *widget, gpointer user_data);
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);
void multiactor_set_position(MultiActor *ma, gint dx, gint dy, gint dz);
void actor_set_position_full(GtkWidget *actor, gint x, gint y, gint z);
-
+gint read_config(Animation_WallpaperPrivate *priv);
+void save_config(Animation_WallpaperPrivate *priv);
#endif