mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 14:50:06 +00:00
widget: Remove gtk_widget_draw()
If you want to draw a widget to cairo today, you create a widget paintable, snapshot it to a render node and then draw the render node to cairo. And yes, this is that complicated on purpose. Don't draw widgets to Cairo.
This commit is contained in:
parent
4a513b7800
commit
c06a790694
@ -4238,7 +4238,6 @@ gtk_widget_map
|
|||||||
gtk_widget_unmap
|
gtk_widget_unmap
|
||||||
gtk_widget_realize
|
gtk_widget_realize
|
||||||
gtk_widget_unrealize
|
gtk_widget_unrealize
|
||||||
gtk_widget_draw
|
|
||||||
gtk_widget_queue_draw
|
gtk_widget_queue_draw
|
||||||
gtk_widget_queue_resize
|
gtk_widget_queue_resize
|
||||||
gtk_widget_queue_resize_no_redraw
|
gtk_widget_queue_resize_no_redraw
|
||||||
|
@ -5379,46 +5379,6 @@ gtk_widget_draw_internal (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_widget_draw:
|
|
||||||
* @widget: the widget to draw. It must be drawable (see
|
|
||||||
* gtk_widget_is_drawable()) and a size must have been allocated.
|
|
||||||
* @cr: a cairo context to draw to
|
|
||||||
*
|
|
||||||
* Draws @widget to @cr. The top left corner of the widget will be
|
|
||||||
* drawn to the currently set origin point of @cr.
|
|
||||||
*
|
|
||||||
* You should pass a cairo context as @cr argument that is in an
|
|
||||||
* original state. Otherwise the resulting drawing is undefined. For
|
|
||||||
* example changing the operator using cairo_set_operator() or the
|
|
||||||
* line width using cairo_set_line_width() might have unwanted side
|
|
||||||
* effects.
|
|
||||||
* You may however change the context’s transform matrix - like with
|
|
||||||
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
|
|
||||||
* region with cairo_clip() prior to calling this function. Also, it
|
|
||||||
* is fine to modify the context with cairo_save() and
|
|
||||||
* cairo_push_group() prior to calling this function.
|
|
||||||
*
|
|
||||||
* Note that special-purpose widgets may contain special code for
|
|
||||||
* rendering to the screen and might appear differently on screen
|
|
||||||
* and when rendered using gtk_widget_draw().
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
gtk_widget_draw (GtkWidget *widget,
|
|
||||||
cairo_t *cr)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
||||||
g_return_if_fail (!widget->priv->alloc_needed);
|
|
||||||
g_return_if_fail (!widget->priv->alloc_needed_on_child);
|
|
||||||
g_return_if_fail (cr != NULL);
|
|
||||||
|
|
||||||
cairo_save (cr);
|
|
||||||
|
|
||||||
gtk_widget_draw_internal (widget, cr);
|
|
||||||
|
|
||||||
cairo_restore (cr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_widget_real_key_press_event (GtkWidget *widget,
|
gtk_widget_real_key_press_event (GtkWidget *widget,
|
||||||
GdkEventKey *event)
|
GdkEventKey *event)
|
||||||
|
@ -408,9 +408,6 @@ void gtk_widget_realize (GtkWidget *widget);
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_widget_unrealize (GtkWidget *widget);
|
void gtk_widget_unrealize (GtkWidget *widget);
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_widget_draw (GtkWidget *widget,
|
|
||||||
cairo_t *cr);
|
|
||||||
/* Queuing draws */
|
/* Queuing draws */
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_widget_queue_draw (GtkWidget *widget);
|
void gtk_widget_queue_draw (GtkWidget *widget);
|
||||||
|
Loading…
Reference in New Issue
Block a user