--- glib/glibmm.h.old	2008-08-04 23:00:39.000000000 +0400
+++ glib/glibmm.h	2009-03-11 14:16:07.000000000 +0300
@@ -61,6 +61,7 @@
 #include <glibmm/shell.h>
 #include <glibmm/signalproxy_connectionnode.h>
 #include <glibmm/signalproxy.h>
+#include <glibmm/slotscontainer.h>
 #include <glibmm/slisthandle.h>
 #include <glibmm/spawn.h>
 #include <glibmm/stringutils.h>
--- glib/src/Makefile.in.old	2009-03-11 14:04:15.000000000 +0300
+++ glib/src/Makefile.in	2009-03-11 13:24:14.000000000 +0300
@@ -213,7 +213,8 @@
 files_win32_hg = 
 files_general_hg = checksum.hg convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg \
                    module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg \
-                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg
+                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg \
+                   slotscontainer.hg
 
 files_general_deprecated_hg = 
 files_all_hg = \
--- glib/src/Makefile_list_of_hg.am_fragment.old	2008-08-04 23:00:39.000000000 +0400
+++ glib/src/Makefile_list_of_hg.am_fragment	2009-03-11 13:24:04.000000000 +0300
@@ -7,7 +7,8 @@
 files_win32_hg =
 files_general_hg = checksum.hg convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg \
                    module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg \
-                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg
+                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg \
+                   slotscontainer.hg
 files_general_deprecated_hg =
 
 include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment 
--- /dev/null	2009-03-11 11:50:45.993007025 +0300
+++ glib/src/slotscontainer.ccg	2009-03-11 13:49:04.000000000 +0300
@@ -0,0 +1,54 @@
+/* Copyright (C) 2002 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+namespace Glib
+{
+
+SlotsContainer::SlotsContainer(void)
+{
+  clear();
+}
+
+SlotsContainer::~SlotsContainer(void)
+{
+  for (std::map<ustring, sigc::slot_base*>::iterator it =
+	slot_map.begin(); it != slot_map.end(); it++) {
+    delete it->second;
+  }
+  clear();
+}
+
+void SlotsContainer::clear(void)
+{
+  slot_map.clear();
+  initialized = false;
+}
+
+bool SlotsContainer::have_slot(const ustring name)
+{
+  if (!initialized)
+    init_slots();
+  return (slot_map.find(name) != slot_map.end());
+}
+
+void SlotsContainer::init_slots(void)
+{
+  __init_slots();
+  initialized = true;
+}
+
+} // namespace Glib
--- /dev/null	2009-03-11 11:50:45.993007025 +0300
+++ glib/src/slotscontainer.hg	2009-03-11 13:48:55.000000000 +0300
@@ -0,0 +1,104 @@
+/* Copyright (C) 2002 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+_DEFS(glibmm,glib)
+
+#include <glibmm/error.h>
+#include <glibmm/ustring.h>
+#include <map>
+#include <sigc++/slot.h>
+
+namespace Glib
+{
+
+class SlotsContainer
+{
+public:
+  SlotsContainer(void);
+  ~SlotsContainer(void);
+
+  void clear(void);
+  bool have_slot(const ustring name);
+
+  template <class T_sig>
+  bool connect(T_sig sig, const ustring& name)
+  {
+    if (!have_slot(name))
+      return false;
+    sig.connect(get_slot<typename T_sig::SlotType>(name));
+    return true;
+  }
+
+  template <typename T_ret, class T_class>
+  void register_slot(const ustring& name, T_class *ptr,
+	T_ret(T_class::*handler)(void))
+  {
+    slot_map[name] = new sigc::slot<T_ret>(sigc::mem_fun(*ptr, handler));
+  }
+  template <typename T_ret, class T_class, typename T_arg>
+  void register_slot(const ustring& name, T_class *ptr,
+	T_ret(T_class::*handler)(T_arg))
+  {
+    slot_map[name] = new sigc::slot<T_ret, T_arg>(sigc::mem_fun(*ptr, handler));
+  }
+  template <typename T_ret>
+  void register_slot(const ustring& name, T_ret(*handler)(void))
+  {
+    slot_map[name] = new sigc::slot<T_ret>(sigc::ptr_fun(handler));
+  }
+  template <typename T_ret, typename T_arg>
+  void register_slot(const ustring& name, T_ret(*handler)(T_arg))
+  {
+    slot_map[name] = new sigc::slot<T_ret, T_arg>(sigc::ptr_fun(handler));
+  }
+
+protected:
+  virtual void __init_slots(void) = 0;
+
+  template <class T_class>
+  T_class get_slot(const ustring name)
+  {
+    if (!initialized)
+      init_slots();
+    std::map<ustring, sigc::slot_base*>::iterator it = slot_map.find(name);
+    if (it == slot_map.end())
+      throw Error(g_quark_from_static_string("no_such_slot"), -2,
+	    "No such slot");
+    T_class *sl = dynamic_cast<T_class*>(it->second);
+    if (!sl)
+      throw Error(g_quark_from_static_string("wrong_handler_type"), -1,
+	    "Wrong handler type");
+    return *sl;
+  }
+
+  std::map<ustring, sigc::slot_base*> slot_map;
+  bool initialized;
+
+private:
+  void init_slots(void);
+};
+
+#define GTKMM_SLOT(s) register_slot(__STRING(s), this, &s)
+#define GTKMM_SLOT_FUN(s) register_slot(__STRING(s), &s)
+#define GTKMM_REGISTER_SLOT(c, s) c.register_slot(__STRING(s), this, &s)
+#define GTKMM_DECLARE_SLOTS(...) \
+virtual void __init_slots(void) \
+{ \
+    __VA_ARGS__; \
+}
+
+} // namespace Glib
--- glib/glibmm/private/Makefile.in.old	2008-10-21 11:02:35.000000000 +0400
+++ glib/glibmm/private/Makefile.in	2009-03-18 12:06:17.000000000 +0300
@@ -60,7 +61,7 @@
 	fileutils_p.h iochannel_p.h keyfile_p.h markup_p.h module_p.h \
 	optioncontext_p.h optionentry_p.h optiongroup_p.h regex_p.h \
 	shell_p.h spawn_p.h thread_p.h nodetree_p.h unicode_p.h \
-	uriutils_p.h interface_p.h object_p.h
+	uriutils_p.h slotscontainer_p.h interface_p.h object_p.h
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -205,7 +209,8 @@
 files_win32_hg = 
 files_general_hg = checksum.hg convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg \
                    module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg \
-                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg
+                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg \
+                   slotscontainer.hg
 
 files_general_deprecated_hg = 
 files_all_hg = \
--- /dev/null	2009-03-11 11:50:45.993007025 +0300
+++ glib/glibmm/private/slotscontainer_p.h	2009-03-11 13:35:46.000000000 +0300
@@ -0,0 +1,8 @@
+// -*- c++ -*-
+// Generated by gtkmmproc -- DO NOT MODIFY!
+#ifndef _GLIBMM_SLOTSCONTAINER_P_H
+#define _GLIBMM_SLOTSCONTAINER_P_H
+
+
+#endif /* _GLIBMM_SLOTSCONTAINER_P_H */
+
--- glib/glibmm/Makefile.in.old	2008-10-21 11:02:34.000000000 +0400
+++ glib/glibmm/Makefile.in	2009-03-18 12:06:17.000000000 +0300
@@ -72,18 +73,19 @@
 	fileutils.cc iochannel.cc keyfile.cc markup.cc module.cc \
 	optioncontext.cc optionentry.cc optiongroup.cc regex.cc \
 	shell.cc spawn.cc thread.cc nodetree.cc unicode.cc uriutils.cc \
