No issues found
1 /*
2 * nautilus-location-widget-provider.c - Interface for Nautilus
3 extensions that provide extra widgets for a location
4 *
5 * Copyright (C) 2005 Red Hat, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 *
21 * Author: Alexander Larsson <alexl@redhat.com>
22 *
23 */
24
25 #include <config.h>
26 #include "nautilus-location-widget-provider.h"
27
28 #include <glib-object.h>
29
30 static void
31 nautilus_location_widget_provider_base_init (gpointer g_class)
32 {
33 }
34
35 GType
36 nautilus_location_widget_provider_get_type (void)
37 {
38 static GType type = 0;
39
40 if (!type) {
41 const GTypeInfo info = {
42 sizeof (NautilusLocationWidgetProviderIface),
43 nautilus_location_widget_provider_base_init,
44 NULL,
45 NULL,
46 NULL,
47 NULL,
48 0,
49 0,
50 NULL
51 };
52
53 type = g_type_register_static (G_TYPE_INTERFACE,
54 "NautilusLocationWidgetProvider",
55 &info, 0);
56 g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
57 }
58
59 return type;
60 }
61
62 /**
63 * nautilus_location_widget_provider_get_widget:
64 * @provider: a #NautilusLocationWidgetProvider
65 * @uri: the URI of the location
66 * @window: parent #GtkWindow
67 *
68 * Returns: (transfer none): the location widget for @provider at @uri
69 */
70 GtkWidget *
71 nautilus_location_widget_provider_get_widget (NautilusLocationWidgetProvider *provider,
72 const char *uri,
73 GtkWidget *window)
74 {
75 g_return_val_if_fail (NAUTILUS_IS_LOCATION_WIDGET_PROVIDER (provider), NULL);
76
77 return NAUTILUS_LOCATION_WIDGET_PROVIDER_GET_IFACE (provider)->get_widget
78 (provider, uri, window);
79
80 }