Bug 7180

Summary: pycairo wraps nonexistent (changed) API
Product: pycairo Reporter: Elijah Newren <newren>
Component: generalAssignee: Steve Chaplin <d74n5pohf9>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: fpeters
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Hacky patch to fix the bug
replace *Surface set_dpi method by Surface set_fallback_resolution

Description Elijah Newren 2006-06-10 14:12:28 UTC
pycairo wraps cairo_ps_surface_set_dpi, but cairo/src/cairo.h now #defines that
function to
cairo_ps_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution,
without defining this new function.  It appears to be part of a cairo effort to
force people to move to the new API.  (See also
http://bugzilla.gnome.org/show_bug.cgi?id=344512)

1032 newren@Moe:gnome/PolicyKit$ jhbuild shell
1001 newren@Moe:gnome/PolicyKit$ python
Python 2.4.3 (#1, Jun 10 2006, 15:32:32)
[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/opt/gnome2/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line
43, in ?
    from _gtk import *
  File "/opt/gnome2/lib/python2.4/site-packages/cairo/__init__.py", line 1, in ?
    from _cairo import *
ImportError: /opt/gnome2/lib/python2.4/site-packages/cairo/_cairo.so: undefined
symbol: cairo_ps_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution
Comment 1 Elijah Newren 2006-06-10 15:23:51 UTC
Created attachment 5871 [details] [review]
Hacky patch to fix the bug

This patch takes the minimal route to fixing this bug.	Probably not the best
route, as you'd probably want to compress the three pycairo functions into one
just as cairo did.
Comment 2 Frederic Peters 2006-06-10 23:08:38 UTC
Created attachment 5874 [details] [review]
replace *Surface set_dpi method by Surface set_fallback_resolution

This patch does it like cairo did; providing set_fallback_resolution to
CairoSurface instead of three set_dpi methods to children classes.
Comment 3 Steve Chaplin 2006-06-11 00:29:04 UTC
Fixed in CVS using the method from the second patch. (I received the email
regarding the second patch after I had just made the equivalent changes!)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.