QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
paramspec.cpp
00001 /*
00002     Copyright (C) 2009-2010  George Kiagiadakis <kiagiadakis.george@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as published
00006     by the Free Software Foundation; either version 2.1 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 #include "paramspec.h"
00018 #include "string.h"
00019 #include "quark.h"
00020 #include <glib-object.h>
00021 
00022 namespace QGlib {
00023 
00024 QString ParamSpec::name() const
00025 {
00026     return QString::fromUtf8(g_param_spec_get_name(object<GParamSpec>()));
00027 }
00028 
00029 QString ParamSpec::nick() const
00030 {
00031     return QString::fromUtf8(g_param_spec_get_nick(object<GParamSpec>()));
00032 }
00033 
00034 QString ParamSpec::description() const
00035 {
00036     return QString::fromUtf8(g_param_spec_get_blurb(object<GParamSpec>()));
00037 }
00038 
00039 ParamSpec::ParamFlags ParamSpec::flags() const
00040 {
00041     return ParamFlags(object<GParamSpec>()->flags);
00042 }
00043 
00044 Type ParamSpec::valueType() const
00045 {
00046     return Type(G_PARAM_SPEC_VALUE_TYPE(object<GParamSpec>()));
00047 }
00048 
00049 Type ParamSpec::ownerType() const
00050 {
00051     return Type(object<GParamSpec>()->owner_type);
00052 }
00053 
00054 void *ParamSpec::quarkData(const Quark & quark) const
00055 {
00056     return g_param_spec_get_qdata(object<GParamSpec>(), quark);
00057 }
00058 
00059 void *ParamSpec::stealQuarkData(const Quark & quark) const
00060 {
00061     return g_param_spec_steal_qdata(object<GParamSpec>(), quark);
00062 }
00063 
00064 void ParamSpec::setQuarkData(const Quark & quark, void *data, void (*destroyCallback)(void*))
00065 {
00066     g_param_spec_set_qdata_full(object<GParamSpec>(), quark, data, destroyCallback);
00067 }
00068 
00069 void ParamSpec::ref(bool increaseRef)
00070 {
00071     if (increaseRef) {
00072         g_param_spec_ref(G_PARAM_SPEC(m_object));
00073     }
00074 }
00075 
00076 void ParamSpec::unref()
00077 {
00078     g_param_spec_unref(G_PARAM_SPEC(m_object));
00079 }
00080 
00081 } //namespace QGlib