After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 665926 - should not have to document object structures
should not have to document object structures
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: 1.20
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-10 22:21 UTC by Allison Karlitskaya (desrt)
Modified: 2014-02-14 20:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mkdb: change format of KnownSymbols dict (4.96 KB, patch)
2011-12-10 22:25 UTC, Allison Karlitskaya (desrt)
rejected Details | Review
mkdb: recognise GObjects in 'standard' (2.46 KB, patch)
2011-12-10 22:25 UTC, Allison Karlitskaya (desrt)
rejected Details | Review

Description Allison Karlitskaya (desrt) 2011-12-10 22:21:44 UTC
It's pretty annoying to have to write this over and over:

/**
 * MyObject:
 *
 * The MyObject structure contains only private data.  Do not use this.
 **/

Instead, we should be able to put MyObject into the Standard subsection and still have the proper GObject stuff get emitted into the page.
Comment 1 Allison Karlitskaya (desrt) 2011-12-10 22:25:02 UTC
Created attachment 203191 [details] [review]
mkdb: change format of KnownSymbols dict

Instead of storing '1' for known public symbols and '0' for known
private/standard symbols, store the strings "public", "standard" and
"private", accordingly.
Comment 2 Allison Karlitskaya (desrt) 2011-12-10 22:25:04 UTC
Created attachment 203192 [details] [review]
mkdb: recognise GObjects in 'standard'

Only ignore GObject types if they are in Private subsections.  Do the
normal GObject introspection stuff for those included in Standard.
Comment 3 Allison Karlitskaya (desrt) 2011-12-10 22:26:29 UTC
This is the beginning of an idea of how we might want to handle this.  It's currently broken due to (I think) this code:

  # We don't want standard macros/functions of GObjects,
  # or private declarations.
  if ($subsection ne "Standard" && $subsection ne "Private") {


in OutputSGML() that I'm scared to modify...
Comment 4 Yeti 2011-12-10 22:50:59 UTC
I have GObjects that do intentionally have public data members, marked /*<public>*/, of course to get them documented.  I do not want them disappear, thank you very much.

Also, that the standard stuff is not mentioned at all seems to be confusing to some novice users of the libs.  Removing more means increasing the confusion.

So, IMO, this is heading in an entirely wrong direction.  Instead, the documentation of the standard symbols should be automatically created if there is no manual documentation overridng it -- see bug 166363.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2011-12-11 16:02:22 UTC
+1 for what Yeti said. I would be open to have a commandline switch to choose a different policy if one can come up with a simple enough scheme. I don't want 10 new options for it really.
Comment 6 Dan Winship 2013-01-03 20:52:31 UTC
(In reply to comment #4)
> I have GObjects that do intentionally have public data members, marked
> /*<public>*/, of course to get them documented.  I do not want them disappear,
> thank you very much.

That's not what Ryan's patch does (assuming I'm reading it correctly). It adds the *option* of omitting the struct entry (while still documenting the signals, hierarchy, etc), but it also keeps the two existing options (to show everything, or to show nothing).

In Ryan's patch, the new option is triggered by putting the struct into <SUBSECTION Standard>, but that used to be equivalent to putting it in <SUBSECTION Private>, so this might change the behavior in some modules where people intended for the type to be hidden...
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-18 14:24:37 UTC
Review of attachment 203191 [details] [review]:

::: gtkdoc-mkdb.in
@@ +1195,3 @@
             }
             else {
+                $KnownSymbols{$symbol} = $subsection;

lc $subsection
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-18 14:30:47 UTC
(In reply to comment #7)
> Review of attachment 203191 [details] [review]:
> 
> ::: gtkdoc-mkdb.in
> @@ +1195,3 @@
>              }
>              else {
> +                $KnownSymbols{$symbol} = $subsection;
> 
> lc $subsection

Or alternatively also use the form with a leading uppercase character (maybe more consistent).

(In reply to comment #3)
> This is the beginning of an idea of how we might want to handle this.  It's
> currently broken due to (I think) this code:
> 
>   # We don't want standard macros/functions of GObjects,
>   # or private declarations.
>   if ($subsection ne "Standard" && $subsection ne "Private") {
> 
> 
> in OutputSGML() that I'm scared to modify...

How is it broken? You probably want to ensure that
if (&CheckIsObject ($symbol)) {
    push @file_objects, $symbol;
}
is now called for both "Public" and "Standard".
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-14 10:27:22 UTC
So what is the plan? Regarding policy, there is also: bug#324880.

With current git (upcomming 1.20), gtkdoc-scan is only adding Object, ObjectClass and ObjectIface/Interface to the public subsection of the autogenerated section file if they are actually documented. Personally I put the ObjectClass to the standart subsection in my manual section file for some time already if there is nothing there to be documented.

Ryan, are you saying that if an object has neither Object nor ObjectClass documented it is not showing up as a GObject in the docs (not properties, signals, hierarchy, ...)?
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-14 20:38:12 UTC
I added a testcase and push a simple fix. Now gobject that have section docs show up with all details.

commit 457c8bb87ea05d4da5f08f33b4799c0622cca0c2
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Fri Feb 14 21:15:09 2014 +0100

    mkdb: show object details also for mostly undocumented objects
    
    Simplyfy the code. If there is a section entry for an object, show the object
    details and the docs we have.
    Fixes #593282

commit 28380a862cfa50725a9b69f5004ce04edb5f91fb
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Fri Feb 14 21:14:23 2014 +0100

    tests: add a undocumented object
    
    Test case for bug#593282