diff options
author | Benjamin Otte <otte@redhat.com> | 2016-11-18 05:45:36 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-11-18 06:40:53 +0100 |
commit | 5940625e9e55b713e2b112b558e447ac1d28644a (patch) | |
tree | b86e5752ec10ca7762b98a74d5f39bf1481d7c36 /gtk/gtkdrawingarea.h | |
parent | 41d1e1fea8ad2d33f355e1eafc69053972fcb279 (diff) | |
download | gtk+-5940625e9e55b713e2b112b558e447ac1d28644a.tar.gz |
drawingarea: Add gtk_drawing_area_set_draw_func()
Diffstat (limited to 'gtk/gtkdrawingarea.h')
-rw-r--r-- | gtk/gtkdrawingarea.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gtk/gtkdrawingarea.h b/gtk/gtkdrawingarea.h index 8307b370b9..7d0ebb0548 100644 --- a/gtk/gtkdrawingarea.h +++ b/gtk/gtkdrawingarea.h @@ -42,10 +42,32 @@ G_BEGIN_DECLS #define GTK_IS_DRAWING_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DRAWING_AREA)) #define GTK_DRAWING_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DRAWING_AREA, GtkDrawingAreaClass)) - typedef struct _GtkDrawingArea GtkDrawingArea; typedef struct _GtkDrawingAreaClass GtkDrawingAreaClass; +/** + * GtkDrawingAreaDrawFunc: + * @drawing_area: the #GtkDrawingArea to redraw + * @cr: the context to draw to + * @width: the actual width of the contents. This value will be at least + * as wide as GtkDrawingArea:width. + * @height: the actual height of the contents. This value will be at least + * as wide as GtkDrawingArea:height. + * @user_data: (closure): user data + * + * Whenever @drawing_area needs to redraw, this function will be called. + * + * This function should exclusively redraw the contents of the drawing area + * and must not call any widget functions that cause changes. + * + * Since: 3.90 + */ +typedef void (* GtkDrawingAreaDrawFunc) (GtkDrawingArea *drawing_area, + cairo_t *cr, + int width, + int height, + gpointer user_data); + struct _GtkDrawingArea { GtkWidget widget; @@ -78,6 +100,11 @@ void gtk_drawing_area_set_content_height (GtkDrawingArea int height); GDK_AVAILABLE_IN_3_90 int gtk_drawing_area_get_content_height (GtkDrawingArea *self); +GDK_AVAILABLE_IN_3_90 +void gtk_drawing_area_set_draw_func (GtkDrawingArea *self, + GtkDrawingAreaDrawFunc draw_func, + gpointer user_data, + GDestroyNotify destroy); G_END_DECLS |