mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
[project @ 2004-08-13 00:55:59 by jmb]
Rewrite of plugin handling. This is now much nicer than before although it has about the same amount of functionality. Note: This is now configurable via an option (defaults to OFF) This has only really been tested with the Flash plugin and seems to work reasonably. svn path=/import/netsurf/; revision=1216
This commit is contained in:
parent
0a93f2d264
commit
d7627ceceb
@ -200,7 +200,7 @@ static const struct handler_entry handler_map[] = {
|
||||
#endif
|
||||
#ifdef WITH_PLUGIN
|
||||
{plugin_create, 0, plugin_convert,
|
||||
0, plugin_destroy, 0, plugin_redraw,
|
||||
plugin_reformat, plugin_destroy, 0, plugin_redraw,
|
||||
plugin_open, plugin_close,
|
||||
true},
|
||||
#endif
|
||||
|
11
render/box.h
11
render/box.h
@ -102,16 +102,9 @@ struct object_params {
|
||||
char* codebase;
|
||||
char* classid;
|
||||
struct plugin_params* params;
|
||||
/* not a parameter, but stored here for convenience */
|
||||
/* not a parameter but stored here for convenience */
|
||||
char* basehref;
|
||||
char* filename;
|
||||
bool repeated;
|
||||
unsigned int browser;
|
||||
unsigned int plugin;
|
||||
unsigned int browser_stream;
|
||||
unsigned int plugin_stream;
|
||||
unsigned int plugin_task;
|
||||
unsigned int consumed;
|
||||
|
||||
};
|
||||
|
||||
struct plugin_params {
|
||||
|
25
riscos/gui.c
25
riscos/gui.c
@ -1001,24 +1001,47 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
|
||||
#endif
|
||||
#ifdef WITH_PLUGIN
|
||||
case message_PLUG_IN_OPENING:
|
||||
plugin_opening(message);
|
||||
break;
|
||||
case message_PLUG_IN_CLOSED:
|
||||
plugin_closed(message);
|
||||
break;
|
||||
case message_PLUG_IN_RESHAPE_REQUEST:
|
||||
plugin_reshape_request(message);
|
||||
break;
|
||||
case message_PLUG_IN_FOCUS:
|
||||
break;
|
||||
case message_PLUG_IN_URL_ACCESS:
|
||||
plugin_url_access(message);
|
||||
break;
|
||||
case message_PLUG_IN_STATUS:
|
||||
plugin_status(message);
|
||||
break;
|
||||
case message_PLUG_IN_BUSY:
|
||||
break;
|
||||
case message_PLUG_IN_STREAM_NEW:
|
||||
plugin_stream_new(message);
|
||||
break;
|
||||
case message_PLUG_IN_STREAM_WRITE:
|
||||
break;
|
||||
case message_PLUG_IN_STREAM_WRITTEN:
|
||||
plugin_stream_written(message);
|
||||
break;
|
||||
case message_PLUG_IN_STREAM_DESTROY:
|
||||
break;
|
||||
case message_PLUG_IN_OPEN:
|
||||
if (event == wimp_USER_MESSAGE_ACKNOWLEDGE)
|
||||
plugin_open_msg(message);
|
||||
break;
|
||||
case message_PLUG_IN_CLOSE:
|
||||
if (event == wimp_USER_MESSAGE_ACKNOWLEDGE)
|
||||
plugin_close_msg(message);
|
||||
break;
|
||||
case message_PLUG_IN_RESHAPE:
|
||||
case message_PLUG_IN_STREAM_AS_FILE:
|
||||
case message_PLUG_IN_NOTIFY:
|
||||
case message_PLUG_IN_ABORT:
|
||||
case message_PLUG_IN_ACTION:
|
||||
plugin_msg_parse(message, event == wimp_USER_MESSAGE_ACKNOWLEDGE);
|
||||
break;
|
||||
#endif
|
||||
#ifdef WITH_PRINT
|
||||
|
@ -47,6 +47,7 @@ extern bool option_buffer_animations;
|
||||
extern bool option_buffer_everything;
|
||||
extern char *option_homepage_url;
|
||||
extern bool option_open_browser_at_startup;
|
||||
extern bool option_plugins;
|
||||
|
||||
#define EXTRA_OPTION_DEFINE \
|
||||
bool option_use_mouse_gestures = false;\
|
||||
@ -79,7 +80,8 @@ bool option_background_blending = true; \
|
||||
bool option_buffer_animations = true; \
|
||||
bool option_buffer_everything = false; \
|
||||
char *option_homepage_url = 0; \
|
||||
bool option_open_browser_at_startup = false;
|
||||
bool option_open_browser_at_startup = false; \
|
||||
bool option_plugins = false;
|
||||
|
||||
#define EXTRA_OPTION_TABLE \
|
||||
{ "use_mouse_gestures", OPTION_BOOL, &option_use_mouse_gestures },\
|
||||
@ -112,5 +114,6 @@ bool option_open_browser_at_startup = false;
|
||||
{ "buffer_animations", OPTION_BOOL, &option_buffer_animations }, \
|
||||
{ "buffer_everything", OPTION_BOOL, &option_buffer_everything }, \
|
||||
{ "homepage_url", OPTION_STRING, &option_homepage_url }, \
|
||||
{ "open_browser_at_startup",OPTION_BOOL, &option_open_browser_at_startup }
|
||||
{ "open_browser_at_startup",OPTION_BOOL, &option_open_browser_at_startup }, \
|
||||
{ "plugins", OPTION_BOOL, &option_plugins }
|
||||
#endif
|
||||
|
2467
riscos/plugin.c
2467
riscos/plugin.c
File diff suppressed because it is too large
Load Diff
@ -18,60 +18,30 @@ struct content;
|
||||
struct object_params;
|
||||
|
||||
struct content_plugin_data {
|
||||
char *data; /* object data */
|
||||
unsigned long length; /* object length */
|
||||
char *sysvar; /* system variable set by plugin */
|
||||
};
|
||||
|
||||
struct plugin_state {
|
||||
int dummy;
|
||||
};
|
||||
|
||||
struct plugin_message {
|
||||
|
||||
int poll;
|
||||
plugin_b browser;
|
||||
plugin_p plugin;
|
||||
wimp_message *m;
|
||||
struct plugin_message *reply;
|
||||
struct plugin_message *next;
|
||||
struct plugin_message *prev;
|
||||
};
|
||||
|
||||
struct plugin_list {
|
||||
|
||||
struct content *c;
|
||||
struct browser_window *bw;
|
||||
struct content *page;
|
||||
struct box *box;
|
||||
struct object_params *params;
|
||||
void **state;
|
||||
struct plugin_list *next;
|
||||
struct plugin_list *prev;
|
||||
};
|
||||
|
||||
struct plugin_param_item {
|
||||
|
||||
int type;
|
||||
int rsize;
|
||||
int nsize;
|
||||
char *name;
|
||||
int npad;
|
||||
int vsize;
|
||||
char *value;
|
||||
int vpad;
|
||||
int msize;
|
||||
char *mime_type;
|
||||
int mpad;
|
||||
|
||||
struct plugin_param_item *next;
|
||||
struct browser_window *bw; /* window containing this content */
|
||||
struct content *page; /* parent content */
|
||||
struct box *box; /* box containing this content */
|
||||
char *taskname; /* plugin task to launch */
|
||||
char *filename; /* filename of parameters file */
|
||||
char *datafile; /* filename of filestreamed file */
|
||||
bool opened; /* has this plugin been opened? */
|
||||
int repeated; /* indication of opening state */
|
||||
unsigned int browser; /* browser handle */
|
||||
unsigned int plugin; /* plugin handle */
|
||||
unsigned int browser_stream; /* browser stream handle */
|
||||
unsigned int plugin_stream; /* plugin stream handle */
|
||||
unsigned int plugin_task; /* plugin task handle */
|
||||
unsigned int consumed; /* size of data consumed by plugin */
|
||||
bool reformat_pending; /* is a reformat pending? */
|
||||
int width, height; /* reformat width & height */
|
||||
bool stream_waiting; /* waiting to stream a datastream */
|
||||
bool file_stream_waiting; /* waiting to stream as file */
|
||||
};
|
||||
|
||||
/* function definitions */
|
||||
bool plugin_handleable(const char *mime_type);
|
||||
void plugin_msg_parse(wimp_message *message, int ack);
|
||||
bool plugin_create(struct content *c, const char *params[]);
|
||||
bool plugin_process_data(struct content *c, char *data, unsigned int size);
|
||||
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);
|
||||
@ -84,5 +54,17 @@ void plugin_open(struct content *c, struct browser_window *bw,
|
||||
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);
|
||||
void plugin_close_msg(wimp_message *message);
|
||||
void plugin_closed(wimp_message *message);
|
||||
void plugin_reshape_request(wimp_message *message);
|
||||
void plugin_status(wimp_message *message);
|
||||
void plugin_stream_new(wimp_message *message);
|
||||
void plugin_stream_written(wimp_message *message);
|
||||
void plugin_url_access(wimp_message *message);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user