more mozilla mompatibility
[glugin.git] / glugin.h
blob4a48b890619a1502c4c0a8c461a110965d1192fb
3 #define MOZ_X11
4 #include "npapi.h"
5 #include "npupp.h"
7 void Log(const char*,...);
9 #define pdof(x) ((pluginData*)(x->pdata))
11 typedef struct pluginData_t {
12 //UNIX part
13 Window win;
14 pid_t child;
15 FILE *pr,*pw;
16 Display* dpy;
18 int has_window;
20 //common part
21 void(*swapbuffers)(struct pluginData_t*);
22 void(*getsize)(struct pluginData_t*,int*,int*); //TODO
24 int exit_request,exit_ack;
26 int r,g,b,br,bg,bb;
28 //guest handlers
29 void(*handle_newstream)(struct pluginData_t*,NPStream*);
30 void(*handle_destroystream)(struct pluginData_t*, NPStream*);
31 void(*handle_write)(struct pluginData_t*,NPStream*,int32,int32,void*);
32 } pluginData;
34 extern "C"
35 void glugin_proc(pluginData* pd);
38 //op number, unsigned int
39 #define gln_new_stream 1 //stream *
40 #define gln_stream_data 2 //stream *, data offset, data size, data
41 #define gln_destroy_stream 3 //stream *
42 #define gln_request_get 4 //url size, url
43 #define gln_request_post 5 //url size, data size, url, data
45 void host_newstream(pluginData*, NPStream*);
46 void host_destroystream(pluginData*, NPStream*);
47 void host_write(pluginData*,NPStream*,int32, int32, void*);
48 void host_read_guest_requests(pluginData*);
50 void guest_read_host_requests(pluginData*);