medit/moo/moocpp/gobjptrtypes-glib.cpp

86 lines
2.3 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;
2016-01-04 09:56:33 -08:00
using namespace g;
2016-01-02 04:31:23 -08:00
2016-01-04 09:56:33 -08:00
gulong Object::signal_connect(const char *detailed_signal, GCallback c_handler, void *data)
2016-01-02 04:31:23 -08:00
{
2016-01-03 05:13:00 -08:00
return g_signal_connect(gobj(), detailed_signal, c_handler, data);
2016-01-02 04:31:23 -08:00
}
2016-01-04 09:56:33 -08:00
gulong Object::signal_connect_swapped(const char *detailed_signal, GCallback c_handler, void *data)
2016-01-02 04:31:23 -08:00
{
2016-01-03 05:13:00 -08:00
return g_signal_connect_swapped(gobj(), detailed_signal, c_handler, data);
2016-01-02 04:31:23 -08:00
}
2016-01-04 09:56:33 -08:00
void Object::signal_emit_by_name(const char* detailed_signal, ...)
2016-01-04 03:56:42 -08:00
{
guint signal_id;
GQuark detail;
g_return_if_fail(g_signal_parse_name(detailed_signal,
G_OBJECT_TYPE(gobj()),
&signal_id, &detail,
true));
va_list args;
va_start(args, detailed_signal);
g_signal_emit_valist(gobj(), signal_id, detail, args);
va_end(args);
}
2016-01-04 09:56:33 -08:00
void Object::signal_emit(guint signal_id, GQuark detail, ...)
2016-01-04 03:56:42 -08:00
{
va_list args;
va_start(args, detail);
g_signal_emit_valist(gobj(), signal_id, detail, args);
va_end(args);
}
2016-01-04 09:56:33 -08:00
void Object::set_data(const char* key, gpointer value)
2016-01-02 04:31:23 -08:00
{
2016-01-03 05:13:00 -08:00
g_object_set_data(gobj(), key, value);
2016-01-02 04:31:23 -08:00
}
2016-01-04 09:56:33 -08:00
void Object::set(const gchar *first_prop, ...)
2016-01-02 04:31:23 -08:00
{
va_list args;
va_start(args, first_prop);
2016-01-03 05:13:00 -08:00
g_object_set_valist(gobj(), first_prop, args);
2016-01-02 04:31:23 -08:00
va_end(args);
}
2016-01-04 09:56:33 -08:00
void Object::set_property(const gchar *property_name, const GValue *value)
2016-01-02 04:31:23 -08:00
{
2016-01-03 05:13:00 -08:00
g_object_set_property(gobj(), property_name, value);
2016-01-02 04:31:23 -08:00
}
2016-01-02 13:51:52 -08:00
2016-01-04 09:56:33 -08:00
void Object::notify(const char* property_name)
2016-01-04 03:56:42 -08:00
{
g_object_notify(gobj(), property_name);
}
2016-01-04 09:56:33 -08:00
void Object::freeze_notify()
2016-01-02 13:51:52 -08:00
{
2016-01-03 05:13:00 -08:00
g_object_freeze_notify(gobj());
2016-01-02 13:51:52 -08:00
}
2016-01-04 09:56:33 -08:00
void Object::thaw_notify()
2016-01-02 13:51:52 -08:00
{
2016-01-03 05:13:00 -08:00
g_object_thaw_notify(gobj());
2016-01-02 13:51:52 -08:00
}