[Cairo] Cairo API change: cairo_get_* -> cairo_current_*

Carl Worth cworth at east.isi.edu
Thu Sep 4 08:49:01 PDT 2003


I just modified Cairo so that almost all cairo_get_* functions are now
cairo_current_* functions. Most of the changes are a direct
substitution of "current" for "get", but a few are slightly
different:

	cairo_get_current_point	-> cairo_current_point
	cairo_get_status	-> cairo_status
	cairo_get_status_string	-> cairo_status_string

Now that Cairo is starting to see more use, with this API change I've
gone out of my way to make API changes a little easier to deal
with. Here's what you will notice:

1) I lifted some of Richard's work on the slim macros to provide
   aliases so the deprecated function names will work, but with useful
   compile-time warnings. For example, compiling code that still calls
   cairo_get_status may result in an error message like:

	warning: implicit declaration of function
	`cairo_get_status_DEPRECATED_BY_cairo_status'

   The aliasing feature works on ELF systems with gcc >= 2. Other
   systems will get a link error for a missing function, (named as in
   the example warning above). So the old and new function names will
   always be reported at compile time.

2) I've added a script to update source code using Cairo to the latest
   version of the API. The script is located in util/cairo-api-update.
   Usage is quite simple:

	cairo-api-update *.c

   The script is kind enough to make a backup copy of each file it
   touches. The script is not installed with "make install".

3) For the various libraries I'm actually incrementing the package
   version numbers when the API changes. I'm also trying to be careful
   to adjust the configure scripts of higher-level libraries to look
   for the new versions. The upshot is that you should be able to just
   upgrade the top-level library of interest, (say libxsvg or cairo),
   at when you run configure it should tell you if you also need to
   update lower-level libraries, (such as libic).

Let me know if I've broken anything, or if there's any other feedback.

-Carl





More information about the cairo mailing list