Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Dimensions!

  • Loading branch information...
commit 792da05c0b39b927165e6ff5cf2c52c22fb788d1 1 parent b74fb15
@nddrylliog authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 source/rsvg.ooc
View
23 source/rsvg.ooc
@@ -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
}
Please sign in to comment.
Something went wrong with that request. Please try again.