summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-09-03 09:27:42 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-09-03 09:27:42 +0000
commit9ee4f6146e06f6d142cc98a2bc600a49b4a3ddc6 (patch)
tree08e36656c3bdc25b57021fdeb86cdc65901495ed
parent4539f8836e30b16982efab4e7c70191af171e7d5 (diff)
downloadnetsurf-9ee4f6146e06f6d142cc98a2bc600a49b4a3ddc6.tar.gz
netsurf-9ee4f6146e06f6d142cc98a2bc600a49b4a3ddc6.tar.bz2
Remove mime_type parameter from content handler content_type callback API
svn path=/trunk/netsurf/; revision=12704
-rw-r--r--amiga/dt_anim.c4
-rw-r--r--amiga/dt_picture.c4
-rw-r--r--amiga/dt_sound.c4
-rw-r--r--amiga/icon.c4
-rw-r--r--amiga/plugin_hack.c4
-rw-r--r--cocoa/apple_image.m4
-rw-r--r--content/content.c6
-rw-r--r--content/content_factory.c2
-rw-r--r--content/content_protected.h2
-rw-r--r--css/css.c5
-rw-r--r--image/bmp.c2
-rw-r--r--image/gif.c2
-rw-r--r--image/ico.c2
-rw-r--r--image/jpeg.c2
-rw-r--r--image/mng.c2
-rw-r--r--image/nssprite.c2
-rw-r--r--image/png.c2
-rw-r--r--image/rsvg.c2
-rw-r--r--image/svg.c2
-rw-r--r--image/webp.c2
-rw-r--r--render/html.c5
-rw-r--r--render/textplain.c4
-rw-r--r--riscos/content-handlers/artworks.c4
-rw-r--r--riscos/content-handlers/draw.c4
-rw-r--r--riscos/content-handlers/sprite.c4
25 files changed, 39 insertions, 41 deletions
diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c
index 5136608dc..aa2f4b2d2 100644
--- a/amiga/dt_anim.c
+++ b/amiga/dt_anim.c
@@ -70,7 +70,7 @@ static void amiga_dt_anim_open(struct content *c, struct browser_window *bw,
struct object_params *params);
static void amiga_dt_anim_close(struct content *c);
static nserror amiga_dt_anim_clone(const struct content *old, struct content **newc);
-static content_type amiga_dt_anim_content_type(lwc_string *mime_type);
+static content_type amiga_dt_anim_content_type(void);
static void *amiga_dt_anim_get_internal(const struct content *c, void *context)
{
@@ -340,7 +340,7 @@ nserror amiga_dt_anim_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type amiga_dt_anim_content_type(lwc_string *mime_type)
+content_type amiga_dt_anim_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index b36352506..f373fcdbf 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -59,7 +59,7 @@ static bool amiga_dt_picture_redraw(struct content *c,
struct content_redraw_data *data, const struct rect *clip,
const struct redraw_context *ctx);
static nserror amiga_dt_picture_clone(const struct content *old, struct content **newc);
-static content_type amiga_dt_picture_content_type(lwc_string *mime_type);
+static content_type amiga_dt_picture_content_type(void);
static void *amiga_dt_picture_get_internal(const struct content *c, void *context)
{
@@ -281,7 +281,7 @@ nserror amiga_dt_picture_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type amiga_dt_picture_content_type(lwc_string *mime_type)
+content_type amiga_dt_picture_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c
index 5f5c68d0c..2f661a688 100644
--- a/amiga/dt_sound.c
+++ b/amiga/dt_sound.c
@@ -56,7 +56,7 @@ static void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
struct content *page, struct box *box,
struct object_params *params);
static nserror amiga_dt_sound_clone(const struct content *old, struct content **newc);
-static content_type amiga_dt_sound_content_type(lwc_string *mime_type);
+static content_type amiga_dt_sound_content_type(void);
static const content_handler amiga_dt_sound_content_handler = {
.create = amiga_dt_sound_create,
@@ -281,7 +281,7 @@ nserror amiga_dt_sound_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type amiga_dt_sound_content_type(lwc_string *mime_type)
+content_type amiga_dt_sound_content_type(void)
{
return CONTENT_PLUGIN;
}
diff --git a/amiga/icon.c b/amiga/icon.c
index 07dd9db2b..c05950e92 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -73,7 +73,7 @@ static bool amiga_icon_redraw(struct content *c,
const struct redraw_context *ctx);
static nserror amiga_icon_clone(const struct content *old,
struct content **newc);
-static content_type amiga_icon_content_type(lwc_string *mime_type);
+static content_type amiga_icon_content_type(void);
static void *amiga_icon_get_internal(const struct content *c, void *context)
{
@@ -348,7 +348,7 @@ nserror amiga_icon_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type amiga_icon_content_type(lwc_string *mime_type)
+content_type amiga_icon_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c
index 72cba5e60..b37dac15b 100644
--- a/amiga/plugin_hack.c
+++ b/amiga/plugin_hack.c
@@ -53,7 +53,7 @@ static void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
struct object_params *params);
static void amiga_plugin_hack_close(struct content *c);
static nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc);
-static content_type amiga_plugin_hack_content_type(lwc_string *mime_type);
+static content_type amiga_plugin_hack_content_type(void);
static const content_handler amiga_plugin_hack_content_handler = {
.create = amiga_plugin_hack_create,
@@ -234,7 +234,7 @@ nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc
return NSERROR_OK;
}
-content_type amiga_plugin_hack_content_type(lwc_string *mime_type)
+content_type amiga_plugin_hack_content_type(void)
{
return CONTENT_PLUGIN;
}
diff --git a/cocoa/apple_image.m b/cocoa/apple_image.m
index 4eef98530..f88e6cc7e 100644
--- a/cocoa/apple_image.m
+++ b/cocoa/apple_image.m
@@ -48,7 +48,7 @@ static bool apple_image_redraw(struct content *c, struct content_redraw_data *da
const struct rect *clip, const struct redraw_context *ctx);
static nserror apple_image_clone(const struct content *old,
struct content **newc);
-static content_type apple_image_content_type(lwc_string *mime_type);
+static content_type apple_image_content_type(void);
static void *apple_image_get_internal(const struct content *c, void *context)
{
@@ -249,7 +249,7 @@ nserror apple_image_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type apple_image_content_type(lwc_string *mime_type)
+content_type apple_image_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/content/content.c b/content/content.c
index db186e8cc..4c87f0eb5 100644
--- a/content/content.c
+++ b/content/content.c
@@ -733,7 +733,7 @@ content_type content_get_type(hlcache_handle *h)
if (c == NULL)
return CONTENT_NONE;
- return c->handler->type(c->mime_type);
+ return c->handler->type();
}
/**
@@ -977,7 +977,7 @@ struct bitmap *content__get_bitmap(struct content *c)
if ((c != NULL) &&
(c->handler != NULL) &&
(c->handler->type != NULL) &&
- (c->handler->type(NULL) == CONTENT_IMAGE) &&
+ (c->handler->type() == CONTENT_IMAGE) &&
(c->handler->get_internal != NULL) ) {
bitmap = c->handler->get_internal(c, NULL);
}
@@ -1012,7 +1012,7 @@ bool content__get_opaque(struct content *c)
if ((c != NULL) &&
(c->handler != NULL) &&
(c->handler->type != NULL) &&
- (c->handler->type(NULL) == CONTENT_IMAGE) &&
+ (c->handler->type() == CONTENT_IMAGE) &&
(c->handler->get_internal != NULL) ) {
struct bitmap *bitmap = NULL;
bitmap = c->handler->get_internal(c, NULL);
diff --git a/content/content_factory.c b/content/content_factory.c
index 0b9d44b7d..d3a69c34d 100644
--- a/content/content_factory.c
+++ b/content/content_factory.c
@@ -135,7 +135,7 @@ content_type content_factory_type_from_mime_type(lwc_string *mime_type)
handler = content_lookup(mime_type);
if (handler != NULL) {
- type = handler->type(mime_type);
+ type = handler->type();
}
return type;
diff --git a/content/content_protected.h b/content/content_protected.h
index fd854a0bc..a1d6c7076 100644
--- a/content/content_protected.h
+++ b/content/content_protected.h
@@ -67,7 +67,7 @@ struct content_handler {
struct selection * (*get_selection)(struct content *c);
nserror (*clone)(const struct content *old, struct content **newc);
bool (*matches_quirks)(const struct content *c, bool quirks);
- content_type (*type)(lwc_string *mime_type);
+ content_type (*type)(void);
/** handler dependant content sensitive internal data interface. */
void * (*get_internal)(const struct content *c, void *context);
diff --git a/css/css.c b/css/css.c
index 9d0014ec6..61f0b2e7e 100644
--- a/css/css.c
+++ b/css/css.c
@@ -65,7 +65,7 @@ static bool nscss_convert(struct content *c);
static void nscss_destroy(struct content *c);
static nserror nscss_clone(const struct content *old, struct content **newc);
static bool nscss_matches_quirks(const struct content *c, bool quirks);
-static content_type nscss_content_type(lwc_string *mime_type);
+static content_type nscss_content_type(void);
static void nscss_content_done(struct content_css_data *css, void *pw);
static css_error nscss_handle_import(void *pw, css_stylesheet *parent,
@@ -476,10 +476,9 @@ struct nscss_import *nscss_get_imports(hlcache_handle *h, uint32_t *n)
/**
* Compute the type of a content
*
- * \param mime_type MIME type
* \return CONTENT_CSS
*/
-content_type nscss_content_type(lwc_string *mime_type)
+content_type nscss_content_type(void)
{
return CONTENT_CSS;
}
diff --git a/image/bmp.c b/image/bmp.c
index fdf64d9dc..aea6d26fc 100644
--- a/image/bmp.c
+++ b/image/bmp.c
@@ -251,7 +251,7 @@ static void *nsbmp_get_internal(const struct content *c, void *context)
return bmp->bitmap;
}
-static content_type nsbmp_content_type(lwc_string *mime_type)
+static content_type nsbmp_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/gif.c b/image/gif.c
index 88cc22147..aa05a8c81 100644
--- a/image/gif.c
+++ b/image/gif.c
@@ -411,7 +411,7 @@ static void *nsgif_get_internal(const struct content *c, void *context)
return gif->bitmap;
}
-static content_type nsgif_content_type(lwc_string *mime_type)
+static content_type nsgif_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/ico.c b/image/ico.c
index f12e0cccb..6a8da57ea 100644
--- a/image/ico.c
+++ b/image/ico.c
@@ -219,7 +219,7 @@ static void *nsico_get_internal(const struct content *c, void *context)
return ico->bitmap;
}
-static content_type nsico_content_type(lwc_string *mime_type)
+static content_type nsico_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/jpeg.c b/image/jpeg.c
index 29fd0bf5c..ec1be8eab 100644
--- a/image/jpeg.c
+++ b/image/jpeg.c
@@ -345,7 +345,7 @@ static void *nsjpeg_get_internal(const struct content *c, void *context)
return jpeg_c->bitmap;
}
-static content_type nsjpeg_content_type(lwc_string *mime_type)
+static content_type nsjpeg_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/mng.c b/image/mng.c
index f0eff4b69..396cd6b94 100644
--- a/image/mng.c
+++ b/image/mng.c
@@ -770,7 +770,7 @@ static void *nsmng_get_internal(const struct content *c, void *context)
return mng->bitmap;
}
-static content_type nsmng_content_type(lwc_string *mime_type)
+static content_type nsmng_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/nssprite.c b/image/nssprite.c
index 4e6b659e1..7789d8df9 100644
--- a/image/nssprite.c
+++ b/image/nssprite.c
@@ -226,7 +226,7 @@ static void *nssprite_get_internal(const struct content *c, void *context)
return nssprite->bitmap;
}
-static content_type nssprite_content_type(lwc_string *mime_type)
+static content_type nssprite_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/png.c b/image/png.c
index 66826bb3d..b2dc0e145 100644
--- a/image/png.c
+++ b/image/png.c
@@ -418,7 +418,7 @@ static void *nspng_get_internal(const struct content *c, void *context)
return png_c->bitmap;
}
-static content_type nspng_content_type(lwc_string *mime_type)
+static content_type nspng_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/rsvg.c b/image/rsvg.c
index 691e03370..68d677054 100644
--- a/image/rsvg.c
+++ b/image/rsvg.c
@@ -297,7 +297,7 @@ static void *rsvg_get_internal(const struct content *c, void *context)
return d->bitmap;
}
-static content_type rsvg_content_type(lwc_string *mime_type)
+static content_type rsvg_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/svg.c b/image/svg.c
index 43f456bd6..698d20d55 100644
--- a/image/svg.c
+++ b/image/svg.c
@@ -319,7 +319,7 @@ static nserror svg_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-static content_type svg_content_type(lwc_string *mime_type)
+static content_type svg_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/image/webp.c b/image/webp.c
index 714e44c5c..eba155492 100644
--- a/image/webp.c
+++ b/image/webp.c
@@ -200,7 +200,7 @@ static void *webp_get_internal(const struct content *c, void *context)
return webp->bitmap;
}
-static content_type webp_content_type(lwc_string *mime_type)
+static content_type webp_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/render/html.c b/render/html.c
index c8b6d0cb7..7f9692aed 100644
--- a/render/html.c
+++ b/render/html.c
@@ -78,7 +78,7 @@ static void html_close(struct content *c);
struct selection *html_get_selection(struct content *c);
struct search_context *html_get_search(struct content *c);
static nserror html_clone(const struct content *old, struct content **newc);
-static content_type html_content_type(lwc_string *mime_type);
+static content_type html_content_type(void);
static void html_finish_conversion(html_content *c);
static nserror html_convert_css_callback(hlcache_handle *css,
@@ -2402,10 +2402,9 @@ bool html_get_id_offset(hlcache_handle *h, const char *frag_id, int *x, int *y)
/**
* Compute the type of a content
*
- * \param c Content to consider
* \return CONTENT_HTML
*/
-content_type html_content_type(lwc_string *mime_type)
+content_type html_content_type(void)
{
return CONTENT_HTML;
}
diff --git a/render/textplain.c b/render/textplain.c
index 9486dc2a0..1b1876786 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -119,7 +119,7 @@ struct selection *textplain_get_selection(struct content *c);
struct search_context *textplain_get_search(struct content *c);
static nserror textplain_clone(const struct content *old,
struct content **newc);
-static content_type textplain_content_type(lwc_string *mime_type);
+static content_type textplain_content_type(void);
static parserutils_error textplain_charset_hack(const uint8_t *data, size_t len,
uint16_t *mibenum, uint32_t *source);
@@ -609,7 +609,7 @@ nserror textplain_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type textplain_content_type(lwc_string *mime_type)
+content_type textplain_content_type(void)
{
return CONTENT_TEXTPLAIN;
}
diff --git a/riscos/content-handlers/artworks.c b/riscos/content-handlers/artworks.c
index ffbd7835e..a669dce14 100644
--- a/riscos/content-handlers/artworks.c
+++ b/riscos/content-handlers/artworks.c
@@ -113,7 +113,7 @@ static void artworks_destroy(struct content *c);
static bool artworks_redraw(struct content *c, struct content_redraw_data *data,
const struct rect *clip, const struct redraw_context *ctx);
static nserror artworks_clone(const struct content *old, struct content **newc);
-static content_type artworks_content_type(lwc_string *mime_type);
+static content_type artworks_content_type(void);
static const content_handler artworks_content_handler = {
.create = artworks_create,
@@ -468,7 +468,7 @@ nserror artworks_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type artworks_content_type(lwc_string *mime_type)
+content_type artworks_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/riscos/content-handlers/draw.c b/riscos/content-handlers/draw.c
index 5f3865921..536ee0516 100644
--- a/riscos/content-handlers/draw.c
+++ b/riscos/content-handlers/draw.c
@@ -53,7 +53,7 @@ static void draw_destroy(struct content *c);
static bool draw_redraw(struct content *c, struct content_redraw_data *data,
const struct rect *clip, const struct redraw_context *ctx);
static nserror draw_clone(const struct content *old, struct content **newc);
-static content_type draw_content_type(lwc_string *mime_type);
+static content_type draw_content_type(void);
static const content_handler draw_content_handler = {
.create = draw_create,
@@ -281,7 +281,7 @@ nserror draw_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type draw_content_type(lwc_string *mime_type)
+content_type draw_content_type(void)
{
return CONTENT_IMAGE;
}
diff --git a/riscos/content-handlers/sprite.c b/riscos/content-handlers/sprite.c
index 9260703f4..f93deaa60 100644
--- a/riscos/content-handlers/sprite.c
+++ b/riscos/content-handlers/sprite.c
@@ -55,7 +55,7 @@ static void sprite_destroy(struct content *c);
static bool sprite_redraw(struct content *c, struct content_redraw_data *data,
const struct rect *clip, const struct redraw_context *ctx);
static nserror sprite_clone(const struct content *old, struct content **newc);
-static content_type sprite_content_type(lwc_string *mime_type);
+static content_type sprite_content_type(void);
static const content_handler sprite_content_handler = {
.create = sprite_create,
@@ -254,7 +254,7 @@ nserror sprite_clone(const struct content *old, struct content **newc)
return NSERROR_OK;
}
-content_type sprite_content_type(lwc_string *mime_type)
+content_type sprite_content_type(void)
{
return CONTENT_IMAGE;
}