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.
22 #include <glib-object.h>
26 #define MM_HIT_GET_PRIVATE(o) \
27 (G_TYPE_INSTANCE_GET_PRIVATE ((o), MM_TYPE_HIT, MMHitDetails))
29 G_DEFINE_TYPE (MMHit
, mm_hit
, G_TYPE_OBJECT
);
37 struct _MMHitDetails
{
43 mm_hit_finalize (GObject
*o
)
45 MMHitDetails
*details
= MM_HIT (o
)->details
;
47 g_free (details
->uri
);
48 g_free (details
->name
);
50 G_OBJECT_CLASS (mm_hit_parent_class
)->finalize (o
);
54 mm_hit_set_property (GObject
*obj
,
59 MMHitDetails
*details
= MM_HIT (obj
)->details
;
63 details
->uri
= g_strdup (g_value_get_string (value
));
66 details
->name
= g_strdup (g_value_get_string (value
));
74 mm_hit_get_property (GObject
*obj
,
79 MMHitDetails
*details
= MM_HIT (obj
)->details
;
83 g_value_set_string (value
, details
->uri
);
86 g_value_set_string (value
, details
->name
);
94 mm_hit_init (MMHit
*h
)
96 MMHitDetails
*details
= h
->details
= MM_HIT_GET_PRIVATE (h
);
103 mm_hit_class_init (MMHitClass
*klass
)
105 GObjectClass
*oclass
= G_OBJECT_CLASS (klass
);
107 oclass
->set_property
= mm_hit_set_property
;
108 oclass
->get_property
= mm_hit_get_property
;
109 oclass
->finalize
= mm_hit_finalize
;
111 g_object_class_install_property (oclass
,
113 g_param_spec_string ("uri",
117 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
118 g_object_class_install_property (oclass
,
120 g_param_spec_string ("name",
124 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
126 g_type_class_add_private (klass
, sizeof (MMHitDetails
));