[Github-comments] [geany/geany] gtkdoc: include macros in geany-gtkdoc.h (#1796)

Colomban Wendling notifications at xxxxx
Sat Mar 10 02:46:05 UTC 2018


b4n requested changes on this pull request.

Is `GEANY_WORDCHARS` actually useful to anyone?  I think it's pretty much useless in most situations, and wrong in many other (e.g. it's *not* a good universal way to recognize a "word", not even for programming languages).
And it's fairly easy to copy over, or even generate using I don't know, `'_' + string.lowercase + string.uppercase + string.digits` in Python, and probably something similar in another language.

Also, most if not all the other macros are irrelevant to non-C, like `foreach_document`, `documents` and alike.  The only potentially interesting things would be `TAG_*`, but I'm not even sure we really think it's part of the API (OK, it is, but I'm not sure we did know), and no plugin is using it ATM AFAICT.

`GEANY_API_VERSION` is also probably uninteresting as I guess the proxy is more relevant here.

Anyway, the code here seem mostly good to me, but I'm not very sure it's a good or useful idea.  And if we do want macros, we should probably mark a lot of the existing ones `@girskip` in any case.

> Note also: Due to a bug in g-ir-scanner, GEANY_ABI_VERSION is parsed
incorrectly (simply without the GTK version shift) but the ABI is
of little relevance for GIR consumers.

FWIW `GEANY_ABI_SHIFT` is not part of the API, and thus is not in the gtkdoc header, no surprise g-ir-scanner has a hard time :)

> +class DoxyDefine(DoxyElement):
+    @staticmethod
+    def from_memberdef(xml):
+        name = xml.find("name").text
+        v = xml.find("initializer")
+        if (v is not None):
+            proc = DoxygenProcess()
+            text = proc.process_element(v)
+            params = ",".join(p.text for p in xml.xpath(".//param/defname"))
+            if (params != ""):
+                params = "(%s)" % params
+            d = "#define %s%s %s" % (name, params, text)
+        else:
+            d = "#define %s" % name
+
+        e = DoxyEnum(name, d)

Shouldn't this be `DocyDefine(name, d)`? (not that it actually matters much, but still)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1796#pullrequestreview-102836258
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180309/7056b910/attachment.html>


More information about the Github-comments mailing list