Commits

Yevgen Muntyan  committed ce4bb09

Tag PYGTK_2_22_0

  • Participants
  • Parent commits 65d0907

Comments (0)

Files changed (41)

 	PKG-INFO.in 				\
 	setup.py 				\
 	THREADS					\
+	README.win32					\
 	m4/jhflags.m4				\
 	m4/python.m4
 
+pygtk-2.22.0 25-Sep-2010
+    - Fix build with Python 2.5 (Chenthill)
+    - Add final GTK/GDK-2.22 API (John Stowers)
+    - Add missing GDK-2.18 API (John Stowers)
+
+pygtk-2.21.0 15-Jul-2010
+    - Bump version number so next stable release will be aligned with the
+      final gtk+-2.0 release (gtk+-2.22)
+    - Wrap new API added in GTK/GDK 2.21/2.22 (John Stowers)
+    - Wrap new API added in GTK/GDK 2.20 (John Stowers)
+    - Add forgotten API from GTK/GDK 2.12/14/16/18/20 (John Stowers)
+
+pygtk-2.17.0 26-Dec-2009
+    - Some docs improvements (Gian Mario)
+    - Wrap new API added in GTK/GDK 2.18 (Gian Mario)
+    - Release GIL in several gdk.Pixbuf methods (Paul, #591726)
+    - Fix override for gtk.TreeSortable.do_get_sorted_column_id (Paul)
+    - Make it possible to implement gtk.TreeSortable to some extent (Paul)
+    - Fix wrong gtk.gdk.color_from_hsv definition (Arun Raghavan, #594347)
+    - Plug memory leaks in a few Pango Cairo functions (Paul, #599730)
+    - Plug a huge leak in gtk.Widget.get_snapshot() (Benjamin Berg, #596612)
+    - Undeprecate gtk.Toolbar.(un)set_icon_size() again (Paul)
+
 pygtk-2.16.0 23-Aug-2009
     - Allow to use automake 1.11 (Paolo Borelli)
     - Remove compiler warnings (Gian)
 diffs which don't have any context, as these make it very difficult to
 see what the patch does.
 
-What's new in PyGTK 2.16
-========================
-
-See the wiki page for an overview of the features in PyGTK 2.16
-
-http://live.gnome.org/PyGTK/WhatsNew216
-
 New Versions
 ============
 
   2.12.x
   2.14.x
   2.16.x
+  2.18.x
 
 To include support for the 2.10 API you'll need GTK+ 2.10.0 etc.
 

File configure.ac

 
 dnl the pygtk version number
 m4_define(pygtk_major_version, 2)
-m4_define(pygtk_minor_version, 16)
+m4_define(pygtk_minor_version, 22)
 m4_define(pygtk_micro_version, 0)
 m4_define(pygtk_version, pygtk_major_version.pygtk_minor_version.pygtk_micro_version)
 
 m4_define(libglade_required_version,   2.5.0)
 m4_define(gtkunixprint_required_version,  2.9.0)
 m4_define(pycairo_required_version,    1.0.2) dnl or 1.1.7
-m4_define(pygobject_required_version,  2.16.1)
+m4_define(pygobject_required_version,  2.21.3)
 
 AC_INIT(pygtk, pygtk_version,
         [http://bugzilla.gnome.org/enter_bug.cgi?product=pygtk])
   AM_CONDITIONAL(HAVE_GTK_2_16, $have_gtk_216)
   AC_SUBST(HAVE_GTK_2_16)
   AC_DEFINE([HAVE_GTK_2_16], [$have_gtk_216], [If Gtk 2.16 was found])
+  
+  dnl check for gtk 2.18
+  PKG_CHECK_MODULES(GTK218, gtk+-2.0 >= 2.18.0,
+	  HAVE_GTK_218="yes", HAVE_GTK_218="no")
+
+  if test "x$HAVE_GTK_218" = "xyes"; then
+     gtk_version="2.18"
+     have_gtk_218=true
+     PYGTK_CODEGEN_DEFINES="$PYGTK_CODEGEN_DEFINES -DHAVE_GTK_2_18"
+  else
+     AC_MSG_RESULT(no)
+     have_gtk_218=false
+  fi
+
+  AM_CONDITIONAL(HAVE_GTK_2_18, $have_gtk_218)
+  AC_SUBST(HAVE_GTK_2_18)
+  AC_DEFINE([HAVE_GTK_2_18], [$have_gtk_218], [If Gtk 2.18 was found])
+
+  dnl check for gtk 2.20
+  PKG_CHECK_MODULES(GTK220, gtk+-2.0 >= 2.20.0,
+	  HAVE_GTK_220="yes", HAVE_GTK_220="no")
+
+  if test "x$HAVE_GTK_220" = "xyes"; then
+     gtk_version="2.20"
+     have_gtk_220=true
+     PYGTK_CODEGEN_DEFINES="$PYGTK_CODEGEN_DEFINES -DHAVE_GTK_2_20"
+  else
+     AC_MSG_RESULT(no)
+     have_gtk_220=false
+  fi
+
+  AM_CONDITIONAL(HAVE_GTK_2_20, $have_gtk_220)
+  AC_SUBST(HAVE_GTK_2_20)
+  AC_DEFINE([HAVE_GTK_2_20], [$have_gtk_220], [If Gtk 2.20 was found])
+
+  dnl check for gtk 2.22
+  PKG_CHECK_MODULES(GTK222, gtk+-2.0 >= 2.22.0,
+	  HAVE_GTK_222="yes", HAVE_GTK_222="no")
+
+  if test "x$HAVE_GTK_222" = "xyes"; then
+     gtk_version="2.22"
+     have_gtk_222=true
+     PYGTK_CODEGEN_DEFINES="$PYGTK_CODEGEN_DEFINES -DHAVE_GTK_2_22"
+  else
+     AC_MSG_RESULT(no)
+     have_gtk_222=false
+  fi
+
+  AM_CONDITIONAL(HAVE_GTK_2_22, $have_gtk_222)
+  AC_SUBST(HAVE_GTK_2_22)
+  AC_DEFINE([HAVE_GTK_2_22], [$have_gtk_222], [If Gtk 2.22 was found])
 
   dnl libglade
   PKG_CHECK_MODULES(LIBGLADE, [libglade-2.0 >= libglade_required_version],
   AM_CONDITIONAL(HAVE_GTK_2_10, false)
   AM_CONDITIONAL(HAVE_GTK_2_12, false)
   AM_CONDITIONAL(HAVE_GTK_2_14, false)
+  AM_CONDITIONAL(HAVE_GTK_2_16, false)
+  AM_CONDITIONAL(HAVE_GTK_2_18, false)
+  AM_CONDITIONAL(HAVE_GTK_2_20, false)
+  AM_CONDITIONAL(HAVE_GTK_2_22, false)
   AM_CONDITIONAL(BUILD_LIBGLADE, false)
   AM_CONDITIONAL(BUILD_GTKUNIXPRINT, false)
   have_pangocairo=false

File docs/reference/ChangeLog

+2010-09-10  Rafael Villar Burke  <pachi@rvburke.com>
+
+		* pygtk-gtkcurve.xml: fix swapped get_vector/set_vector names
+
+2010-04-09  Rafael Villar Burke  <pachi@rvburke.com>
+
+	Bug 615270 - Website typo in docs for gtk.Buildable
+
+		* pygtk-gtkbuildable.xml: fix a small typo in class name.
+
 2009-03-20  Gian Mario Tagliaretti  <gianmt@gnome.org>
 
-	Bug 575604  typo in gtk.AccelGroup.connect_group
+	Bug 575604 ¿ typo in gtk.AccelGroup.connect_group
 
 	* pygtk-gtkaccelgroup.xml: fix a small typo in method name.
 
 2009-03-09  Gian Mario Tagliaretti  <gianmt@gnome.org>
 
-	Bug 574640  gtk.FileChooserButton "file-set" signal is not documented
+	Bug 574640 ¿ gtk.FileChooserButton "file-set" signal is not documented
 
 	* pygtk-gtkfilechooserbutton.xml: Add "file-set" signal.
 
 
 2009-02-23  Gian Mario Tagliaretti  <gianmt@gnome.org>
 	
-	Bug 567736  Misleading suggestion of get_child_requisition in
+	Bug 567736 ¿ Misleading suggestion of get_child_requisition in
 	gtk.Widget.size_request documentation
 
 	* pygtk-gtkwidget.xml: Apply a patch from Pietro Battiston
 
 2008-11-17  Gian Mario Tagliaretti  <gianmt@gnome.org>
 
-	Bug 561210  Change documentation of clicked event
+	Bug 561210 ¿ Change documentation of clicked event
 	
 	* pygtk-gtkbutton.xml: fix #561210.
 
 2008-11-17  Gian Mario Tagliaretti  <gianmt@gnome.org>
 
-	Bug 560509  The documentation for gtk.ComboBox does not include the
+	Bug 560509 ¿ The documentation for gtk.ComboBox does not include the
 	signals "popup", "popdown" and "move-active"
 	
 	* pygtk-gtkcombobox.xml: fix the above bug and update to 2.14 release.
 
 2008-09-26  Paul Pogonyshev  <pogonyshev@gmx.net>
 
-	Bug 553921  Incorrect callback signature of gtk.TextBuffers'
+	Bug 553921 ¿ Incorrect callback signature of gtk.TextBuffers'
 	"mark-set" signal
 
 	* pygtk-gtktextbuffer.xml (mark-set): Fix signature documentation.
 
 2008-09-22  Gian Mario Tagliaretti  <gianmt@gnome.org>
 
-	Bug 541510  pango.layout missing document on
+	Bug 541510 ¿ pango.layout missing document on
 	layout.get_font_description()
 
 	* pygtk-pangolayout.xml: add pango.Layout.get_font_description()
 
 2008-08-02  Paul Pogonyshev  <pogonyshev@gmx.net>
 
-	Bug 527212  types with well-defined equality semantics are not
+	Bug 527212 ¿ types with well-defined equality semantics are not
 	properly comparable
 
 	* pygtk-gdkcolor.xml: Document new constructor option.  Document

File docs/reference/pygtk-gdk-constants.xml

             <simpara>A window used to implement a desktop.</simpara>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><literal>gtk.gdk.WINDOW_TYPE_HINT_DROPDOWN_MENU</literal></term>
+          <listitem>
+            <simpara>A menu that belongs to a menubar.</simpara>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><literal>gtk.gdk.WINDOW_TYPE_HINT_POPUP_MENU</literal></term>
+          <listitem>
+            <simpara>A menu that does not belong to a menubar, e.g. a context menu.</simpara>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><literal>gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP</literal></term>
+          <listitem>
+            <simpara>A tooltip.</simpara>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><literal>gtk.gdk.WINDOW_TYPE_HINT_NOTIFICATION</literal></term>
+          <listitem>
+            <simpara>A notification - typically a "bubble" that belongs to a status icon.</simpara>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><literal>gtk.gdk.WINDOW_TYPE_HINT_COMBO</literal></term>
+          <listitem>
+            <simpara>A popup from a combo box.</simpara>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><literal>gtk.gdk.WINDOW_TYPE_HINT_DND</literal></term>
+          <listitem>
+            <simpara>A window that is used to implement a DND cursor.</simpara>
+          </listitem>
+        </varlistentry>
       </variablelist>
 
     </refsect2>

File docs/reference/pygtk-gdkkeymap.xml

 	<varlistentry>
 	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
 	  <listitem><simpara><literal>True</literal> if there are layouts in both directions,
-      <literal>FALSE</literal> otherwise.</simpara></listitem>
+	  <literal>False</literal> otherwise.</simpara></listitem>
 	</varlistentry>
       </variablelist>
 

File docs/reference/pygtk-gtkbuildable.xml

             <link linkend="class-gtkrecentchooserwidget"><classname>gtk.RecentChooserWidget</classname></link>,
             <link linkend="class-gtktoggletoolbutton"><classname>gtk.ToggleToolButton</classname></link>,
             <link linkend="class-gtkcombobox"><classname>gtk.ComboBox</classname></link>,
-            <link linkend="class-gtkvscrollbar"><classname>gtk.VScroolBar</classname></link>,
+            <link linkend="class-gtkvscrollbar"><classname>gtk.VScrollBar</classname></link>,
             <link linkend="class-gtkframe"><classname>gtk.Frame</classname></link>,
             <link linkend="class-gtkspinbutton"><classname>gtk.SpinButton</classname></link>,
             <link linkend="class-gtklabel"><classname>gtk.Label</classname></link>,

File docs/reference/pygtk-gtkcurve.xml

       <title>gtk.Curve.get_vector</title>
 
       <programlisting><methodsynopsis language="python">
-	  <methodname>set_vector</methodname>
+	  <methodname>get_vector</methodname>
 	  <methodparam><parameter
 			 role="keyword">size</parameter><initializer>-1</initializer></methodparam>
 	</methodsynopsis></programlisting>
       <title>gtk.Curve.set_vector</title>
 
       <programlisting><methodsynopsis language="python">
-	  <methodname>get_vector</methodname>
+	  <methodname>set_vector</methodname>
 	  <methodparam><parameter
 			 role="keyword">vector</parameter></methodparam>
 	</methodsynopsis></programlisting>

File docs/reference/pygtk-gtkdrawingarea.xml

     </itemizedlist>
 
     <para>See the <ulink
-url="../pygtk2tutorial/ch-DrawingArea.html">Drawing
+url="http://www.pygtk.org/pygtk2tutorial/ch-DrawingArea.html">Drawing
 Area</ulink> chapter in the tutorial for more information on using a <link
 linkend="class-gtkdrawingarea"><classname>gtk.DrawingArea</classname></link>.</para>
 

File docs/reference/pygtk-gtksettings.xml

               <entry>Read-Write</entry>
               <entry>Controls the direction of the sort indicators in sorted list
               and tree views. By default an arrow pointing down means the column
-              is sorted in ascending order. When set to TRUE, this order will be inverted.
-              Default value: <literal>FALSE</literal>
+              is sorted in ascending order. When set to <literal>True</literal>,
+              this order will be inverted. Default value: <literal>False</literal>.
               This property is available in GTK+ 2.12 and above.</entry>
             </row>
             

File docs/reference/pygtk-gtkstyle.xml

 	<methodparam><parameter
 		       role="keyword">stock_id</parameter></methodparam>
       </methodsynopsis>
+
+      <methodsynopsis language="python">
+	<methodname><link linkend="method-gtkstyle--lookup-color">lookup_color</link></methodname>
+	<methodparam><parameter role="keyword">color_name</parameter></methodparam>
+      </methodsynopsis>
+
       <methodsynopsis language="python">
 	<methodname><link
 linkend="method-gtkstyle--render-icon">render_icon</link></methodname>
 
     </refsect2>
 
+    <refsect2 id="method-gtkstyle--lookup-color">
+      <title>gtk.Style.lookup_color</title>
+
+      <programlisting><methodsynopsis language="python">
+	  <methodname>lookup_color</methodname>
+	  <methodparam><parameter role="keyword">color_name</parameter></methodparam>
+	</methodsynopsis></programlisting>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter role="keyword">color_name</parameter>&nbsp;:</term>
+	  <listitem><simpara>the name of the logical color to look up</simpara></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
+	  <listitem><simpara>a <link linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>
+	  on succes, <literal>None</literal> otherwise.</simpara></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <para>
+	The <methodname>lookup_color</methodname>() method looks up <parameter>color_name</parameter>
+	in the style's logical color mappings, filling in color and returning <literal>True</literal>
+	if found, otherwise returning <literal>Flase</literal>.
+	Do not cache the found mapping, because it depends on the GtkStyle and might
+	change when a theme switch occurs.
+      </para>
+
+    </refsect2>
+
     <refsect2 id="method-gtkstyle--render-icon">
       <title>gtk.Style.render_icon</title>
 

File docs/reference/pygtk-gtktoolbar.xml

 	</varlistentry>
       </variablelist>
 
-      <warning>
-	<para>This method is deprecated in PyGTK 2.4 and above</para>
-      </warning>
-
       <para>The <methodname>set_icon_size</methodname>() method sets the
 size of stock icons in the toolbar to the value specified by
 <parameter>icon_size</parameter>. The value of
 	  <methodname>unset_icon_size</methodname>
 	  <methodparam></methodparam>  </methodsynopsis></programlisting>
 
-      <warning>
-	<para>This method is deprecated in PyGTK 2.4 and above</para>
-      </warning>
-
       <para>The <methodname>unset_icon_size</methodname>() method unsets
 toolbar icon size set with the <link
 linkend="method-gtktoolbar--set-icon-size"><methodname>set_icon_size</methodname>()</link>, 

File docs/reference/pygtk-gtkwidget.xml

                 <variablelist>
                     <varlistentry>
                         <term><emphasis>Returns</emphasis>&nbsp;:</term>
-                        <listitem><simpara>the widget's <link linkend="class-gtkwindow"><classname>gtk.Window</classname>
+                        <listitem><simpara>the widget's <link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname>
                         </link>.</simpara></listitem>
                     </varlistentry>
                 </variablelist>

File examples/Makefile.am

 	pygtk-demo/demos/tree_store.py		\
 	pygtk-demo/demos/treemodel.py		\
 	pygtk-demo/demos/statusicon.py		\
-	pygtk-demo/demos/ui_manager.py
+	pygtk-demo/demos/ui_manager.py		\
+	pygtk-demo/demos/infobar.py
 
 demoimg_DATA = \
 	pygtk-demo/demos/images/alphatest.png		\

File gtk/Makefile.am

 	gtk-2.16.defs		\
 	gtk-2.16-types.defs
 
+GTK_2_18_DEFS =
+	gdk-2.18.defs		\
+	gtk-2.18.defs		\
+	gtk-2.18-types.defs
+
+GTK_2_20_DEFS =
+	gdk-2.20.defs		\
+	gtk-2.20.defs		\
+	gtk-2.20-types.defs	\
+	gtkunixprint-2.20.defs
+
+GTK_2_22_DEFS =
+	gdk-2.22.defs		\
+	gtk-2.22.defs		\
+	gtk-2.22-types.defs
+
 if HAVE_GTK_2_10
 GDK_DEFS += gdk-2.10.defs 
 GTK_DEFS += gtk-2.10.defs 
 GTK_TYPES_DEFS += gtk-2.16-types.defs
 endif
 
+if HAVE_GTK_2_18
+GDK_DEFS += gdk-2.18.defs 
+GTK_DEFS += gtk-2.18.defs 
+GTK_TYPES_DEFS += gtk-2.18-types.defs
+endif
+
+if HAVE_GTK_2_20
+GDK_DEFS += gdk-2.20.defs 
+GTK_DEFS += gtk-2.20.defs 
+GTK_TYPES_DEFS += gtk-2.20-types.defs
+endif
+
+if HAVE_GTK_2_22
+GDK_DEFS += gdk-2.22.defs
+GTK_DEFS += gtk-2.22.defs
+GTK_TYPES_DEFS += gtk-2.22-types.defs
+endif
+
 CREATEDEFS = $(PYTHON) $(CODEGENDIR)/createdefs.py
 
 GDK_OVERRIDES = \
 	$(GTK_2_10_DEFS)	\
 	$(GTK_2_12_DEFS)	\
 	$(GTK_2_14_DEFS)	\
-        $(GTK_2_16_DEFS)	\
+	$(GTK_2_16_DEFS)	\
+	$(GTK_2_18_DEFS)	\
+	$(GTK_2_20_DEFS)	\
+	$(GTK_2_22_DEFS)	\
 	$(GTK_OVERRIDES)
 
 

File gtk/gdk-2.14.defs

 
 
 
+;; From gdk-pixbuf-core.h
+
+(define-function pixbuf_new_from_stream
+  (c-name "gdk_pixbuf_new_from_stream")
+  (return-type "GdkPixbuf*")
+  (parameters
+    '("GInputStream*" "stream")
+    '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
+    '("GError**" "error")
+  )
+)
+
+(define-function pixbuf_new_from_stream_at_scale
+  (c-name "gdk_pixbuf_new_from_stream_at_scale")
+  (return-type "GdkPixbuf*")
+  (parameters
+    '("GInputStream*" "stream")
+    '("gint" "width" (default "-1"))
+    '("gint" "height" (default "-1"))
+    '("gboolean" "preserve_aspect_ratio" (default "1"))
+    '("GCancellable*" "cancellable" (null-ok) (default "NULL"))
+    '("GError**" "error")
+  )
+)
+
+
 (ifdef GDK_TARGET_X11
  
 ;; From gdkx.h

File gtk/gdk-base.defs

 
 (define-method unref
   (of-object "GdkGC")
-  (c-name "gdk_gc_unref")
+  (c-name "g_object_unref")
   (return-type "none")
 )
 
   (of-object "GdkPixbuf")
   (c-name "gdk_pixbuf_rotate_simple")
   (return-type "GdkPixbuf*")
+  (unblock-threads #t)
   (parameters
     '("int" "angle")
   )
   (of-object "GdkPixbuf")
   (c-name "gdk_pixbuf_saturate_and_pixelate")
   (return-type "none")
+  (unblock-threads #t)
   (parameters
     '("GdkPixbuf*" "dest")
     '("gfloat" "saturation")
   (of-object "GdkPixbuf")
   (c-name "gdk_pixbuf_scale")
   (return-type "none")
+  (unblock-threads #t)
   (parameters
     '("GdkPixbuf*" "dest")
     '("int" "dest_x")
   (of-object "GdkPixbuf")
   (c-name "gdk_pixbuf_composite")
   (return-type "none")
+  (unblock-threads #t)
   (parameters
     '("GdkPixbuf*" "dest")
     '("int" "dest_x")
   (of-object "GdkPixbuf")
   (c-name "gdk_pixbuf_composite_color")
   (return-type "none")
+  (unblock-threads #t)
   (parameters
     '("GdkPixbuf*" "dest")
     '("int" "dest_x")
   (c-name "gdk_pixbuf_scale_simple")
   (caller-owns-return #t)
   (return-type "GdkPixbuf*")
+  (unblock-threads #t)
   (parameters
     '("int" "dest_width")
     '("int" "dest_height")
   (c-name "gdk_pixbuf_composite_color_simple")
   (caller-owns-return #t)
   (return-type "GdkPixbuf*")
+  (unblock-threads #t)
   (parameters
     '("int" "dest_width")
     '("int" "dest_height")
   (of-object "GdkPixbuf")
   (c-name "gdk_pixbuf_flip")
   (return-type "GdkPixbuf*")
+  (unblock-threads #t)
   (parameters
     '("gboolean" "horizontal")
   )

File gtk/gdk.override

 import pango.Renderer as PyPangoRenderer_Type
 import gio.AppLaunchContext as PyGAppLaunchContext_Type for GAppLaunchContext
 import gio.Icon as PyGIcon_Type for GIcon
+import gio.InputStream as PyGInputStream_Type
+import gio.Cancellable as PyGCancellable_Type
 %%
 ignore
   gdk_window_set_debug_updates
     ret = Py_BuildValue("(NN)",
                         pygobject_new((GObject *)pixmap),
                         pygobject_new((GObject *)mask));
-    gdk_pixmap_unref(pixmap);
-    gdk_bitmap_unref(mask);
+    g_object_unref(pixmap);
+    g_object_unref(mask);
     return ret;
 }
 %%
     ret = Py_BuildValue("(NN)",
                         pygobject_new((GObject *)pixmap),
                         pygobject_new((GObject *)mask));
-    gdk_pixmap_unref(pixmap);
-    gdk_bitmap_unref(mask);
+    g_object_unref(pixmap);
+    g_object_unref(mask);
     return ret;
 }
 %%
     ret = Py_BuildValue("(NN)",
                         pygobject_new((GObject *)pixmap),
                         pygobject_new((GObject *)mask));
-    gdk_pixmap_unref(pixmap);
-    gdk_bitmap_unref(mask);
+    g_object_unref(pixmap);
+    g_object_unref(mask);
     return ret;
 }
 %%
     ret = Py_BuildValue("(NN)",
                         pygobject_new((GObject *)pixmap),
                         pygobject_new((GObject *)mask));
-    gdk_pixmap_unref(pixmap);
-    gdk_bitmap_unref(mask);
+    g_object_unref(pixmap);
+    g_object_unref(mask);
     return ret;
 }
 %%

File gtk/gdkcairo.override

     return Py_None;
 }
 
+static PyObject *
+_wrap_gdk_cairo_reset_clip(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "cr", "drawable", NULL };
+    PyGObject *drawable;
+    PycairoContext *cr;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!O!:gtk.gdk.CairoContext.reset_clip", kwlist,
+				     &PycairoContext_Type, &cr, &PyGdkDrawable_Type,
+				     &drawable))
+        return NULL;
+    
+    gdk_cairo_reset_clip(cr->ctx, GDK_DRAWABLE(drawable->obj));
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
 #if GTK_CHECK_VERSION(2, 9, 3)
 static PyObject *
 _wrap_gdk_cairo_set_source_pixmap(PyObject *self, PyObject *args,
     { "set_source_color", (PyCFunction)_wrap_gdk_cairo_set_source_color, METH_VARARGS|METH_KEYWORDS },
     { "rectangle", (PyCFunction)_wrap_gdk_cairo_rectangle, METH_VARARGS|METH_KEYWORDS },
     { "region", (PyCFunction)_wrap_gdk_cairo_region, METH_VARARGS|METH_KEYWORDS },
+    { "reset_clip", (PyCFunction)_wrap_gdk_cairo_reset_clip, METH_VARARGS|METH_KEYWORDS },
 #if GTK_CHECK_VERSION(2, 9, 3)
     { "set_source_pixmap", (PyCFunction)_wrap_gdk_cairo_set_source_pixmap, METH_VARARGS|METH_KEYWORDS },
 #endif
   gdk_cairo_rectangle
   gdk_cairo_region
   gdk_cairo_set_source_pixmap
+  gdk_cairo_reset_clip
 
 %%
 init

File gtk/gdkcolor.override

 }
 
 %%
-define color_from_hsv
+define color_from_hsv kwargs
 static PyObject *
 _wrap_color_from_hsv (PyObject *ignored, PyObject *args, PyObject*kwargs)
 {

File gtk/gdkgc.override

     }
     gc = gdk_gc_new_with_values(GDK_DRAWABLE(self->obj), &values, mask);
     pygc = pygobject_new((GObject *)gc);
-    gdk_gc_unref(gc);
+    g_object_unref(gc);
     return pygc;
 }
 %%

File gtk/gdkpixbuf.override

 
     if (pixmap) {
         pypixmap = pygobject_new((GObject *) pixmap);
-        gdk_pixmap_unref(pixmap);
+        g_object_unref(pixmap);
     } else {
         Py_INCREF(Py_None);
         pypixmap = Py_None;

File gtk/gtk-2.12.defs

   (return-type "GQuark")
 )
 
+(define-function gtk_builder_error_get_type
+  (c-name "gtk_builder_error_get_type")
+  (return-type "GType")
+)
+
 (define-function gtk_builder_get_type
   (c-name "gtk_builder_get_type")
   (return-type "GType")
     '("const-gchar*" "startup_id")
   )
 )
+
+;; From gtkbindingentry.h
+
+(define-function gtk_binding_entry_skip
+  (c-name "gtk_binding_entry_skip")
+  (return-type "none")
+  (parameters
+    '("GtkBindingSet*" "binding_set")
+    '("guint" "keyval")
+    '("GdkModifierType" "modifiers")
+  )
+)
+

File gtk/gtk-2.14.defs

   (return-type "gint")
 )
 
+;
+; RuntimeError: write_return not implemented for UCharArg
+;
 ;(define-method get_data
 ;  (of-object "GtkSelectionData")
 ;  (c-name "gtk_selection_data_get_data")
 
 ;; From gtktoolshell.h
 
+(define-function gtk_tool_shell_get_type
+  (c-name "gtk_tool_shell_get_type")
+  (return-type "GType")
+)
+
 (define-method get_icon_size
   (of-object "GtkToolShell")
   (c-name "gtk_tool_shell_get_icon_size")
   (return-type "none")
 )
 
-
-
 ;; From gtktreeselection.h
 
 (define-method get_select_function
   (of-object "GtkWidget")
   (c-name "gtk_widget_get_snapshot")
   (return-type "GdkPixmap*")
+  (caller-owns-return #t)
   (parameters
     '("GdkRectangle*" "clip_rect" (null-ok) (default "NULL"))
   )
   (c-name "gtk_window_group_list_windows")
   (return-type "GList*")
 )
+
+;; From gtklinkbutton.h
+
+(define-method get_visited
+  (of-object "GtkLinkButton")
+  (c-name "gtk_link_button_get_visited")
+  (return-type "gboolean")
+)
+
+(define-method set_visited
+  (of-object "GtkLinkButton")
+  (c-name "gtk_link_button_set_visited")
+  (return-type "none")
+  (parameters
+    '("gboolean" "visited")
+  )
+)

File gtk/gtk-2.16.defs

   (return-type "none")
 )
 
+(define-method set_icon_drag_source
+  (of-object "GtkEntry")
+  (c-name "gtk_entry_set_icon_drag_source")
+  (return-type "none")
+  (parameters
+    '("GtkEntryIconPosition" "icon_pos")
+    '("GtkTargetList*" "target_list")
+    '("GdkDragAction" "actions")
+  )
+)
+
+(define-method get_current_icon_drag_source
+  (of-object "GtkEntry")
+  (c-name "gtk_entry_get_current_icon_drag_source")
+  (return-type "gint")
+)
 
 
 ;; From gtkimagemenuitem.h

File gtk/gtk-base-types.defs

   )
 )
 
+;; Note: deliberately lacking type, as these don't make a real enum.
+(define-enum SortColumnId
+  (in-module "Gtk")
+  (values
+    '("default" "GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID")
+    '("unsorted" "GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID")
+  )
+)
+
 (define-enum SortType
   (in-module "Gtk")
   (c-name "GtkSortType")

File gtk/gtk-base.defs

     '("gint" "width")
     '("gint" "height")
   )
+  (deprecated "")
 )
 
 (define-method draw_option

File gtk/gtk-types.c

     if (self == NULL)
 	return NULL;
     self->obj = win;
-    gdk_window_ref(self->obj);
+    g_object_ref(self->obj);
     return (PyObject *)self;
 }
 #endif
 static void
 PyGdkWindow_Dealloc(PyGdkWindow_Object *self)
 {
-    if (gdk_window_get_type(self->obj) == GDK_WINDOW_PIXMAP)
-	gdk_pixmap_unref(self->obj);
+    if (gdk_drawable_get_type(self->obj) == GDK_WINDOW_PIXMAP)
+	g_object_unref(self->obj);
     else
-	gdk_window_unref(self->obj);
+	g_object_unref(self->obj);
     PyObject_DEL(self);
 }
 
 PyGdkWindow_Repr(PyGdkWindow_Object *self)
 {
     char buf[100];
-    if (gdk_window_get_type(self->obj) == GDK_WINDOW_PIXMAP)
+    if (gdk_drawable_get_type(self->obj) == GDK_WINDOW_PIXMAP)
 	sprintf(buf, "<GdkPixmap at %lx>", (long)PyGdkWindow_Get(self));
     else
 	sprintf(buf, "<GdkWindow at %lx>", (long)PyGdkWindow_Get(self));
 	return NULL;
     gc = gdk_gc_new_with_values(PyGdkWindow_Get(self), &values, mask);
     value = PyGdkGC_New(gc);
-    gdk_gc_unref(gc);
+    g_object_unref(gc);
     return value;
 }
 
 			     "height", "parent", "pointer", "pointer_state",
 			     "toplevel", "type", "width", "x", "xid", "y");
     if (!strcmp(key, "width")) {
-	gdk_window_get_size(win, &x, NULL);
+	gdk_drawable_get_size(win, &x, NULL);
 	return PyInt_FromLong(x);
     }
     if (!strcmp(key, "height")) {
-	gdk_window_get_size(win, NULL, &y);
+	gdk_drawable_get_size(win, NULL, &y);
 	return PyInt_FromLong(y);
     }
     if (!strcmp(key, "x")) {
 	return PyInt_FromLong(y);
     }
     if (!strcmp(key, "colormap"))
-	return PyGdkColormap_New(gdk_window_get_colormap(win));
+	return PyGdkColormap_New(gdk_drawable_get_colormap(win));
     if (!strcmp(key, "pointer")) {
 	gdk_window_get_pointer(win, &x, &y, NULL);
 	return Py_BuildValue("(ii)", x, y);
 	return ret;
     }
     if (!strcmp(key, "type"))
-	return PyInt_FromLong(gdk_window_get_type(win));
+	return PyInt_FromLong(gdk_drawable_get_type(win));
     if (!strcmp(key, "depth")) {
 	gdk_window_get_geometry(win, NULL, NULL, NULL, NULL, &x);
 	return PyInt_FromLong(x);

File gtk/gtk.override

 #define NO_IMPORT_PYGOBJECT
 #include "pygobject.h"
 
+#include <fcntl.h>
 #include <locale.h>
 
 #include <gtk/gtk.h>
 
   /* This code (pygtk main watch) was copied with minor changes from
    * pygobject/gobject/pygmainloop.c */
+
+static int pipe_fds[2];
+
 typedef struct {
     GSource source;
-    int fds[2];
     GPollFD fd;
 } PySignalWatchSource;
 
 static gboolean
 pygtk_main_watch_prepare(GSource *source,
-			 int     *timeout)
+                         int     *timeout)
 {
     /* Python only invokes signal handlers from the main thread,
      * so if a thread other than the main thread receives the signal
      * do nothing.
      */
 
+#ifdef HAVE_PYSIGNAL_SETWAKEUPFD
+    return FALSE;
+#else /* !HAVE_PYSIGNAL_SETWAKEUPFD */
     /* On Windows g_poll() won't be interrupted by a signal
      * (AFAIK), so we need the timeout there too, even if there's
      * only one thread.
      */
 #ifndef PLATFORM_WIN32
     if (!pyg_threads_enabled)
-	return FALSE;
-#endif
-
-#ifdef HAVE_PYSIGNAL_SETWAKEUPFD
-    {
-        PySignalWatchSource *real_source = (PySignalWatchSource *)source;
-
-        if (real_source->fds[0] != 0)
-            return FALSE;
-
-        /* Unfortunately we need to create a new pipe here instead of
-         * reusing the pipe inside the GMainContext.  Ideally an api
-         * should be added to GMainContext which allows us to reuse
-         * that pipe which would suit us perfectly fine.
-         */
-        if (pipe(real_source->fds) < 0)
-            g_error("Cannot create main loop pipe: %s\n",
-                    g_strerror(errno));
-
-        real_source->fd.fd = real_source->fds[0];
-        real_source->fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
-        g_source_add_poll(source, &real_source->fd);
-
-        PySignal_SetWakeupFd(real_source->fds[1]);
-    }
-#else /* !HAVE_PYSIGNAL_SETWAKEUPFD */
+        return FALSE;
+#endif /* PLATFORM_WIN32 */
+
     /* If we're using 2.5 or an earlier version of python we
      * will default to a timeout every second, be aware,
      * this will cause unnecessary wakeups, see
      * http://bugzilla.gnome.org/show_bug.cgi?id=481569
      */
     *timeout = 1000;
+    return FALSE;
 #endif /* HAVE_PYSIGNAL_SETWAKEUPFD */
-
-    return FALSE;
 }
 
 static gboolean
 {
     PyGILState_STATE state;
 
+#ifdef HAVE_PYSIGNAL_SETWAKEUPFD
+    PySignalWatchSource *real_source = (PySignalWatchSource *)source;
+    GPollFD *poll_fd = &real_source->fd;
+    int data_size = 0;
+    if (poll_fd->revents & G_IO_IN)
+        data_size = read(poll_fd->fd, 0, 1);
+#endif
+
     state = pyg_gil_state_ensure();
 
     if (PyErr_CheckSignals() == -1 && gtk_main_level() > 0) {
-	PyErr_SetNone(PyExc_KeyboardInterrupt);
-	gtk_main_quit();
+        PyErr_SetNone(PyExc_KeyboardInterrupt);
+        gtk_main_quit();
     }
 
     pyg_gil_state_release(state);
     return TRUE;
 }
 
-static void
-pygtk_main_watch_finalize(GSource *source)
-{
-    PySignalWatchSource *real_source = (PySignalWatchSource*)source;
-
-    if (source != NULL) {
-	if (real_source->fds[0] != 0)
-	    close(real_source->fds[0]);
-	
-	if (real_source->fds[1] != 0) {
-#if HAVE_PYSIGNAL_SETWAKEUPFD
-            int  wakeup_fd = PySignal_SetWakeupFd(-1);
-            if (wakeup_fd != real_source->fds[1]) {
-                /* Probably should never happen. */
-                PySignal_SetWakeupFd(wakeup_fd);
-            }
-#endif
-
-            close(real_source->fds[1]);
-        }
-    }
-}
-
 static GSourceFuncs pygtk_main_watch_funcs =
 {
     pygtk_main_watch_prepare,
     pygtk_main_watch_check,
-    pygtk_main_watch_dispatch,
-    pygtk_main_watch_finalize
+    pygtk_main_watch_dispatch
 };
 
 static GSource *
 pygtk_main_watch_new(void)
 {
-    return g_source_new(&pygtk_main_watch_funcs, sizeof(PySignalWatchSource));
+    GSource *source = g_source_new(&pygtk_main_watch_funcs, sizeof(PySignalWatchSource));
+
+#ifdef HAVE_PYSIGNAL_SETWAKEUPFD
+    PySignalWatchSource *real_source = (PySignalWatchSource *)source;
+    int flag;
+
+    /* Unfortunately we need to create a new pipe here instead of
+     * reusing the pipe inside the GMainContext.
+     * Ideally an api should be added to GMainContext which allows us
+     * to reuse that pipe which would suit us perfectly fine.
+     * XXX More efficient than a pipe, we could use an eventfd on Linux
+     * kernels that support it.
+     */
+    gint already_piped = (pipe_fds[0] > 0);
+    if (!already_piped) {
+	if (pipe(pipe_fds) < 0)
+	    g_error("Cannot create main loop pipe: %s\n",
+	            g_strerror(errno));
+
+        /* Make the write end of the fd non blocking */
+        flag = fcntl(pipe_fds[1], F_GETFL, 0);
+        flag |= O_NONBLOCK;
+        fcntl(pipe_fds[1], F_SETFL, flag);
+    }
+
+    real_source->fd.fd = pipe_fds[0];
+    real_source->fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
+    g_source_add_poll(source, &real_source->fd);
+
+    if (!already_piped)
+      PySignal_SetWakeupFd(pipe_fds[1]);
+#endif
+    return source;
 }
 
 
                                            PyObject *kwargs)
 {
     static char *kwlist[] = { "app_name", NULL };
-    gchar *app_name, *app_exec = NULL;
+    gchar *app_name;
+    const gchar *app_exec = NULL;
     gboolean ret;
     PyObject *py_ret;
     guint count = 0;
     /* pygobject_new handles NULL checking */
     return pygobject_new((GObject *)ret);
 }
+%%
+override gtk_hsv_get_color noargs
+static PyObject *
+_wrap_gtk_hsv_get_color(PyGObject *self)
+{
+    gdouble h, s, v;
+
+    gtk_hsv_get_color(GTK_HSV(self->obj), &h, &s, &v);
+
+    return Py_BuildValue("(ddd)", h, s, v);
+}
+%%
+override gtk_hsv_get_metrics noargs
+static PyObject *
+_wrap_gtk_hsv_get_metrics(PyGObject *self)
+{
+    gint size, ring_width;
+
+    gtk_hsv_get_metrics(GTK_HSV(self->obj), &size, &ring_width);
+
+    return Py_BuildValue("(ii)", size, ring_width);
+}
+%%
+override gtk_hsv_to_rgb kwargs
+static PyObject *
+_wrap_gtk_hsv_to_rgb(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "h", "s", "v", NULL };
+    gdouble h=0, s=0, v=0;
+    gdouble r, g, b;
+    
+    if (!PyArg_ParseTupleAndKeywords(args,kwargs,
+                                     "ddd:gtk.hsv_to_rgb",
+                                     kwlist, &h, &s, &v))
+        return NULL;
+    
+    gtk_hsv_to_rgb(h, s, v, &r, &g, &b);
+
+    return Py_BuildValue("(ddd)", r, g, b);
+}
+%%
+override gtk_cell_renderer_get_alignment noargs
+static PyObject *
+_wrap_gtk_cell_renderer_get_alignment(PyGObject *self)
+{
+    gfloat xalign, yalign;
+
+    gtk_cell_renderer_get_alignment(GTK_CELL_RENDERER(self->obj),
+                                    &xalign, &yalign);
+
+    return Py_BuildValue("(dd)", xalign, yalign);
+}
+%%
+override gtk_cell_renderer_get_padding noargs
+static PyObject *
+_wrap_gtk_cell_renderer_get_padding(PyGObject *self)
+{
+    gint xpad, ypad;
+
+    gtk_cell_renderer_get_padding(GTK_CELL_RENDERER(self->obj), &xpad, &ypad);
+
+    return Py_BuildValue("(ii)", xpad, ypad);
+}
+%%
+override gtk_widget_set_allocation kwargs
+static PyObject *
+_wrap_gtk_widget_set_allocation(PyGObject *self,
+                                PyObject *args,
+                                PyObject *kwargs)
+{
+    static char *kwlist[] = { "allocation", NULL };
+    PyObject *py_allocation;
+    GdkRectangle allocation = { 0, 0, 0, 0 };
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:Gtk.Widget.set_allocation",
+                                     kwlist, &py_allocation))
+        return NULL;
+
+    if (!pygdk_rectangle_from_pyobject(py_allocation, &allocation))
+        return NULL;
+    
+    gtk_widget_set_allocation(GTK_WIDGET(self->obj), &allocation);
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gtk_clipboard_wait_for_uris noargs
+static PyObject *
+_wrap_gtk_clipboard_wait_for_uris(PyGObject *self)
+{
+    gchar **uris = NULL, **tmp;
+    PyObject *ret;
+    int i = 0, j;
+
+    uris = gtk_clipboard_wait_for_uris(GTK_CLIPBOARD(self->obj));
+
+    if (uris) {
+        tmp = uris;
+        while (*tmp)
+            tmp++, i++;
+
+        ret = PyTuple_New(i);
+        for (j = 0; j < i; j++)
+            PyTuple_SetItem(ret, j, PyString_FromString(uris[j]));
+
+        g_strfreev(uris);
+
+        return ret;
+    }
+    Py_INCREF(Py_None);
+    return Py_None;
+}

File gtk/gtkmodule.c

 };
 
 static void
-sink_gtkwindow(GObject *object)
-{
-    if (object->ref_count == 1
-	&& GTK_WINDOW(object)->has_user_ref_count) {
-	g_object_ref(object);
-    }
-}
-
-static void
-sink_gtkinvisible(GObject *object)
-{
-    if (object->ref_count == 1
-	&& GTK_INVISIBLE(object)->has_user_ref_count) {
-	g_object_ref(object);
-    }
-}
-
-static void
-sink_gtkobject(GObject *object)
-{
-    if (GTK_OBJECT_FLOATING(object)) {
-	g_object_ref(object);
-	gtk_object_sink(GTK_OBJECT(object));
-    }
-}
-
-static void
 pygtk_add_stock_items(PyObject *d)
 {
     GSList *stock_ids, *cur;
     /* initialise pygtk */
     gtk_type_init(0);
 
-    pygobject_register_sinkfunc(GTK_TYPE_WINDOW, sink_gtkwindow);
-    pygobject_register_sinkfunc(GTK_TYPE_INVISIBLE, sink_gtkinvisible);
-    pygobject_register_sinkfunc(GTK_TYPE_OBJECT, sink_gtkobject);
-	
     m = Py_InitModule("gtk._gtk", pygtk_functions);
     d = PyModule_GetDict(m);
 

File gtk/gtktreeview.override

     return Py_None;
 }
 %%
+override GtkTreeSortable__do_get_sort_column_id kwargs
+static PyObject *
+_wrap_GtkTreeSortable__do_get_sort_column_id(PyObject *cls, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "self", NULL };
+    GtkTreeSortableIface *iface;
+    PyGObject *self;
+    gint sort_column_id;
+    GtkSortType order;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:gtk.TreeSortable.do_get_sort_column_id", kwlist, &PyGtkTreeSortable_Type, &self))
+        return NULL;
+    iface = g_type_interface_peek(g_type_class_peek(pyg_type_from_object(cls)), GTK_TYPE_TREE_SORTABLE);
+    if (iface->get_sort_column_id)
+        iface->get_sort_column_id(GTK_TREE_SORTABLE(self->obj), &sort_column_id, &order);
+    else {
+        PyErr_SetString(PyExc_NotImplementedError, "interface method gtk.TreeSortable.get_sort_column_id not implemented");
+        return NULL;
+    }
+
+    return Py_BuildValue("(iN)", sort_column_id, pyg_enum_from_gtype(GTK_TYPE_SORT_TYPE, order));
+}
+%%
+override GtkTreeSortable__proxy_do_get_sort_column_id
+static gboolean
+_wrap_GtkTreeSortable__proxy_do_get_sort_column_id(GtkTreeSortable *self, gint *sort_column_id, GtkSortType *order)
+{
+    PyGILState_STATE __py_state;
+    PyObject *py_self;
+    PyObject *py_retval;
+    PyObject *py_method;
+    gint py_sort_column_id;
+    PyObject *py_order;
+
+    __py_state = pyg_gil_state_ensure();
+    py_self = pygobject_new((GObject *) self);
+    if (!py_self) {
+        if (PyErr_Occurred())
+            PyErr_Print();
+        pyg_gil_state_release(__py_state);
+        return FALSE;
+    }
+    
+    py_method = PyObject_GetAttrString(py_self, "do_get_sort_column_id");
+    if (!py_method) {
+        if (PyErr_Occurred())
+            PyErr_Print();
+        Py_DECREF(py_self);
+        pyg_gil_state_release(__py_state);
+        return FALSE;
+    }
+    py_retval = PyObject_CallObject(py_method, NULL);
+    if (!py_retval) {
+        if (PyErr_Occurred())
+            PyErr_Print();
+        Py_XDECREF(py_retval);
+        Py_DECREF(py_method);
+        Py_DECREF(py_self);
+        pyg_gil_state_release(__py_state);
+        return FALSE;
+    }
+    if (!PyArg_ParseTuple(py_retval, "iO", &py_sort_column_id, &py_order)) {
+        PyErr_Print();
+        Py_XDECREF(py_retval);
+        Py_DECREF(py_method);
+        Py_DECREF(py_self);
+        pyg_gil_state_release(__py_state);
+        return FALSE;
+    }
+    if (sort_column_id)
+        *sort_column_id = py_sort_column_id;
+    if (order && pyg_enum_get_value(GTK_TYPE_SORT_TYPE, py_order, (gint *) order)) {
+        PyErr_Print();
+        Py_XDECREF(py_retval);
+        Py_DECREF(py_method);
+        Py_DECREF(py_self);
+        pyg_gil_state_release(__py_state);
+        return FALSE;
+    }
+
+    Py_XDECREF(py_retval);
+    Py_DECREF(py_method);
+    Py_DECREF(py_self);
+    pyg_gil_state_release(__py_state);
+
+    return py_order >= 0;
+}
+%%
+override GtkTreeSortable__do_set_sort_func
+static PyObject *
+_wrap_GtkTreeSortable__do_set_sort_func(PyObject *cls, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "self", "sort_column_id", "func", "user_data", NULL };
+    GtkTreeSortableIface *iface;
+    PyGObject *self;
+    gint sort_column_id;
+    PyObject *func;
+    PyObject *user_data;
+    PyGtkCustomNotify *func_wrapper;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!iO|O:gtk.TreeSortable.do_set_sort_func", kwlist,
+                                     &PyGtkTreeSortable_Type, &self,
+                                     &sort_column_id, &func, &user_data))
+        return NULL;
+
+    if (!PyCallable_Check(func)) {
+        PyErr_SetString(PyExc_TypeError, "func must be a callable object");
+        return NULL;
+    }
+
+    iface = g_type_interface_peek(g_type_class_peek(pyg_type_from_object(cls)), GTK_TYPE_TREE_SORTABLE);
+    if (!iface->set_sort_func) {
+        PyErr_SetString(PyExc_NotImplementedError,
+                        "interface method gtk.TreeSortable.set_sort_func not implemented");
+        return NULL;
+    }
+
+    func_wrapper = g_new(PyGtkCustomNotify, 1);
+    func_wrapper->func = func;
+    Py_INCREF(func_wrapper->func);
+    func_wrapper->data = user_data;
+    Py_XINCREF(func_wrapper->data);
+
+    iface->set_sort_func(GTK_TREE_SORTABLE(self->obj), sort_column_id,
+                         pygtk_tree_sortable_sort_cb, func_wrapper, pygtk_custom_destroy_notify);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override GtkTreeSortable__do_set_default_sort_func
+static PyObject *
+_wrap_GtkTreeSortable__do_set_default_sort_func(PyObject *cls, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "self", "func", "user_data", NULL };
+    GtkTreeSortableIface *iface;
+    PyGObject *self;
+    PyObject *func;
+    PyObject *user_data;
+    PyGtkCustomNotify *func_wrapper;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "O!iO|O:gtk.TreeSortable.do_set_default_sort_func", kwlist,
+                                     &PyGtkTreeSortable_Type, &self,
+                                     &func, &user_data))
+        return NULL;
+
+    if (!PyCallable_Check(func)) {
+        PyErr_SetString(PyExc_TypeError, "func must be a callable object");
+        return NULL;
+    }
+
+    iface = g_type_interface_peek(g_type_class_peek(pyg_type_from_object(cls)), GTK_TYPE_TREE_SORTABLE);
+    if (!iface->set_default_sort_func) {
+        PyErr_SetString(PyExc_NotImplementedError,
+                        "interface method gtk.TreeSortable.set_default_sort_func not implemented");
+        return NULL;
+    }
+
+    func_wrapper = g_new(PyGtkCustomNotify, 1);
+    func_wrapper->func = func;
+    Py_INCREF(func_wrapper->func);
+    func_wrapper->data = user_data;
+    Py_XINCREF(func_wrapper->data);
+
+    iface->set_default_sort_func(GTK_TREE_SORTABLE(self->obj),
+                                 pygtk_tree_sortable_sort_cb, func_wrapper, pygtk_custom_destroy_notify);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override GtkTreeSortable__proxy_do_set_sort_func
+
+typedef struct {
+  GtkTreeIterCompareFunc func;
+  gpointer               data;
+  GDestroyNotify         destroy;
+} _PyGTKIterCompareFuncWrapper;
+
+static PyObject *
+_pygtk_tree_iter_compare_func_wrapper__call(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "model", "iter1", "iter2", NULL };
+
+    PyObject *py_model;
+    PyObject *py_iter1;
+    PyObject *py_iter2;
+    _PyGTKIterCompareFuncWrapper *wrapper;
+    int result;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O!O!", kwlist,
+                                     &PyGtkTreeModel_Type, &py_model,
+                                     &PyGtkTreeIter_Type, &py_iter1,
+                                     &PyGtkTreeIter_Type, &py_iter2))
+        return NULL;
+
+    wrapper = (_PyGTKIterCompareFuncWrapper *) PyCObject_AsVoidPtr(self);
+    result = (*wrapper->func) (GTK_TREE_MODEL(((PyGObject *) py_model)->obj),
+                               pyg_boxed_get(py_iter1, GtkTreeIter),
+                               pyg_boxed_get(py_iter2, GtkTreeIter),
+                               wrapper->data);
+
+    return PyInt_FromLong(result);
+}
+
+static void
+_pygtk_tree_iter_compare_func_wrapper__destroy(void *wrapper_)
+{
+    _PyGTKIterCompareFuncWrapper *wrapper = (_PyGTKIterCompareFuncWrapper *) wrapper_;
+
+    if (wrapper->destroy)
+        (*wrapper->destroy) (wrapper->data);
+
+    g_slice_free(_PyGTKIterCompareFuncWrapper, wrapper);
+}
+
+static PyObject *
+_wrap_tree_iter_compare_func(GtkTreeIterCompareFunc func, gpointer data, GDestroyNotify destroy)
+{
+    static PyMethodDef wrapper_method
+        = { "_iter_compare", (PyCFunction) _pygtk_tree_iter_compare_func_wrapper__call,
+            METH_VARARGS | METH_KEYWORDS, NULL };
+
+    _PyGTKIterCompareFuncWrapper *wrapper;
+    PyObject *py_wrapper;
+    PyObject *result;
+
+    if (!func) {
+        if (destroy)
+            (*destroy) (data);
+
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    wrapper = g_slice_new(_PyGTKIterCompareFuncWrapper);
+    wrapper->func = func;
+    wrapper->data = data;
+    wrapper->destroy = destroy;
+
+    py_wrapper = PyCObject_FromVoidPtr(wrapper, _pygtk_tree_iter_compare_func_wrapper__destroy);
+    if (!py_wrapper) {
+        _pygtk_tree_iter_compare_func_wrapper__destroy(wrapper);
+        return NULL;
+    }
+
+    result = PyCFunction_New(&wrapper_method, py_wrapper);
+    Py_DECREF(py_wrapper);
+
+    return result;
+}
+
+static void
+_do_proxy_do_set_sort_func(GtkTreeSortable *self, gboolean default_,
+                           gint sort_column_id,
+                           GtkTreeIterCompareFunc func,
+                           gpointer data,
+                           GDestroyNotify destroy)
+{
+    PyGILState_STATE py_state = pyg_gil_state_ensure ();
+    PyObject *py_self = NULL;
+    PyObject *py_func = NULL;
+    PyObject *result = NULL;
+
+    py_self = pygobject_new(G_OBJECT(self));
+    if (!py_self)
+        goto error;
+
+    py_func = _wrap_tree_iter_compare_func(func, data, destroy);
+    if (!py_func)
+        goto error;
+
+    if (default_)
+        result = PyObject_CallMethod(py_self, "do_set_default_sort_func", "O", py_func);
+    else
+        result = PyObject_CallMethod(py_self, "do_set_sort_func", "iO", sort_column_id, py_func);
+
+    if (!result)
+        goto error;
+
+ done:
+    Py_XDECREF(py_self);
+    Py_XDECREF(py_func);
+    Py_XDECREF(result);
+  
+    pyg_gil_state_release (py_state);
+
+    return;
+
+ error:
+    if (PyErr_Occurred ())
+        PyErr_Print ();
+
+    goto done;
+}
+
+static void
+_wrap_GtkTreeSortable__proxy_do_set_sort_func(GtkTreeSortable *self,
+                                              gint sort_column_id,
+                                              GtkTreeIterCompareFunc func,
+                                              gpointer data,
+                                              GDestroyNotify destroy)
+{
+    _do_proxy_do_set_sort_func(self, FALSE, sort_column_id, func, data, destroy);
+}
+%%
+override GtkTreeSortable__proxy_do_set_default_sort_func
+static void
+_wrap_GtkTreeSortable__proxy_do_set_default_sort_func(GtkTreeSortable *self,
+                                                      GtkTreeIterCompareFunc func,
+                                                      gpointer data,
+                                                      GDestroyNotify destroy)
+{
+    _do_proxy_do_set_sort_func(self, TRUE, 0, func, data, destroy);
+}
+
+%%
 ignore gtk_list_store_newv
 %%
 new-constructor GTK_TYPE_LIST_STORE

File gtk/gtkunixprint.override

     Py_INCREF(Py_None);
     return Py_None;
 }
