diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2011-03-06 13:58:02 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2011-03-06 13:58:02 +0000 |
commit | 5ac45472c7af8ccf686ea93791e491899889f087 (patch) | |
tree | 9d64a00ac2ceff5686f247ad163839a880f71b71 /riscos | |
parent | bfadf014825099ca4021a083fca7a6a83d737331 (diff) | |
download | netsurf-5ac45472c7af8ccf686ea93791e491899889f087.tar.gz netsurf-5ac45472c7af8ccf686ea93791e491899889f087.tar.bz2 |
Fix broken CONTENT_PLUGIN API.
Add a default content handler for Amiga using the plugin interface, which passes
unknown files (currently images only) through DataTypes.
svn path=/trunk/netsurf/; revision=11924
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/plugin.c | 25 | ||||
-rw-r--r-- | riscos/plugin.h | 22 |
2 files changed, 21 insertions, 26 deletions
diff --git a/riscos/plugin.c b/riscos/plugin.c index 25b2afe54..c3065ed37 100644 --- a/riscos/plugin.c +++ b/riscos/plugin.c @@ -183,8 +183,7 @@ static void plugin_fetch_callback(fetch_msg msg, void *p, const void *data, * \param params Parameters associated with the content * \return true on success, false otherwise */ -bool plugin_create(struct content *c, struct content *parent, - const char *params[]) +bool plugin_create(struct content *c, const http_parameter *params) { LOG(("plugin_create")); c->data.plugin.bw = 0; @@ -213,11 +212,9 @@ bool plugin_create(struct content *c, struct content *parent, * \param height Height of available space * \return true on success, false otherwise */ -bool plugin_convert(struct content *c, int width, int height) +bool plugin_convert(struct content *c) { LOG(("plugin_convert")); - c->width = width; - c->height = height; content_set_ready(c); content_set_done(c); @@ -535,6 +532,24 @@ void plugin_reformat(struct content *c, int width, int height) } } + +bool plugin_clone(const struct content *old, struct content *new_content) +{ + LOG(("plugin_clone")); + /* We "clone" the old content by replaying creation and conversion */ + if (plugin_create(new_content, NULL) == false) + return false; + + if (old->status == CONTENT_STATUS_READY || + old->status == CONTENT_STATUS_DONE) { + if (plugin_convert(new_content) == false) + return false; + } + + return true; +} + + /** * Creates a system variable from the mimetype * diff --git a/riscos/plugin.h b/riscos/plugin.h index d23e6539e..a3586b284 100644 --- a/riscos/plugin.h +++ b/riscos/plugin.h @@ -22,16 +22,12 @@ #include "utils/config.h" #ifdef WITH_PLUGIN +#include "desktop/plugin.h" #include <stdbool.h> #include "oslib/plugin.h" #include "oslib/wimp.h" -struct box; -struct browser_window; -struct content; -struct object_params; struct plugin_stream; -struct rect; /* We have one content per instance of a plugin */ struct content_plugin_data { @@ -50,22 +46,6 @@ struct content_plugin_data { struct plugin_stream *streams; /* list of active streams */ }; -/* function definitions */ -bool plugin_handleable(const char *mime_type); -void plugin_msg_parse(wimp_message *message, int ack); -bool plugin_create(struct content *c, struct content *parent, - const char *params[]); -bool plugin_convert(struct content *c, int width, int height); -void plugin_reformat(struct content *c, int width, int height); -void plugin_destroy(struct content *c); -bool plugin_redraw(struct content *c, int x, int y, - int width, int height, const struct rect *clip, - float scale, colour background_colour); -void plugin_open(struct content *c, struct browser_window *bw, - struct content *page, unsigned int index, struct box *box, - struct object_params *params); -void plugin_close(struct content *c); - /* message handlers */ void plugin_open_msg(wimp_message *message); void plugin_opening(wimp_message *message); |