Fix PyObject_Repr and PyObject_Str reference leaks

Fix all calls to PyObject_Repr() and PyObject_Str() to be properly DECREF'd.

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

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
Add conversion of the Gdk.NotifyType constants to pygi-convert.sh script

Signed-off-by: Manuel Quiñones <manuq@laptop.org>

https://bugzilla.gnome.org/show_bug.cgi?id=679754
Add error-checking for the case where _arg_cache_new() fails

This can happen when a typelib and its underlying library are out-of-sync. This
converts the segfault into a more helpful traceback.

https://bugzilla.gnome.org/show_bug.cgi?id=678914
Add the same rules for pack_start to convert pack_end

Signed-off-by: Manuel Quiñones <manuq@laptop.org>

https://bugzilla.gnome.org/show_bug.cgi?id=679760
Add conversion of the Gdk.PropMode constants to pygi-convert.sh script

Signed-off-by: Manuel Quiñones <manuq@laptop.org>

https://bugzilla.gnome.org/show_bug.cgi?id=679775
Fix array handling for interfaces, properties, and signals

Fix lots of corner cases where arrays are not handled properly.
_pygi_argument_to_object() now has the documented expectation of getting arrays
packed in GArrays. This was implicit before and not correctly done on most call
sites.

The helper _pygi_argument_to_array() has been improved to work on any kind of
array. Fix all call sites of _pygi_argument_to_object() to do the
array conversion appropriately before calling _pygi_argument_to_object().

Adds a test case that implements a GInterface with a method that takes an array
of variants as input.

https://bugzilla.gnome.org/show_bug.cgi?id=667244
pygi-convert.sh: Fix some child → getChild() false positives

https://bugzilla.gnome.org/show_bug.cgi?id=680004
Fix __path__ module attribute

get_typelib_path() returns bytes, not strings, so in Python 3 we need to decode
it to get a proper __path__ attribute.
Skip gi.CallbackInfo objects from a module's dir()

Skip gi.CallbackInfo items from IntrospectionModule's __dir__(), as we do not
implement __getattr__ for those.

Add a test case that dir() works on GI modules, contain expected identifiers,
and that all identifiers in dir() can actually be retrieved.

Prerequisite for https://bugzilla.gnome.org/show_bug.cgi?id=679804
Fix help() for GI modules

Derive DynamicModule from types.ModuleType, so that the inspect modules'
ismodule() actually succeeds on those and generates useful help on a GI
repository module.

https://bugzilla.gnome.org/show_bug.cgi?id=679804
pygi-convert.sh: Drop bogus filter_new() conversion

my_tree_model.filter_new() is still a method on GtkTreeModel, not a
constructor, so do not try to convert it to a constructor call.

https://bugzilla.gnome.org/show_bug.cgi?id=679999
test_gi: Fix for Python 2
release 3.3.4
configure.ac: post-release bump to 3.3.5
pygi-convert.sh: convert rsvg.Handle(data=...)

Replace rsvg.Handle(data=data) with Rsvg.Handle.new_from_data(data)

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

Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
pygi-convert.sh: Add some missing Gdk.CursorTypes

This patch adds WATCH, ARROW and CLOCK.

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

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
[API add] Add API for checking pygobject's version

Add a gi.__version__ attribute for the textual version, and gi.version_info for
a version triple similar to sys.version_info.

Also add a gi.require_version(<minimum_version>) which raises an exception if
the pygobject version is older.

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

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
Convert all Gdk.WindowState constants in pygi-convert.sh

Signed-off-by: Manuel Quiñones <manuq@laptop.org>

https://bugzilla.gnome.org/show_bug.cgi?id=680257
Convert Gtk.DestDefaults constants in pygi-convert.sh script

Signed-off-by: Manuel Quiñones <manuq@laptop.org>

https://bugzilla.gnome.org/show_bug.cgi?id=680259
Fix property type mapping from int to TYPE_INT for python3.

Python3 does not have a long type, however, propertyhelper.py was
using long_ = int; to get things working. Type mapping code
was then checking for long_ first and always returning TYPE_LONG.
Additional refactoring was done to move large if/elif statements
into dictionary lookups and usage of tuples instead of lists
for simple 'in' list of items tests.

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