Skip to content
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 something to make it easier to converting cairo contexts #13

Open
hamishmack opened this issue May 27, 2016 · 4 comments
Open

Add something to make it easier to converting cairo contexts #13

hamishmack opened this issue May 27, 2016 · 4 comments

Comments

@hamishmack
Copy link
Collaborator

Since Cairo does not have full GI we need convert gi-cairo contexts for use with the Gtk2Hs cairo package. Winds up being something like this:

import Graphics.Rendering.Cairo.Types (Cairo(..))
import Graphics.Rendering.Cairo.Internal (Render(..))

...

    withManagedPtr context $ \cPtr -> (`runReaderT` Cairo (castPtr cPtr)) . runRender $ do

Where context is the gi-cairo context. We should wrap this up into a withCairo function or something.

@garetxe
Copy link
Contributor

garetxe commented May 27, 2016

Sounds good to me!

@jplatte
Copy link

jplatte commented May 27, 2016

Hm, wouldn't it make sense to create a gi-cairo-hs package that exposes the same or a similar API as the current cairo package, but is based on gi-cairo instead of Graphics.Rendering.Cairo.Internal, so we can get rid of those manually maintained low-level bindings in the long run?

@hamishmack
Copy link
Collaborator Author

@jplatte unfortunately cairo.gir is only 60 lines long (so gi-cairo contains very little), but even so gi-cairo-hs makes sense. Hopefully we could avoid depending on gtk2hs-buildtools. The same goes for gi-javascriptcore-hs.

@jplatte
Copy link

jplatte commented May 27, 2016

Oh, okay. What's the problem with introspecting cairo? Are the introspection comments just missing or is there another reason the gi scanner doesn't pick up most of the API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants