[gi-docgen/validate-links] gir: Add base_type for ast.Callback



commit aef47aaaeb8ae0561edbe6534183b1c89e0f2bf2
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue May 25 13:13:21 2021 +0100

    gir: Add base_type for ast.Callback
    
    A callback can have a type, so we should map the same protocol as
    ast.Type.

 gidocgen/gir/ast.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gidocgen/gir/ast.py b/gidocgen/gir/ast.py
index 0bea25a..430c0ea 100644
--- a/gidocgen/gir/ast.py
+++ b/gidocgen/gir/ast.py
@@ -390,6 +390,12 @@ class Callback(Callable):
         super().__init__(name=name, namespace=namespace, identifier=None, throws=throws)
         self.ctype = ctype
 
+    @property
+    def base_ctype(self):
+        if self.ctype is None:
+            return None
+        return self.ctype.replace('*', '')
+
 
 class Member(GIRElement):
     """A member in an enumeration, error domain, or bitfield"""


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