Fixed bug with unallowed characters
[ArenaLive.git] / glugin.h
blobd4bdb14a633145ff0266b4bd495510f27f701a33
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
18 * Based on GLugin http://exa.czweb.org/repos/glugin.tar.bz2
19 * Big thanks for "exa"
23 #define MOZ_X11
24 #include "npapi.h"
25 #include "npupp.h"
27 void Log (const char *, ...);
29 #define pdof(x) ((pluginData *) (x->pdata))
31 typedef struct pluginData_t {
32 /* UNIX part */
33 Window win;
34 pid_t child;
35 FILE *pr, *pw;
36 Display *dpy;
38 int has_window;
40 /* common part */
41 void (*swapbuffers) (struct pluginData_t *);
42 void (*getsize) (struct pluginData_t *, int *, int *); /* TODO */
44 int exit_request;
45 int exit_ack;
47 /* html tag parameters */
48 char *conparam;
49 int action;
51 /* guest handlers */
52 void (*handle_newstream) (struct pluginData_t *, NPStream *);
53 void (*handle_destroystream) (struct pluginData_t *, NPStream *);
54 void (*handle_write) (struct pluginData_t *, NPStream *, int32, int32, void *);
55 } pluginData;
57 void glugin_proc (pluginData *pd);
60 //op number, unsigned int
61 #define gln_new_stream 1 /* stream * */
62 #define gln_stream_data 2 /* stream *, data offset, data size, data */
63 #define gln_destroy_stream 3 /* stream * */
64 #define gln_request_get 4 /* url size, url */
65 #define gln_request_post 5 /* url size, data size, url, data */
67 void host_newstream (pluginData *, NPStream *);
68 void host_destroystream (pluginData *, NPStream *);
69 void host_write (pluginData *, NPStream *, int32, int32, void *);
70 void host_read_guest_requests (pluginData *);
71 void guest_read_host_requests (pluginData *);
73 extern int plugin_action (pluginData *pd);
74 extern void conparam_verify (char *str, unsigned len);