From 5dde093dd8fb17419e77a4a266858c243951791b Mon Sep 17 00:00:00 2001 From: Robert Staudinger Date: Sun, 5 Feb 2006 09:03:18 +0000 Subject: add props "width", "height", "em", "ex" (all read only) * rsvg-gobject.c: add props "width", "height", "em", "ex" (all read only) --- ChangeLog | 2 +- rsvg-gobject.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdd3568f..46a1b045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2006-02-04 Rob Staudinger - * rsvg-gobject.c: add props "width", "height" (read only) + * rsvg-gobject.c: add props "width", "height", "em", "ex" (all read only) * rsvg.h: fix doc after cairo rendering renaming 2006-02-04 Dom Lachowicz diff --git a/rsvg-gobject.c b/rsvg-gobject.c index 635b7f93..b2b44108 100644 --- a/rsvg-gobject.c +++ b/rsvg-gobject.c @@ -30,6 +30,8 @@ enum { PROP_BASE_URI, PROP_WIDTH, PROP_HEIGHT, + PROP_EM, + PROP_EX, PROP_TITLE, PROP_DESC, PROP_METADATA, @@ -164,6 +166,14 @@ get_property (GObject *instance, rsvg_handle_get_dimensions (self, &dim); g_value_set_int (value, dim.height); break; + case PROP_EM: + rsvg_handle_get_dimensions (self, &dim); + g_value_set_double (value, dim.em); + break; + case PROP_EX: + rsvg_handle_get_dimensions (self, &dim); + g_value_set_double (value, dim.ex); + break; case PROP_TITLE: g_value_set_string (value, rsvg_handle_get_title (self)); break; @@ -213,17 +223,29 @@ class_init (RsvgHandleClass *klass) (GParamFlags)(G_PARAM_READWRITE | G_PARAM_CONSTRUCT))); g_object_class_install_property (gobject_class, - PROP_DPI_Y, - g_param_spec_double ("width", _("Image width"), + PROP_WIDTH, + g_param_spec_int ("width", _("Image width"), _("Image width"), 0, G_MAXINT, 0, (GParamFlags)(G_PARAM_READABLE))); g_object_class_install_property (gobject_class, - PROP_DPI_Y, - g_param_spec_double ("height", _("Image height"), + PROP_HEIGHT, + g_param_spec_int ("height", _("Image height"), _("Image height"), 0, G_MAXINT, 0, (GParamFlags)(G_PARAM_READABLE))); + g_object_class_install_property (gobject_class, + PROP_EM, + g_param_spec_double ("em", _("em"), + _("em"), 0, G_MAXDOUBLE, 0, + (GParamFlags)(G_PARAM_READABLE))); + + g_object_class_install_property (gobject_class, + PROP_EX, + g_param_spec_double ("ex", _("ex"), + _("ex"), 0, G_MAXDOUBLE, 0, + (GParamFlags)(G_PARAM_READABLE))); + g_object_class_install_property (gobject_class, PROP_TITLE, g_param_spec_string ("title", _("Title"), -- cgit v1.2.1