From: DongHun Kwak Date: Tue, 11 Jul 2017 23:37:26 +0000 (+0900) Subject: Imported Upstream version 2.90.3 X-Git-Tag: upstream/3.9.92~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e94eac598d6c67611cd184e40480265208110b14;p=platform%2Fupstream%2Fpygobject2.git Imported Upstream version 2.90.3 Change-Id: I441d6d3d1cdc19585579e43b751e9f0c06c90d7c Signed-off-by: DongHun Kwak --- diff --git a/ChangeLog b/ChangeLog index bec9ed8..13594e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,436 @@ +commit 429569abddada5a3bad554de707ddf35b349936e +Author: John (J5) Palmieri +Date: Thu Aug 25 13:57:53 2011 -0400 + + support skip annotation for return values + + * this is used for things like skiping gboolean returns that are + useful is C but useless in python + + * cleans up after skipped returns that are also marked transfer + full + https://bugzilla.gnome.org/show_bug.cgi?id=650135 + + 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(-) + +commit 7a234b185b131f3eb6a6e8a8c717ddf4d508b15e +Author: Xavier Claessens +Date: Tue Aug 2 12:05:12 2011 +0200 + + Test GPtrArray regression + + tests/test_everything.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 42fc9fa437102c882844a0e70a081ab08de92658 +Author: Steve Frécinaux +Date: Fri Aug 26 10:53:43 2011 +0200 + + Drop support for old constructor style. + + Bindings don't write their own constructors anymore, and the old style + has been deprecated for ages, so let's just drop them now and make + pygobject simpler. + + https://bugzilla.gnome.org/show_bug.cgi?id=657413 + + gi/_gobject/gobjectmodule.c | 20 -------------------- + gi/_gobject/pygobject-private.h | 1 - + gi/_gobject/pygobject.c | 1 - + gi/_gobject/pygobject.h | 2 -- + gi/gimodule.c | 28 ---------------------------- + gi/types.py | 2 -- + tests/testhelpermodule.c | 5 ----- + 7 files changed, 0 insertions(+), 59 deletions(-) + +commit 3961a405e1bddef22e1a5a0c7aa3ae55e4ec09ad +Author: Steve Frécinaux +Date: Fri Aug 26 10:45:59 2011 +0200 + + Drop support for sink functions. + + Sink functions were meant to deal with floating references in a custom + way. They are not useful anymore with the dynamic bindings. + + https://bugzilla.gnome.org/show_bug.cgi?id=642233 + + gi/_gobject/gobjectmodule.c | 1 - + gi/_gobject/pygobject.c | 53 -------------------------------------- + gi/_gobject/pygobject.h | 4 --- + tests/test-floating.c | 59 + ++++++------------------------------------ + tests/test-floating.h | 42 ++++++++---------------------- + tests/test_gobject.py | 13 ++------- + tests/testhelpermodule.c | 32 ++++++---------------- + 7 files changed, 32 insertions(+), 172 deletions(-) + +commit 631d8ef879a13492945a3e30b3df9863a4ba2f44 +Author: Mike Gorse +Date: Wed Aug 24 17:30:09 2011 -0500 + + Reinstate copying of in-line structs in arrays + + For arrays of in-line, non-boxed structures with (transfer full), + _pygi_marshal_free_out_array eventually gets called and frees + the array + data, so we should copy it (IE, BGO#653588). + + https://bugzilla.gnome.org/show_bug.cgi?id=657120 + + gi/pygi-marshal-out.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit f38511f251602e18551c04617cc2e2d42e812e1e +Author: John (J5) Palmieri +Date: Tue Aug 23 14:18:43 2011 -0400 + + fix inline struct array handling + + * we now assume any non-boxed structs are inline in an array since + there is + no way to check in GI and this is the most common use for an + array of + non-boxed structs + + https://bugzilla.gnome.org/show_bug.cgi?id=657120 + + gi/pygi-marshal-out.c | 23 +++++++++-------------- + tests/test_gi.py | 8 ++++++++ + 2 files changed, 17 insertions(+), 14 deletions(-) + +commit d92846a5446b0dd2e69c813f56224a1966ab1a33 +Author: Dieter Verfaillie +Date: Tue Aug 23 11:30:41 2011 +0200 + + [gtk-demo] printing.py: set print and error dialog transient parent + + demos/gtk-demo/demos/printing.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 1aebc1565752840075027b9452fe2a67217bf53b +Author: Dieter Verfaillie +Date: Tue Aug 23 11:28:05 2011 +0200 + + [gtk-demo] printing.py: exit Gtk mainloop when done and correctly + handle printing errors + + demos/gtk-demo/demos/printing.py | 14 ++++++++++---- + 1 files changed, 10 insertions(+), 4 deletions(-) + +commit 1f9e4486c5b84209ce0038887738fc16a4ef7da3 +Author: Dieter Verfaillie +Date: Tue Aug 23 08:05:43 2011 +0200 + + [gtk-demo] show "activated" demo's in italic font in the TreeView + + demos/gtk-demo/gtk-demo.py | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 971d063f7a36e13ef6621db7002b00af52f6292a +Author: Dieter Verfaillie +Date: Mon Aug 22 14:52:28 2011 +0200 + + [gtk-demo] source colorizer: Python3 does not have the BACKQUOTE + token, so simply remove it + + demos/gtk-demo/gtk-demo.py | 5 +---- + 1 files changed, 1 insertions(+), 4 deletions(-) + +commit c2979a37d6d505095b6e55789150a6498d95819d +Author: Dieter Verfaillie +Date: Mon Aug 22 14:22:18 2011 +0200 + + [gtk-demo] In Python3, GLib.file_get_contents returns a bytes object + but Gtk.TextBuffer.insert expects a string. + + Fixed by using codes.open() as hinted in + http://docs.python.org/dev/howto/pyporting.html#text-files + section "If pre-2.6 compatibility is needed" (because configure.ac + is still happy with Python 2.5.2). + + demos/gtk-demo/gtk-demo.py | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit 9ea56535f35abbea4cd977dea4c89247e4b01694 +Author: Dieter Verfaillie +Date: Mon Aug 22 12:30:24 2011 +0200 + + [gtk-demo] images.py: fix 'Insensitive 'button mnenomic + + demos/gtk-demo/demos/images.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7829dae1cdb8697a19c2b5e158ef0e08f6c2558b +Author: Dieter Verfaillie +Date: Mon Aug 22 10:38:04 2011 +0200 + + [gtk-demo] printing.py: fix Pango.EllipsizeType > Pango.EllipsizeMode + & get_pixel_size + + demos/gtk-demo/demos/printing.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 07f0274301d77d9bf62b49a14b059d9a52afb445 +Author: Dieter Verfaillie +Date: Mon Aug 22 10:37:08 2011 +0200 + + [gtk-demo] printing.py: fix text file loading + + demos/gtk-demo/demos/printing.py | 32 ++++++++++++++++---------------- + 1 files changed, 16 insertions(+), 16 deletions(-) + +commit 135148a4c35aac1d132b0b8fa3adbf1fdcdb3a24 +Author: Dieter Verfaillie +Date: Mon Aug 22 10:20:35 2011 +0200 + + [gtk-demo] pixbuf.py: fix image loading + + demos/gtk-demo/demos/pixbuf.py | 25 +++++++++++-------------- + 1 files changed, 11 insertions(+), 14 deletions(-) + +commit a93cae2c80e30a408f86e7e6c4d15a538011a189 +Author: Dieter Verfaillie +Date: Mon Aug 22 10:10:02 2011 +0200 + + [gtk-demo] images.py: fix logo loading + + demos/gtk-demo/demos/images.py | 70 + ++++++++++++++++----------------------- + 1 files changed, 29 insertions(+), 41 deletions(-) + +commit eddc0824e0e4c156fca5de05bdeb600c534d4b24 +Author: Dieter Verfaillie +Date: Wed Aug 24 12:19:21 2011 +0200 + + [gtk-demo] appwindow.py: set AboutDialog parent + + demos/gtk-demo/demos/appwindow.py | 7 +++---- + 1 files changed, 3 insertions(+), 4 deletions(-) + +commit 7fe10a5b33148b1f029f3d34f76b7f880c1c2e7a +Author: Dieter Verfaillie +Date: Mon Aug 22 07:58:25 2011 +0200 + + [gtk-demo] appwindow.py: fix logo loading + + demos/gtk-demo/demos/appwindow.py | 10 +++------- + 1 files changed, 3 insertions(+), 7 deletions(-) + +commit 62fda288c1c37167c589e8e9d49ed625f770a98a +Author: Dieter Verfaillie +Date: Mon Aug 22 07:57:31 2011 +0200 + + [gtk-demo] appwindow.py: fix callback signatures + + demos/gtk-demo/demos/appwindow.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 87e9ab4d3a0aac4f4710aa0f8af0a1736f781ad9 +Author: Dieter Verfaillie +Date: Mon Aug 22 07:48:28 2011 +0200 + + [gtk-demo] fix glib vs GLib usage + + demos/gtk-demo/demos/Icon View/iconviewbasics.py | 2 +- + demos/gtk-demo/demos/appwindow.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit d29cad6976a80862e1fc590d3e7d190e8a234866 +Author: Dieter Verfaillie +Date: Wed Aug 24 12:19:02 2011 +0200 + + [gtk-demo] iconviewedit.py: fix for Gdk.color_parse API breakage + caused by improved GDK overrides + + demos/gtk-demo/demos/Icon View/iconviewedit.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit f29d3a85a275a39e8481484779264b0dea1160ab +Author: Dieter Verfaillie +Date: Mon Aug 22 07:25:32 2011 +0200 + + [gtk-demo] optimize source colorizer by only preparing iters for + known colorized tokens + + demos/gtk-demo/gtk-demo.py | 20 +++++++++++++++----- + 1 files changed, 15 insertions(+), 5 deletions(-) + +commit ecd1eb00b19733da3f2e3d7935792378f34cab19 +Author: Dieter Verfaillie +Date: Fri Aug 19 18:31:20 2011 +0200 + + [gtk-demo] small formatting fixes + + demos/gtk-demo/demos/Entry/entry_buffer.py | 1 + + demos/gtk-demo/demos/Entry/entry_completion.py | 1 + + demos/gtk-demo/demos/Icon View/iconviewbasics.py | 8 ++++---- + demos/gtk-demo/demos/assistant.py | 1 + + demos/gtk-demo/demos/builder.py | 4 +++- + demos/gtk-demo/demos/button_box.py | 1 + + demos/gtk-demo/demos/clipboard.py | 1 + + demos/gtk-demo/demos/colorselector.py | 1 + + demos/gtk-demo/demos/combobox.py | 1 + + demos/gtk-demo/demos/drawingarea.py | 4 +++- + demos/gtk-demo/demos/test.py | 2 ++ + 11 files changed, 19 insertions(+), 6 deletions(-) + +commit c42cb4da399ff5732f4ca732b85134de796a60fa +Author: Dieter Verfaillie +Date: Fri Aug 19 18:30:50 2011 +0200 + + [gtk-demo] remove "is_fully_bound" from demos + + demos/gtk-demo/demos/Entry/entry_buffer.py | 2 -- + demos/gtk-demo/demos/Entry/entry_completion.py | 2 -- + demos/gtk-demo/demos/appwindow.py | 3 --- + demos/gtk-demo/demos/assistant.py | 2 -- + demos/gtk-demo/demos/builder.py | 2 -- + demos/gtk-demo/demos/button_box.py | 2 -- + demos/gtk-demo/demos/clipboard.py | 2 -- + demos/gtk-demo/demos/colorselector.py | 2 -- + demos/gtk-demo/demos/combobox.py | 2 -- + demos/gtk-demo/demos/drawingarea.py | 2 -- + demos/gtk-demo/demos/test.py | 1 - + 11 files changed, 0 insertions(+), 22 deletions(-) + +commit cad6a62c63f455f0b1315465a9cd71c0f02b12a5 +Author: Dieter Verfaillie +Date: Fri Aug 19 18:26:31 2011 +0200 + + [gtk-demo] add source colorizer loosely based on PyGTK's pygtk-demo + and GTK+'s gtk-demo code + + demos/gtk-demo/gtk-demo.py | 116 + ++++++++++++++++++++++++++++++++++++++------ + 1 files changed, 101 insertions(+), 15 deletions(-) + +commit 250c36f4a8352ff1b31c1c85b156d3e803d4b8ef +Author: Dieter Verfaillie +Date: Fri Aug 19 15:08:15 2011 +0200 + + [gtk-demo] remove C-isms + + demos/gtk-demo/gtk-demo.py | 28 ++++++++++++++-------------- + 1 files changed, 14 insertions(+), 14 deletions(-) + +commit cf35fe8e259e786d0fa21b08b1f5c64c9bb0a84e +Author: Dieter Verfaillie +Date: Fri Aug 19 14:54:39 2011 +0200 + + [gtk-demo] fix text on info tab to be more like GTK+'s gtk-demo + + demos/gtk-demo/gtk-demo.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 241827208e25c72a990d8edd95a3b879470d6409 +Author: Dieter Verfaillie +Date: Fri Aug 19 14:40:56 2011 +0200 + + [gtk-demo] remove duplicate storage of demos by only storing them + in a TreeStore subclass + + This also moves demos loading code into the TreeStore subclass and + demo loading code into the Demo class + + demos/gtk-demo/gtk-demo.py | 151 + ++++++++++++++++++++----------------------- + 1 files changed, 70 insertions(+), 81 deletions(-) + +commit 58797c355a08a35375988881a17958bb42ad54bb +Author: Dieter Verfaillie +Date: Fri Aug 19 14:40:00 2011 +0200 + + [gtk-demo] make GtkDemoApp a Gtk.Window subclass and adapt main() + to demonstrate the GLib.MainLoop + + demos/gtk-demo/gtk-demo.py | 43 + ++++++++++++++++++++++++++----------------- + 1 files changed, 26 insertions(+), 17 deletions(-) + +commit 1e4fc1ea54527cff78f6c633db39e9a0bd3c64d2 +Author: Dieter Verfaillie +Date: Fri Aug 19 11:46:17 2011 +0200 + + [gtk-demo] correctly load demo code when cwd != demos/gtk-demo/ + + demos/gtk-demo/gtk-demo.py | 39 +++++++++++++++++++++++---------------- + 1 files changed, 23 insertions(+), 16 deletions(-) + +commit 6ffc999fbd4c9990fb5bde53ddd46d139b53245e +Author: Dieter Verfaillie +Date: Fri Aug 19 11:02:35 2011 +0200 + + [gtk-demo] drawingarea: fix labels + + demos/gtk-demo/demos/drawingarea.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 9fd3986affe11cbc5a816adcccdc56d0592f3618 +Author: Dieter Verfaillie +Date: Fri Aug 19 09:57:31 2011 +0200 + + [gtk-demo] fix imports + + demos/gtk-demo/demos/Icon View/iconviewbasics.py | 6 ++++-- + demos/gtk-demo/demos/appwindow.py | 9 ++++++--- + demos/gtk-demo/gtk-demo.py | 8 ++++---- + 3 files changed, 14 insertions(+), 9 deletions(-) + +commit 9f314babfdee3b82799e00ea003972b0bbe6a8d5 +Author: Dieter Verfaillie +Date: Fri Aug 19 10:07:14 2011 +0200 + + [gtk-demo] fix shebang + + demos/gtk-demo/gtk-demo.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 01142060ae7d71a8a1f7d3e9bbc6f52e65f01c8d +Author: Sebastian Pölsterl +Date: Fri Aug 19 12:27:04 2011 +0200 + + Added support for __setitem__ to TreeModel and support for slices + to TreeModelRow + + https://bugzilla.gnome.org/show_bug.cgi?id=656891 + + gi/overrides/Gtk.py | 26 +++++++++++++++++++- + tests/test_overrides.py | 57 + +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 81 insertions(+), 2 deletions(-) + +commit d6da96c65b2ed3cda238886990a624fbc31f6987 +Author: Olav Vitters +Date: Wed Aug 24 16:31:12 2011 +0200 + + Convert ACCEL_* constants into Gtk.AccelFlags. + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 0841d41698302abb5d987849a5874252564ed428 +Author: Olav Vitters +Date: Wed Aug 24 16:22:17 2011 +0200 + + Convert TREE_VIEW_DROP_* constants into Gtk.TreeViewDropPosition + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 37b0d0f9dc3d485829cae6e50da369fdea91a2d1 +Author: John (J5) Palmieri +Date: Thu Aug 18 14:06:32 2011 -0400 + + post commit version bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + commit e51efc50835a14e0418cc27cc928c52d1aa6a3cf Author: John (J5) Palmieri Date: Thu Aug 18 14:02:30 2011 -0400 diff --git a/NEWS b/NEWS index 7c6d823..0bebcaa 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +2.90.3 31-Aug-2011 (3.0 pre-release) + - support skip annotation for return values (John (J5) Palmieri) + - Test GPtrArray regression (Xavier Claessens) + - Drop support for old constructor style. (Steve Frécinaux) + - Drop support for sink functions. (Steve Frécinaux) + - Reinstate copying of in-line structs in arrays (Mike Gorse) + - fix inline struct array handling (John (J5) Palmieri) + - fix on demos (Dieter Verfaillie) + - Added support for __setitem__ to TreeModel and support for slices to TreeModelRow (Sebastian Pölsterl) + - Convert ACCEL_* constants into Gtk.AccelFlags. (Olav Vitters) + - Convert TREE_VIEW_DROP_* constants into Gtk.TreeViewDropPosition (Olav Vitters) + 2.90.2 18-Aug-2011 (3.0 pre-release) - remove tests that were removed from gi (John (J5) Palmieri) - don't calculate item_size using is_pointer (John (J5) Palmieri) diff --git a/PKG-INFO b/PKG-INFO index 18b9123..0c75472 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 2.90.2 +Version: 2.90.3 Summary: Python bindings for GObject Home-page: http://www.pygtk.org/ Author: James Henstridge @@ -8,7 +8,7 @@ Author-email: james@daa.com.au Maintainer: Johan Dahlin Maintainer-email: johan@gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.90/pygobject-2.90.2.tar.gz +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.90/pygobject-2.90.3.tar.gz Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable diff --git a/configure b/configure index 9a559f5..30e0390 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for pygobject 2.90.2. +# Generated by GNU Autoconf 2.68 for pygobject 2.90.3. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pygobject' PACKAGE_TARNAME='pygobject' -PACKAGE_VERSION='2.90.2' -PACKAGE_STRING='pygobject 2.90.2' +PACKAGE_VERSION='2.90.3' +PACKAGE_STRING='pygobject 2.90.3' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' PACKAGE_URL='' @@ -1360,7 +1360,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pygobject 2.90.2 to adapt to many kinds of systems. +\`configure' configures pygobject 2.90.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1430,7 +1430,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 2.90.2:";; + short | recursive ) echo "Configuration of pygobject 2.90.3:";; esac cat <<\_ACEOF @@ -1556,7 +1556,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 2.90.2 +pygobject configure 2.90.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1834,7 +1834,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pygobject $as_me 2.90.2, which was +It was created by pygobject $as_me 2.90.3, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2198,9 +2198,9 @@ $as_echo "#define PYGOBJECT_MINOR_VERSION 90" >>confdefs.h PYGOBJECT_MINOR_VERSION=90 -$as_echo "#define PYGOBJECT_MICRO_VERSION 2" >>confdefs.h +$as_echo "#define PYGOBJECT_MICRO_VERSION 3" >>confdefs.h -PYGOBJECT_MICRO_VERSION=2 +PYGOBJECT_MICRO_VERSION=3 ac_config_headers="$ac_config_headers config.h" @@ -2684,7 +2684,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='2.90.2' + VERSION='2.90.3' cat >>confdefs.h <<_ACEOF @@ -12020,7 +12020,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -pygobject config.lt 2.90.2 +pygobject config.lt 2.90.3 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -16746,7 +16746,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pygobject $as_me 2.90.2, which was +This file was extended by pygobject $as_me 2.90.3, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16812,7 +16812,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -pygobject config.status 2.90.2 +pygobject config.status 2.90.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 4296111..8937c18 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ m4_define(python3_min_ver, 3.1) dnl the pygobject version number m4_define(pygobject_major_version, 2) m4_define(pygobject_minor_version, 90) -m4_define(pygobject_micro_version, 2) +m4_define(pygobject_micro_version, 3) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) dnl versions of packages we require ... diff --git a/docs/html/class-glibmaincontext.html b/docs/html/class-glibmaincontext.html index 65e7a00..739d719 100644 --- a/docs/html/class-glibmaincontext.html +++ b/docs/html/class-glibmaincontext.html @@ -1,7 +1,7 @@ glib.MainContext

