summaryrefslogtreecommitdiff
path: root/content/handlers/javascript/duktape/netsurf.bnd
blob: 4aca4752fc65ebba8e70ccdcf3fd4b756119e3e2 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/* Binding for browser using duktape and libdom
 *
 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
 *
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 *
 * Released under the terms of the MIT License,
 *         http://www.opensource.org/licenses/mit-license
 */

binding duk_libdom {
	webidl "dom.idl";
	webidl "dom-parsing.idl";
	webidl "html.idl";
	webidl "cssom.idl";
	webidl "uievents.idl";
	webidl "urlutils.idl";
	webidl "console.idl";

	preface	%{
/* DukTape JavaScript bindings for NetSurf browser
 *
 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 * Released under the terms of the MIT License,
 *        http://www.opensource.org/licenses/mit-license
 */

#include <dom/dom.h>

#include "utils/log.h"
#include "utils/nsurl.h"

#include "javascript/duktape/duktape.h"

struct browser_window;
struct html_content;
struct dom_node;
struct dom_element;
struct dom_document;
struct dom_html_element;
struct dom_node_character_data;
struct dom_node_text;
struct dom_node_list;
struct dom_node_comment;
struct dom_html_collection;
struct dom_html_br_element;

%};

	prologue %{
#include "javascript/duktape/dukky.h"
%};

};

#include "Console.bnd"
#include "Window.bnd"
#include "Document.bnd"
#include "Node.bnd"
#include "NodeList.bnd"
#include "Element.bnd"
#include "HTMLCollection.bnd"
#include "Location.bnd"
#include "Navigator.bnd"

/* events */

#include "Event.bnd"

init MutationEvent(struct dom_mutation_event *evt::evt);
init UIEvent(struct dom_ui_event *evt::evt);
init TextEvent(struct dom_text_event *evt::evt);
init MutationNameEvent(struct dom_mutation_name_event *evt::evt);
init MouseWheelEvent(struct dom_mouse_wheel_event *evt::evt);
init MouseMultiWheelEvent(struct dom_mouse_multi_wheel_event *evt::evt);
init MouseEvent(struct dom_mouse_event *evt::evt);
init KeyboardEvent(struct dom_keyboard_event *evt::evt);
init DocumentEvent(struct dom_document_event *evt::evt);
init CustomEvent(struct dom_custom_event *evt::evt);
init CompositionEvent(struct dom_ui_event *evt::evt);
init WheelEvent(struct dom_mouse_event *evt::evt);
init FocusEvent(struct dom_ui_event *evt::evt);
init StorageEvent(struct dom_event *evt::evt);
init CloseEvent(struct dom_event *evt::evt);
init MessageEvent(struct dom_event *evt::evt);
init ErrorEvent(struct dom_event *evt::evt);
init BeforeUnloadEvent(struct dom_event *evt::evt);
init PageTransitionEvent(struct dom_event *evt::evt);
init HashChangeEvent(struct dom_event *evt::evt);
init PopStateEvent(struct dom_event *evt::evt);
init DragEvent(struct dom_mouse_event *evt::evt);
init RelatedEvent(struct dom_event *evt::evt);
init AutocompleteErrorEvent(struct dom_event *evt::evt);
init TrackEvent(struct dom_event *evt::evt);


/* html elements */
#include "HTMLElement.bnd"

/* specialisations of html_element */
#include "HTMLAnchorElement.bnd"
#include "HTMLAppletElement.bnd"
#include "HTMLAreaElement.bnd"
#include "HTMLBaseElement.bnd"
#include "HTMLBodyElement.bnd"
#include "HTMLButtonElement.bnd"
#include "HTMLBRElement.bnd"
#include "HTMLDivElement.bnd"
#include "HTMLFontElement.bnd"
#include "HTMLFormElement.bnd"
#include "HTMLFrameElement.bnd"
#include "HTMLFrameSetElement.bnd"
#include "HTMLHeadingElement.bnd"
#include "HTMLHRElement.bnd"
#include "HTMLHTMLElement.bnd"
#include "HTMLIFrameElement.bnd"
#include "HTMLImageElement.bnd"
#include "HTMLInputElement.bnd"
#include "HTMLLabelElement.bnd"
#include "HTMLLegendElement.bnd"
#include "HTMLLIElement.bnd"
#include "HTMLLinkElement.bnd"
#include "HTMLMapElement.bnd"
#include "HTMLMarqueeElement.bnd"
#include "HTMLMenuElement.bnd"
#include "HTMLMetaElement.bnd"
#include "HTMLObjectElement.bnd"
#include "HTMLOptionElement.bnd"
#include "HTMLOListElement.bnd"
#include "HTMLParagraphElement.bnd"
#include "HTMLParamElement.bnd"
#include "HTMLPreElement.bnd"
#include "HTMLQuoteElement.bnd"
#include "HTMLScriptElement.bnd"
#include "HTMLSelectElement.bnd"
#include "HTMLStyleElement.bnd"
#include "HTMLTableCaptionElement.bnd"
#include "HTMLTableCellElement.bnd"
#include "HTMLTableColElement.bnd"
#include "HTMLTableElement.bnd"
#include "HTMLTableRowElement.bnd"
#include "HTMLTableSectionElement.bnd"
#include "HTMLTextAreaElement.bnd"
#include "HTMLTitleElement.bnd"

