NetSurf
dukky.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
3 * Copyright 2015 Daniel Dilverstone <dsilvers@netsurf-browser.org>
4 * Copyright 2016 Michael Drake <tlsa@netsurf-browser.org>
5 *
6 * This file is part of NetSurf, http://www.netsurf-browser.org/
7 *
8 * NetSurf is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * NetSurf is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21/** \file
22 * Duktapeish implementation of javascript engine functions, prototypes.
23 */
24
25#ifndef DUKKY_H
26#define DUKKY_H
27
28duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args);
30duk_bool_t dukky_push_node(duk_context *ctx, struct dom_node *node);
31void dukky_inject_not_ctr(duk_context *ctx, int idx, const char *name);
33 struct dom_element *ele,
34 dom_string *name,
35 bool capture);
37 dom_string *name,
38 dom_event_target *et);
39void dukky_push_event(duk_context *ctx, dom_event *evt);
40bool dukky_event_target_push_listeners(duk_context *ctx, bool dont_create);
41
42typedef enum {
43 ELF_CAPTURE = 1 << 0,
44 ELF_PASSIVE = 1 << 1,
45 ELF_ONCE = 1 << 2,
46 ELF_NONE = 0
48
50
51/* pcall something, and if it errored, also dump the error to the log */
52duk_int_t dukky_pcall(duk_context *ctx, duk_size_t argc, bool reset_timeout);
53
54/* Push a generics function onto the stack */
55void dukky_push_generics(duk_context *ctx, const char *generic);
56
57/* Log the current stack frame if possible */
58void dukky_log_stack_frame(duk_context *ctx, const char * reason);
59
60#endif
duk_small_int_t duk_ret_t
Definition: duk_config.h:2076
duk_small_uint_t duk_bool_t
Definition: duk_config.h:2051
duk_uint_t duk_uarridx_t
Definition: duk_config.h:2068
duk_int_fast32_t duk_int_t
Definition: duk_config.h:2011
size_t duk_size_t
Definition: duk_config.h:1996
void dukky_push_generics(duk_context *ctx, const char *generic)
Definition: dukky.c:892
void dukky_shuffle_array(duk_context *ctx, duk_uarridx_t idx)
Definition: dukky.c:1458
void dukky_inject_not_ctr(duk_context *ctx, int idx, const char *name)
Definition: dukky.c:527
void dukky_push_event(duk_context *ctx, dom_event *evt)
Definition: dukky.c:1006
bool dukky_get_current_value_of_event_handler(duk_context *ctx, dom_string *name, dom_event_target *et)
Definition: dukky.c:1090
event_listener_flags
Definition: dukky.h:42
@ ELF_ONCE
Definition: dukky.h:45
@ ELF_NONE
Definition: dukky.h:46
@ ELF_PASSIVE
Definition: dukky.h:44
@ ELF_CAPTURE
Definition: dukky.h:43
duk_int_t dukky_pcall(duk_context *ctx, duk_size_t argc, bool reset_timeout)
Definition: dukky.c:876
duk_bool_t dukky_push_node_stacked(duk_context *ctx)
Definition: dukky.c:147
void dukky_log_stack_frame(duk_context *ctx, const char *reason)
Definition: dukky.c:909
duk_bool_t dukky_push_node(duk_context *ctx, struct dom_node *node)
Definition: dukky.c:482
duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args)
Definition: dukky.c:116
void dukky_register_event_listener_for(duk_context *ctx, struct dom_element *ele, dom_string *name, bool capture)
Definition: dukky.c:1344
bool dukky_event_target_push_listeners(duk_context *ctx, bool dont_create)
Definition: dukky.c:1408