Permalink
Browse files

Dimensions!

  • Loading branch information...
1 parent b74fb15 commit 792da05c0b39b927165e6ff5cf2c52c22fb788d1 Amos Wenger committed Dec 19, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 source/rsvg.ooc
View
@@ -3,6 +3,13 @@ use rsvg, cairo
include librsvg/rsvg, librsvg/rsvg-cairo
import cairo/Cairo
+SvgDimensions: cover from RsvgDimensionData {
+ width: extern Int
+ height: extern Int
+ em: extern Double
+ ex: extern Double
+}
+
Svg: cover from RsvgHandle * {
/**
@@ -13,8 +20,24 @@ Svg: cover from RsvgHandle * {
rsvg_handle_new_from_file(path, null)
}
+ getDimensions: extern(rsvg_handle_get_dimensions) func (dimensions: SvgDimensions*)
+
+ getWidth: func -> Int {
+ dimensions: SvgDimensions
+ getDimensions(dimensions&)
+ dimensions width
+ }
+
+ getHeight: func -> Int {
+ dimensions: SvgDimensions
+ getDimensions(dimensions&)
+ dimensions height
+ }
+
render: extern(rsvg_handle_render_cairo) func (cr: Context)
+ render: extern(rsvg_handle_render_cairo_sub) func ~sub (cr: Context, id: CString)
+
free: extern(rsvg_handle_free) func
}

0 comments on commit 792da05

Please sign in to comment.