#!/usr/bin/env python3

import inspect
from gi.repository import GObject, Gtk, Clutter, Gst

def get_method_names(info):
    return set(n.get_name() for n in info.get_methods() \
               if not n.get_name().startswith('_'))

for module in (Gtk, Clutter, Gst):
    for name in dir(module):
        item = getattr(module, name)

        if inspect.isclass(item) and \
                issubclass(item, GObject.Object) and \
                hasattr(module, name + 'Class'):

            methods = get_method_names(item.__info__)
            cls = getattr(module, name + 'Class')
            intersection = methods.intersection(get_method_names(cls.__info__))

            if intersection:
                print('%s.%s : %s' % (module.__name__.split('.')[-1], name, intersection))
