No issues found
1 /*
2 * nautilus-property-page-provider.c - Interface for Nautilus extensions
3 * that provide property pages for
4 * files.
5 *
6 * Copyright (C) 2003 Novell, Inc.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 * Author: Dave Camp <dave@ximian.com>
23 *
24 */
25
26 #include <config.h>
27 #include "nautilus-property-page-provider.h"
28
29 #include <glib-object.h>
30
31 static void
32 nautilus_property_page_provider_base_init (gpointer g_class)
33 {
34 }
35
36 GType
37 nautilus_property_page_provider_get_type (void)
38 {
39 static GType type = 0;
40
41 if (!type) {
42 const GTypeInfo info = {
43 sizeof (NautilusPropertyPageProviderIface),
44 nautilus_property_page_provider_base_init,
45 NULL,
46 NULL,
47 NULL,
48 NULL,
49 0,
50 0,
51 NULL
52 };
53
54 type = g_type_register_static (G_TYPE_INTERFACE,
55 "NautilusPropertyPageProvider",
56 &info, 0);
57 g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
58 }
59
60 return type;
61 }
62
63 /**
64 * nautilus_property_page_provider_get_pages:
65 * @provider: a #NautilusPropertyPageProvider
66 * @files: (element-type NautilusFileInfo): a #GList of #NautilusFileInfo
67 *
68 * This function is called by Nautilus when it wants property page
69 * items from the extension.
70 *
71 * This function is called in the main thread before a property page
72 * is shown, so it should return quickly.
73 *
74 * Returns: (element-type NautilusPropertyPage) (transfer full): A #GList of allocated #NautilusPropertyPage items.
75 */
76 GList *
77 nautilus_property_page_provider_get_pages (NautilusPropertyPageProvider *provider,
78 GList *files)
79 {
80 g_return_val_if_fail (NAUTILUS_IS_PROPERTY_PAGE_PROVIDER (provider), NULL);
81 g_return_val_if_fail (NAUTILUS_PROPERTY_PAGE_PROVIDER_GET_IFACE (provider)->get_pages != NULL, NULL);
82
83 return NAUTILUS_PROPERTY_PAGE_PROVIDER_GET_IFACE (provider)->get_pages
84 (provider, files);
85 }
86
87