Rsvg::Handle Class Reference

Inherits Glib::Object.

Collaboration diagram for Rsvg::Handle:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Handle ()
RsvgHandle* gobj ()
 Provides access to the underlying C GObject.
const RsvgHandle* gobj () const
 Provides access to the underlying C GObject.
RsvgHandle* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void set_dpi (double dpi)
 Sets the DPI for the outgoing pixbuf.
void set_dpi (double dpi_x, double dpi_y)
 Sets the DPI for the outgoing pixbuf.
void write (const guint8* buf, gsize count)
 Loads the next count bytes of the image.
void close ()
 Closes handle, to indicate that loading the image is complete.
Glib::ustring get_base_uri () const
 Gets the base uri for this Rsvg::Handle.
void set_base_uri (const Glib::ustring& base_uri)
 Set the base URI for this SVG.
void get_dimensions (DimensionData& dimension_data) const
 Get the SVG's size.
bool get_dimensions_sub (DimensionData& dimension_data, const Glib::ustring& id) const
 Get the size of a subelement of the SVG file.
bool get_position_sub (PositionData& position_data, const Glib::ustring& id) const
 Get the position of a subelement of the SVG file.
bool has_sub (const Glib::ustring& id) const
 Checks whether the element id exists in the SVG document.
bool render (const Cairo::RefPtr< Cairo::Context >& cr) const
 Draws a SVG to a Cairo surface.
bool render_sub (const Cairo::RefPtr< Cairo::Context >& cr, const Glib::ustring& id) const
 Draws a subset of a SVG to a Cairo surface.
Glib::ustring get_title () const
 Returns: The SVG's title.
Glib::ustring get_desc () const
 Returns: The SVG's description.
Glib::ustring get_metadata () const
 Returns: The SVG's title.
Glib::PropertyProxy< double > property_dpi_x ()
 Horizontal resolution.
Glib::PropertyProxy_ReadOnly
< double > 
property_dpi_x () const
 Horizontal resolution.
Glib::PropertyProxy< double > property_dpi_y ()
 Vertical resolution.
Glib::PropertyProxy_ReadOnly
< double > 
property_dpi_y () const
 Vertical resolution.
Glib::PropertyProxy
< Glib::ustring
property_base_uri ()
 Base URI.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_base_uri () const
 Base URI.
Glib::PropertyProxy_ReadOnly< int > property_width () const
 Image width.
Glib::PropertyProxy_ReadOnly< int > property_height () const
 Image height.
Glib::PropertyProxy_ReadOnly
< double > 
property_em () const
 em.
Glib::PropertyProxy_ReadOnly
< double > 
property_ex () const
 ex.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_title () const
 SVG file title.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_desc () const
 SVG file description.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_metadata () const
 SVG file metadata.

Static Public Member Functions

static Glib::RefPtr< Handlecreate ()
static Glib::RefPtr< Handlecreate_from_data (const guint8* data, gsize data_len)
 Loads the SVG specified by data.
static Glib::RefPtr< Handlecreate_from_file (const std::string& file_name)
 Loads the SVG specified by file_name.

Protected Member Functions

 Handle ()

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Rsvg::Handlewrap (RsvgHandle* object, bool take_copy=false)
 A Glib::wrap() method for this object.


Constructor & Destructor Documentation

virtual Rsvg::Handle::~Handle (  )  [virtual]

Rsvg::Handle::Handle (  )  [protected]


Member Function Documentation

void Rsvg::Handle::close (  ) 

Closes handle, to indicate that loading the image is complete.

This will return #true if the loader closed successfully. Note that handle isn't freed until g_object_unref is called.

Returns:
#true if the loader closed successfully, or #false if there was an error.

static Glib::RefPtr<Handle> Rsvg::Handle::create (  )  [static]

static Glib::RefPtr<Handle> Rsvg::Handle::create_from_data ( const guint8 *  data,
gsize  data_len 
) [static]

Loads the SVG specified by data.

Parameters:
data The SVG data.
data_len The length of data, in bytes.
Returns:
A RsvgHandle or 0 if an error occurs.
Since librsvgmm 2.14:

static Glib::RefPtr<Handle> Rsvg::Handle::create_from_file ( const std::string file_name  )  [static]

Loads the SVG specified by file_name.

Parameters:
file_name The file name to load. If built with gnome-vfs, can be a URI.
Returns:
A RsvgHandle or 0 if an error occurs.
Since librsvgmm 2.14:

Glib::ustring Rsvg::Handle::get_base_uri (  )  const

Gets the base uri for this Rsvg::Handle.

Returns:
The base uri, possibly null
Since librsvgmm 2.9:
(really present in 2.8 as well).

Glib::ustring Rsvg::Handle::get_desc (  )  const

Returns: The SVG's description.

Returns:
The SVG's description
Since librsvgmm 2.4:

void Rsvg::Handle::get_dimensions ( DimensionData dimension_data  )  const

Get the SVG's size.

Do not call from within the size_func callback, because an infinite loop will occur.

Since librsvgmm 2.14:
Parameters:
dimension_data A place to store the SVG's size.

