From d296158f19b27d4c3985fb4800dbad89052b384b Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 29 May 2008 16:13:34 +0200 Subject: [PATCH] First implementation of the application provider and the category provider. --- src/mm-application-provider.c | 66 +++++++++++++++++++++++++++++++++++++++++++ src/mm-category-provider.c | 65 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 src/mm-application-provider.c create mode 100644 src/mm-category-provider.c diff --git a/src/mm-application-provider.c b/src/mm-application-provider.c new file mode 100644 index 0000000..48bcb4d --- /dev/null +++ b/src/mm-application-provider.c @@ -0,0 +1,66 @@ +/* MManager - a Desktop wide manager for multimedia applications. + * + * Copyright (C) 2008 Cosimo Cecchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "mm-application-provider.h" +#include "mm-application.h" + +static void +mm_application_provider_base_init (gpointer klass) +{ + +} + +GType +mm_application_provider_get_type (void) +{ + static GType type = 0; + + if (!type) { + const GTypeInfo info = { + sizeof (MMApplicationProviderIface), + mm_application_provider_base_init, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL + }; + + type = g_type_register_static (G_TYPE_INTERFACE, + "MMApplicationProvider", + &info, 0); + g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); + } + + return type; +} + +MMApplication * +mm_application_provider_get_application (MMApplicationProvider *provider) +{ + g_return_val_if_fail (MM_IS_APPLICATION_PROVIDER (provider), NULL); + g_return_val_if_fail (MM_APPLICATION_PROVIDER_GET_IFACE (provider)->get_application != NULL, NULL); + + return MM_APPLICATION_PROVIDER_GET_IFACE (provider)->get_application (provider); +} diff --git a/src/mm-category-provider.c b/src/mm-category-provider.c new file mode 100644 index 0000000..fcf5346 --- /dev/null +++ b/src/mm-category-provider.c @@ -0,0 +1,65 @@ +/* MManager - a Desktop wide manager for multimedia applications. + * + * Copyright (C) 2008 Cosimo Cecchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "mm-category-provider.h" + +static void +mm_category_provider_base_init (gpointer klass) +{ + +} + +GType +mm_category_provider_get_type (void) +{ + static GType type = 0; + + if (!type) { + const GTypeInfo info = { + sizeof (MMCategoryProviderIface), + mm_category_provider_base_init, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL + }; + + type = g_type_register_static (G_TYPE_INTERFACE, + "MMCategoryProvider", + &info, 0); + g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); + } + + return type; +} + +GList * +mm_category_provider_get_categories (MMCatgegoryProvider *provider) +{ + g_return_val_if_fail (MM_IS_CATEGORY_PROVIDER (provider), NULL); + g_return_val_if_fail (MM_CATEGORY_PROVIDER_GET_IFACE (provider)->get_categories != NULL, NULL); + + return MM_CATEGORY_PROVIDER_GET_IFACE (provider)->get_categories (provider); +} -- 2.11.4.GIT