diff options
author | James Henstridge <james@daa.com.au> | 2002-11-16 11:41:07 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2002-11-16 11:41:07 +0000 |
commit | 7bc8cb25fcb8650c58b93faa21505cd4a6790566 (patch) | |
tree | ac46f107458a9454cf7774e572e41726b3169f4f /codegen | |
parent | 6ed4b51887e4d3e1980bd20a7ef37d2cd1453568 (diff) | |
download | pygtk-7bc8cb25fcb8650c58b93faa21505cd4a6790566.tar.gz |
From patch on bug #96950
2002-11-16 James Henstridge <james@daa.com.au>
From patch on bug #96950
* gtk/gdk.override (_wrap_gdk_pixbuf_save): wrapper for
GdkPixbuf.save()
* codegen/argtypes.py (GdkRectanglePtrArg.write_param): handle
GdkRectangle args with (null-ok) set.
* gtk/gtk.defs (gtk.Style.paint_*): allow passing None for area,
widget and detail arguments.
Diffstat (limited to 'codegen')
-rw-r--r-- | codegen/argtypes.py | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/codegen/argtypes.py b/codegen/argtypes.py index 99aaf222..a4fb8f65 100644 --- a/codegen/argtypes.py +++ b/codegen/argtypes.py @@ -647,14 +647,28 @@ class GtkTreePathArg(ArgType): ' return Py_None;') class GdkRectanglePtrArg(ArgType): - null = (' if (!pygdk_rectangle_from_pyobject(py_%(name)s, &%(name)s))\n' - ' return NULL;\n') + normal = (' if (!pygdk_rectangle_from_pyobject(py_%(name)s, &%(name)s))\n' + ' return NULL;\n') + null = (' if (py_%(name)s == Py_None)\n' + ' %(name)s = NULL;\n' + ' else if (pygdk_rectangle_from_pyobject(py_%(name)s, &%(name)s_rect))\n' + ' %(name)s = &%(name)s_rect;\n' + ' else\n' + ' return NULL;\n') def write_param(self, ptype, pname, pdflt, pnull, info): - info.varlist.add('GdkRectangle', pname + ' = { 0, 0, 0, 0 }') - info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') - info.add_parselist('O', ['&py_' + pname], [pname]) - info.arglist.append('&' + pname) - info.codebefore.append(self.null % {'name': pname}) + if pnull: + info.varlist.add('GdkRectangle', pname + '_rect = { 0, 0, 0, 0 }') + info.varlist.add('GdkRectangle', '*' + pname) + info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') + info.add_parselist('O', ['&py_' + pname], [pname]) + info.arglist.append(pname) + info.codebefore.append(self.null % {'name': pname}) + else: + info.varlist.add('GdkRectangle', pname + ' = { 0, 0, 0, 0 }') + info.varlist.add('PyObject', '*py_' + pname) + info.add_parselist('O', ['&py_' + pname], [pname]) + info.arglist.append('&' + pname) + info.codebefore.append(self.normal % {'name': pname}) class GdkRectangleArg(ArgType): def write_return(self, ptype, ownsreturn, info): |