• Tomasz Miąsko's avatar
    Fix introspection for GdkEventTouchpadPinch and GdkEventTouchpadSwipe. · 5d258bf3
    Tomasz Miąsko authored
    When using type annotations, the ABI of type being annotated and a new
    type introduced from annotation should match.
    In case of enumerations, the most common ABI, and probably the only one
    currently used in practice with gtk, corresponds to -fno-short-enums
    compiler option. It uses int as the underlying type of enum, bumping it
    up to unsigned int, long int or unsigned long int, in that order, when
    Thus, when annotating a field of integer type with an enum type, it is
    never correct to annotate field smaller than int, because it changes the
    ABI from perspective on introspection.
    The gint8 phase field in GdkEventTouchpadSwipe and GdkEventTouchpadPinch
    structures have been previously annotated in such a way, and this change
    removes this annotation to restore ABI compatibility.
    Size of structures before (which does not match C):
    >>> Gdk.EventTouchpadPinch.__info__.get_size()
    >>> Gdk.EventTouchpadSwipe.__info__.get_size()
    Size of structures after (which does match C):
    >>> Gdk.EventTouchpadPinch.__info__.get_size()
    >>> Gdk.EventTouchpadSwipe.__info__.get_size()
    Fixes issue #57.