gtkmm
3.93.0
|
Auxiliary object for snapshots. More...
#include <gtkmm/snapshot.h>
Public Member Functions | |
void | push (bool keep_coordinates, const Glib::ustring& name) |
Creates a new render node, appends it to the current render node of the snapshot, and makes it the new current render node. More... | |
void | push_cross_fade (double progress, const Glib::ustring& name) |
Snapshots a cross-fade operation between two images with the given progress. More... | |
void | pop () |
Removes the top element from the stack of render nodes, and appends it to the node underneath it. More... | |
void | offset (int x, int y) |
Appends a translation by ( x, y) to the current transformation. More... | |
void | get_offset (int& x, int& y) const |
Queries the offset managed by snapshot. More... | |
Cairo::RefPtr< Cairo::Context > | append_cairo (const graphene_rect_t* bounds, const Glib::ustring& name) |
Creates a new render node and appends it to the current render node of the snapshot, without changing the current node. More... | |
Cairo::RefPtr< Cairo::Context > | append_cairo (const Gdk::Rectangle& bounds, const Glib::ustring& name) |
Creates a new render node and appends it to the current render node of the snapshot, without changing the current node. More... | |
bool | clips_rect (const Gdk::Rectangle& bounds) const |
Tests whether the rectangle is entirely outside the clip region of snapshot. More... | |
void | render_backgrount (const Glib::RefPtr< StyleContext >& context, double x, double y, double width, double height) |
Creates a render node for the CSS background according to context, and appends it to the current node of snapshot, without changing the current node. More... | |
void | render_frame (const Glib::RefPtr< StyleContext >& context, double x, double y, double width, double height) |
Creates a render node for the CSS border according to context, and appends it to the current node of snapshot, without changing the current node. More... | |
void | render_focus (const Glib::RefPtr< StyleContext >& context, double x, double y, double width, double height) |
Creates a render node for the focus outline according to context, and appends it to the current node of snapshot, without changing the current node. More... | |
void | render_layout (const Glib::RefPtr< StyleContext >& context, double x, double y, const Glib::RefPtr< Pango::Layout >& layout) |
Creates a render node for rendering layout according to the style information in context, and appends it to the current node of snapshot, without changing the current node. More... | |
void | render_insertion_cursor (const Glib::RefPtr< StyleContext >& context, double x, double y, const Glib::RefPtr< Pango::Layout >& layout, int index, Pango::Direction direction) |
Draws a text caret using snapshot at the specified index of layout. More... | |
GtkSnapshot* | gobj () |
Provides access to the underlying C instance. More... | |
const GtkSnapshot* | gobj () const |
Provides access to the underlying C instance. More... | |
Snapshot ()=delete | |
Snapshot (const Snapshot&)=delete | |
Snapshot& | operator= (const Snapshot&)=delete |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Snapshot* | wrap (GtkSnapshot* gobject) |
A C++ wrapper for the C object. More... | |
Auxiliary object for snapshots.
Snapshot is an auxiliary object that assists in creating GskRenderNodes in the Gtk::WidgetCustomSnapshot::snapshot_vfunc(). It functions in a similar way to a cairo context, and maintains a stack of render nodes and their associated transformations.
The node at the top of the stack is the the one that append_node() operates on. Use the push() and pop() functions to change the current node.
The only way to obtain a Snapshot object is as an argument to Gtk::WidgetCustomSnapshot::snapshot_vfunc().
|
delete |
|
delete |
Cairo::RefPtr<Cairo::Context> Gtk::Snapshot::append_cairo | ( | const graphene_rect_t * | bounds, |
const Glib::ustring & | name | ||
) |
Creates a new render node and appends it to the current render node of the snapshot, without changing the current node.
bounds | The bounds for the new node. |
name | The name for the new node, or an empty string for no name. |
Cairo::RefPtr<Cairo::Context> Gtk::Snapshot::append_cairo | ( | const Gdk::Rectangle& | bounds, |
const Glib::ustring & | name | ||
) |
Creates a new render node and appends it to the current render node of the snapshot, without changing the current node.
bounds | The bounds for the new node. |
name | The name for the new node, or an empty string for no name. |
bool Gtk::Snapshot::clips_rect | ( | const Gdk::Rectangle& | bounds | ) | const |
Tests whether the rectangle is entirely outside the clip region of snapshot.
bounds | A rectangle. |
true
if bounds is entirely outside the clip region. void Gtk::Snapshot::get_offset | ( | int & | x, |
int & | y | ||
) | const |
Queries the offset managed by snapshot.
This offset is the accumulated sum of calls to offset().
Use this offset to determine how to offset nodes that you manually add to the snapshot using gtk_snapshot_append().
Note that other functions that add nodes for you, such as append_cairo() will add this offset for you.
x | Return location for x offset. |
y | Return location for y offset. |
GtkSnapshot* Gtk::Snapshot::gobj | ( | ) |
Provides access to the underlying C instance.
const GtkSnapshot* Gtk::Snapshot::gobj | ( | ) | const |
Provides access to the underlying C instance.
void Gtk::Snapshot::offset | ( | int | x, |
int | y | ||
) |
Appends a translation by ( x, y) to the current transformation.
x | Horizontal translation. |
y | Vertical translation. |
void Gtk::Snapshot::pop | ( | ) |
Removes the top element from the stack of render nodes, and appends it to the node underneath it.
void Gtk::Snapshot::push | ( | bool | keep_coordinates, |
const Glib::ustring & | name | ||
) |
Creates a new render node, appends it to the current render node of the snapshot, and makes it the new current render node.
keep_coordinates | If true , the current offset and clip will be kept. Otherwise, the clip will be unset and the offset will be reset to (0, 0). |
name | The name for the new node, or an empty string for no name. |
void Gtk::Snapshot::push_cross_fade | ( | double | progress, |
const Glib::ustring & | name | ||
) |
Snapshots a cross-fade operation between two images with the given progress.
Until the first call to pop(), the start image will be the snapshot. After that call, the end image will be recorded until the second call to pop().
Calling this function requires 2 calls to pop().
progress | Progress between 0.0 and 1.0. |
name | The name of the pushed node, or an empty string for no name. |
void Gtk::Snapshot::render_backgrount | ( | const Glib::RefPtr< StyleContext >& | context, |
double | x, | ||
double | y, | ||
double | width, | ||
double | height | ||
) |
Creates a render node for the CSS background according to context, and appends it to the current node of snapshot, without changing the current node.
context | The Gtk::StyleContext to use. |
x | X origin of the rectangle. |
y | Y origin of the rectangle. |
width | Rectangle width. |
height | Rectangle height. |
void Gtk::Snapshot::render_focus | ( | const Glib::RefPtr< StyleContext >& | context, |
double | x, | ||
double | y, | ||
double | width, | ||
double | height | ||
) |
Creates a render node for the focus outline according to context, and appends it to the current node of snapshot, without changing the current node.
context | The Gtk::StyleContext to use. |
x | X origin of the rectangle. |
y | Y origin of the rectangle. |
width | Rectangle width. |
height | Rectangle height. |
void Gtk::Snapshot::render_frame | ( | const Glib::RefPtr< StyleContext >& | context, |
double | x, | ||
double | y, | ||
double | width, | ||
double | height | ||
) |
Creates a render node for the CSS border according to context, and appends it to the current node of snapshot, without changing the current node.
context | The Gtk::StyleContext to use. |
x | X origin of the rectangle. |
y | Y origin of the rectangle. |
width | Rectangle width. |
height | Rectangle height. |
void Gtk::Snapshot::render_insertion_cursor | ( | const Glib::RefPtr< StyleContext >& | context, |
double | x, | ||
double | y, | ||
const Glib::RefPtr< Pango::Layout > & | layout, | ||
int | index, | ||
Pango::Direction | direction | ||
) |
Draws a text caret using snapshot at the specified index of layout.
context | A Gtk::StyleContext. |
x | X origin. |
y | Y origin. |
layout | The Pango::Layout of the text. |
index | The index in the Pango::Layout. |
direction | The Pango::Direction of the text. |
void Gtk::Snapshot::render_layout | ( | const Glib::RefPtr< StyleContext >& | context, |
double | x, | ||
double | y, | ||
const Glib::RefPtr< Pango::Layout > & | layout | ||
) |
Creates a render node for rendering layout according to the style information in context, and appends it to the current node of snapshot, without changing the current node.
context | The Gtk::StyleContext to use. |
x | X origin of the rectangle. |
y | Y origin of the rectangle. |
layout | The Pango::Layout to render. |
|
related |
A C++ wrapper for the C object.
gobject | The C instance. |