wok-current annotate visualboyadvance/stuff/1.7.2-deprecatedsigc++.patch @ rev 13492

Add; mondo$
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Fri Oct 12 23:26:16 2012 +0200 (2012-10-12)
parents
children
rev   line source
gokhlayeh@7031 1 --- src/gtk/sigccompat.h.old 2008-05-02 10:46:45.000000000 +0200
gokhlayeh@7031 2 +++ src/gtk/sigccompat.h 2008-05-02 10:47:08.000000000 +0200
gokhlayeh@7031 3 @@ -20,7 +20,7 @@
gokhlayeh@7031 4 #ifndef __VBA_SIGCCOMPAT_H__
gokhlayeh@7031 5 #define __VBA_SIGCCOMPAT_H__
gokhlayeh@7031 6
gokhlayeh@7031 7 -#undef LIBSIGC_DISABLE_DEPRECATED
gokhlayeh@7031 8 +#define LIBSIGC_DISABLE_DEPRECATED
gokhlayeh@7031 9 #include <sigc++/bind.h>
gokhlayeh@7031 10 #include <sigc++/connection.h>
gokhlayeh@7031 11
gokhlayeh@7031 12 @@ -28,9 +28,679 @@
gokhlayeh@7031 13 #include <sigc++/object.h>
gokhlayeh@7031 14 #include <sigc++/functors/mem_fun.h>
gokhlayeh@7031 15
gokhlayeh@7031 16 -namespace SigC
gokhlayeh@7031 17 +
gokhlayeh@7031 18 +// From sigc++/bind.h
gokhlayeh@7031 19 +namespace SigC {
gokhlayeh@7031 20 +
gokhlayeh@7031 21 +template <class T_bound1, class T_functor>
gokhlayeh@7031 22 +inline ::sigc::bind_functor<-1, T_functor,
gokhlayeh@7031 23 + typename ::sigc::unwrap_reference<T_bound1>::type>
gokhlayeh@7031 24 +bind(const T_functor& _A_functor, T_bound1 _A_b1)
gokhlayeh@7031 25 +{ return ::sigc::bind_functor<-1, T_functor,
gokhlayeh@7031 26 + typename ::sigc::unwrap_reference<T_bound1>::type>
gokhlayeh@7031 27 + (_A_functor, _A_b1);
gokhlayeh@7031 28 +}
gokhlayeh@7031 29 +
gokhlayeh@7031 30 +template <class T_bound1, class T_bound2, class T_functor>
gokhlayeh@7031 31 +inline ::sigc::bind_functor<-1, T_functor,
gokhlayeh@7031 32 + typename ::sigc::unwrap_reference<T_bound1>::type,
gokhlayeh@7031 33 + typename ::sigc::unwrap_reference<T_bound2>::type>
gokhlayeh@7031 34 +bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2)
gokhlayeh@7031 35 +{ return ::sigc::bind_functor<-1, T_functor,
gokhlayeh@7031 36 + typename ::sigc::unwrap_reference<T_bound1>::type,
gokhlayeh@7031 37 + typename ::sigc::unwrap_reference<T_bound2>::type>
gokhlayeh@7031 38 + (_A_functor, _A_b1, _A_b2);
gokhlayeh@7031 39 +}
gokhlayeh@7031 40 +
gokhlayeh@7031 41 +template <class T_bound1, class T_bound2, class T_bound3, class T_functor>
gokhlayeh@7031 42 +inline ::sigc::bind_functor<-1, T_functor,
gokhlayeh@7031 43 + typename ::sigc::unwrap_reference<T_bound1>::type,
gokhlayeh@7031 44 + typename ::sigc::unwrap_reference<T_bound2>::type,
gokhlayeh@7031 45 + typename ::sigc::unwrap_reference<T_bound3>::type>
gokhlayeh@7031 46 +bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2,T_bound3 _A_b3)
gokhlayeh@7031 47 +{ return ::sigc::bind_functor<-1, T_functor,
gokhlayeh@7031 48 + typename ::sigc::unwrap_reference<T_bound1>::type,
gokhlayeh@7031 49 + typename ::sigc::unwrap_reference<T_bound2>::type,
gokhlayeh@7031 50 + typename ::sigc::unwrap_reference<T_bound3>::type>
gokhlayeh@7031 51 + (_A_functor, _A_b1, _A_b2, _A_b3);
gokhlayeh@7031 52 +}
gokhlayeh@7031 53 +
gokhlayeh@7031 54 +}
gokhlayeh@7031 55 +
gokhlayeh@7031 56 +// From sigc++/connection.h
gokhlayeh@7031 57 +namespace SigC {
gokhlayeh@7031 58 +
gokhlayeh@7031 59 +/** Convinience class for safe disconnection.
gokhlayeh@7031 60 + * Iterators must not be used beyond the lifetime of the list
gokhlayeh@7031 61 + * they work on. A connection object can be created from a
gokhlayeh@7031 62 + * slot list iterator and may safely be used to disconnect
gokhlayeh@7031 63 + * the referred slot at any time (disconnect()). If the slot
gokhlayeh@7031 64 + * has already been destroyed, disconnect() does nothing. empty() or
gokhlayeh@7031 65 + * operator bool() can be used to test whether the connection is
gokhlayeh@7031 66 + * still active. The connection can be blocked (block(), unblock()).
gokhlayeh@7031 67 + *
gokhlayeh@7031 68 + * This is possible because the connection object gets notified
gokhlayeh@7031 69 + * when the referred slot dies (notify()).
gokhlayeh@7031 70 + *
gokhlayeh@7031 71 + * @deprecated Use sigc::connection instead.
gokhlayeh@7031 72 + * @ingroup compat
gokhlayeh@7031 73 + */
gokhlayeh@7031 74 +typedef ::sigc::connection Connection;
gokhlayeh@7031 75 +
gokhlayeh@7031 76 +}
gokhlayeh@7031 77 +
gokhlayeh@7031 78 +// From sigc++/slot.h
gokhlayeh@7031 79 +namespace SigC {
gokhlayeh@7031 80 +
gokhlayeh@7031 81 +// SlotN
gokhlayeh@7031 82 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 83 + * Slot0 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 84 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 85 + *
gokhlayeh@7031 86 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 87 + * - @e T_return The return type of operator()().
gokhlayeh@7031 88 + *
gokhlayeh@7031 89 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 90 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 91 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 92 + * will invoke the functor with minimal copies.
gokhlayeh@7031 93 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 94 + * from operator()() temporarily.
gokhlayeh@7031 95 + *
gokhlayeh@7031 96 + * @par Example:
gokhlayeh@7031 97 + * @code
gokhlayeh@7031 98 + * #include <sigc++/slot.h>
gokhlayeh@7031 99 + * void foo(int) {}
gokhlayeh@7031 100 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 101 + * s(19);
gokhlayeh@7031 102 + * @endcode
gokhlayeh@7031 103 + *
gokhlayeh@7031 104 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 105 + * @ingroup compat
gokhlayeh@7031 106 + */
gokhlayeh@7031 107 +template <class T_return>
gokhlayeh@7031 108 +class Slot0
gokhlayeh@7031 109 + : public ::sigc::slot<T_return>
gokhlayeh@7031 110 +{
gokhlayeh@7031 111 +public:
gokhlayeh@7031 112 + typedef ::sigc::slot<T_return> parent_type;
gokhlayeh@7031 113 +
gokhlayeh@7031 114 + /// Constructs an empty slot.
gokhlayeh@7031 115 + Slot0() {}
gokhlayeh@7031 116 +
gokhlayeh@7031 117 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 118 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 119 + */
gokhlayeh@7031 120 + template <class T_functor>
gokhlayeh@7031 121 + Slot0(const T_functor& _A_func)
gokhlayeh@7031 122 + : ::sigc::slot<T_return>(_A_func) {}
gokhlayeh@7031 123 +
gokhlayeh@7031 124 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 125 + * @param src The existing slot to copy.
gokhlayeh@7031 126 + */
gokhlayeh@7031 127 + Slot0(const parent_type& src)
gokhlayeh@7031 128 + : parent_type(src) {}
gokhlayeh@7031 129 +
gokhlayeh@7031 130 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 131 + * @param src The slot from which to make a copy.
gokhlayeh@7031 132 + * @return @p this.
gokhlayeh@7031 133 + */
gokhlayeh@7031 134 + Slot0& operator=(const parent_type& src)
gokhlayeh@7031 135 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 136 +};
gokhlayeh@7031 137 +
gokhlayeh@7031 138 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 139 + * Slot1 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 140 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 141 + *
gokhlayeh@7031 142 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 143 + * - @e T_return The return type of operator()().
gokhlayeh@7031 144 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 145 + *
gokhlayeh@7031 146 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 147 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 148 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 149 + * will invoke the functor with minimal copies.
gokhlayeh@7031 150 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 151 + * from operator()() temporarily.
gokhlayeh@7031 152 + *
gokhlayeh@7031 153 + * @par Example:
gokhlayeh@7031 154 + * @code
gokhlayeh@7031 155 + * #include <sigc++/slot.h>
gokhlayeh@7031 156 + * void foo(int) {}
gokhlayeh@7031 157 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 158 + * s(19);
gokhlayeh@7031 159 + * @endcode
gokhlayeh@7031 160 + *
gokhlayeh@7031 161 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 162 + * @ingroup compat
gokhlayeh@7031 163 + */
gokhlayeh@7031 164 +template <class T_return, class T_arg1>
gokhlayeh@7031 165 +class Slot1
gokhlayeh@7031 166 + : public ::sigc::slot<T_return, T_arg1>
gokhlayeh@7031 167 +{
gokhlayeh@7031 168 +public:
gokhlayeh@7031 169 + typedef ::sigc::slot<T_return, T_arg1> parent_type;
gokhlayeh@7031 170 +
gokhlayeh@7031 171 + /// Constructs an empty slot.
gokhlayeh@7031 172 + Slot1() {}
gokhlayeh@7031 173 +
gokhlayeh@7031 174 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 175 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 176 + */
gokhlayeh@7031 177 + template <class T_functor>
gokhlayeh@7031 178 + Slot1(const T_functor& _A_func)
gokhlayeh@7031 179 + : ::sigc::slot<T_return, T_arg1>(_A_func) {}
gokhlayeh@7031 180 +
gokhlayeh@7031 181 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 182 + * @param src The existing slot to copy.
gokhlayeh@7031 183 + */
gokhlayeh@7031 184 + Slot1(const parent_type& src)
gokhlayeh@7031 185 + : parent_type(src) {}
gokhlayeh@7031 186 +
gokhlayeh@7031 187 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 188 + * @param src The slot from which to make a copy.
gokhlayeh@7031 189 + * @return @p this.
gokhlayeh@7031 190 + */
gokhlayeh@7031 191 + Slot1& operator=(const parent_type& src)
gokhlayeh@7031 192 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 193 +};
gokhlayeh@7031 194 +
gokhlayeh@7031 195 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 196 + * Slot2 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 197 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 198 + *
gokhlayeh@7031 199 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 200 + * - @e T_return The return type of operator()().
gokhlayeh@7031 201 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 202 + * - @e T_arg2 Argument type used in the definition of operator()().
gokhlayeh@7031 203 + *
gokhlayeh@7031 204 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 205 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 206 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 207 + * will invoke the functor with minimal copies.
gokhlayeh@7031 208 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 209 + * from operator()() temporarily.
gokhlayeh@7031 210 + *
gokhlayeh@7031 211 + * @par Example:
gokhlayeh@7031 212 + * @code
gokhlayeh@7031 213 + * #include <sigc++/slot.h>
gokhlayeh@7031 214 + * void foo(int) {}
gokhlayeh@7031 215 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 216 + * s(19);
gokhlayeh@7031 217 + * @endcode
gokhlayeh@7031 218 + *
gokhlayeh@7031 219 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 220 + * @ingroup compat
gokhlayeh@7031 221 + */
gokhlayeh@7031 222 +template <class T_return, class T_arg1,class T_arg2>
gokhlayeh@7031 223 +class Slot2
gokhlayeh@7031 224 + : public ::sigc::slot<T_return, T_arg1,T_arg2>
gokhlayeh@7031 225 +{
gokhlayeh@7031 226 +public:
gokhlayeh@7031 227 + typedef ::sigc::slot<T_return, T_arg1,T_arg2> parent_type;
gokhlayeh@7031 228 +
gokhlayeh@7031 229 + /// Constructs an empty slot.
gokhlayeh@7031 230 + Slot2() {}
gokhlayeh@7031 231 +
gokhlayeh@7031 232 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 233 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 234 + */
gokhlayeh@7031 235 + template <class T_functor>
gokhlayeh@7031 236 + Slot2(const T_functor& _A_func)
gokhlayeh@7031 237 + : ::sigc::slot<T_return, T_arg1,T_arg2>(_A_func) {}
gokhlayeh@7031 238 +
gokhlayeh@7031 239 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 240 + * @param src The existing slot to copy.
gokhlayeh@7031 241 + */
gokhlayeh@7031 242 + Slot2(const parent_type& src)
gokhlayeh@7031 243 + : parent_type(src) {}
gokhlayeh@7031 244 +
gokhlayeh@7031 245 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 246 + * @param src The slot from which to make a copy.
gokhlayeh@7031 247 + * @return @p this.
gokhlayeh@7031 248 + */
gokhlayeh@7031 249 + Slot2& operator=(const parent_type& src)
gokhlayeh@7031 250 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 251 +};
gokhlayeh@7031 252 +
gokhlayeh@7031 253 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 254 + * Slot3 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 255 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 256 + *
gokhlayeh@7031 257 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 258 + * - @e T_return The return type of operator()().
gokhlayeh@7031 259 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 260 + * - @e T_arg2 Argument type used in the definition of operator()().
gokhlayeh@7031 261 + * - @e T_arg3 Argument type used in the definition of operator()().
gokhlayeh@7031 262 + *
gokhlayeh@7031 263 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 264 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 265 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 266 + * will invoke the functor with minimal copies.
gokhlayeh@7031 267 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 268 + * from operator()() temporarily.
gokhlayeh@7031 269 + *
gokhlayeh@7031 270 + * @par Example:
gokhlayeh@7031 271 + * @code
gokhlayeh@7031 272 + * #include <sigc++/slot.h>
gokhlayeh@7031 273 + * void foo(int) {}
gokhlayeh@7031 274 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 275 + * s(19);
gokhlayeh@7031 276 + * @endcode
gokhlayeh@7031 277 + *
gokhlayeh@7031 278 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 279 + * @ingroup compat
gokhlayeh@7031 280 + */
gokhlayeh@7031 281 +template <class T_return, class T_arg1,class T_arg2,class T_arg3>
gokhlayeh@7031 282 +class Slot3
gokhlayeh@7031 283 + : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3>
gokhlayeh@7031 284 +{
gokhlayeh@7031 285 +public:
gokhlayeh@7031 286 + typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3> parent_type;
gokhlayeh@7031 287 +
gokhlayeh@7031 288 + /// Constructs an empty slot.
gokhlayeh@7031 289 + Slot3() {}
gokhlayeh@7031 290 +
gokhlayeh@7031 291 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 292 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 293 + */
gokhlayeh@7031 294 + template <class T_functor>
gokhlayeh@7031 295 + Slot3(const T_functor& _A_func)
gokhlayeh@7031 296 + : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3>(_A_func) {}
gokhlayeh@7031 297 +
gokhlayeh@7031 298 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 299 + * @param src The existing slot to copy.
gokhlayeh@7031 300 + */
gokhlayeh@7031 301 + Slot3(const parent_type& src)
gokhlayeh@7031 302 + : parent_type(src) {}
gokhlayeh@7031 303 +
gokhlayeh@7031 304 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 305 + * @param src The slot from which to make a copy.
gokhlayeh@7031 306 + * @return @p this.
gokhlayeh@7031 307 + */
gokhlayeh@7031 308 + Slot3& operator=(const parent_type& src)
gokhlayeh@7031 309 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 310 +};
gokhlayeh@7031 311 +
gokhlayeh@7031 312 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 313 + * Slot4 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 314 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 315 + *
gokhlayeh@7031 316 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 317 + * - @e T_return The return type of operator()().
gokhlayeh@7031 318 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 319 + * - @e T_arg2 Argument type used in the definition of operator()().
gokhlayeh@7031 320 + * - @e T_arg3 Argument type used in the definition of operator()().
gokhlayeh@7031 321 + * - @e T_arg4 Argument type used in the definition of operator()().
gokhlayeh@7031 322 + *
gokhlayeh@7031 323 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 324 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 325 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 326 + * will invoke the functor with minimal copies.
gokhlayeh@7031 327 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 328 + * from operator()() temporarily.
gokhlayeh@7031 329 + *
gokhlayeh@7031 330 + * @par Example:
gokhlayeh@7031 331 + * @code
gokhlayeh@7031 332 + * #include <sigc++/slot.h>
gokhlayeh@7031 333 + * void foo(int) {}
gokhlayeh@7031 334 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 335 + * s(19);
gokhlayeh@7031 336 + * @endcode
gokhlayeh@7031 337 + *
gokhlayeh@7031 338 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 339 + * @ingroup compat
gokhlayeh@7031 340 + */
gokhlayeh@7031 341 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
gokhlayeh@7031 342 +class Slot4
gokhlayeh@7031 343 + : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>
gokhlayeh@7031 344 +{
gokhlayeh@7031 345 +public:
gokhlayeh@7031 346 + typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4> parent_type;
gokhlayeh@7031 347 +
gokhlayeh@7031 348 + /// Constructs an empty slot.
gokhlayeh@7031 349 + Slot4() {}
gokhlayeh@7031 350 +
gokhlayeh@7031 351 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 352 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 353 + */
gokhlayeh@7031 354 + template <class T_functor>
gokhlayeh@7031 355 + Slot4(const T_functor& _A_func)
gokhlayeh@7031 356 + : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>(_A_func) {}
gokhlayeh@7031 357 +
gokhlayeh@7031 358 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 359 + * @param src The existing slot to copy.
gokhlayeh@7031 360 + */
gokhlayeh@7031 361 + Slot4(const parent_type& src)
gokhlayeh@7031 362 + : parent_type(src) {}
gokhlayeh@7031 363 +
gokhlayeh@7031 364 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 365 + * @param src The slot from which to make a copy.
gokhlayeh@7031 366 + * @return @p this.
gokhlayeh@7031 367 + */
gokhlayeh@7031 368 + Slot4& operator=(const parent_type& src)
gokhlayeh@7031 369 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 370 +};
gokhlayeh@7031 371 +
gokhlayeh@7031 372 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 373 + * Slot5 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 374 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 375 + *
gokhlayeh@7031 376 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 377 + * - @e T_return The return type of operator()().
gokhlayeh@7031 378 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 379 + * - @e T_arg2 Argument type used in the definition of operator()().
gokhlayeh@7031 380 + * - @e T_arg3 Argument type used in the definition of operator()().
gokhlayeh@7031 381 + * - @e T_arg4 Argument type used in the definition of operator()().
gokhlayeh@7031 382 + * - @e T_arg5 Argument type used in the definition of operator()().
gokhlayeh@7031 383 + *
gokhlayeh@7031 384 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 385 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 386 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 387 + * will invoke the functor with minimal copies.
gokhlayeh@7031 388 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 389 + * from operator()() temporarily.
gokhlayeh@7031 390 + *
gokhlayeh@7031 391 + * @par Example:
gokhlayeh@7031 392 + * @code
gokhlayeh@7031 393 + * #include <sigc++/slot.h>
gokhlayeh@7031 394 + * void foo(int) {}
gokhlayeh@7031 395 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 396 + * s(19);
gokhlayeh@7031 397 + * @endcode
gokhlayeh@7031 398 + *
gokhlayeh@7031 399 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 400 + * @ingroup compat
gokhlayeh@7031 401 + */
gokhlayeh@7031 402 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
gokhlayeh@7031 403 +class Slot5
gokhlayeh@7031 404 + : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>
gokhlayeh@7031 405 +{
gokhlayeh@7031 406 +public:
gokhlayeh@7031 407 + typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> parent_type;
gokhlayeh@7031 408 +
gokhlayeh@7031 409 + /// Constructs an empty slot.
gokhlayeh@7031 410 + Slot5() {}
gokhlayeh@7031 411 +
gokhlayeh@7031 412 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 413 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 414 + */
gokhlayeh@7031 415 + template <class T_functor>
gokhlayeh@7031 416 + Slot5(const T_functor& _A_func)
gokhlayeh@7031 417 + : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>(_A_func) {}
gokhlayeh@7031 418 +
gokhlayeh@7031 419 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 420 + * @param src The existing slot to copy.
gokhlayeh@7031 421 + */
gokhlayeh@7031 422 + Slot5(const parent_type& src)
gokhlayeh@7031 423 + : parent_type(src) {}
gokhlayeh@7031 424 +
gokhlayeh@7031 425 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 426 + * @param src The slot from which to make a copy.
gokhlayeh@7031 427 + * @return @p this.
gokhlayeh@7031 428 + */
gokhlayeh@7031 429 + Slot5& operator=(const parent_type& src)
gokhlayeh@7031 430 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 431 +};
gokhlayeh@7031 432 +
gokhlayeh@7031 433 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 434 + * Slot6 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 435 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 436 + *
gokhlayeh@7031 437 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 438 + * - @e T_return The return type of operator()().
gokhlayeh@7031 439 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 440 + * - @e T_arg2 Argument type used in the definition of operator()().
gokhlayeh@7031 441 + * - @e T_arg3 Argument type used in the definition of operator()().
gokhlayeh@7031 442 + * - @e T_arg4 Argument type used in the definition of operator()().
gokhlayeh@7031 443 + * - @e T_arg5 Argument type used in the definition of operator()().
gokhlayeh@7031 444 + * - @e T_arg6 Argument type used in the definition of operator()().
gokhlayeh@7031 445 + *
gokhlayeh@7031 446 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 447 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 448 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 449 + * will invoke the functor with minimal copies.
gokhlayeh@7031 450 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 451 + * from operator()() temporarily.
gokhlayeh@7031 452 + *
gokhlayeh@7031 453 + * @par Example:
gokhlayeh@7031 454 + * @code
gokhlayeh@7031 455 + * #include <sigc++/slot.h>
gokhlayeh@7031 456 + * void foo(int) {}
gokhlayeh@7031 457 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 458 + * s(19);
gokhlayeh@7031 459 + * @endcode
gokhlayeh@7031 460 + *
gokhlayeh@7031 461 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 462 + * @ingroup compat
gokhlayeh@7031 463 + */
gokhlayeh@7031 464 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
gokhlayeh@7031 465 +class Slot6
gokhlayeh@7031 466 + : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>
gokhlayeh@7031 467 +{
gokhlayeh@7031 468 +public:
gokhlayeh@7031 469 + typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> parent_type;
gokhlayeh@7031 470 +
gokhlayeh@7031 471 + /// Constructs an empty slot.
gokhlayeh@7031 472 + Slot6() {}
gokhlayeh@7031 473 +
gokhlayeh@7031 474 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 475 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 476 + */
gokhlayeh@7031 477 + template <class T_functor>
gokhlayeh@7031 478 + Slot6(const T_functor& _A_func)
gokhlayeh@7031 479 + : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>(_A_func) {}
gokhlayeh@7031 480 +
gokhlayeh@7031 481 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 482 + * @param src The existing slot to copy.
gokhlayeh@7031 483 + */
gokhlayeh@7031 484 + Slot6(const parent_type& src)
gokhlayeh@7031 485 + : parent_type(src) {}
gokhlayeh@7031 486 +
gokhlayeh@7031 487 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 488 + * @param src The slot from which to make a copy.
gokhlayeh@7031 489 + * @return @p this.
gokhlayeh@7031 490 + */
gokhlayeh@7031 491 + Slot6& operator=(const parent_type& src)
gokhlayeh@7031 492 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 493 +};
gokhlayeh@7031 494 +
gokhlayeh@7031 495 +/** Converts an arbitrary functor to a unified type which is opaque.
gokhlayeh@7031 496 + * Slot7 itself is a functor or to be more precise a closure. It contains
gokhlayeh@7031 497 + * a single, arbitrary functor (or closure) that is executed in operator()().
gokhlayeh@7031 498 + *
gokhlayeh@7031 499 + * The template arguments determine the function signature of operator()():
gokhlayeh@7031 500 + * - @e T_return The return type of operator()().
gokhlayeh@7031 501 + * - @e T_arg1 Argument type used in the definition of operator()().
gokhlayeh@7031 502 + * - @e T_arg2 Argument type used in the definition of operator()().
gokhlayeh@7031 503 + * - @e T_arg3 Argument type used in the definition of operator()().
gokhlayeh@7031 504 + * - @e T_arg4 Argument type used in the definition of operator()().
gokhlayeh@7031 505 + * - @e T_arg5 Argument type used in the definition of operator()().
gokhlayeh@7031 506 + * - @e T_arg6 Argument type used in the definition of operator()().
gokhlayeh@7031 507 + * - @e T_arg7 Argument type used in the definition of operator()().
gokhlayeh@7031 508 + *
gokhlayeh@7031 509 + * To use simply assign the slot to the desired functor. If the functor
gokhlayeh@7031 510 + * is not compatible with the parameter list defined with the template
gokhlayeh@7031 511 + * arguments compiler errors are triggered. When called the slot
gokhlayeh@7031 512 + * will invoke the functor with minimal copies.
gokhlayeh@7031 513 + * block() and unblock() can be used to block the functor's invocation
gokhlayeh@7031 514 + * from operator()() temporarily.
gokhlayeh@7031 515 + *
gokhlayeh@7031 516 + * @par Example:
gokhlayeh@7031 517 + * @code
gokhlayeh@7031 518 + * #include <sigc++/slot.h>
gokhlayeh@7031 519 + * void foo(int) {}
gokhlayeh@7031 520 + * SigC::Slot1<void, long> s = SigC::slot(&foo);
gokhlayeh@7031 521 + * s(19);
gokhlayeh@7031 522 + * @endcode
gokhlayeh@7031 523 + *
gokhlayeh@7031 524 + * @deprecated Use the unnumbered template sigc::slot instead.
gokhlayeh@7031 525 + * @ingroup compat
gokhlayeh@7031 526 + */
gokhlayeh@7031 527 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
gokhlayeh@7031 528 +class Slot7
gokhlayeh@7031 529 + : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
gokhlayeh@7031 530 {
gokhlayeh@7031 531 +public:
gokhlayeh@7031 532 + typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> parent_type;
gokhlayeh@7031 533 +
gokhlayeh@7031 534 + /// Constructs an empty slot.
gokhlayeh@7031 535 + Slot7() {}
gokhlayeh@7031 536 +
gokhlayeh@7031 537 + /** Constructs a slot from an arbitrary functor.
gokhlayeh@7031 538 + * @param _A_func The desired functor the new slot should be assigned to.
gokhlayeh@7031 539 + */
gokhlayeh@7031 540 + template <class T_functor>
gokhlayeh@7031 541 + Slot7(const T_functor& _A_func)
gokhlayeh@7031 542 + : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>(_A_func) {}
gokhlayeh@7031 543 +
gokhlayeh@7031 544 + /** Constructs a slot, copying an existing one.
gokhlayeh@7031 545 + * @param src The existing slot to copy.
gokhlayeh@7031 546 + */
gokhlayeh@7031 547 + Slot7(const parent_type& src)
gokhlayeh@7031 548 + : parent_type(src) {}
gokhlayeh@7031 549 +
gokhlayeh@7031 550 + /** Overrides this slot making a copy from another slot.
gokhlayeh@7031 551 + * @param src The slot from which to make a copy.
gokhlayeh@7031 552 + * @return @p this.
gokhlayeh@7031 553 + */
gokhlayeh@7031 554 + Slot7& operator=(const parent_type& src)
gokhlayeh@7031 555 + { parent_type::operator=(src); return *this; }
gokhlayeh@7031 556 +};
gokhlayeh@7031 557 +
gokhlayeh@7031 558 +
gokhlayeh@7031 559 +
gokhlayeh@7031 560 +#ifndef DOXYGEN_SHOULD_SKIP_THIS
gokhlayeh@7031 561 +/* gcc 3.2 reports a strange conflict between SigC::slot() and sigc::slot<>
gokhlayeh@7031 562 + * when "using namespace SigC" and later using a slot(obj,func) overload
gokhlayeh@7031 563 + * without the prefix "SigC::". Probably a compiler bug. I will investigate.
gokhlayeh@7031 564 + *
gokhlayeh@7031 565 + * This ugly hack avoids the error:
gokhlayeh@7031 566 + */
gokhlayeh@7031 567 +// #define slot(...) make_slot(__VA_ARGS__) /* only works for gcc */
gokhlayeh@7031 568 +#endif
gokhlayeh@7031 569
gokhlayeh@7031 570 +
gokhlayeh@7031 571 +// slot()
gokhlayeh@7031 572 +/** Creates a functor of type SigC::Slot0 that wraps an existing non-member function.
gokhlayeh@7031 573 + *
gokhlayeh@7031 574 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 575 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 576 + *
gokhlayeh@7031 577 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 578 + * @ingroup compat
gokhlayeh@7031 579 + */
gokhlayeh@7031 580 +template <class T_return>
gokhlayeh@7031 581 +inline Slot0<T_return>
gokhlayeh@7031 582 +slot(T_return (*_A_func)())
gokhlayeh@7031 583 +{ return Slot0<T_return>(_A_func); }
gokhlayeh@7031 584 +
gokhlayeh@7031 585 +/** Creates a functor of type SigC::Slot1 that wraps an existing non-member function.
gokhlayeh@7031 586 + *
gokhlayeh@7031 587 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 588 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 589 + *
gokhlayeh@7031 590 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 591 + * @ingroup compat
gokhlayeh@7031 592 + */
gokhlayeh@7031 593 +template <class T_return, class T_arg1>
gokhlayeh@7031 594 +inline Slot1<T_return, T_arg1>
gokhlayeh@7031 595 +slot(T_return (*_A_func)(T_arg1))
gokhlayeh@7031 596 +{ return Slot1<T_return, T_arg1>(_A_func); }
gokhlayeh@7031 597 +
gokhlayeh@7031 598 +/** Creates a functor of type SigC::Slot2 that wraps an existing non-member function.
gokhlayeh@7031 599 + *
gokhlayeh@7031 600 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 601 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 602 + *
gokhlayeh@7031 603 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 604 + * @ingroup compat
gokhlayeh@7031 605 + */
gokhlayeh@7031 606 +template <class T_return, class T_arg1,class T_arg2>
gokhlayeh@7031 607 +inline Slot2<T_return, T_arg1,T_arg2>
gokhlayeh@7031 608 +slot(T_return (*_A_func)(T_arg1,T_arg2))
gokhlayeh@7031 609 +{ return Slot2<T_return, T_arg1,T_arg2>(_A_func); }
gokhlayeh@7031 610 +
gokhlayeh@7031 611 +/** Creates a functor of type SigC::Slot3 that wraps an existing non-member function.
gokhlayeh@7031 612 + *
gokhlayeh@7031 613 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 614 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 615 + *
gokhlayeh@7031 616 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 617 + * @ingroup compat
gokhlayeh@7031 618 + */
gokhlayeh@7031 619 +template <class T_return, class T_arg1,class T_arg2,class T_arg3>
gokhlayeh@7031 620 +inline Slot3<T_return, T_arg1,T_arg2,T_arg3>
gokhlayeh@7031 621 +slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3))
gokhlayeh@7031 622 +{ return Slot3<T_return, T_arg1,T_arg2,T_arg3>(_A_func); }
gokhlayeh@7031 623 +
gokhlayeh@7031 624 +/** Creates a functor of type SigC::Slot4 that wraps an existing non-member function.
gokhlayeh@7031 625 + *
gokhlayeh@7031 626 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 627 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 628 + *
gokhlayeh@7031 629 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 630 + * @ingroup compat
gokhlayeh@7031 631 + */
gokhlayeh@7031 632 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
gokhlayeh@7031 633 +inline Slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4>
gokhlayeh@7031 634 +slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4))
gokhlayeh@7031 635 +{ return Slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4>(_A_func); }
gokhlayeh@7031 636 +
gokhlayeh@7031 637 +/** Creates a functor of type SigC::Slot5 that wraps an existing non-member function.
gokhlayeh@7031 638 + *
gokhlayeh@7031 639 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 640 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 641 + *
gokhlayeh@7031 642 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 643 + * @ingroup compat
gokhlayeh@7031 644 + */
gokhlayeh@7031 645 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
gokhlayeh@7031 646 +inline Slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>
gokhlayeh@7031 647 +slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5))
gokhlayeh@7031 648 +{ return Slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>(_A_func); }
gokhlayeh@7031 649 +
gokhlayeh@7031 650 +/** Creates a functor of type SigC::Slot6 that wraps an existing non-member function.
gokhlayeh@7031 651 + *
gokhlayeh@7031 652 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 653 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 654 + *
gokhlayeh@7031 655 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 656 + * @ingroup compat
gokhlayeh@7031 657 + */
gokhlayeh@7031 658 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
gokhlayeh@7031 659 +inline Slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>
gokhlayeh@7031 660 +slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6))
gokhlayeh@7031 661 +{ return Slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>(_A_func); }
gokhlayeh@7031 662 +
gokhlayeh@7031 663 +/** Creates a functor of type SigC::Slot7 that wraps an existing non-member function.
gokhlayeh@7031 664 + *
gokhlayeh@7031 665 + * @param _A_func Pointer to function that should be wrapped.
gokhlayeh@7031 666 + * @return Functor that executes _A_func on invokation.
gokhlayeh@7031 667 + *
gokhlayeh@7031 668 + * @deprecated Use sigc::ptr_fun() instead.
gokhlayeh@7031 669 + * @ingroup compat
gokhlayeh@7031 670 + */
gokhlayeh@7031 671 +template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
gokhlayeh@7031 672 +inline Slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
gokhlayeh@7031 673 +slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7))
gokhlayeh@7031 674 +{ return Slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>(_A_func); }
gokhlayeh@7031 675 +
gokhlayeh@7031 676 +
gokhlayeh@7031 677 +
gokhlayeh@7031 678 +}
gokhlayeh@7031 679 +
gokhlayeh@7031 680 +// From sigc++/object.h
gokhlayeh@7031 681 +namespace SigC {
gokhlayeh@7031 682 +
gokhlayeh@7031 683 +// Object
gokhlayeh@7031 684 +typedef ::sigc::trackable Object;
gokhlayeh@7031 685 +
gokhlayeh@7031 686 +}
gokhlayeh@7031 687 +
gokhlayeh@7031 688 +namespace SigC
gokhlayeh@7031 689 +{
gokhlayeh@7031 690 template <class T_return, class T_obj1, class T_obj2>
gokhlayeh@7031 691 inline Slot0<T_return>
gokhlayeh@7031 692 slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() )