]> Pileus Git - ~andy/gtk/blob - gtk/gtkappchoosermodule.c
bc5c0e74af3c58acdcc1da264bff3f43a0f5057c
[~andy/gtk] / gtk / gtkappchoosermodule.c
1 /*
2  * gtkappchoosermodule.c: an extension point for online integration
3  *
4  * Copyright (C) 2010 Red Hat, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
18  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  * Authors: Cosimo Cecchi <ccecchi@redhat.com>
22  */
23
24 #include "config.h"
25
26 #include "gtkappchoosermodule.h"
27
28 #include <gio/gio.h>
29
30 #include "gtkappchooseronline.h"
31 #include "gtkappchooseronlinedummy.h"
32
33 #ifdef ENABLE_PACKAGEKIT
34 #include "gtkappchooseronlinepk.h"
35 #endif
36
37 G_LOCK_DEFINE_STATIC (registered_ep);
38
39 void
40 _gtk_app_chooser_module_ensure (void)
41 {
42   static gboolean registered_ep = FALSE;
43   GIOExtensionPoint *ep;
44
45   G_LOCK (registered_ep);
46
47   if (!registered_ep)
48 {
49     registered_ep = TRUE;
50
51     ep = g_io_extension_point_register ("gtkappchooser-online");
52     g_io_extension_point_set_required_type (ep, GTK_TYPE_APP_CHOOSER_ONLINE);
53
54     _gtk_app_chooser_online_dummy_get_type ();
55
56 #ifdef ENABLE_PACKAGEKIT
57     _gtk_app_chooser_online_pk_get_type ();
58 #endif
59   }
60
61   G_UNLOCK (registered_ep);
62 }