2 * irreco - Ir Remote Control
3 * Copyright (C) 2007,2008 Arto Karppinen (arto.karppinen@iki.fi)
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program 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
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include "irreco_internal_widget.h"
23 * @addtogroup IrrecoInternalWidget
26 * A widget class which has IrrecoData construction property.
33 * Source file of @ref IrrecoInternalWidget.
38 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
40 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
48 typedef struct _IrrecoInternalWidgetPrivate IrrecoInternalWidgetPrivate
;
49 struct _IrrecoInternalWidgetPrivate
{
50 IrrecoData
*irreco_data
;
53 #define _GET_PRIVATE(_self) \
54 G_TYPE_INSTANCE_GET_PRIVATE( \
55 IRRECO_INTERNAL_WIDGET(_self), \
56 IRRECO_TYPE_INTERNAL_WIDGET, \
57 IrrecoInternalWidgetPrivate);
61 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
63 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
67 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
68 /* Construction & Destruction */
69 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
72 * @name Construction & Destruction
76 G_DEFINE_TYPE(IrrecoInternalWidget
, irreco_internal_widget
, GTK_TYPE_VBOX
)
79 irreco_internal_widget_init (IrrecoInternalWidget
*object
)
81 /* TODO: Add initialization code here */
85 irreco_internal_widget_finalize (GObject
*object
)
87 /* TODO: Add deinitalization code here */
89 G_OBJECT_CLASS (irreco_internal_widget_parent_class
)->finalize (object
);
93 irreco_internal_widget_set_property (GObject
*object
, guint prop_id
, const GValue
*value
, GParamSpec
*pspec
)
95 IrrecoInternalWidgetPrivate
*priv
= NULL
;
96 g_return_if_fail (IRRECO_IS_INTERNAL_WIDGET (object
));
100 case PROP_IRRECO_DATA
:
101 priv
= _GET_PRIVATE(object
);
102 priv
->irreco_data
= (IrrecoData
*) g_value_get_pointer(value
);
105 G_OBJECT_WARN_INVALID_PROPERTY_ID (object
, prop_id
, pspec
);
111 irreco_internal_widget_get_property (GObject
*object
, guint prop_id
, GValue
*value
, GParamSpec
*pspec
)
113 IrrecoInternalWidgetPrivate
*priv
= NULL
;
114 g_return_if_fail (IRRECO_IS_INTERNAL_WIDGET (object
));
118 case PROP_IRRECO_DATA
:
119 priv
= _GET_PRIVATE(object
);
120 g_value_set_pointer(value
, priv
->irreco_data
);
123 G_OBJECT_WARN_INVALID_PROPERTY_ID (object
, prop_id
, pspec
);
129 irreco_internal_widget_class_init (IrrecoInternalWidgetClass
*klass
)
131 GObjectClass
* object_class
= G_OBJECT_CLASS (klass
);
132 /*GtkHBoxClass* parent_class = GTK_HBOX_CLASS (klass);*/
134 object_class
->finalize
= irreco_internal_widget_finalize
;
135 object_class
->set_property
= irreco_internal_widget_set_property
;
136 object_class
->get_property
= irreco_internal_widget_get_property
;
138 g_type_class_add_private(klass
, sizeof (IrrecoInternalWidgetPrivate
));
140 g_object_class_install_property(
143 g_param_spec_pointer(
149 G_PARAM_CONSTRUCT_ONLY
));
156 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
157 /* Public Functions */
158 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
161 * @name Public Functions
165 IrrecoData
*irreco_internal_widget_get_irreco_data(IrrecoInternalWidget
*self
)
167 IrrecoInternalWidgetPrivate
*priv
= NULL
;
170 priv
= _GET_PRIVATE(self
);
171 IRRECO_RETURN_PTR(priv
->irreco_data
);