From 14bff8d023891ad6cd02e5986dae4368dfdef80b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 19 Apr 2017 16:23:08 +0100 Subject: replace redraw and update methods with invalidate in window table API --- include/netsurf/window.h | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/netsurf/window.h b/include/netsurf/window.h index b88736807..434a79584 100644 --- a/include/netsurf/window.h +++ b/include/netsurf/window.h @@ -98,21 +98,23 @@ struct gui_window_table { void (*destroy)(struct gui_window *gw); /** - * Force a redraw of the entire contents of a window. + * Invalidate an area of a window. * - * @todo this API should be merged with update. + * The specified area of the window should now be considered + * out of date. If the area is NULL the entire window must be + * invalidated. It is expected that the windowing system will + * then subsequently cause redraw/expose operations as + * necessary. * - * \param g gui_window to redraw - */ - void (*redraw)(struct gui_window *g); - - /** - * Redraw an area of a window. + * \note the frontend should not attempt to actually start the + * redraw operations as a result of this callback because the + * core redraw functions may already be threaded. * * \param g gui_window - * \param rect area to redraw + * \param rect area to redraw or NULL for the entire window area + * \return NSERROR_OK on success or appropriate error code */ - void (*update)(struct gui_window *g, const struct rect *rect); + nserror (*invalidate)(struct gui_window *g, const struct rect *rect); /** * Get the scroll position of a browser window. @@ -289,7 +291,7 @@ struct gui_window_table { /** * Called when the gui_window has new content. * - * \param g the gui_window that has new content + * \param g the gui_window that has new content */ void (*new_content)(struct gui_window *g); @@ -303,13 +305,19 @@ struct gui_window_table { */ void (*file_gadget_open)(struct gui_window *g, struct hlcache_handle *hl, struct form_control *gadget); - /** object dragged to window*/ + /** + * object dragged to window + */ void (*drag_save_object)(struct gui_window *g, struct hlcache_handle *c, gui_save_type type); - /** drag selection save */ + /** + * drag selection save + */ void (*drag_save_selection)(struct gui_window *g, const char *selection); - /** selection started */ + /** + * selection started + */ void (*start_selection)(struct gui_window *g); }; -- cgit v1.2.3