AC_SUBST(OSSO_LIBS)
AC_SUBST(OSSO_CFLAGS)
+PKG_CHECK_MODULES(CONTROLPANEL, hildon-control-panel)
+AC_SUBST(CONTROLPANEL_CFLAGS)
+AC_SUBST(CONTROLPANEL_LIBS)
+
# Discover where to install the .desktop file:
HILDON_HOME_DESKTOP_DIR=`pkg-config libhildondesktop-1 --variable=hildonhomedesktopentrydir`
AC_SUBST(HILDON_HOME_DESKTOP_DIR)
HILDON_DESKTOP_LIB_DIR=`pkg-config libhildondesktop-1 --variable=hildondesktoplibdir`
AC_SUBST(HILDON_DESKTOP_LIB_DIR)
+# Discover where to install the panel's lib file:
+HILDON_PANEL_LIB_DIR=`pkg-config hildon-control-panel --variable=pluginlibdir`
+AC_SUBST(HILDON_PANEL_LIB_DIR)
+
dnl Localisation
localedir=`pkg-config osso-af-settings --variable=localedir`
if test "$localedir" == ""; then
desktop_files = livewp.desktop
desktop_DATA = $(desktop_files)
+desktoppaneldir = $(datadir)/applications/hildon-control-panel
+desktoppanel_files = livewpp.desktop
+desktoppanel_DATA = $(desktoppanel_files)
+
+
EXTRA_DIST = $(berlintheme_DATA) \
$(moderntheme_DATA) \
sed "s/__PACKAGE__/$(PACKAGE)/g" $@.tmp >$@ && \
$(RM) *.tmp
+livewpp.desktop: livewpp.desktop.in
+ sed "s/__VERSION__/$(VERSION)/g" $< >$@.tmp && \
+ sed "s/__PACKAGE__/$(PACKAGE)/g" $@.tmp >$@ && \
+ $(RM) *.tmp
+
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
-am__installdirs = "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)"
+am__installdirs = "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(desktoppaneldir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)"
berlinthemeDATA_INSTALL = $(INSTALL_DATA)
dbus_serviceDATA_INSTALL = $(INSTALL_DATA)
desktopDATA_INSTALL = $(INSTALL_DATA)
+desktoppanelDATA_INSTALL = $(INSTALL_DATA)
matrixthemeDATA_INSTALL = $(INSTALL_DATA)
modernthemeDATA_INSTALL = $(INSTALL_DATA)
DATA = $(berlintheme_DATA) $(dbus_service_DATA) $(desktop_DATA) \
- $(matrixtheme_DATA) $(moderntheme_DATA)
+ $(desktoppanel_DATA) $(matrixtheme_DATA) $(moderntheme_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CONTROLPANEL_CFLAGS = @CONTROLPANEL_CFLAGS@
+CONTROLPANEL_LIBS = @CONTROLPANEL_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
GREP = @GREP@
HILDON_DESKTOP_LIB_DIR = @HILDON_DESKTOP_LIB_DIR@
HILDON_HOME_DESKTOP_DIR = @HILDON_HOME_DESKTOP_DIR@
+HILDON_PANEL_LIB_DIR = @HILDON_PANEL_LIB_DIR@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
desktopdir = $(datadir)/applications/hildon
desktop_files = livewp.desktop
desktop_DATA = $(desktop_files)
+desktoppaneldir = $(datadir)/applications/hildon-control-panel
+desktoppanel_files = livewpp.desktop
+desktoppanel_DATA = $(desktoppanel_files)
EXTRA_DIST = $(berlintheme_DATA) \
$(moderntheme_DATA) \
$(matrixtheme_DATA) \
echo " rm -f '$(DESTDIR)$(desktopdir)/$$f'"; \
rm -f "$(DESTDIR)$(desktopdir)/$$f"; \
done
+install-desktoppanelDATA: $(desktoppanel_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(desktoppaneldir)" || $(mkdir_p) "$(DESTDIR)$(desktoppaneldir)"
+ @list='$(desktoppanel_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(desktoppanelDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(desktoppaneldir)/$$f'"; \
+ $(desktoppanelDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(desktoppaneldir)/$$f"; \
+ done
+
+uninstall-desktoppanelDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(desktoppanel_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f '$(DESTDIR)$(desktoppaneldir)/$$f'"; \
+ rm -f "$(DESTDIR)$(desktoppaneldir)/$$f"; \
+ done
install-matrixthemeDATA: $(matrixtheme_DATA)
@$(NORMAL_INSTALL)
test -z "$(matrixthemedir)" || $(mkdir_p) "$(DESTDIR)$(matrixthemedir)"
check: check-am
all-am: Makefile $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)"; do \
+ for dir in "$(DESTDIR)$(berlinthemedir)" "$(DESTDIR)$(dbus_servicedir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(desktoppaneldir)" "$(DESTDIR)$(matrixthemedir)" "$(DESTDIR)$(modernthemedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
info-am:
install-data-am: install-berlinthemeDATA install-dbus_serviceDATA \
- install-desktopDATA install-matrixthemeDATA \
- install-modernthemeDATA
+ install-desktopDATA install-desktoppanelDATA \
+ install-matrixthemeDATA install-modernthemeDATA
install-exec-am:
ps-am:
uninstall-am: uninstall-berlinthemeDATA uninstall-dbus_serviceDATA \
- uninstall-desktopDATA uninstall-info-am \
- uninstall-matrixthemeDATA uninstall-modernthemeDATA
+ uninstall-desktopDATA uninstall-desktoppanelDATA \
+ uninstall-info-am uninstall-matrixthemeDATA \
+ uninstall-modernthemeDATA
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-berlinthemeDATA install-data install-data-am \
- install-dbus_serviceDATA install-desktopDATA install-exec \
- install-exec-am install-info install-info-am install-man \
+ install-dbus_serviceDATA install-desktopDATA \
+ install-desktoppanelDATA install-exec install-exec-am \
+ install-info install-info-am install-man \
install-matrixthemeDATA install-modernthemeDATA install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-berlinthemeDATA uninstall-dbus_serviceDATA \
- uninstall-desktopDATA uninstall-info-am \
- uninstall-matrixthemeDATA uninstall-modernthemeDATA
+ uninstall-desktopDATA uninstall-desktoppanelDATA \
+ uninstall-info-am uninstall-matrixthemeDATA \
+ uninstall-modernthemeDATA
livewp.desktop: livewp.desktop.in
sed "s/__VERSION__/$(VERSION)/g" $< >$@.tmp && \
sed "s/__PACKAGE__/$(PACKAGE)/g" $@.tmp >$@ && \
$(RM) *.tmp
+
+livewpp.desktop: livewpp.desktop.in
+ sed "s/__VERSION__/$(VERSION)/g" $< >$@.tmp && \
+ sed "s/__PACKAGE__/$(PACKAGE)/g" $@.tmp >$@ && \
+ $(RM) *.tmp
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Version=__VERSION__
+Name=Live Wallpaper
+Comment=Configuring Live Wallpaper
+Type=HildonControlPanelPlugin
+Icon=qgn_list_cp_isetup
+X-control-panel-plugin=liblivewp-panel-widget.so
+Categories=personalisation
+
live-wallpaper (0.4) unstable; urgency=low
- * Nothing yet
+ * Fixed problem ith traffic light
+ * Added possibility to configure Live Wallpaper using Control Panel
- -- Vlad Vasiliev <vlad@gas.by> Sun, 14 Apr 2010 16:21:10 +0200
+ -- Vlad Vasiliev <vlad@gas.by> Sat, 24 Apr 2010 17:23:10 +0200
live-wallpaper (0.3) unstable; urgency=low
AM_CFLAGS = -Wall $(EXAMPLE_CFLAGS) $(OSSO_CFLAGS)
+panellib_LTLIBRARIES = liblivewp-panel-widget.la
+panellibdir = $(HILDON_PANEL_LIB_DIR)
+
+liblivewp_panel_widget_la_SOURCES = livewp-settings.c livewp-settings.h livewp-common.h \
+ livewp-config.c livewp-config.h \
+ livewp-control-widget.c livewp-control-widget.h \
+ livewp-dbus.c livewp-dbus.h
+liblivewp_panel_widget_la_LIBADD = $(EXAMPLE_LIBS) $(OSSO_LIBS) $(CONTROLPANEL_LIBS)
+
+liblivewp_panel_widget_la_CFLAGS = -Wall $(EXAMPLE_CFLAGS) $(OSSO_CFLAGS) $(CONTROLPANEL_CFLAGS) -DCONTROLPANEL
+
--- /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 "livewp-control-widget.h"
+
+osso_return_t
+execute(osso_context_t *osso, gpointer data, gboolean user_activated){
+
+ Animation_WallpaperPrivate *priv = g_new0 (Animation_WallpaperPrivate, 1);
+ priv->osso = osso_initialize("org.maemo.livewp", VERSION, TRUE, NULL);
+ /* Load config */
+ read_config(priv);
+ /* Initialize DBUS */
+ livewp_initialize_dbus(priv);
+
+
+ lw_settings(priv, data);
+ return OSSO_OK;
+
+}
+
+osso_return_t
+save_state(osso_context_t *osso, gpointer data)
+{
+ /* ... save state ... */
+ fprintf(stderr,"SAVE state\n");
+ return OSSO_OK;
+}
+
--- /dev/null
+/*
+ * 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 <hildon-cp-plugin/hildon-cp-plugin-interface.h>
+#include <gtk/gtk.h>
+
fprintf(stderr, "\nCan not read config file.\n");
}else{
read_config(priv);
-#ifndef APPLICATION
+#if !(defined APPLICATION || defined CONTROLPANEL)
reload_scene(priv->desktop_plugin);
#endif
}
*/
hd_home_plugin_item_set_settings (HD_HOME_PLUGIN_ITEM (desktop_plugin), TRUE);
g_signal_connect (desktop_plugin, "show-settings",
- G_CALLBACK (lw_settings), priv);
+ G_CALLBACK (show_settings), priv);
gtk_widget_show (desktop_plugin->priv->main_widget);
gtk_container_add (GTK_CONTAINER (desktop_plugin), desktop_plugin->priv->main_widget);
init_applet_position();
G_END_DECLS
-void lw_settings(GtkWidget *widget, gpointer user_data);
+void lw_settings(gpointer user_data, gpointer data);
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);
static void init_scene2(AWallpaperPlugin *desktop_plugin);
void create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin);
void get_sun_screen_pos(double alt, double azm, gint * x, gint * y);
-
+void show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv);
#endif
Animation_WallpaperPrivate *priv = data;
// open settings dialog
fprintf(stderr, "btn setting clicked, %s\n", priv->theme);
- lw_settings(priv->desktop_plugin, priv);
+ lw_settings(priv, NULL);
fprintf(stderr, "btn setting clicked, %s\n", priv->theme);
}
void
}
/*******************************************************************************/
+void
+show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv){
+ lw_settings(priv, NULL);
+}
+/*******************************************************************************/
void
-lw_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv){
+lw_settings(Animation_WallpaperPrivate *priv, gpointer data){
gint result;
GtkWidget *window = NULL;
GtkWidget *save_button;
GtkWidget *rich_animation_button;
window = gtk_dialog_new();
+
gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_widget_destroy(window);
}
-GtkWidget*
-create_settings(void){
- gint result;
- GtkWidget *window = NULL;
- GtkWidget *save_button;
- GtkWidget *theme_button;
- GtkWidget *rich_animation_button;
-
- window = gtk_dialog_new();
- gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
- gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
- gtk_window_set_modal(GTK_WINDOW(window), TRUE);
- /* Create Theme button */
- theme_button = create_themes_button("Modern");
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
- theme_button, TRUE, TRUE, 5);
- /* Create rich animation button */
- rich_animation_button = create_rich_animation_button(TRUE);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
- rich_animation_button, TRUE, TRUE, 5);
- gtk_widget_show (theme_button);
- gtk_widget_show (rich_animation_button);
- gtk_widget_show (window);
- gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
- save_button = gtk_dialog_add_button(GTK_DIALOG(window), _("Save"), GTK_RESPONSE_YES);
-#if 0
- result = gtk_dialog_run(GTK_DIALOG(window));
-
- switch(result){
- case GTK_RESPONSE_YES:
- if (hildon_button_get_value(HILDON_BUTTON (theme_button))){
- if (priv->theme)
- g_free(priv->theme);
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Berlin")))
- priv->theme = g_strdup("Berlin");
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Modern")))
- priv->theme = g_strdup("Modern");
- if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Matrix")))
- priv->theme = g_strdup("Matrix");
- if (hildon_check_button_get_active (rich_animation_button))
- priv->rich_animation = TRUE;
- else
- priv->rich_animation = FALSE;
- }
- save_config(priv);
- reload_scene(priv->desktop_plugin);
- break;
- default:
- case GTK_RESPONSE_OK:
- break;
- case GTK_RESPONSE_NO:
- gtk_widget_destroy(window);
- window = NULL;
- lw_about();
- break;
- }
- if (window)
- gtk_widget_destroy(window);
-#endif
- return window;
-}
*/
/*******************************************************************************/
#include "livewp-common.h"
-void lw_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv);
+void lw_settings(Animation_WallpaperPrivate *priv, gpointer data);
void save_config(Animation_WallpaperPrivate *priv);
void reload_scene(AWallpaperPlugin *desktop_plugin);
GtkWidget* create_settings(void);
+void show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv);