1 /* vim: set sw=4 ts=4 et: */
3 * This file is part of Live Wallpaper (livewp)
5 * Copyright (C) 2010 Vlad Vasiliev
6 * Copyright (C) 2010 Tanya Makova
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version.
14 * This software is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this software; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 /*******************************************************************************/
25 #include "livewp-common.h"
26 #include "livewp-settings.h"
27 /*******************************************************************************/
30 btn_setting_clicked(HildonButton *btn, gpointer data)
32 Animation_WallpaperPrivate *priv = data;
33 // open settings dialog
34 fprintf(stderr, "btn setting clicked, %s\n", priv->theme);
35 lw_settings(priv->desktop_plugin, priv);
36 fprintf(stderr, "btn setting clicked, %s\n", priv->theme);
40 main(int argc, char *argv[])
42 GtkWidget *main_widget = NULL;
44 GtkWidget *btn_setting, *vbox;
48 Animation_WallpaperPrivate *priv = g_new0 (Animation_WallpaperPrivate, 1);
51 setlocale(LC_ALL, "");
52 bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
53 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
54 textdomain(GETTEXT_PACKAGE);
57 hildon_gtk_init (&argc, &argv);
58 app = HILDON_PROGRAM (hildon_program_get_instance());
59 g_set_application_name (PACKAGE);
61 priv->osso = osso_initialize("org.maemo.livewp", VERSION, TRUE, NULL);
63 fprintf(stderr,"osso_initialize failed\n");
71 main_widget = hildon_stackable_window_new ();
72 gtk_window_set_title(GTK_WINDOW(main_widget), PACKAGE);
74 vbox = gtk_vbox_new(FALSE, 5);
75 btn_setting = hildon_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
76 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
77 hildon_button_set_text(HILDON_BUTTON(btn_setting), _("Settings"), "");
78 g_signal_connect(btn_setting, "clicked", G_CALLBACK(btn_setting_clicked), priv);
79 //gtk_container_add(GTK_CONTAINER(main_widget), button);
80 gtk_box_pack_start(vbox, btn_setting, FALSE, FALSE, 0);
81 gtk_container_add(GTK_CONTAINER(main_widget), vbox);
83 g_signal_connect(main_widget, "destroy", G_CALLBACK(gtk_main_quit), NULL);
84 hildon_program_add_window(app, HILDON_WINDOW(main_widget));
86 gtk_widget_show_all(GTK_WIDGET(main_widget));