initial import
[slovak-l10n] / ukeyboard / cpanel / about.c
1 /*
2  *  Copyright (c) 2008 Jiri Benc <jbenc@upir.cz>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License version 2 as
6  *  published by the Free Software Foundation.
7  *
8  *  This program is distributed in the hope that it will be useful,
9  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *  GNU General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License
14  *  along with this program; if not, write to the Free Software
15  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16  */
17
18 #include <stdio.h>
19 #include <string.h>
20 #include <glib.h>
21 #include <gtk/gtk.h>
22 #include <libosso.h>
23 #include <gconf/gconf.h>
24 #include <gconf/gconf-client.h>
25 #include "prefs.h"
26 #include "hw.h"
27
28 #ifdef HAVE_MAEMO5
29 #include <hildon/hildon.h>
30 #else
31
32 static gboolean label_focus(GtkWidget *widget, GtkDirectionType arg, gpointer data)
33 {
34         (void)arg; (void)data;
35         gtk_label_select_region(GTK_LABEL(widget), 0, 0);
36         return TRUE;
37 }
38 #endif
39
40 static GtkWidget *start(GConfClient *client, GtkWidget *win, void **data)
41 {
42 #ifdef HAVE_MAEMO5
43         GtkWidget *scroll;
44 #else
45         GtkScrolledWindow *scroll;
46 #endif
47         GtkWidget *label;
48
49         (void)client; (void)win;
50
51 #ifdef HAVE_MAEMO5
52         scroll = hildon_pannable_area_new();
53 #else
54         scroll = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(NULL, NULL));
55         gtk_scrolled_window_set_policy(scroll, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
56 #endif
57
58         label = gtk_label_new(NULL);
59         gtk_label_set_markup(GTK_LABEL(label),
60 #include "about.inc"
61         );
62 #ifdef HAVE_MAEMO5
63         hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA(scroll), label);
64 #else
65         gtk_label_set_selectable(GTK_LABEL(label), TRUE);
66         g_signal_connect(G_OBJECT(label), "focus", G_CALLBACK(label_focus), NULL);
67         gtk_scrolled_window_add_with_viewport(scroll, label);
68 #endif
69         *data = NULL;
70         return GTK_WIDGET(scroll);
71 }
72
73 void prefs_about_init(struct prefs *prefs)
74 {
75         prefs->start = start;
76         prefs->action = NULL;
77         prefs->stop = NULL;
78         prefs->name = "About";
79 }