-	wrap_init.cc class.cc containers.cc debug.cc dispatcher.cc \
-	error.cc exception.cc exceptionhandler.cc init.cc interface.cc \
-	main.cc miscutils.cc object.cc objectbase.cc pattern.cc \
-	property.cc propertyproxy.cc propertyproxy_base.cc quark.cc \
-	random.cc signalproxy.cc signalproxy_connectionnode.cc \
-	streamiochannel.cc stringutils.cc threadpool.cc timer.cc \
-	timeval.cc ustring.cc utility.cc value.cc value_custom.cc \
-	wrap.cc value_basictypes.cc
+	slotscontainer.cc wrap_init.cc class.cc containers.cc debug.cc \
+	dispatcher.cc error.cc exception.cc exceptionhandler.cc \
+	init.cc interface.cc main.cc miscutils.cc object.cc \
+	objectbase.cc pattern.cc property.cc propertyproxy.cc \
+	propertyproxy_base.cc quark.cc random.cc signalproxy.cc \
+	signalproxy_connectionnode.cc streamiochannel.cc \
+	stringutils.cc threadpool.cc timer.cc timeval.cc ustring.cc \
+	utility.cc value.cc value_custom.cc wrap.cc \
+	value_basictypes.cc
 am__objects_1 = checksum.lo convert.lo date.lo fileutils.lo \
 	iochannel.lo keyfile.lo markup.lo module.lo optioncontext.lo \
 	optionentry.lo optiongroup.lo regex.lo shell.lo spawn.lo \
-	thread.lo nodetree.lo unicode.lo uriutils.lo
+	thread.lo nodetree.lo unicode.lo uriutils.lo slotscontainer.lo
 am__objects_2 =
 @OS_WIN32_FALSE@am__objects_3 = $(am__objects_1) $(am__objects_2) \
 @OS_WIN32_FALSE@	$(am__objects_2)
@@ -297,7 +302,8 @@
 files_win32_hg = 
 files_general_hg = checksum.hg convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg \
                    module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg \
-                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg
+                   shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg \
+                   slotscontainer.hg
 
 files_general_deprecated_hg = 
 files_all_hg = \
