2
* Copyright (C) 2010 Intel, Inc
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Author: Thomas Wood <thomas.wood@intel.com>
21
#include "bg-source.h"
22
#include "cc-appearance-item.h"
24
G_DEFINE_ABSTRACT_TYPE (BgSource, bg_source, G_TYPE_OBJECT)
26
#define SOURCE_PRIVATE(o) \
27
(G_TYPE_INSTANCE_GET_PRIVATE ((o), BG_TYPE_SOURCE, BgSourcePrivate))
29
struct _BgSourcePrivate
41
bg_source_get_property (GObject *object,
46
BgSource *source = BG_SOURCE (object);
51
g_value_set_object (value, bg_source_get_liststore (source));
55
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
60
bg_source_set_property (GObject *object,
68
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
73
bg_source_dispose (GObject *object)
75
BgSourcePrivate *priv = BG_SOURCE (object)->priv;
79
g_object_unref (priv->store);
83
G_OBJECT_CLASS (bg_source_parent_class)->dispose (object);
87
bg_source_finalize (GObject *object)
89
G_OBJECT_CLASS (bg_source_parent_class)->finalize (object);
93
bg_source_class_init (BgSourceClass *klass)
96
GObjectClass *object_class = G_OBJECT_CLASS (klass);
98
g_type_class_add_private (klass, sizeof (BgSourcePrivate));
100
object_class->get_property = bg_source_get_property;
101
object_class->set_property = bg_source_set_property;
102
object_class->dispose = bg_source_dispose;
103
object_class->finalize = bg_source_finalize;
105
pspec = g_param_spec_object ("liststore",
107
"Liststore used in the source",
109
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
110
g_object_class_install_property (object_class, PROP_LISTSTORE, pspec);
114
bg_source_init (BgSource *self)
116
BgSourcePrivate *priv;
118
priv = self->priv = SOURCE_PRIVATE (self);
120
priv->store = gtk_list_store_new (3, G_TYPE_ICON, G_TYPE_OBJECT, G_TYPE_STRING);
124
bg_source_get_liststore (BgSource *source)
126
g_return_val_if_fail (BG_IS_SOURCE (source), NULL);
128
return source->priv->store;