<!DOCTYPE html><html><head><title></title><style type="text/css">#qt p{white-space:pre-wrap;}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Even,<br></div><div><br></div><div>The SWIG doc updates are scattered through several pull requests and wiki pages. I'll put these together into an RFC before making any further changes and I'll leave the typedefs alone. <br></div><div><br></div><div>I was trying to avoid touching the header files, but the docstrings have to be next to the properties to force SWIG to attach them to the nodes. It will only be properties that require a docstring here, functions are all documented in the .i files. <br></div><div>I did try an approach of setting the docstrings with a macro and inserting just the macro in the .h files, but this added an extra level of indirection, and would likely mean no properties available in MapScript would be kept updated. <br></div><div><br></div><div>The advantage of the SWIG docstrings is they can then be read from the Python source and then Sphinx can take over allowing internal doc links, inclusion of text, images, examples on a class by class basis. <br></div><div><br></div><div>I'll upload some sample output as part of the RFC. <br></div><div><br></div><div>Seth<br></div><div><br></div><div id="sig62266145"><div>--<br></div><div>web:http://geographika.co.uk<br></div><div>twitter: @geographika<br></div></div><div><br></div><div><br></div><div>On Sun, May 24, 2020, at 10:56 PM, Even Rouault wrote:<br></div><blockquote type="cite" id="qt" style="font-family:"monospace";font-size:9pt;font-weight:400;font-style:normal;"><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">On dimanche 24 mai 2020 21:33:25 CEST Seth G wrote:<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> Hi all,<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> While going through documenting the various objects available in MapScript I<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> notice some objects in mapserver.h are declared:<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> typedef struct {<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> ..<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> } symbolSetObj;<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> and some are declared:<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> struct styleObj{<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> ...<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> }<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> The former has the minor benefit the class can be documented by SWIG within<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> the struct, whereas the latter must be documented before it. Does anyone<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> know if there is a reason for the differences?<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> It would be nice to have them using a consistent declaration but changing<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> classObj to the first style breaks the code (see branch at [1]) due to<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> redefinitions in the mapserver-api.h (which is the "public MapServer API"<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> as described on the mailing list post [2]). Maybe best to leave alone if<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> this API is used throughout other projects [3]? Or is there a way to easily<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">> update the public API?<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"> <br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">I don't think this public API is much used, if it used at all outside of MapServer, given that it looks to be only embryonic. That said, the intent was good, and having the opaque typedef in mapserver-api.h was a good principle. It doesn't look to me to be a big deal to have the doc for the struct to be before it. I find this even a bit cleaner / closer to Doxygen.<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"> <br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">Speaking about that, having SWIG docstring in .h is a bit messy. Have you considered using Doxygen instead ? It looks from http://www.swig.org/Doc4.0/Doxygen.html that there might be a possibility to make SWIG extra from Doxygen, but I didn't try it. Sorry if this has been discussed before and I didn't catch up.<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"> <br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">--<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">Spatialys - Geospatial professional services<br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">http://www.spatialys.com<br></p></blockquote><div><br></div></body></html>