Added LICENSE; Added GPL2 header to all source code files
[ArenaLive.git] / glugin.h
blob6190d41f433cf0ae0e57016dadba3e7fcaf5639f
1 /*
2 * (C) Copyright 2009 ZeXx86 (zexx86@gmail.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #define MOZ_X11
22 #include "npapi.h"
23 #include "npupp.h"
25 void Log (const char *, ...);
27 #define pdof(x) ((pluginData *) (x->pdata))
29 typedef struct pluginData_t {
30 /* UNIX part */
31 Window win;
32 pid_t child;
33 FILE *pr, *pw;
34 Display *dpy;
36 int has_window;
38 /* common part */
39 void (*swapbuffers) (struct pluginData_t *);
40 void (*getsize) (struct pluginData_t *, int *, int *); /* TODO */
42 int exit_request;
43 int exit_ack;
45 /* html tag parameters */
46 char *conparam;
47 int action;
49 /* guest handlers */
50 void (*handle_newstream) (struct pluginData_t *, NPStream *);
51 void (*handle_destroystream) (struct pluginData_t *, NPStream *);
52 void (*handle_write) (struct pluginData_t *, NPStream *, int32, int32, void *);
53 } pluginData;
55 void glugin_proc (pluginData *pd);
58 //op number, unsigned int
59 #define gln_new_stream 1 /* stream * */
60 #define gln_stream_data 2 /* stream *, data offset, data size, data */
61 #define gln_destroy_stream 3 /* stream * */
62 #define gln_request_get 4 /* url size, url */
63 #define gln_request_post 5 /* url size, data size, url, data */
65 void host_newstream (pluginData *, NPStream *);
66 void host_destroystream (pluginData *, NPStream *);
67 void host_write (pluginData *, NPStream *, int32, int32, void *);
68 void host_read_guest_requests (pluginData *);
69 void guest_read_host_requests (pluginData *);
71 extern int plugin_action (pluginData *pd);