First implementation of the application provider and the category provider.
[mmediamanager.git] / src / mm-application-provider.c
blob48bcb4d5ae0ae787313b911d3da64c4c5a7d4e1b
1 /* MManager - a Desktop wide manager for multimedia applications.
3 * Copyright (C) 2008 Cosimo Cecchi <cosimoc@gnome.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include <config.h>
22 #include <glib-object.h>
23 #include "mm-application-provider.h"
24 #include "mm-application.h"
26 static void
27 mm_application_provider_base_init (gpointer klass)
32 GType
33 mm_application_provider_get_type (void)
35 static GType type = 0;
37 if (!type) {
38 const GTypeInfo info = {
39 sizeof (MMApplicationProviderIface),
40 mm_application_provider_base_init,
41 NULL,
42 NULL,
43 NULL,
44 NULL,
47 NULL
50 type = g_type_register_static (G_TYPE_INTERFACE,
51 "MMApplicationProvider",
52 &info, 0);
53 g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
56 return type;
59 MMApplication *
60 mm_application_provider_get_application (MMApplicationProvider *provider)
62 g_return_val_if_fail (MM_IS_APPLICATION_PROVIDER (provider), NULL);
63 g_return_val_if_fail (MM_APPLICATION_PROVIDER_GET_IFACE (provider)->get_application != NULL, NULL);
65 return MM_APPLICATION_PROVIDER_GET_IFACE (provider)->get_application (provider);