Modified webpage: now tinymail repository is in gitorious.
[modest] / src / hildon2 / modest-hildon2-msg-view-window.c
1 /* Copyright (c) 2009, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  *   notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  *   notice, this list of conditions and the following disclaimer in the
12  *   documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Nokia Corporation nor the names of its
14  *   contributors may be used to endorse or promote products derived from
15  *   this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 #include <hildon/hildon.h>
31 #include <modest-hildon2-msg-view-window.h>
32
33 /* 'private'/'protected' functions */
34 static void modest_hildon2_msg_view_window_class_init  (ModestHildon2MsgViewWindowClass *klass);
35 static void modest_hildon2_msg_view_window_instance_init (ModestHildon2MsgViewWindow *obj);
36 static void modest_hildon2_msg_view_window_finalize    (GObject *obj);
37
38 /* globals */
39 static GtkWindowClass *parent_class = NULL;
40
41 /************************************************************************/
42
43 GType
44 modest_hildon2_msg_view_window_get_type (void)
45 {
46         static GType my_type = 0;
47         if (!my_type) {
48                 static const GTypeInfo my_info = {
49                         sizeof(ModestHildon2MsgViewWindowClass),
50                         NULL,           /* base init */
51                         NULL,           /* base finalize */
52                         (GClassInitFunc) modest_hildon2_msg_view_window_class_init,
53                         NULL,           /* class finalize */
54                         NULL,           /* class data */
55                         sizeof(ModestHildon2MsgViewWindow),
56                         1,              /* n_preallocs */
57                         (GInstanceInitFunc) modest_hildon2_msg_view_window_instance_init,
58                         NULL
59                 };
60                 my_type = g_type_register_static (MODEST_TYPE_MSG_VIEW_WINDOW,
61                                                   "ModestHildon2MsgViewWindow",
62                                                   &my_info, 0);
63         }
64         return my_type;
65 }
66
67 static void
68 modest_hildon2_msg_view_window_class_init (ModestHildon2MsgViewWindowClass *klass)
69 {
70         GObjectClass *gobject_class;
71         gobject_class = (GObjectClass*) klass;
72
73         parent_class            = g_type_class_peek_parent (klass);
74         gobject_class->finalize = modest_hildon2_msg_view_window_finalize;
75
76 }
77
78 static void
79 modest_hildon2_msg_view_window_instance_init (ModestHildon2MsgViewWindow *obj)
80 {
81         hildon_program_add_window (hildon_program_get_instance(),
82                                    HILDON_WINDOW(obj));
83 }
84
85 static void
86 modest_hildon2_msg_view_window_finalize (GObject *obj)
87 {
88         G_OBJECT_CLASS(parent_class)->finalize (obj);
89 }
90
91 ModestWindow *
92 modest_hildon2_msg_view_window_new (void)
93 {
94         return modest_hildon2_msg_view_window_new ();
95 }
96