- Date: Fri, 21 Oct 2016 01:30:33 +1100
- From: Timothy Ward <gtwa001@xxxxxxxxx>
- Subject: Re: gobject
On Thu, 2016-10-20 at 15:01 +0100, Emmanuele Bassi wrote:
> On 20 October 2016 at 14:50, Timothy Ward <gtwa001@xxxxxxxxx> wrote:
> > >
> > > Yes. Ideally, the "new" style, with G_DECLARE_* and
> > > G_DEFINE_TYPE,
> > > should be used for all newly written code, as it allows not only
> > > hiding the internals of the type system, but also allows GLib
> > > maintainer to update the best practices for creating types
> > > without
> > > requiring vast amounts of code rewrites — just a rebuild.
> > >
> > > >
> > > >
> > > > The referenced docs do not provided full explanations or
> > > > examples
> > > > of
> > > > either.
> > >
> > > What kind of full explanation are you looking for, precisely?
> > How to code both types - explanation of the boiler plate code
> > what it is for and how to code it.
This was to be able to understand when studying code that has it
already incorporated but I understand your purpose below.
Thanks for the great references.
> That's the rub: writing down what the boilerplate code is means that
> we commit to it for all eternity — or, at least, until a major API
> The whole idea of using the macros is not just to avoid the
> boilerplate: is to make it irrelevant to know what the boilerplate
> does, unless you're literally hacking on the type system itself.
> Given that GObject is mostly based on conventions more than API, to
> make up from lack of syntactic sugar, following conventions and best
> practices is generally the right path.
> If you want to know what the macros do, you can still look at their
> API reference:
> and the conventions used by GObject-based code:
> and, eventually, to the macro implementation, inside
gtk-list mailing list