ELinks 0.18.0
window.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/leds.h"
#include "dialogs/menu.h"
#include "dialogs/status.h"
#include "document/document.h"
#include "document/view.h"
#include "js/ecmascript.h"
#include "js/quickjs.h"
#include "js/quickjs/css.h"
#include "js/quickjs/element.h"
#include "js/quickjs/heartbeat.h"
#include "js/quickjs/keyboard.h"
#include "js/quickjs/location.h"
#include "js/quickjs/message.h"
#include "js/quickjs/window.h"
#include "js/timer.h"
#include "intl/libintl.h"
#include "main/select.h"
#include "osdep/newwin.h"
#include "session/session.h"
#include "session/task.h"
#include "terminal/tab.h"
#include "util/conv.h"
#include "viewer/text/vs.h"
Include dependency graph for window.c:

Data Structures

struct  win_listener
struct  el_window
struct  el_message

Macros

#define countof(x)

Functions

static void js_window_finalize (JSRuntime *rt, JSValue val)
static void js_window_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
JSValue js_window_open (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
JSValue js_window_setInterval (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
JSValue js_window_setTimeout (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
JSValue js_window_clearInterval (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
JSValue js_window_clearTimeout (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
JSValue js_window_getComputedStyle (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
static JSValue js_window_get_property_closed (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_get_property_event (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_get_property_innerHeight (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_get_property_innerWidth (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_get_property_location (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_set_property_location (JSContext *ctx, JSValueConst this_val, JSValue val)
static JSValue js_window_get_property_parent (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_get_property_self (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_get_property_status (JSContext *ctx, JSValueConst this_val)
static JSValue js_window_set_property_status (JSContext *ctx, JSValueConst this_val, JSValue val)
static JSValue js_window_get_property_top (JSContext *ctx, JSValueConst this_val)
JSValue js_window_alert (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
static JSValue js_window_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
static JSValue js_window_addEventListener (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
static JSValue js_window_removeEventListener (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
static void onmessage_run (void *data)
static JSValue js_window_postMessage (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
int js_window_init (JSContext *ctx)

Variables

static JSClassID js_window_class_id
struct term_event last_event
static const JSCFunctionListEntry js_window_proto_funcs []
static JSClassDef js_window_class

Macro Definition Documentation

◆ countof

#define countof ( x)
Value:
(sizeof(x) / sizeof((x)[0]))

Function Documentation

◆ js_window_addEventListener()

JSValue js_window_addEventListener ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ js_window_alert()

JSValue js_window_alert ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_clearInterval()

JSValue js_window_clearInterval ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_clearTimeout()

JSValue js_window_clearTimeout ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_finalize()

void js_window_finalize ( JSRuntime * rt,
JSValue val )
static

◆ js_window_get_property_closed()

JSValue js_window_get_property_closed ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_event()

JSValue js_window_get_property_event ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_innerHeight()

JSValue js_window_get_property_innerHeight ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_innerWidth()

JSValue js_window_get_property_innerWidth ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_location()

JSValue js_window_get_property_location ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_parent()

JSValue js_window_get_property_parent ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_self()

JSValue js_window_get_property_self ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_status()

JSValue js_window_get_property_status ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_get_property_top()

JSValue js_window_get_property_top ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_window_getComputedStyle()

JSValue js_window_getComputedStyle ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_init()

int js_window_init ( JSContext * ctx)

◆ js_window_mark()

void js_window_mark ( JSRuntime * rt,
JSValueConst val,
JS_MarkFunc * mark_func )
static

◆ js_window_open()

JSValue js_window_open ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_postMessage()

JSValue js_window_postMessage ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ js_window_removeEventListener()

JSValue js_window_removeEventListener ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ js_window_set_property_location()

JSValue js_window_set_property_location ( JSContext * ctx,
JSValueConst this_val,
JSValue val )
static

◆ js_window_set_property_status()

JSValue js_window_set_property_status ( JSContext * ctx,
JSValueConst this_val,
JSValue val )
static

◆ js_window_setInterval()

JSValue js_window_setInterval ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_setTimeout()

JSValue js_window_setTimeout ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )

◆ js_window_toString()

JSValue js_window_toString ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ onmessage_run()

void onmessage_run ( void * data)
static

Variable Documentation

◆ js_window_class

JSClassDef js_window_class
static
Initial value:
= {
"window",
.finalizer = js_window_finalize,
.gc_mark = js_window_mark,
}
static void js_window_mark(JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
Definition window.c:88
static void js_window_finalize(JSRuntime *rt, JSValue val)
Definition window.c:67

◆ js_window_class_id

JSClassID js_window_class_id
static

◆ js_window_proto_funcs

const JSCFunctionListEntry js_window_proto_funcs[]
static
Initial value:
= {
JS_CGETSET_DEF("closed", js_window_get_property_closed, NULL),
JS_CGETSET_DEF("event", js_window_get_property_event, NULL),
JS_CGETSET_DEF("innerHeight", js_window_get_property_innerHeight, NULL),
JS_CGETSET_DEF("innerWidth", js_window_get_property_innerWidth, NULL),
JS_CGETSET_DEF("parent", js_window_get_property_parent, NULL),
JS_CGETSET_DEF("self", js_window_get_property_self, NULL),
JS_CGETSET_DEF("top", js_window_get_property_top, NULL),
JS_CGETSET_DEF("window", js_window_get_property_self, NULL),
JS_CFUNC_DEF("addEventListener", 3, js_window_addEventListener),
JS_CFUNC_DEF("alert", 1, js_window_alert),
JS_CFUNC_DEF("clearInterval", 1, js_window_clearInterval),
JS_CFUNC_DEF("clearTimeout", 1, js_window_clearTimeout),
JS_CFUNC_DEF("getComputedStyle", 2, js_window_getComputedStyle),
JS_CFUNC_DEF("open", 3, js_window_open),
JS_CFUNC_DEF("postMessage", 3, js_window_postMessage),
JS_CFUNC_DEF("removeEventListener", 3, js_window_removeEventListener),
JS_CFUNC_DEF("setInterval", 2, js_window_setInterval),
JS_CFUNC_DEF("setTimeout", 2, js_window_setTimeout),
}
#define NULL
Definition explodename.c:35
static JSValue js_window_get_property_top(JSContext *ctx, JSValueConst this_val)
Definition window.c:664
static JSValue js_window_postMessage(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:912
static JSValue js_window_get_property_status(JSContext *ctx, JSValueConst this_val)
Definition window.c:623
JSValue js_window_alert(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:711
static JSValue js_window_get_property_closed(JSContext *ctx, JSValueConst this_val)
Definition window.c:457
JSValue js_window_setInterval(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:250
static JSValue js_window_addEventListener(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:758
static JSValue js_window_get_property_parent(JSContext *ctx, JSValueConst this_val)
Definition window.c:588
static JSValue js_window_removeEventListener(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:820
static JSValue js_window_get_property_innerWidth(JSContext *ctx, JSValueConst this_val)
Definition window.c:507
JSValue js_window_clearInterval(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:367
static JSValue js_window_set_property_location(JSContext *ctx, JSValueConst this_val, JSValue val)
Definition window.c:551
JSValue js_window_clearTimeout(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:403
static JSValue js_window_get_property_event(JSContext *ctx, JSValueConst this_val)
Definition window.c:468
JSValue js_window_getComputedStyle(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:438
static JSValue js_window_get_property_location(JSContext *ctx, JSValueConst this_val)
Definition window.c:535
static JSValue js_window_set_property_status(JSContext *ctx, JSValueConst this_val, JSValue val)
Definition window.c:634
JSValue js_window_setTimeout(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:309
JSValue js_window_open(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition window.c:119
static JSValue js_window_get_property_self(JSContext *ctx, JSValueConst this_val)
Definition window.c:610
static JSValue js_window_get_property_innerHeight(JSContext *ctx, JSValueConst this_val)
Definition window.c:479

◆ last_event

struct term_event last_event
extern