+%%
+override gtk_printer_list_papers noargs
+static PyObject*
+_wrap_gtk_printer_list_papers(PyGObject *self)
+{
+    GList *list;
+    PyObject *ret;
+
+    list = gtk_printer_list_papers(GTK_PRINTER(self->obj));
+
+    if (list) {
+        PYLIST_FROMGLIST(ret, list, pygobject_new(list_item), NULL, NULL);
+        return ret;
+    } else {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+}

File pangocairo.defs

+;; -*- scheme -*-
 ;; From /opt/gnome-devel/include/pango-1.0/pango/pangocairo.h
 
 (define-interface CairoFontMap
   (of-object "PangoCairoFontMap")
   (c-name "pango_cairo_font_map_create_context")
   (return-type "PangoContext*")
+  (caller-owns-return #t)
 )
 
 (define-function update_context
 (define-function create_layout
   (c-name "pango_cairo_create_layout")
   (return-type "PangoLayout*")
+  (caller-owns-return #t)
   (parameters
     '("cairo_t*" "cr")
   )

File pygtk-2.0.pc.in

 
 Name: PyGTK
 Description: Python bindings for GTK+ and related libraries
-Requires: pygobject-2.0
+Requires: pygobject-2.0 gtk+-2.0
 Version: @VERSION@
 Cflags: -I${pygtkincludedir} @THREADING_CFLAGS@

File pygtk_postinstall.py

 import distutils.file_util
 import distutils.errors
 
-PYGOBJECT_XSL_DIR = os.path.join('share', 'pygobject','xsl')
-PYGOBJECT_HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygobject')
-HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygtk')
+pkgconfig_file = os.path.normpath(
+    os.path.join(sys.prefix,
+                 'lib/pkgconfig/pygtk-2.0.pc'))
 
 prefix_pattern=re.compile("^prefix=.*")
 exec_pattern=re.compile("^exec\s.*")
 codegendir_pattern=re.compile("^codegendir=.*")
+version_pattern=re.compile("Version: ([0-9]+\.[0-9]+\.[0-9]+)")
 
 def replace_prefix(s):
     if prefix_pattern.match(s):
            '/gtk-2.0/codegen' + '\n')
     return s
 
-def copy_pygobject_css():
-    # Copy style.css from pygobject docs to pygtk docs
+def get_doc_url(pkgconfig_file, base_url):
     try:
-        distutils.file_util.copy_file(
-            os.path.normpath(os.path.join(sys.prefix, PYGOBJECT_HTML_DIR,
-                                          'style.css')),
-            os.path.normpath(os.path.join(sys.prefix,HTML_DIR)))
-    except distutils.errors.DistutilsFileError:
-        # probably pygobject has not been installed yet
-        pass
-        
-    
-
-def html_fixxref():
-    sys.path.insert(0, os.path.normpath(os.path.join(sys.prefix,
-                                                     PYGOBJECT_XSL_DIR)))
-    try:
-        import fixxref
-        fixxref.scan_index_dir(fixxref.DOCDIR)
-        fixxref.fix_xrefs(os.path.normpath(os.path.join(sys.prefix,
-                                                        HTML_DIR)))
-    except ImportError, e:
-        pass
+        f = open(pkgconfig_file).read()
+        ver = version_pattern.search(f).groups()[0]
+        majv,minv,micv = ver.split('.')
+        doc_url = "%s/%s.%s/" % (base_url,majv,minv)
+    except:
+        doc_url = base_url + "/stable/"
+    return doc_url
 
 # TODO : Check that shortcuts are created system-wide when the user
 # has admin rights (hint: see pywin32 postinstall)
     pygtk_shortcuts = os.path.join(progs_folder, 'PyGTK')
     if not os.path.isdir(pygtk_shortcuts):
         os.mkdir(pygtk_shortcuts)
-       
+
+    # link to specific documentation version by parsing the
+    # pkgconfig file
+    doc_url = get_doc_url(pkgconfig_file,
+                          "http://library.gnome.org/devel/pygtk")
     pygtk_doc_link=os.path.join(pygtk_shortcuts,
                                     'PyGTK Documentation.lnk')
     if os.path.isfile(pygtk_doc_link):   
         os.remove(pygtk_doc_link)
-    
-    create_shortcut(os.path.join(sys.prefix,'share','gtk-doc','html',
-                                 'pygtk','index.html'),
-                    'PyGTK Documentation', pygtk_doc_link)
+    create_shortcut(doc_url,'PyGTK Documentation',pygtk_doc_link)
    
     homepage_link = os.path.join(pygtk_shortcuts,
                                  "PyGTK Home.lnk")
     if os.path.isfile(homepage_link):   
         os.remove(homepage_link)
-    create_shortcut("http://www.pygtk.org",'PyGTK Homepage', homepage_link)
+    create_shortcut("http://www.pygtk.org",'PyGTK Homepage',homepage_link)
 
 def remove_shortcuts():
     pygtk_shortcuts = os.path.join(
 
 if len(sys.argv) == 2:
     if sys.argv[1] == "-install":
-        filenames=['lib/pkgconfig/pygtk-2.0.pc','bin/pygtk-codegen-2.0']
-        for filename in filenames: 
-            pkgconfig_file = os.path.normpath(
-                os.path.join(sys.prefix,filename))
-
-            lines=open(pkgconfig_file).readlines()
-            open(pkgconfig_file, 'w').writelines(map(replace_prefix,lines))
-        copy_pygobject_css()
-        html_fixxref()
+        # fixup the pkgconfig file
+        lines=open(pkgconfig_file).readlines()
+        open(pkgconfig_file, 'w').writelines(map(replace_prefix,lines))
         # TODO: Add an installer option for shortcut creation 
-        # create_shortcuts()
+        create_shortcuts()
         print __doc__
     elif sys.argv[1] == "-remove":
-        # remove_shortcuts()
-        os.remove(os.path.normpath(
-            os.path.join(sys.prefix,HTML_DIR,'style.css')))
+        remove_shortcuts()
 #
 # setup.py - distutils configuration for pygtk
 #
-# TODO:
-# pygtk.spec(.in)
-#
-"""Python Bindings for the GTK Widget Set.
-
-PyGTK is a set of bindings for the GTK widget set. It provides an object
-oriented interface that is slightly higher level than the C one. It
-automatically does all the type casting and reference counting that you
-would have to do normally with the C API. You can find out more on the
-official homepage, http://www.daa.com.au/~james/pygtk/"""
+"""Python Bindings for the GTK Widget Set."""
 
 from distutils.command.build import build
 from distutils.core import setup
 import sys
 
 from dsextras import get_m4_define, getoutput, have_pkgconfig, \
-     pkgc_version_check, \
+     pkgc_version_check, getoutput, \
      GLOBAL_INC, GLOBAL_MACROS, InstallLib, InstallData, BuildExt, \
      PkgConfigExtension, Template, TemplateExtension
 
     print '*'*70
     input = raw_input('Not supported, ok [y/N]? ')
     if not input.startswith('y'):
-        raise SystemExit
+        raise SystemExit("Aborted")
 
-    if sys.version_info[:3] < (2, 3, 5):
-        raise SystemExit, \
-              "Python 2.3.5 or higher is required, %d.%d.%d found" % sys.version_info[:3]
-    
+MIN_PYTHON_VERSION = (2, 3, 5)
+
 MAJOR_VERSION = int(get_m4_define('pygtk_major_version'))
 MINOR_VERSION = int(get_m4_define('pygtk_minor_version'))
 MICRO_VERSION = int(get_m4_define('pygtk_micro_version'))
 GTK_REQUIRED      = get_m4_define('gtk_required_version')
 LIBGLADE_REQUIRED = get_m4_define('libglade_required_version')
 PYCAIRO_REQUIRED  = get_m4_define('pycairo_required_version')
+PYGOBJECT_REQUIRED = get_m4_define('pygobject_required_version')
 
 PYGTK_SUFFIX = '2.0'
 PYGTK_SUFFIX_LONG = 'gtk-' + PYGTK_SUFFIX
     GLOBAL_MACROS.append(('PLATFORM_WIN32',1))
     GLOBAL_MACROS.append(('HAVE_BIND_TEXTDOMAIN_CODESET',1))
 else:
-    GLOBAL_MACROS.append(('VERSION', '"%s"' % VERSION))
+    raise SystemExit("Error: distutils build only supported on windows")
+
+if sys.version_info[:3] < MIN_PYTHON_VERSION:
+    raise SystemExit("Python %s or higher is required, %s found" % (
+        ".".join(map(str,MIN_PYTHON_VERSION)),
+                     ".".join(map(str,sys.version_info[:3]))))
+
+if not have_pkgconfig():
+    raise SystemExit("Error, could not find pkg-config")
 
 DEFS_DIR    = os.path.join('share', 'pygtk', PYGTK_SUFFIX, 'defs')
 INCLUDE_DIR = os.path.join('include', 'pygtk-%s' % PYGTK_SUFFIX)
-HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygtk')
+PYGOBJECT_DEFSDIR = getoutput('pkg-config --variable=defsdir pygobject-2.0')
 
 class PyGtkInstallLib(InstallLib):
     def run(self):
 
 class PyGtkBuild(build):
     enable_threading = 1
+
 PyGtkBuild.user_options.append(('enable-threading', None,
                                 'enable threading support'))
 
+###################################################################
+# FOR A NEW RELEASE, YOU USUALLY ONLY NEED TO CHANGE THE FOLLOWING
+# These defs are registered with many modules...
+gdk_defs = [
+    'gtk/gdk-2.20.defs',
+    'gtk/gdk-2.18.defs',
+    'gtk/gdk-2.16.defs',
+    'gtk/gdk-2.14.defs',
+    'gtk/gdk-2.12.defs',
+    'gtk/gdk-2.10.defs',
+    'gtk/gdk-base.defs']
+gtk_defs = [
+    'gtk/gtk-2.20.defs',
+    'gtk/gtk-2.18.defs',
+    'gtk/gtk-2.16.defs',
+    'gtk/gtk-2.14.defs',
+    'gtk/gtk-2.12.defs',
+    'gtk/gtk-2.10.defs',
+    'gtk/gtk-base.defs']
+gtk_types_defs = [
+    'gtk/gtk-2.20-types.defs',
+    'gtk/gtk-2.18-types.defs',
+    'gtk/gtk-2.16-types.defs',
+    'gtk/gtk-2.14-types.defs',
+    'gtk/gtk-2.12-types.defs',
+    'gtk/gtk-2.10-types.defs',
+    'gtk/gtk-base-types.defs']
+gtk_extra_defs = [
+    'gtk/gtk-extrafuncs.defs']
+####################################################################
+
 # Atk
-atk = TemplateExtension(name='atk', pkc_name='atk',
-                        pkc_version=ATK_REQUIRED,
+atk = TemplateExtension(name='atk', 
+                        pkc_name=('pygobject-2.0','atk'),
+                        pkc_version=(PYGOBJECT_REQUIRED, ATK_REQUIRED),
                         sources=['atkmodule.c', 'atk.c'],
                         register=['atk-types.defs'],
                         override='atk.override',
                         defs='atk.defs',
                         py_ssize_t_clean=True)
 # Pango
-pango = TemplateExtension(name='pango', pkc_name='pango',
-                          pkc_version=PANGO_REQUIRED,
+pango = TemplateExtension(name='pango', 
+                          pkc_name=('pygobject-2.0','pango'),
+                          pkc_version=(PYGOBJECT_REQUIRED, PANGO_REQUIRED),
                           sources=['pango.c', 'pangomodule.c'],
                           register=['pango-types.defs'],
                           override='pango.override',
 # Pangocairo
 pangocairo = TemplateExtension(name='pangocairo',
                                pkc_name=('pycairo', 'pangocairo'),
-                               pkc_version=(PYCAIRO_REQUIRED,
-                                            PANGO_REQUIRED),
+                               pkc_version=(PYCAIRO_REQUIRED, PANGO_REQUIRED),
                                sources=['pangocairo.c', 'pangocairomodule.c'],
                                register=['pango-types.defs'],
                                override='pangocairo.override',
 
 # Gdk (template only)
 gdk_template = Template('gtk/gdk.override', 'gtk/gdk.c',
-                        defs=('gtk/gdk.defs',
-                              ['gtk/gdk-2.10.defs','gtk/gdk-base.defs']),
+                        defs=('gtk/gdk.defs',gdk_defs),
                         prefix='pygdk',
                         register=['atk-types.defs',
                                   'pango-types.defs',
-                                  ('gtk/gdk-types.defs',
-                                   ['gtk/gdk-base-types.defs'])],
+                                  ('gtk/gdk-types.defs',gdk_defs)],
                         py_ssize_t_clean=True)
 # Gtk+
-if pangocairo.can_build():
-    gtk_pkc_name=('gtk+-2.0','pycairo')
-    gtk_pkc_version=(GTK_REQUIRED,PYCAIRO_REQUIRED)
-else:
-    gtk_pkc_name='gtk+-2.0'
-    gtk_pkc_version=GTK_REQUIRED
+gtk_pkc_defs=('gtk/gtk.defs',gtk_defs)
+gtk_pkc_register=['%s/gio-types.defs' % PYGOBJECT_DEFSDIR,
+                  'atk-types.defs',
+                  'pango-types.defs',
+                  ('gtk/gdk-types.defs',['gtk/gdk-base-types.defs']),
+                  ('gtk/gtk-types.defs',gtk_types_defs)]
+libglade_pkc_register=[('gtk/gdk-types.defs',['gtk/gdk-base-types.defs']),
+                       ('gtk/gtk-types.defs',gtk_types_defs),
+                       'gtk/libglade.defs']
 
-if pkgc_version_check('gtk+-2.0', '2.10.0'):
-    gtk_pkc_defs=('gtk/gtk.defs',['gtk/gtk-2.10.defs','gtk/gtk-base.defs'])
-    gtk_pkc_register=['atk-types.defs',
-                      'pango-types.defs',
-                      ('gtk/gdk-types.defs',['gtk/gdk-base-types.defs']),
-                      ('gtk/gtk-types.defs',['gtk/gtk-base-types.defs',
-                                             'gtk/gtk-2.10-types.defs'])]
-    libglade_pkc_register=[('gtk/gtk-types.defs',
-                            ['gtk/gtk-base-types.defs',
-                             'gtk/gtk-2.10-types.defs']),
-                           'gtk/libglade.defs']
-else:
-    gtk_pkc_defs=('gtk/gtk.defs',['gtk/gtk-base.defs'])
-    gtk_pkc_register=['atk-types.defs',
-                      'pango-types.defs',
-                      ('gtk/gdk-types.defs',['gtk/gdk-base-types.defs']),
-                      ('gtk/gtk-types.defs',['gtk/gtk-base-types.defs'])]
-    libglade_pkc_register=[('gtk/gtk-types.defs',['gtk/gtk-base-types.defs']),
-                           'gtk/libglade.defs']
-
-gtk = TemplateExtension(name='gtk', pkc_name=gtk_pkc_name,
-                        pkc_version=gtk_pkc_version,
+gtk = TemplateExtension(name='gtk', pkc_name=('gtk+-2.0','pycairo'),
+                        pkc_version=(GTK_REQUIRED, PYCAIRO_REQUIRED),
                         output='gtk._gtk',
                         sources=['gtk/gtkmodule.c',
                                  'gtk/gtkobject-support.c',
 py_modules = []
 packages = []
 
-if not have_pkgconfig():
-    print "Error, could not find pkg-config"
-    raise SystemExit
-
-if atk.can_build():
-    ext_modules.append(atk)
-    data_files.append((DEFS_DIR, ('atk.defs', 'atk-types.defs')))
-if pango.can_build():
-    ext_modules.append(pango)
-    data_files.append((DEFS_DIR, ('pango.defs', 'pango-types.defs')))
-    if pangocairo.can_build():
-        ext_modules.append(pangocairo)
-        data_files.append((DEFS_DIR, ('pangocairo.defs',)))
-        GLOBAL_MACROS.append(('HAVE_PYCAIRO',1))
 if gtk.can_build():
     if '--disable-numpy' in sys.argv:
         sys.argv.remove('--disable-nump