From df307f86ad32fcc841c770e8f5af72e8c0b80cfb Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 4 May 2022 15:16:56 -0700 Subject: web: abstract away most EM_ASM calls to dom file --- web/web_dom.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'web/web_dom.h') diff --git a/web/web_dom.h b/web/web_dom.h index a86d432..12205c2 100644 --- a/web/web_dom.h +++ b/web/web_dom.h @@ -1,6 +1,8 @@ #ifndef WEB_DOM_H #define WEB_DOM_H +#include + struct elem { char *ns, *name, *content; int n_attrs, size_attrs; @@ -13,4 +15,16 @@ void elem_add_attr(struct elem *e, char *name, char *val); void elem_add_attr_double(struct elem *e, char *name, double val); void append_elemv(char *sel, int elemc, struct elem **elemv); +char *dom_elem_get_content(char *sel); +void dom_elem_set_content(char *sel, char *str); +void dom_elem_set_value(char *sel, char *str); + +bool dom_elem_has_class(char *sel, char *class); +void dom_elem_add_class(char *sel, char *class); +void dom_elem_remove_class(char *sel, char *class); +void dom_elem_toggle_class(char *sel, char *class); +void dom_elem_set_uniq_class(char *sel, char *class, char *sel_set); + +void dom_elem_scroll_to_bottom(char *sel); + #endif -- cgit v1.2.3-70-g09d2