Rsvg::Handle Class Reference

Inheritance diagram for Rsvg::Handle:

Inheritance 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)
void set_dpi (double dpi_x, double dpi_y)
void write (const guint8* buf, gsize count)
void close ()
Glib::ustring get_base_uri () const
void set_base_uri (const Glib::ustring& base_uri)
void get_dimensions (DimensionData& dimension_data) const
bool get_dimensions_sub (DimensionData& dimension_data, const Glib::ustring& id) const
bool get_position_sub (PositionData& position_data, const Glib::ustring& id) const
bool has_sub (const Glib::ustring& id) const
bool render (const Cairo::RefPtr<Cairo::Context>& cr) const
bool render_sub (const Cairo::RefPtr<Cairo::Context>& cr, const Glib::ustring& id) const
Glib::ustring get_title () const
Glib::ustring get_desc () const
Glib::ustring get_metadata () const
Glib::PropertyProxy<double> property_dpi_x ()
Glib::PropertyProxy_ReadOnly
<double> 
property_dpi_x () const
Glib::PropertyProxy<double> property_dpi_y ()
Glib::PropertyProxy_ReadOnly
<double> 
property_dpi_y () const
Glib::PropertyProxy
<Glib::ustring> 
property_base_uri ()
Glib::PropertyProxy_ReadOnly
<Glib::ustring> 
property_base_uri () const
Glib::PropertyProxy_ReadOnly<int> property_width () const
Glib::PropertyProxy_ReadOnly<int> property_height () const
Glib::PropertyProxy_ReadOnly
<double> 
property_em () const
Glib::PropertyProxy_ReadOnly
<double> 
property_ex () const
Glib::PropertyProxy_ReadOnly
<Glib::ustring> 
property_title () const
Glib::PropertyProxy_ReadOnly
<Glib::ustring> 
property_desc () const
Glib::PropertyProxy_ReadOnly
<Glib::ustring> 
property_metadata () const

Static Public Member Functions

static Glib::RefPtr<Handlecreate ()
static Glib::RefPtr<Handlecreate_from_data (const guint8* data, gsize data_len)
static Glib::RefPtr<Handlecreate_from_file (const std::string& 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)


Constructor & Destructor Documentation

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

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


Member Function Documentation

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

Provides access to the underlying C GObject.

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

Provides access to the underlying C GObject.

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.

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.

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.

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.

Parameters:
dpi Dots Per Inch (aka Pixels Per Inch).

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.

Parameters:
dpi_x Dots Per Inch (aka Pixels Per Inch).
dpi_y 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.

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.

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

Gets the base uri for this Rsvg::Handle.

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

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: 2.9

Parameters:
base_uri The base uri.

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.

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.

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.

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.

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.

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

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

Draws a SVG to a Cairo surface

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

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.

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

Returns: The SVG's title

Returns:
The SVG's title

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

Returns: The SVG's description

Returns:
The SVG's description

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

Returns: The SVG's title

Returns:
The SVG's title
Since: 2.9.

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_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_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_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<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_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_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.

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<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<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<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<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.


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 Sun Aug 2 17:51:56 2009 for librsvgmm by  doxygen 1.5.4