Re: Widget descriptors as unions

Le 29/08/2015 11:08, Florian Pelz a écrit :
On 08/29/2015 10:53 AM, LRN wrote:
On 29.08.2015 11:46, Florian Pelz wrote:
On 08/29/2015 10:39 AM, Jean-Marie Delapierre wrote:
I have explained (I hope in a clear way, but I begin to doubt about it)
that the unions I suggest only own pointers, not child objects as you
say in your answer.
I think it is clear, but you still need to declare one such union for
each class.
Union-pointers sound like a neat trick.

Can't you generate headers with these union-pointer declarations
automatically, using gobject introspection?

I don't like requiring an additional tool for building. It also makes
the inner workings less transparent than using only the C high-level
assembler with macros. I don't think you can do the declaration
conveniently without additional tools, i.e. just a C preprocessor and

I'm also not sure what are the ABI implications. Are unions compile-time
only? I guess you'd only change a pointer-union if the class hierarchy of
its corresponding widget class changes, which sounds like a good excuse to
recompile anyway...

ABI-wise, unions don't make a difference. But: If you use a library that
uses a class that inherits from a GTK class and the GTK class starts
implementing a new interface, you'd need to recompile the library's
header files.

gtk-list mailing list
gtk-list gnome org


To Florian Pelz : I apologize for the aggresseness included in my previous answer.

I have understood the issue of being on the wrong list and I will take care of it.

In the example I have posted in May, I have defined specialized header files for any GTK+ object I use in my program, but it's certainly not what I suggest to do in the future.

What I hope if the advantage of detecting more bugs at compilation time is agreed by the GTK+ community is that the union type declarations would be just included in the standard header files, allowing the programmers to use any coding style they want.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]