blob: 894340c368f5c547179190f2137eddbb31fc8922 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/*******************************************************************************
* Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
* available at http://www.gnu.org/licenses/lgpl.html. If the version
* of the LGPL at http://www.gnu.org is different to the version of
* the LGPL accompanying this distribution and there is any conflict
* between the two license versions, the terms of the LGPL accompanying
* this distribution shall govern.
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
#ifndef INC_webkitgtk_H
#define INC_webkitgtk_H
#include <dlfcn.h>
#include <string.h>
#include <stdlib.h>
#include <glib-object.h>
#define WebKitGTK_LOAD_FUNCTION(var, name) \
static int initialized = 0; \
static void *var = NULL; \
if (!initialized) { \
void* handle ; \
if (getenv("SWT_GTK3")) { \
handle = dlopen("libwebkitgtk-3.0.so.0", LOAD_FLAGS); /* webkitgtk >= 3.x lib */ \
} else { \
handle = dlopen("libwebkit-1.0.so.2", LOAD_FLAGS); /* webkitgtk 1.2.x lib */ \
if (!handle) { \
handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk >= 1.4.x lib */ \
} \
} \
if (handle) { \
var = dlsym(handle, #name); \
} \
initialized = 1; \
}
typedef struct {
int version;
int attributes;
const char* className;
void* parentClass;
const void* staticValues;
const void* staticFunctions;
void* initialize;
void* finalize;
void* hasProperty;
void* getProperty;
void* setProperty;
void* deleteProperty;
void* getPropertyNames;
void* callAsFunction;
void* callAsConstructor;
void* hasInstance;
void* convertToType;
} JSClassDefinition;
typedef struct {
char* name;
char* value;
char* domain;
char* path;
void* expires;
gboolean secure;
gboolean http_only;
} SoupCookie;
typedef struct {
GObject parent;
const char* method;
guint status_code;
char* reason_phrase;
void* request_body;
void* request_headers;
void* response_body;
void* response_headers;
} SoupMessage;
#endif /* INC_webkitgtk_H */
|