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-category-provider.h>
24 #include <libmmanager/mm-category.h>
25 #include <libmmanager/mm-application.h>
27 #include "server-cat.h"
29 static GObjectClass
*server_cat_parent_class
;
30 static GType server_cat_type
= 0;
33 server_cat_get_categories (MMCategoryProvider
*p
,
37 MMCategory
*cat1
, *cat2
;
39 cat1
= mm_category_new (app
, "Cat1", NULL
);
40 cat2
= mm_category_new (app
, "Cat2", NULL
);
42 list
= g_list_prepend (list
, cat2
);
43 list
= g_list_prepend (list
, cat1
);
49 server_cat_category_provider_iface_init (MMCategoryProviderIface
*iface
)
51 /* implement interface methods */
52 iface
->get_categories
= server_cat_get_categories
;
56 server_cat_instance_init (ServerCat
*cat
)
62 server_cat_class_init (ServerCatClass
*klass
)
64 server_cat_parent_class
= g_type_class_peek_parent (klass
);
68 server_cat_get_type (void)
70 return server_cat_type
;
74 server_cat_register_type (GTypeModule
*module
)
76 static const GTypeInfo info
= {
77 sizeof (ServerCatClass
),
79 (GBaseFinalizeFunc
) NULL
,
80 (GClassInitFunc
) server_cat_class_init
,
85 (GInstanceInitFunc
) server_cat_instance_init
,
88 static const GInterfaceInfo category_provider_iface_info
= {
89 (GInterfaceInitFunc
) server_cat_category_provider_iface_init
,
94 server_cat_type
= g_type_module_register_type (module
,
99 g_type_module_add_interface (module
,
101 MM_TYPE_CATEGORY_PROVIDER
,
102 &category_provider_iface_info
);