+commit 5c24760b797e985721f7fe51d52252e4dd54a417
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Fri Oct 21 17:31:41 2011 +0200
+
+ Fix "Returns: (skip)" method calls without (out) arguments
+
+ When we have a method call with a skipped return value, but no
+ other out
+ arguments, we previously returned NULL to Python, which causes
+ "SystemError:
+ error return without exception set". Return None instead.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=662383
+
+ gi/pygi-invoke.c | 10 ++++++++++
+ tests/test_everything.py | 8 ++++++++
+ 2 files changed, 18 insertions(+), 0 deletions(-)
+
+commit 585222915dc98b0e375de3db4771466278a32e81
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Tue Oct 18 00:39:16 2011 -0400
+
+ Do union member checks for unions that are parameters
+
+ * before we were only doing checks if the union was an instance
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=661673
+
+ gi/pygi-marshal-from-py.c | 121
+ +++++++++++++++++++++++++--------------------
+ 1 files changed, 68 insertions(+), 53 deletions(-)
+
+commit 8deaec6b9abd87f02060c9feec773d4693e89028
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Wed Oct 19 14:35:11 2011 +0200
+
+ Gdk overrides: Unbreak for Gdk-2.0
+
+ Fix regression from commit 31db3ed: Gdk 2.0 did not yet have
+ atom_intern(), so
+ only do this for Gdk >= 3.0.
+
+ https://launchpad.net/bugs/875399
+
+ gi/overrides/Gdk.py | 95
+ ++++++++++++++++++++++++++-------------------------
+ 1 files changed, 48 insertions(+), 47 deletions(-)
+
+commit f395fb131caf7ca550acd17138d8061926ef4f92
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Fri Oct 14 17:19:45 2011 -0400
+
+ unit test for checking ref count of object param in signals
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=661359
+
+ tests/test_everything.py | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+commit 611f58b99851328653af4930f188c33eccaa9f6f
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Fri Oct 14 16:42:32 2011 -0400
+
+ when converting an object with transfer none, make sure the wrapper
+ owns a ref
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=661359
+
+ gi/pygi-argument.c | 10 ++++++++++
+ 1 files changed, 10 insertions(+), 0 deletions(-)
+
+commit 0f1eb9fa0e7aa5e7c22dabc709c0dfb469e404f1
+Author: Timo Vanwynsberghe <timovwb@gmail.com>
+Date: Tue Oct 4 11:13:43 2011 +0200
+
+ Allow GBoxed types as property
+
+ Add the GBoxed type as valid type to the gobject property helper
+ https://bugzilla.gnome.org/show_bug.cgi?id=660798
+
+ gi/_gobject/propertyhelper.py | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+commit bef8d385117dd0295c9ba7567710d76fc2bb729a
+Author: Ignacio Casal Quinteiro <icq@gnome.org>
+Date: Mon Oct 10 11:24:42 2011 +0200
+
+ Add tests for boxed properties.
+
+ tests/test_properties.py | 20 ++++++++++++++++++--
+ 1 files changed, 18 insertions(+), 2 deletions(-)
+
+commit 77123ffeb1585837033848f4d5a90cfa63fdaee0
+Author: Ignacio Casal Quinteiro <icq@gnome.org>
+Date: Fri Sep 30 20:21:07 2011 +0200
+
+ Post release bump version
+
+ configure.ac | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+commit f5ccfec0a1bc4c999bfa49d75383ea06d3a068c4
+Author: Ignacio Casal Quinteiro <icq@gnome.org>
+Date: Fri Sep 30 20:19:46 2011 +0200
+
+ Release 3.0.1
+
+ NEWS | 5 +++++
+ configure.ac | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletions(-)
+
commit 56ac9339eb1d6950623dc4d8c3b9972874e7fa86
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Thu Sep 22 19:03:20 2011 -0400
https://bugzilla.gnome.org/show_bug.cgi?id=658362
gi/Makefile.am | 8 +-
- gi/pygi-cache.c | 673 +++++++++++-----------
+ gi/pygi-cache.c | 669 +++++++++++----------
gi/pygi-cache.h | 62 ++-
- gi/pygi-invoke.c | 144 +++---
+ gi/pygi-invoke.c | 142 +++---
gi/pygi-marshal-cleanup.c | 168 +++---
gi/pygi-marshal-cleanup.h | 128 ++--
gi/pygi-marshal-from-py.c | 1412
gi/pygi-marshal-out.h | 144 -----
gi/pygi-marshal-to-py.c | 768 ++++++++++++++++++++++++
gi/pygi-marshal-to-py.h | 144 +++++
- 14 files changed, 3122 insertions(+), 3081 deletions(-)
+ 14 files changed, 3119 insertions(+), 3078 deletions(-)
commit 45b0fcff9e948c65a3903c32a3957802034c5e47
Author: Dieter Verfaillie <dieterv@optionexplicit.be>
gi/pygi-cache.c | 1 +
gi/pygi-cache.h | 1 +
- gi/pygi-invoke.c | 48
- ++++++++++++++++++++++++++++-----------------
- tests/test_everything.py | 8 +++++++
- 4 files changed, 40 insertions(+), 18 deletions(-)
+ gi/pygi-invoke.c | 46
+ +++++++++++++++++++++++++++++-----------------
+ tests/test_everything.py | 8 ++++++++
+ 4 files changed, 39 insertions(+), 17 deletions(-)
commit 7a234b185b131f3eb6a6e8a8c717ddf4d508b15e
Author: Xavier Claessens <xclaesse@gmail.com>
https://bugzilla.gnome.org/show_bug.cgi?id=642048
Makefile.am | 8 +-------
- configure.ac | 43 +++++++++++++++++--------------------------
+ configure.ac | 39 +++++++++++++++------------------------
gi/pygi.h | 37 -------------------------------------
gobject/Makefile.am | 5 +----
tests/Makefile.am | 7 +------
- 5 files changed, 20 insertions(+), 80 deletions(-)
+ 5 files changed, 18 insertions(+), 78 deletions(-)
commit d862168d6a82edd59547d39f5b0ab8279b1e511c
Author: John (J5) Palmieri <johnp@redhat.com>
[caching] refactor function names to be less confusing
- gi/pygi-cache.c | 307
+ gi/pygi-cache.c | 305
+++++++++++++++++++++++++++----------------------------
- 1 files changed, 150 insertions(+), 157 deletions(-)
+ 1 files changed, 149 insertions(+), 156 deletions(-)
commit c167a9345b01c070bd5a84b4a4b3a53baf9e217d
Author: John (J5) Palmieri <johnp@redhat.com>
gi/pygi-invoke-state-struct.h | 2 +
gi/pygi-marshal-cleanup.c | 301
++++++++++++++++-------------------------
- gi/pygi-marshal-cleanup.h | 45 ++++---
+ gi/pygi-marshal-cleanup.h | 43 ++++--
gi/pygi-marshal.c | 15 +-
- 7 files changed, 174 insertions(+), 225 deletions(-)
+ 7 files changed, 173 insertions(+), 224 deletions(-)
commit 198714dc4585f7463f38929f1ca4e4b60a27dadb
Author: John (J5) Palmieri <johnp@redhat.com>
[gi-invoke-ng] refactor FunctionCache to be more generic CallableCache
- gi/pygi-cache.c | 392
+ gi/pygi-cache.c | 388
++++++++++++++++++++++++++-------------------------
gi/pygi-cache.h | 12 +-
gi/pygi-info.c | 2 +-
gi/pygi-invoke-ng.c | 40 +++---
gi/pygi-marshal.c | 140 +++++++++---------
- gi/pygi-marshal.h | 159 ++++++++-------------
+ gi/pygi-marshal.h | 159 +++++++++-------------
gi/pygi.h | 2 +-
- 7 files changed, 362 insertions(+), 385 deletions(-)
+ 7 files changed, 360 insertions(+), 383 deletions(-)
commit 3d5d9ff5c18a850650992bdd52e8e4c722b23396
Author: John (J5) Palmieri <johnp@redhat.com>
[gi-demo] Fix color dialog demo to run with new draw, style and
color apis
- demos/gtk-demo/demos/colorselector.py | 44
+ demos/gtk-demo/demos/colorselector.py | 42
++++++++++++--------------------
- 1 files changed, 17 insertions(+), 27 deletions(-)
+ 1 files changed, 16 insertions(+), 26 deletions(-)
commit f94a96c53e9432ac085bd05acee7ebdd2803fbad
Author: John (J5) Palmieri <johnp@redhat.com>
[gi-demos] fix drawingarea app to use the new draw api
- demos/gtk-demo/demos/drawingarea.py | 144
+ demos/gtk-demo/demos/drawingarea.py | 138
++++++++++++-----------------------
- 1 files changed, 50 insertions(+), 94 deletions(-)
+ 1 files changed, 47 insertions(+), 91 deletions(-)
commit 8385afbbc5df295d9b7cd3b5d19c90faa1f7ea8e
Author: John (J5) Palmieri <johnp@redhat.com>
values based on if they are in, out or inout
* in invoke we order the pointers based on their direction
- gi/pygi-cache.c | 1445
+ gi/pygi-cache.c | 1441
++++++++++++++++++++++++++----------------------------
gi/pygi-invoke.c | 19 +-
- 2 files changed, 711 insertions(+), 753 deletions(-)
+ 2 files changed, 709 insertions(+), 751 deletions(-)
commit 2b185362de45f46ce0f0b8816499aef06ab1ad1e
Author: John (J5) Palmieri <johnp@redhat.com>
[gi] fix sequence caching to support out
- gi/pygi-cache.c | 111
+ gi/pygi-cache.c | 109
+++++++++++++++++++++++++++++++++++++++++++------------
- 1 files changed, 87 insertions(+), 24 deletions(-)
+ 1 files changed, 86 insertions(+), 23 deletions(-)
commit 69207910209ebfe450df616aeb8fa4cc2e7eccf3
Author: Martin Pitt <martin.pitt@ubuntu.com>
https://bugzilla.gnome.org/show_bug.cgi?id=640197
- gobject/gobjectmodule.c | 35 ++-------------------
+ gobject/gobjectmodule.c | 35 ++--------------------
gobject/pygobject-private.h | 5 +++
- gobject/pygobject.c | 71
+ gobject/pygobject.c | 69
+++++++++++++++++++++++++-----------------
- 3 files changed, 50 insertions(+), 61 deletions(-)
+ 3 files changed, 49 insertions(+), 60 deletions(-)
commit a3e0cfe8924887ecd1e07cedd2cfb999c853ac62
Author: John (J5) Palmieri <johnp@redhat.com>
https://bugzilla.gnome.org/show_bug.cgi?id=640073
- gi/types.py | 104
- +++++++++++++++++++++++++++++++++---------------------
+ gi/types.py | 100
+ +++++++++++++++++++++++++++++++++--------------------
tests/test_gi.py | 13 +++++++
- 2 files changed, 77 insertions(+), 40 deletions(-)
+ 2 files changed, 75 insertions(+), 38 deletions(-)
commit 8f4e6536f3c2edf38a45632d1c23eb7c6681c3be
Author: Sebastian Pölsterl <sebp@k-d-w.org>
https://bugzilla.gnome.org/show_bug.cgi?id=639939
- gi/overrides/GLib.py | 229
+ gi/overrides/GLib.py | 199
+++++++++++++++++++++++++----------------------
- tests/test_overrides.py | 159 +++++++++++++++++++++++++++++++--
- 2 files changed, 273 insertions(+), 115 deletions(-)
+ tests/test_overrides.py | 159 +++++++++++++++++++++++++++++++++++--
+ 2 files changed, 258 insertions(+), 100 deletions(-)
commit ac095f5435f106e175fa3297cb273e63c85d2809
Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
[gi] fix marshalling structs
- gi/pygi-argument.c | 47 +++++++++++++++++++++++++++++++++++------------
+ gi/pygi-argument.c | 45 ++++++++++++++++++++++++++++++++++-----------
gi/pygi-foreign.c | 18 ++++++++++++------
gi/pygi-foreign.h | 8 ++++----
- 3 files changed, 51 insertions(+), 22 deletions(-)
+ 3 files changed, 50 insertions(+), 21 deletions(-)
commit b2189424f9dd6d3a4a5b9792f0d5843fc27657d1
Author: Sebastian Pölsterl <sebp@k-d-w.org>
support callbacks
- gi/pygi-argument.c | 68 ++++++++++++++++++++++++++++++++++++++++++--
- gi/pygi-cache.c | 80
- +++++++++++++++++++++++++++++++++++++++------------
+ gi/pygi-argument.c | 68 +++++++++++++++++++++++++++++++++++++++++++--
+ gi/pygi-cache.c | 78
+ ++++++++++++++++++++++++++++++++++++++++------------
gi/pygi-cache.h | 13 +++++++-
gi/pygi-invoke.c | 2 +-
- 4 files changed, 138 insertions(+), 25 deletions(-)
+ 4 files changed, 137 insertions(+), 24 deletions(-)
commit 914d3a0a29680f4d3aa0e1f8afdd625b017b013a
Author: Sebastian Pölsterl <sebp@k-d-w.org>
https://bugzilla.gnome.org/show_bug.cgi?id=615872
- gobject/pygtype.c | 31 +++++++++++++++++--------------
- 1 files changed, 17 insertions(+), 14 deletions(-)
+ gobject/pygtype.c | 29 ++++++++++++++++-------------
+ 1 files changed, 16 insertions(+), 13 deletions(-)
commit 3d431c7dd0de97db10cb0c00c39d9c1837bed2f2
Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
gi/Makefile.am | 2 +
gi/pygi-argument.c | 2 +-
- gi/pygi-foreign-cairo.c | 16 +++---
- gi/pygi-foreign.c | 107
+ gi/pygi-foreign-cairo.c | 16 ++++----
+ gi/pygi-foreign.c | 105
++++++++++++++++++++++++++++-----------------
gi/pygi-foreign.h | 7 +--
gi/pygi-invoke.c | 18 ++++----
gi/pygi-struct.c | 10 ++++-
gi/pygi.h | 9 ++--
- tests/test_everything.py | 8 +++
- 9 files changed, 110 insertions(+), 69 deletions(-)
+ tests/test_everything.py | 8 ++++
+ 9 files changed, 109 insertions(+), 68 deletions(-)
commit 3b3bd4da3fbc993fa7f7cfb46ed4e67671c94cc0
Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
https://bugzilla.gnome.org/show_bug.cgi?id=623021
configure.ac | 2 +
- gi/Makefile.am | 38 +++++++++-----
+ gi/Makefile.am | 38 ++++++++++-----
gi/gimodule.c | 8 +---
gi/pygi-argument.c | 10 +---
gi/pygi-foreign-cairo.c | 56 ++++++++++++++++-----
gi/pygi-foreign-cairo.h | 55 ---------------------
- gi/pygi-foreign.c | 125
+ gi/pygi-foreign.c | 123
++++++++++++++++++++++++++++-------------------
- gi/pygi-foreign.h | 31 +++++------
- gi/pygi.h | 40 +++++++++++++--
- 9 files changed, 196 insertions(+), 169 deletions(-)
+ gi/pygi-foreign.h | 31 +++++-------
+ gi/pygi.h | 40 ++++++++++++++--
+ 9 files changed, 195 insertions(+), 168 deletions(-)
commit a6a90551311bc64f037cbd442e13f70c30060871
Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
This won't affect git blame nor git diff if the switch -w is used.
gi/gimodule.c | 138 ++++----
- gi/pygi-argument.c | 960
+ gi/pygi-argument.c | 958
+++++++++++++++++++++++-----------------------
gi/pygi-boxed.c | 108 +++---
- gi/pygi-callbacks.c | 154 ++++----
+ gi/pygi-callbacks.c | 152 ++++----
gi/pygi-callbacks.h | 8 +-
- gi/pygi-closure.c | 270 +++++++-------
+ gi/pygi-closure.c | 266 +++++++-------
gi/pygi-closure.h | 18 +-
gi/pygi-foreign-cairo.c | 36 +-
gi/pygi-foreign-cairo.h | 36 +-
gi/pygi-type.c | 32 +-
gi/pygi.h | 20 +-
gi/pygobject-external.h | 14 +-
- 18 files changed, 1544 insertions(+), 1542 deletions(-)
+ 18 files changed, 1540 insertions(+), 1538 deletions(-)
commit 6156f15cb15b4c20e975527227135d49207c520a
Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
gi/pygi-callbacks.c | 22 +-
gi/pygi-callbacks.h | 4 +-
- gi/pygi-info.c | 582
+ gi/pygi-info.c | 576
+++++++++++++++++++++++++++++----------------------
- 3 files changed, 346 insertions(+), 262 deletions(-)
+ 3 files changed, 343 insertions(+), 259 deletions(-)
commit 7fc5528273edae5ecdd5d8bdf0e5b898eec7a624
Author: Zach Goldberg <zach@zachgoldberg.com>
Add one more missing file to tarballs
- gi/overrides/Makefile.am | 1 +
+ gi/overrides/Makefile.am | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
commit 979e01852fc7f830ee91093accdc387fa535075f
gi/pygi-info.c | 86
++++++++++++++++++++++++++++++++++++++++++++++++-
gi/pygi-info.h | 1 +
- gi/types.py | 44 +++++++++++++++++--------
+ gi/types.py | 42 ++++++++++++++++-------
tests/test_gi.py | 18 ++++++++++
- 9 files changed, 227 insertions(+), 21 deletions(-)
+ 9 files changed, 226 insertions(+), 20 deletions(-)
commit e239faacb4798fe2d166233ca1a19a843a6225e3
Author: Zach Goldberg <zach@zachgoldberg.com>
gi/pygi-argument.c | 516
++++++++++++++++++++++++++++++++++++++++++----------
- gi/pygi-info.c | 333 +++++++++++++++++----------------
- 2 files changed, 596 insertions(+), 253 deletions(-)
+ gi/pygi-info.c | 327 +++++++++++++++++----------------
+ 2 files changed, 593 insertions(+), 250 deletions(-)
commit d1ae73f3cf7cebdb74c9ec56b08928a2a53b9de6
Author: Johan Dahlin <johan@gnome.org>
Remove the girepository module
- Makefile.am | 2 +-
- configure.ac | 17 -
- girepository/Makefile.am | 54 --
- girepository/__init__.py | 24 -
- girepository/bank-argument.c | 379 ------------
- girepository/bank-info.c | 1194
- ------------------------------------
- girepository/bank-repository.c | 236 -------
- girepository/bank.c | 155 -----
- girepository/bank.h | 80 ---
- girepository/btypes.py | 300 ---------
- girepository/importer.py | 51 --
- girepository/module.py | 224 -------
- girepository/overrides/Gdk.py | 14 -
- girepository/overrides/Gtk.py | 8 -
- girepository/repository.py | 51 --
- tests/test_girepository.py | 386 ------------
+ Makefile.am | 2 +-
+ configure.ac | 17 -
+ girepository/Makefile.am | 54 --
+ girepository/__init__.py | 24 -
+ girepository/bank-argument.c | 379 -------------
+ girepository/bank-info.c | 1194
+ ----------------------------------------
+ girepository/bank-repository.c | 236 --------
+ girepository/bank.c | 155 ------
+ girepository/bank.h | 80 ---
+ girepository/btypes.py | 300 ----------
+ girepository/importer.py | 51 --
+ girepository/module.py | 224 --------
+ girepository/overrides/Gdk.py | 14 -
+ girepository/overrides/Gtk.py | 8 -
+ girepository/repository.py | 51 --
+ tests/test_girepository.py | 386 -------------
16 files changed, 1 insertions(+), 3174 deletions(-)
commit a644edf0515c26ed027522891ccf02aceac764e8
Adds overrides modules from PyBank.
- girepository/Makefile.am | 3 +++
- girepository/importer.py | 3 +--
- girepository/overrides/Gdk.py | 14 ++++++++++++++
- girepository/overrides/Gtk.py | 8 ++++++++
+ girepository/Makefile.am | 3 +++
+ girepository/importer.py | 3 +--
+ girepository/overrides/Gdk.py | 14 ++++++++++++++
+ girepository/overrides/Gtk.py | 8 ++++++++
4 files changed, 26 insertions(+), 2 deletions(-)
commit c12964e6a3354d8063355225c94e6d21d621e08b
Disables the tests that fail in tests/test_girepository.py.
- tests/test_girepository.py | 242
+ tests/test_girepository.py | 232
+++++++++++++++++++++++++++++++++-----------
- 1 files changed, 182 insertions(+), 60 deletions(-)
+ 1 files changed, 177 insertions(+), 55 deletions(-)
commit a4469a3f7d32a25156bae5e7aef9ec4ae5f6e140
Author: Simon van der Linden <simon.vanderlinden@student.uclouvain.be>
return color
# constants
-SELECTION_PRIMARY = Gdk.atom_intern('PRIMARY', True)
-__all__.append('SELECTION_PRIMARY')
-
-SELECTION_SECONDARY = Gdk.atom_intern('SECONDARY', True)
-__all__.append('SELECTION_SECONDARY')
-
-SELECTION_CLIPBOARD = Gdk.atom_intern('CLIPBOARD', True)
-__all__.append('SELECTION_CLIPBOARD')
-
-TARGET_BITMAP = Gdk.atom_intern('BITMAP', True)
-__all__.append('TARGET_BITMAP')
-
-TARGET_COLORMAP = Gdk.atom_intern('COLORMAP', True)
-__all__.append('TARGET_COLORMAP')
-
-TARGET_DRAWABLE = Gdk.atom_intern('DRAWABLE', True)
-__all__.append('TARGET_DRAWABLE')
-
-TARGET_PIXMAP = Gdk.atom_intern('PIXMAP', True)
-__all__.append('TARGET_PIXMAP')
-
-TARGET_STRING = Gdk.atom_intern('STRING', True)
-__all__.append('TARGET_STRING')
-
-SELECTION_TYPE_ATOM = Gdk.atom_intern('ATOM', True)
-__all__.append('SELECTION_TYPE_ATOM')
-
-SELECTION_TYPE_BITMAP = Gdk.atom_intern('BITMAP', True)
-__all__.append('SELECTION_TYPE_BITMAP')
-
-SELECTION_TYPE_COLORMAP = Gdk.atom_intern('COLORMAP', True)
-__all__.append('SELECTION_TYPE_COLORMAP')
-
-SELECTION_TYPE_DRAWABLE = Gdk.atom_intern('DRAWABLE', True)
-__all__.append('SELECTION_TYPE_DRAWABLE')
-
-SELECTION_TYPE_INTEGER = Gdk.atom_intern('INTEGER', True)
-__all__.append('SELECTION_TYPE_INTEGER')
-
-SELECTION_TYPE_PIXMAP = Gdk.atom_intern('PIXMAP', True)
-__all__.append('SELECTION_TYPE_PIXMAP')
-
-SELECTION_TYPE_WINDOW = Gdk.atom_intern('WINDOW', True)
-__all__.append('SELECTION_TYPE_WINDOW')
-
-SELECTION_TYPE_STRING = Gdk.atom_intern('STRING', True)
-__all__.append('SELECTION_TYPE_STRING')
+if Gdk._version >= '3.0':
+ SELECTION_PRIMARY = Gdk.atom_intern('PRIMARY', True)
+ __all__.append('SELECTION_PRIMARY')
+
+ SELECTION_SECONDARY = Gdk.atom_intern('SECONDARY', True)
+ __all__.append('SELECTION_SECONDARY')
+
+ SELECTION_CLIPBOARD = Gdk.atom_intern('CLIPBOARD', True)
+ __all__.append('SELECTION_CLIPBOARD')
+
+ TARGET_BITMAP = Gdk.atom_intern('BITMAP', True)
+ __all__.append('TARGET_BITMAP')
+
+ TARGET_COLORMAP = Gdk.atom_intern('COLORMAP', True)
+ __all__.append('TARGET_COLORMAP')
+
+ TARGET_DRAWABLE = Gdk.atom_intern('DRAWABLE', True)
+ __all__.append('TARGET_DRAWABLE')
+
+ TARGET_PIXMAP = Gdk.atom_intern('PIXMAP', True)
+ __all__.append('TARGET_PIXMAP')
+
+ TARGET_STRING = Gdk.atom_intern('STRING', True)
+ __all__.append('TARGET_STRING')
+
+ SELECTION_TYPE_ATOM = Gdk.atom_intern('ATOM', True)
+ __all__.append('SELECTION_TYPE_ATOM')
+
+ SELECTION_TYPE_BITMAP = Gdk.atom_intern('BITMAP', True)
+ __all__.append('SELECTION_TYPE_BITMAP')
+
+ SELECTION_TYPE_COLORMAP = Gdk.atom_intern('COLORMAP', True)
+ __all__.append('SELECTION_TYPE_COLORMAP')
+
+ SELECTION_TYPE_DRAWABLE = Gdk.atom_intern('DRAWABLE', True)
+ __all__.append('SELECTION_TYPE_DRAWABLE')
+
+ SELECTION_TYPE_INTEGER = Gdk.atom_intern('INTEGER', True)
+ __all__.append('SELECTION_TYPE_INTEGER')
+
+ SELECTION_TYPE_PIXMAP = Gdk.atom_intern('PIXMAP', True)
+ __all__.append('SELECTION_TYPE_PIXMAP')
+
+ SELECTION_TYPE_WINDOW = Gdk.atom_intern('WINDOW', True)
+ __all__.append('SELECTION_TYPE_WINDOW')
+
+ SELECTION_TYPE_STRING = Gdk.atom_intern('STRING', True)
+ __all__.append('SELECTION_TYPE_STRING')
import sys
#include "pygi-marshal-cleanup.h"
#include "pygi-marshal-from-py.h"
+/*
+ * _is_union_member - check to see if the py_arg is actually a member of the
+ * expected C union
+ */
+static gboolean
+_is_union_member (PyGIInterfaceCache *iface_cache, PyObject *py_arg) {
+ gint i;
+ gint n_fields;
+ GIUnionInfo *union_info;
+ GIInfoType info_type;
+ gboolean is_member = FALSE;
+
+ info_type = g_base_info_get_type (iface_cache->interface_info);
+
+ if (info_type != GI_INFO_TYPE_UNION)
+ return FALSE;
+
+ union_info = (GIUnionInfo *) iface_cache->interface_info;
+ n_fields = g_union_info_get_n_fields (union_info);
+
+ for (i = 0; i < n_fields; i++) {
+ GIFieldInfo *field_info;
+ GITypeInfo *field_type_info;
+
+ field_info = g_union_info_get_field (union_info, i);
+ field_type_info = g_field_info_get_type (field_info);
+
+ /* we can only check if the members are interfaces */
+ if (g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_INTERFACE) {
+ PyObject *py_type;
+ GIInterfaceInfo *field_iface_info =
+ g_type_info_get_interface (field_type_info);
+
+ py_type = _pygi_type_import_by_gi_info (
+ (GIBaseInfo *) field_iface_info);
+
+ if (py_type != NULL && PyObject_IsInstance (py_arg, py_type)) {
+ is_member = TRUE;
+ break;
+ }
+
+ Py_XDECREF (py_type);
+ g_base_info_unref ( ( GIBaseInfo *) field_iface_info);
+
+ }
+
+ g_base_info_unref ( ( GIBaseInfo *) field_type_info);
+ g_base_info_unref ( ( GIBaseInfo *) field_info);
+
+ if (is_member)
+ break;
+ }
+
+ return is_member;
+}
+
gboolean
_pygi_marshal_from_py_void (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
return (success == Py_None);
} else if (!PyObject_IsInstance (py_arg, iface_cache->py_type)) {
- PyErr_Format (PyExc_TypeError, "Expected %s, but got %s",
- iface_cache->type_name,
- iface_cache->py_type->ob_type->tp_name);
- return FALSE;
+ /* first check to see if this is a member of the expected union */
+ if (!_is_union_member (iface_cache, py_arg)) {
+ if (!PyErr_Occurred())
+ PyErr_Format (PyExc_TypeError, "Expected %s, but got %s",
+ iface_cache->type_name,
+ iface_cache->py_type->ob_type->tp_name);
+
+ return FALSE;
+ }
}
if (g_type_is_a (iface_cache->g_type, G_TYPE_BOXED)) {
if (!PyObject_IsInstance (py_arg, iface_cache->py_type)) {
/* wait, we might be a member of a union so manually check */
- if (info_type == GI_INFO_TYPE_UNION) {
- gint i;
- gint n_fields;
- gboolean is_member = FALSE;
- GIUnionInfo *union_info = (GIUnionInfo *) iface_cache->interface_info;
-
- n_fields = g_union_info_get_n_fields (union_info);
-
- for (i = 0; i < n_fields; i++) {
- GIFieldInfo *field_info;
- GITypeInfo *field_type_info;
-
- field_info = g_union_info_get_field (union_info, i);
- field_type_info = g_field_info_get_type (field_info);
-
- /* we can only check if the members are interfaces */
- if (g_type_info_get_tag (field_type_info) ==
- GI_TYPE_TAG_INTERFACE) {
- PyObject *py_type;
- GIInterfaceInfo *field_iface_info =
- g_type_info_get_interface(field_type_info);
-
- py_type = _pygi_type_import_by_gi_info (
- (GIBaseInfo *) field_iface_info);
-
- if (PyObject_IsInstance (py_arg, py_type)) {
- is_member = TRUE;
- break;
- }
-
- Py_XDECREF (py_type);
- g_base_info_unref ( ( GIBaseInfo *) field_iface_info);
-
- }
-
- g_base_info_unref ( ( GIBaseInfo *) field_type_info);
- g_base_info_unref ( ( GIBaseInfo *) field_info);
-
- if (is_member)
- break;
- }
-
- if (!is_member) {
+ if (!_is_union_member (iface_cache, py_arg)) {
+ if (!PyErr_Occurred())
PyErr_Format (PyExc_TypeError,
"Expected a %s, but got %s",
iface_cache->type_name,
py_arg->ob_type->tp_name);
- return FALSE;
- }
- } else {
- PyErr_Format (PyExc_TypeError, "Expected a %s, but got %s",
- iface_cache->type_name,
- py_arg->ob_type->tp_name);
+
return FALSE;
}
}