glib.MainContext

glib.MainContext — an object representing a set of event sources to be handled -in a glib.MainLoop.

Synopsis

class glib.MainContext:
-    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
-

Description

A glib.MainContext +in a glib.MainLoop.

Synopsis

class glib.MainContext:
+    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
+

Description

A glib.MainContext represents a set of event sources that can be run in a single thread. File descriptors (plain files, pipes or sockets) and timeouts are the standard event sources for GTK and PyGTK though @@ -13,7 +13,7 @@ events from lower priority sources. Single iterations of a iteration() method.

Constructor

    glib.MainContext()

Returns :

a new glib.MainContext object.

Creates a new glib.MainContext -object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if True the call may block +object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if True the call may block waiting for an event.

Returns :

True if events were dispatched.

The iteration() method runs a single iteration. This involves:

  • checking to see if any associated event sources are ready diff --git a/docs/html/class-glibmainloop.html b/docs/html/class-glibmainloop.html index 27de53a..37a0c7a 100644 --- a/docs/html/class-glibmainloop.html +++ b/docs/html/class-glibmainloop.html @@ -1,7 +1,7 @@ glib.MainLoop

    glib.MainLoop

    glib.MainLoop — an object representing the main event loop of a PyGTK - application.

    Synopsis

    class glib.MainLoop:
    -    glib.MainLoop(context=None, is_running=0)
    def get_context()
    def is_running()
    def quit()
    def run()

    Ancestry

    +-- glib.MainLoop
    -

    Description

    glib.MainLoop + application.

    Synopsis

    class glib.MainLoop:
    +    glib.MainLoop(context=None, is_running=0)
    def get_context()
    def is_running()
    def quit()
    def run()

    Ancestry

    +-- glib.MainLoop
    +

    Description

    glib.MainLoop represents a main event loop. A glib.MainLoop is created with the glib.MainLoop() constructor. After adding the initial event sources, the run() @@ -24,7 +24,7 @@ functions.

