summaryrefslogtreecommitdiff
path: root/javascript/jsapi/binding.h
blob: 2d88c005bab43c65ea4b43564388e3d7589ded2e (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
85
86
87
/*
 * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
 *
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 *
 * NetSurf is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * NetSurf is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/** \file
 * spidermonkey jsapi class bindings
 */

#ifndef _NETSURF_JAVASCRIPT_JSAPI_BINDING_H_
#define _NETSURF_JAVASCRIPT_JSAPI_BINDING_H_


#include "render/html_internal.h"

JSObject *jsapi_InitClass_Window(JSContext *cx, JSObject *parent);

/** Create a new javascript window object
 *
 * @param cx The javascript context.
 * @param parent The parent object or NULL for new global
 * @param win_priv The private context to set on the object
 * @return new javascript object or NULL on error
 */
JSObject *jsapi_new_Window(JSContext *cx, 
			    JSObject *window,
			    JSObject *parent, 
			    struct browser_window *bw, 
			   html_content *htmlc);


JSObject *jsapi_InitClass_Document(JSContext *cx, JSObject *parent);

/** Create a new javascript document object
 *
 * @param cx The javascript context.
 * @param parent The parent object, usually a global window object
 * @param doc_priv The private context to set on the object
 * @return new javascript object or NULL on error
 */
JSObject *jsapi_new_Document(JSContext *cx,
		JSObject *proto,
		JSObject *parent,
		dom_document *node,
			     struct html_content *htmlc);

/** Create a new javascript console object
 *
 * @param cx The javascript context.
 * @param parent The parent object, usually a global window object
 * @return new javascript object or NULL on error
 */
JSObject *jsapi_new_Console(JSContext *cx, JSObject *parent);


JSObject *jsapi_InitClass_Navigator(JSContext *cx, JSObject *parent);
/** Create a new javascript navigator object
 *
 * @param cx The javascript context.
 * @param parent The parent object, usually a global window object
 * @return new javascript object or NULL on error
 */
JSObject *jsapi_new_Navigator(JSContext *cx, JSObject *proto, JSObject *parent);

/** Create a new javascript element object
 *
 * @param cx The javascript context.
 * @param parent The parent object, usually a global window object
 * @param doc_priv The private context to set on the object
 * @return new javascript object or NULL on error
 */
JSObject *jsapi_new_element(JSContext *cx, JSObject *parent, struct html_content *htmlc, struct dom_element *domelement);

#endif