summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES115
-rw-r--r--ChangeLog5
-rw-r--r--configure.in4
-rw-r--r--examples/thread/dispatcher.cc14
-rw-r--r--examples/thread/dispatcher2.cc16
-rw-r--r--examples/thread/threadpool.cc2
-rw-r--r--glib/glibmm-2.4.pc.in2
-rw-r--r--glib/glibmm/dispatcher.cc11
-rw-r--r--glib/glibmm/dispatcher.h4
-rw-r--r--glib/glibmm/exceptionhandler.cc48
-rw-r--r--glib/glibmm/exceptionhandler.h2
-rw-r--r--glib/glibmm/main.cc112
-rw-r--r--glib/glibmm/main.h24
-rw-r--r--glib/glibmm/objectbase.h6
-rw-r--r--glib/glibmm/propertyproxy_base.cc26
-rw-r--r--glib/glibmm/propertyproxy_base.h4
-rw-r--r--glib/glibmm/signalproxy.cc30
-rw-r--r--glib/glibmm/signalproxy_connectionnode.cc51
-rw-r--r--glib/glibmm/signalproxy_connectionnode.h18
-rw-r--r--glib/glibmm/threadpool.cc20
-rw-r--r--glib/glibmm/threadpool.h2
-rw-r--r--glib/src/iochannel.ccg15
-rw-r--r--glib/src/iochannel.hg2
-rw-r--r--glib/src/markup.hg4
-rw-r--r--glib/src/signalproxy.h.m431
-rw-r--r--glib/src/spawn.ccg33
-rw-r--r--glib/src/spawn.hg12
-rw-r--r--glib/src/thread.ccg44
-rw-r--r--glib/src/thread.hg8
-rw-r--r--tools/m4/signal.m417
-rw-r--r--tools/m4/signalproxy_custom.m425
31 files changed, 268 insertions, 439 deletions
diff --git a/CHANGES b/CHANGES
index 3de00e27..8b137891 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,116 +1 @@
-*** #Include "gtkmm/something.h" instead of "gtk--/something.h"
-
-As well as using the new gtkmm name, this means that we don't need to move
-the old gtk-- 1.2 headers into a version-specific directory. However, the
-new gtkmm 2.0 headers are in a version-specific directory, so this won't
-happen again for gtkmm 2.2.
-
-*** Glib::ustring:
-
-glib::ustring has much the same interface as std::string,
-but contains UTF8 strings.
-Note that a normal ANSI string is also a UTF8 string, so,
-if you want to, you can use this class without every thinking about UTF8.
-
-Also, this class has conversions to and from std::string,
-so you can use a std::string instead of a glib::ustring -
-However, this will not work with multi-byte translations,
-just as normal C char* code wouldn't.
-
-In a perfect world the C++ Standard Library would contain a
-a UTF8 string, but it doesn't.
-
-*** The main window concept
-
-In gtkmm 1.2 you had to worry about the Window's delete_event signal to make your application quit properly. If you didn't or if you got it wrong then your Window would self-destruct and cause a segfault. This was tedious and difficult, and nobody really understood it.
-
-We've made life simpler by preventing Window from self-destructing, and adding the Gtk::Main::run(window) override. It shows the window, starts the event loop, and stops the event loop when the window is closed. You can think of it as a way to say 'This is the main application window.' or 'The window and the application have the same lifetime. The examples now demonstrate this simpler technique.
-
-*** Glib::RefPtr<>:
-
-Most of the GDK objects are now based on GObject,
-so we now have auto-generated classes for them. However, GObject is a bit
-stricter than GtkObject about how we can manage it's memory. We can only
-unref() a GObject, we can never destroy it. Therefore our C++ wrapper (which
-is used by the C GObject) must remain alive as long as the C instance. But of
-course it should be deleted when glib tells us that the C instance has died.
-
-Of course you don't want to worry about all that, so we've created RefPtr<>
-which does all that for you. Objects such as Gdk::Bitmap can now only be
-instantiated with a create() function. For instance,
-
-Glib::RefPtr<Gdk::Bitmap> bitmap
- = Gdk::Bitmap::create(window, data, width, height);
-
-You have no way of getting a bare Gdk::Bitmap.
-
-bitmap is then a smart pointer, so you can do this, much like a normal
-pointer:
-
-if(bitmap)
-{
- int depth = bitmap->get_depth().
-}
-
-When bitmap goes out of scope an unref() will happen in the background and you
-don't need to worry about it anymore.
-
-This should mean that you *never* need to ref()/unref() a Gdk
-object again. GTK+ is a little inconsistent about it's refcounting, though there
-are a loose set of rules. All gtkmm methods do any extra referencing for you, so
-you don't need to worry about that.
-
-*** Re-written GDK wrappers
-
-The GDK wrappers are now auto-generated and are in the Gdk namespace. With the use of Glib::RefPtr<> you no longer need to worry about ref-counting issues.
-
-*** Clearly-named default signal handlers
-
-Default signal handlers were previously suffixed with _impl - for instance, Button::clicked_impl(). Now that they are prefixed with on_ - for instance, Button::on_clicked() is is much easier to see that they are signal handlers that are worthwhile to override in derived classes.
-
-*** signals prefixed by signal_
-
-For instance, Button::clicked is now Button::signal_clicked. This makes the API and your code clearer, while also avoiding clashes with methods of the same name - for instance, Button::clicked().
-
-*** signals connected via signal accessors.
-
-For instance,
- gtkmm 1.2: button.clicked.connect(SigC::slot(this, &Something::somemethod));
- gtkmm 1.3: button.signal_clicked().connect(SigC::slot(*this, &Something::somemethod));
-
-*** C++ types used in signal handlers
-
-Signal handlers now use C++ types, just like other C++ methods.
-
-*** Signals do not have slots.
-
-In gtkmm1.2, you could connect a Signal to the 'Slot' of another signal, for instance Gtk::Main::quit.slot(). The actual action that then happened when the signal was emitted was quite arbitrary. These slots did not have any consistent connection with the signal. Therefore we have removed this idea.
-
-*** Namespaced enums:
-
-gtkmm interfaces now use C++ enums rather than the original GTK+ enums.
-
-*** properties:
-
-GTK+ properties can be used like so:
-
-someobject.property_something().set_value(2);
-int value = someobject.property_something().get_value();
-
-or alternatively:
-
-someobject.property_something() = 2;
-int value = someobject.property_something();
-
-*** GTK+ changes:
-
-Methods and classes that are now deprecated in GTK+ 2.0 are not wrapped in gtkmm 2.0.
-
-
-Implementation Changes:
-
-*** Much clearer, better documented, more maintainable code-generating code.
-*** Use of gtk+'s .defs C interface-definition format, parsed by perl.
-*** Seperate .hg/.ccg files parsed by perl.
-*** Wrappers for GObject, GtkObject, and Boxed Types.
diff --git a/ChangeLog b/ChangeLog
index 7e9976f3..32fe17c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-10 Murray Cumming <murrayc@usa.net>
+
+ * glibmm now uses libsigc++ 2 instead of libsigc++ 1.2. See bug
+ #125061 for more details. We must update CHANGES later.
+
2.3.4:
2004-02-02 Murray Cumming <murrayc@usa.net>
diff --git a/configure.in b/configure.in
index 246eacb2..d283b5c2 100644
--- a/configure.in
+++ b/configure.in
@@ -116,10 +116,10 @@ AC_CHECK_FUNCS([flockfile funlockfile getc_unlocked])
#########################################################################
# Dependancy checks
#########################################################################
-gtkmm_min_sigc_version=1.2.0
+gtkmm_min_sigc_version=1.9.9
gtkmm_min_glib_version=2.2.0
-PKG_CHECK_MODULES(GLIBMM, sigc++-1.2 >= ${gtkmm_min_sigc_version} glib-2.0 >= ${gtkmm_min_glib_version} gobject-2.0 >= ${gtkmm_min_glib_version} gmodule-2.0 >= ${gtkmm_min_glib_version})
+PKG_CHECK_MODULES(GLIBMM, sigc++-2.0 >= ${gtkmm_min_sigc_version} glib-2.0 >= ${gtkmm_min_glib_version} gobject-2.0 >= ${gtkmm_min_glib_version} gmodule-2.0 >= ${gtkmm_min_glib_version})
AC_SUBST(GLIBMM_CFLAGS)
AC_SUBST(GLIBMM_LIBS)
diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc
index 3971be8c..cfbd7c01 100644
--- a/examples/thread/dispatcher.cc
+++ b/examples/thread/dispatcher.cc
@@ -20,7 +20,7 @@ namespace
{
Glib::RefPtr<Glib::MainLoop> main_loop;
-class ThreadProgress : public SigC::Object
+class ThreadProgress : public sigc::trackable
{
public:
ThreadProgress(int id, Glib::Mutex& mtx);
@@ -28,7 +28,7 @@ public:
void launch();
- typedef SigC::Signal1<void, ThreadProgress*> type_signal_finished;
+ typedef sigc::signal<void, ThreadProgress*> type_signal_finished;
type_signal_finished& signal_finished();
int id() const;
@@ -44,7 +44,7 @@ private:
};
//TODO: Rename to avoid confusion with Glib::Dispatcher.
-class Dispatcher : public SigC::Object
+class Dispatcher : public sigc::trackable
{
public:
Dispatcher();
@@ -65,7 +65,7 @@ ThreadProgress::ThreadProgress(int id, Glib::Mutex& mtx)
progress_ (0), id_ (id), cout_mutex_ (mtx)
{
// Connect to the cross-thread signal.
- signal_increment_.connect(SigC::slot(*this, &ThreadProgress::progress_increment));
+ signal_increment_.connect(sigc::mem_fun(*this, &ThreadProgress::progress_increment));
}
ThreadProgress::~ThreadProgress()
@@ -74,7 +74,7 @@ ThreadProgress::~ThreadProgress()
void ThreadProgress::launch()
{
// Create a non-joinable thread -- it's deleted automatically on thread exit.
- Glib::Thread::create(SigC::slot_class(*this, &ThreadProgress::thread_function), false);
+ Glib::Thread::create(sigc::mem_fun(*this, &ThreadProgress::thread_function), false);
}
ThreadProgress::type_signal_finished& ThreadProgress::signal_finished()
@@ -128,7 +128,7 @@ Dispatcher::Dispatcher()
progress_list_.push_back(progress);
progress->signal_finished().connect(
- SigC::slot(*this, &Dispatcher::on_progress_finished));
+ sigc::mem_fun(*this, &Dispatcher::on_progress_finished));
}
}
@@ -166,7 +166,7 @@ int main(int argc, char** argv)
// Install a one-shot idle handler to launch the threads
Glib::signal_idle().connect(
- SigC::bind_return(SigC::slot(dispatcher, &Dispatcher::launch_threads), false));
+ sigc::bind_return(sigc::mem_fun(dispatcher, &Dispatcher::launch_threads), false));
main_loop->run();
diff --git a/examples/thread/dispatcher2.cc b/examples/thread/dispatcher2.cc
index 70e65ab5..c2270181 100644
--- a/examples/thread/dispatcher2.cc
+++ b/examples/thread/dispatcher2.cc
@@ -30,7 +30,7 @@ namespace
{
Glib::RefPtr<Glib::MainLoop> main_loop;
-class ThreadTimer : public SigC::Object
+class ThreadTimer : public sigc::trackable
{
public:
ThreadTimer();
@@ -61,7 +61,7 @@ private:
};
//TODO: Rename to avoid confusion with Glib::Dispatcher. murrayc
-class Dispatcher : public SigC::Object
+class Dispatcher : public sigc::trackable
{
public:
Dispatcher();
@@ -82,7 +82,7 @@ ThreadTimer::ThreadTimer()
signal_finished_ptr_ (NULL)
{
// Connect the cross-thread signal.
- signal_increment_.connect(SigC::slot(*this, &ThreadTimer::timer_increment));
+ signal_increment_.connect(sigc::mem_fun(*this, &ThreadTimer::timer_increment));
}
ThreadTimer::~ThreadTimer()
@@ -98,7 +98,7 @@ void ThreadTimer::launch()
// Create a joinable thread -- it needs to be joined, otherwise it's a memory leak.
thread_ = Glib::Thread::create(
- SigC::slot_class(*this, &ThreadTimer::thread_function), true);
+ sigc::mem_fun(*this, &ThreadTimer::thread_function), true);
// Wait for the 2nd thread's startup notification.
while(signal_finished_ptr_ == NULL)
@@ -164,7 +164,7 @@ void ThreadTimer::thread_function()
// attach a timeout handler, that is called every second, to the
// newly created MainContext
- context->signal_timeout().connect(SigC::slot(*this, &ThreadTimer::timeout_handler), 1000);
+ context->signal_timeout().connect(sigc::mem_fun(*this, &ThreadTimer::timeout_handler), 1000);
// We need to lock while creating the Dispatcher instance,
// in order to ensure memory visibility.
@@ -173,7 +173,7 @@ void ThreadTimer::thread_function()
// create a new dispatcher, that is connected to the newly
// created MainContext
Glib::Dispatcher signal_finished (context);
- signal_finished.connect(SigC::bind(SigC::slot(&ThreadTimer::finished_handler), mainloop));
+ signal_finished.connect(sigc::bind(sigc::ptr_fun(&ThreadTimer::finished_handler), mainloop));
signal_finished_ptr_ = &signal_finished;
@@ -195,7 +195,7 @@ Dispatcher::Dispatcher()
std::cout << "Thread Dispatcher Example #2" << std::endl;
timer_ = new ThreadTimer();
- timer_->signal_end().connect(SigC::slot(*this, &Dispatcher::end));
+ timer_->signal_end().connect(sigc::mem_fun(*this, &Dispatcher::end));
timer_->print();
}
@@ -223,7 +223,7 @@ int main(int argc, char** argv)
// Install a one-shot idle handler to launch the threads
Glib::signal_idle().connect(
- SigC::bind_return(SigC::slot(dispatcher, &Dispatcher::launch_thread), false));
+ sigc::bind_return(sigc::mem_fun(dispatcher, &Dispatcher::launch_thread), false));
main_loop->run();
diff --git a/examples/thread/threadpool.cc b/examples/thread/threadpool.cc
index 721f7f2f..9fc58888 100644
--- a/examples/thread/threadpool.cc
+++ b/examples/thread/threadpool.cc
@@ -36,7 +36,7 @@ int main(int, char**)
Glib::ThreadPool pool (10);
for(char c = 'a'; c <= 'z'; ++c)
- pool.push(SigC::bind(SigC::slot(&print_char), c));
+ pool.push(sigc::bind(sigc::ptr_fun(&print_char), c));
pool.shutdown();
diff --git a/glib/glibmm-2.4.pc.in b/glib/glibmm-2.4.pc.in
index 88a76a87..afe813b8 100644
--- a/glib/glibmm-2.4.pc.in
+++ b/glib/glibmm-2.4.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: GLibmm
Description: C++ wrapper for GLib
-Requires: gobject-2.0 sigc++-1.2
+Requires: gobject-2.0 sigc++-2.0
Version: @VERSION@
Libs: -L${libdir} -lglibmm-2.3
Cflags: -I${includedir}/glibmm-2.3 -I${libdir}/glibmm-2.3/include
diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc
index cc104b83..8d698687 100644
--- a/glib/glibmm/dispatcher.cc
+++ b/glib/glibmm/dispatcher.cc
@@ -23,7 +23,6 @@
#include <glibmm/fileutils.h>
#include <glibmm/main.h>
#include <glibmm/thread.h>
-#include <sigc++/class_slot.h>
#include <fcntl.h>
#include <cerrno>
@@ -192,7 +191,7 @@ private:
#else
FD_TYPE fd_sender_;
#endif /* G_OS_WIN32 */
- SigC::Connection conn_io_handler_;
+ sigc::connection conn_io_handler_;
void create_pipe();
bool pipe_io_handler(Glib::IOCondition condition);
@@ -223,11 +222,11 @@ DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
{
#ifdef G_OS_WIN32
conn_io_handler_ = context_->signal_io().connect(
- SigC::slot_class(*this, &DispatchNotifier::pipe_io_handler),
+ sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler),
GPOINTER_TO_INT(fd_receiver_), Glib::IO_IN);
#else
conn_io_handler_ = context_->signal_io().connect(
- SigC::slot_class(*this, &DispatchNotifier::pipe_io_handler),
+ sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler),
fd_receiver_, Glib::IO_IN);
#endif /* G_OS_WIN32 */
}
@@ -244,7 +243,7 @@ DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
DispatchNotifier::~DispatchNotifier()
{
- // Disconnect manually because we're using SigC::slot_class().
+ // Disconnect manually because we don't inherit from sigc::trackable
conn_io_handler_.disconnect();
#ifndef G_OS_WIN32
@@ -465,7 +464,7 @@ void Dispatcher::operator()()
emit();
}
-SigC::Connection Dispatcher::connect(const SigC::Slot0<void>& slot)
+sigc::connection Dispatcher::connect(const sigc::slot<void>& slot)
{
return signal_.connect(slot);
}
diff --git a/glib/glibmm/dispatcher.h b/glib/glibmm/dispatcher.h
index 7e086883..d4bc802b 100644
--- a/glib/glibmm/dispatcher.h
+++ b/glib/glibmm/dispatcher.h
@@ -76,10 +76,10 @@ public:
void emit();
void operator()();
- SigC::Connection connect(const SigC::Slot0<void>& slot);
+ sigc::connection connect(const sigc::slot<void>& slot);
private:
- SigC::Signal0<void> signal_;
+ sigc::signal<void> signal_;
DispatchNotifier* notifier_;
// noncopyable
diff --git a/glib/glibmm/exceptionhandler.cc b/glib/glibmm/exceptionhandler.cc
index f4847832..7c468156 100644
--- a/glib/glibmm/exceptionhandler.cc
+++ b/glib/glibmm/exceptionhandler.cc
@@ -36,45 +36,13 @@ GLIBMM_USING_STD(list)
namespace
{
-typedef std::list< SigC::Slot0<void> > HandlerList;
+typedef sigc::signal<void> HandlerList;
// Each thread has its own list of exception handlers
// to avoid thread synchronization problems.
Glib::StaticPrivate<HandlerList> thread_specific_handler_list = GLIBMM_STATIC_PRIVATE_INIT;
-class HandlerConnectionNode : public SigC::ConnectionNode
-{
-public:
- explicit HandlerConnectionNode(const SigC::Slot0<void>& slot)
- : SigC::ConnectionNode(static_cast<SigC::SlotNode*>(slot.impl())) {}
-
- virtual void notify(bool from_child);
-};
-
-void HandlerConnectionNode::notify(bool from_child)
-{
- if(HandlerList *const handler_list = thread_specific_handler_list.get())
- {
- // We can't use remove_if() because it's possible to insert the same
- // slot multiple times, although unlikely. std::list<>::remove_if()
- // would remove only the first matching element.
-
- HandlerList::iterator pslot = handler_list->begin();
-
- while(pslot != handler_list->end())
- {
- if(pslot->impl() == slot().impl())
- pslot = handler_list->erase(pslot);
- else
- ++pslot;
- }
- }
-
- SigC::ConnectionNode::notify(from_child);
-}
-
-
void glibmm_exception_warning(const GError* error)
{
g_assert(error != 0);
@@ -121,7 +89,7 @@ void glibmm_unexpected_exception()
namespace Glib
{
-SigC::Connection add_exception_handler(const SigC::Slot0<void>& slot)
+sigc::connection add_exception_handler(const sigc::slot<void>& slot)
{
HandlerList* handler_list = thread_specific_handler_list.get();
@@ -131,10 +99,8 @@ SigC::Connection add_exception_handler(const SigC::Slot0<void>& slot)
thread_specific_handler_list.set(handler_list);
}
- const SigC::Connection connection (new HandlerConnectionNode(slot));
- handler_list->push_front(slot);
-
- return connection;
+ handler_list->slots().push_front(slot);
+ return handler_list->slots().begin();
}
// internal
@@ -155,15 +121,15 @@ void exception_handlers_invoke() throw()
if(HandlerList *const handler_list = thread_specific_handler_list.get())
{
- HandlerList::iterator pslot = handler_list->begin();
+ HandlerList::iterator pslot = handler_list->slots().begin();
- while(pslot != handler_list->end())
+ while(pslot != handler_list->slots().end())
{
// Calling an empty slot would mean ignoring the exception,
// thus we have to check for dead slots explicitly.
if(pslot->empty())
{
- pslot = handler_list->erase(pslot);
+ pslot = handler_list->slots().erase(pslot);
continue;
}
diff --git a/glib/glibmm/exceptionhandler.h b/glib/glibmm/exceptionhandler.h
index ccbc239f..de1d68f4 100644
--- a/glib/glibmm/exceptionhandler.h
+++ b/glib/glibmm/exceptionhandler.h
@@ -31,7 +31,7 @@ namespace Glib
/** Specify a slot to be called when an exception is thrown by a signal handler.
*/
-SigC::Connection add_exception_handler(const SigC::Slot0<void>& slot);
+sigc::connection add_exception_handler(const sigc::slot<void>& slot);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// internal
diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc
index 3f9b4d5d..91e03180 100644
--- a/glib/glibmm/main.cc
+++ b/glib/glibmm/main.cc
@@ -33,58 +33,60 @@ GLIBMM_USING_STD(min)
namespace
{
-class SourceConnectionNode : public SigC::ConnectionNode
+class SourceConnectionNode
{
public:
- explicit inline SourceConnectionNode(const SigC::SlotBase& slot);
+ explicit inline SourceConnectionNode(const sigc::slot_base& slot);
- virtual void notify(bool from_child);
- static void destroy_notify_callback(void* data);
+ static void* notify(void* data);
+ static void destroy_notify_callback(void* data);
inline void install(GSource* source);
- inline SigC::SlotNode* get_slot_node();
+ inline sigc::slot_base* get_slot();
private:
+ sigc::slot_base slot_;
GSource* source_;
};
inline
-SourceConnectionNode::SourceConnectionNode(const SigC::SlotBase& slot)
+SourceConnectionNode::SourceConnectionNode(const sigc::slot_base& slot)
:
- SigC::ConnectionNode (static_cast<SigC::SlotNode*>(slot.impl())),
- source_ (0)
-{}
+ slot_ (slot),
+ source_ (0)
+{
+ slot_.set_parent(this, &SourceConnectionNode::notify);
+}
-void SourceConnectionNode::notify(bool from_child)
+void* SourceConnectionNode::notify(void* data)
{
- SigC::ConnectionNode::notify(from_child);
+ SourceConnectionNode *const self = static_cast<SourceConnectionNode*>(data);
- if(source_)
+ // if there is no object, this call was triggered from destroy_notify_handler().
+ if (self->source_)
{
- g_source_destroy(source_);
- source_ = 0;
+ GSource* s = self->source_;
+ self->source_ = 0;
+ g_source_destroy(self->source_);
+
+ delete self;
}
+
+ return 0;
}
// static
void SourceConnectionNode::destroy_notify_callback(void* data)
{
- try
- {
- SourceConnectionNode *const self = static_cast<SourceConnectionNode*>(data);
+ SourceConnectionNode *const self = static_cast<SourceConnectionNode*>(data);
+ // if there is no object, this call was triggered from notify().
+ if (self->source_)
+ {
// The GLib side is disconnected now, thus the GSource* is no longer valid.
self->source_ = 0;
- if(!self->notified_)
- self->notify(false);
-
- // Undo the reference made by install().
- self->unreference();
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
+ delete self;
}
}
@@ -92,13 +94,12 @@ inline
void SourceConnectionNode::install(GSource* source)
{
source_ = source;
- reference();
}
inline
-SigC::SlotNode* SourceConnectionNode::get_slot_node()
+sigc::slot_base* SourceConnectionNode::get_slot()
{
- return static_cast<SigC::SlotNode*>(slot().impl());
+ return &slot_;
}
@@ -185,11 +186,12 @@ gboolean glibmm_dummy_source_callback(void*)
*/
gboolean glibmm_source_callback(void* data)
{
+ SourceConnectionNode *const conn_data = static_cast<SourceConnectionNode*>(data);
+
try
{
// Recreate the specific slot from the generic slot node.
- SigC::Slot0<bool> slot (static_cast<SourceConnectionNode*>(data)->get_slot_node());
- return slot();
+ return (*static_cast<sigc::slot<bool>*>(conn_data->get_slot()))();
}
catch(...)
{
@@ -206,8 +208,8 @@ gboolean glibmm_iosource_callback(GIOChannel*, GIOCondition condition, void* dat
try
{
// Recreate the specific slot from the generic slot node.
- SigC::Slot1<bool,Glib::IOCondition> slot (callback_data->node->get_slot_node());
- return slot((Glib::IOCondition) condition);
+ return (*static_cast<sigc::slot<bool,Glib::IOCondition>*>(callback_data->node->get_slot()))
+ ((Glib::IOCondition) condition);
}
catch(...)
{
@@ -254,11 +256,11 @@ SignalTimeout::SignalTimeout(GMainContext* context)
context_ (context)
{}
-SigC::Connection SignalTimeout::connect(const SigC::Slot0<bool>& slot,
+sigc::connection SignalTimeout::connect(const sigc::slot<bool>& slot,
unsigned int interval, int priority)
{
SourceConnectionNode *const conn_node = new SourceConnectionNode(slot);
- const SigC::Connection connection (conn_node);
+ const sigc::connection connection (*conn_node->get_slot());
GSource *const source = g_timeout_source_new(interval);
@@ -290,10 +292,10 @@ SignalIdle::SignalIdle(GMainContext* context)
context_ (context)
{}
-SigC::Connection SignalIdle::connect(const SigC::Slot0<bool>& slot, int priority)
+sigc::connection SignalIdle::connect(const sigc::slot<bool>& slot, int priority)
{
SourceConnectionNode *const conn_node = new SourceConnectionNode(slot);
- const SigC::Connection connection (conn_node);
+ const sigc::connection connection (*conn_node->get_slot());
GSource *const source = g_idle_source_new();
@@ -325,7 +327,7 @@ SignalIO::SignalIO(GMainContext* context)
context_ (context)
{}
-SigC::Connection SignalIO::connect(const SigC::Slot1<bool,IOCondition>& slot,
+sigc::connection SignalIO::connect(const sigc::slot<bool,IOCondition>& slot,
int fd, IOCondition condition, int priority)
{
const Glib::RefPtr<IOSource> source = IOSource::create(fd, condition);
@@ -333,14 +335,14 @@ SigC::Connection SignalIO::connect(const SigC::Slot1<bool,IOCondition>& slot,
if(priority != G_PRIORITY_DEFAULT)
source->set_priority(priority);
- const SigC::Connection connection = source->connect(slot);
+ const sigc::connection connection = source->connect(slot);
g_source_attach(source->gobj(), context_);
return connection;
}
-SigC::Connection SignalIO::connect(const SigC::Slot1<bool,IOCondition>& slot,
+sigc::connection SignalIO::connect(const sigc::slot<bool,IOCondition>& slot,
const Glib::RefPtr<IOChannel>& channel,
IOCondition condition, int priority)
{
@@ -349,7 +351,7 @@ SigC::Connection SignalIO::connect(const SigC::Slot1<bool,IOCondition>& slot,
if(priority != G_PRIORITY_DEFAULT)
source->set_priority(priority);
- const SigC::Connection connection = source->connect(slot);
+ const sigc::connection connection = source->connect(slot);
g_source_attach(source->gobj(), context_);
@@ -699,10 +701,10 @@ Source::~Source()
}
}
-SigC::Connection Source::connect_generic(const SigC::SlotBase& slot)
+sigc::connection Source::connect_generic(const sigc::slot_base& slot)
{
SourceConnectionNode *const conn_node = new SourceConnectionNode(slot);
- const SigC::Connection connection (conn_node);
+ const sigc::connection connection (*conn_node->get_slot());
// Don't override the callback data. Reuse the existing one
// calling SourceCallbackData::set_node() to register conn_node.
@@ -776,7 +778,7 @@ gboolean Source::dispatch_vfunc(GSource*, GSourceFunc callback, void* user_data)
try
{
Source *const self = callback_data->wrapper;
- return self->dispatch(callback_data->node->get_slot_node());
+ return self->dispatch(callback_data->node->get_slot());
}
catch(...)
{
@@ -809,7 +811,7 @@ Glib::RefPtr<TimeoutSource> TimeoutSource::create(unsigned int interval)
return Glib::RefPtr<TimeoutSource>(new TimeoutSource(interval));
}
-SigC::Connection TimeoutSource::connect(const SigC::Slot0<bool>& slot)
+sigc::connection TimeoutSource::connect(const sigc::slot<bool>& slot)
{
return connect_generic(slot);
}
@@ -870,10 +872,9 @@ bool TimeoutSource::check()
return (expiration_ <= current_time);
}
-bool TimeoutSource::dispatch(SigC::SlotNode* slot_data)
+bool TimeoutSource::dispatch(sigc::slot_base* slot)
{
- SigC::Slot0<bool> slot (slot_data);
- const bool again = slot();
+ const bool again = (*static_cast<sigc::slot<bool>*>(slot))();
if(again)
{
@@ -893,7 +894,7 @@ Glib::RefPtr<IdleSource> IdleSource::create()
return Glib::RefPtr<IdleSource>(new IdleSource());
}
-SigC::Connection IdleSource::connect(const SigC::Slot0<bool>& slot)
+sigc::connection IdleSource::connect(const sigc::slot<bool>& slot)
{
return connect_generic(slot);
}
@@ -917,10 +918,9 @@ bool IdleSource::check()
return true;
}
-bool IdleSource::dispatch(SigC::SlotNode* slot_data)
+bool IdleSource::dispatch(sigc::slot_base* slot)
{
- SigC::Slot0<bool> slot (slot_data);
- return slot();
+ return (*static_cast<sigc::slot<bool>*>(slot))();
}
@@ -937,7 +937,7 @@ Glib::RefPtr<IOSource> IOSource::create(const Glib::RefPtr<IOChannel>& channel,
return Glib::RefPtr<IOSource>(new IOSource(channel, condition));
}
-SigC::Connection IOSource::connect(const SigC::Slot1<bool,IOCondition>& slot)
+sigc::connection IOSource::connect(const sigc::slot<bool,IOCondition>& slot)
{
return connect_generic(slot);
}
@@ -969,10 +969,10 @@ bool IOSource::check()
return ((poll_fd_.get_revents() & poll_fd_.get_events()) != 0);
}
-bool IOSource::dispatch(SigC::SlotNode* slot_data)
+bool IOSource::dispatch(sigc::slot_base* slot)
{
- SigC::Slot1<bool,IOCondition> slot (slot_data);
- return slot(poll_fd_.get_revents());
+ return (*static_cast<sigc::slot<bool,IOCondition>*>(slot))
+ (poll_fd_.get_revents());
}
} // namespace Glib
diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h
index c3c54756..599b444e 100644
--- a/glib/glibmm/main.h
+++ b/glib/glibmm/main.h
@@ -180,7 +180,7 @@ public:
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- SigC::Connection connect(const SigC::Slot0<bool>& slot, unsigned int interval,
+ sigc::connection connect(const sigc::slot<bool>& slot, unsigned int interval,
int priority = PRIORITY_DEFAULT);
private:
GMainContext* context_;
@@ -211,7 +211,7 @@ public:
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- SigC::Connection connect(const SigC::Slot0<bool>& slot, int priority = PRIORITY_DEFAULT_IDLE);
+ sigc::connection connect(const sigc::slot<bool>& slot, int priority = PRIORITY_DEFAULT_IDLE);
private:
GMainContext* context_;
@@ -246,7 +246,7 @@ public:
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- SigC::Connection connect(const SigC::Slot1<bool,IOCondition>& slot, int fd,
+ sigc::connection connect(const sigc::slot<bool,IOCondition>& slot, int fd,
IOCondition condition, int priority = PRIORITY_DEFAULT);
/** Connects an I/O channel.
@@ -267,7 +267,7 @@ public:
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- SigC::Connection connect(const SigC::Slot1<bool,IOCondition>& slot, const Glib::RefPtr<IOChannel>& channel,
+ sigc::connection connect(const sigc::slot<bool,IOCondition>& slot, const Glib::RefPtr<IOChannel>& channel,
IOCondition condition, int priority = PRIORITY_DEFAULT);
private:
@@ -577,7 +577,7 @@ protected:
virtual ~Source();
- SigC::Connection connect_generic(const SigC::SlotBase& slot);
+ sigc::connection connect_generic(const sigc::slot_base& slot);
/** Adds a file descriptor to the set of file descriptors polled for this source.
* The event source's check function will typically test the revents field in the PollFD and return true if events need to be processed.
@@ -597,7 +597,7 @@ protected:
virtual bool prepare(int& timeout) = 0;
virtual bool check() = 0;
- virtual bool dispatch(SigC::SlotNode* slot_data) = 0;
+ virtual bool dispatch(sigc::slot_base* slot) = 0;
private:
GSource* gobject_;
@@ -629,7 +629,7 @@ public:
typedef Glib::TimeoutSource CppObjectType;
static Glib::RefPtr<TimeoutSource> create(unsigned int interval);
- SigC::Connection connect(const SigC::Slot0<bool>& slot);
+ sigc::connection connect(const sigc::slot<bool>& slot);
protected:
explicit TimeoutSource(unsigned int interval);
@@ -637,7 +637,7 @@ protected:
virtual bool prepare(int& timeout);
virtual bool check();
- virtual bool dispatch(SigC::SlotNode* slot_data);
+ virtual bool dispatch(sigc::slot_base* slot);
private:
Glib::TimeVal expiration_;
@@ -651,7 +651,7 @@ public:
typedef Glib::IdleSource CppObjectType;
static Glib::RefPtr<IdleSource> create();
- SigC::Connection connect(const SigC::Slot0<bool>& slot);
+ sigc::connection connect(const sigc::slot<bool>& slot);
protected:
IdleSource();
@@ -659,7 +659,7 @@ protected:
virtual bool prepare(int& timeout);
virtual bool check();
- virtual bool dispatch(SigC::SlotNode* slot_data);
+ virtual bool dispatch(sigc::slot_base* slot_data);
};
@@ -670,7 +670,7 @@ public:
static Glib::RefPtr<IOSource> create(int fd, IOCondition condition);
static Glib::RefPtr<IOSource> create(const Glib::RefPtr<IOChannel>& channel, IOCondition condition);
- SigC::Connection connect(const SigC::Slot1<bool,IOCondition>& slot);
+ sigc::connection connect(const sigc::slot<bool,IOCondition>& slot);
protected:
IOSource(int fd, IOCondition condition);
@@ -679,7 +679,7 @@ protected:
virtual bool prepare(int& timeout);
virtual bool check();
- virtual bool dispatch(SigC::SlotNode* slot_data);
+ virtual bool dispatch(sigc::slot_base* slot);
private:
PollFD poll_fd_;
diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h
index c8adeeed..2b9fe1b6 100644
--- a/glib/glibmm/objectbase.h
+++ b/glib/glibmm/objectbase.h
@@ -23,7 +23,7 @@
#include <glibmm/signalproxy.h>
#include <glibmm/propertyproxy.h>
-#include <sigc++/object.h>
+#include <sigc++/trackable.h>
#include <typeinfo>
#include <glibmmconfig.h>
#include <glibmm/debug.h>
@@ -42,9 +42,9 @@ namespace Glib
class GSigConnectionNode;
#endif
-//This inherits virtually from Sigc::Object, so that people can multiply inherit glibmm classes from other SigC::Object-derived classes.
+//This inherits virtually from sgc::trackable so that people can multiply inherit glibmm classes from other SigC::Object-derived classes.
//See bugzilla.gnome.org bug # 116280
-class ObjectBase : virtual public SigC::Object
+class ObjectBase : virtual public sigc::trackable
{
protected:
// Glib::ObjectBase is used as virtual base class. This means the ObjectBase
diff --git a/glib/glibmm/propertyproxy_base.cc b/glib/glibmm/propertyproxy_base.cc
index 5583f629..dba3318d 100644
--- a/glib/glibmm/propertyproxy_base.cc
+++ b/glib/glibmm/propertyproxy_base.cc
@@ -36,8 +36,7 @@ class PropertyProxyConnectionNode : public SignalProxyConnectionNode
public:
friend class SignalProxyProperty;
- PropertyProxyConnectionNode(SigC::SlotNode* slot_data, GObject* gobject, const gchar* property_name);
- virtual ~PropertyProxyConnectionNode();
+ PropertyProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject, const gchar* property_name);
protected:
//This will be examined in the callback.
@@ -45,16 +44,12 @@ protected:
const gchar* property_name_;
};
-PropertyProxyConnectionNode::PropertyProxyConnectionNode(SigC::SlotNode* slot_data, GObject* gobject, const gchar* property_name)
-: SignalProxyConnectionNode(slot_data, gobject),
+PropertyProxyConnectionNode::PropertyProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject, const gchar* property_name)
+: SignalProxyConnectionNode(slot, gobject),
property_name_(property_name)
{
}
-PropertyProxyConnectionNode::~PropertyProxyConnectionNode()
-{
-}
-
//SignalProxyProperty implementation:
SignalProxyProperty::SignalProxyProperty(Glib::ObjectBase* obj, const gchar* property_name)
@@ -67,13 +62,10 @@ SignalProxyProperty::~SignalProxyProperty()
{
}
-SigC::Connection SignalProxyProperty::connect(const SlotType& sl)
+sigc::connection SignalProxyProperty::connect(const SlotType& sl)
{
- // create a proxy to hold our connection info
- PropertyProxyConnectionNode* pConnectionNode = new PropertyProxyConnectionNode( (SigC::SlotNode*)(sl.impl()), obj_->gobj(), property_name_ );
-
- // gtk+ will hold a reference to this object
- pConnectionNode->reference();
+ // create a proxy to hold our connection info
+ PropertyProxyConnectionNode* pConnectionNode = new PropertyProxyConnectionNode(sl, obj_->gobj(), property_name_ );
// connect it to gtk+
// pConnectionNode will be passed as the data argument to the callback.
@@ -84,7 +76,7 @@ SigC::Connection SignalProxyProperty::connect(const SlotType& sl)
&PropertyProxyConnectionNode::destroy_notify_handler,
G_CONNECT_AFTER);
- return SigC::Connection(pConnectionNode);
+ return sigc::connection(pConnectionNode->slot_);
}
void SignalProxyProperty::callback(GObject*, GParamSpec* pspec, gpointer data) //static
@@ -101,8 +93,8 @@ void SignalProxyProperty::callback(GObject*, GParamSpec* pspec, gpointer data) /
//If it's the correct property, then call the signal handler:
if(strcmp(property_name_changed, property_name_monitored) == 0)
{
- if(SigC::SlotNode *const slot = data_to_slot(data))
- (*(SlotType::Proxy)(slot->proxy_))(slot);
+ if(sigc::slot_base *const slot = data_to_slot(data))
+ (*static_cast<sigc::slot<void>*>(slot))();
}
}
}
diff --git a/glib/glibmm/propertyproxy_base.h b/glib/glibmm/propertyproxy_base.h
index 9799de36..743242ce 100644
--- a/glib/glibmm/propertyproxy_base.h
+++ b/glib/glibmm/propertyproxy_base.h
@@ -40,8 +40,8 @@ public:
SignalProxyProperty(Glib::ObjectBase* obj, const gchar* property_name);
~SignalProxyProperty();
- typedef SigC::Slot0<void> SlotType;
- SigC::Connection connect(const SlotType& sl);
+ typedef sigc::slot<void> SlotType;
+ sigc::connection connect(const SlotType& sl);
protected:
static void callback(GObject* object, GParamSpec* pspec, gpointer data);
diff --git a/glib/glibmm/signalproxy.cc b/glib/glibmm/signalproxy.cc
index f95450b4..67f7a929 100644
--- a/glib/glibmm/signalproxy.cc
+++ b/glib/glibmm/signalproxy.cc
@@ -25,7 +25,6 @@
#include <glibmm/exceptionhandler.h>
#include <glibmm/object.h>
#include <glibmm/signalproxy.h>
-#include <glibmm/signalproxy_connectionnode.h>
namespace Glib
@@ -50,27 +49,24 @@ SignalProxyNormal::SignalProxyNormal(Glib::ObjectBase* obj, const SignalProxyInf
SignalProxyNormal::~SignalProxyNormal()
{}
-SigC::ConnectionNode*
-SignalProxyNormal::connect_(const SigC::SlotBase& slot_base, bool after)
+sigc::slot_base&
+SignalProxyNormal::connect_(const sigc::slot_base& slot, bool after)
{
- return connect_impl_(info_->callback, slot_base, after);
+ return connect_impl_(info_->callback, slot, after);
}
-SigC::ConnectionNode*
-SignalProxyNormal::connect_notify_(const SigC::SlotBase& slot_base, bool after)
+sigc::slot_base&
+SignalProxyNormal::connect_notify_(const sigc::slot_base& slot, bool after)
{
- return connect_impl_(info_->notify_callback, slot_base, after);
+ return connect_impl_(info_->notify_callback, slot, after);
}
-SigC::ConnectionNode*
-SignalProxyNormal::connect_impl_(GCallback callback, const SigC::SlotBase& slot_base, bool after)
+sigc::slot_base&
+SignalProxyNormal::connect_impl_(GCallback callback, const sigc::slot_base& slot, bool after)
{
// create a proxy to hold our connection info
SignalProxyConnectionNode *const pConnectionNode =
- new SignalProxyConnectionNode(static_cast<SigC::SlotNode*>(slot_base.impl()), obj_->gobj());
-
- // glib will hold a reference to this object
- pConnectionNode->reference();
+ new SignalProxyConnectionNode(slot, obj_->gobj());
// connect it to glib
// pConnectionNode will be passed in the data argument to the callback.
@@ -79,7 +75,7 @@ SignalProxyNormal::connect_impl_(GCallback callback, const SigC::SlotBase& slot_
&SignalProxyConnectionNode::destroy_notify_handler,
static_cast<GConnectFlags>((after) ? G_CONNECT_AFTER : 0));
- return pConnectionNode;
+ return pConnectionNode->slot_;
}
void SignalProxyNormal::emission_stop()
@@ -90,15 +86,13 @@ void SignalProxyNormal::emission_stop()
// static
void SignalProxyNormal::slot0_void_callback(GObject* self, void* data)
{
- typedef SigC::Slot0<void> SlotType;
-
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper(self))
{
try
{
- if(SigC::SlotNode *const slot = data_to_slot(data))
- (*(SlotType::Proxy)(slot->proxy_))(slot);
+ if(sigc::slot_base *const slot = data_to_slot(data))
+ (*static_cast<sigc::slot<void>*>(slot))();
}
catch(...)
{
diff --git a/glib/glibmm/signalproxy_connectionnode.cc b/glib/glibmm/signalproxy_connectionnode.cc
index b9d5bbbc..42905ef6 100644
--- a/glib/glibmm/signalproxy_connectionnode.cc
+++ b/glib/glibmm/signalproxy_connectionnode.cc
@@ -28,56 +28,53 @@
namespace Glib
{
-SignalProxyConnectionNode::SignalProxyConnectionNode(SigC::SlotNode* slot_data, GObject* gobject)
+SignalProxyConnectionNode::SignalProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject)
:
- SigC::ConnectionNode(slot_data),
+ slot_ (slot),
connection_id_ (0),
- gsignal_disconnection_in_process_ (false),
object_ (gobject)
-{}
-
-SignalProxyConnectionNode::~SignalProxyConnectionNode()
{
- object_ = 0;
+ slot_.set_parent(this, &SignalProxyConnectionNode::notify);
}
// notify is a message coming up from the slot to be passed back to Gtk+
// disconnect is a message coming up from the Gtk+ to be passed down to SigC++
-void SignalProxyConnectionNode::notify(bool from_child)
+//static
+void* SignalProxyConnectionNode::notify(void* data)
{
- if (object_)
+ // notification from sigc++.
+ SignalProxyConnectionNode* conn = static_cast<SignalProxyConnectionNode*>(data);
+
+ // if there is no object, this call was triggered from destroy_notify_handler().
+ if (conn->object_)
{
- GObject* o = object_;
- object_ = 0;
+ GObject* o = conn->object_;
+ conn->object_ = 0;
- gsignal_disconnection_in_process_ = true; //Prevent destroy_notify_handler() from calling notify() too.
- if(g_signal_handler_is_connected(o, connection_id_)) //During destruction, GTK+ sometimes seems to disconnect them for us, before we expect it to. See bug #87912
- g_signal_handler_disconnect(o, connection_id_);
- }
+ // this triggers execution of destroy_notify_handler():
+ if(g_signal_handler_is_connected(o, conn->connection_id_)) //During destruction, GTK+ sometimes seems to disconnect them for us, before we expect it to. See bug #87912
+ g_signal_handler_disconnect(o, conn->connection_id_);
+
+ conn->connection_id_ = 0;
- connection_id_ = 0;
- SigC::ConnectionNode::notify(from_child);
+ delete conn; // if there are connection objects referring to slot_ they are notified during destruction of slot_
+ }
}
+//static
void SignalProxyConnectionNode::destroy_notify_handler(gpointer data, GClosure*)
{
// notification from gtk+.
SignalProxyConnectionNode* conn = static_cast<SignalProxyConnectionNode*>(data);
- // if there is no object, this call was reduntant.
- // (except for unreferencing the connection node. daniel.)
+ // if there is no object, this call was triggered from notify().
if (conn->object_)
{
- // the object has already lost track of this object.
- conn->object_ = 0;
+ // the object has already lost track of this object.
+ conn->object_ = 0;
- // inform sigc++ that the slot is of no further use.
- if(!conn->gsignal_disconnection_in_process_) //Prevent us from calling notify() twice. If it's in process then SignalProxyConnectionNode::notify() will do this.
- conn->notify(false); //TODO: What does false mean here?
+ delete conn; // if there are connection objects referring to slot_ they are notified during destruction of slot_
}
-
- if(!conn->gsignal_disconnection_in_process_)
- conn->unreference(); // remove the notice
}
} /* namespace Glib */
diff --git a/glib/glibmm/signalproxy_connectionnode.h b/glib/glibmm/signalproxy_connectionnode.h
index deccd35e..1126ba9c 100644
--- a/glib/glibmm/signalproxy_connectionnode.h
+++ b/glib/glibmm/signalproxy_connectionnode.h
@@ -35,22 +35,28 @@ namespace Glib
* It lives between the layer of Gtk+ and SigC++.
* It is very much an internal class.
*/
-class SignalProxyConnectionNode : public SigC::ConnectionNode
+class SignalProxyConnectionNode
{
public:
- SignalProxyConnectionNode(SigC::SlotNode* slot_data, GObject* gobject);
- virtual ~SignalProxyConnectionNode();
+ SignalProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject);
- virtual void notify(bool from_child); //overridden.
+ /** Callback that is executed when the slot becomes invalid.
+ * This callback is registered in the slot.
+ * @param data The SignalProxyConnectionNode object (@p this).
+ */
+ static void* notify(void* data);
+ /** Callback that is executed when the glib closure is destroyed.
+ * @param data The SignalProxyConnectionNode object (@p this).
+ * @param closure The glib closure object.
+ */
static void destroy_notify_handler(gpointer data, GClosure *closure);
gulong connection_id_;
- bool gsignal_disconnection_in_process_;
+ sigc::slot_base slot_;
protected:
GObject* object_;
-
};
} /* namespace Glib */
diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc
index 6a1a2f9f..9bb7c27a 100644
--- a/glib/glibmm/threadpool.cc
+++ b/glib/glibmm/threadpool.cc
@@ -37,14 +37,14 @@ public:
SlotList();
~SlotList();
- SigC::Slot0<void>* push(const SigC::Slot0<void>& slot);
- SigC::Slot0<void> pop(SigC::Slot0<void>* slot_ptr);
+ sigc::slot<void>* push(const sigc::slot<void>& slot);
+ sigc::slot<void> pop(sigc::slot<void>* slot_ptr);
void lock_and_unlock();
private:
Glib::Mutex mutex_;
- std::list< SigC::Slot0<void> > list_;
+ std::list< sigc::slot<void> > list_;
// noncopyable
SlotList(const ThreadPool::SlotList&);
@@ -57,7 +57,7 @@ ThreadPool::SlotList::SlotList()
ThreadPool::SlotList::~SlotList()
{}
-SigC::Slot0<void>* ThreadPool::SlotList::push(const SigC::Slot0<void>& slot)
+sigc::slot<void>* ThreadPool::SlotList::push(const sigc::slot<void>& slot)
{
Mutex::Lock lock (mutex_);
@@ -65,14 +65,14 @@ SigC::Slot0<void>* ThreadPool::SlotList::push(const SigC::Slot0<void>& slot)
return &list_.back();
}
-SigC::Slot0<void> ThreadPool::SlotList::pop(SigC::Slot0<void>* slot_ptr)
+sigc::slot<void> ThreadPool::SlotList::pop(sigc::slot<void>* slot_ptr)
{
- SigC::Slot0<void> slot;
+ sigc::slot<void> slot;
{
Mutex::Lock lock (mutex_);
- std::list< SigC::Slot0<void> >::iterator pslot = list_.begin();
+ std::list< sigc::slot<void> >::iterator pslot = list_.begin();
while(pslot != list_.end() && slot_ptr != &*pslot)
++pslot;
@@ -105,7 +105,7 @@ void call_thread_entry_slot(void* data, void* user_data)
Glib::ThreadPool::SlotList *const slot_list =
static_cast<Glib::ThreadPool::SlotList*>(user_data);
- SigC::Slot0<void> slot (slot_list->pop(static_cast<SigC::Slot0<void>*>(data)));
+ sigc::slot<void> slot (slot_list->pop(static_cast<sigc::slot<void>*>(data)));
slot();
}
@@ -156,9 +156,9 @@ ThreadPool::~ThreadPool()
}
}
-void ThreadPool::push(const SigC::Slot0<void>& slot)
+void ThreadPool::push(const sigc::slot<void>& slot)
{
- SigC::Slot0<void> *const slot_ptr = slot_list_->push(slot);
+ sigc::slot<void> *const slot_ptr = slot_list_->push(slot);
GError* error = 0;
g_thread_pool_push(gobject_, slot_ptr, &error);
diff --git a/glib/glibmm/threadpool.h b/glib/glibmm/threadpool.h
index af999d52..5cff035b 100644
--- a/glib/glibmm/threadpool.h
+++ b/glib/glibmm/threadpool.h
@@ -72,7 +72,7 @@ public:
* couldn't be created. In that case @a slot is simply appended to the
* queue of work to do.
*/
- void push(const SigC::Slot0<void>& slot);
+ void push(const sigc::slot<void>& slot);
/** Sets the maximal allowed number of threads for the pool.
* A value of -1 means that the maximal number of threads is unlimited.
diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg
index 9aee28d6..6e637079 100644
--- a/glib/src/iochannel.ccg
+++ b/glib/src/iochannel.ccg
@@ -44,7 +44,7 @@ namespace
// GlibmmIOChannel backend is used -- we use the GIOChannel reference
// counting mechanism. If the IOChannel backend is unknown, then the
// wrapper instance holds always exactly one reference to the GIOChannel.
-// The wrapper object itself is then managed via the SigC::Object refcounting
+// The wrapper object itself is then managed via our own refcounting
// mechanism. To do that a utility class ForeignIOChannel is introduced to
// override reference() and unreference().
@@ -52,20 +52,23 @@ class ForeignIOChannel : public Glib::IOChannel
{
public:
ForeignIOChannel(GIOChannel* gobject, bool take_copy)
- : Glib::IOChannel(gobject, take_copy) {}
+ : Glib::IOChannel(gobject, take_copy), ref_count_(0) {}
virtual void reference() const;
virtual void unreference() const;
+
+private:
+ mutable int ref_count_;
};
void ForeignIOChannel::reference() const
{
- SigC::ObjectBase::reference();
+ ++ref_count_;
}
void ForeignIOChannel::unreference() const
{
- SigC::ObjectBase::unreference();
+ if (!(--ref_count_)) delete this;
}
} // anonymous namespace
@@ -371,8 +374,8 @@ Glib::RefPtr<IOChannel> wrap(GIOChannel* gobject, bool take_copy)
}
else
{
- cpp_object = SigC::manage(new ForeignIOChannel(gobject, take_copy));
- cpp_object->reference(); // the SigC::Object refcount is initially 0
+ cpp_object = new ForeignIOChannel(gobject, take_copy);
+ cpp_object->reference(); // the refcount is initially 0
}
}
diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg
index 78658036..fbc3ea13 100644
--- a/glib/src/iochannel.hg
+++ b/glib/src/iochannel.hg
@@ -82,7 +82,7 @@ class GlibmmIOChannel;
* it isn't terribly useful either. Thus please refrain from overriding any
* IOChannel vfuncs.
*/
-class IOChannel : public SigC::Object
+class IOChannel : public sigc::trackable
{
_CLASS_GENERIC(IOChannel, GIOChannel)
diff --git a/glib/src/markup.hg b/glib/src/markup.hg
index ee881eb7..d0b61e1f 100644
--- a/glib/src/markup.hg
+++ b/glib/src/markup.hg
@@ -165,7 +165,7 @@ class ParserCallbacks;
* error from a method, Glib::Markup::ParseContext::parse() will report that
* error back to its caller.
*/
-class Parser : public SigC::Object
+class Parser : public sigc::trackable
{
public:
typedef std::map<Glib::ustring, Glib::ustring, Glib::Markup::AttributeKeyLess> AttributeMap;
@@ -258,7 +258,7 @@ private:
* occur; once an error occurs, the parse context can't continue to parse text
* (you have to destroy it and create a new parse context).
*/
-class ParseContext : public SigC::Object
+class ParseContext : public sigc::trackable
{
public:
/** Creates a new parse context.
diff --git a/glib/src/signalproxy.h.m4 b/glib/src/signalproxy.h.m4
index 3face310..6ba9fdb0 100644
--- a/glib/src/signalproxy.h.m4
+++ b/glib/src/signalproxy.h.m4
@@ -32,6 +32,7 @@ extern "C"
}
#include <sigc++/sigc++.h>
+#include <glibmm/signalproxy_connectionnode.h>
namespace Glib
@@ -58,14 +59,12 @@ public:
SignalProxyBase(Glib::ObjectBase* obj);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- static inline SigC::SlotNode* data_to_slot(void* data)
+ static inline sigc::slot_base* data_to_slot(void* data)
{
- // We store a ProxyConnection_ on the data slot of the closure.
- // But that type is not exposed, so we use the base type.
- SigC::ConnectionNode *const conn = static_cast<SigC::ConnectionNode*>(data);
+ SignalProxyConnectionNode *const pConnectionNode = static_cast<SignalProxyConnectionNode*>(data);
// Return 0 if the connection is blocked.
- return (!conn->blocked()) ? static_cast<SigC::SlotNode*>(conn->slot_.impl()) : 0;
+ return (!pConnectionNode->slot_.blocked()) ? &pConnectionNode->slot_ : 0;
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
@@ -87,7 +86,7 @@ class SignalProxyNormal : public SignalProxyBase
public:
~SignalProxyNormal();
- /// stops the current signal emmision (not in SigC++)
+ /// stops the current signal emmision (not in libsigc++)
void emission_stop();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -99,13 +98,13 @@ public:
protected:
SignalProxyNormal(Glib::ObjectBase* obj, const SignalProxyInfo* info);
- SigC::ConnectionNode* connect_(const SigC::SlotBase& slot_base, bool after);
- SigC::ConnectionNode* connect_notify_(const SigC::SlotBase& slot_base, bool after);
+ sigc::slot_base& connect_(const sigc::slot_base& slot, bool after);
+ sigc::slot_base& connect_notify_(const sigc::slot_base& slot, bool after);
private:
const SignalProxyInfo* info_;
- SigC::ConnectionNode* connect_impl_(GCallback callback, const SigC::SlotBase& slot_base, bool after);
+ sigc::slot_base& connect_impl_(GCallback callback, const sigc::slot_base& slot, bool after);
// no copy assignment
SignalProxyNormal& operator=(const SignalProxyNormal&);
@@ -121,23 +120,23 @@ LINE(]__line__[)dnl
/**** Glib::[SignalProxy]NUM($1) ***************************************************/
/** Proxy for signals with NUM($1) arguments.
- * Use the connect() method, with SigC::slot() to connect signals to signal handlers.
+ * Use the connect() method, with sigc::mem_fun() or sigc::ptr_fun() to connect signals to signal handlers.
*/
template <LIST(class R,ARG_CLASS($1))>
class [SignalProxy]NUM($1) : public SignalProxyNormal
{
public:
- typedef SigC::[Slot]NUM($1)<LIST(R,ARG_TYPE($1))> SlotType;
- typedef SigC::[Slot]NUM($1)<LIST(void,ARG_TYPE($1))> VoidSlotType;
+ typedef sigc::slot<LIST(R,ARG_TYPE($1))> SlotType;
+ typedef sigc::slot<LIST(void,ARG_TYPE($1))> VoidSlotType;
[SignalProxy]NUM($1)(ObjectBase* obj, const SignalProxyInfo* info)
: SignalProxyNormal(obj, info) {}
- SigC::Connection connect(const SlotType& slot, bool after = true)
- { return SigC::Connection(connect_(slot, after)); }
+ sigc::connection connect(const SlotType& slot, bool after = true)
+ { return sigc::connection(connect_(slot, after)); }
- SigC::Connection connect_notify(const VoidSlotType& slot, bool after = false)
- { return SigC::Connection(connect_notify_(slot, after)); }
+ sigc::connection connect_notify(const VoidSlotType& slot, bool after = false)
+ { return sigc::connection(connect_notify_(slot, after)); }
};
])dnl
diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg
index 3168e705..07f1e248 100644
--- a/glib/src/spawn.ccg
+++ b/glib/src/spawn.ccg
@@ -34,8 +34,7 @@ void child_setup_callback(void* user_data)
{
try
{
- SigC::Slot0<void> slot (static_cast<SigC::SlotNode*>(user_data));
- slot();
+ (*reinterpret_cast<sigc::slot<void>*>(user_data))();
}
catch(...)
{
@@ -66,13 +65,14 @@ void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
- const SigC::Slot0<void>& child_setup,
+ const sigc::slot<void>& child_setup,
int* child_pid,
int* standard_input,
int* standard_output,
int* standard_error)
{
const bool setup_slot = !child_setup.empty();
+ sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
g_spawn_async_with_pipes(
@@ -81,7 +81,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
const_cast<char**>(envp.data()),
static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : 0,
- (setup_slot) ? child_setup.impl() : 0,
+ (setup_slot) ? &child_setup_ : 0,
child_pid,
standard_input, standard_output, standard_error,
&error);
@@ -93,13 +93,14 @@ void spawn_async_with_pipes(const std::string& working_directory,
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
- const SigC::Slot0<void>& child_setup,
+ const sigc::slot<void>& child_setup,
int* child_pid,
int* standard_input,
int* standard_output,
int* standard_error)
{
const bool setup_slot = !child_setup.empty();
+ sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
g_spawn_async_with_pipes(
@@ -107,7 +108,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
const_cast<char**>(argv.data()), 0,
static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : 0,
- (setup_slot) ? child_setup.impl() : 0,
+ (setup_slot) ? &child_setup_ : 0,
child_pid,
standard_input, standard_output, standard_error,
&error);
@@ -120,10 +121,11 @@ void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
- const SigC::Slot0<void>& child_setup,
+ const sigc::slot<void>& child_setup,
int* child_pid)
{
const bool setup_slot = !child_setup.empty();
+ sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
g_spawn_async(
@@ -132,7 +134,7 @@ void spawn_async(const std::string& working_directory,
const_cast<char**>(envp.data()),
static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : 0,
- (setup_slot) ? child_setup.impl() : 0,
+ (setup_slot) ? &child_setup_ : 0,
child_pid,
&error);
@@ -143,10 +145,11 @@ void spawn_async(const std::string& working_directory,
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
- const SigC::Slot0<void>& child_setup,
+ const sigc::slot<void>& child_setup,
int* child_pid)
{
const bool setup_slot = !child_setup.empty();
+ sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
g_spawn_async(
@@ -154,7 +157,7 @@ void spawn_async(const std::string& working_directory,
const_cast<char**>(argv.data()), 0,
static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : 0,
- (setup_slot) ? child_setup.impl() : 0,
+ (setup_slot) ? &child_setup_ : 0,
child_pid,
&error);
@@ -166,12 +169,13 @@ void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
- const SigC::Slot0<void>& child_setup,
+ const sigc::slot<void>& child_setup,
std::string* standard_output,
std::string* standard_error,
int* exit_status)
{
const bool setup_slot = !child_setup.empty();
+ sigc::slot<void> child_setup_ = child_setup;
Glib::ScopedPtr<char> buf_standard_output;
Glib::ScopedPtr<char> buf_standard_error;
@@ -183,7 +187,7 @@ void spawn_sync(const std::string& working_directory,
const_cast<char**>(envp.data()),
static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : 0,
- (setup_slot) ? child_setup.impl() : 0,
+ (setup_slot) ? &child_setup_ : 0,
(standard_output) ? buf_standard_output.addr() : 0,
(standard_error) ? buf_standard_error.addr() : 0,
exit_status,
@@ -199,12 +203,13 @@ void spawn_sync(const std::string& working_directory,
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
- const SigC::Slot0<void>& child_setup,
+ const sigc::slot<void>& child_setup,
std::string* standard_output,
std::string* standard_error,
int* exit_status)
{
const bool setup_slot = !child_setup.empty();
+ sigc::slot<void> child_setup_ = child_setup;
Glib::ScopedPtr<char> buf_standard_output;
Glib::ScopedPtr<char> buf_standard_error;
@@ -215,7 +220,7 @@ void spawn_sync(const std::string& working_directory,
const_cast<char**>(argv.data()), 0,
static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : 0,
- (setup_slot) ? child_setup.impl() : 0,
+ (setup_slot) ? &child_setup_ : 0,
(standard_output) ? buf_standard_output.addr() : 0,
(standard_error) ? buf_standard_error.addr() : 0,
exit_status,
diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg
index 79b93c20..c2a403bb 100644
--- a/glib/src/spawn.hg
+++ b/glib/src/spawn.hg
@@ -47,7 +47,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SpawnFlags(0),
- const SigC::Slot0<void>& child_setup = SigC::Slot0<void>(),
+ const sigc::slot<void>& child_setup = sigc::slot<void>(),
int* child_pid = 0,
int* standard_input = 0,
int* standard_output = 0,
@@ -56,7 +56,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SpawnFlags(0),
- const SigC::Slot0<void>& child_setup = SigC::Slot0<void>(),
+ const sigc::slot<void>& child_setup = sigc::slot<void>(),
int* child_pid = 0,
int* standard_input = 0,
int* standard_output = 0,
@@ -66,20 +66,20 @@ void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SpawnFlags(0),
- const SigC::Slot0<void>& child_setup = SigC::Slot0<void>(),
+ const sigc::slot<void>& child_setup = sigc::slot<void>(),
int* child_pid = 0);
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SpawnFlags(0),
- const SigC::Slot0<void>& child_setup = SigC::Slot0<void>(),
+ const sigc::slot<void>& child_setup = sigc::slot<void>(),
int* child_pid = 0);
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SpawnFlags(0),
- const SigC::Slot0<void>& child_setup = SigC::Slot0<void>(),
+ const sigc::slot<void>& child_setup = sigc::slot<void>(),
std::string* standard_output = 0,
std::string* standard_error = 0,
int* exit_status = 0);
@@ -87,7 +87,7 @@ void spawn_sync(const std::string& working_directory,
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SpawnFlags(0),
- const SigC::Slot0<void>& child_setup = SigC::Slot0<void>(),
+ const sigc::slot<void>& child_setup = sigc::slot<void>(),
std::string* standard_output = 0,
std::string* standard_error = 0,
int* exit_status = 0);
diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg
index 84499b0e..bdfd7774 100644
--- a/glib/src/thread.ccg
+++ b/glib/src/thread.ccg
@@ -27,15 +27,12 @@ namespace
void* call_thread_entry_slot(void* data)
{
+ sigc::slot_base *const slot = reinterpret_cast<sigc::slot_base*>(data);
+
try
{
- SigC::SlotNode *const slot_node = static_cast<SigC::SlotNode*>(data);
-
// Recreate the specific slot, and drop the reference obtained by create().
- SigC::Slot0<void> slot (slot_node);
- slot_node->unreference();
-
- slot();
+ (*static_cast<sigc::slot<void>*>(slot))();
}
catch(Glib::Thread::Exit&)
{
@@ -47,6 +44,7 @@ void* call_thread_entry_slot(void* data)
Glib::exception_handlers_invoke();
}
+ delete slot;
return 0;
}
@@ -67,28 +65,19 @@ void thread_init_impl()
/**** Glib::Thread *********************************************************/
// static
-Thread* Thread::create(const SigC::Slot0<void>& slot, bool joinable)
+Thread* Thread::create(const sigc::slot<void>& slot, bool joinable)
{
- // Obtain ownership of the slot node, and let the slot forget about it.
- // That avoids a thread-unsafe call to unreference() in the slot's dtor.
- //
- // TODO: This isn't entirely safe yet, we still have reentrancy issues if
- // the slot has been copied from another slot that still holds a reference.
- // We need either thread-safe refcounting, or a way to force copying of the
- // underlying slot node. The latter approach would get my vote. daniel.
-
- SigC::SlotNode *const slot_node = static_cast<SigC::SlotNode*>(slot.impl());
- slot_node->reference();
- slot.clear();
+ // Make a copy of slot on the heap
+ sigc::slot_base *const slot_copy = new sigc::slot<void>(slot);
GError* error = 0;
GThread *const thread = g_thread_create(
- &call_thread_entry_slot, slot_node, joinable, &error);
+ &call_thread_entry_slot, slot_copy, joinable, &error);
if(error)
{
- slot_node->unreference();
+ delete slot_copy;
Glib::Error::throw_exception(error);
}
@@ -96,26 +85,21 @@ Thread* Thread::create(const SigC::Slot0<void>& slot, bool joinable)
}
// static
-Thread* Thread::create(const SigC::Slot0<void>& slot, unsigned long stack_size,
+Thread* Thread::create(const sigc::slot<void>& slot, unsigned long stack_size,
bool joinable, bool bound, ThreadPriority priority)
{
- // Obtain ownership of the slot node, and let the slot forget about it.
- // That avoids a thread-unsafe call to unreference() in the slot's dtor.
- // See the TODO comment in the other create() method.
-
- SigC::SlotNode *const slot_node = static_cast<SigC::SlotNode*>(slot.impl());
- slot_node->reference();
- slot.clear();
+ // Make a copy of slot on the heap
+ sigc::slot_base *const slot_copy = new sigc::slot<void>(slot);
GError* error = 0;
GThread *const thread = g_thread_create_full(
- &call_thread_entry_slot, slot_node, stack_size, joinable,
+ &call_thread_entry_slot, slot_copy, stack_size, joinable,
bound, (GThreadPriority) priority, &error);
if(error)
{
- slot_node->unreference();
+ delete slot_copy;
Glib::Error::throw_exception(error);
}
diff --git a/glib/src/thread.hg b/glib/src/thread.hg
index f60e7863..9431b298 100644
--- a/glib/src/thread.hg
+++ b/glib/src/thread.hg
@@ -187,7 +187,7 @@ public:
* @return The new Thread* on success.
* @throw Glib::ThreadError
*/
- static Thread* create(const SigC::Slot0<void>& slot, bool joinable);
+ static Thread* create(const sigc::slot<void>& slot, bool joinable);
/** Creates a new thread with the priority @a priority. The stack gets the
* size @a stack_size or the default value for the current platform, if
@@ -212,9 +212,9 @@ public:
* here as a default.
*
* @note Only use the extended
- * create(const SigC::Slot0<void>&, unsigned long, bool, bool, ThreadPriority)
+ * create(const sigc::slot<void>&, unsigned long, bool, bool, ThreadPriority)
* function, when you really can't use the simple
- * create(const SigC::Slot0<void>&, bool)
+ * create(const sigc::slot<void>&, bool)
* instead. The latter overload does not take @a stack_size, @a bound and
* @a priority as arguments, as they should only be used for cases, where
* it is inevitable.
@@ -227,7 +227,7 @@ public:
* @return The new Thread* on success.
* @throw Glib::ThreadError
*/
- static Thread* create(const SigC::Slot0<void>& slot, unsigned long stack_size,
+ static Thread* create(const sigc::slot<void>& slot, unsigned long stack_size,
bool joinable, bool bound, ThreadPriority priority);
/** Returns the Thread* corresponding to the calling thread.
diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4
index a95cd8c2..9c4ea01f 100644
--- a/tools/m4/signal.m4
+++ b/tools/m4/signal.m4
@@ -35,20 +35,18 @@ ifelse($8,`1',,`dnl Do not generate the implementation if it should be custom:
$2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`'void* data)
{
using namespace __NAMESPACE__;
- typedef SigC::Slot`'_NUM($6)< $5`'_COMMA_PREFIX($6) > SlotType;
+ typedef sigc::slot< $5`'_COMMA_PREFIX($6) > SlotType;
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
try
{
- if(SigC::SlotNode *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
+ if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
ifelse(`$2',void,`dnl
- (*(SlotType::Proxy)(slot->proxy_))
- (_COMMA_SUFFIX($7) slot);
+ (*static_cast<SlotType*>(slot))($7);
',`dnl else
- return _CONVERT($5,$2,`((*(SlotType::Proxy)(slot->proxy_))
- (_COMMA_SUFFIX($7) slot))');
+ return _CONVERT($5,$2,`(*static_cast<SlotType*>(slot))($7)');
')dnl endif
}
catch(...)
@@ -67,16 +65,15 @@ ifelse($2,void,,`dnl else
$2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`' void* data)
{
using namespace __NAMESPACE__;
- typedef SigC::Slot`'_NUM($6)< void`'_COMMA_PREFIX($6) > SlotType;
+ typedef sigc::slot< void`'_COMMA_PREFIX($6) > SlotType;
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
try
{
- if(SigC::SlotNode *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
- (*(SlotType::Proxy)(slot->proxy_))
- (_COMMA_SUFFIX($7) slot);
+ if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
+ (*static_cast<SlotType*>(slot))($7);
}
catch(...)
{
diff --git a/tools/m4/signalproxy_custom.m4 b/tools/m4/signalproxy_custom.m4
index fccce04a..7b85e940 100644
--- a/tools/m4/signalproxy_custom.m4
+++ b/tools/m4/signalproxy_custom.m4
@@ -17,8 +17,8 @@ public:
~SignalProxy_`'$1();
//Reimplement connect(), to use the new glib_callback:
- SigC::Connection connect(const SlotType& s, bool after = true);
- SigC::Connection connect_notify(const VoidSlotType& s, bool after = false);
+ sigc::connection connect(const SlotType& s, bool after = true);
+ sigc::connection connect_notify(const VoidSlotType& s, bool after = false);
protected:
static $2 glib_callback(GObject* obj _COMMA_PREFIX(`$3'), void* data);
@@ -43,14 +43,14 @@ SignalProxy_`'$1`'::~SignalProxy_`'$1()
{}
//Reimplement connect(), to use the new glib_callback:
-SigC::Connection SignalProxy_`'$1`'::connect(const SlotType& s, bool after /* = true */)
+sigc::connection SignalProxy_`'$1`'::connect(const SlotType& s, bool after /* = true */)
{
- return SigC::Connection(connect_((GCallback)&glib_callback, s, after));
+ return sigc::connection(connect_((GCallback)&glib_callback, s, after));
}
-SigC::Connection SignalProxy_`'$1`'::connect_notify(const VoidSlotType& s, bool after /* = false */)
+sigc::connection SignalProxy_`'$1`'::connect_notify(const VoidSlotType& s, bool after /* = false */)
{
- return SigC::Connection(connect_((GCallback)&glib_void_callback, s, after));
+ return sigc::connection(connect_((GCallback)&glib_void_callback, s, after));
}
@@ -58,13 +58,11 @@ $2 SignalProxy_`'$1`'::glib_callback(GObject* obj _COMMA_PREFIX(`$3'), void* dat
{
try
{
- SigC::SlotNode* slot = data_to_slot(data);
+ sigc::slot_base* slot = data_to_slot(data);
ifelse(`$2',void,`dnl
- ((SlotType::Proxy)(slot->proxy_))
- (_COMMA_SUFFIX($6) slot);
+ (*static_cast<SlotType*>(slot))(`$6');
',`dnl
- $2 cresult = ((SlotType::Proxy)(slot->proxy_))
- (_COMMA_SUFFIX($6) slot);
+ $2 cresult = (*static_cast<SlotType*>(slot))(`$6');
//Convert to the C++ type, and return:
return _CONVERT($2,$4,`cresult');
')
@@ -80,9 +78,8 @@ $2 SignalProxy_`'$1`'::glib_void_callback(GObject* obj _COMMA_PREFIX(`$3'), void
{
try
{
- SigC::SlotNode* slot = data_to_slot(data);
- ((VoidSlotType::Proxy)(slot->proxy_))
- (_COMMA_SUFFIX(`$6') slot);
+ sigc::slot_base* slot = data_to_slot(data);
+ (*static_cast<VoidSlotType*>(slot))(`$6');
}
catch (...)
{