Re: Child Properties with gtk-doc



On Fri, Sep 08, 2006 at 09:44:07PM +0100, Damon Chaplin wrote:
> On Fri, 2006-09-08 at 12:11 +0200, Sven Herzberg wrote:
> > 
> > Am Donnerstag, den 07.09.2006, 21:34 -0400 schrieb Matthias Clasen: 
> > > Have you tried simply using the same syntax that works for documenting
> > > regular properties in sources ? I thought that would just work...
> > 
> > No, just because I don't think I can. As the container's properties
> > would be specified by g_object_class_install_property() and the property
> > information would be read by property introspection in the scangobj
> > application built by gtk-doc.
> 
> Coincidentally I've been thinking of using container properties for
> GooCanvas. Though I wasn't sure if it was possible to use them outside
> of GtkContainer.
> 
> Have you got the properties working in ccc?
> 
> If they do work, I'd like to see support added to gtk-doc. Though I
> didn't write that part of gtk-doc so I'm not sure how difficult it would
> be. It might be trivial.

Well, I don't understand what you are both talking about,
but child properties work normally.

That is child properties of subclasses of GtkContainer that
are registered with gtk_container_class_install_child_property()
and that can be found by gtk_container_class_list_child_properties()
inspection.  The syntax for in-line docs is identical to
normal properties:

  /**
   * GtkTable:top-attach:
   *
   * The row number to attach the top of a child widget to.
   *
   * Some more documentation...
   **/
   gtk_container_class_install_child_property(container_class,
                                              ...

In fact the syntax is identical to the extent that you get
into troubles when you have a normal property and a child
property of the same name.

If you want support for a new kind of child properties of
a new kind of containers, you have to hack gtk-doc.  I did
not try it, but if confusion between GtkContainer child
properties and YourContainer child properties is not
possible, it should suffice to modify

#ifdef GTK_IS_CONTAINER_CLASS
    if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) {
      properties = gtk_container_class_list_child_properties (class, &n_properties);
      child_prop = TRUE;
      continue;
    }
#endif

in gtkdoc-scangobj.in to obtain GtkContainer child
properties for GtkContainers and YourContainer child
properties for YourContainers.  The rest of gtk-doc little
cares where the child property came from and you will simply
get it listed in Child properties.

Yeti


--
Anonyms eat their boogers.



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