1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[quickjs] input.c

This commit is contained in:
Witold Filipczyk 2023-04-01 10:14:09 +02:00
parent 27ecf2f84d
commit 60da566eb4
8 changed files with 1654 additions and 7 deletions

View File

@ -1,6 +1,6 @@
top_builddir=../../../..
include $(top_builddir)/Makefile.config
OBJS = attr.o attributes.o collection.o console.o heartbeat.o history.o keyboard.o localstorage.o location.o mapa.obj message.o navigator.o nodelist.o screen.o unibar.o window.o xhr.o
OBJS = attr.o attributes.o collection.o console.o heartbeat.o history.o input.o keyboard.o localstorage.o location.o mapa.obj message.o navigator.o nodelist.o screen.o unibar.o window.o xhr.o
include $(top_srcdir)/Makefile.lib

File diff suppressed because it is too large Load Diff

View File

@ -56,6 +56,14 @@ attr_create_new_collections_map(void)
return (void *)mapa;
}
void *
attr_create_new_input_map(void)
{
std::map<void *, JSValueConst> *mapa = new std::map<void *, JSValueConst>;
return (void *)mapa;
}
void *
attr_create_new_collections_map_rev(void)
{

View File

@ -15,6 +15,7 @@ void *attr_create_new_attributes_map(void);
void *attr_create_new_attributes_map_rev(void);
void *attr_create_new_collections_map(void);
void *attr_create_new_collections_map_rev(void);
void *attr_create_new_input_map(void);
void *attr_create_new_nodelist_map(void);
void *attr_create_new_nodelist_map_rev(void);

View File

@ -1,2 +1,2 @@
srcs += files('attr.c', 'attributes.c', 'collection.c', 'console.c', 'heartbeat.c', 'history.c', 'keyboard.c', 'localstorage.c', 'location.c',
srcs += files('attr.c', 'attributes.c', 'collection.c', 'console.c', 'heartbeat.c', 'history.c', 'input.c', 'keyboard.c', 'localstorage.c', 'location.c',
'mapa.cpp', 'message.c', 'navigator.c', 'nodelist.c', 'screen.c', 'unibar.c', 'window.c', 'xhr.c')

View File

@ -3,6 +3,17 @@
#include <quickjs/quickjs.h>
#if !defined(JS_NAN_BOXING) && defined(__cplusplus)
inline int operator<(JSValueConst a, JSValueConst b)
{
return JS_VALUE_GET_PTR(a) < JS_VALUE_GET_PTR(b);
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ECMASCRIPT_DEBUG
#define RETURN_JS(obj) \
@ -45,12 +56,10 @@ int quickjs_eval_boolback(struct ecmascript_interpreter *interpreter, struct str
void quickjs_call_function(struct ecmascript_interpreter *interpreter, JSValueConst fun, struct string *ret);
#if !defined(JS_NAN_BOXING) && defined(__cplusplus)
inline int operator<(JSValueConst a, JSValueConst b)
{
return JS_VALUE_GET_PTR(a) < JS_VALUE_GET_PTR(b);
extern struct module quickjs_module;
#ifdef __cplusplus
}
#endif
extern struct module quickjs_module;
#endif

View File

@ -49,6 +49,8 @@
#include <libxml++/libxml++.h>
#include <map>
#ifndef CONFIG_LIBDOM
#define countof(x) (sizeof(x) / sizeof((x)[0]))
static JSClassID js_input_class_id;
@ -1634,3 +1636,4 @@ getInput(JSContext *ctx, struct form_state *fs)
JSValue rr = JS_DupValue(ctx, input_obj);
RETURN_JS(rr);
}
#endif

View File

@ -3,8 +3,16 @@
#include <quickjs/quickjs.h>
#ifdef __cplusplus
extern "C" {
#endif
struct form_state;
JSValue js_get_input_object(JSContext *ctx, struct form_state *fs);
#ifdef __cplusplus
}
#endif
#endif