Now autofoo + gtk-doc should be all fine.
[mmediamanager.git] / test / server-app / server-cat.c
blob85dbd34debc235cea2f206bd98ce8ef612ded2bf
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 <glib-object.h>
22 #include <glib.h>
23 #include <libmmanager/mm.h>
24 #include <libmmanager/mm-so-category.h>
26 #include "server-cat.h"
28 static GObjectClass *server_cat_parent_class;
29 static GType server_cat_type = 0;
31 GList *
32 server_cat_get_categories (MMCategoryProvider *p,
33 MMApplication *app)
35 GList *list = NULL;
36 MMCategory *cat1, *cat2;
38 cat1 = mm_so_category_new (MM_SO_APPLICATION (app), "Cat1", NULL);
39 cat2 = mm_so_category_new (MM_SO_APPLICATION (app), "Cat2", NULL);
41 list = g_list_prepend (list, cat2);
42 list = g_list_prepend (list, cat1);
44 return list;
47 static void
48 server_cat_category_provider_iface_init (MMCategoryProviderIface *iface)
50 /* implement interface methods */
51 iface->get_categories = server_cat_get_categories;
54 static void
55 server_cat_instance_init (ServerCat *cat)
57 /* do nothing */
60 static void
61 server_cat_class_init (ServerCatClass *klass)
63 server_cat_parent_class = g_type_class_peek_parent (klass);
66 GType
67 server_cat_get_type (void)
69 return server_cat_type;
72 void
73 server_cat_register_type (GTypeModule *module)
75 static const GTypeInfo info = {
76 sizeof (ServerCatClass),
77 (GBaseInitFunc) NULL,
78 (GBaseFinalizeFunc) NULL,
79 (GClassInitFunc) server_cat_class_init,
80 NULL,
81 NULL,
82 sizeof (ServerCat),
84 (GInstanceInitFunc) server_cat_instance_init,
87 static const GInterfaceInfo category_provider_iface_info = {
88 (GInterfaceInitFunc) server_cat_category_provider_iface_init,
89 NULL,
90 NULL
93 server_cat_type = g_type_module_register_type (module,
94 G_TYPE_OBJECT,
95 "ServerCat",
96 &info, 0);
98 g_type_module_add_interface (module,
99 server_cat_type,
100 MM_TYPE_CATEGORY_PROVIDER,
101 &category_provider_iface_info);