Returns :

a new glib.MainLoop object.

Creates a new glib.MainLoop -object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext +object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext the mainloop is associated with

The get_context() method returns the glib.MainContext that the mainloop was created with.

glib.MainLoop.is_running

    def is_running()

Returns :

True if the mainloop is diff --git a/docs/html/class-gobject.html b/docs/html/class-gobject.html index 7b1ec0d..5a10122 100644 --- a/docs/html/class-gobject.html +++ b/docs/html/class-gobject.html @@ -1,6 +1,6 @@ -gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
-    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
-

Attributes

"props"Read/Write +gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
+    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
+

Attributes

"props"Read/Write

This attribute gives full access to GObject properties as simple attributes. It can be used to iterate over all the object properties, and can be used both on class or instance objects.

@@ -17,12 +17,12 @@ button_label = button.get_property(label_pspec.name)
"__doc__"ReadThe documentation for the object type. Uses "__gdoc__" if no specific documentation set.
"__gdoc__"ReadThe generated documentation for the underlying GObject - type.
"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject + type.

"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject class is the base class providing the common attributes and methods for the PyGTK classes. The gobject.GObject class is not a user interface widget class.

The gobject.GObject class provides the signal management methods, the object property access - methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the + methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the GObject

Returns :

a Python object containing the value of the property

