]> Pileus Git - ~andy/gtk/blob - gtk/gtkappchoosermodule.c
Merge branch 'master' into treeview-refactor
[~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
32 #ifdef ENABLE_PACKAGEKIT
33 #include "gtkappchooseronlinepk.h"
34 #endif
35
36 G_LOCK_DEFINE_STATIC (registered_ep);
37
38 void
39 _gtk_app_chooser_module_ensure (void)
40 {
41   static gboolean registered_ep = FALSE;
42   GIOExtensionPoint *ep;
43
44   G_LOCK (registered_ep);
45
46   if (!registered_ep)
47     {
48       registered_ep = TRUE;
49
50       ep = g_io_extension_point_register ("gtkappchooser-online");
51       g_io_extension_point_set_required_type (ep, GTK_TYPE_APP_CHOOSER_ONLINE);
52
53 #ifdef ENABLE_PACKAGEKIT
54       _gtk_app_chooser_online_pk_get_type ();
55 #endif
56     }
57
58   G_UNLOCK (registered_ep);
59 }