@@ -473,6 +479,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalproxy.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalproxy_connectionnode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slotscontainer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streamiochannel.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringutils.Plo@am__quote@
--- /dev/null	2009-03-11 11:50:45.993007025 +0300
+++ glib/glibmm/slotscontainer.cc	2009-03-11 13:49:11.000000000 +0300
@@ -0,0 +1,66 @@
+// Generated by gtkmmproc -- DO NOT MODIFY!
+
+
+#include <glibmm/slotscontainer.h>
+#include <glibmm/private/slotscontainer_p.h>
+
+/* Copyright (C) 2002 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+namespace Glib
+{
+
+SlotsContainer::SlotsContainer(void)
+{
+  clear();
+}
+
+SlotsContainer::~SlotsContainer(void)
+{
+  for (std::map<ustring, sigc::slot_base*>::iterator it =
+	slot_map.begin(); it != slot_map.end(); it++) {
+    delete it->second;
+  }
+  clear();
+}
+
+void SlotsContainer::clear(void)
+{
+  slot_map.clear();
+  initialized = false;
+}
+
+bool SlotsContainer::have_slot(const ustring name)
+{
+  if (!initialized)
+    init_slots();
+  return (slot_map.find(name) != slot_map.end());
+}
+
+void SlotsContainer::init_slots(void)
+{
+  __init_slots();
+  initialized = true;
+}
+
+} // namespace Glib
+
+namespace
+{
+} // anonymous namespace
+
+
--- /dev/null	2009-03-11 11:50:45.993007025 +0300
+++ glib/glibmm/slotscontainer.h	2009-03-11 13:49:11.000000000 +0300
@@ -0,0 +1,113 @@
+// -*- c++ -*-
+// Generated by gtkmmproc -- DO NOT MODIFY!
+#ifndef _GLIBMM_SLOTSCONTAINER_H
+#define _GLIBMM_SLOTSCONTAINER_H
+
+
+/* Copyright (C) 2002 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <glibmm/error.h>
+#include <glibmm/ustring.h>
+#include <map>
+#include <sigc++/slot.h>
+
+namespace Glib
+{
+
+class SlotsContainer
+{
+public:
+  SlotsContainer(void);
+  ~SlotsContainer(void);
+
+  void clear(void);
+  bool have_slot(const ustring name);
+
+  template <class T_sig>
+  bool connect(T_sig sig, const ustring& name)
+  {
+    if (!have_slot(name))
+      return false;
+    sig.connect(get_slot<typename T_sig::SlotType>(name));
+    return true;
+  }
+
+  template <typename T_ret, class T_class>
+  void register_slot(const ustring& name, T_class *ptr,
+	T_ret(T_class::*handler)(void))
+  {
+    slot_map[name] = new sigc::slot<T_ret>(sigc::mem_fun(*ptr, handler));
+  }
+  template <typename T_ret, class T_class, typename T_arg>
+  void register_slot(const ustring& name, T_class *ptr,
+	T_ret(T_class::*handler)(T_arg))
+  {
+    slot_map[name] = new sigc::slot<T_ret, T_arg>(sigc::mem_fun(*ptr, handler));
+  }
+  template <typename T_ret>
+  void register_slot(const ustring& name, T_ret(*handler)(void))
+  {
+    slot_map[name] = new sigc::slot<T_ret>(sigc::ptr_fun(handler));
+  }
+  template <typename T_ret, typename T_arg>
+  void register_slot(const ustring& name, T_ret(*handler)(T_arg))
+  {
+    slot_map[name] = new sigc::slot<T_ret, T_arg>(sigc::ptr_fun(handler));
+  }
+
+protected:
+  virtual void __init_slots(void) = 0;
+
+  template <class T_class>
+  T_class get_slot(const ustring name)
+  {
+    if (!initialized)
+      init_slots();
+    std::map<ustring, sigc::slot_base*>::iterator it = slot_map.find(name);
+    if (it == slot_map.end())
+      throw Error(g_quark_from_static_string("no_such_slot"), -2,
+	    "No such slot");
+    T_class *sl = dynamic_cast<T_class*>(it->second);
+    if (!sl)
+      throw Error(g_quark_from_static_string("wrong_handler_type"), -1,
+	    "Wrong handler type");
+    return *sl;
+  }
+
+  std::map<ustring, sigc::slot_base*> slot_map;
+  bool initialized;
+
+private:
+  void init_slots(void);
+};
+
+#define GTKMM_SLOT(s) register_slot(__STRING(s), this, &s)
+#define GTKMM_SLOT_FUN(s) register_slot(__STRING(s), &s)
+#define GTKMM_REGISTER_SLOT(c, s) c.register_slot(__STRING(s), this, &s)
+#define GTKMM_DECLARE_SLOTS(...) \
+virtual void __init_slots(void) \
+{ \
+    __VA_ARGS__; \
+}
+
+} // namespace Glib
+
+
+#endif /* _GLIBMM_SLOTSCONTAINER_H */
+
