summaryrefslogtreecommitdiff
path: root/web/web_dom.h
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-04 15:16:56 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-04 15:16:56 -0700
commitdf307f86ad32fcc841c770e8f5af72e8c0b80cfb (patch)
tree1881655a210d183ef775c1427906c765c1b14240 /web/web_dom.h
parentba56ae56ebec73ca8ea966fde4bb385f911a6669 (diff)
downloaddartboat-df307f86ad32fcc841c770e8f5af72e8c0b80cfb.tar.gz
dartboat-df307f86ad32fcc841c770e8f5af72e8c0b80cfb.tar.xz
web: abstract away most EM_ASM calls to dom file
Diffstat (limited to 'web/web_dom.h')
-rw-r--r--web/web_dom.h14
1 files changed, 14 insertions, 0 deletions
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 <stdbool.h>
+
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