init HTMLUnknownElement(struct dom_html_element *html_unknown_element::html_element);
init HTMLDirectoryElement(struct dom_html_element *html_directory_element::html_element);
init HTMLCanvasElement(struct dom_html_element *html_canvas_element::html_element);
init HTMLTemplateElement(struct dom_html_element *html_template_element::html_element);
init HTMLDialogElement(struct dom_html_element *html_dialog_element::html_element);
init HTMLMenuItemElement(struct dom_html_element *html_menu_item_element::html_element);
init HTMLDetailsElement(struct dom_html_element *html_details_element::html_element);
init HTMLFieldSetElement(struct dom_html_element *html_field_set_element::html_element);
init HTMLMeterElement(struct dom_html_element *html_meter_element::html_element);
init HTMLProgressElement(struct dom_html_element *html_progress_element::html_element);
init HTMLOutputElement(struct dom_html_element *html_output_element::html_element);
init HTMLKeygenElement(struct dom_html_element *html_keygen_element::html_element);
init HTMLOptGroupElement(struct dom_html_element *html_opt_group_element::html_element);
init HTMLDataListElement(struct dom_html_element *html_data_list_element::html_element);
init HTMLMediaElement(struct dom_html_element *html_media_element::html_element);
init HTMLTrackElement(struct dom_html_element *html_track_element::html_element);
init HTMLEmbedElement(struct dom_html_element *html_embed_element::html_element);
init HTMLSourceElement(struct dom_html_element *html_source_element::html_element);
init HTMLPictureElement(struct dom_html_element *html_picture_element::html_element);
init HTMLModElement(struct dom_html_element *html_mod_element::html_element);
init HTMLSpanElement(struct dom_html_element *html_span_element::html_element);
init HTMLTimeElement(struct dom_html_element *html_time_element::html_element);
init HTMLDataElement(struct dom_html_element *html_data_element::html_element);
init HTMLDListElement(struct dom_html_element *html_d_list_element::html_element);
init HTMLUListElement(struct dom_html_element *html_u_list_element::html_element);
init HTMLHeadElement(struct dom_html_element *html_head_element::html_element);

/* specialisations of HTMLTableCellElement */
init HTMLTableHeaderCellElement(struct dom_html_element *html_table_header_cell_element::html_table_cell_element);
init HTMLTableDataCellElement(struct dom_html_element *html_table_data_cell_element::html_table_cell_element);

/* specialisations of html_media_element */
init HTMLAudioElement(struct dom_html_element *html_audio_element::html_media_element);
init HTMLVideoElement(struct dom_html_element *html_video_element::html_media_element);

init Text(struct dom_node_text *text::character_data);
init Comment(struct dom_node_comment *comment::character_data);
init ProcessingInstruction(struct dom_node_text *text::character_data);

init XMLDocument(struct dom_document *document);

init CharacterData(struct dom_node_character_data *character_data::node);
init DocumentFragment(struct dom_document *document::node);
init DocumentType(struct dom_document *document::node);

init PropertyNodeList(struct dom_nodelist *nodes);
init RadioNodeList(struct dom_nodelist *nodes);

init HTMLAllCollection(struct dom_html_collection *coll);
init HTMLFormControlsCollection(struct dom_html_collection *coll);
init HTMLOptionsCollection(struct dom_html_collection *coll);
init HTMLPropertiesCollection(struct dom_html_collection *coll);