Remove mime_type parameter from content handler content_type callback API

svn path=/trunk/netsurf/; revision=12704
This commit is contained in:
John Mark Bell 2011-09-03 09:27:42 +00:00
parent 4539f8836e
commit 9ee4f6146e
25 changed files with 39 additions and 41 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}