r10081 jmb - in /branches/jmb/new-cache/content: content.c content_protected.h

netsurf at semichrome.net netsurf at semichrome.net
Thu Feb 25 01:00:56 GMT 2010


Author: jmb
Date: Wed Feb 24 19:00:56 2010
New Revision: 10081

URL: http://source.netsurf-browser.org?rev=10081&view=rev
Log:
Additional API for content handlers

Modified:
    branches/jmb/new-cache/content/content.c
    branches/jmb/new-cache/content/content_protected.h

Modified: branches/jmb/new-cache/content/content.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/content.c?rev=10081&r1=10080&r2=10081&view=diff
==============================================================================
--- branches/jmb/new-cache/content/content.c (original)
+++ branches/jmb/new-cache/content/content.c Wed Feb 24 19:00:56 2010
@@ -1004,8 +1004,11 @@
  */
 content_type content_get_type(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_type(hlcache_handle_get_content(h));
+}
+
+content_type content__get_type(struct content *c)
+{
 	if (c == NULL)
 		return CONTENT_UNKNOWN;
 
@@ -1020,8 +1023,11 @@
  */
 const char *content_get_url(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_url(hlcache_handle_get_content(h));
+}
+
+const char *content__get_url(struct content *c)
+{
 	if (c == NULL)
 		return NULL;
 
@@ -1036,8 +1042,11 @@
  */
 const char *content_get_title(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_title(hlcache_handle_get_content(h));
+}
+
+const char *content__get_title(struct content *c)
+{
 	if (c == NULL)
 		return NULL;
 
@@ -1052,8 +1061,11 @@
  */
 content_status content_get_status(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_status(hlcache_handle_get_content(h));
+}
+
+content_status content__get_status(struct content *c)
+{
 	if (c == NULL)
 		return CONTENT_STATUS_TYPE_UNKNOWN;
 
@@ -1068,8 +1080,11 @@
  */
 const char *content_get_status_message(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_status_message(hlcache_handle_get_content(h));
+}
+
+const char *content__get_status_message(struct content *c)
+{
 	if (c == NULL)
 		return NULL;
 
@@ -1084,8 +1099,11 @@
  */
 int content_get_width(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_width(hlcache_handle_get_content(h));
+}
+
+int content__get_width(struct content *c)
+{
 	if (c == NULL)
 		return 0;
 
@@ -1100,8 +1118,11 @@
  */
 int content_get_height(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_height(hlcache_handle_get_content(h));
+}
+
+int content__get_height(struct content *c)
+{
 	if (c == NULL)
 		return 0;
 
@@ -1117,7 +1138,11 @@
  */
 const char *content_get_source_data(hlcache_handle *h, unsigned long *size)
 {
-	struct content *c = hlcache_handle_get_content(h);
+	return content__get_source_data(hlcache_handle_get_content(h), size);
+}
+
+const char *content__get_source_data(struct content *c, unsigned long *size)
+{
 	const uint8_t *data;
 	size_t len;
 
@@ -1142,8 +1167,11 @@
  */
 void content_invalidate_reuse_data(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	content__invalidate_reuse_data(hlcache_handle_get_content(h));
+}
+
+void content__invalidate_reuse_data(struct content *c)
+{
 	if (c == NULL)
 		return;
 
@@ -1159,8 +1187,11 @@
  */
 const char *content_get_refresh_url(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_refresh_url(hlcache_handle_get_content(h));
+}
+
+const char *content__get_refresh_url(struct content *c)
+{
 	if (c == NULL)
 		return NULL;
 
@@ -1175,8 +1206,11 @@
  */
 struct bitmap *content_get_bitmap(hlcache_handle *h)
 {
-	struct content *c = hlcache_handle_get_content(h);
-
+	return content__get_bitmap(hlcache_handle_get_content(h));
+}
+
+struct bitmap *content__get_bitmap(struct content *c)
+{
 	if (c == NULL)
 		return NULL;
 

Modified: branches/jmb/new-cache/content/content_protected.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/content_protected.h?rev=10081&r1=10080&r2=10081&view=diff
==============================================================================
--- branches/jmb/new-cache/content/content_protected.h (original)
+++ branches/jmb/new-cache/content/content_protected.h Wed Feb 24 19:00:56 2010
@@ -196,4 +196,16 @@
 extern const char * const content_type_name[];
 extern const char * const content_status_name[];
 
-#endif
+content_type content__get_type(struct content *c);
+const char *content__get_url(struct content *c);
+const char *content__get_title(struct content *c);
+content_status content__get_status(struct content *c);
+const char *content__get_status_message(struct content *c);
+int content__get_width(struct content *c);
+int content__get_height(struct content *c);
+const char *content__get_source_data(struct content *c, unsigned long *size);
+void content__invalidate_reuse_data(struct content *c);
+const char *content__get_refresh_url(struct content *c);
+struct bitmap *content__get_bitmap(struct content *c);
+
+#endif




More information about the netsurf-commits mailing list