Created attachment 93975 [details] [review] Remove no longer useful .cvsignore files I've wrapped most of the new Cairo 1.12 API (patches attached). The new wrappers are not ready for committing yet: I've only made sure that the library compiles, the new wrappers have not been tested.
Created attachment 93976 [details] [review] Wrap FtFontFace::{get,set,unset}_synthesize
Created attachment 93977 [details] [review] Wrap cairo script device and script surface APIs
Created attachment 93978 [details] [review] Wrap XCB device and XCB surface APIs
Created attachment 93979 [details] [review] Wrap Xlib device API
Created attachment 93980 [details] [review] Wrap new Surface member functions
Created attachment 93981 [details] [review] Wrap the mesh surface API
Thanks. In an email, you said: " There is one place where I'm a bit unsure how to wrap the API: cairo_surface_map_to_image requires that the returned surface is not disposed through cairo_surface_destroy, but through cairo_surface_unmap_image instead. This means we can't use RefPtr as usual. Returning a plain pointer doesn't sound as a good idea either, so I created a small wrapper modelling an unique pointer with a custom deleter (see MappedImagePtr). " Which patches does this affect? I'd like to just apply the other patches as they seem straightforward.
Created attachment 94466 [details] Wrap the mesh surface API Seems that I haven't committed everything. One function is enabled only in C++11 mode so that otherwise noncopyable Path can be returned using move semantics.
> Which patches does this affect? I'd like to just apply the other patches as they seem straightforward. This affects the "Wrap new Surface member functions" patch. Others may indeed be worth to commit, but I think writing a toy program to test the wrappers is still a good idea. Regards, Povilas
Comment on attachment 93975 [details] [review] Remove no longer useful .cvsignore files Pushed.
Comment on attachment 93976 [details] [review] Wrap FtFontFace::{get,set,unset}_synthesize Pushed.
Comment on attachment 93977 [details] [review] Wrap cairo script device and script surface APIs Pushed.
Comment on attachment 93978 [details] [review] Wrap XCB device and XCB surface APIs Review of attachment 93978 [details] [review]: ----------------------------------------------------------------- Just one comment for this patch. ::: cairomm/xcb_device.h @@ +54,5 @@ > + * Returns the connection for the XCB device. > + * > + * @since 1.12 > + */ > + xcb_connection_t* get_connection() const; I think this needs some comment about why it makes sense for it to be const, if it does. I don't know.
(In reply to comment #7) > cairo_surface_map_to_image requires that the returned surface is not > disposed through cairo_surface_destroy, but through > cairo_surface_unmap_image instead. This means we can't use RefPtr as > usual. Returning a plain pointer doesn't sound as a good idea either, > so I created a small wrapper modelling an unique pointer with a custom > deleter (see MappedImagePtr). Yes, I see that now. The C API is a bit awkward. I would have tried the same thing, but I wonder if it will be simple enough to make it worth wrapping this function. I'm a bit surprised that you don't need a copy constructor and operator= for MappedImagePtr even just to use it as a return type. And without letting people copy it (with underlying reference-counting), you'd force people to do the (implicit) unmap in the same scope rather than at some later dynamically-chosen time.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairomm/issues/8.
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.