![]() |
![]() |
Public Member Functions | ||||
const guint8* | get_data () const | |||
std::string | get_data_as_string () const | |||
std::string | get_data_type () const | |||
Returns the type of the data as set by SelectionData::set(). | ||||
Glib::RefPtr<const Gdk::Display> | get_display () const | |||
Glib::RefPtr<Gdk::Display> | get_display () | |||
int | get_format () const | |||
int | get_length () const | |||
Glib::RefPtr<const Gdk::Pixbuf> | get_pixbuf () const | |||
Gets the contents of the selection data as a Gdk::Pixbuf. | ||||
Glib::RefPtr<Gdk::Pixbuf> | get_pixbuf () | |||
Gets the contents of the selection data as a Gdk::Pixbuf. | ||||
GdkAtom | get_selection () const | |||
Returns the ID of the selection. | ||||
std::string | get_target () const | |||
Glib::StringArrayHandle | get_targets () const | |||
See also Gtk::Clipboard::request_targets(). | ||||
Glib::ustring | get_text () const | |||
Gets the contents of the selection data as a UTF-8 string. | ||||
Glib::StringArrayHandle | get_uris () const | |||
Gets the contents of the selection data as array of URIs. | ||||
const GtkSelectionData* | gobj () const | |||
Provides access to the underlying C instance. | ||||
GtkSelectionData* | gobj () | |||
Provides access to the underlying C instance. | ||||
GtkSelectionData* | gobj_copy () const | |||
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. | ||||
SelectionData& | operator= (const SelectionData& other) | |||
SelectionData (const SelectionData& other) | ||||
SelectionData (GtkSelectionData* gobject, bool make_a_copy=true) | ||||
SelectionData () | ||||
void | set (const std::string& type, const std::string& data) | |||
Assign a string of raw data. | ||||
void | set (const std::string& type, int format, const guint8* data, int length) | |||
Assign a memory block of raw data. | ||||
void | set (int format, const guint8* data, int length) | |||
bool | set_pixbuf (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) | |||
Sets the contents of the selection from a Gdk::Pixbuf The pixbuf is converted to the form determined by selection_data ->target. | ||||
bool | set_text (const Glib::ustring& data) | |||
Assign UTF-8 encoded text. | ||||
bool | set_uris (const Glib::StringArrayHandle& uris) | |||
Sets the contents of the selection from a list of URIs. | ||||
void | swap (SelectionData& other) | |||
bool | targets_include_image (bool writable=true) const | |||
Given a Gtk::SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide a Gdk::Pixbuf. | ||||
bool | targets_include_rich_text (const Glib::RefPtr<TextBuffer>& buffer) const | |||
bool | targets_include_text () const | |||
Given a Gtk::SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide text. | ||||
bool | targets_include_uri () const | |||
~SelectionData () | ||||
Protected Attributes | ||||
GtkSelectionData* | gobject_ | |||
Related Functions | ||||
(Note that these are not member functions.) | ||||
void | swap (SelectionData& lhs, SelectionData& rhs) | |||
| ||||
Gtk::SelectionData | wrap (GtkSelectionData* object, bool take_copy=false) | |||
A Glib::wrap() method for this object. |
Gtk::SelectionData::SelectionData | ( | ) |
Gtk::SelectionData::SelectionData | ( | GtkSelectionData * | gobject, | |
bool | make_a_copy = true | |||
) | [explicit] |
Gtk::SelectionData::SelectionData | ( | const SelectionData& | other | ) |
Gtk::SelectionData::~SelectionData | ( | ) |
const guint8* Gtk::SelectionData::get_data | ( | ) | const |
std::string Gtk::SelectionData::get_data_as_string | ( | ) | const |
std::string Gtk::SelectionData::get_data_type | ( | ) | const |
Returns the type of the data as set by SelectionData::set().
Glib::RefPtr<const Gdk::Display> Gtk::SelectionData::get_display | ( | ) | const |
Glib::RefPtr<Gdk::Display> Gtk::SelectionData::get_display | ( | ) |
int Gtk::SelectionData::get_format | ( | ) | const |
int Gtk::SelectionData::get_length | ( | ) | const |
Glib::RefPtr<const Gdk::Pixbuf> Gtk::SelectionData::get_pixbuf | ( | ) | const |
Gets the contents of the selection data as a Gdk::Pixbuf.
0
. If the result is non-0
it must be freed with Glib::object_unref().Glib::RefPtr<Gdk::Pixbuf> Gtk::SelectionData::get_pixbuf | ( | ) |
Gets the contents of the selection data as a Gdk::Pixbuf.
0
. If the result is non-0
it must be freed with Glib::object_unref().GdkAtom Gtk::SelectionData::get_selection | ( | ) | const |
Returns the ID of the selection.
std::string Gtk::SelectionData::get_target | ( | ) | const |
Glib::StringArrayHandle Gtk::SelectionData::get_targets | ( | ) | const |
See also Gtk::Clipboard::request_targets().
Glib::ustring Gtk::SelectionData::get_text | ( | ) | const |
Gets the contents of the selection data as a UTF-8 string.
Glib::StringArrayHandle Gtk::SelectionData::get_uris | ( | ) | const |
Gets the contents of the selection data as array of URIs.
0
-terminated string array containing the URIs, otherwise 0
. If the result is non-0
it must be freed with Glib::strfreev().const GtkSelectionData* Gtk::SelectionData::gobj | ( | ) | const [inline] |
Provides access to the underlying C instance.
GtkSelectionData* Gtk::SelectionData::gobj | ( | ) | [inline] |
Provides access to the underlying C instance.
GtkSelectionData* Gtk::SelectionData::gobj_copy | ( | ) | const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
SelectionData& Gtk::SelectionData::operator= | ( | const SelectionData& | other | ) |
void Gtk::SelectionData::set | ( | const std::string & | type, | |
const std::string & | data | |||
) |
Assign a string of raw data.
Store new data into the Gtk::SelectionData object. Should _only_ by called from a selection handler callback.
type | The type of the selection. | |
data | A string that contains the data (does not have to be text). |
void Gtk::SelectionData::set | ( | const std::string & | type, | |
int | format, | |||
const guint8 * | data, | |||
int | length | |||
) |
Assign a memory block of raw data.
Store new data into the Gtk::SelectionData object. Should _only_ by called from a selection handler callback. A 0-byte terminates the stored data.
type | The type of the selection. | |
format | The data format, i.e. the number of bits in a unit. | |
data | Pointer to the data (will be copied). | |
length | The length of the data block in bytes. |
void Gtk::SelectionData::set | ( | int | format, | |
const guint8 * | data, | |||
int | length | |||
) |
bool Gtk::SelectionData::set_pixbuf | ( | const Glib::RefPtr<Gdk::Pixbuf>& | pixbuf | ) |
Sets the contents of the selection from a Gdk::Pixbuf The pixbuf is converted to the form determined by selection_data ->target.
pixbuf | A Gdk::Pixbuf. |
true
if the selection was successfully set, otherwise false
.bool Gtk::SelectionData::set_text | ( | const Glib::ustring & | data | ) |
Assign UTF-8 encoded text.
Sets the contents of the selection from a UTF-8 encoded string. The string is converted to the form determined by get_target().
data | A UTF-8 encoded string. |
true
if the selection was successfully set, otherwise false
. bool Gtk::SelectionData::set_uris | ( | const Glib::StringArrayHandle & | uris | ) |
Sets the contents of the selection from a list of URIs.
The string is converted to the form determined by selection_data ->target.
uris | A 0 -terminated array of strings hilding URIs. |
true
if the selection was successfully set, otherwise false
.void Gtk::SelectionData::swap | ( | SelectionData& | other | ) |
bool Gtk::SelectionData::targets_include_image | ( | bool | writable = true |
) | const |
Given a Gtk::SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide a Gdk::Pixbuf.
writable | Whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format. |
true
if selection_data holds a list of targets, and a suitable target for images is included, otherwise false
.bool Gtk::SelectionData::targets_include_rich_text | ( | const Glib::RefPtr<TextBuffer>& | buffer | ) | const |
bool Gtk::SelectionData::targets_include_text | ( | ) | const |
Given a Gtk::SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide text.
true
if selection_data holds a list of targets, and a suitable target for text is included, otherwise false
. bool Gtk::SelectionData::targets_include_uri | ( | ) | const |
void swap | ( | SelectionData& | lhs, | |
SelectionData& | rhs | |||
) | [related] |
lhs | The left-hand side |
rhs | The right-hand side |
Gtk::SelectionData wrap | ( | GtkSelectionData * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
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. |
GtkSelectionData* Gtk::SelectionData::gobject_ [protected] |