[cairo] cairo-ft-font.c naming cleanup

Carl Worth cworth at redhat.com
Wed Jul 13 14:45:44 PDT 2005


On Wed, 13 Jul 2005 16:30:10 -0400, Owen Taylor wrote:
> For the cairo_unscaled_font_t => cairo_ft_unscaled_font_t change: 
> the API that you are changing is all stuff that is currently planned
> (and was originally planned) to be moved to be backend independent.

Yes, we should have a backend-independent _cairo_scaled_font_get_unscaled_font.
But _cairo_ft_unscaled_font_[un]lock_face is cairo-ft specific by
definition, right?

> But even if it wasn't planned to move - we really don't do public
> subclasses for functions that work on subclasses, for instance:
[...]
> Inheritance of structures isn't something we expose in the public API.
> While this is private API, my tendency is to design private APIs along 
> similar principles to public APIs.

I agree with these principles. In the specific case of
_cairo_ft_unscaled_font_[un]lock_face, I compromised here, but I'm
open to suggestions. We've got a type-unsafe interface into
cairo-ft-font.c, but we want the same type-safe function inside
cairo-ft-font.c. In similar cases in the implementation we would use
_cairo_ft_abstract_unscaled_font_[un]lock_face. But that would only
work well with a generic _cairo_unscaled_font_lock_face function and
hiding the ugly name in the backend table.

Anyway, we'd just need two different names here, but I couldn't think
of a good convention. Currently, they're distinguished by prefixes of
_cairo_ft vs. _ft, but that's what the patch eliminates.


> Would I happier if renames were done when I didn't have a bunch of
> outstanding changes? Of course. But resolving conflicts probably won't
> take more than 15 minutes for me if you think committing now is going to
> make the cache changes easier.

Holding off on the patch is fine too. Mostly I did the renaming as I
was trying to understand things. So I've already gotten the benefit
from it, and it doesn't have to land before the hash/cache rework.

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050713/4488b04a/attachment.pgp


More information about the cairo mailing list