Commit 9c4fb9dc authored by Federico Mena Quintero's avatar Federico Mena Quintero
Browse files

RsvgUnit/RsvgLength - New public types

We will return these from an API to get an SVG's intrinsic dimensions.
parent 2dfd2320
......@@ -204,6 +204,23 @@ gboolean rsvg_handle_get_geometry_sub (RsvgHandle *handle,
gboolean rsvg_handle_has_sub (RsvgHandle *handle, const char *id);
typedef enum {
RSVG_UNIT_PERCENT,
RSVG_UNIT_PX,
RSVG_UNIT_EM,
RSVG_UNIT_EX,
RSVG_UNIT_IN,
RSVG_UNIT_CM,
RSVG_UNIT_MM,
RSVG_UNIT_PT,
RSVG_UNIT_PC
} RsvgUnit;
typedef struct {
double length;
RsvgUnit unit;
} RsvgLength;
/* GIO APIs */
/**
......
......@@ -7,7 +7,10 @@ use parsers::Parse;
use parsers::ParseError;
use properties::ComputedValues;
// Keep this in sync with rsvg.h:RsvgUnit
/// Units for length values
#[repr(C)]
#[derive(Debug, PartialEq, Copy, Clone)]
pub enum LengthUnit {
/// `1.0` means 100%
......@@ -173,6 +176,8 @@ define_length_type!(LengthVertical, LengthDir::Vertical);
/// against the current viewport's width and height.
define_length_type!(LengthBoth, LengthDir::Both);
// Keep this in sync with rsvg.h:RsvgLength
#[repr(C)]
#[derive(Debug, PartialEq, Copy, Clone)]
struct Length {
pub length: f64,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment