Renaming maemo-tweaks to tweakr.
[tweakr] / libtweakr-section / tweakr-section.c
1 /*
2  * vim:ts=4:sw=4:et:cindent:cino=(0
3  */ 
4
5 #include <config.h>
6 #include <gtk/gtk.h>
7
8 #include "tweakr-section.h"
9
10
11 G_DEFINE_TYPE (TweakrSection, tweakr_section, G_TYPE_OBJECT);
12
13
14 static void
15 tweakr_section_class_init (TweakrSectionClass *class)
16 {
17 }
18
19 static void
20 tweakr_section_init (TweakrSection *section)
21 {
22 }
23
24 TweakrSection *
25 tweakr_section_new (GType type)
26 {
27     g_return_val_if_fail (g_type_is_a (type, TWEAKR_TYPE_SECTION),
28                           NULL);
29
30     return g_object_new (type, NULL);
31 }
32
33 GtkWidget *
34 tweakr_section_get_widget (TweakrSection *section)
35 {
36     g_return_val_if_fail (TWEAKR_IS_SECTION (section), NULL);
37
38     return section->widget;
39 }
40
41 gboolean
42 tweakr_section_save (TweakrSection *section,
43                            gboolean *requires_restart)
44 {
45     g_return_val_if_fail (TWEAKR_IS_SECTION (section), TRUE);
46
47     if (TWEAKR_SECTION_GET_CLASS (section)->save)
48         return TWEAKR_SECTION_GET_CLASS (section)->save
49             (section, requires_restart);
50     else
51         g_warning ("%s: section class %s doesn't implement "
52                    "TweakrSection::filter ()\n",
53                    G_STRFUNC, g_type_name (G_TYPE_FROM_INSTANCE (section)));
54
55     return TRUE;
56 }
57