summaryrefslogtreecommitdiff
path: root/glib/glibmm/propertyproxy_base.cc
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2023-03-31 15:24:13 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2023-03-31 15:24:13 +0200
commit98f3b67b5c1bd71d0e7b41193fb4683fc957e321 (patch)
tree1fa8a4cf1bf9a93a79bfe08be83426bb15da01e9 /glib/glibmm/propertyproxy_base.cc
parentb7ad9b86d70003c065606c563578cc66dcd2ce0a (diff)
downloadglibmm-2-76.tar.gz
Glib: Use callback functions with C linkageglibmm-2-76
* gio/src/cancellable.ccg: Add TODO comment. * glib/glibmm/class.cc: Call custom_class_base_finalize_function() and custom_class_init_function() via local functions with C linkage. * glib/glibmm/extraclassinit.h: Point out in the class documentation that the class init and instance init functions shall have C linkage. * glib/glibmm/main.[cc|h]: Call prepare_vfunc(), check_vfunc() and dispatch_vfunc() via local functions with C linkage. * glib/glibmm/objectbase.cc: Call destroy_notify_callback() via a local function with C linkage. * glib/glibmm/propertyproxy_base.cc: Call PropertyProxyConnectionNode:: callback() and destroy_notify_handler() via local functions with C linkage. * glib/glibmm/signalproxy.cc: Call SignalProxyNormal::slot0_void_callback() and SignalProxyConnectionNode::destroy_notify_handler() via local functions with C linkage. * glib/src/binding.ccg: Add extern "C". * glib/src/bytearray.ccg: Add a TODO comment. * glib/src/markup.ccg: Call functions in the vfunc table via local functions with C linkage. * glib/src/optioncontext.ccg: Add extern "C". * glib/src/optiongroup.ccg: Call post_parse_callback() and option_arg_callback() via local functions with C linkage. Part of issue #1
Diffstat (limited to 'glib/glibmm/propertyproxy_base.cc')
-rw-r--r--glib/glibmm/propertyproxy_base.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/glib/glibmm/propertyproxy_base.cc b/glib/glibmm/propertyproxy_base.cc
index bc643498..b062bb68 100644
--- a/glib/glibmm/propertyproxy_base.cc
+++ b/glib/glibmm/propertyproxy_base.cc
@@ -23,6 +23,24 @@
#include <glibmm/private/object_p.h>
#include <utility> // For std::move()
+namespace
+{
+extern "C"
+{
+// From functions with C linkage to public static member functions with C++ linkage
+static void PropertyProxyConnectionNode_callback(GObject* object, GParamSpec* pspec, gpointer data)
+{
+ Glib::PropertyProxyConnectionNode::callback(object, pspec, data);
+}
+
+static void PropertyProxyConnectionNode_destroy_notify_handler(gpointer data, GClosure* closure)
+{
+ // It's actually in the base class SignalProxyConnectionNode
+ Glib::PropertyProxyConnectionNode::destroy_notify_handler(data, closure);
+}
+} // extern "C"
+} // anonymous namespace
+
namespace Glib
{
@@ -55,8 +73,8 @@ PropertyProxyConnectionNode::connect_changed(const Glib::ustring& property_name)
// 'this' will be passed as the data argument to the callback.
const Glib::ustring notify_signal_name = get_detailed_signal_name("notify", property_name);
connection_id_ = g_signal_connect_data(object_, notify_signal_name.c_str(),
- (GCallback)(&PropertyProxyConnectionNode::callback), this,
- &PropertyProxyConnectionNode::destroy_notify_handler, G_CONNECT_AFTER);
+ (GCallback)(&PropertyProxyConnectionNode_callback), this,
+ &PropertyProxyConnectionNode_destroy_notify_handler, G_CONNECT_AFTER);
return sigc::connection(slot_);
}