bool Rsvg::Handle::get_dimensions_sub ( DimensionData dimension_data,
const Glib::ustring id 
) const

Get the size of a subelement of the SVG file.

Do not call from within the size_func callback, because an infinite loop will occur.

Since librsvgmm 2.22:
Parameters:
dimension_data A place to store the SVG's size.
id An element's id within the SVG, or 0 to get the dimension of the whole SVG. For example, if you have a layer called "layer1" for that you want to get the dimension, pass "#layer1" as the id.

Glib::ustring Rsvg::Handle::get_metadata (  )  const

Returns: The SVG's title.

Returns:
The SVG's title
Since librsvgmm 2.9:

bool Rsvg::Handle::get_position_sub ( PositionData position_data,
const Glib::ustring id 
) const

Get the position of a subelement of the SVG file.

Do not call from within the size_func callback, because an infinite loop will occur.

Since librsvgmm 2.22:
Parameters:
position_data A place to store the SVG fragment's position.
id An element's id within the SVG. For example, if you have a layer called "layer1" for that you want to get the position, pass "#layer1" as the id.

Glib::ustring Rsvg::Handle::get_title (  )  const

Returns: The SVG's title.

Returns:
The SVG's title
Since librsvgmm 2.4:

const RsvgHandle* Rsvg::Handle::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

RsvgHandle* Rsvg::Handle::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

RsvgHandle* Rsvg::Handle::gobj_copy (  ) 

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Rsvg::Handle::has_sub ( const Glib::ustring id  )  const

Checks whether the element id exists in the SVG document.

Parameters:
id An element's id within the SVG.
Returns:
true if id exists in the SVG document
Since librsvgmm 2.22:

Glib::PropertyProxy_ReadOnly<Glib::ustring> Rsvg::Handle::property_base_uri (  )  const

Base URI.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Rsvg::Handle::property_base_uri (  ) 

Base URI.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Rsvg::Handle::property_desc (  )  const

SVG file description.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<double> Rsvg::Handle::property_dpi_x (  )  const

Horizontal resolution.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<double> Rsvg::Handle::property_dpi_x (  ) 

Horizontal resolution.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<double> Rsvg::Handle::property_dpi_y (  )  const

Vertical resolution.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<double> Rsvg::Handle::property_dpi_y (  ) 

Vertical resolution.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<double> Rsvg::Handle::property_em (  )  const

em.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<double> Rsvg::Handle::property_ex (  )  const

ex.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Rsvg::Handle::property_height (  )  const

Image height.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Rsvg::Handle::property_metadata (  )  const

SVG file metadata.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Rsvg::Handle::property_title (  )  const

SVG file title.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Rsvg::Handle::property_width (  )  const

Image width.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

bool Rsvg::Handle::render ( const Cairo::RefPtr< Cairo::Context > &  cr  )  const

Draws a SVG to a Cairo surface.

Since librsvgmm 2.14:
Parameters:
cr A Cairo renderer.

bool Rsvg::Handle::render_sub ( const Cairo::RefPtr< Cairo::Context > &  cr,
const Glib::ustring id 
) const

Draws a subset of a SVG to a Cairo surface.

Since librsvgmm 2.14:
Parameters:
cr A Cairo renderer.
id An element's id within the SVG, or 0 to render the whole SVG. For example, if you have a layer called "layer1" that you wish to render, pass "##layer1" as the id.

void Rsvg::Handle::set_base_uri ( const Glib::ustring base_uri  ) 

Set the base URI for this SVG.

This can only be called before write() has been called.

Since librsvgmm 2.9:
Parameters:
base_uri The base uri.

void Rsvg::Handle::set_dpi ( double  dpi_x,
double  dpi_y 
)

Sets the DPI for the outgoing pixbuf.

Common values are 75, 90, and 300 DPI. Passing a number <= 0 to dpi_x or dpi_y will reset the DPI to whatever the default value happens to be.

Since librsvgmm 2.8:
Parameters:
dpi_x Dots Per Inch (aka Pixels Per Inch).
dpi_y Dots Per Inch (aka Pixels Per Inch).

void Rsvg::Handle::set_dpi ( double  dpi  ) 

Sets the DPI for the outgoing pixbuf.

Common values are 75, 90, and 300 DPI. Passing a number <= 0 to dpi will reset the DPI to whatever the default value happens to be.

Since librsvgmm 2.8:
Parameters:
dpi Dots Per Inch (aka Pixels Per Inch).

void Rsvg::Handle::write ( const guint8 *  buf,
gsize  count 
)

Loads the next count bytes of the image.

This will return #true if the data was loaded successful, and #false if an error occurred. In the latter case, the loader will be closed, and will not accept further writes. If false is returned, error will be set to an error from the Rsvg::ERROR domain.

Parameters:
buf Pointer to svg data.
count Length of the buf buffer in bytes.
Returns:
#true if the write was successful, or #false if there was an error.


Friends And Related Function Documentation

Glib::RefPtr< Rsvg::Handle > wrap ( RsvgHandle *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:

Generated on Fri Aug 28 20:18:34 2009 for librsvgmm by  doxygen 1.5.8