summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-05-23 09:41:29 +0100
committerVincent Sanders <vince@kyllikki.org>2017-05-23 09:41:29 +0100
commitac732fb79d4fd92394dc09576c0390e10937617b (patch)
tree639130eb58f53768585c5d3e8b4a5b39e66a38d1 /include
parentbc42b2980115850ce93ee7cfa73460a63d25e444 (diff)
downloadnetsurf-ac732fb79d4fd92394dc09576c0390e10937617b.tar.gz
netsurf-ac732fb79d4fd92394dc09576c0390e10937617b.tar.bz2
update invalidate area core window API
slightly extends the invalidate core window API with error return and whole window invalidation. Also renames it to be more inline with browser window API call. cannot quite reuse browser window API yet as that applies scaling
Diffstat (limited to 'include')
-rw-r--r--include/netsurf/core_window.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/include/netsurf/core_window.h b/include/netsurf/core_window.h
index b6b012049..77d220b9c 100644
--- a/include/netsurf/core_window.h
+++ b/include/netsurf/core_window.h
@@ -20,7 +20,7 @@
* \file
* Interface to core window handling.
*
- * This provides a generallised API for frontends to implement which
+ * This provides a generalised API for frontends to implement which
* allows them to provide a single implementation for general window
* operations on their platform.
*
@@ -35,6 +35,9 @@
struct core_window;
struct rect;
+/**
+ * drag status passed to drag_status callback
+ */
typedef enum {
CORE_WINDOW_DRAG_NONE,
CORE_WINDOW_DRAG_SELECTION,
@@ -42,15 +45,28 @@ typedef enum {
CORE_WINDOW_DRAG_MOVE
} core_window_drag_status;
-/** Callbacks to achieve various core window functionality. */
+/**
+ * Callbacks to achieve various core window functionality.
+ */
struct core_window_callback_table {
/**
- * Request a redraw of the window
+ * Invalidate an area of a window.
*
- * \param[in] cw the core window object
- * \param[in] r rectangle to redraw
+ * 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.
+ *
+ * \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[in] cw The core window to invalidate.
+ * \param[in] rect area to redraw or NULL for the entire window area
+ * \return NSERROR_OK on success or appropriate error code
*/
- void (*redraw_request)(struct core_window *cw, const struct rect *r);
+ nserror (*invalidate)(struct core_window *cw, const struct rect *rect);
/**
* Update the limits of the window