Merge branch 'master' of ssh://pege77@mercury.wipsl.com/var/git/irreco-theme-editor
[irreco.git] / irreco / src / core / irreco_internal_dlg.c
blobcd35a39a9898ba4615b499f8c989b5b1cb94618e
1 /*
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_dlg.h"
22 /**
23 * @addtogroup IrrecoInternalDlg
24 * @ingroup Irreco
26 * A dialog class which has IrrecoData construction property.
28 * @{
31 /**
32 * @file
33 * Source file of @ref IrrecoInternalDlg.
38 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
39 /* Datatypes */
40 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
42 enum
44 PROP_0,
45 PROP_IRRECO_DATA
48 typedef struct _IrrecoInternalDlgPrivate IrrecoInternalDlgPrivate;
49 struct _IrrecoInternalDlgPrivate {
50 IrrecoData *irreco_data;
53 #define _GET_PRIVATE(_self) \
54 G_TYPE_INSTANCE_GET_PRIVATE( \
55 IRRECO_INTERNAL_DLG(_self), \
56 IRRECO_TYPE_INTERNAL_DLG, \
57 IrrecoInternalDlgPrivate);
61 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
62 /* Prototypes */
63 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
67 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
68 /* Construction & Destruction */
69 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
71 /**
72 * @name Construction & Destruction
73 * @{
76 G_DEFINE_TYPE(IrrecoInternalDlg, irreco_internal_dlg, IRRECO_TYPE_DLG)
78 static void
79 irreco_internal_dlg_init(IrrecoInternalDlg *object)
81 /* TODO: Add initialization code here */
84 static void
85 irreco_internal_dlg_finalize(GObject *object)
87 /* TODO: Add deinitalization code here */
89 G_OBJECT_CLASS(irreco_internal_dlg_parent_class)->finalize (object);
92 static void
93 irreco_internal_dlg_set_property(GObject *object, guint prop_id,
94 const GValue *value, GParamSpec *pspec)
96 IrrecoInternalDlgPrivate *priv = NULL;
97 g_return_if_fail (IRRECO_IS_INTERNAL_DLG (object));
99 switch (prop_id)
101 case PROP_IRRECO_DATA:
102 priv = _GET_PRIVATE(object);
103 priv->irreco_data = (IrrecoData*) g_value_get_pointer(value);
104 break;
105 default:
106 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
107 break;
111 static void
112 irreco_internal_dlg_get_property(GObject *object, guint prop_id,
113 GValue *value, GParamSpec *pspec)
115 IrrecoInternalDlgPrivate *priv = NULL;
116 g_return_if_fail (IRRECO_IS_INTERNAL_DLG (object));
118 switch (prop_id)
120 case PROP_IRRECO_DATA:
121 priv = _GET_PRIVATE(object);
122 g_value_set_pointer(value, priv->irreco_data);
123 break;
124 default:
125 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
126 break;
130 static void
131 irreco_internal_dlg_class_init(IrrecoInternalDlgClass *klass)
133 GObjectClass* object_class = G_OBJECT_CLASS (klass);
134 /*IrrecoDlgClass* parent_class = IRRECO_DLG_CLASS (klass);*/
136 object_class->finalize = irreco_internal_dlg_finalize;
137 object_class->set_property = irreco_internal_dlg_set_property;
138 object_class->get_property = irreco_internal_dlg_get_property;
140 g_type_class_add_private(klass, sizeof (IrrecoInternalDlgPrivate));
142 g_object_class_install_property(
143 object_class,
144 PROP_IRRECO_DATA,
145 g_param_spec_pointer(
146 "irreco-data",
147 "irreco-data",
148 "IrrecoData",
149 G_PARAM_CONSTRUCT_ONLY |
150 G_PARAM_WRITABLE |
151 G_PARAM_READABLE));
154 /** @} */
158 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
159 /* Public Functions */
160 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
163 * @name Public Functions
164 * @{
167 IrrecoData *irreco_internal_dlg_get_irreco_data(IrrecoInternalDlg *self)
169 IrrecoInternalDlgPrivate *priv = NULL;
170 IRRECO_ENTER
172 priv = _GET_PRIVATE(self);
173 IRRECO_RETURN_PTR(priv->irreco_data);
176 /** @} */
178 /** @} */