root/trunk/libtinymailui/tny-summary-view.c

Revision 3666 (checked in by jdapena, 6 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 #include <config.h>
21
22 #include <tny-summary-view.h>
23
24
25 static void
26 tny_summary_view_base_init (gpointer g_class)
27 {
28         static gboolean initialized = FALSE;
29
30         if (!initialized) {
31                 /* create interface signals here. */
32                 initialized = TRUE;
33         }
34 }
35
36 static gpointer
37 tny_summary_view_register_type (gpointer notused)
38 {
39         GType type = 0;
40
41         static const GTypeInfo info =
42                 {
43                   sizeof (TnySummaryViewIface),
44                   tny_summary_view_base_init,   /* base_init */
45                   NULL,   /* base_finalize */
46                   NULL,   /* class_init */
47                   NULL,   /* class_finalize */
48                   NULL,   /* class_data */
49                   0,
50                   0,      /* n_preallocs */
51                   NULL    /* instance_init */
52                 };
53         type = g_type_register_static (G_TYPE_INTERFACE,
54                                        "TnySummaryView", &info, 0);
55
56         g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
57
58         return GUINT_TO_POINTER (type);
59 }
60
61 GType
62 tny_summary_view_get_type (void)
63 {
64         static GOnce once = G_ONCE_INIT;
65         g_once (&once, tny_summary_view_register_type, NULL);
66         return GPOINTER_TO_UINT (once.retval);
67 }
Note: See TracBrowser for help on using the browser.