Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Util::GlibValue Namespace Reference

Functions

template<class T >
GType type ()
 Returns the type used for storing an object of type T inside a value.
 
template<typename T >
bool holds (GValue const *value)
 Tests whether a value contains an object of type T.
 
template<typename T >
bool holds (Glib::ValueBase const &value)
 Tests whether a value contains an object of type T.
 
template<typename T >
T * get (GValue *value)
 Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.
 
template<typename T >
T * get (Glib::ValueBase &value)
 Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.
 
template<typename T >
T const * get (GValue const *value)
 Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.
 
template<typename T >
T const * get (Glib::ValueBase const &value)
 Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.
 
template<typename T >
Glib::ValueBase own (std::unique_ptr< T > t)
 Return a value containing and taking ownership of the given T instance.
 
template<typename T , typename... Args>
Glib::ValueBase create (Args &&... args)
 Return a value containing and owning a newly-created T instance.
 
GValue release (Glib::ValueBase &&value)
 Release the value from its owning wrapper, leaving the original in an empty state.
 
template<typename T >
std::unique_ptr< T > from_content_provider (Gdk::ContentProvider const &content_provider)
 Attempt to get a value of type T from a content provider, returning it on success, otherwise nullptr.
 

Function Documentation

◆ create()

template<typename T , typename... Args>
Glib::ValueBase Inkscape::Util::GlibValue::create ( Args &&...  args)

Return a value containing and owning a newly-created T instance.

Definition at line 112 of file value-utils.h.

References own().

◆ from_content_provider()

template<typename T >
std::unique_ptr< T > Inkscape::Util::GlibValue::from_content_provider ( Gdk::ContentProvider const &  content_provider)

Attempt to get a value of type T from a content provider, returning it on success, otherwise nullptr.

Definition at line 125 of file value-utils.h.

References from_content_provider().

Referenced by from_content_provider().

◆ get() [1/4]

template<typename T >
T * Inkscape::Util::GlibValue::get ( Glib::ValueBase &  value)

Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.

Definition at line 74 of file value-utils.h.

References get().

◆ get() [2/4]

template<typename T >
T const * Inkscape::Util::GlibValue::get ( Glib::ValueBase const &  value)

Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.

Definition at line 91 of file value-utils.h.

References get().

◆ get() [3/4]

template<typename T >
T * Inkscape::Util::GlibValue::get ( GValue *  value)

Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.

Definition at line 64 of file value-utils.h.

References get().

Referenced by get(), get(), get(), and get().

◆ get() [4/4]

template<typename T >
T const * Inkscape::Util::GlibValue::get ( GValue const *  value)

Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.

Definition at line 81 of file value-utils.h.

References get().

◆ holds() [1/2]

template<typename T >
bool Inkscape::Util::GlibValue::holds ( Glib::ValueBase const &  value)

Tests whether a value contains an object of type T.

Definition at line 57 of file value-utils.h.

References holds().

◆ holds() [2/2]

template<typename T >
bool Inkscape::Util::GlibValue::holds ( GValue const *  value)

Tests whether a value contains an object of type T.

Definition at line 50 of file value-utils.h.

References holds().

Referenced by holds(), and holds().

◆ own()

template<typename T >
Glib::ValueBase Inkscape::Util::GlibValue::own ( std::unique_ptr< T >  t)

Return a value containing and taking ownership of the given T instance.

The argument must not be null.

Definition at line 101 of file value-utils.h.

References own().

Referenced by create(), and own().

◆ release()

GValue Inkscape::Util::GlibValue::release ( Glib::ValueBase &&  value)
inline

Release the value from its owning wrapper, leaving the original in an empty state.

Definition at line 118 of file value-utils.h.

References release().

Referenced by release().

◆ type()

template<class T >
GType Inkscape::Util::GlibValue::type ( )

Returns the type used for storing an object of type T inside a value.

Definition at line 29 of file value-utils.h.

References name, and type().

Referenced by type().