Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/986d4d5f82cfc96d9308e710aeeff0feac1bec4a
...commit
http://git.netsurf-browser.org/netsurf.git/commit/986d4d5f82cfc96d9308e710aeeff0feac1bec4a
...tree
http://git.netsurf-browser.org/netsurf.git/tree/986d4d5f82cfc96d9308e710aeeff0feac1bec4a
The branch, master has been updated
via 986d4d5f82cfc96d9308e710aeeff0feac1bec4a (commit)
from 479d0cb29a74eddc95e3e2292d9d49e8dafdf46f (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/netsurf.git/commit/?id=986d4d5f82cfc96d9308e710aeeff0feac1bec4a
commit 986d4d5f82cfc96d9308e710aeeff0feac1bec4a
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
put html content handler object interface into its own header
diff --git a/content/handlers/html/box_construct.c
b/content/handlers/html/box_construct.c
index fba9764..f1ea71d 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -38,6 +38,7 @@
#include "desktop/gui_internal.h"
#include "html/html_internal.h"
+#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
#include "html/box_construct.h"
diff --git a/content/handlers/html/box_special.c
b/content/handlers/html/box_special.c
index 9f4a512..2d3bd05 100644
--- a/content/handlers/html/box_special.c
+++ b/content/handlers/html/box_special.c
@@ -42,6 +42,7 @@
#include "html/html.h"
#include "html/html_internal.h"
+#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
#include "html/box_construct.h"
diff --git a/content/handlers/html/html_internal.h
b/content/handlers/html/html_internal.h
index 6b55334..ae3182a 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -367,25 +367,6 @@ nserror html_css_fetcher_register(void);
nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url,
uint32_t *key);
-/* in html/html_object.c */
-
-/**
- * Start a fetch for an object required by a page.
- *
- * \param c content of type CONTENT_HTML
- * \param url URL of object to fetch (copied)
- * \param box box that will contain the object
- * \param permitted_types bitmap of acceptable types
- * \param background this is a background image
- * \return true on success, false on memory exhaustion
- */
-bool html_fetch_object(html_content *c, nsurl *url, struct box *box,
content_type permitted_types, bool background);
-
-nserror html_object_free_objects(html_content *html);
-nserror html_object_close_objects(html_content *html);
-nserror html_object_open_objects(html_content *html, struct browser_window
*bw);
-nserror html_object_abort_objects(html_content *html);
-
/**
* Complete the HTML content state machine *iff* all scripts are finished
*/
diff --git a/content/handlers/html/object.c b/content/handlers/html/object.c
index c20118d..e8cdc7d 100644
--- a/content/handlers/html/object.c
+++ b/content/handlers/html/object.c
@@ -44,6 +44,7 @@
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/html_internal.h"
+#include "html/object.h"
/* break reference loop */
static void html_object_refresh(void *p);
@@ -489,6 +490,7 @@ html_object_callback(hlcache_handle *object,
return NSERROR_OK;
}
+
/**
* Start a fetch for an object required by a page, replacing an existing
object.
*
@@ -496,7 +498,6 @@ html_object_callback(hlcache_handle *object,
* \param url URL of object to fetch (copied)
* \return true on success, false on memory exhaustion
*/
-
static bool html_replace_object(struct content_html_object *object, nsurl *url)
{
html_content *c;
@@ -549,7 +550,6 @@ static bool html_replace_object(struct content_html_object
*object, nsurl *url)
/**
* schedule callback for object refresh
*/
-
static void html_object_refresh(void *p)
{
struct content_html_object *object = p;
@@ -571,6 +571,8 @@ static void html_object_refresh(void *p)
}
}
+
+/* exported interface documented in html/object.h */
nserror html_object_open_objects(html_content *html, struct browser_window *bw)
{
struct content_html_object *object, *next;
@@ -592,6 +594,8 @@ nserror html_object_open_objects(html_content *html, struct
browser_window *bw)
return NSERROR_OK;
}
+
+/* exported interface documented in html/object.h */
nserror html_object_abort_objects(html_content *htmlc)
{
struct content_html_object *object;
@@ -632,6 +636,8 @@ nserror html_object_abort_objects(html_content *htmlc)
return NSERROR_OK;
}
+
+/* exported interface documented in html/object.h */
nserror html_object_close_objects(html_content *html)
{
struct content_html_object *object, *next;
@@ -654,6 +660,8 @@ nserror html_object_close_objects(html_content *html)
return NSERROR_OK;
}
+
+/* exported interface documented in html/object.h */
nserror html_object_free_objects(html_content *html)
{
while (html->object_list != NULL) {
@@ -675,8 +683,7 @@ nserror html_object_free_objects(html_content *html)
}
-
-/* exported interface documented in html/html_internal.h */
+/* exported interface documented in html/object.h */
bool
html_fetch_object(html_content *c,
nsurl *url,
diff --git a/content/handlers/html/object.h b/content/handlers/html/object.h
new file mode 100644
index 0000000..85734fd
--- /dev/null
+++ b/content/handlers/html/object.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2020 Vincent Sanders <[email protected]>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * HTML content object interface
+ */
+
+#ifndef NETSURF_HTML_OBJECT_H
+#define NETSURF_HTML_OBJECT_H
+
+struct html_content;
+struct browser_window;
+struct box;
+
+/**
+ * Start a fetch for an object required by a page.
+ *
+ * The created content object is added to the HTML content which is
+ * updated as the fetch progresses. The box (if any) is updated when
+ * the object content becomes done.
+ *
+ * \param c content of type CONTENT_HTML
+ * \param url URL of object to fetch
+ * \param box box that will contain the object or NULL if none
+ * \param permitted_types bitmap of acceptable types
+ * \param background this is a background image
+ * \return true on success, false on memory exhaustion
+ */
+bool html_fetch_object(struct html_content *c, nsurl *url, struct box *box,
content_type permitted_types, bool background);
+
+/**
+ * release memory of content objects associated with a HTML content
+ *
+ * The content objects contents should have been previously closed
+ * with html_object_close_objects().
+ *
+ * \param html The html content to release the objects from.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_free_objects(struct html_content *html);
+
+/**
+ * close content of content objects associated with a HTML content
+ *
+ * \param html The html content to close the objects from.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_close_objects(struct html_content *html);
+
+
+/**
+ * open content of content objects associated with a HTML content
+ *
+ * \param html The html content to open the objects from.
+ * \param bw Browser window handle to open contents with.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_open_objects(struct html_content *html, struct
browser_window *bw);
+
+
+/**
+ * abort any content objects that have not completed fetching.
+ *
+ * \param html The html content to abort the objects from.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_abort_objects(struct html_content *html);
+
+#endif
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box_construct.c | 1 +
content/handlers/html/box_special.c | 1 +
content/handlers/html/html_internal.h | 19 --------
content/handlers/html/object.c | 15 ++++--
content/handlers/html/object.h | 85 +++++++++++++++++++++++++++++++++
5 files changed, 98 insertions(+), 23 deletions(-)
create mode 100644 content/handlers/html/object.h
diff --git a/content/handlers/html/box_construct.c
b/content/handlers/html/box_construct.c
index fba9764..f1ea71d 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -38,6 +38,7 @@
#include "desktop/gui_internal.h"
#include "html/html_internal.h"
+#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
#include "html/box_construct.h"
diff --git a/content/handlers/html/box_special.c
b/content/handlers/html/box_special.c
index 9f4a512..2d3bd05 100644
--- a/content/handlers/html/box_special.c
+++ b/content/handlers/html/box_special.c
@@ -42,6 +42,7 @@
#include "html/html.h"
#include "html/html_internal.h"
+#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
#include "html/box_construct.h"
diff --git a/content/handlers/html/html_internal.h
b/content/handlers/html/html_internal.h
index 6b55334..ae3182a 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -367,25 +367,6 @@ nserror html_css_fetcher_register(void);
nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url,
uint32_t *key);
-/* in html/html_object.c */
-
-/**
- * Start a fetch for an object required by a page.
- *
- * \param c content of type CONTENT_HTML
- * \param url URL of object to fetch (copied)
- * \param box box that will contain the object
- * \param permitted_types bitmap of acceptable types
- * \param background this is a background image
- * \return true on success, false on memory exhaustion
- */
-bool html_fetch_object(html_content *c, nsurl *url, struct box *box,
content_type permitted_types, bool background);
-
-nserror html_object_free_objects(html_content *html);
-nserror html_object_close_objects(html_content *html);
-nserror html_object_open_objects(html_content *html, struct browser_window
*bw);
-nserror html_object_abort_objects(html_content *html);
-
/**
* Complete the HTML content state machine *iff* all scripts are finished
*/
diff --git a/content/handlers/html/object.c b/content/handlers/html/object.c
index c20118d..e8cdc7d 100644
--- a/content/handlers/html/object.c
+++ b/content/handlers/html/object.c
@@ -44,6 +44,7 @@
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/html_internal.h"
+#include "html/object.h"
/* break reference loop */
static void html_object_refresh(void *p);
@@ -489,6 +490,7 @@ html_object_callback(hlcache_handle *object,
return NSERROR_OK;
}
+
/**
* Start a fetch for an object required by a page, replacing an existing
object.
*
@@ -496,7 +498,6 @@ html_object_callback(hlcache_handle *object,
* \param url URL of object to fetch (copied)
* \return true on success, false on memory exhaustion
*/
-
static bool html_replace_object(struct content_html_object *object, nsurl *url)
{
html_content *c;
@@ -549,7 +550,6 @@ static bool html_replace_object(struct content_html_object
*object, nsurl *url)
/**
* schedule callback for object refresh
*/
-
static void html_object_refresh(void *p)
{
struct content_html_object *object = p;
@@ -571,6 +571,8 @@ static void html_object_refresh(void *p)
}
}
+
+/* exported interface documented in html/object.h */
nserror html_object_open_objects(html_content *html, struct browser_window *bw)
{
struct content_html_object *object, *next;
@@ -592,6 +594,8 @@ nserror html_object_open_objects(html_content *html, struct
browser_window *bw)
return NSERROR_OK;
}
+
+/* exported interface documented in html/object.h */
nserror html_object_abort_objects(html_content *htmlc)
{
struct content_html_object *object;
@@ -632,6 +636,8 @@ nserror html_object_abort_objects(html_content *htmlc)
return NSERROR_OK;
}
+
+/* exported interface documented in html/object.h */
nserror html_object_close_objects(html_content *html)
{
struct content_html_object *object, *next;
@@ -654,6 +660,8 @@ nserror html_object_close_objects(html_content *html)
return NSERROR_OK;
}
+
+/* exported interface documented in html/object.h */
nserror html_object_free_objects(html_content *html)
{
while (html->object_list != NULL) {
@@ -675,8 +683,7 @@ nserror html_object_free_objects(html_content *html)
}
-
-/* exported interface documented in html/html_internal.h */
+/* exported interface documented in html/object.h */
bool
html_fetch_object(html_content *c,
nsurl *url,
diff --git a/content/handlers/html/object.h b/content/handlers/html/object.h
new file mode 100644
index 0000000..85734fd
--- /dev/null
+++ b/content/handlers/html/object.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2020 Vincent Sanders <[email protected]>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * HTML content object interface
+ */
+
+#ifndef NETSURF_HTML_OBJECT_H
+#define NETSURF_HTML_OBJECT_H
+
+struct html_content;
+struct browser_window;
+struct box;
+
+/**
+ * Start a fetch for an object required by a page.
+ *
+ * The created content object is added to the HTML content which is
+ * updated as the fetch progresses. The box (if any) is updated when
+ * the object content becomes done.
+ *
+ * \param c content of type CONTENT_HTML
+ * \param url URL of object to fetch
+ * \param box box that will contain the object or NULL if none
+ * \param permitted_types bitmap of acceptable types
+ * \param background this is a background image
+ * \return true on success, false on memory exhaustion
+ */
+bool html_fetch_object(struct html_content *c, nsurl *url, struct box *box,
content_type permitted_types, bool background);
+
+/**
+ * release memory of content objects associated with a HTML content
+ *
+ * The content objects contents should have been previously closed
+ * with html_object_close_objects().
+ *
+ * \param html The html content to release the objects from.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_free_objects(struct html_content *html);
+
+/**
+ * close content of content objects associated with a HTML content
+ *
+ * \param html The html content to close the objects from.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_close_objects(struct html_content *html);
+
+
+/**
+ * open content of content objects associated with a HTML content
+ *
+ * \param html The html content to open the objects from.
+ * \param bw Browser window handle to open contents with.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_open_objects(struct html_content *html, struct
browser_window *bw);
+
+
+/**
+ * abort any content objects that have not completed fetching.
+ *
+ * \param html The html content to abort the objects from.
+ * \return NSERROR_OK on success else appropriate error code.
+ */
+nserror html_object_abort_objects(struct html_content *html);
+
+#endif
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]