The get_property() method returns the value of the property specified by property_name or @@ -161,7 +161,7 @@ still to be run will not be invoked.

emit_stop_by_name() method stops the current emission of the signal specified by detailed_signal. Any signal handlers in the list -still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the +still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the signal

property_spec :

the gobject.GParamSpec of the property that was changed

user_param1 :

the first user parameter (if any) specified with the connect() diff --git a/docs/html/class-gobjectgboxed.html b/docs/html/class-gobjectgboxed.html index 077bcd5..b9d8bbd 100644 --- a/docs/html/class-gobjectgboxed.html +++ b/docs/html/class-gobjectgboxed.html @@ -1,9 +1,9 @@ -gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
-    def copy()

Ancestry

+-- gobject.GBoxed
-

Description

gobject.GBoxed +gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
+    def copy()

Ancestry

+-- gobject.GBoxed
+

Description

gobject.GBoxed is an abstract base class that encapsulates an opaque chunk of data to provide an object-oriented interface and a type that is registered with the GLIB type system. A boxed type is registered with functions that provide for the copying and freeing of the underlying data -structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed +structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed object

The copy() method makes and returns a copy of the boxed object.

diff --git a/docs/html/class-gobjectginterface.html b/docs/html/class-gobjectginterface.html index 26a7cb7..9191f18 100644 --- a/docs/html/class-gobjectginterface.html +++ b/docs/html/class-gobjectginterface.html @@ -1,4 +1,4 @@ -gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
-

Ancestry

+-- gobject.GInterface
-

Description

gobject.GInterface +gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
+

Ancestry

+-- gobject.GInterface
+

Description

gobject.GInterface is an abstract base class that encapsulates a GInterface.

diff --git a/docs/html/class-gobjectgpointer.html b/docs/html/class-gobjectgpointer.html index d6e506b..7e8e1c0 100644 --- a/docs/html/class-gobjectgpointer.html +++ b/docs/html/class-gobjectgpointer.html @@ -1,7 +1,7 @@ gobject.GPointer

gobject.GPointer

gobject.GPointer — an object containing a completely opaque chunk of - data

Synopsis

class gobject.GPointer:
-

Ancestry

+-- gobject.GPointer
-

Description

gobject.GPointer + data

Synopsis

class gobject.GPointer:
+

Ancestry

+-- gobject.GPointer
+

Description

gobject.GPointer is an abstract base class that encapsulates an opaque chunk of data and registers it with the GLIB type system. A pointer type has no methods and generic ways of copying and freeing the data. It diff --git a/docs/html/glib-constants.html b/docs/html/glib-constants.html index 6d8e31c..4e997cf 100644 --- a/docs/html/glib-constants.html +++ b/docs/html/glib-constants.html @@ -1,4 +1,4 @@ -glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Synopsis

+glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Synopsis

 Glib IO Condition Constants
 Glib Priority Constants
 Glib Spawn Flag Constants
diff --git a/docs/html/glib-functions.html b/docs/html/glib-functions.html
index 793d7de..450894a 100644
--- a/docs/html/glib-functions.html
+++ b/docs/html/glib-functions.html
@@ -1,6 +1,6 @@
-glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

-    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib -module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when +glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

+    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib +module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when PyGTK is idle

... :

optionals arguments to be passed to callback

Returns :

an integer ID

The glib.idle_add() function adds a function (specified by callback) to be called diff --git a/docs/html/gobject-constants.html b/docs/html/gobject-constants.html index 97eabc1..984db0b 100644 --- a/docs/html/gobject-constants.html +++ b/docs/html/gobject-constants.html @@ -1,4 +1,4 @@ -gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Synopsis

+gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Synopsis

 GObject Param Flag Constants
 GObject Signal Flag Constants
 GObject Built-in Type Constants
diff --git a/docs/html/gobject-functions.html b/docs/html/gobject-functions.html
index 55f75ab..aa4d279 100644
--- a/docs/html/gobject-functions.html
+++ b/docs/html/gobject-functions.html
@@ -1,12 +1,12 @@
-gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

+gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

     def gobject.type_name(type)
def gobject.type_from_name(type_name)
def gobject.type_parent(type)
def gobject.type_is_a(type, parent_type)
def gobject.type_children(type)
def gobject.type_interfaces(type)
def gobject.type_register(class)
def gobject.signal_new(signal_name, type, flags, return_type, param_types)
def gobject.signal_list_names(type)
def gobject.signal_list_ids(type)
def gobject.signal_lookup(name, type)
def gobject.signal_name(signal_id)
def gobject.signal_query(name, type)
def gobject.signal_query(signal_id)
def gobject.list_properties(type)
def gobject.new(type, ...)
def gobject.signal_accumulator_true_handled()
def gobject.add_emission_hook(type, name, callback, ...)
def gobject.remove_emission_hook(type, name, hook_id)
def gobject._install_metaclass(metaclass) -

Description

These functions are part of the PyGTK gobject +

Description

These functions are part of the PyGTK gobject module but are not directly associated with a specific class.

Note

Many functions that previously were in this namespace got moved to glib namespace instead. They are still available in gobject for backward compatibility, but not documented here. If you miss documentation for some function, be sure to check glib first. -

Functions

gobject.type_name

    def gobject.type_name(type)

type :

a GObject type, type ID or +

Functions

gobject.type_name

    def gobject.type_name(type)

type :

a GObject type, type ID or instance

Returns :

The gobject.type_name() function returns the unique name that is assigned to the specified type. type can be a GObject diff --git a/docs/html/index.html b/docs/html/index.html index 9abc306..77417f8 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -1,4 +1,4 @@ -PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.90.2

2011-08-18 +PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.90.3

2011-08-31

Abstract

This reference describes the classes of the python gobject module.


Table of Contents

