From 62f5ea585b1c8fe065d61f0236bd0fa34c41faa3 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 17 Sep 2003 21:47:21 +0000 Subject: [project @ 2003-09-17 21:47:21 by jmb] Make applets load (untested). Plugin loading conforms closer to the spec svn path=/import/netsurf/; revision=302 --- riscos/plugin.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'riscos') diff --git a/riscos/plugin.c b/riscos/plugin.c index 2d778f0cb..02db64676 100644 --- a/riscos/plugin.c +++ b/riscos/plugin.c @@ -132,7 +132,7 @@ void plugin_add_instance(struct content *c, struct browser_window *bw, struct object_params *params, void **state) { char sysvar[40]; - char *varval; + char *varval, *filename, *p; os_error *e; wimp_message m; plugin_message_open *pmo; @@ -284,10 +284,23 @@ void plugin_add_instance(struct content *c, struct browser_window *bw, plugin_add_instance_to_list(c, bw, page, box, params, state); /* TODO - handle other flags (see below) */ - if(flags & 0x4) + if(flags & 0x4) { /* wants data fetching */ plugin_create_stream(bw, params, c); + plugin_destroy_stream(bw, params, c); - plugin_destroy_stream(bw, params, c); + /* delete file_as_stream file + * (we don't care if the file doesn't exist) + */ + filename = strdup(params->filename); + p = strrchr((const char*)filename, 'p'); + filename[(p-filename)] = 'd'; + xosfile_delete((char const*)filename, NULL, NULL, + NULL, NULL, NULL); + } + + if (!(flags & 0x08)) /* will delete parameters file */ + xosfile_delete((char const*)params->filename, NULL, NULL, + NULL, NULL, NULL); } @@ -310,10 +323,6 @@ int plugin_process_opening(struct object_params *params, LOG(("accepts input focus")); if(pmo->flags & 0x2) LOG(("wants code fetching")); - if(pmo->flags & 0x4) - LOG(("wants data fetching")); - if(pmo->flags & 0x8) - LOG(("will delete parameters")); if(pmo->flags & 0x10) LOG(("still busy")); if(pmo->flags & 0x20) @@ -337,15 +346,12 @@ void plugin_remove_instance(struct content *c, struct browser_window *bw, wimp_message m; plugin_message_close *pmc; struct plugin_message *temp; - char *p, *filename; if (params == 0) { return; } - filename = strdup(params->filename); - pmc = (plugin_message_close*)&m.data; pmc->flags = 0; pmc->plugin = (plugin_p)params->plugin; @@ -376,12 +382,6 @@ void plugin_remove_instance(struct content *c, struct browser_window *bw, plugin_remove_message_from_linked_list(temp); } - /* delete parameters file */ - xosfile_delete((char const*)params->filename, NULL, NULL, NULL, NULL, NULL); - p = strrchr((const char*)filename, 'p'); - filename[(p-filename)] = 'd'; - xosfile_delete((char const*)filename, NULL, NULL, NULL, NULL, NULL); - /* delete instance from list */ plugin_remove_instance_from_list(params); } -- cgit v1.2.3