medit/moo/moocpp/gobjptrtypes-glib.cpp

57 lines
1.7 KiB
C++
Raw Normal View History

2016-01-02 04:31:23 -08:00
/*
* moocpp/gobjptrtypes-glib.cpp
*
* Copyright (C) 2004-2016 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
*
* This file is part of medit. medit is free software; you can
* redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License,
* or (at your option) any later version.
*
* You should have received a copy of the GNU Lesser General Public
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
*/
#include "moocpp/gobjptrtypes-glib.h"
using namespace moo;
const gobjptr<GObject>& mg_gobjptr_accessor_base::self() const
{
return gobjptr<GObject>::from_accessor(static_cast<const mg_gobjptr_accessor<GObject>&>(*this));
}
GObject* mg_gobjptr_accessor_base::g() const
{
return self().get();
}
gulong mg_gobjptr_accessor_base::signal_connect(const char *detailed_signal, GCallback c_handler, void *data) const
{
return g_signal_connect(g(), detailed_signal, c_handler, data);
}
gulong mg_gobjptr_accessor_base::signal_connect_swapped(const char *detailed_signal, GCallback c_handler, void *data) const
{
return g_signal_connect_swapped(g(), detailed_signal, c_handler, data);
}
void mg_gobjptr_accessor_base::set_data(const char* key, gpointer value) const
{
g_object_set_data(g(), key, value);
}
void mg_gobjptr_accessor_base::set(const gchar *first_prop, ...) const
{
va_list args;
va_start(args, first_prop);
g_object_set_valist(g(), first_prop, args);
va_end(args);
}
void mg_gobjptr_accessor_base::set_property(const gchar *property_name, const GValue *value) const
{
g_object_set_property(g(), property_name, value);
}