root/trunk/libtinymailui/tny-msg-window.c

Revision 3666 (checked in by jdapena, 7 months ago)

* Use GOnce registering all types in tinymail to make

registering thread-safe.

Line 
1 /* libtinymailui - The Tiny Mail UI library
2  * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with self library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 /**
21  * TnyMsgWindow:
22  *
23  * A type that can view a #TnyMsg in a window
24  *
25  * free-function: g_object_unref
26  **/
27
28 #include <config.h>
29
30 #include <tny-msg-window.h>
31
32
33 static void
34 tny_msg_window_base_init (gpointer g_class)
35 {
36         static gboolean initialized = FALSE;
37
38         if (!initialized) {
39                 /* create interface signals here. */
40                 initialized = TRUE;
41         }
42 }
43
44 static gpointer
45 tny_msg_window_register_type (gpointer notused)
46 {
47         GType type = 0;
48
49         static const GTypeInfo info =
50                 {
51                   sizeof (TnyMsgWindowIface),
52                   tny_msg_window_base_init,   /* base_init */
53                   NULL,   /* base_finalize */
54                   NULL,   /* class_init */
55                   NULL,   /* class_finalize */
56                   NULL,   /* class_data */
57                   0,
58                   0,      /* n_preallocs */
59                   NULL    /* instance_init */
60                 };
61
62         type = g_type_register_static (G_TYPE_INTERFACE,
63                                        "TnyMsgWindow", &info, 0);
64
65         g_type_interface_add_prerequisite (type, TNY_TYPE_MSG_VIEW);
66
67         return GUINT_TO_POINTER (type);
68 }
69
70 GType
71 tny_msg_window_get_type (void)
72 {
73         static GOnce once = G_ONCE_INIT;
74         g_once (&once, tny_msg_window_register_type, NULL);
75         return GPOINTER_TO_UINT (once.retval);
76 }
Note: See TracBrowser for help on using the browser.