summaryrefslogtreecommitdiff
path: root/src/dom/watcher.h
blob: a6f2568dbcfbaa214c668a03d9ec38ee698b6a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * This file is part of LibNSLayout
 * Licensed under the ISC License, http://opensource.org/licenses/ISC
 * Copyright 2015 Michael Drake <tlsa@netsurf-browser.org>
 */

/** \file src/dom/watcher.h
 * Interface to DOM mutation watching.
 */

#ifndef nslayout_dom_watcher_h_
#define nslayout_dom_watcher_h_

struct dom_document;
struct nsl_dom_watcher;

/**
 * Create DOM change watcher for a DOM document.
 *
 * \param[out]  watcher_out  Returns a dom watcher object for layout.
 * \param[in]   document     DOM document to create watcher for.
 * \return NSLAYOUT_OK on success, appropriate error otherwise.
 */
nslayout_error nsl_dom_watcher_create(
		struct nsl_dom_watcher **watcher_out,
		dom_document *document);

/**
 * Destroy a document change DOM change watcher.
 *
 * \param[in]  watcher  DOM change watcher to destroy.
 * \return NSLAYOUT_OK on success, appropriate error otherwise.
 */
nslayout_error nsl_dom_watcher_destroy(
		struct nsl_dom_watcher *watcher);

#endif