NetSurf
Enumerations | Functions
dukky.h File Reference

Duktapeish implementation of javascript engine functions, prototypes. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  event_listener_flags { ELF_CAPTURE = 1 << 0 , ELF_PASSIVE = 1 << 1 , ELF_ONCE = 1 << 2 , ELF_NONE = 0 }
 

Functions

duk_ret_t dukky_create_object (duk_context *ctx, const char *name, int args)
 
duk_bool_t dukky_push_node_stacked (duk_context *ctx)
 
duk_bool_t dukky_push_node (duk_context *ctx, struct dom_node *node)
 
void dukky_inject_not_ctr (duk_context *ctx, int idx, const char *name)
 
void dukky_register_event_listener_for (duk_context *ctx, struct dom_element *ele, dom_string *name, bool capture)
 
bool dukky_get_current_value_of_event_handler (duk_context *ctx, dom_string *name, dom_event_target *et)
 
void dukky_push_event (duk_context *ctx, dom_event *evt)
 
bool dukky_event_target_push_listeners (duk_context *ctx, bool dont_create)
 
void dukky_shuffle_array (duk_context *ctx, duk_uarridx_t idx)
 
duk_int_t dukky_pcall (duk_context *ctx, duk_size_t argc, bool reset_timeout)
 
void dukky_push_generics (duk_context *ctx, const char *generic)
 
void dukky_log_stack_frame (duk_context *ctx, const char *reason)
 

Detailed Description

Duktapeish implementation of javascript engine functions, prototypes.

Definition in file dukky.h.

Enumeration Type Documentation

◆ event_listener_flags

Enumerator
ELF_CAPTURE 
ELF_PASSIVE 
ELF_ONCE 
ELF_NONE 

Definition at line 42 of file dukky.h.

Function Documentation

◆ dukky_create_object()

duk_ret_t dukky_create_object ( duk_context ctx,
const char *  name,
int  args 
)

Definition at line 116 of file dukky.c.

References DUK_EXEC_SUCCESS, duk_insert(), duk_push_int(), duk_push_object(), duk_push_string(), duk_put_prop_string(), duk_safe_call(), dukky_populate_object(), HANDLER_LISTENER_MAGIC, HANDLER_MAGIC, and NSLOG.

Referenced by dukky_push_event(), and js_newthread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_event_target_push_listeners()

bool dukky_event_target_push_listeners ( duk_context ctx,
bool  dont_create 
)

Definition at line 1408 of file dukky.c.

References duk_dup(), duk_get_prop(), duk_get_prop_string(), duk_insert(), duk_is_undefined(), duk_pop(), duk_pop_2(), duk_pop_3(), duk_push_array(), duk_push_object(), duk_push_undefined(), duk_put_prop(), duk_put_prop_string(), and EVENT_LISTENER_JS_MAGIC.

Referenced by dukky_generic_event_handler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_get_current_value_of_event_handler()

bool dukky_get_current_value_of_event_handler ( duk_context ctx,
dom_string *  name,
dom_event_target *  et 
)
Todo:
This is entirely wrong, but it's hard to get right

Definition at line 1090 of file dukky.c.

References DUK_COMPILE_FUNCTION, duk_concat(), duk_get_prop(), duk_get_prop_string(), duk_insert(), duk_is_undefined(), duk_pcompile, duk_pop(), duk_pop_2(), duk_push_lstring(), duk_push_string(), dukky_push_handler_code_(), HANDLER_MAGIC, and NSLOG.

Referenced by dukky_generic_event_handler(), and js_fire_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_inject_not_ctr()

void dukky_inject_not_ctr ( duk_context ctx,
int  idx,
const char *  name 
)

Definition at line 527 of file dukky.c.

References duk_insert(), duk_push_c_function(), duk_put_prop_string(), and dukky_bad_constructor().

Here is the call graph for this function:

◆ dukky_log_stack_frame()

void dukky_log_stack_frame ( duk_context ctx,
const char *  reason 
)

Definition at line 909 of file dukky.c.

References duk_pop(), duk_push_string(), duk_safe_call(), duk_safe_to_string, dukky_push_context_dump(), and NSLOG.

Referenced by js_newthread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_pcall()

duk_int_t dukky_pcall ( duk_context ctx,
duk_size_t  argc,
bool  reset_timeout 
)

Definition at line 876 of file dukky.c.

References duk_pcall(), dukky_dump_error(), and dukky_reset_start_time().

Referenced by dukky_destroythread(), js_closethread(), and js_newthread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_push_event()

void dukky_push_event ( duk_context ctx,
dom_event *  evt 
)

Definition at line 1006 of file dukky.c.

References duk_dup(), DUK_EXEC_SUCCESS, duk_get_global_string(), duk_get_prop(), duk_is_undefined(), duk_pop(), duk_push_object(), duk_push_pointer(), duk_put_prop(), duk_replace(), dukky_create_object(), dukky_event_proto(), and EVENT_MAGIC.

Referenced by dukky_generic_event_handler(), and js_fire_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_push_generics()

void dukky_push_generics ( duk_context ctx,
const char *  generic 
)

Definition at line 892 of file dukky.c.

References duk_get_global_string(), duk_get_prop_string(), duk_remove(), and GENERICS_MAGIC.

Here is the call graph for this function:

◆ dukky_push_node()

duk_bool_t dukky_push_node ( duk_context ctx,
struct dom_node *  node 
)

Definition at line 482 of file dukky.c.

References duk_dup(), duk_get_global_string(), duk_get_prop(), duk_insert(), duk_is_undefined(), duk_pop(), duk_pop_2(), duk_push_pointer(), duk_safe_to_string, dukky_push_node_klass(), dukky_push_node_stacked(), NSLOG, NSLOG_COMPILED_MIN_LEVEL, and NSLOG_LEVEL_DEEPDEBUG.

Referenced by dukky_generic_event_handler(), dukky_register_event_listener_for(), and js_fire_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_push_node_stacked()

duk_bool_t dukky_push_node_stacked ( duk_context ctx)

Definition at line 147 of file dukky.c.

References duk_dup(), DUK_EXEC_SUCCESS, duk_get_global_string(), duk_get_prop(), duk_get_top(), duk_insert(), duk_is_undefined(), duk_pop(), duk_pop_3(), duk_push_int(), duk_push_object(), duk_put_prop(), duk_put_prop_string(), duk_safe_call(), duk_safe_to_string, duk_set_top(), dukky_populate_object(), HANDLER_LISTENER_MAGIC, HANDLER_MAGIC, NSLOG, NSLOG_COMPILED_MIN_LEVEL, and NSLOG_LEVEL_DEEPDEBUG.

Referenced by dukky_push_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_register_event_listener_for()

void dukky_register_event_listener_for ( duk_context ctx,
struct dom_element *  ele,
dom_string *  name,
bool  capture 
)

Definition at line 1344 of file dukky.c.

References duk_get_prop_string(), duk_has_prop(), duk_pop_2(), duk_push_boolean(), duk_push_global_object(), duk_push_lstring(), duk_put_prop(), dukky_generic_event_handler(), dukky_push_node(), HANDLER_LISTENER_MAGIC, and NSLOG.

Referenced by js_handle_new_element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dukky_shuffle_array()

void dukky_shuffle_array ( duk_context ctx,
duk_uarridx_t  idx 
)

Definition at line 1458 of file dukky.c.

References duk_del_prop_index(), duk_get_prop_index(), duk_pop(), and duk_put_prop_index().

Referenced by dukky_generic_event_handler().

Here is the call graph for this function:
Here is the caller graph for this function: