Fix leaked vfunc return values

Simple fix to dec ref returned values from closures wrapping
python functions.

https://bugzilla.gnome.org/show_bug.cgi?id=686140
Install the .egg-info files into correct multilib directory

This makes sure the .egg-info files end up in the same python top level
directory as the rest of the gi .py files.

https://bugzilla.gnome.org/show_bug.cgi?id=686315
tests: Consistently use GLib.MainLoop

... instead of mixing GObject.MainLoop and GLib.MainLoop.
Fix Signal decorator to not use base class gsignals dict

Fix install_signals to not use the parent classes __gsignals__
dict if one does not exist on the given class.

https://bugzilla.gnome.org/show_bug.cgi?id=686496
Move property install function into propertyhelper.py

Move _install_properties() into gi/_gobject/propertyhelper.py
and add unittests.

https://bugzilla.gnome.org/show_bug.cgi?id=686559
Change install_properties to not use getattr on classes

The usage of getattr for accessing a classes __gproperties__
variable can be problematic due to the potential of it returning
the parent classes variable when it does not exist on the sub-class.
Similar to the fix for https://bugzilla.gnome.org/show_bug.cgi?id=686496,
cls.__dict__.get is used to ensure this does not happen.

https://bugzilla.gnome.org/show_bug.cgi?id=686559
test_mainloop code cleanup

Ensure that sys.excepthook is always restored, even if the test fails. Use the
assert{True,False,Equal} unittest API instead of simple asserts for more useful
failure messages.
Bump version to 3.7.1

Let's follow the real GNOME versioning from now on.
release 3.7.1
configure.ac: post-release bump to 3.7.2
Fix TestSource.testSources() test case

PyGObject has established the assumption that the destruction of a GLib.Source
Python object does not destroy the actual GSource, as shown in
TestSource.setup_timeout(), TestTimeout.test504337(), and
https://bugzilla.gnome.org/show_bug.cgi?id=504337.

So we need to explicitly destroy our MySource and Idle objects after using
them, as their callbacks always return True and we do not want them to spill
over into other tests.

Also fix the assertions to actually verify that MySources' callback was callied
(pos > 0, not pos >= 0), and use the unittest comparison API instead of a
simple assert statement.

https://bugzilla.gnome.org/show_bug.cgi?id=686627
Fix OverflowError in source_remove()

GSource IDs are unsigned, so we must use 'I' for parsing then, not 'i'.

https://bugzilla.gnome.org/show_bug.cgi?id=684526
Drop unnecessary static _glib bindings

Drop static pyglib bindings which have straightforward and working GLib GI
bindings. Add tests for all dropped functions to ensure they keep working.
Add test for GLib.get_current_time()

This adds a plausibility test, as well as ensuring the documented return type.
This will be useful if/once we drop the static _glib binding.
[API change] Do not bind gobject_get_data() and gobject_set_data()

They will basically cause a crash if misused, and you can always use a
python member attribute instead.

These methods were marked as deprecated for 3.4 and throwing a warning, so
let's remove them for good now.

https://bugzilla.gnome.org/show_bug.cgi?id=641944

Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
Add some MainLoop, MainContext, and Source test cases

These cover the remaining static API and behaviour, so that we have good
regression tests for converting them to GI.

See https://bugzilla.gnome.org/show_bug.cgi?id=686443
Deprecate void pointer fields as general PyObject storage.

Complete deprecation of gpointer struct fields as general
PyObject storage. Only int types are now allowed.
Assignment of anything other than an int or None raises
a TypeError stating the error and  associated bug URL.

https://bugzilla.gnome.org/show_bug.cgi?id=683599
Remove static MainLoop, MainContext, and some GSource bindings

glib's MainLoop and MainContext are fully introspectable these days, so remove
our static bindings. This reduces our code, as well enables GLib API which
hasn't been available through the static bindings before.

This also requires dropping our custom static types for GLib Source, Timeout,
and Idle. The latter two work fine with introspection and just need tiny
overrides for a backwards compatible API. g_source_new() is not introspectable,
though, so we need to keep our static wrappers for that. Move them from
gi/_glib/pygsource.c to gi/pygi-source.c, so that it can use the GI API.

Note that gi/_glib/pygsource.[hc] is still required for the static PollFD type
which is used by the static IOChannel binding. Once the latter goes away,
PollFD can be dropped as well.

https://bugzilla.gnome.org/show_bug.cgi?id=686443
Mark GLib API that is exposed in GObject as deprecated

A lot of API in GObject really belongs into GLib and is just there for
historical/backwards compatible reasons. Mark these methods as deprecated so
that at some point we can drop them.
Mark GLib.Source.get_current_time() as deprecated

This method has been deprecated in GLib long ago. We have a workaround
implementation using GLib.get_real_time(), but eventually this should go away.