/usr/lib/x86_64-linux-gnu/glibmm-2.4/proc/m4/signal.m4 is in libglibmm-2.4-dev 2.39.93-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | #
# --------------------------- Signal Decl----------------------------
#
dnl _SIGNAL_PROXY($1 = c_signal_name,
dnl $2 = c_return_type,
dnl $3 = `<c_arg_types_and_names>',
dnl $4 = cpp_signal_name,
dnl $5 = cpp_return_type,
dnl $6 = `<cpp_arg_types>',
dnl $7 = `<c_args_to_cpp>',
dnl $8 = `custom_c_callback (boolean)',
dnl $9 = `deprecated' (boolean),
dnl $10 = `refdoc_comment',
dnl $11 = ifdef)
define(`_SIGNAL_PROXY',`
ifelse(`$11',,,`#ifdef $11'
)dnl
ifelse(`$9',,,`_DEPRECATE_IFDEF_START
')dnl
$10
Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > signal_$4`'();
ifelse(`$9',,,`_DEPRECATE_IFDEF_END
')dnl
ifelse(`$11',,,`#endif // $11
')dnl
dnl
_PUSH(SECTION_ANONYMOUS_NAMESPACE)
ifelse(`$11',,,`#ifdef $11'
)dnl
ifelse(`$9',,,`_DEPRECATE_IFDEF_START
')dnl
dnl
ifelse($2`'_NUM($3)`'$5`'_NUM($6)`'$8,`void0void00',`dnl
dnl
dnl Use predefined callback for SignalProxy0<void>, to reduce code size,
dnl if custom_c_callback is not specified.
static const Glib::SignalProxyInfo __CPPNAME__`'_signal_$4_info =
{
"$1",
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};
',`dnl else
ifelse($8,`1',,`dnl Do not generate the implementation if it should be custom:
static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`'void* data)
{
using namespace __NAMESPACE__;
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))
{
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
#endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
ifelse(`$2',void,`dnl
(*static_cast<SlotType*>(slot))($7);
',`dnl else
return _CONVERT($5,$2,`(*static_cast<SlotType*>(slot))($7)');
')dnl endif
#ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
ifelse($2,void,,`dnl else
typedef $2 RType;
return RType`'();
')dnl
}
ifelse($2,void,,`dnl else
static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`' void* data)
{
using namespace __NAMESPACE__;
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))
{
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
#endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
(*static_cast<SlotType*>(slot))($7);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
typedef $2 RType;
return RType`'();
}
')dnl endif
')dnl endif
static const Glib::SignalProxyInfo __CPPNAME__`'_signal_$4_info =
{
"$1",
(GCallback) &__CPPNAME__`'_signal_$4_callback,
(GCallback) &__CPPNAME__`'_signal_$4_`'ifelse($2,void,,notify_)`'callback
};
')dnl endif
ifelse(`$9',,,`_DEPRECATE_IFDEF_END
')dnl
ifelse(`$11',,,`#endif // $11
')dnl
_SECTION(SECTION_CC_SIGNALPROXIES)
ifelse(`$11',,,`#ifdef $11'
)dnl
ifelse(`$9',,,`_DEPRECATE_IFDEF_START
')dnl
Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'()
{
return Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info);
}
ifelse(`$9',,,`_DEPRECATE_IFDEF_END
')dnl
ifelse(`$11',,,`#endif // $11
')dnl
_POP()')
dnl $1 $2 $3 $4 $5
dnl _SIGNAL_PH(gname, crettype, cargs and names, ifdef, deprecated)
dnl Create a callback and set it in our derived G*Class.
dnl
define(`_SIGNAL_PH',`dnl
_PUSH(SECTION_PCC_CLASS_INIT_DEFAULT_SIGNAL_HANDLERS)
ifelse(`$4',,,`#ifdef $4'
)dnl
ifelse(`$5',,,`_DEPRECATE_IFDEF_START
')dnl
klass->$1 = `&'$1_callback;
ifelse(`$5',,,`_DEPRECATE_IFDEF_END
')dnl
ifelse(`$4',,,`#endif // $4
')dnl
_SECTION(SECTION_PH_DEFAULT_SIGNAL_HANDLERS)
ifelse(`$4',,,`#ifdef $4'
)dnl
ifelse(`$5',,,`_DEPRECATE_IFDEF_START
')dnl
static $2 $1_callback`'($3);
ifelse(`$5',,,`_DEPRECATE_IFDEF_END
')dnl
ifelse(`$4',,,`#endif // $4
')dnl
_POP()')
dnl $1 $2 $3 $4 $5 $6
dnl _SIGNAL_PCC(cppname,gname,cpprettype,crettype,`<cargs and names>',`<cnames>',
dnl $7 $8 $9 $10
dnl `<cpparg names>',firstarg,<ifdef>,deprecated)
dnl
define(`_SIGNAL_PCC',`dnl
_PUSH(SECTION_PCC_DEFAULT_SIGNAL_HANDLERS)
ifelse(`$9',,,`#ifdef $9'
)dnl
ifelse(`$10',,,`_DEPRECATE_IFDEF_START
')dnl
$4 __CPPNAME__`'_Class::$2_callback`'($5)
{
dnl First, do a simple cast to ObjectBase. We will have to do a dynamic_cast
dnl eventually, but it is not necessary to check whether we need to call
dnl the vfunc.
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper`'((GObject*)$8));
_IMPORT(SECTION_CHECK)
// Non-gtkmmproc-generated custom classes implicitly call the default
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
// generated classes can use this optimisation, which avoids the unnecessary
// parameter conversions if there is no possibility of the virtual function
// being overridden:
if(obj_base && obj_base->is_derived_())
{
dnl We need to do a dynamic cast to get the real object type, to call the
dnl C++ vfunc on it.
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
if(obj) // This can be NULL during destruction.
{
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
#endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
ifelse($4,void,`dnl
obj->on_$1`'($7);
return;
',`dnl
return _CONVERT($3,$4,`obj->on_$1`'($7)');
')dnl
#ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke`'();
}
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
BaseClassType *const base = static_cast<BaseClassType*>(
ifdef(`__BOOL_IS_INTERFACE__',`dnl
_IFACE_PARENT_FROM_OBJECT($8)dnl
',`dnl
_PARENT_GCLASS_FROM_OBJECT($8)dnl
') );
dnl g_assert(base != 0);
// Call the original underlying C function:
if(base && base->$2)
ifelse($4,void,,`return ')(*base->$2)`'($6);
ifelse($4,void,,`dnl
typedef $4 RType;
return RType`'();
')dnl
}
ifelse(`$10',,,`_DEPRECATE_IFDEF_END
')dnl
ifelse(`$9',,,`#endif // $9
')dnl
_POP()')
dnl $1 $2 $3 $4
dnl _SIGNAL_H(signame, rettype, `<cppargs>', <ifdef>)
dnl
define(`_SIGNAL_H',`dnl
_PUSH(SECTION_H_DEFAULT_SIGNAL_HANDLERS)
ifelse(`$4',,,`#ifdef $4'
)dnl
/// This is a default handler for the signal signal_$1`'().
virtual $2 on_$1`'($3);
ifelse(`$4',,,`#endif // $4
')dnl
_POP()')
dnl $1 $2 $3 $4 $5 $6 $7 $8 $9
dnl _SIGNAL_CC(signame,gname,rettype,crettype,`<cppargs>',`<carg_names>', const, refreturn, <ifdef>)
dnl
define(`_SIGNAL_CC',`dnl
_PUSH(SECTION_CC_DEFAULT_SIGNAL_HANDLERS)
ifelse(`$9',,,`#ifdef $9'
)dnl
$3 __NAMESPACE__::__CPPNAME__::on_$1`'($5)
{
BaseClassType *const base = static_cast<BaseClassType*>(
ifdef(`__BOOL_IS_INTERFACE__',`dnl
_IFACE_PARENT_FROM_OBJECT(gobject_)dnl
',`dnl
_PARENT_GCLASS_FROM_OBJECT(gobject_)dnl
') );
dnl g_assert(base != 0);
if(base && base->$2)
ifelse($3,void,`dnl
(*base->$2)`'(gobj`'()`'_COMMA_PREFIX($6));
',`dnl
ifelse($8,refreturn,`dnl Assume Glib::wrap() is correct if refreturn is requested.
return Glib::wrap((*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6)), true);
',`dnl
return _CONVERT($4,$3,`(*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6))');
')dnl
typedef $3 RType;
return RType`'();
')dnl
}
ifelse(`$9',,,`#endif // $9
')dnl
_POP()')
|