Gitweb links:
...log
http://git.netsurf-browser.org/libnslayout.git/shortlog/617c559accc02deb3e956b592dc22d7891e28369
...commit
http://git.netsurf-browser.org/libnslayout.git/commit/617c559accc02deb3e956b592dc22d7891e28369
...tree
http://git.netsurf-browser.org/libnslayout.git/tree/617c559accc02deb3e956b592dc22d7891e28369
The branch, master has been updated
via 617c559accc02deb3e956b592dc22d7891e28369 (commit)
from f18b7ad86fe25e32cac7d9bca1abe92c46437535 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnslayout.git/commit/?id=617c559accc02deb3e956b592dc22d7891e28369
commit 617c559accc02deb3e956b592dc22d7891e28369
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Client API: Various changes due to new thinking about responsibilities.
diff --git a/include/libnslayout/nslayout.h b/include/libnslayout/nslayout.h
index b486cba..62ce584 100644
--- a/include/libnslayout/nslayout.h
+++ b/include/libnslayout/nslayout.h
@@ -22,8 +22,8 @@ extern "C"
#include <libnslayout/error.h>
-/** An opaque client-owned replaced element */
-typedef void nslayout_replaced;
+/** A client-defined replaced element structure */
+typedef struct nslayout_replaced nslayout_replaced;
/** A rectangle */
typedef struct nslayout_rect {
@@ -33,15 +33,25 @@ typedef struct nslayout_rect {
int h; /**< Height of rect in px */
} nslayout_rect;
+/***/
+enum nslayout_dom_node_event_type {
+ NSLAYOUT_DOM_NODE_INSERTED,
+ NSLAYOUT_DOM_NODE_MODIFIED,
+ NSLAYOUT_DOM_NODE_REMOVED,
+ NSLAYOUT_DOM_NODE__COUNT,
+};
+
/** Render list */
typedef struct nslayout_render_list {
} nslayout_render_list;
-/** Render list */
+/** Opaque layout tree object */
typedef struct nslayout_layout nslayout_layout;
+
/**
* A LibNSLayout request
+ * Client calls to set replaced element intrinsic dimensions.
*
* Passed to the client via nslayout_callback
*/
@@ -49,7 +59,6 @@ typedef struct nslayout_request {
/** Request type */
enum {
NSLAYOUT_GET_RESOURCE,
- NSLAYOUT_CREATE_REPLACED,
NSLAYOUT_RENDER,
NSLAYOUT_SET_EXTENTS,
NSLAYOUT_GET_INTRINSIC_SIZE
@@ -60,9 +69,6 @@ typedef struct nslayout_request {
const char *url; /**< Absolute URL */
} get_resource;
struct {
- dom_element *element; /**< DOM element */
- } create_replaced;
- struct {
nslayout_render_list *list; /**< Render list */
} render;
struct {
@@ -79,9 +85,6 @@ typedef struct nslayout_request {
nslayout_replaced **replaced; /** Replacement object */
} get_resource;
struct {
- nslayout_replaced **replaced; /** Replacement object */
- } create_replaced;
- struct {
unsigned int *width; /** Replacement object's width */
unsigned int *height; /** Replacement object's height */
} get_intrinsic_size;
@@ -90,6 +93,59 @@ typedef struct nslayout_request {
/**
+ * Client calls for DOM tree change events.
+ *
+ * \param[in] layout The layout requiring update for DOM change.
+ * \param[in] node The DOM node which is concerned in the event.
+ * \param[in] type The type of DOM change event.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_dom_node_event(
+ nslayout_layout *layout,
+ dom_event_target *node,
+ enum nslayout_dom_node_event_type type);
+
+/**
+ * Client calls to set node as client-replaced.
+ *
+ * \param[in] layout The layout to replace an element in.
+ * \param[in] node The DOM node which is to be replaced.
+ * \param[in] replaced The client's replacement object to register with node.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_node_event_set_replaced(
+ nslayout_layout *layout,
+ dom_event_target *node,
+ nslayout_replaced *replaced);
+
+
+/**
+ * Client calls to set replaced element intrinsic dimensions.
+ *
+ * \param[in] layout The layout to replace an element in.
+ * \param[in] node The DOM node which is to be replaced.
+ * \param[in] width Width in pixels.
+ * \param[in] height Height in pixels.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_node_event_set_intrinsic_dimensions(
+ nslayout_layout *layout,
+ dom_event_target *node,
+ unsigned int width,
+ unsigned int height);
+
+
+/**
+ * Client calls to tell NSLayout that everything requires reselection.
+ *
+ * \param[in]layout The layout to who's selection context has changed.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_selection_context_updated(
+ nslayout_layout *layout);
+
+
+/**
* Initialise LibNSLayout
*
* \return NSLAYOUT_OK on success, appropriate error otherwise.
-----------------------------------------------------------------------
Summary of changes:
include/libnslayout/nslayout.h | 76 ++++++++++++++++++++++++++++++++++------
1 file changed, 66 insertions(+), 10 deletions(-)
diff --git a/include/libnslayout/nslayout.h b/include/libnslayout/nslayout.h
index b486cba..62ce584 100644
--- a/include/libnslayout/nslayout.h
+++ b/include/libnslayout/nslayout.h
@@ -22,8 +22,8 @@ extern "C"
#include <libnslayout/error.h>
-/** An opaque client-owned replaced element */
-typedef void nslayout_replaced;
+/** A client-defined replaced element structure */
+typedef struct nslayout_replaced nslayout_replaced;
/** A rectangle */
typedef struct nslayout_rect {
@@ -33,15 +33,25 @@ typedef struct nslayout_rect {
int h; /**< Height of rect in px */
} nslayout_rect;
+/***/
+enum nslayout_dom_node_event_type {
+ NSLAYOUT_DOM_NODE_INSERTED,
+ NSLAYOUT_DOM_NODE_MODIFIED,
+ NSLAYOUT_DOM_NODE_REMOVED,
+ NSLAYOUT_DOM_NODE__COUNT,
+};
+
/** Render list */
typedef struct nslayout_render_list {
} nslayout_render_list;
-/** Render list */
+/** Opaque layout tree object */
typedef struct nslayout_layout nslayout_layout;
+
/**
* A LibNSLayout request
+ * Client calls to set replaced element intrinsic dimensions.
*
* Passed to the client via nslayout_callback
*/
@@ -49,7 +59,6 @@ typedef struct nslayout_request {
/** Request type */
enum {
NSLAYOUT_GET_RESOURCE,
- NSLAYOUT_CREATE_REPLACED,
NSLAYOUT_RENDER,
NSLAYOUT_SET_EXTENTS,
NSLAYOUT_GET_INTRINSIC_SIZE
@@ -60,9 +69,6 @@ typedef struct nslayout_request {
const char *url; /**< Absolute URL */
} get_resource;
struct {
- dom_element *element; /**< DOM element */
- } create_replaced;
- struct {
nslayout_render_list *list; /**< Render list */
} render;
struct {
@@ -79,9 +85,6 @@ typedef struct nslayout_request {
nslayout_replaced **replaced; /** Replacement object */
} get_resource;
struct {
- nslayout_replaced **replaced; /** Replacement object */
- } create_replaced;
- struct {
unsigned int *width; /** Replacement object's width */
unsigned int *height; /** Replacement object's height */
} get_intrinsic_size;
@@ -90,6 +93,59 @@ typedef struct nslayout_request {
/**
+ * Client calls for DOM tree change events.
+ *
+ * \param[in] layout The layout requiring update for DOM change.
+ * \param[in] node The DOM node which is concerned in the event.
+ * \param[in] type The type of DOM change event.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_dom_node_event(
+ nslayout_layout *layout,
+ dom_event_target *node,
+ enum nslayout_dom_node_event_type type);
+
+/**
+ * Client calls to set node as client-replaced.
+ *
+ * \param[in] layout The layout to replace an element in.
+ * \param[in] node The DOM node which is to be replaced.
+ * \param[in] replaced The client's replacement object to register with node.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_node_event_set_replaced(
+ nslayout_layout *layout,
+ dom_event_target *node,
+ nslayout_replaced *replaced);
+
+
+/**
+ * Client calls to set replaced element intrinsic dimensions.
+ *
+ * \param[in] layout The layout to replace an element in.
+ * \param[in] node The DOM node which is to be replaced.
+ * \param[in] width Width in pixels.
+ * \param[in] height Height in pixels.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_node_event_set_intrinsic_dimensions(
+ nslayout_layout *layout,
+ dom_event_target *node,
+ unsigned int width,
+ unsigned int height);
+
+
+/**
+ * Client calls to tell NSLayout that everything requires reselection.
+ *
+ * \param[in]layout The layout to who's selection context has changed.
+ * \return NSLAYOUT_OK on success, appropriate error otherwise.
+ */
+nslayout_error nslayout_selection_context_updated(
+ nslayout_layout *layout);
+
+
+/**
* Initialise LibNSLayout
*
* \return NSLAYOUT_OK on success, appropriate error otherwise.
--
NetSurf Layout Engine
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org