Turn main-window into a GObject
[milk] / src / milk-main-window.c
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10  * General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public
13  * License along with this program; if not, write to the
14  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
15  * Boston, MA  02110-1301  USA
16  *
17  * Authors: Travis Reitter <treitter@gmail.com>
18  */
19
20 #include <config.h>
21
22 #include <glib.h>
23 #include <gtk/gtk.h>
24 #include <hildon/hildon.h>
25
26 #include "milk-main-window.h"
27
28 G_DEFINE_TYPE (MilkMainWindow, milk_main_window, HILDON_TYPE_WINDOW)
29
30 #define MILK_MAIN_WINDOW_PRIVATE(o) \
31                 (G_TYPE_INSTANCE_GET_PRIVATE ((o), MILK_TYPE_MAIN_WINDOW, MilkMainWindowPrivate))
32
33 struct _MilkMainWindowPrivate
34 {
35 };
36
37 static void
38 milk_main_window_get_property (GObject    *object,
39                                guint       property_id,
40                                GValue     *value,
41                                GParamSpec *pspec)
42 {
43         switch (property_id)
44         {
45                 default:
46                         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
47         }
48 }
49
50 static void
51 milk_main_window_set_property (GObject      *object,
52                                guint         property_id,
53                                const GValue *value,
54                                GParamSpec   *pspec)
55 {
56         switch (property_id)
57         {
58                 default:
59                         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
60         }
61 }
62
63 static void
64 milk_main_window_dispose (GObject *object)
65 {
66         G_OBJECT_CLASS (milk_main_window_parent_class)->dispose (object);
67 }
68
69 static void
70 milk_main_window_constructed (GObject* object)
71 {
72         MilkMainWindow *self = MILK_MAIN_WINDOW (object);
73 }
74
75 static void
76 milk_main_window_class_init (MilkMainWindowClass *klass)
77 {
78         GObjectClass *object_class = G_OBJECT_CLASS (klass);
79
80         g_type_class_add_private (klass, sizeof (MilkMainWindowPrivate));
81
82         object_class->get_property = milk_main_window_get_property;
83         object_class->set_property = milk_main_window_set_property;
84         object_class->constructed = milk_main_window_constructed;
85         object_class->dispose = milk_main_window_dispose;
86 }
87
88 static void
89 milk_main_window_init (MilkMainWindow *self)
90 {
91         self->priv = MILK_MAIN_WINDOW_PRIVATE (self);
92 }
93
94 GtkWidget*
95 milk_main_window_new ()
96 {
97         return g_object_new (MILK_TYPE_MAIN_WINDOW,
98                              NULL);
99 }