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>
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;
32 server_cat_get_categories (MMCategoryProvider
*p
,
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
);
48 server_cat_category_provider_iface_init (MMCategoryProviderIface
*iface
)
50 /* implement interface methods */
51 iface
->get_categories
= server_cat_get_categories
;
55 server_cat_instance_init (ServerCat
*cat
)
61 server_cat_class_init (ServerCatClass
*klass
)
63 server_cat_parent_class
= g_type_class_peek_parent (klass
);
67 server_cat_get_type (void)
69 return server_cat_type
;
73 server_cat_register_type (GTypeModule
*module
)
75 static const GTypeInfo info
= {
76 sizeof (ServerCatClass
),
78 (GBaseFinalizeFunc
) NULL
,
79 (GClassInitFunc
) server_cat_class_init
,
84 (GInstanceInitFunc
) server_cat_instance_init
,
87 static const GInterfaceInfo category_provider_iface_info
= {
88 (GInterfaceInitFunc
) server_cat_category_provider_iface_init
,
93 server_cat_type
= g_type_module_register_type (module
,
98 g_type_module_add_interface (module
,
100 MM_TYPE_CATEGORY_PROVIDER
,
101 &category_provider_iface_info
);