Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

State-of-the-art for embedding scriptable, interactive SVG in Gtk+ applications?

Tags:

c

svg

gtk

I'm interested in writing a Gtk application that uses an embedded SVG canvas for graphics, and I'm wondering what the current state-of-the-art is for using SVG in Gtk. I know that it's possible to embed Webkit inside of Gtk, and so that seems like one approach, but I would like to add interactivity to DOM elements in the embedded SVG canvas using C instead of JavaScript, and I'm not sure if the embedded Webkit exposes its DOM APIs to the embedding C context. I'm wondering if there might be a better approach. The last article I was able to find on the subject was from 2004: http://www.osnews.com/story/6460

like image 372
jbeard4 Avatar asked Sep 19 '10 16:09

jbeard4


1 Answers

librsvg is the preferred way to draw SVG into GTK+ widgets. However, to my knowledge, it doesn't support any kind of interactivity (only drawing).

Regarding WebKit, it does expose the DOM through webkit_web_view_get_dom_document. Have a look at the WebKitGtk tests for some examples.

like image 200
Johannes Sasongko Avatar answered Oct 10 '22 07:10

Johannes Sasongko