r10083 jmb - in /branches/jmb/new-cache/render: html.c html.h

netsurf at semichrome.net netsurf at semichrome.net
Sun Feb 28 15:09:57 GMT 2010


Author: jmb
Date: Sun Feb 28 09:09:56 2010
New Revision: 10083

URL: http://source.netsurf-browser.org?rev=10083&view=rev
Log:
Make html APIs called from desktop/ and above take hlcache_handle * instead of struct content *

Modified:
    branches/jmb/new-cache/render/html.c
    branches/jmb/new-cache/render/html.h

Modified: branches/jmb/new-cache/render/html.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.c?rev=10083&r1=10082&r2=10083&view=diff
==============================================================================
--- branches/jmb/new-cache/render/html.c (original)
+++ branches/jmb/new-cache/render/html.c Sun Feb 28 09:09:56 2010
@@ -32,6 +32,7 @@
 #include "content/content_protected.h"
 #include "content/fetch.h"
 #include "content/fetchcache.h"
+#include "content/hlcache.h"
 #include "desktop/browser.h"
 #include "desktop/gui.h"
 #include "desktop/options.h"
@@ -2040,11 +2041,14 @@
 /**
  * Retrieve HTML document tree
  *
- * \param c  HTML content to retrieve document tree from
+ * \param h  HTML content to retrieve document tree from
  * \return Pointer to document tree
  */
-xmlDoc *html_get_document(struct content *c)
-{
+xmlDoc *html_get_document(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.document;
@@ -2053,13 +2057,16 @@
 /**
  * Retrieve box tree
  *
- * \param c  HTML content to retrieve tree from
+ * \param h  HTML content to retrieve tree from
  * \return Pointer to box tree
  *
  * \todo This API must die, as must all use of the box tree outside render/
  */
-struct box *html_get_box_tree(struct content *c)
-{
+struct box *html_get_box_tree(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.layout;
@@ -2068,11 +2075,14 @@
 /**
  * Retrieve the charset of an HTML document
  *
- * \param c  Content to retrieve charset from
+ * \param h  Content to retrieve charset from
  * \return Pointer to charset, or NULL
  */
-const char *html_get_encoding(struct content *c)
-{
+const char *html_get_encoding(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.encoding;
@@ -2081,11 +2091,14 @@
 /**
  * Retrieve framesets used in an HTML document
  *
- * \param c  Content to inspect
+ * \param h  Content to inspect
  * \return Pointer to framesets, or NULL if none
  */
-struct content_html_frames *html_get_frameset(struct content *c)
-{
+struct content_html_frames *html_get_frameset(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.frameset;
@@ -2094,11 +2107,14 @@
 /**
  * Retrieve iframes used in an HTML document
  *
- * \param c  Content to inspect
+ * \param h  Content to inspect
  * \return Pointer to iframes, or NULL if none
  */
-struct content_html_iframe *html_get_iframe(struct content *c)
-{
+struct content_html_iframe *html_get_iframe(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.iframe;
@@ -2107,11 +2123,14 @@
 /**
  * Retrieve an HTML content's base URL
  *
- * \param c  Content to retrieve base target from
+ * \param h  Content to retrieve base target from
  * \return Pointer to URL
  */
-const char *html_get_base_url(struct content *c)
-{
+const char *html_get_base_url(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.base_url;
@@ -2120,11 +2139,14 @@
 /**
  * Retrieve an HTML content's base target
  *
- * \param c  Content to retrieve base target from
+ * \param h  Content to retrieve base target from
  * \return Pointer to target, or NULL if none
  */
-const char *html_get_base_target(struct content *c)
-{
+const char *html_get_base_target(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.base_target;
@@ -2133,12 +2155,15 @@
 /**
  * Retrieve stylesheets used by HTML document
  *
- * \param c  Content to retrieve stylesheets from
+ * \param h  Content to retrieve stylesheets from
  * \param n  Pointer to location to receive number of sheets
  * \return Pointer to array of stylesheets
  */
-struct html_stylesheet *html_get_stylesheets(struct content *c, unsigned int *n)
-{
+struct html_stylesheet *html_get_stylesheets(hlcache_handle *h, unsigned int *n)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 	assert(n != NULL);
 
@@ -2150,12 +2175,15 @@
 /**
  * Retrieve objects used by HTML document
  *
- * \param c  Content to retrieve objects from
+ * \param h  Content to retrieve objects from
  * \param n  Pointer to location to receive number of objects
  * \return Pointer to array of objects
  */
-struct content_html_object *html_get_objects(struct content *c, unsigned int *n)
-{
+struct content_html_object *html_get_objects(hlcache_handle *h, unsigned int *n)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 	assert(n != NULL);
 
@@ -2167,11 +2195,14 @@
 /**
  * Retrieve favicon associated with an HTML document
  *
- * \param c  HTML document to retrieve favicon from
+ * \param h  HTML document to retrieve favicon from
  * \return Pointer to favicon, or NULL if none
  */
-struct content *html_get_favicon(struct content *c)
-{
+struct content *html_get_favicon(hlcache_handle *h)
+{
+	struct content *c = hlcache_handle_get_content(h);
+
+	assert(c != NULL);
 	assert(c->type == CONTENT_HTML);
 
 	return c->data.html.favicon;

Modified: branches/jmb/new-cache/render/html.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.h?rev=10083&r1=10082&r2=10083&view=diff
==============================================================================
--- branches/jmb/new-cache/render/html.h (original)
+++ branches/jmb/new-cache/render/html.h Sun Feb 28 09:09:56 2010
@@ -36,6 +36,7 @@
 struct rect;
 struct browser_window;
 struct content;
+struct hlcache_handle;
 struct imagemap;
 struct object_params;
 struct plotters;
@@ -223,17 +224,17 @@
 		float scale,
 		bool excluded);
 
-xmlDoc *html_get_document(struct content *c);
-struct box *html_get_box_tree(struct content *c);
-const char *html_get_encoding(struct content *c);
-struct content_html_frames *html_get_frameset(struct content *c);
-struct content_html_iframe *html_get_iframe(struct content *c);
-const char *html_get_base_url(struct content *c);
-const char *html_get_base_target(struct content *c);
-struct html_stylesheet *html_get_stylesheets(struct content *c, 
+xmlDoc *html_get_document(struct hlcache_handle *h);
+struct box *html_get_box_tree(struct hlcache_handle *h);
+const char *html_get_encoding(struct hlcache_handle *h);
+struct content_html_frames *html_get_frameset(struct hlcache_handle *h);
+struct content_html_iframe *html_get_iframe(struct hlcache_handle *h);
+const char *html_get_base_url(struct hlcache_handle *h);
+const char *html_get_base_target(struct hlcache_handle *h);
+struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h, 
 		unsigned int *n);
-struct content_html_object *html_get_objects(struct content *c, 
+struct content_html_object *html_get_objects(struct hlcache_handle *h, 
 			unsigned int *n);
-struct content *html_get_favicon(struct content *c);
+struct content *html_get_favicon(struct hlcache_handle *h);
 
 #endif




More information about the netsurf-commits mailing list