Some GObject classes have static methods, represented in .gir files with <function> tags, but these were missing from fakegir's output. I've changed extract_methods() to recognise <function> tags within <class>.
I'm not sure whether <function> and <method> tags are used exclusively for static and instance methods exclusively, so I've used the presence (or not) of a 'self' parameter to decide whether to add the @staticmethod annotation. It would probably be OK to check only the first parameter instead of using any() as I have done.
Some GObject classes have static methods, represented in .gir files with <function> tags, but these were missing from fakegir's output. I've changed
extract_methods()
to recognise <function> tags within <class>.I'm not sure whether <function> and <method> tags are used exclusively for static and instance methods exclusively, so I've used the presence (or not) of a 'self' parameter to decide whether to add the
@staticmethod
annotation. It would probably be OK to check only the first parameter instead of usingany()
as I have done.