-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HAS_ constants #33
Comments
It’d be nice, but it’s not obvious how to do it. These constants are given by cairo as cairocffi, on the other hand, uses Or, perhaps we can convince the cairo developers to add a function (not a macro) for getting these constants (perhaps as a bitfield). |
I've asked the cairo developers to add this in https://bugs.freedesktop.org/show_bug.cgi?id=83050 |
I’ve just thought of a work-around: just try to use a cairo function, and catch whatever exception CFFI raises for not finding the corresponding symbol. |
… which is pretty much what Behdad Esfahbod suggests: https://bugs.freedesktop.org/show_bug.cgi?id=83050#c1
Now, if we want to do this with an API compatible with pycairo, we either need to:
Or, if pycairo compat can be dropped, this could be more simply a function or a set of functions. In any case, we’d first need to map each HAS_* constant to a symbol that only exists in the shared library if that feature is enabled. (E.g. |
pycairo has a bunch of constants (see http://cairographics.org/documentation/pycairo/2/reference/constants.html#cairo-has) which define if a given feature is available. It'd be awesome if cairocffi supported these as well.
The text was updated successfully, but these errors were encountered: