brndnmtthws/conky — pull request #13 by jrk- (2013-05-22 20:47:10+00:00)
Title: Lua bindings to librsvg

Using these bindings svg files can be drawn with lua and cairo. SVGs support real transparency (I tried it out using a transparent window) and can be scaled arbitrary.

Here's an exemplary lua snippet:

```lua
if conky_window == nil then return end

local cs = cairo_xlib_surface_create(conky_window.display,
conky_window.drawable,
conky_window.visual,
conky_window.width,
conky_window.height)
local cr = cairo_create(cs)
local rh = rsvg_create_handle_from_file(dir.."gpm-ac-adapter.svg")

local rd = RsvgDimensionData:create()
rsvg_handle_get_dimensions(rh, rd)

w, h, em, ex = rd:get()

print("width: "..w.." height: "..h.." em: "..em.." ex: "..ex)

rsvg_handle_render_cairo(rh, cr)
rsvg_destroy_handle(rh)
cairo_destroy(cr)
cairo_surface_destroy(cs)
```