GtkSnapshot: Add getters

These getters can be useful when creating new snapshots
in a snapshot() vfunc.
This commit is contained in:
Matthias Clasen 2018-03-11 00:17:53 -05:00
parent 890cd45ce4
commit 7c18911c00
4 changed files with 23 additions and 3 deletions

View File

@ -4171,6 +4171,8 @@ gtk_snapshot_ref
gtk_snapshot_unref
gtk_snapshot_to_node
gtk_snapshot_free_to_node
gtk_snapshot_get_renderer
gtk_snapshot_get_record_names
gtk_snapshot_push
gtk_snapshot_push_transform
gtk_snapshot_push_opacity

View File

@ -1223,11 +1223,26 @@ gtk_snapshot_pop (GtkSnapshot *snapshot)
* Returns: (transfer none): the #GskRenderer
*/
GskRenderer *
gtk_snapshot_get_renderer (const GtkSnapshot *snapshot)
gtk_snapshot_get_renderer (GtkSnapshot *snapshot)
{
return snapshot->renderer;
}
/**
* gtk_snapshot_get_record_names:
* @snapshot: a #GtkSnapshot
*
* Obtains whether the snapshot is recording names
* for debugging.
*
* Returns: whether the snapshot records names
*/
gboolean
gtk_snapshot_get_record_names (GtkSnapshot *snapshot)
{
return snapshot->record_names;
}
/**
* gtk_snapshot_offset:
* @snapshot: a $GtkSnapshot

View File

@ -56,6 +56,11 @@ GskRenderNode * gtk_snapshot_free_to_node (GtkSnapshot
GDK_AVAILABLE_IN_ALL
GskRenderNode * gtk_snapshot_to_node (GtkSnapshot *snapshot);
GDK_AVAILABLE_IN_ALL
GskRenderer * gtk_snapshot_get_renderer (GtkSnapshot *snapshot);
GDK_AVAILABLE_IN_ALL
gboolean gtk_snapshot_get_record_names (GtkSnapshot *snapshot);
GDK_AVAILABLE_IN_ALL
void gtk_snapshot_push (GtkSnapshot *snapshot,
gboolean keep_coordinates,

View File

@ -88,8 +88,6 @@ struct _GtkSnapshot {
GPtrArray *nodes;
};
GskRenderer * gtk_snapshot_get_renderer (const GtkSnapshot *snapshot);
G_END_DECLS
#endif /* __GTK_SNAPSHOT_PRIVATE_H__ */