QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
paramspec.cpp
1 /*
2  Copyright (C) 2009-2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
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 Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include "paramspec.h"
18 #include "string.h"
19 #include "quark.h"
20 #include <glib-object.h>
21 
22 namespace QGlib {
23 
24 QString ParamSpec::name() const
25 {
26  return QString::fromUtf8(g_param_spec_get_name(object<GParamSpec>()));
27 }
28 
29 QString ParamSpec::nick() const
30 {
31  return QString::fromUtf8(g_param_spec_get_nick(object<GParamSpec>()));
32 }
33 
34 QString ParamSpec::description() const
35 {
36  return QString::fromUtf8(g_param_spec_get_blurb(object<GParamSpec>()));
37 }
38 
39 ParamSpec::ParamFlags ParamSpec::flags() const
40 {
41  return ParamFlags(object<GParamSpec>()->flags);
42 }
43 
44 Type ParamSpec::valueType() const
45 {
46  return Type(G_PARAM_SPEC_VALUE_TYPE(object<GParamSpec>()));
47 }
48 
49 Type ParamSpec::ownerType() const
50 {
51  return Type(object<GParamSpec>()->owner_type);
52 }
53 
54 void *ParamSpec::quarkData(const Quark & quark) const
55 {
56  return g_param_spec_get_qdata(object<GParamSpec>(), quark);
57 }
58 
59 void *ParamSpec::stealQuarkData(const Quark & quark) const
60 {
61  return g_param_spec_steal_qdata(object<GParamSpec>(), quark);
62 }
63 
64 void ParamSpec::setQuarkData(const Quark & quark, void *data, void (*destroyCallback)(void*))
65 {
66  g_param_spec_set_qdata_full(object<GParamSpec>(), quark, data, destroyCallback);
67 }
68 
69 void ParamSpec::ref(bool increaseRef)
70 {
71  if (increaseRef) {
72  g_param_spec_ref(G_PARAM_SPEC(m_object));
73  }
74 }
75 
76 void ParamSpec::unref()
77 {
78  g_param_spec_unref(G_PARAM_SPEC(m_object));
79 }
80 
81 } //namespace QGlib