gtkmm: Gdk::Cursor Class Reference
This represents a cursor. More...
#include <gdkmm/cursor.h>

Public Member Functions |
|
Cursor ( Cursor && src) noexcept | |
Cursor & | operator= ( Cursor && src) noexcept |
~Cursor () noexceptoverride | |
GdkCursor* | gobj () |
Provides access to the underlying C GObject.
More...
|
|
const GdkCursor* | gobj () const |
Provides access to the underlying C GObject.
More...
|
|
GdkCursor* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
More...
|
|
Glib::RefPtr < Display > | get_display () |
Returns the display on which the
Gdk::Cursor
is defined.
More...
|
|
Glib::RefPtr < const Display > | get_display () const |
Returns the display on which the
Gdk::Cursor
is defined.
More...
|
|
Glib::RefPtr < Gdk::Pixbuf > | get_image () |
Returns a
Gdk::Pixbuf
with the image used to display the cursor.
More...
|
|
Glib::RefPtr < const Gdk::Pixbuf > | get_image () const |
Returns a
Gdk::Pixbuf
with the image used to display the cursor.
More...
|
|
:: Cairo::RefPtr < :: Cairo::Surface > | get_surface (double& x_hot, double& y_hot) |
Returns a cairo image surface with the image used to display the cursor.
More...
|
|
:: Cairo::RefPtr < const :: Cairo::Surface > | get_surface (double& x_hot, double& y_hot) const |
Returns a cairo image surface with the image used to display the cursor.
More...
|
|
CursorType | get_cursor_type () const |
Returns the cursor type for this cursor.
More...
|
|
![]() |
|
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object ( Object &&src) noexcept | |
Object & | operator= ( Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr < Glib::Object > | wrap (GObject *object, bool take_copy=false) |
![]() |
|
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot < void > &slot) |
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot < void > &&slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot < void > &slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot < void > &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
![]() |
|
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable ( trackable &&src) | |
~trackable () | |
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= ( trackable &&src) |
void | remove_destroy_notify_callback (void *data) const |
Static Public Member Functions |
|
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system.
More...
|
|
static Glib::RefPtr < Cursor > | create ( CursorType cursor_type) |
Creates a new cursor from the set of builtin cursors for the default display.
More...
|
|
static Glib::RefPtr < Cursor > | create (const Glib::RefPtr < Display >& display, CursorType cursor_type) |
Creates a new cursor from the set of builtin cursors.
More...
|
|
static Glib::RefPtr < Cursor > | create (const Glib::RefPtr < Display >& display, const Glib::RefPtr < Pixbuf >& pixbuf, int x, int y) |
Creates a new cursor from a pixbuf.
More...
|
|
static Glib::RefPtr < Cursor > | create (const Glib::RefPtr < Display >& display, const :: Cairo::RefPtr < :: Cairo::Surface >& surface, double x, double y) |
Creates a new cursor from a cairo image surface.
More...
|
|
static Glib::RefPtr < Cursor > | create (const Glib::RefPtr < Display >& display, const Glib::ustring & name) |
Creates a new cursor by looking up
name
in the current cursor theme.
More...
|
|
Protected Member Functions |
|
Cursor (const Glib::RefPtr < Display >& display, const Glib::ustring & name) | |
![]() |
|
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexceptoverride | |
![]() |
|
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase ( ObjectBase &&src) noexcept | |
ObjectBase & | operator= ( ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Functions |
|
(Note that these are not member functions.) |
|
Glib::RefPtr < Gdk::Cursor > | wrap (GdkCursor* object, bool take_copy=false) |
A
Glib::wrap()
method for this object.
More...
|
|
Additional Inherited Members |
|
![]() |
|
typedef void(*)(gpointer data | DestroyNotify ) |
![]() |
|
typedef internal::func_destroy_notify | func_destroy_notify |
Detailed Description
This represents a cursor.
Constructor & Destructor Documentation
|
noexcept |
|
override noexcept |
|
explicit protected |
Member Function Documentation
|
static |
Creates a new cursor from the set of builtin cursors for the default display.
See new_for_display().
To make the cursor invisible, use Gdk::BLANK_CURSOR .
Deprecated: 3.16: Use new_for_display() instead.
- Deprecated:
- Use the constructor that takes a Display instead.
- Parameters
-
cursor_type Cursor to create.
- Returns
- A new Gdk::Cursor .
|
static |
Creates a new cursor from the set of builtin cursors.
- Parameters
-
display The Gdk::Display for which the cursor will be created. cursor_type Cursor to create.
- Returns
- A new Gdk::Cursor .
|
static |
Creates a new cursor from a pixbuf.
Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions Gdk::Display::supports_cursor_alpha() and Gdk::Display::supports_cursor_color() can be used to determine whether RGBA cursors are supported; Gdk::Display::get_default_cursor_size() and Gdk::Display::get_maximal_cursor_size() give information about cursor sizes.
If
x
or
y
are
-1
, the pixbuf must have options named “x_hot” and “y_hot”, resp., containing integer values between
0
and the width resp. height of the pixbuf. (Since: 3.0)
On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
- Parameters
-
display The Gdk::Display for which the cursor will be created. pixbuf The Gdk::Pixbuf containing the cursor image. x The horizontal offset of the “hotspot” of the cursor. y The vertical offset of the “hotspot” of the cursor.
- Returns
- A new Gdk::Cursor .
|
static |
Creates a new cursor from a cairo image surface.
Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions Gdk::Display::supports_cursor_alpha() and Gdk::Display::supports_cursor_color() can be used to determine whether RGBA cursors are supported; Gdk::Display::get_default_cursor_size() and Gdk::Display::get_maximal_cursor_size() give information about cursor sizes.
On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
- Parameters
-
display The Gdk::Display for which the cursor will be created. surface The cairo image surface containing the cursor pixel data. x The horizontal offset of the “hotspot” of the cursor. y The vertical offset of the “hotspot” of the cursor.
- Returns
- A new Gdk::Cursor .
|
static |
Creates a new cursor by looking up name in the current cursor theme.
A recommended set of cursor names that will work across different platforms can be found in the CSS specification:
- "none"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
display The Gdk::Display for which the cursor will be created. name The name of the cursor.
- Returns
-
A new
Gdk::Cursor
, or
nullptr
if there is no cursor with the given name.
CursorType Gdk::Cursor::get_cursor_type | ( | ) | const |
Glib::RefPtr < Display > Gdk::Cursor::get_display | ( | ) |
Returns the display on which the Gdk::Cursor is defined.
- Returns
- The Gdk::Display associated to cursor .
Glib::RefPtr <const Display > Gdk::Cursor::get_display | ( | ) | const |
Returns the display on which the Gdk::Cursor is defined.
- Returns
- The Gdk::Display associated to cursor .
Glib::RefPtr < Gdk::Pixbuf > Gdk::Cursor::get_image | ( | ) |
Returns a Gdk::Pixbuf with the image used to display the cursor.
Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nullptr
is returned.
- Returns
-
A
Gdk::Pixbuf
representing
cursor
, or
nullptr
.
Glib::RefPtr <const Gdk::Pixbuf > Gdk::Cursor::get_image | ( | ) | const |
Returns a Gdk::Pixbuf with the image used to display the cursor.
Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nullptr
is returned.
- Returns
-
A
Gdk::Pixbuf
representing
cursor
, or
nullptr
.
:: Cairo::RefPtr < :: Cairo::Surface > Gdk::Cursor::get_surface | ( | double & | x_hot , |
double & | y_hot | ||
) |
Returns a cairo image surface with the image used to display the cursor.
Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nullptr
is returned.
- Parameters
-
x_hot Location to store the hotspot x position, or nullptr
.y_hot Location to store the hotspot y position, or nullptr
.
- Returns
-
A #cairo_surface_t representing
cursor
, or
nullptr
.
:: Cairo::RefPtr <const :: Cairo::Surface > Gdk::Cursor::get_surface | ( | double & | x_hot , |
double & | y_hot | ||
) | const |
Returns a cairo image surface with the image used to display the cursor.
Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nullptr
is returned.
- Parameters
-
x_hot Location to store the hotspot x position, or nullptr
.y_hot Location to store the hotspot y position, or nullptr
.
- Returns
-
A #cairo_surface_t representing
cursor
, or
nullptr
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GdkCursor* Gdk::Cursor::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Friends And Related Function Documentation
|
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.