Introduction
Reference Page Format
PyGlibClass Reference
glib.MainContext — an object representing a set of event sources to be handled in a glib.MainLoop.
glib.MainLoop — an object representing the main event loop of a PyGTK diff --git a/gi/_gobject/gobjectmodule.c b/gi/_gobject/gobjectmodule.c index ac0a6f4..dfa1a8c 100644 --- a/gi/_gobject/gobjectmodule.c +++ b/gi/_gobject/gobjectmodule.c @@ -1024,10 +1024,6 @@ pygobject__g_instance_init(GTypeInstance *instance, GObject *object = (GObject *) instance; PyObject *wrapper, *args, *kwargs; - if (!g_type_get_qdata(G_OBJECT_TYPE(object), - pygobject_has_updated_constructor_key)) - return; - wrapper = g_object_get_qdata(object, pygobject_wrapper_key); if (wrapper == NULL) { wrapper = pygobject_init_wrapper_get(); @@ -1135,7 +1131,6 @@ pyg_type_register(PyTypeObject *class, const char *type_name) guint n_parent_interfaces; GTypeQuery query; gpointer gclass; - gpointer has_new_constructor_api; GTypeInfo type_info = { 0, /* class_size */ @@ -1201,14 +1196,6 @@ pyg_type_register(PyTypeObject *class, const char *type_name) PyObject_SetAttrString((PyObject *)class, "__gtype__", gtype); Py_DECREF(gtype); - /* propagate new constructor API compatility flag from parent to child type */ - has_new_constructor_api = - g_type_get_qdata(parent_type, - pygobject_has_updated_constructor_key); - if (has_new_constructor_api != NULL) - g_type_set_qdata(instance_type, pygobject_has_updated_constructor_key, - has_new_constructor_api); - /* if no __doc__, set it to the auto doc descriptor */ if (PyDict_GetItemString(class->tp_dict, "__doc__") == NULL) { PyDict_SetItemString(class->tp_dict, "__doc__", @@ -2313,12 +2300,6 @@ pygobject_construct(PyGObject *self, const char *first_property_name, ...) return retval; } -void -pyg_set_object_has_new_constructor(GType type) -{ - g_type_set_qdata(type, pygobject_has_updated_constructor_key, GINT_TO_POINTER(1)); -} - PyObject * pyg_integer_richcompare(PyObject *v, PyObject *w, int op) { @@ -2408,7 +2389,6 @@ disable_warning_redirections(void) struct _PyGObject_Functions pygobject_api_functions = { pygobject_register_class, pygobject_register_wrapper, - pygobject_register_sinkfunc, pygobject_lookup_class, pygobject_new, @@ -2472,7 +2452,6 @@ struct _PyGObject_Functions pygobject_api_functions = { pyg_closure_set_exception_handler, pygobject_constructv, pygobject_construct, - pyg_set_object_has_new_constructor, add_warning_redirection, disable_warning_redirections, diff --git a/gi/_gobject/pygobject-private.h b/gi/_gobject/pygobject-private.h index 99c1894..1fed2ae 100644 --- a/gi/_gobject/pygobject-private.h +++ b/gi/_gobject/pygobject-private.h @@ -92,7 +92,6 @@ int pygobject_constructv (PyGObject *self, int pygobject_construct (PyGObject *self, const char *first_property_name, ...); -void pyg_set_object_has_new_constructor (GType gtype); PyObject *pyg_integer_richcompare(PyObject *v, PyObject *w, diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c index 56b9aef..0ad7e95 100644 --- a/gi/_gobject/pygobject.c +++ b/gi/_gobject/pygobject.c @@ -113,12 +113,6 @@ pygobject_get_inst_data(PyGObject *self) } -typedef struct { - GType type; - void (* sinkfunc)(GObject *object); -} SinkFunc; -static GArray *sink_funcs = NULL; - GHashTable *custom_type_registration = NULL; PyTypeObject *PyGObject_MetaType = NULL; @@ -135,17 +129,6 @@ PyTypeObject *PyGObject_MetaType = NULL; void pygobject_sink(GObject *obj) { - if (sink_funcs) { - gint i; - - for (i = 0; i < sink_funcs->len; i++) { - if (g_type_is_a(G_OBJECT_TYPE(obj), - g_array_index(sink_funcs, SinkFunc, i).type)) { - g_array_index(sink_funcs, SinkFunc, i).sinkfunc(obj); - return; - } - } - } /* The default behaviour for GInitiallyUnowned subclasses is to call ref_sink(). * - if the object is new and owned by someone else, its ref has been sunk and * we need to keep the one from that someone and add our own "fresh ref" @@ -157,42 +140,6 @@ pygobject_sink(GObject *obj) } } -/** - * pygobject_register_sinkfunc: - * type: the GType the sink function applies to. - * sinkfunc: a function to remove the floating reference on an object. - * - * As Python handles reference counting for us, the "floating - * reference" code in GTK is not all that useful. In fact, it can - * cause leaks. For this reason, PyGTK removes the floating - * references on objects on construction. - * - * The sinkfunc should be able to remove the floating reference on - * instances of the given type, or any subclasses. - * - * Deprecated: Since 2.22, sinkfuncs are not needed. - */ -void -pygobject_register_sinkfunc(GType type, void (* sinkfunc)(GObject *object)) -{ - SinkFunc sf; - - g_message ("pygobject_register_sinkfunc is deprecated (%s)", - g_type_name(type)); - -#if 0 - g_return_if_fail(G_TYPE_IS_OBJECT(type)); -#endif - g_return_if_fail(sinkfunc != NULL); - - if (!sink_funcs) - sink_funcs = g_array_new(FALSE, FALSE, sizeof(SinkFunc)); - - sf.type = type; - sf.sinkfunc = sinkfunc; - g_array_append_val(sink_funcs, sf); -} - typedef struct { PyObject_HEAD GParamSpec **props; @@ -2350,7 +2297,6 @@ pygobject_object_register_types(PyObject *d) &PyGObject_Type, NULL); PyDict_SetItemString(PyGObject_Type.tp_dict, "__gdoc__", pyg_object_descr_doc_get()); - pyg_set_object_has_new_constructor(G_TYPE_OBJECT); /* GProps */ PyGProps_Type.tp_dealloc = (destructor)PyGProps_dealloc; diff --git a/gi/_gobject/pygobject.h b/gi/_gobject/pygobject.h index 7952e5e..7939563 100644 --- a/gi/_gobject/pygobject.h +++ b/gi/_gobject/pygobject.h @@ -92,8 +92,6 @@ struct _PyGObject_Functions { void (* register_class)(PyObject *dict, const gchar *class_name, GType gtype, PyTypeObject *type, PyObject *bases); void (* register_wrapper)(PyObject *self); - void (* register_sinkfunc)(GType type, - void (* sinkfunc)(GObject *object)); PyTypeObject *(* lookup_class)(GType type); PyObject *(* newgobj)(GObject *obj); @@ -188,7 +186,6 @@ struct _PyGObject_Functions { int (*pygobject_construct) (PyGObject *self, const char *first_property_name, ...); - void (*set_object_has_new_constructor) (GType type); void (*add_warning_redirection) (const char *domain, PyObject *warning); @@ -211,8 +208,6 @@ struct _PyGObject_Functions *_PyGObject_API; #define pygobject_register_class (_PyGObject_API->register_class) #define pygobject_register_wrapper (_PyGObject_API->register_wrapper) -/* This is deprecated, sinkfuncs are not needed anymore */ -#define pygobject_register_sinkfunc (_PyGObject_API->register_sinkfunc) #define pygobject_lookup_class (_PyGObject_API->lookup_class) #define pygobject_new (_PyGObject_API->newgobj) #define pyg_closure_new (_PyGObject_API->closure_new) @@ -261,7 +256,6 @@ struct _PyGObject_Functions *_PyGObject_API; #define pyg_register_interface_info (_PyGObject_API->register_interface_info) #define pygobject_construct (_PyGObject_API->pygobject_construct) #define pygobject_constructv (_PyGObject_API->pygobject_constructv) -#define pyg_set_object_has_new_constructor (_PyGObject_API->set_object_has_new_constructor) #define pyg_add_warning_redirection (_PyGObject_API->add_warning_redirection) #define pyg_disable_warning_redirections (_PyGObject_API->disable_warning_redirections) #define pyg_type_register_custom_callback (_PyGObject_API->type_register_custom) diff --git a/gi/gimodule.c b/gi/gimodule.c index f715d0f..873a56e 100644 --- a/gi/gimodule.c +++ b/gi/gimodule.c @@ -201,33 +201,6 @@ _wrap_pyg_flags_register_new_gtype_and_add (PyObject *self, return pyg_flags_add (NULL, g_type_name (g_type), NULL, g_type); } - -static PyObject * -_wrap_pyg_set_object_has_new_constructor (PyObject *self, - PyObject *args, - PyObject *kwargs) -{ - static char *kwlist[] = { "g_type", NULL }; - PyObject *py_g_type; - GType g_type; - - if (!PyArg_ParseTupleAndKeywords (args, kwargs, - "O!:set_object_has_new_constructor", - kwlist, &PyGTypeWrapper_Type, &py_g_type)) { - return NULL; - } - - g_type = pyg_type_from_object (py_g_type); - if (!g_type_is_a (g_type, G_TYPE_OBJECT)) { - PyErr_SetString (PyExc_TypeError, "must be a subtype of GObject"); - return NULL; - } - - pyg_set_object_has_new_constructor (g_type); - - Py_RETURN_NONE; -} - static void initialize_interface (GTypeInterface *iface, PyTypeObject *pytype) { @@ -486,7 +459,6 @@ static PyMethodDef _gi_functions[] = { { "flags_add", (PyCFunction) _wrap_pyg_flags_add, METH_VARARGS | METH_KEYWORDS }, { "flags_register_new_gtype_and_add", (PyCFunction) _wrap_pyg_flags_register_new_gtype_and_add, METH_VARARGS | METH_KEYWORDS }, - { "set_object_has_new_constructor", (PyCFunction) _wrap_pyg_set_object_has_new_constructor, METH_VARARGS | METH_KEYWORDS }, { "register_interface_info", (PyCFunction) _wrap_pyg_register_interface_info, METH_VARARGS }, { "hook_up_vfunc_implementation", (PyCFunction) _wrap_pyg_hook_up_vfunc_implementation, METH_VARARGS }, { "variant_new_tuple", (PyCFunction) _wrap_pyg_variant_new_tuple, METH_VARARGS }, diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py index 2aea6ad..97c8b40 100644 --- a/gi/overrides/Gtk.py +++ b/gi/overrides/Gtk.py @@ -734,6 +734,10 @@ class TreeModel(Gtk.TreeModel): raise IndexError("could not find tree path '%s'" % key) return TreeModelRow(self, aiter) + def __setitem__(self, key, value): + row = self[key] + self.set_row(row.iter, value) + def __iter__(self): return TreeModelRowIter(self, self.get_iter_first()) @@ -781,6 +785,8 @@ class TreeModel(Gtk.TreeModel): def set_row(self, treeiter, row): # TODO: Accept a dictionary for row # model.append(None,{COLUMN_ICON: icon, COLUMN_NAME: name}) + if isinstance(row, str): + raise TypeError('Expected a list or tuple, but got str') n_columns = self.get_n_columns() if len(row) != n_columns: @@ -1033,6 +1039,12 @@ class TreeModelRow(object): elif key < 0: key = self._convert_negative_index(key) return self.model.get_value(self.iter, key) + elif isinstance(key, slice): + start, stop, step = key.indices(self.model.get_n_columns()) + alist = [] + for i in range(start, stop, step): + alist.append(self.model.get_value(self.iter, i)) + return alist else: raise TypeError("indices must be integers, not %s" % type(key).__name__) @@ -1042,9 +1054,19 @@ class TreeModelRow(object): raise IndexError("column index is out of bounds: %d" % key) elif key < 0: key = self._convert_negative_index(key) - return self.model.set_value(self.iter, key, value) + self.model.set_value(self.iter, key, value) + elif isinstance(key, slice): + start, stop, step = key.indices(self.model.get_n_columns()) + indexList = range(start, stop, step) + if len(indexList) != len(value): + raise ValueError( + "attempt to assign sequence of size %d to slice of size %d" + % (len(value), len(indexList))) + + for i,v in enumerate(indexList): + self.model.set_value(self.iter, v, value[i]) else: - raise TypeError("indices must be integers, not %s" % type(key).__name__) + raise TypeError("index must be an integer or slice, not %s" % type(key).__name__) def _convert_negative_index(self, index): new_index = self.model.get_n_columns() + index diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c index 31dc9e2..a376443 100644 --- a/gi/pygi-cache.c +++ b/gi/pygi-cache.c @@ -1265,6 +1265,7 @@ _args_cache_generate (GICallableInfo *callable_info, -1, -1); + return_cache->is_skipped = g_callable_info_skip_return (callable_info); callable_cache->return_cache = return_cache; g_base_info_unref (return_info); diff --git a/gi/pygi-cache.h b/gi/pygi-cache.h index e00e54d..a0e6e4f 100644 --- a/gi/pygi-cache.h +++ b/gi/pygi-cache.h @@ -87,6 +87,7 @@ struct _PyGIArgCache PyGIMetaArgType meta_type; gboolean is_pointer; gboolean is_caller_allocates; + gboolean is_skipped; gboolean allow_none; GIDirection direction; diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c index 55e56ee..4a7366c 100644 --- a/gi/pygi-invoke.c +++ b/gi/pygi-invoke.c @@ -24,7 +24,7 @@ #include #include "pygi-invoke.h" - +#include "pygi-marshal-cleanup.h" static inline gboolean _invoke_callable (PyGIInvokeState *state, @@ -508,30 +508,42 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGICallableCache *cache) gboolean has_return = FALSE; if (cache->return_cache) { + if (!cache->return_cache->is_skipped) { + if (cache->function_type == PYGI_FUNCTION_TYPE_CONSTRUCTOR) { + if (state->return_arg.v_pointer == NULL) { + PyErr_SetString (PyExc_TypeError, "constructor returned NULL"); + pygi_marshal_cleanup_args_return_fail (state, + cache); + return NULL; + } + } - if (cache->function_type == PYGI_FUNCTION_TYPE_CONSTRUCTOR) { - if (state->return_arg.v_pointer == NULL) { - PyErr_SetString (PyExc_TypeError, "constructor returned NULL"); + py_return = cache->return_cache->out_marshaller ( state, + cache, + cache->return_cache, + &state->return_arg); + if (py_return == NULL) { pygi_marshal_cleanup_args_return_fail (state, cache); return NULL; } - } - py_return = cache->return_cache->out_marshaller ( state, - cache, - cache->return_cache, - &state->return_arg); - if (py_return == NULL) { - pygi_marshal_cleanup_args_return_fail (state, - cache); - return NULL; - } - - if (cache->return_cache->type_tag != GI_TYPE_TAG_VOID) { - total_out_args++; - has_return = TRUE; + if (cache->return_cache->type_tag != GI_TYPE_TAG_VOID) { + total_out_args++; + has_return = TRUE; + } + } else { + if (cache->return_cache->transfer == GI_TRANSFER_EVERYTHING) { + PyGIMarshalCleanupFunc out_cleanup = + cache->return_cache->out_cleanup; + + if (out_cleanup != NULL) + out_cleanup ( state, + cache->return_cache, + &state->return_arg, + FALSE); + } } } diff --git a/gi/pygi-marshal-out.c b/gi/pygi-marshal-out.c index 8adf9ae..e72db80 100644 --- a/gi/pygi-marshal-out.c +++ b/gi/pygi-marshal-out.c @@ -331,20 +331,21 @@ _pygi_marshal_out_array (PyGIInvokeState *state, if (seq_cache->array_type == GI_ARRAY_TYPE_PTR_ARRAY) { item_arg.v_pointer = g_ptr_array_index ( ( GPtrArray *)array_, i); } else if (item_arg_cache->type_tag == GI_TYPE_TAG_INTERFACE) { - item_arg.v_pointer = g_array_index (array_, gpointer, i); - if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) { - PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *) item_arg_cache; - switch (g_base_info_get_type (iface_cache->interface_info)) { - case GI_INFO_TYPE_STRUCT: - { - gpointer *_struct = g_malloc (item_size); - memcpy (_struct, item_arg.v_pointer, item_size); - item_arg.v_pointer = _struct; - break; - } - default: - break; - } + PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *) item_arg_cache; + + switch (g_base_info_get_type (iface_cache->interface_info)) { + case GI_INFO_TYPE_STRUCT: + if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) { + gpointer *_struct = g_malloc (item_size); + memcpy (_struct, array_->data + i * item_size, + item_size); + item_arg.v_pointer = _struct; + } else + item_arg.v_pointer = array_->data + i * item_size; + break; + default: + item_arg.v_pointer = g_array_index (array_, gpointer, i); + break; } } else { memcpy (&item_arg, array_->data + i * item_size, item_size); diff --git a/gi/types.py b/gi/types.py index 1740f96..58eec51 100644 --- a/gi/types.py +++ b/gi/types.py @@ -30,7 +30,6 @@ from ._gi import \ ObjectInfo, \ StructInfo, \ VFuncInfo, \ - set_object_has_new_constructor, \ register_interface_info, \ hook_up_vfunc_implementation @@ -225,7 +224,6 @@ class GObjectMeta(_gobject.GObjectMeta, MetaClassHelper): if isinstance(cls.__info__, ObjectInfo): cls._setup_fields() cls._setup_constructors() - set_object_has_new_constructor(cls.__info__.get_g_type()) elif isinstance(cls.__info__, InterfaceInfo): register_interface_info(cls.__info__.get_g_type()) diff --git a/tests/test-floating.c b/tests/test-floating.c index 8e8ba5d..18e4a46 100644 --- a/tests/test-floating.c +++ b/tests/test-floating.c @@ -1,5 +1,5 @@ /* - * test-floating.c - Source for TestFloatingWithSinkFunc and TestFloatingWithoutSinkFunc + * test-floating.c - Source for TestFloating * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or @@ -19,55 +19,14 @@ #include "test-floating.h" -/* TestFloatingWithSinkFunc */ +/* TestFloating */ -G_DEFINE_TYPE(TestFloatingWithSinkFunc, test_floating_with_sink_func, G_TYPE_INITIALLY_UNOWNED) +G_DEFINE_TYPE(TestFloating, test_floating, G_TYPE_INITIALLY_UNOWNED) static void -test_floating_with_sink_func_finalize (GObject *gobject) +test_floating_finalize (GObject *gobject) { - TestFloatingWithSinkFunc *object = TEST_FLOATING_WITH_SINK_FUNC (gobject); - - if (g_object_is_floating (object)) - { - g_warning ("A floating object was finalized. This means that someone\n" - "called g_object_unref() on an object that had only a floating\n" - "reference; the initial floating reference is not owned by anyone\n" - "and must be removed with g_object_ref_sink()."); - } - - G_OBJECT_CLASS (test_floating_with_sink_func_parent_class)->finalize (gobject); -} - -static void -test_floating_with_sink_func_class_init (TestFloatingWithSinkFuncClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - gobject_class->finalize = test_floating_with_sink_func_finalize; -} - -static void -test_floating_with_sink_func_init (TestFloatingWithSinkFunc *self) -{ -} - -void -sink_test_floating_with_sink_func (GObject *object) -{ - if (g_object_is_floating(object)) { - g_object_ref_sink(object); - } -} - -/* TestFloatingWithoutSinkFunc */ - -G_DEFINE_TYPE(TestFloatingWithoutSinkFunc, test_floating_without_sink_func, G_TYPE_INITIALLY_UNOWNED) - -static void -test_floating_without_sink_func_finalize (GObject *gobject) -{ - TestFloatingWithoutSinkFunc *object = TEST_FLOATING_WITHOUT_SINK_FUNC (gobject); + TestFloating *object = TEST_FLOATING (gobject); if (g_object_is_floating (object)) { @@ -77,19 +36,19 @@ test_floating_without_sink_func_finalize (GObject *gobject) "and must be removed without g_object_ref_sink()."); } - G_OBJECT_CLASS (test_floating_without_sink_func_parent_class)->finalize (gobject); + G_OBJECT_CLASS (test_floating_parent_class)->finalize (gobject); } static void -test_floating_without_sink_func_class_init (TestFloatingWithoutSinkFuncClass *klass) +test_floating_class_init (TestFloatingClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = test_floating_without_sink_func_finalize; + gobject_class->finalize = test_floating_finalize; } static void -test_floating_without_sink_func_init (TestFloatingWithoutSinkFunc *self) +test_floating_init (TestFloating *self) { } diff --git a/tests/test-floating.h b/tests/test-floating.h index bf4e101..ecf2462 100644 --- a/tests/test-floating.h +++ b/tests/test-floating.h @@ -1,5 +1,5 @@ /* - * test-floating.h - Header for TestFloatingWithSinkFunc and TestFloatingWithoutSinkFunc + * test-floating.h - Header for TestFloating * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or @@ -19,44 +19,24 @@ #include -/* TestFloatingWithSinkFunc */ +/* TestFloating */ typedef struct { GInitiallyUnowned parent; -} TestFloatingWithSinkFunc; +} TestFloating; typedef struct { GInitiallyUnownedClass parent_class; -} TestFloatingWithSinkFuncClass; +} TestFloatingClass; -#define TEST_TYPE_FLOATING_WITH_SINK_FUNC (test_floating_with_sink_func_get_type()) -#define TEST_FLOATING_WITH_SINK_FUNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_FLOATING_WITH_SINK_FUNC, TestFloatingWithSinkFunc)) -#define TEST_FLOATING_WITH_SINK_FUNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_FLOATING_WITH_SINK_FUNC, TestFloatingWithSinkFuncClass)) -#define TEST_IS_FLOATING_WITH_SINK_FUNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_FLOATING_WITH_SINK_FUNC)) -#define TEST_IS_FLOATING_WITH_SINK_FUNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TEST_TYPE_FLOATING_WITH_SINK_FUNC)) -#define TEST_FLOATING_WITH_SINK_FUNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_FLOATING_WITH_SINK_FUNC, TestFloatingWithSinkFuncClass)) +#define TEST_TYPE_FLOATING (test_floating_get_type()) +#define TEST_FLOATING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_FLOATING, TestFloating)) +#define TEST_FLOATING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_FLOATING, TestFloatingClass)) +#define TEST_IS_FLOATING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_FLOATING)) +#define TEST_IS_FLOATING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TEST_TYPE_FLOATING)) +#define TEST_FLOATING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_FLOATING, TestFloatingClass)) -GType test_floating_with_sink_func_get_type (void); -void sink_test_floating_with_sink_func (GObject *object); - -/* TestFloatingWithoutSinkFunc */ - -typedef struct { - GInitiallyUnowned parent; -} TestFloatingWithoutSinkFunc; - -typedef struct { - GInitiallyUnownedClass parent_class; -} TestFloatingWithoutSinkFuncClass; - -#define TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC (test_floating_without_sink_func_get_type()) -#define TEST_FLOATING_WITHOUT_SINK_FUNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC, TestFloatingWithoutSinkFunc)) -#define TEST_FLOATING_WITHOUT_SINK_FUNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC, TestFloatingWithoutSinkFuncClass)) -#define TEST_IS_FLOATING_WITHOUT_SINK_FUNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC)) -#define TEST_IS_FLOATING_WITHOUT_SINK_FUNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC)) -#define TEST_FLOATING_WITHOUT_SINK_FUNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC, TestFloatingWithoutSinkFuncClass)) - -GType test_floating_without_sink_func_get_type (void); +GType test_floating_get_type (void); /* TestOwnedByLibrary */ diff --git a/tests/test_everything.py b/tests/test_everything.py index b39711e..4a03890 100644 --- a/tests/test_everything.py +++ b/tests/test_everything.py @@ -157,6 +157,9 @@ class TestEverything(unittest.TestCase): # test that there are no duplicates returned self.assertEqual(len(attr_list), len(set(attr_list))) + def test_ptrarray(self): + self.assertEquals (Everything.test_garray_container_return(), ['regress']) + class TestNullableArgs(unittest.TestCase): def test_in_nullable_hash(self): Everything.test_ghash_null_in(None) @@ -472,3 +475,11 @@ class TestAdvancedInterfaces(unittest.TestCase): self.assertTrue(isinstance(obj1, Everything.TestObj)) self.assertTrue(isinstance(obj2, Everything.TestObj)) self.assertNotEqual(obj1, obj2) + + def test_obj_skip_return_val(self): + obj = Everything.TestObj(); + ret = obj.skip_return_val(50, 42.0, 60, 2, 3); + self.assertEquals(len(ret), 3); + self.assertEquals(ret[0], 51); + self.assertEquals(ret[1], 61); + self.assertEquals(ret[2], 32); diff --git a/tests/test_gi.py b/tests/test_gi.py index dddc6fb..c84ca23 100644 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -703,6 +703,14 @@ class TestArray(unittest.TestCase): object_ = GIMarshallingTests.Object() self.assertEquals([-1, 0, 1, 2], object_.method_array_return()) + def test_array_fixed_out_struct(self): + struct1, struct2 = GIMarshallingTests.array_fixed_out_struct() + + self.assertEquals(7, struct1.long_) + self.assertEquals(6, struct1.int8) + self.assertEquals(6, struct2.long_) + self.assertEquals(7, struct2.int8) + def test_array_zero_terminated_return(self): self.assertEquals(['0', '1', '2'], GIMarshallingTests.array_zero_terminated_return()) diff --git a/tests/test_gobject.py b/tests/test_gobject.py index dbbc5b7..eef9cf6 100644 --- a/tests/test_gobject.py +++ b/tests/test_gobject.py @@ -23,18 +23,11 @@ class TestReferenceCounting(unittest.TestCase): obj = GObject.new(GObject.GObject) self.assertEquals(obj.__grefcount__, 1) - def testFloatingWithSinkFunc(self): - obj = testhelper.FloatingWithSinkFunc() + def testFloating(self): + obj = testhelper.Floating() self.assertEquals(obj.__grefcount__, 1) - obj = GObject.new(testhelper.FloatingWithSinkFunc) - self.assertEquals(obj.__grefcount__, 1) - - def testFloatingWithoutSinkFunc(self): - obj = testhelper.FloatingWithoutSinkFunc() - self.assertEquals(obj.__grefcount__, 1) - - obj = GObject.new(testhelper.FloatingWithoutSinkFunc) + obj = GObject.new(testhelper.Floating) self.assertEquals(obj.__grefcount__, 1) def testOwnedByLibrary(self): diff --git a/tests/test_overrides.py b/tests/test_overrides.py index 427f4d1..2f25121 100644 --- a/tests/test_overrides.py +++ b/tests/test_overrides.py @@ -1246,6 +1246,63 @@ class TestGtk(unittest.TestCase): self.assertRaises(ValueError, tree_store.get, aiter, 1, 100) self.assertEqual(tree_store.get(aiter, 0, 1), (10, 'this is row #10')) + def test_tree_model_edit(self): + model = Gtk.ListStore(int, str, float) + model.append([1, "one", -0.1]) + model.append([2, "two", -0.2]) + + def set_row(value): + model[1] = value + + self.assertRaises(TypeError, set_row, 3) + self.assertRaises(TypeError, set_row, "three") + self.assertRaises(ValueError, set_row, []) + self.assertRaises(ValueError, set_row, [3, "three"]) + + model[0] = (3, "three", -0.3) + + def test_tree_row_slice(self): + model = Gtk.ListStore(int, str, float) + model.append([1, "one", -0.1]) + + self.assertEqual([1, "one", -0.1], model[0][:]) + self.assertEqual([1, "one"], model[0][:2]) + self.assertEqual(["one", -0.1], model[0][1:]) + self.assertEqual(["one"], model[0][1:-1]) + self.assertEqual([1], model[0][:-2]) + self.assertEqual([], model[0][5:]) + self.assertEqual([1, -0.1], model[0][0:3:2]) + + model[0][:] = (2, "two", -0.2) + self.assertEqual([2, "two", -0.2], model[0][:]) + + model[0][:2] = (3, "three") + self.assertEqual([3, "three", -0.2], model[0][:]) + + model[0][1:] = ("four", -0.4) + self.assertEqual([3, "four", -0.4], model[0][:]) + + model[0][1:-1] = ("five",) + self.assertEqual([3, "five", -0.4], model[0][:]) + + model[0][0:3:2] = (6, -0.6) + self.assertEqual([6, "five", -0.6], model[0][:]) + + def set_row1(): + model[0][5:] = ("doesn't", "matter",) + + self.assertRaises(ValueError, set_row1) + + def set_row2(): + model[0][:1] = (0, "zero", 0) + + self.assertRaises(ValueError, set_row2) + + def set_row3(): + model[0][:2] = ("0", 0) + + self.assertRaises(ValueError, set_row3) + def test_tree_view_column(self): cell = Gtk.CellRendererText() column = Gtk.TreeViewColumn(title='This is just a test', diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c index b242a34..592c503 100644 --- a/tests/testhelpermodule.c +++ b/tests/testhelpermodule.c @@ -224,11 +224,8 @@ static const GInterfaceInfo __TestInterface__iinfo = { NULL }; -/* TestFloatingWithSinkFunc */ -PYGLIB_DEFINE_TYPE("testhelper.FloatingWithSinkFunc", PyTestFloatingWithSinkFunc_Type, PyGObject); - -/* TestFloatingWithoutSinkFunc */ -PYGLIB_DEFINE_TYPE("testhelper.FloatingWithoutSinkFunc", PyTestFloatingWithoutSinkFunc_Type, PyGObject); +/* TestFloating */ +PYGLIB_DEFINE_TYPE("testhelper.Floating", PyTestFloating_Type, PyGObject); /* TestOwnedByLibrary */ PYGLIB_DEFINE_TYPE("testhelper.OwnedByLibrary", PyTestOwnedByLibrary_Type, PyGObject); @@ -563,29 +560,15 @@ PYGLIB_MODULE_START(testhelper, "testhelper") Py_BuildValue("(O)", &PyGObject_Type, &PyTestInterface_Type)); - pyg_set_object_has_new_constructor(TEST_TYPE_UNKNOWN); - //pyg_register_class_init(TEST_TYPE_UNKNOWN, __GtkUIManager_class_init); - - /* TestFloatingWithSinkFunc */ - PyTestFloatingWithSinkFunc_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); - PyTestFloatingWithSinkFunc_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); - PyTestFloatingWithSinkFunc_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); - pygobject_register_class(d, "FloatingWithSinkFunc", TEST_TYPE_FLOATING_WITH_SINK_FUNC, - &PyTestFloatingWithSinkFunc_Type, - Py_BuildValue("(O)", - &PyGObject_Type)); - pyg_set_object_has_new_constructor(TEST_TYPE_FLOATING_WITH_SINK_FUNC); - pygobject_register_sinkfunc(TEST_TYPE_FLOATING_WITH_SINK_FUNC, sink_test_floating_with_sink_func); - - /* TestFloatingWithoutSinkFunc */ - PyTestFloatingWithoutSinkFunc_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); - PyTestFloatingWithoutSinkFunc_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); - PyTestFloatingWithoutSinkFunc_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); - pygobject_register_class(d, "FloatingWithoutSinkFunc", TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC, - &PyTestFloatingWithoutSinkFunc_Type, + + /* TestFloating */ + PyTestFloating_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyTestFloating_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); + PyTestFloating_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); + pygobject_register_class(d, "Floating", TEST_TYPE_FLOATING, + &PyTestFloating_Type, Py_BuildValue("(O)", &PyGObject_Type)); - pyg_set_object_has_new_constructor(TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC); /* TestOwnedByLibrary */ PyTestOwnedByLibrary_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); @@ -596,7 +579,6 @@ PYGLIB_MODULE_START(testhelper, "testhelper") &PyTestOwnedByLibrary_Type, Py_BuildValue("(O)", &PyGObject_Type)); - pyg_set_object_has_new_constructor(TEST_TYPE_OWNED_BY_LIBRARY); /* TestFloatingAndSunk */ PyTestFloatingAndSunk_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); @@ -607,7 +589,6 @@ PYGLIB_MODULE_START(testhelper, "testhelper") &PyTestFloatingAndSunk_Type, Py_BuildValue("(O)", &PyGObject_Type)); - pyg_set_object_has_new_constructor(TEST_TYPE_FLOATING_AND_SUNK); } PYGLIB_MODULE_END