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-hit-collection-provider.h>
24 #include <libmmanager/mm-hit.h>
25 #include <libmmanager/mm-hit-collection.h>
27 #include "server-coll.h"
29 static GObjectClass
*server_coll_parent_class
;
30 static GType server_coll_type
= 0;
33 server_coll_get_hits (MMHitCollectionProvider
*p
,
34 MMCategory
*belonging_category
,
37 MMHitCollection
*coll
;
41 coll
= mm_hit_collection_new ();
42 hit1
= g_object_new (MM_TYPE_HIT
,
43 "uri", "file:///home/anarki/foo",
46 hit2
= g_object_new (MM_TYPE_HIT
,
47 "uri", "file:///home/anarki/bar",
50 mm_hit_collection_add_hit (coll
, hit1
);
51 mm_hit_collection_add_hit (coll
, hit2
);
57 server_coll_hit_collection_provider_iface_init (MMHitCollectionProviderIface
*iface
)
59 /* implement interface methods */
60 iface
->get_hits
= server_coll_get_hits
;
64 server_coll_instance_init (ServerColl
*coll
)
70 server_coll_class_init (ServerCollClass
*klass
)
72 server_coll_parent_class
= g_type_class_peek_parent (klass
);
76 server_coll_get_type (void)
78 return server_coll_type
;
82 server_coll_register_type (GTypeModule
*module
)
84 static const GTypeInfo info
= {
85 sizeof (ServerCollClass
),
87 (GBaseFinalizeFunc
) NULL
,
88 (GClassInitFunc
) server_coll_class_init
,
93 (GInstanceInitFunc
) server_coll_instance_init
,
96 static const GInterfaceInfo hit_collection_provider_iface_info
= {
97 (GInterfaceInitFunc
) server_coll_hit_collection_provider_iface_init
,
102 server_coll_type
= g_type_module_register_type (module
,
107 g_type_module_add_interface (module
,
109 MM_TYPE_HIT_COLLECTION_PROVIDER
,
110 &hit_collection_provider_iface_info
);