Re: How do I use cairomm and librsvg?



Thanks a lot! I don't know how I missed that - it does exactly what I'm looking for.

On 2018-07-22 09:48, Ezekiel Oruven wrote:
What's wrong with using the cobj() method in Cairo::Context? I thought
Cairo::Context did provide access to the underlying C type, just for
this situation.

https://www.cairographics.org/documentation/cairomm/reference/classCairo_1_1Context.html#a614bcb4e9570c5b5c54b3bfc304c194a

This method returns a pointer to Cairo::Context::cobject which is just
a typedef of cairo_t. Then you shouldn't need to do any of that
subclassing work. I haven't tested your code in any way, but that's
what my understanding from the documentation is.

On Sat, Jul 21, 2018 at 10:02 PM, <ghosty airmail cc> wrote:

I have a C++ program that uses cairomm, and I'd like to use librsvg
with it to render SVG files to Cairo surfaces. However, librsvg is
in C, and rsvg_handle_render_cairo expects a cairo_t value, while
cairomm's Cairo::Context doesn't give access to the underlying C
type (it's protected). I tried subclassing Cairo::Context and
implementing a function that returned a pointer to the underlying
cairo_t type, but it doesn't seem to be working.

Code is as follows:

main.cpp: https://paste.gnome.org/p9fzmosnu [1]
Makefile: https://paste.gnome.org/p6qswmxgr [2]
mor.glade: https://paste.gnome.org/phlvgqqt5 [3]

It just prints
(mor:7839): librsvg-CRITICAL **: rsvg_handle_render_cairo_sub:
assertion 'handle != NULL' failed
repeatedly, and doesn't render anything.

Any help would be appreciated.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list [4]



Links:
------
[1] https://paste.gnome.org/p9fzmosnu
[2] https://paste.gnome.org/p6qswmxgr
[3] https://paste.gnome.org/phlvgqqt5
[4] https://mail.gnome.org/mailman/listinfo/gtkmm-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]