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