Murray Cumming Comneon com said:
muppet said:
overriding existing vfuncs means you have to have the struct
offsets someplace, and you have to know how to marshall them.
with all that, you either need a database of vfuncs and
parameter types,
We have hand-written *_vfuncs.defs files. And we have code to generate
*_signals.defs files.
our signal marshallers are all magical and automatic -- there's one generic
marshaller for GClosures, and overrides may be specified at boot time. not as
fast as your custom generated code, probably, but the maintenance and code
size are almost zero, and that's a huge benefit. if a new version of gtk+
adds a signal, it Just Works, with new no support code needed.
i suppose we could install marshalling data for vfuncs in a GType's qdata, but
that starts to get expensive for startup time and memory usage... and we'd
still have to generate the data somehow at compile time because the library
doesn't provide it. hence, we've gone with hand-coded marshallers for vfuncs
-- painful, but the lesser of evils.