Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3584 → Rev 4364

/contrib/network/netsurf/libdom/include/dom/core/attr.h
0,0 → 1,147
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_attr_h_
#define dom_core_attr_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/node.h>
 
struct dom_element;
struct dom_type_info;
struct dom_node;
struct dom_attr;
 
typedef struct dom_attr dom_attr;
 
/**
* The attribute type
*/
typedef enum {
DOM_ATTR_UNSET = 0,
DOM_ATTR_STRING,
DOM_ATTR_BOOL,
DOM_ATTR_SHORT,
DOM_ATTR_INTEGER
} dom_attr_type;
 
/* DOM Attr vtable */
typedef struct dom_attr_vtable {
struct dom_node_vtable base;
 
dom_exception (*dom_attr_get_name)(struct dom_attr *attr,
dom_string **result);
dom_exception (*dom_attr_get_specified)(struct dom_attr *attr,
bool *result);
dom_exception (*dom_attr_get_value)(struct dom_attr *attr,
dom_string **result);
dom_exception (*dom_attr_set_value)(struct dom_attr *attr,
dom_string *value);
dom_exception (*dom_attr_get_owner_element)(struct dom_attr *attr,
struct dom_element **result);
dom_exception (*dom_attr_get_schema_type_info)(struct dom_attr *attr,
struct dom_type_info **result);
dom_exception (*dom_attr_is_id)(struct dom_attr *attr, bool *result);
} dom_attr_vtable;
 
static inline dom_exception dom_attr_get_name(struct dom_attr *attr,
dom_string **result)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_get_name(attr, result);
}
#define dom_attr_get_name(a, r) dom_attr_get_name((struct dom_attr *) (a), (r))
 
static inline dom_exception dom_attr_get_specified(struct dom_attr *attr,
bool *result)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_get_specified(attr, result);
}
#define dom_attr_get_specified(a, r) dom_attr_get_specified( \
(struct dom_attr *) (a), (bool *) (r))
 
static inline dom_exception dom_attr_get_value(struct dom_attr *attr,
dom_string **result)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_get_value(attr, result);
}
#define dom_attr_get_value(a, r) dom_attr_get_value((struct dom_attr *) (a), (r))
 
static inline dom_exception dom_attr_set_value(struct dom_attr *attr,
dom_string *value)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_set_value(attr, value);
}
#define dom_attr_set_value(a, v) dom_attr_set_value((struct dom_attr *) (a), (v))
 
static inline dom_exception dom_attr_get_owner_element(struct dom_attr *attr,
struct dom_element **result)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_get_owner_element(attr, result);
}
#define dom_attr_get_owner_element(a, r) dom_attr_get_owner_element(\
(struct dom_attr *) (a), (struct dom_element **) (r))
 
static inline dom_exception dom_attr_get_schema_type_info(
struct dom_attr *attr, struct dom_type_info **result)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_get_schema_type_info(attr, result);
}
#define dom_attr_get_schema_type_info(a, r) dom_attr_get_schema_type_info( \
(struct dom_attr *) (a), (struct dom_type_info **) (r))
 
static inline dom_exception dom_attr_is_id(struct dom_attr *attr, bool *result)
{
return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)->
dom_attr_is_id(attr, result);
}
#define dom_attr_is_id(a, r) dom_attr_is_id((struct dom_attr *) (a), \
(bool *) (r))
 
/*-----------------------------------------------------------------------*/
/**
* Following are our implementation specific APIs.
*
* These APIs are defined for the purpose that there are some attributes in
* HTML and other DOM module whose type is not DOMString, but uint32_t or
* boolean, for those types of attributes, clients should call one of the
* following APIs to set it.
*
* When an Attr node is created, its type is unset and it can be turned into
* any of the four types. Once the type is fixed by calling any of the four
* APIs:
* dom_attr_set_value
* dom_attr_set_integer
* dom_attr_set_short
* dom_attr_set_bool
* it can't be modified in future.
*
* For integer/short/bool type of attributes, we provide no string
* repensentation of them, so when you call dom_attr_get_value on these
* three type of attribute nodes, you will always get a empty dom_string.
* If you want to do something with Attr node, you must know its type
* firstly by calling dom_attr_get_type before you decide to call other
* dom_attr_get_* functions.
*/
dom_attr_type dom_attr_get_type(dom_attr *a);
dom_exception dom_attr_get_integer(dom_attr *a, uint32_t *value);
dom_exception dom_attr_set_integer(dom_attr *a, uint32_t value);
dom_exception dom_attr_get_short(dom_attr *a, unsigned short *value);
dom_exception dom_attr_set_short(dom_attr *a, unsigned short value);
dom_exception dom_attr_get_bool(dom_attr *a, bool *value);
dom_exception dom_attr_set_bool(dom_attr *a, bool value);
/* Make a attribute node readonly */
void dom_attr_mark_readonly(dom_attr *a);
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/cdatasection.h
0,0 → 1,12
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
*/
 
#ifndef dom_core_cdatasection_h_
#define dom_core_cdatasection_h_
 
typedef struct dom_cdata_section dom_cdata_section;
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/characterdata.h
0,0 → 1,130
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_characterdata_h_
#define dom_core_characterdata_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/node.h>
 
typedef struct dom_characterdata dom_characterdata;
 
/* The vtable for characterdata */
typedef struct dom_characterdata_vtable {
struct dom_node_vtable base;
 
dom_exception (*dom_characterdata_get_data)(
struct dom_characterdata *cdata,
dom_string **data);
dom_exception (*dom_characterdata_set_data)(
struct dom_characterdata *cdata,
dom_string *data);
dom_exception (*dom_characterdata_get_length)(
struct dom_characterdata *cdata,
uint32_t *length);
dom_exception (*dom_characterdata_substring_data)(
struct dom_characterdata *cdata, uint32_t offset,
uint32_t count, dom_string **data);
dom_exception (*dom_characterdata_append_data)(
struct dom_characterdata *cdata,
dom_string *data);
dom_exception (*dom_characterdata_insert_data)(
struct dom_characterdata *cdata,
uint32_t offset, dom_string *data);
dom_exception (*dom_characterdata_delete_data)(
struct dom_characterdata *cdata,
uint32_t offset, uint32_t count);
dom_exception (*dom_characterdata_replace_data)(
struct dom_characterdata *cdata, uint32_t offset,
uint32_t count, dom_string *data);
} dom_characterdata_vtable;
 
 
static inline dom_exception dom_characterdata_get_data(
struct dom_characterdata *cdata, dom_string **data)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_get_data(cdata, data);
}
#define dom_characterdata_get_data(c, d) dom_characterdata_get_data( \
(struct dom_characterdata *) (c), (d))
 
static inline dom_exception dom_characterdata_set_data(
struct dom_characterdata *cdata, dom_string *data)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_set_data(cdata, data);
}
#define dom_characterdata_set_data(c, d) dom_characterdata_set_data( \
(struct dom_characterdata *) (c), (d))
 
static inline dom_exception dom_characterdata_get_length(
struct dom_characterdata *cdata, uint32_t *length)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_get_length(cdata, length);
}
#define dom_characterdata_get_length(c, l) dom_characterdata_get_length( \
(struct dom_characterdata *) (c), (uint32_t *) (l))
 
static inline dom_exception dom_characterdata_substring_data(
struct dom_characterdata *cdata, uint32_t offset,
uint32_t count, dom_string **data)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_substring_data(cdata, offset, count,
data);
}
#define dom_characterdata_substring_data(c, o, ct, d) \
dom_characterdata_substring_data( \
(struct dom_characterdata *) (c), (uint32_t) (o), \
(uint32_t) (ct), (d))
 
static inline dom_exception dom_characterdata_append_data(
struct dom_characterdata *cdata, dom_string *data)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_append_data(cdata, data);
}
#define dom_characterdata_append_data(c, d) dom_characterdata_append_data( \
(struct dom_characterdata *) (c), (d))
 
static inline dom_exception dom_characterdata_insert_data(
struct dom_characterdata *cdata, uint32_t offset,
dom_string *data)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_insert_data(cdata, offset, data);
}
#define dom_characterdata_insert_data(c, o, d) dom_characterdata_insert_data( \
(struct dom_characterdata *) (c), (uint32_t) (o), (d))
 
static inline dom_exception dom_characterdata_delete_data(
struct dom_characterdata *cdata, uint32_t offset,
uint32_t count)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_delete_data(cdata, offset, count);
}
#define dom_characterdata_delete_data(c, o, ct) dom_characterdata_delete_data(\
(struct dom_characterdata *) (c), (uint32_t) (o), \
(uint32_t) (ct))
 
static inline dom_exception dom_characterdata_replace_data(
struct dom_characterdata *cdata, uint32_t offset,
uint32_t count, dom_string *data)
{
return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)->
dom_characterdata_replace_data(cdata, offset, count,
data);
}
#define dom_characterdata_replace_data(c, o, ct, d) \
dom_characterdata_replace_data(\
(struct dom_characterdata *) (c), (uint32_t) (o),\
(uint32_t) (ct), (d))
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/comment.h
0,0 → 1,18
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_core_comment_h_
#define dom_core_comment_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/characterdata.h>
 
typedef struct dom_comment dom_comment;
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/doc_fragment.h
0,0 → 1,12
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
*/
 
#ifndef dom_core_documentfragment_h_
#define dom_core_documentfragment_h_
 
typedef struct dom_document_fragment dom_document_fragment;
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/document.h
0,0 → 1,471
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_document_h_
#define dom_core_document_h_
 
#include <stdbool.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/implementation.h>
#include <dom/core/node.h>
 
struct dom_attr;
struct dom_cdata_section;
struct dom_characterdata;
struct dom_comment;
struct dom_configuration;
struct dom_document_fragment;
struct dom_document_type;
struct dom_element;
struct dom_entity_reference;
struct dom_node;
struct dom_nodelist;
struct dom_processing_instruction;
struct dom_text;
struct lwc_string_s;
 
typedef struct dom_document dom_document;
 
/**
* Quirks mode flag
*/
typedef enum dom_document_quirks_mode {
DOM_DOCUMENT_QUIRKS_MODE_NONE,
DOM_DOCUMENT_QUIRKS_MODE_LIMITED,
DOM_DOCUMENT_QUIRKS_MODE_FULL
} dom_document_quirks_mode;
 
 
/* DOM Document vtable */
typedef struct dom_document_vtable {
struct dom_node_vtable base;
 
dom_exception (*dom_document_get_doctype)(struct dom_document *doc,
struct dom_document_type **result);
dom_exception (*dom_document_get_implementation)(
struct dom_document *doc,
dom_implementation **result);
dom_exception (*dom_document_get_document_element)(
struct dom_document *doc, struct dom_element **result);
dom_exception (*dom_document_create_element)(struct dom_document *doc,
dom_string *tag_name,
struct dom_element **result);
dom_exception (*dom_document_create_document_fragment)(
struct dom_document *doc,
struct dom_document_fragment **result);
dom_exception (*dom_document_create_text_node)(struct dom_document *doc,
dom_string *data, struct dom_text **result);
dom_exception (*dom_document_create_comment)(struct dom_document *doc,
dom_string *data, struct dom_comment **result);
dom_exception (*dom_document_create_cdata_section)(
struct dom_document *doc, dom_string *data,
struct dom_cdata_section **result);
dom_exception (*dom_document_create_processing_instruction)(
struct dom_document *doc, dom_string *target,
dom_string *data,
struct dom_processing_instruction **result);
dom_exception (*dom_document_create_attribute)(struct dom_document *doc,
dom_string *name, struct dom_attr **result);
dom_exception (*dom_document_create_entity_reference)(
struct dom_document *doc, dom_string *name,
struct dom_entity_reference **result);
dom_exception (*dom_document_get_elements_by_tag_name)(
struct dom_document *doc, dom_string *tagname,
struct dom_nodelist **result);
dom_exception (*dom_document_import_node)(struct dom_document *doc,
struct dom_node *node, bool deep,
struct dom_node **result);
dom_exception (*dom_document_create_element_ns)(
struct dom_document *doc, dom_string *namespace,
dom_string *qname, struct dom_element **result);
dom_exception (*dom_document_create_attribute_ns)(
struct dom_document *doc, dom_string *namespace,
dom_string *qname, struct dom_attr **result);
dom_exception (*dom_document_get_elements_by_tag_name_ns)(
struct dom_document *doc, dom_string *namespace,
dom_string *localname,
struct dom_nodelist **result);
dom_exception (*dom_document_get_element_by_id)(
struct dom_document *doc, dom_string *id,
struct dom_element **result);
dom_exception (*dom_document_get_input_encoding)(
struct dom_document *doc, dom_string **result);
dom_exception (*dom_document_get_xml_encoding)(struct dom_document *doc,
dom_string **result);
dom_exception (*dom_document_get_xml_standalone)(
struct dom_document *doc, bool *result);
dom_exception (*dom_document_set_xml_standalone)(
struct dom_document *doc, bool standalone);
dom_exception (*dom_document_get_xml_version)(struct dom_document *doc,
dom_string **result);
dom_exception (*dom_document_set_xml_version)(struct dom_document *doc,
dom_string *version);
dom_exception (*dom_document_get_strict_error_checking)(
struct dom_document *doc, bool *result);
dom_exception (*dom_document_set_strict_error_checking)(
struct dom_document *doc, bool strict);
dom_exception (*dom_document_get_uri)(struct dom_document *doc,
dom_string **result);
dom_exception (*dom_document_set_uri)(struct dom_document *doc,
dom_string *uri);
dom_exception (*dom_document_adopt_node)(struct dom_document *doc,
struct dom_node *node, struct dom_node **result);
dom_exception (*dom_document_get_dom_config)(struct dom_document *doc,
struct dom_configuration **result);
dom_exception (*dom_document_normalize)(struct dom_document *doc);
dom_exception (*dom_document_rename_node)(struct dom_document *doc,
struct dom_node *node, dom_string *namespace,
dom_string *qname, struct dom_node **result);
dom_exception (*get_quirks_mode)(dom_document *doc,
dom_document_quirks_mode *result);
dom_exception (*set_quirks_mode)(dom_document *doc,
dom_document_quirks_mode quirks);
} dom_document_vtable;
 
static inline dom_exception dom_document_get_doctype(struct dom_document *doc,
struct dom_document_type **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_doctype(doc, result);
}
#define dom_document_get_doctype(d, r) dom_document_get_doctype( \
(dom_document *) (d), (struct dom_document_type **) (r))
 
static inline dom_exception dom_document_get_implementation(
struct dom_document *doc, dom_implementation **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_implementation(doc, result);
}
#define dom_document_get_implementation(d, r) dom_document_get_implementation(\
(dom_document *) (d), (dom_implementation **) (r))
 
static inline dom_exception dom_document_get_document_element(
struct dom_document *doc, struct dom_element **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_document_element(doc, result);
}
#define dom_document_get_document_element(d, r) \
dom_document_get_document_element((dom_document *) (d), \
(struct dom_element **) (r))
 
static inline dom_exception dom_document_create_element(
struct dom_document *doc, dom_string *tag_name,
struct dom_element **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_element(doc, tag_name, result);
}
#define dom_document_create_element(d, t, r) dom_document_create_element( \
(dom_document *) (d), (t), \
(struct dom_element **) (r))
 
static inline dom_exception dom_document_create_document_fragment(
struct dom_document *doc,
struct dom_document_fragment **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_document_fragment(doc, result);
}
#define dom_document_create_document_fragment(d, r) \
dom_document_create_document_fragment((dom_document *) (d), \
(struct dom_document_fragment **) (r))
 
static inline dom_exception dom_document_create_text_node(
struct dom_document *doc, dom_string *data,
struct dom_text **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_text_node(doc, data, result);
}
#define dom_document_create_text_node(d, data, r) \
dom_document_create_text_node((dom_document *) (d), \
(data), (struct dom_text **) (r))
 
static inline dom_exception dom_document_create_comment(
struct dom_document *doc, dom_string *data,
struct dom_comment **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_comment(doc, data, result);
}
#define dom_document_create_comment(d, data, r) dom_document_create_comment( \
(dom_document *) (d), (data), \
(struct dom_comment **) (r))
 
static inline dom_exception dom_document_create_cdata_section(
struct dom_document *doc, dom_string *data,
struct dom_cdata_section **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_cdata_section(doc, data, result);
}
#define dom_document_create_cdata_section(d, data, r) \
dom_document_create_cdata_section((dom_document *) (d), \
(data), (struct dom_cdata_section **) (r))
 
static inline dom_exception dom_document_create_processing_instruction(
struct dom_document *doc, dom_string *target,
dom_string *data,
struct dom_processing_instruction **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_processing_instruction(doc, target,
data, result);
}
#define dom_document_create_processing_instruction(d, t, data, r) \
dom_document_create_processing_instruction( \
(dom_document *) (d), (t), (data), \
(struct dom_processing_instruction **) (r))
 
static inline dom_exception dom_document_create_attribute(
struct dom_document *doc, dom_string *name,
struct dom_attr **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_attribute(doc, name, result);
}
#define dom_document_create_attribute(d, n, r) dom_document_create_attribute( \
(dom_document *) (d), (n), \
(struct dom_attr **) (r))
 
static inline dom_exception dom_document_create_entity_reference(
struct dom_document *doc, dom_string *name,
struct dom_entity_reference **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_entity_reference(doc, name,
result);
}
#define dom_document_create_entity_reference(d, n, r) \
dom_document_create_entity_reference((dom_document *) (d), \
(n), (struct dom_entity_reference **) (r))
 
static inline dom_exception dom_document_get_elements_by_tag_name(
struct dom_document *doc, dom_string *tagname,
struct dom_nodelist **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_elements_by_tag_name(doc, tagname,
result);
}
#define dom_document_get_elements_by_tag_name(d, t, r) \
dom_document_get_elements_by_tag_name((dom_document *) (d), \
(t), (struct dom_nodelist **) (r))
 
static inline dom_exception dom_document_import_node(struct dom_document *doc,
struct dom_node *node, bool deep, struct dom_node **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_import_node(doc, node, deep, result);
}
#define dom_document_import_node(d, n, deep, r) dom_document_import_node( \
(dom_document *) (d), (dom_node *) (n), (bool) deep, \
(dom_node **) (r))
 
static inline dom_exception dom_document_create_element_ns(
struct dom_document *doc, dom_string *namespace,
dom_string *qname, struct dom_element **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_element_ns(doc, namespace,
qname, result);
}
#define dom_document_create_element_ns(d, n, q, r) \
dom_document_create_element_ns((dom_document *) (d), \
(n), (q), \
(struct dom_element **) (r))
 
static inline dom_exception dom_document_create_attribute_ns
(struct dom_document *doc, dom_string *namespace,
dom_string *qname, struct dom_attr **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_create_attribute_ns(doc, namespace,
qname, result);
}
#define dom_document_create_attribute_ns(d, n, q, r) \
dom_document_create_attribute_ns((dom_document *) (d), \
(n), (q), (struct dom_attr **) (r))
 
static inline dom_exception dom_document_get_elements_by_tag_name_ns(
struct dom_document *doc, dom_string *namespace,
dom_string *localname, struct dom_nodelist **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_elements_by_tag_name_ns(doc,
namespace, localname, result);
}
#define dom_document_get_elements_by_tag_name_ns(d, n, l, r) \
dom_document_get_elements_by_tag_name_ns((dom_document *) (d),\
(n), (l), (struct dom_nodelist **) (r))
 
static inline dom_exception dom_document_get_element_by_id(
struct dom_document *doc, dom_string *id,
struct dom_element **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_element_by_id(doc, id, result);
}
#define dom_document_get_element_by_id(d, i, r) \
dom_document_get_element_by_id((dom_document *) (d), \
(i), (struct dom_element **) (r))
 
static inline dom_exception dom_document_get_input_encoding(
struct dom_document *doc, dom_string **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_input_encoding(doc, result);
}
#define dom_document_get_input_encoding(d, r) dom_document_get_input_encoding(\
(dom_document *) (d), (r))
 
static inline dom_exception dom_document_get_xml_encoding(
struct dom_document *doc, dom_string **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_xml_encoding(doc, result);
}
#define dom_document_get_xml_encoding(d, r) dom_document_get_xml_encoding( \
(dom_document *) (d), (r))
 
static inline dom_exception dom_document_get_xml_standalone(
struct dom_document *doc, bool *result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_xml_standalone(doc, result);
}
#define dom_document_get_xml_standalone(d, r) dom_document_get_xml_standalone(\
(dom_document *) (d), (bool *) (r))
 
static inline dom_exception dom_document_set_xml_standalone(
struct dom_document *doc, bool standalone)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_set_xml_standalone(doc, standalone);
}
#define dom_document_set_xml_standalone(d, s) dom_document_set_xml_standalone(\
(dom_document *) (d), (bool) (s))
 
static inline dom_exception dom_document_get_xml_version(
struct dom_document *doc, dom_string **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_xml_version(doc, result);
}
#define dom_document_get_xml_version(d, r) dom_document_get_xml_version( \
(dom_document *) (d), (r))
 
static inline dom_exception dom_document_set_xml_version(
struct dom_document *doc, dom_string *version)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_set_xml_version(doc, version);
}
#define dom_document_set_xml_version(d, v) dom_document_set_xml_version( \
(dom_document *) (d), (v))
 
static inline dom_exception dom_document_get_strict_error_checking(
struct dom_document *doc, bool *result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_strict_error_checking(doc, result);
}
#define dom_document_get_strict_error_checking(d, r) \
dom_document_get_strict_error_checking((dom_document *) (d), \
(bool *) (r))
 
static inline dom_exception dom_document_set_strict_error_checking(
struct dom_document *doc, bool strict)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_set_strict_error_checking(doc, strict);
}
#define dom_document_set_strict_error_checking(d, s) \
dom_document_set_strict_error_checking((dom_document *) (d), \
(bool) (s))
 
static inline dom_exception dom_document_get_uri(struct dom_document *doc,
dom_string **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_uri(doc, result);
}
#define dom_document_get_uri(d, r) dom_document_get_uri((dom_document *) (d), \
(r))
 
static inline dom_exception dom_document_set_uri(struct dom_document *doc,
dom_string *uri)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_set_uri(doc, uri);
}
#define dom_document_set_uri(d, u) dom_document_set_uri((dom_document *) (d), \
(u))
 
static inline dom_exception dom_document_adopt_node(struct dom_document *doc,
struct dom_node *node, struct dom_node **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_adopt_node(doc, node, result);
}
#define dom_document_adopt_node(d, n, r) dom_document_adopt_node( \
(dom_document *) (d), (dom_node *) (n), (dom_node **) (r))
 
static inline dom_exception dom_document_get_dom_config(
struct dom_document *doc, struct dom_configuration **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_get_dom_config(doc, result);
}
#define dom_document_get_dom_config(d, r) dom_document_get_dom_config( \
(dom_document *) (d), (struct dom_configuration **) (r))
 
static inline dom_exception dom_document_normalize(struct dom_document *doc)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_normalize(doc);
}
#define dom_document_normalize(d) dom_document_normalize((dom_document *) (d))
 
static inline dom_exception dom_document_rename_node(struct dom_document *doc,
struct dom_node *node,
dom_string *namespace, dom_string *qname,
struct dom_node **result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_rename_node(doc, node, namespace, qname,
result);
}
#define dom_document_rename_node(d, n, ns, q, r) dom_document_rename_node( \
(dom_document *) (d), (ns), \
(q), (dom_node **) (r))
 
static inline dom_exception dom_document_get_quirks_mode(
dom_document *doc, dom_document_quirks_mode *result)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
get_quirks_mode(doc, result);
}
#define dom_document_get_quirks_mode(d, r) \
dom_document_get_quirks_mode((dom_document *) (d), (r))
 
static inline dom_exception dom_document_set_quirks_mode(
dom_document *doc, dom_document_quirks_mode quirks)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
set_quirks_mode(doc, quirks);
}
#define dom_document_set_quirks_mode(d, q) \
dom_document_set_quirks_mode((dom_document *) (d), (q))
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/document_type.h
0,0 → 1,106
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
* Copyright 2007 James Shaw <jshaw@netsurf-browser.org>
*/
 
#ifndef dom_core_document_type_h_
#define dom_core_document_type_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/node.h>
 
struct dom_namednodemap;
 
typedef struct dom_document_type dom_document_type;
/* The Dom DocumentType vtable */
typedef struct dom_document_type_vtable {
struct dom_node_vtable base;
 
dom_exception (*dom_document_type_get_name)(
struct dom_document_type *doc_type,
dom_string **result);
dom_exception (*dom_document_type_get_entities)(
struct dom_document_type *doc_type,
struct dom_namednodemap **result);
dom_exception (*dom_document_type_get_notations)(
struct dom_document_type *doc_type,
struct dom_namednodemap **result);
dom_exception (*dom_document_type_get_public_id)(
struct dom_document_type *doc_type,
dom_string **result);
dom_exception (*dom_document_type_get_system_id)(
struct dom_document_type *doc_type,
dom_string **result);
dom_exception (*dom_document_type_get_internal_subset)(
struct dom_document_type *doc_type,
dom_string **result);
} dom_document_type_vtable;
 
static inline dom_exception dom_document_type_get_name(
struct dom_document_type *doc_type, dom_string **result)
{
return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
->dom_document_type_get_name(doc_type, result);
}
#define dom_document_type_get_name(dt, r) dom_document_type_get_name( \
(dom_document_type *) (dt), (r))
 
static inline dom_exception dom_document_type_get_entities(
struct dom_document_type *doc_type,
struct dom_namednodemap **result)
{
return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
->dom_document_type_get_entities(doc_type, result);
}
#define dom_document_type_get_entities(dt, r) dom_document_type_get_entities( \
(dom_document_type *) (dt), (struct dom_namednodemap **) (r))
 
static inline dom_exception dom_document_type_get_notations(
struct dom_document_type *doc_type,
struct dom_namednodemap **result)
{
return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
->dom_document_type_get_notations(doc_type, result);
}
#define dom_document_type_get_notations(dt, r) dom_document_type_get_notations(\
(dom_document_type *) (dt), (struct dom_namednodemap **) (r))
 
static inline dom_exception dom_document_type_get_public_id(
struct dom_document_type *doc_type,
dom_string **result)
{
return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
->dom_document_type_get_public_id(doc_type, result);
}
#define dom_document_type_get_public_id(dt, r) \
dom_document_type_get_public_id((dom_document_type *) (dt), \
(r))
 
static inline dom_exception dom_document_type_get_system_id(
struct dom_document_type *doc_type,
dom_string **result)
{
return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
->dom_document_type_get_system_id(doc_type, result);
}
#define dom_document_type_get_system_id(dt, r) \
dom_document_type_get_system_id((dom_document_type *) (dt), \
(r))
 
static inline dom_exception dom_document_type_get_internal_subset(
struct dom_document_type *doc_type,
dom_string **result)
{
return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
->dom_document_type_get_internal_subset(doc_type,
result);
}
#define dom_document_type_get_internal_subset(dt, r) \
dom_document_type_get_internal_subset( \
(dom_document_type *) (dt), (r))
 
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/element.h
0,0 → 1,359
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_element_h_
#define dom_core_element_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/node.h>
 
struct dom_attr;
struct dom_nodelist;
struct dom_type_info;
 
typedef struct dom_element dom_element;
 
/* The DOMElement vtable */
typedef struct dom_element_vtable {
struct dom_node_vtable base;
 
dom_exception (*dom_element_get_tag_name)(struct dom_element *element,
dom_string **name);
dom_exception (*dom_element_get_attribute)(struct dom_element *element,
dom_string *name, dom_string **value);
dom_exception (*dom_element_set_attribute)(struct dom_element *element,
dom_string *name, dom_string *value);
dom_exception (*dom_element_remove_attribute)(
struct dom_element *element, dom_string *name);
dom_exception (*dom_element_get_attribute_node)(
struct dom_element *element, dom_string *name,
struct dom_attr **result);
dom_exception (*dom_element_set_attribute_node)(
struct dom_element *element, struct dom_attr *attr,
struct dom_attr **result);
dom_exception (*dom_element_remove_attribute_node)(
struct dom_element *element, struct dom_attr *attr,
struct dom_attr **result);
dom_exception (*dom_element_get_elements_by_tag_name)(
struct dom_element *element, dom_string *name,
struct dom_nodelist **result);
dom_exception (*dom_element_get_attribute_ns)(
struct dom_element *element,
dom_string *namespace,
dom_string *localname,
dom_string **value);
dom_exception (*dom_element_set_attribute_ns)(
struct dom_element *element,
dom_string *namespace, dom_string *qname,
dom_string *value);
dom_exception (*dom_element_remove_attribute_ns)(
struct dom_element *element,
dom_string *namespace,
dom_string *localname);
dom_exception (*dom_element_get_attribute_node_ns)(
struct dom_element *element,
dom_string *namespace,
dom_string *localname, struct dom_attr **result);
dom_exception (*dom_element_set_attribute_node_ns)(
struct dom_element *element, struct dom_attr *attr,
struct dom_attr **result);
dom_exception (*dom_element_get_elements_by_tag_name_ns)(
struct dom_element *element,
dom_string *namespace,
dom_string *localname,
struct dom_nodelist **result);
dom_exception (*dom_element_has_attribute)(struct dom_element *element,
dom_string *name, bool *result);
dom_exception (*dom_element_has_attribute_ns)(
struct dom_element *element,
dom_string *namespace,
dom_string *localname, bool *result);
dom_exception (*dom_element_get_schema_type_info)(
struct dom_element *element,
struct dom_type_info **result);
dom_exception (*dom_element_set_id_attribute)(
struct dom_element *element, dom_string *name,
bool is_id);
dom_exception (*dom_element_set_id_attribute_ns)(
struct dom_element *element,
dom_string *namespace,
dom_string *localname, bool is_id);
dom_exception (*dom_element_set_id_attribute_node)(
struct dom_element *element,
struct dom_attr *id_attr, bool is_id);
 
/* These two are for the benefit of bindings to libcss */
dom_exception (*dom_element_get_classes)(
struct dom_element *element,
lwc_string ***classes, uint32_t *n_classes);
dom_exception (*dom_element_has_class)(
struct dom_element *element,
lwc_string *name, bool *match);
} dom_element_vtable;
 
static inline dom_exception dom_element_get_tag_name(
struct dom_element *element, dom_string **name)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_tag_name(element, name);
}
#define dom_element_get_tag_name(e, n) dom_element_get_tag_name( \
(dom_element *) (e), (n))
 
static inline dom_exception dom_element_get_attribute(
struct dom_element *element, dom_string *name,
dom_string **value)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_attribute(element, name, value);
}
#define dom_element_get_attribute(e, n, v) dom_element_get_attribute( \
(dom_element *) (e), (n), (v))
 
static inline dom_exception dom_element_set_attribute(
struct dom_element *element, dom_string *name,
dom_string *value)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_attribute(element, name, value);
}
#define dom_element_set_attribute(e, n, v) dom_element_set_attribute( \
(dom_element *) (e), (n), (v))
 
static inline dom_exception dom_element_remove_attribute(
struct dom_element *element, dom_string *name)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_remove_attribute(element, name);
}
#define dom_element_remove_attribute(e, n) dom_element_remove_attribute( \
(dom_element *) (e), (n))
 
static inline dom_exception dom_element_get_attribute_node(
struct dom_element *element, dom_string *name,
struct dom_attr **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_attribute_node(element, name, result);
}
#define dom_element_get_attribute_node(e, n, r) \
dom_element_get_attribute_node((dom_element *) (e), \
(n), (struct dom_attr **) (r))
 
static inline dom_exception dom_element_set_attribute_node(
struct dom_element *element, struct dom_attr *attr,
struct dom_attr **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_attribute_node(element, attr, result);
}
#define dom_element_set_attribute_node(e, a, r) \
dom_element_set_attribute_node((dom_element *) (e), \
(struct dom_attr *) (a), (struct dom_attr **) (r))
 
static inline dom_exception dom_element_remove_attribute_node(
struct dom_element *element, struct dom_attr *attr,
struct dom_attr **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_remove_attribute_node(element, attr,
result);
}
#define dom_element_remove_attribute_node(e, a, r) \
dom_element_remove_attribute_node((dom_element *) (e), \
(struct dom_attr *) (a), (struct dom_attr **) (r))
 
 
static inline dom_exception dom_element_get_elements_by_tag_name(
struct dom_element *element, dom_string *name,
struct dom_nodelist **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_elements_by_tag_name(element, name,
result);
}
#define dom_element_get_elements_by_tag_name(e, n, r) \
dom_element_get_elements_by_tag_name((dom_element *) (e), \
(n), (struct dom_nodelist **) (r))
 
static inline dom_exception dom_element_get_attribute_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname, dom_string **value)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_attribute_ns(element, namespace,
localname, value);
}
#define dom_element_get_attribute_ns(e, n, l, v) \
dom_element_get_attribute_ns((dom_element *) (e), \
(n), (l), (v))
 
static inline dom_exception dom_element_set_attribute_ns(
struct dom_element *element, dom_string *namespace,
dom_string *qname, dom_string *value)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_attribute_ns(element, namespace,
qname, value);
}
#define dom_element_set_attribute_ns(e, n, l, v) \
dom_element_set_attribute_ns((dom_element *) (e), \
(n), (l), (v))
 
 
static inline dom_exception dom_element_remove_attribute_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_remove_attribute_ns(element, namespace,
localname);
}
#define dom_element_remove_attribute_ns(e, n, l) \
dom_element_remove_attribute_ns((dom_element *) (e), \
(n), (l))
 
 
static inline dom_exception dom_element_get_attribute_node_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname, struct dom_attr **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_attribute_node_ns(element, namespace,
localname, result);
}
#define dom_element_get_attribute_node_ns(e, n, l, r) \
dom_element_get_attribute_node_ns((dom_element *) (e), \
(n), (l), \
(struct dom_attr **) (r))
 
static inline dom_exception dom_element_set_attribute_node_ns(
struct dom_element *element, struct dom_attr *attr,
struct dom_attr **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_attribute_node_ns(element, attr,
result);
}
#define dom_element_set_attribute_node_ns(e, a, r) \
dom_element_set_attribute_node_ns((dom_element *) (e), \
(struct dom_attr *) (a), (struct dom_attr **) (r))
 
static inline dom_exception dom_element_get_elements_by_tag_name_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname, struct dom_nodelist **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_elements_by_tag_name_ns(element,
namespace, localname, result);
}
#define dom_element_get_elements_by_tag_name_ns(e, n, l, r) \
dom_element_get_elements_by_tag_name_ns((dom_element *) (e), \
(n), (l), (struct dom_nodelist **) (r))
 
static inline dom_exception dom_element_has_attribute(
struct dom_element *element, dom_string *name,
bool *result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_has_attribute(element, name, result);
}
#define dom_element_has_attribute(e, n, r) dom_element_has_attribute( \
(dom_element *) (e), (n), (bool *) (r))
 
static inline dom_exception dom_element_has_attribute_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname, bool *result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_has_attribute_ns(element, namespace,
localname, result);
}
#define dom_element_has_attribute_ns(e, n, l, r) dom_element_has_attribute_ns(\
(dom_element *) (e), (n), (l), (bool *) (r))
 
static inline dom_exception dom_element_get_schema_type_info(
struct dom_element *element, struct dom_type_info **result)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_schema_type_info(element, result);
}
#define dom_element_get_schema_type_info(e, r) \
dom_element_get_schema_type_info((dom_element *) (e), \
(struct dom_type_info **) (r))
 
static inline dom_exception dom_element_set_id_attribute(
struct dom_element *element, dom_string *name,
bool is_id)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_id_attribute(element, name, is_id);
}
#define dom_element_set_id_attribute(e, n, i) \
dom_element_set_id_attribute((dom_element *) (e), \
(n), (bool) (i))
 
static inline dom_exception dom_element_set_id_attribute_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname, bool is_id)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_id_attribute_ns(element, namespace,
localname, is_id);
}
#define dom_element_set_id_attribute_ns(e, n, l, i) \
dom_element_set_id_attribute_ns((dom_element *) (e), \
(n), (l), (bool) (i))
 
static inline dom_exception dom_element_set_id_attribute_node(
struct dom_element *element, struct dom_attr *id_attr,
bool is_id)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_set_id_attribute_node(element, id_attr,
is_id);
}
#define dom_element_set_id_attribute_node(e, a, i) \
dom_element_set_id_attribute_node((dom_element *) (e), \
(struct dom_attr *) (a), (bool) (i))
 
static inline dom_exception dom_element_get_classes(
struct dom_element *element,
lwc_string ***classes, uint32_t *n_classes)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_get_classes(element, classes, n_classes);
}
#define dom_element_get_classes(e, c, n) \
dom_element_get_classes((dom_element *) (e), \
(lwc_string ***) (c), (uint32_t *) (n))
 
static inline dom_exception dom_element_has_class(
struct dom_element *element, lwc_string *name, bool *match)
{
return ((dom_element_vtable *) ((dom_node *) element)->vtable)->
dom_element_has_class(element, name, match);
}
#define dom_element_has_class(e, n, m) \
dom_element_has_class((dom_element *) (e), \
(lwc_string *) (n), (bool *) (m))
 
 
/* Functions for implementing some libcss selection callbacks.
* Note that they don't take a reference to the returned element, as such they
* are UNSAFE if you require the returned element to live beyond the next time
* the DOM gets a chance to change. */
dom_exception dom_element_named_ancestor_node(dom_element *element,
lwc_string *name, dom_element **ancestor);
dom_exception dom_element_named_parent_node(dom_element *element,
lwc_string *name, dom_element **parent);
dom_exception dom_element_parent_node(dom_element *element,
dom_element **parent);
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/entity_ref.h
0,0 → 1,13
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_entityreference_h_
#define dom_core_entityreference_h_
 
typedef struct dom_entity_reference dom_entity_reference;
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/exceptions.h
0,0 → 1,52
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_exceptions_h_
#define dom_core_exceptions_h_
 
/**
* Class of a DOM exception.
*
* The top 16 bits of a dom_exception are a bitfield
* indicating which class the exception belongs to.
*/
typedef enum {
DOM_EXCEPTION_CLASS_NORMAL = 0,
DOM_EXCEPTION_CLASS_EVENT = (1<<30),
DOM_EXCEPTION_CLASS_INTERNAL = (1<<31)
} dom_exception_class;
 
/* The DOM spec says that this is actually an unsigned short */
typedef enum {
DOM_NO_ERR = 0,
DOM_INDEX_SIZE_ERR = 1,
DOM_DOMSTRING_SIZE_ERR = 2,
DOM_HIERARCHY_REQUEST_ERR = 3,
DOM_WRONG_DOCUMENT_ERR = 4,
DOM_INVALID_CHARACTER_ERR = 5,
DOM_NO_DATA_ALLOWED_ERR = 6,
DOM_NO_MODIFICATION_ALLOWED_ERR = 7,
DOM_NOT_FOUND_ERR = 8,
DOM_NOT_SUPPORTED_ERR = 9,
DOM_INUSE_ATTRIBUTE_ERR = 10,
DOM_INVALID_STATE_ERR = 11,
DOM_SYNTAX_ERR = 12,
DOM_INVALID_MODIFICATION_ERR = 13,
DOM_NAMESPACE_ERR = 14,
DOM_INVALID_ACCESS_ERR = 15,
DOM_VALIDATION_ERR = 16,
DOM_TYPE_MISMATCH_ERR = 17,
 
DOM_UNSPECIFIED_EVENT_TYPE_ERR = DOM_EXCEPTION_CLASS_EVENT + 0,
DOM_DISPATCH_REQUEST_ERR = DOM_EXCEPTION_CLASS_EVENT + 1,
 
DOM_NO_MEM_ERR = DOM_EXCEPTION_CLASS_INTERNAL + 0,
DOM_ATTR_WRONG_TYPE_ERR = DOM_EXCEPTION_CLASS_INTERNAL + 1
/* our own internal error */
} dom_exception;
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/implementation.h
0,0 → 1,53
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_implementation_h_
#define dom_core_implementation_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/events/document_event.h>
#include <dom/functypes.h>
 
struct dom_document;
struct dom_document_type;
 
typedef const char dom_implementation;
 
typedef enum dom_implementation_type {
DOM_IMPLEMENTATION_CORE = 0,
DOM_IMPLEMENTATION_XML = (1 << 0), /* not implemented */
DOM_IMPLEMENTATION_HTML = (1 << 1),
 
DOM_IMPLEMENTATION_ALL = DOM_IMPLEMENTATION_CORE |
DOM_IMPLEMENTATION_XML |
DOM_IMPLEMENTATION_HTML
} dom_implementation_type;
 
dom_exception dom_implementation_has_feature(
const char *feature, const char *version,
bool *result);
 
dom_exception dom_implementation_create_document_type(
const char *qname,
const char *public_id, const char *system_id,
struct dom_document_type **doctype);
 
dom_exception dom_implementation_create_document(
uint32_t impl_type,
const char *namespace, const char *qname,
struct dom_document_type *doctype,
dom_events_default_action_fetcher daf,
void *daf_ctx,
struct dom_document **doc);
 
dom_exception dom_implementation_get_feature(
const char *feature, const char *version,
void **object);
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/namednodemap.h
0,0 → 1,83
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_namednodemap_h_
#define dom_core_namednodemap_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_node;
 
typedef struct dom_namednodemap dom_namednodemap;
 
void dom_namednodemap_ref(struct dom_namednodemap *map);
void dom_namednodemap_unref(struct dom_namednodemap *map);
 
dom_exception dom_namednodemap_get_length(struct dom_namednodemap *map,
uint32_t *length);
 
dom_exception _dom_namednodemap_get_named_item(struct dom_namednodemap *map,
dom_string *name, struct dom_node **node);
 
#define dom_namednodemap_get_named_item(m, n, r) \
_dom_namednodemap_get_named_item((dom_namednodemap *) (m), \
(n), (dom_node **) (r))
 
dom_exception _dom_namednodemap_set_named_item(struct dom_namednodemap *map,
struct dom_node *arg, struct dom_node **node);
 
#define dom_namednodemap_set_named_item(m, a, n) \
_dom_namednodemap_set_named_item((dom_namednodemap *) (m), \
(dom_node *) (a), (dom_node **) (n))
 
 
dom_exception _dom_namednodemap_remove_named_item(
struct dom_namednodemap *map, dom_string *name,
struct dom_node **node);
 
#define dom_namednodemap_remove_named_item(m, n, r) \
_dom_namednodemap_remove_named_item((dom_namednodemap *) (m), \
(n), (dom_node **) (r))
 
 
dom_exception _dom_namednodemap_item(struct dom_namednodemap *map,
uint32_t index, struct dom_node **node);
 
#define dom_namednodemap_item(m, i, n) _dom_namednodemap_item( \
(dom_namednodemap *) (m), (uint32_t) (i), \
(dom_node **) (n))
 
 
dom_exception _dom_namednodemap_get_named_item_ns(
struct dom_namednodemap *map, dom_string *namespace,
dom_string *localname, struct dom_node **node);
 
#define dom_namednodemap_get_named_item_ns(m, n, l, r) \
_dom_namednodemap_get_named_item_ns((dom_namednodemap *) (m), \
(n), (l), (dom_node **) (r))
 
 
dom_exception _dom_namednodemap_set_named_item_ns(
struct dom_namednodemap *map, struct dom_node *arg,
struct dom_node **node);
 
#define dom_namednodemap_set_named_item_ns(m, a, n) \
_dom_namednodemap_set_named_item_ns((dom_namednodemap *) (m), \
(dom_node *) (a), (dom_node **) (n))
 
 
dom_exception _dom_namednodemap_remove_named_item_ns(
struct dom_namednodemap *map, dom_string *namespace,
dom_string *localname, struct dom_node **node);
 
#define dom_namednodemap_remove_named_item_ns(m, n, l, r) \
_dom_namednodemap_remove_named_item_ns(\
(dom_namednodemap *) (m), (n),(l), (dom_node **) (r))
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/node.h
0,0 → 1,569
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_node_h_
#define dom_core_node_h_
 
#include <inttypes.h>
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/events/event_target.h>
 
struct dom_document;
struct dom_nodelist;
struct dom_namednodemap;
struct dom_node;
 
/**
* Bits defining position of a node in a document relative to some other node
*/
typedef enum {
DOM_DOCUMENT_POSITION_DISCONNECTED = 0x01,
DOM_DOCUMENT_POSITION_PRECEDING = 0x02,
DOM_DOCUMENT_POSITION_FOLLOWING = 0x04,
DOM_DOCUMENT_POSITION_CONTAINS = 0x08,
DOM_DOCUMENT_POSITION_CONTAINED_BY = 0x10,
DOM_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20
} dom_document_position;
 
/**
* Type of node operation being notified to user_data_handler
*/
typedef enum {
DOM_NODE_CLONED = 1,
DOM_NODE_IMPORTED = 2,
DOM_NODE_DELETED = 3,
DOM_NODE_RENAMED = 4,
DOM_NODE_ADOPTED = 5
} dom_node_operation;
 
/**
* Type of handler function for user data registered on a DOM node
*/
typedef void (*dom_user_data_handler)(dom_node_operation operation,
dom_string *key, void *data, struct dom_node *src,
struct dom_node *dst);
 
/**
* Type of a DOM node
*/
typedef enum {
DOM_ELEMENT_NODE = 1,
DOM_ATTRIBUTE_NODE = 2,
DOM_TEXT_NODE = 3,
DOM_CDATA_SECTION_NODE = 4,
DOM_ENTITY_REFERENCE_NODE = 5,
DOM_ENTITY_NODE = 6,
DOM_PROCESSING_INSTRUCTION_NODE = 7,
DOM_COMMENT_NODE = 8,
DOM_DOCUMENT_NODE = 9,
DOM_DOCUMENT_TYPE_NODE = 10,
DOM_DOCUMENT_FRAGMENT_NODE = 11,
DOM_NOTATION_NODE = 12,
 
/* And a count of the number of node types */
DOM_NODE_TYPE_COUNT = DOM_NOTATION_NODE
} dom_node_type;
 
typedef struct dom_node_internal dom_node_internal;
 
/**
* DOM node type
*/
typedef struct dom_node {
void *vtable;
uint32_t refcnt;
} dom_node;
 
/* DOM node vtable */
typedef struct dom_node_vtable {
dom_event_target_vtable base;
/* pre-destruction hook */
dom_exception (*dom_node_try_destroy)(dom_node_internal *node);
/* The DOM level 3 node's oprations */
dom_exception (*dom_node_get_node_name)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_get_node_value)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_set_node_value)(dom_node_internal *node,
dom_string *value);
dom_exception (*dom_node_get_node_type)(dom_node_internal *node,
dom_node_type *result);
dom_exception (*dom_node_get_parent_node)(dom_node_internal *node,
dom_node_internal **result);
dom_exception (*dom_node_get_child_nodes)(dom_node_internal *node,
struct dom_nodelist **result);
dom_exception (*dom_node_get_first_child)(dom_node_internal *node,
dom_node_internal **result);
dom_exception (*dom_node_get_last_child)(dom_node_internal *node,
dom_node_internal **result);
dom_exception (*dom_node_get_previous_sibling)(dom_node_internal *node,
dom_node_internal **result);
dom_exception (*dom_node_get_next_sibling)(dom_node_internal *node,
dom_node_internal **result);
dom_exception (*dom_node_get_attributes)(dom_node_internal *node,
struct dom_namednodemap **result);
dom_exception (*dom_node_get_owner_document)(dom_node_internal *node,
struct dom_document **result);
dom_exception (*dom_node_insert_before)(dom_node_internal *node,
dom_node_internal *new_child,
dom_node_internal *ref_child,
dom_node_internal **result);
dom_exception (*dom_node_replace_child)(dom_node_internal *node,
dom_node_internal *new_child,
dom_node_internal *old_child,
dom_node_internal **result);
dom_exception (*dom_node_remove_child)(dom_node_internal *node,
dom_node_internal *old_child,
dom_node_internal **result);
dom_exception (*dom_node_append_child)(dom_node_internal *node,
dom_node_internal *new_child,
dom_node_internal **result);
dom_exception (*dom_node_has_child_nodes)(dom_node_internal *node,
bool *result);
dom_exception (*dom_node_clone_node)(dom_node_internal *node, bool deep,
dom_node_internal **result);
dom_exception (*dom_node_normalize)(dom_node_internal *node);
dom_exception (*dom_node_is_supported)(dom_node_internal *node,
dom_string *feature, dom_string *version,
bool *result);
dom_exception (*dom_node_get_namespace)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_get_prefix)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_set_prefix)(dom_node_internal *node,
dom_string *prefix);
dom_exception (*dom_node_get_local_name)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_has_attributes)(dom_node_internal *node,
bool *result);
dom_exception (*dom_node_get_base)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_compare_document_position)(
dom_node_internal *node, dom_node_internal *other,
uint16_t *result);
dom_exception (*dom_node_get_text_content)(dom_node_internal *node,
dom_string **result);
dom_exception (*dom_node_set_text_content)(dom_node_internal *node,
dom_string *content);
dom_exception (*dom_node_is_same)(dom_node_internal *node,
dom_node_internal *other, bool *result);
dom_exception (*dom_node_lookup_prefix)(dom_node_internal *node,
dom_string *namespace,
dom_string **result);
dom_exception (*dom_node_is_default_namespace)(dom_node_internal *node,
dom_string *namespace, bool *result);
dom_exception (*dom_node_lookup_namespace)(dom_node_internal *node,
dom_string *prefix, dom_string **result);
dom_exception (*dom_node_is_equal)(dom_node_internal *node,
dom_node_internal *other, bool *result);
dom_exception (*dom_node_get_feature)(dom_node_internal *node,
dom_string *feature, dom_string *version,
void **result);
dom_exception (*dom_node_set_user_data)(dom_node_internal *node,
dom_string *key, void *data,
dom_user_data_handler handler, void **result);
dom_exception (*dom_node_get_user_data)(dom_node_internal *node,
dom_string *key, void **result);
} dom_node_vtable;
 
/* The ref/unref methods define */
 
static inline dom_node *dom_node_ref(dom_node *node)
{
if (node != NULL)
node->refcnt++;
return node;
}
 
#define dom_node_ref(n) dom_node_ref((dom_node *) (n))
 
static inline dom_exception dom_node_try_destroy(dom_node *node)
{
return ((dom_node_vtable *) node->vtable)->dom_node_try_destroy(
(dom_node_internal *) node);
}
#define dom_node_try_destroy(n) dom_node_try_destroy((dom_node *) (n))
 
static inline void dom_node_unref(dom_node *node)
{
if (node != NULL) {
if (--node->refcnt == 0)
dom_node_try_destroy(node);
}
}
#define dom_node_unref(n) dom_node_unref((dom_node *) (n))
 
static inline dom_exception dom_node_get_node_name(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_node_name(
(dom_node_internal *) node, result);
}
#define dom_node_get_node_name(n, r) dom_node_get_node_name((dom_node *) (n), (r))
 
static inline dom_exception dom_node_get_node_value(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_node_value(
(dom_node_internal *) node, result);
}
#define dom_node_get_node_value(n, r) dom_node_get_node_value( \
(dom_node *) (n), (r))
 
static inline dom_exception dom_node_set_node_value(struct dom_node *node,
dom_string *value)
{
return ((dom_node_vtable *) node->vtable)->dom_node_set_node_value(
(dom_node_internal *) node, value);
}
#define dom_node_set_node_value(n, v) dom_node_set_node_value( \
(dom_node *) (n), (v))
 
static inline dom_exception dom_node_get_node_type(struct dom_node *node,
dom_node_type *result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_node_type(
(dom_node_internal *) node, result);
}
#define dom_node_get_node_type(n, r) dom_node_get_node_type( \
(dom_node *) (n), (dom_node_type *) (r))
 
static inline dom_exception dom_node_get_parent_node(struct dom_node *node,
dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_parent_node(
(dom_node_internal *) node,
(dom_node_internal **) result);
}
#define dom_node_get_parent_node(n, r) dom_node_get_parent_node( \
(dom_node *) (n), (dom_node **) (r))
 
static inline dom_exception dom_node_get_child_nodes(struct dom_node *node,
struct dom_nodelist **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_child_nodes(
(dom_node_internal *) node, result);
}
#define dom_node_get_child_nodes(n, r) dom_node_get_child_nodes( \
(dom_node *) (n), (struct dom_nodelist **) (r))
 
static inline dom_exception dom_node_get_first_child(struct dom_node *node,
dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_first_child(
(dom_node_internal *) node,
(dom_node_internal **) result);
}
#define dom_node_get_first_child(n, r) dom_node_get_first_child( \
(dom_node *) (n), (dom_node **) (r))
 
static inline dom_exception dom_node_get_last_child(struct dom_node *node,
dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_last_child(
(dom_node_internal *) node,
(dom_node_internal **) result);
}
#define dom_node_get_last_child(n, r) dom_node_get_last_child( \
(dom_node *) (n), (dom_node **) (r))
 
static inline dom_exception dom_node_get_previous_sibling(
struct dom_node *node, dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->
dom_node_get_previous_sibling(
(dom_node_internal *) node,
(dom_node_internal **) result);
}
#define dom_node_get_previous_sibling(n, r) dom_node_get_previous_sibling( \
(dom_node *) (n), (dom_node **) (r))
 
static inline dom_exception dom_node_get_next_sibling(struct dom_node *node,
dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_next_sibling(
(dom_node_internal *) node,
(dom_node_internal **) result);
}
#define dom_node_get_next_sibling(n, r) dom_node_get_next_sibling( \
(dom_node *) (n), (dom_node **) (r))
 
static inline dom_exception dom_node_get_attributes(struct dom_node *node,
struct dom_namednodemap **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_attributes(
(dom_node_internal *) node, result);
}
#define dom_node_get_attributes(n, r) dom_node_get_attributes( \
(dom_node *) (n), (struct dom_namednodemap **) (r))
 
static inline dom_exception dom_node_get_owner_document(struct dom_node *node,
struct dom_document **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_owner_document(
(dom_node_internal *) node, result);
}
#define dom_node_get_owner_document(n, r) dom_node_get_owner_document( \
(dom_node *) (n), (struct dom_document **) (r))
 
static inline dom_exception dom_node_insert_before(struct dom_node *node,
struct dom_node *new_child, struct dom_node *ref_child,
struct dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_insert_before(
(dom_node_internal *) node,
(dom_node_internal *) new_child,
(dom_node_internal *) ref_child,
(dom_node_internal **) result);
}
#define dom_node_insert_before(n, nn, ref, ret) dom_node_insert_before( \
(dom_node *) (n), (dom_node *) (nn), (dom_node *) (ref),\
(dom_node **) (ret))
 
static inline dom_exception dom_node_replace_child(struct dom_node *node,
struct dom_node *new_child, struct dom_node *old_child,
struct dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_replace_child(
(dom_node_internal *) node,
(dom_node_internal *) new_child,
(dom_node_internal *) old_child,
(dom_node_internal **) result);
}
#define dom_node_replace_child(n, nn, old, ret) dom_node_replace_child( \
(dom_node *) (n), (dom_node *) (nn), (dom_node *) (old),\
(dom_node **) (ret))
 
static inline dom_exception dom_node_remove_child(struct dom_node *node,
struct dom_node *old_child,
struct dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_remove_child(
(dom_node_internal *) node,
(dom_node_internal *) old_child,
(dom_node_internal **) result);
}
#define dom_node_remove_child(n, old, ret) dom_node_remove_child( \
(dom_node *) (n), (dom_node *) (old), (dom_node **) (ret))
 
static inline dom_exception dom_node_append_child(struct dom_node *node,
struct dom_node *new_child,
struct dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_append_child(
(dom_node_internal *) node,
(dom_node_internal *) new_child,
(dom_node_internal **) result);
}
#define dom_node_append_child(n, nn, ret) dom_node_append_child( \
(dom_node *) (n), (dom_node *) (nn), (dom_node **) (ret))
 
static inline dom_exception dom_node_has_child_nodes(struct dom_node *node,
bool *result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_has_child_nodes(
(dom_node_internal *) node, result);
}
#define dom_node_has_child_nodes(n, r) dom_node_has_child_nodes( \
(dom_node *) (n), (bool *) (r))
 
static inline dom_exception dom_node_clone_node(struct dom_node *node,
bool deep, struct dom_node **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_clone_node(
(dom_node_internal *) node, deep,
(dom_node_internal **) result);
}
#define dom_node_clone_node(n, d, r) dom_node_clone_node((dom_node *) (n), \
(bool) (d), (dom_node **) (r))
 
static inline dom_exception dom_node_normalize(struct dom_node *node)
{
return ((dom_node_vtable *) node->vtable)->dom_node_normalize(
(dom_node_internal *) node);
}
#define dom_node_normalize(n) dom_node_normalize((dom_node *) (n))
 
static inline dom_exception dom_node_is_supported(struct dom_node *node,
dom_string *feature, dom_string *version,
bool *result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_is_supported(
(dom_node_internal *) node, feature,
version, result);
}
#define dom_node_is_supported(n, f, v, r) dom_node_is_supported( \
(dom_node *) (n), (f), (v), (bool *) (r))
 
static inline dom_exception dom_node_get_namespace(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_namespace(
(dom_node_internal *) node, result);
}
#define dom_node_get_namespace(n, r) dom_node_get_namespace((dom_node *) (n), (r))
 
static inline dom_exception dom_node_get_prefix(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_prefix(
(dom_node_internal *) node, result);
}
#define dom_node_get_prefix(n, r) dom_node_get_prefix((dom_node *) (n), (r))
 
static inline dom_exception dom_node_set_prefix(struct dom_node *node,
dom_string *prefix)
{
return ((dom_node_vtable *) node->vtable)->dom_node_set_prefix(
(dom_node_internal *) node, prefix);
}
#define dom_node_set_prefix(n, p) dom_node_set_prefix((dom_node *) (n), (p))
 
static inline dom_exception dom_node_get_local_name(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_local_name(
(dom_node_internal *) node, result);
}
#define dom_node_get_local_name(n, r) dom_node_get_local_name((dom_node *) (n), (r))
 
static inline dom_exception dom_node_has_attributes(struct dom_node *node,
bool *result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_has_attributes(
(dom_node_internal *) node, result);
}
#define dom_node_has_attributes(n, r) dom_node_has_attributes( \
(dom_node *) (n), (bool *) (r))
 
static inline dom_exception dom_node_get_base(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_base(
(dom_node_internal *) node, result);
}
#define dom_node_get_base(n, r) dom_node_get_base((dom_node *) (n), (r))
 
static inline dom_exception dom_node_compare_document_position(
struct dom_node *node, struct dom_node *other,
uint16_t *result)
{
return ((dom_node_vtable *) node->vtable)->
dom_node_compare_document_position(
(dom_node_internal *) node,
(dom_node_internal *) other, result);
}
#define dom_node_compare_document_position(n, o, r) \
dom_node_compare_document_position((dom_node *) (n), \
(dom_node *) (o), (uint16_t *) (r))
 
static inline dom_exception dom_node_get_text_content(struct dom_node *node,
dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_text_content(
(dom_node_internal *) node, result);
}
#define dom_node_get_text_content(n, r) dom_node_get_text_content( \
(dom_node *) (n), (r))
 
static inline dom_exception dom_node_set_text_content(struct dom_node *node,
dom_string *content)
{
return ((dom_node_vtable *) node->vtable)->dom_node_set_text_content(
(dom_node_internal *) node, content);
}
#define dom_node_set_text_content(n, c) dom_node_set_text_content( \
(dom_node *) (n), (c))
 
static inline dom_exception dom_node_is_same(struct dom_node *node,
struct dom_node *other, bool *result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_is_same(
(dom_node_internal *) node,
(dom_node_internal *) other,
result);
}
#define dom_node_is_same(n, o, r) dom_node_is_same((dom_node *) (n), \
(dom_node *) (o), (bool *) (r))
 
static inline dom_exception dom_node_lookup_prefix(struct dom_node *node,
dom_string *namespace, dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_lookup_prefix(
(dom_node_internal *) node, namespace, result);
}
#define dom_node_lookup_prefix(n, ns, r) dom_node_lookup_prefix( \
(dom_node *) (n), (ns), (r))
 
static inline dom_exception dom_node_is_default_namespace(
struct dom_node *node, dom_string *namespace,
bool *result)
{
return ((dom_node_vtable *) node->vtable)->
dom_node_is_default_namespace(
(dom_node_internal *) node, namespace, result);
}
#define dom_node_is_default_namespace(n, ns, r) dom_node_is_default_namespace(\
(dom_node *) (n), (ns), (bool *) (r))
 
static inline dom_exception dom_node_lookup_namespace(struct dom_node *node,
dom_string *prefix, dom_string **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_lookup_namespace(
(dom_node_internal *) node, prefix, result);
}
#define dom_node_lookup_namespace(n, p, r) dom_node_lookup_namespace( \
(dom_node *) (n), (p), (r))
 
static inline dom_exception dom_node_is_equal(struct dom_node *node,
struct dom_node *other, bool *result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_is_equal(
(dom_node_internal *) node,
(dom_node_internal *) other,
result);
}
#define dom_node_is_equal(n, o, r) dom_node_is_equal((dom_node *) (n), \
(dom_node *) (o), (bool *) (r))
 
static inline dom_exception dom_node_get_feature(struct dom_node *node,
dom_string *feature, dom_string *version,
void **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_feature(
(dom_node_internal *) node, feature, version, result);
}
#define dom_node_get_feature(n, f, v, r) dom_node_get_feature( \
(dom_node *) (n), (f), (v), (void **) (r))
 
static inline dom_exception dom_node_set_user_data(struct dom_node *node,
dom_string *key, void *data,
dom_user_data_handler handler, void **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_set_user_data(
(dom_node_internal *) node, key, data, handler,
result);
}
#define dom_node_set_user_data(n, k, d, h, r) dom_node_set_user_data( \
(dom_node *) (n), (k), (void *) (d), \
(dom_user_data_handler) h, (void **) (r))
 
static inline dom_exception dom_node_get_user_data(struct dom_node *node,
dom_string *key, void **result)
{
return ((dom_node_vtable *) node->vtable)->dom_node_get_user_data(
(dom_node_internal *) node, key, result);
}
#define dom_node_get_user_data(n, k, r) dom_node_get_user_data( \
(dom_node *) (n), (k), (void **) (r))
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/nodelist.h
0,0 → 1,28
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_nodelist_h_
#define dom_core_nodelist_h_
 
#include <dom/core/exceptions.h>
 
struct dom_node;
 
typedef struct dom_nodelist dom_nodelist;
 
void dom_nodelist_ref(struct dom_nodelist *list);
void dom_nodelist_unref(struct dom_nodelist *list);
 
dom_exception dom_nodelist_get_length(struct dom_nodelist *list,
uint32_t *length);
dom_exception _dom_nodelist_item(struct dom_nodelist *list,
uint32_t index, struct dom_node **node);
 
#define dom_nodelist_item(l, i, n) _dom_nodelist_item((dom_nodelist *) (l), \
(uint32_t) (i), (dom_node **) (n))
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/pi.h
0,0 → 1,13
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_processinginstruction_h_
#define dom_core_processinginstruction_h_
 
typedef struct dom_processing_instruction dom_processing_instruction;
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/string.h
0,0 → 1,116
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_string_h_
#define dom_string_h_
 
#include <inttypes.h>
#include <stddef.h>
#include <libwapcaplet/libwapcaplet.h>
 
#include <dom/functypes.h>
#include <dom/core/exceptions.h>
 
typedef struct dom_string dom_string;
extern struct dom_string {
uint32_t refcnt;
} _ALIGNED;
 
 
/* Claim a reference on a DOM string */
static inline dom_string *dom_string_ref(dom_string *str)
{
if (str != NULL)
str->refcnt++;
return str;
}
 
/* Destroy a DOM string */
void dom_string_destroy(dom_string *str);
 
/* Release a reference on a DOM string */
static inline void dom_string_unref(dom_string *str)
{
if ((str != NULL) && (--(str->refcnt) == 0)) {
dom_string_destroy(str);
}
}
 
/* Create a DOM string from a string of characters */
dom_exception dom_string_create(const uint8_t *ptr, size_t len,
dom_string **str);
dom_exception dom_string_create_interned(const uint8_t *ptr, size_t len,
dom_string **str);
 
/* Obtain an interned representation of a dom string */
dom_exception dom_string_intern(dom_string *str,
struct lwc_string_s **lwcstr);
 
/* Case sensitively compare two DOM strings */
bool dom_string_isequal(const dom_string *s1, const dom_string *s2);
/* Case insensitively compare two DOM strings */
bool dom_string_caseless_isequal(const dom_string *s1, const dom_string *s2);
 
/* Case sensitively compare DOM string and lwc_string */
bool dom_string_lwc_isequal(const dom_string *s1, lwc_string *s2);
/* Case insensitively compare DOM string and lwc_string */
bool dom_string_caseless_lwc_isequal(const dom_string *s1, lwc_string *s2);
 
/* Get the index of the first occurrence of a character in a dom string */
uint32_t dom_string_index(dom_string *str, uint32_t chr);
/* Get the index of the last occurrence of a character in a dom string */
uint32_t dom_string_rindex(dom_string *str, uint32_t chr);
 
/* Get the length, in characters, of a dom string */
uint32_t dom_string_length(dom_string *str);
 
/**
* Get the raw character data of the dom_string.
* @note: This function is just provided for the convenience of accessing the
* raw C string character, no change on the result string is allowed.
*/
const char *dom_string_data(const dom_string *str);
 
/* Get the byte length of this dom_string */
size_t dom_string_byte_length(const dom_string *str);
 
/* Get the UCS-4 character at position index, the index should be in
* [0, length), and length can be get by calling dom_string_length
*/
dom_exception dom_string_at(dom_string *str, uint32_t index,
uint32_t *ch);
 
/* Concatenate two dom strings */
dom_exception dom_string_concat(dom_string *s1, dom_string *s2,
dom_string **result);
 
/* Extract a substring from a dom string */
dom_exception dom_string_substr(dom_string *str,
uint32_t i1, uint32_t i2, dom_string **result);
 
/* Insert data into a dom string at the given location */
dom_exception dom_string_insert(dom_string *target,
dom_string *source, uint32_t offset,
dom_string **result);
 
/* Replace a section of a dom string */
dom_exception dom_string_replace(dom_string *target,
dom_string *source, uint32_t i1, uint32_t i2,
dom_string **result);
 
/* Generate an uppercase version of the given string */
dom_exception dom_string_toupper(dom_string *source, bool ascii_only,
dom_string **upper);
 
/* Generate an lowercase version of the given string */
dom_exception dom_string_tolower(dom_string *source, bool ascii_only,
dom_string **lower);
 
/* Calculate a hash value from a dom string */
uint32_t dom_string_hash(dom_string *str);
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/text.h
0,0 → 1,70
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_core_text_h_
#define dom_core_text_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/characterdata.h>
 
struct dom_characterdata;
 
typedef struct dom_text dom_text;
 
typedef struct dom_text_vtable {
struct dom_characterdata_vtable base;
 
dom_exception (*dom_text_split_text)(struct dom_text *text,
uint32_t offset, struct dom_text **result);
dom_exception (*dom_text_get_is_element_content_whitespace)(
struct dom_text *text, bool *result);
dom_exception (*dom_text_get_whole_text)(struct dom_text *text,
dom_string **result);
dom_exception (*dom_text_replace_whole_text)(struct dom_text *text,
dom_string *content, struct dom_text **result);
} dom_text_vtable;
 
static inline dom_exception dom_text_split_text(struct dom_text *text,
uint32_t offset, struct dom_text **result)
{
return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
dom_text_split_text(text, offset, result);
}
#define dom_text_split_text(t, o, r) dom_text_split_text((dom_text *) (t), \
(uint32_t) (o), (dom_text **) (r))
 
static inline dom_exception dom_text_get_is_element_content_whitespace(
struct dom_text *text, bool *result)
{
return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
dom_text_get_is_element_content_whitespace(text,
result);
}
#define dom_text_get_is_element_content_whitespace(t, r) \
dom_text_get_is_element_content_whitespace((dom_text *) (t), \
(bool *) (r))
 
static inline dom_exception dom_text_get_whole_text(struct dom_text *text,
dom_string **result)
{
return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
dom_text_get_whole_text(text, result);
}
#define dom_text_get_whole_text(t, r) dom_text_get_whole_text((dom_text *) (t), (r))
 
static inline dom_exception dom_text_replace_whole_text(struct dom_text *text,
dom_string *content, struct dom_text **result)
{
return ((dom_text_vtable *) ((dom_node *) text)->vtable)->
dom_text_replace_whole_text(text, content, result);
}
#define dom_text_replace_whole_text(t, c, r) dom_text_replace_whole_text( \
(dom_text *) (t), (c), (dom_text **) (r))
 
#endif
/contrib/network/netsurf/libdom/include/dom/core/typeinfo.h
0,0 → 1,45
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_core_typeinfo_h_
#define dom_core_typeinfo_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
typedef struct dom_type_info dom_type_info;
 
typedef enum {
DOM_TYPE_INFO_DERIVATION_RESTRICTION = 0x00000001,
DOM_TYPE_INFO_DERIVATION_EXTENSION = 0x00000002,
DOM_TYPE_INFO_DERIVATION_UNION = 0x00000004,
DOM_TYPE_INFO_DERIVATION_LIST = 0x00000008
} dom_type_info_derivation_method;
 
dom_exception _dom_type_info_get_type_name(dom_type_info *ti,
dom_string **ret);
#define dom_type_info_get_type_name(t, r) _dom_type_info_get_type_name( \
(dom_type_info *) (t), (r))
 
 
dom_exception _dom_type_info_get_type_namespace(dom_type_info *ti,
dom_string **ret);
#define dom_type_info_get_type_namespace(t, r) \
_dom_type_info_get_type_namespace((dom_type_info *) (t), (r))
 
 
dom_exception _dom_type_info_is_derived(dom_type_info *ti,
dom_string *namespace, dom_string *name,
dom_type_info_derivation_method method, bool *ret);
#define dom_type_info_is_derived(t, s, n, m, r) _dom_type_info_is_derived(\
(dom_type_info *) (t), (s), (n), \
(dom_type_info_derivation_method) (m), (bool *) (r))
 
 
#endif
/contrib/network/netsurf/libdom/include/dom/dom.h
0,0 → 1,75
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
/** \file
* This is the top-level header file for libdom. The intention of this is
* to allow client applications to simply include this file and get access
* to all the libdom API.
*/
 
#ifndef dom_dom_h_
#define dom_dom_h_
 
/* Base library headers */
#include <dom/functypes.h>
 
/* DOM core headers */
#include <dom/core/attr.h>
#include <dom/core/characterdata.h>
#include <dom/core/document.h>
#include <dom/core/document_type.h>
#include <dom/core/element.h>
#include <dom/core/exceptions.h>
#include <dom/core/implementation.h>
#include <dom/core/namednodemap.h>
#include <dom/core/node.h>
#include <dom/core/cdatasection.h>
#include <dom/core/doc_fragment.h>
#include <dom/core/entity_ref.h>
#include <dom/core/nodelist.h>
#include <dom/core/string.h>
#include <dom/core/text.h>
#include <dom/core/pi.h>
#include <dom/core/typeinfo.h>
#include <dom/core/comment.h>
 
/* DOM HTML headers */
#include <dom/html/html_collection.h>
#include <dom/html/html_document.h>
#include <dom/html/html_element.h>
#include <dom/html/html_html_element.h>
#include <dom/html/html_head_element.h>
#include <dom/html/html_link_element.h>
#include <dom/html/html_title_element.h>
#include <dom/html/html_body_element.h>
#include <dom/html/html_meta_element.h>
#include <dom/html/html_form_element.h>
#include <dom/html/html_input_element.h>
#include <dom/html/html_button_element.h>
#include <dom/html/html_text_area_element.h>
#include <dom/html/html_opt_group_element.h>
#include <dom/html/html_option_element.h>
#include <dom/html/html_select_element.h>
 
/* DOM Events header */
#include <dom/events/events.h>
 
typedef enum dom_namespace {
DOM_NAMESPACE_NULL = 0,
DOM_NAMESPACE_HTML = 1,
DOM_NAMESPACE_MATHML = 2,
DOM_NAMESPACE_SVG = 3,
DOM_NAMESPACE_XLINK = 4,
DOM_NAMESPACE_XML = 5,
DOM_NAMESPACE_XMLNS = 6,
 
DOM_NAMESPACE_COUNT = 7
} dom_namespace;
 
extern dom_string *dom_namespaces[DOM_NAMESPACE_COUNT];
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/custom_event.h
0,0 → 1,31
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_custom_event_h_
#define dom_events_custom_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
typedef struct dom_custom_event dom_custom_event;
 
dom_exception _dom_custom_event_get_detail(dom_custom_event *evt,
void **detail);
#define dom_custom_event_get_detail(e, d) \
_dom_custom_event_get_detail((dom_custom_event *) (e),\
(void **) (d))
 
dom_exception _dom_custom_event_init_ns(dom_custom_event *evt,
dom_string *namespace, dom_string *type,
bool bubble, bool cancelable, void *detail);
#define dom_custom_event_init_ns(e, n, t, b, c, d) \
_dom_custom_event_init_ns((dom_custom_event *) (e), \
(dom_string *) (n), (dom_string *) (t), \
(bool) (b), (bool) (c), (void *) (d))
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/document_event.h
0,0 → 1,100
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_document_event_h_
#define dom_events_document_event_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_event;
struct dom_document;
 
typedef struct dom_document dom_document_event;
 
/**
* The callback function which is used to process the default action of any
* event.
*
* As ::dom_default_action_phase defines, we have three points in our
* implementation where these kinds of callbacks get invoked.
*
* When the implementation start to dispatch certain event, it firstly invoke
* the following callback, which should process the event before the normal
* event flow.
*
* Take a MousePressed event on a check box object as example:
* 1. The 'pressed' event is generated by OS and catched by our UI code;
* 2. The UI code dispatch the event to DOM;
* 3. DOM trys to dispatch the event as what the spec said;
* 4. Before the real event flow happens, DOM get the
* dom_default_action_callback function from the
* dom_events_default_action_fetcher with param
* DOM_DEFAULT_ACTION_STARTED, and then call it;
* 5. The callback function invoke some System-denpendent API to make the
* checkbox checked and then return;
* 6. Normal event flow goes on.
* 7. When the implementation reach the end of the event flow, it check whether
* the event's default action is prevented, if it is, then go to step 8,
* else go to step 9.
* 8. The event's default action get prevented, DOM get the
* dom_default_action_callback function from the
* dom_events_default_action_fetcher with param
* DOM_DEFAULT_ACTION_PREVENTED, and then call it.
* 8. The event's default action does not get prevented, DOM get the
* dom_default_action_callback function from the
* dom_events_default_action_fetcher with param
* DOM_DEFAULT_ACTION_END, and then call it.
*
* @note: the point here is that we want the UI related stuff to be done
* within the default action code. The DOM only take care of the content tree
* and the event flow itself.
*/
typedef void (*dom_default_action_callback)(struct dom_event *evt, void *pw);
 
/**
* The default action phase
*
* @note: we define the following three values to fetch three different types
* of dom_default_action_callback function and their private data.
*/
typedef enum {
DOM_DEFAULT_ACTION_STARTED = 0,
DOM_DEFAULT_ACTION_PREVENTED,
DOM_DEFAULT_ACTION_END
} dom_default_action_phase;
 
/**
* The default action fetcher
*
* \param type The type of the event
* \param phase The phase of the default action callback
* \param pw The return private data of the callback function
* \return a callback function, NULL if there is none.
*/
typedef dom_default_action_callback (*dom_events_default_action_fetcher)
(dom_string *type, dom_default_action_phase phase,
void **pw);
 
dom_exception _dom_document_event_create_event(dom_document_event *de,
dom_string *type, struct dom_event **evt);
#define dom_document_event_create_event(d, t, e) \
_dom_document_event_create_event((dom_document_event *) (d), \
(dom_string *) (t), (struct dom_event **) (e))
 
dom_exception _dom_document_event_can_dispatch(dom_document_event *de,
dom_string *namespace, dom_string *type,
bool* can);
#define dom_document_event_can_dispatch(d, n, t, c) \
_dom_document_event_can_dispatch((dom_document_event *) (d), \
(dom_string *) (n), (dom_string *) (t),\
(bool *) (c))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/events/event.h
0,0 → 1,92
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_event_h_
#define dom_events_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/events/event_target.h>
 
typedef enum {
DOM_CAPTURING_PHASE = 1,
DOM_AT_TARGET = 2,
DOM_BUBBLING_PHASE = 3
} dom_event_flow_phase;
 
typedef struct dom_event dom_event;
 
/* The ref/unref methods define */
void _dom_event_ref(dom_event *evt);
#define dom_event_ref(n) _dom_event_ref((dom_event *) (n))
void _dom_event_unref(dom_event *evt);
#define dom_event_unref(n) _dom_event_unref((dom_event *) (n))
 
dom_exception _dom_event_get_type(dom_event *evt, dom_string **type);
#define dom_event_get_type(e, t) _dom_event_get_type((dom_event *) (e), \
(dom_string **) (t))
 
dom_exception _dom_event_get_target(dom_event *evt, dom_event_target **target);
#define dom_event_get_target(e, t) _dom_event_get_target((dom_event *) (e), \
(dom_event_target **) (t))
 
dom_exception _dom_event_get_current_target(dom_event *evt,
dom_event_target **current);
#define dom_event_get_current_target(e, c) _dom_event_get_current_target(\
(dom_event *) (e), (dom_event_target **) (c))
 
dom_exception _dom_event_get_bubbles(dom_event *evt, bool *bubbles);
#define dom_event_get_bubbles(e, b) _dom_event_get_bubbles((dom_event *) (e), \
(bool *) (b))
 
dom_exception _dom_event_get_cancelable(dom_event *evt, bool *cancelable);
#define dom_event_get_cancelable(e, c) _dom_event_get_cancelable(\
(dom_event *) (e), (bool *) (c))
 
dom_exception _dom_event_get_timestamp(dom_event *evt,
unsigned int *timestamp);
#define dom_event_get_timestamp(e, t) _dom_event_get_timestamp(\
(dom_event *) (e), (unsigned int *) (t))
 
dom_exception _dom_event_stop_propagation(dom_event *evt);
#define dom_event_stop_propagation(e) _dom_event_stop_propagation(\
(dom_event *) (e))
 
dom_exception _dom_event_prevent_default(dom_event *evt);
#define dom_event_prevent_default(e) _dom_event_prevent_default(\
(dom_event *) (e))
 
dom_exception _dom_event_init(dom_event *evt, dom_string *type,
bool bubble, bool cancelable);
#define dom_event_init(e, t, b, c) _dom_event_init((dom_event *) (e), \
(dom_string *) (t), (bool) (b), (bool) (c))
 
dom_exception _dom_event_get_namespace(dom_event *evt,
dom_string **namespace);
#define dom_event_get_namespace(e, n) _dom_event_get_namespace(\
(dom_event *) (e), (dom_string **) (n))
 
dom_exception _dom_event_is_custom(dom_event *evt, bool *custom);
#define dom_event_is_custom(e, c) _dom_event_is_custom((dom_event *) (e), \
(bool *) (c))
dom_exception _dom_event_stop_immediate_propagation(dom_event *evt);
#define dom_event_stop_immediate_propagation(e) \
_dom_event_stop_immediate_propagation((dom_event *) (e))
 
dom_exception _dom_event_is_default_prevented(dom_event *evt, bool *prevented);
#define dom_event_is_default_prevented(e, p) \
_dom_event_is_default_prevented((dom_event *) (e), (bool *) (p))
 
dom_exception _dom_event_init_ns(dom_event *evt, dom_string *namespace,
dom_string *type, bool bubble, bool cancelable);
#define dom_event_init_ns(e, n, t, b, c) _dom_event_init_ns( \
(dom_event *) (e), (dom_string *) (n), \
(dom_string *) (t), (bool) (b), (bool) (c))
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/event_listener.h
0,0 → 1,27
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_event_listener_h_
#define dom_events_event_listener_h_
 
#include <dom/core/exceptions.h>
 
struct dom_document;
struct dom_event;
 
typedef void (*handle_event)(struct dom_event *evt, void *pw);
 
typedef struct dom_event_listener dom_event_listener;
 
dom_exception dom_event_listener_create(struct dom_document *doc,
handle_event handler, void *pw, dom_event_listener **listener);
 
void dom_event_listener_ref(dom_event_listener *listener);
void dom_event_listener_unref(dom_event_listener *listener);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/events/event_target.h
0,0 → 1,111
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_event_target_h_
#define dom_events_event_target_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_event_listener;
struct dom_event;
 
/* Event target is a mixin interface, thus has no concrete implementation.
* Subclasses must provide implementations of the event target methods. */
typedef struct dom_event_target {
void *vtable;
} dom_event_target;
 
typedef struct dom_event_target_vtable {
dom_exception (*add_event_listener)(
dom_event_target *et, dom_string *type,
struct dom_event_listener *listener,
bool capture);
dom_exception (*remove_event_listener)(
dom_event_target *et, dom_string *type,
struct dom_event_listener *listener,
bool capture);
dom_exception (*dispatch_event)(
dom_event_target *et,
struct dom_event *evt, bool *success);
dom_exception (*add_event_listener_ns)(
dom_event_target *et,
dom_string *namespace, dom_string *type,
struct dom_event_listener *listener,
bool capture);
dom_exception (*remove_event_listener_ns)(
dom_event_target *et,
dom_string *namespace, dom_string *type,
struct dom_event_listener *listener,
bool capture);
} dom_event_target_vtable;
 
static inline dom_exception dom_event_target_add_event_listener(
dom_event_target *et, dom_string *type,
struct dom_event_listener *listener, bool capture)
{
return ((dom_event_target_vtable *) et->vtable)->add_event_listener(
et, type, listener, capture);
}
#define dom_event_target_add_event_listener(et, t, l, c) \
dom_event_target_add_event_listener((dom_event_target *) (et),\
(dom_string *) (t), (struct dom_event_listener *) (l), \
(bool) (c))
 
static inline dom_exception dom_event_target_remove_event_listener(
dom_event_target *et, dom_string *type,
struct dom_event_listener *listener, bool capture)
{
return ((dom_event_target_vtable *) et->vtable)->remove_event_listener(
et, type, listener, capture);
}
#define dom_event_target_remove_event_listener(et, t, l, c) \
dom_event_target_remove_event_listener(\
(dom_event_target *) (et), (dom_string *) (t),\
(struct dom_event_listener *) (l), (bool) (c))
 
static inline dom_exception dom_event_target_dispatch_event(
dom_event_target *et, struct dom_event *evt, bool *success)
{
return ((dom_event_target_vtable *) et->vtable)->dispatch_event(
et, evt, success);
}
#define dom_event_target_dispatch_event(et, e, s) \
dom_event_target_dispatch_event((dom_event_target *) (et),\
(struct dom_event *) (e), (bool *) (s))
 
static inline dom_exception dom_event_target_add_event_listener_ns(
dom_event_target *et,
dom_string *namespace, dom_string *type,
struct dom_event_listener *listener, bool capture)
{
return ((dom_event_target_vtable *) et->vtable)->add_event_listener_ns(
et, namespace, type, listener, capture);
}
#define dom_event_target_add_event_listener_ns(et, n, t, l, c) \
dom_event_target_add_event_listener_ns(\
(dom_event_target *) (et), (dom_string *) (n),\
(dom_string *) (t), (struct dom_event_listener *) (l),\
(bool) (c))
 
static inline dom_exception dom_event_target_remove_event_listener_ns(
dom_event_target *et,
dom_string *namespace, dom_string *type,
struct dom_event_listener *listener, bool capture)
{
return ((dom_event_target_vtable *) et->vtable)->remove_event_listener_ns(
et, namespace, type, listener, capture);
}
#define dom_event_target_remove_event_listener_ns(et, n, t, l, c) \
dom_event_target_remove_event_listener_ns(\
(dom_event_target *) (et), (dom_string *) (n),\
(dom_string *) (t), (struct dom_event_listener *) (l),\
(bool) (c))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/events/events.h
0,0 → 1,25
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_h_
#define dom_events_h_
 
#include <dom/events/event.h>
#include <dom/events/ui_event.h>
#include <dom/events/custom_event.h>
#include <dom/events/mouse_event.h>
#include <dom/events/keyboard_event.h>
#include <dom/events/mouse_wheel_event.h>
#include <dom/events/mouse_multi_wheel_event.h>
#include <dom/events/mutation_event.h>
#include <dom/events/mutation_name_event.h>
#include <dom/events/text_event.h>
#include <dom/events/event_listener.h>
#include <dom/events/document_event.h>
#include <dom/events/event_target.h>
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/keyboard_event.h
0,0 → 1,89
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_keyboard_event_h_
#define dom_events_keyboard_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_abstract_view;
 
typedef struct dom_keyboard_event dom_keyboard_event;
 
typedef enum {
DOM_KEY_LOCATION_STANDARD = 0,
DOM_KEY_LOCATION_LEFT = 1,
DOM_KEY_LOCATION_RIGHT = 2,
DOM_KEY_LOCATION_NUMPAD = 3
} dom_key_location;
 
dom_exception _dom_keyboard_event_get_key_identifier(dom_keyboard_event *evt,
dom_string **ident);
#define dom_keyboard_event_get_key_identifier(e, i) \
_dom_keyboard_event_get_key_identifier( \
(dom_keyboard_event *) (e), (dom_string **) (i))
 
dom_exception _dom_keyboard_event_get_key_location(dom_keyboard_event *evt,
dom_key_location *loc);
#define dom_keyboard_event_get_key_location(e, l) \
_dom_keyboard_event_get_key_location( \
(dom_keyboard_event *) (e), (dom_key_location *) (l))
 
dom_exception _dom_keyboard_event_get_ctrl_key(dom_keyboard_event *evt,
bool *key);
#define dom_keyboard_event_get_ctrl_key(e, k) _dom_keyboard_event_get_ctrl_key(\
(dom_keyboard_event *) (e), (bool *) (k))
 
dom_exception _dom_keyboard_event_get_shift_key(dom_keyboard_event *evt,
bool *key);
#define dom_keyboard_event_get_shift_key(e, k) \
_dom_keyboard_event_get_shift_key((dom_keyboard_event *) (e), \
(bool *) (k))
 
dom_exception _dom_keyboard_event_get_alt_key(dom_keyboard_event *evt,
bool *key);
#define dom_keyboard_event_get_alt_key(e, k) _dom_keyboard_event_get_alt_key(\
(dom_keyboard_event *) (e), (bool *) (k))
 
dom_exception _dom_keyboard_event_get_meta_key(dom_keyboard_event *evt,
bool *key);
#define dom_keyboard_event_get_meta_key(e, k) _dom_keyboard_event_get_meta_key(\
(dom_keyboard_event *) (e), (bool *) (k))
 
dom_exception _dom_keyboard_event_get_modifier_state(dom_keyboard_event *evt,
dom_string *m, bool *state);
#define dom_keyboard_event_get_modifier_state(e, m, s) \
_dom_keyboard_event_get_modifier_state( \
(dom_keyboard_event *) (e), (dom_string *) (m),\
(bool *) (s))
 
dom_exception _dom_keyboard_event_init(dom_keyboard_event *evt,
dom_string *type, bool bubble, bool cancelable,
struct dom_abstract_view *view, dom_string *key_ident,
dom_key_location key_loc, dom_string *modifier_list);
#define dom_keyboard_event_init(e, t, b, c, v, ki, kl, m) \
_dom_keyboard_event_init((dom_keyboard_event *) (e), \
(dom_string *) (t), (bool) (b), (bool) (c), \
(struct dom_abstract_view *) (v), (dom_string *) (ki), \
(dom_key_location) (kl), (dom_string *) (m))
 
dom_exception _dom_keyboard_event_init_ns(dom_keyboard_event *evt,
dom_string *namespace, dom_string *type,
bool bubble, bool cancelable, struct dom_abstract_view *view,
dom_string *key_ident, dom_key_location key_loc,
dom_string *modifier_list);
#define dom_keyboard_event_init_ns(e, n, t, b, c, v, ki, kl, m) \
_dom_keyboard_event_init_ns((dom_keyboard_event *) (e), \
(dom_string *) (n), (dom_string *) (t), \
(bool) (b), (bool) (c), (struct dom_abstract_view *) (v), \
(dom_string *) (ki), (dom_key_location) (kl), \
(dom_string *) (m))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/events/mouse_event.h
0,0 → 1,108
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_mouse_event_h_
#define dom_events_mouse_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/events/event_target.h>
 
struct dom_abstract_view;
 
typedef struct dom_mouse_event dom_mouse_event;
 
dom_exception _dom_mouse_event_get_screen_x(dom_mouse_event *evt,
int32_t *x);
#define dom_mouse_event_get_screen_x(e, x) _dom_mouse_event_get_screen_x(\
(dom_mouse_event *) (e), (int32_t *) (x))
 
dom_exception _dom_mouse_event_get_screen_y(dom_mouse_event *evt,
int32_t *y);
#define dom_mouse_event_get_screen_y(e, y) _dom_mouse_event_get_screen_y(\
(dom_mouse_event *) (e), (int32_t *) (y))
 
dom_exception _dom_mouse_event_get_client_x(dom_mouse_event *evt,
int32_t *x);
#define dom_mouse_event_get_client_x(e, x) _dom_mouse_event_get_client_x(\
(dom_mouse_event *) (e), (int32_t *) (x))
 
dom_exception _dom_mouse_event_get_client_y(dom_mouse_event *evt,
int32_t *y);
#define dom_mouse_event_get_client_y(e, y) _dom_mouse_event_get_client_y(\
(dom_mouse_event *) (e), (int32_t *) (y))
 
dom_exception _dom_mouse_event_get_ctrl_key(dom_mouse_event *evt,
bool *key);
#define dom_mouse_event_get_ctrl_key(e, k) _dom_mouse_event_get_ctrl_key( \
(dom_mouse_event *) (e), (bool *) (k))
 
dom_exception _dom_mouse_event_get_shift_key(dom_mouse_event *evt,
bool *key);
#define dom_mouse_event_get_shift_key(e, k) _dom_mouse_event_get_shift_key( \
(dom_mouse_event *) (e), (bool *) (k))
 
dom_exception _dom_mouse_event_get_alt_key(dom_mouse_event *evt,
bool *key);
#define dom_mouse_event_get_alt_key(e, k) _dom_mouse_event_get_alt_key( \
(dom_mouse_event *) (e), (bool *) (k))
 
dom_exception _dom_mouse_event_get_meta_key(dom_mouse_event *evt,
bool *key);
#define dom_mouse_event_get_meta_key(e, k) _dom_mouse_event_get_meta_key( \
(dom_mouse_event *) (e), (bool *) (k))
 
dom_exception _dom_mouse_event_get_button(dom_mouse_event *evt,
unsigned short *button);
#define dom_mouse_event_get_button(e, b) _dom_mouse_event_get_button(\
(dom_mouse_event *) (e), (unsigned short *) (b))
 
dom_exception _dom_mouse_event_get_related_target(dom_mouse_event *evt,
dom_event_target **et);
#define dom_mouse_event_get_related_target(e, t) \
_dom_mouse_event_get_related_target((dom_mouse_event *) (e),\
(dom_event_target **) (t))
 
dom_exception _dom_mouse_event_get_modifier_state(dom_mouse_event *evt,
dom_string *m, bool *state);
#define dom_mouse_event_get_modifier_state(e, m, s) \
_dom_mouse_event_get_modifier_state((dom_mouse_event *) (e), \
(dom_string *) (m), (bool *) (s))
 
dom_exception _dom_mouse_event_init(dom_mouse_event *evt,
dom_string *type, bool bubble, bool cancelable,
struct dom_abstract_view *view, int32_t detail, int32_t screen_x,
int32_t screen_y, int32_t client_x, int32_t client_y, bool ctrl,
bool alt, bool shift, bool meta, unsigned short button,
dom_event_target *et);
#define dom_mouse_event_init(e, t, b, c, v, d, sx, sy, cx, cy, ctrl, alt, \
shift, meta, button, et) \
_dom_mouse_event_init((dom_mouse_event *) (e), \
(dom_string *) (t), (bool) (b), (bool) (c),\
(struct dom_abstract_view *) (v), (int32_t) (d), (int32_t) (sx), \
(int32_t) (sy), (int32_t) (cx), (int32_t) (cy), (bool) (ctrl),\
(bool) (alt), (bool) (shift), (bool) (meta), \
(unsigned short) (button), (dom_event_target *) (et))
 
dom_exception _dom_mouse_event_init_ns(dom_mouse_event *evt,
dom_string *namespace, dom_string *type,
bool bubble, bool cancelable, struct dom_abstract_view *view,
int32_t detail, int32_t screen_x, int32_t screen_y, int32_t client_x,
int32_t client_y, bool ctrl, bool alt, bool shift, bool meta,
unsigned short button, dom_event_target *et);
#define dom_mouse_event_init_ns(e, n, t, b, c, v, d, sx, sy, cx, cy, ctrl, alt,\
shift, meta, button, et) \
_dom_mouse_event_init_ns((dom_mouse_event *) (e), \
(dom_string *) (n), (dom_string *) (t),\
(bool) (b), (bool) (c), (struct dom_abstract_view *) (v),\
(int32_t) (d), (int32_t) (sx), (int32_t) (sy), (int32_t) (cx),\
(int32_t) (cy), (bool) (ctrl), (bool) (alt), (bool) (shift),\
(bool) (meta), (unsigned short) (button),\
(dom_event_target *) (et))
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/mouse_multi_wheel_event.h
0,0 → 1,56
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_mouse_multi_wheel_event_h_
#define dom_events_mouse_multi_wheel_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/events/event_target.h>
 
struct dom_abstract_view;
 
typedef struct dom_mouse_multi_wheel_event dom_mouse_multi_wheel_event;
 
dom_exception _dom_mouse_multi_wheel_event_get_wheel_delta_x(
dom_mouse_multi_wheel_event *evt, int32_t *x);
#define dom_mouse_multi_wheel_event_get_wheel_delta_x(e, x) \
_dom_mouse_multi_wheel_event_get_wheel_delta_x( \
(dom_mouse_multi_wheel_event *) (e), (int32_t *) (x))
 
dom_exception _dom_mouse_multi_wheel_event_get_wheel_delta_y(
dom_mouse_multi_wheel_event *evt, int32_t *y);
#define dom_mouse_multi_wheel_event_get_wheel_delta_y(e, y) \
_dom_mouse_multi_wheel_event_get_wheel_delta_y( \
(dom_mouse_multi_wheel_event *) (e), (int32_t *) (y))
 
dom_exception _dom_mouse_multi_wheel_event_get_wheel_delta_z(
dom_mouse_multi_wheel_event *evt, int32_t *z);
#define dom_mouse_multi_wheel_event_get_wheel_delta_z(e, z) \
_dom_mouse_multi_wheel_event_get_wheel_delta_z( \
(dom_mouse_multi_wheel_event *) (e), (int32_t *) (z))
 
dom_exception _dom_mouse_multi_wheel_event_init_ns(
dom_mouse_multi_wheel_event *evt, dom_string *namespace,
dom_string *type, bool bubble, bool cancelable,
struct dom_abstract_view *view, int32_t detail, int32_t screen_x,
int32_t screen_y, int32_t client_x, int32_t client_y,
unsigned short button, dom_event_target *et,
dom_string *modifier_list, int32_t wheel_delta_x,
int32_t wheel_delta_y, int32_t wheel_delta_z);
#define dom_mouse_multi_wheel_event_init_ns(e, n, t, b, c, v, \
d, sx, sy, cx, cy, button, et, ml, x, y, z) \
_dom_mouse_multi_wheel_event_init_ns( \
(dom_mouse_multi_wheel_event *) (e), (dom_string *) (n),\
(dom_string *) (t), (bool) (b), (bool) (c), \
(struct dom_abstract_view *) (v), (int32_t) (d), (int32_t) (sx), \
(int32_t) (sy), (int32_t) (cx), (int32_t) (cy),\
(unsigned short) (button), (dom_event_target *) (et),\
(dom_string *) (ml), (int32_t) (x), (int32_t) (y), (int32_t) (z))
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/mouse_wheel_event.h
0,0 → 1,42
/* * This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_mouse_wheel_event_h_
#define dom_events_mouse_wheel_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/events/event_target.h>
 
struct dom_abstract_view;
 
typedef struct dom_mouse_wheel_event dom_mouse_wheel_event;
 
dom_exception _dom_mouse_wheel_event_get_wheel_delta(
dom_mouse_wheel_event *evt, int32_t *d);
#define dom_mouse_wheel_event_get_wheel_delta(e, d) \
_dom_mouse_wheel_event_get_wheel_delta( \
(dom_mouse_wheel_event *) (e), (int32_t *) (d))
 
dom_exception _dom_mouse_wheel_event_init_ns(
dom_mouse_wheel_event *evt, dom_string *namespace,
dom_string *type, bool bubble, bool cancelable,
struct dom_abstract_view *view, int32_t detail, int32_t screen_x,
int32_t screen_y, int32_t client_x, int32_t client_y,
unsigned short button, dom_event_target *et,
dom_string *modifier_list, int32_t wheel_delta);
#define dom_mouse_wheel_event_init_ns(e, n, t, b, c, v, \
d, sx, sy, cx, cy, button, et, ml, dt) \
_dom_mouse_wheel_event_init_ns((dom_mouse_wheel_event *) (e), \
(dom_string *) (n), (dom_string *) (t), \
(bool) (b), (bool) (c), (struct dom_abstract_view *) (v),\
(int32_t) (d), (int32_t) (sx), (int32_t) (sy), (int32_t) (cx), (int32_t) (cy),\
(unsigned short) (button), (dom_event_target *) (et),\
(dom_string *) (ml), (int32_t) (dt))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/events/mutation_event.h
0,0 → 1,80
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_mutation_event_h_
#define dom_events_mutation_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_node;
 
typedef enum {
DOM_MUTATION_MODIFICATION = 1,
DOM_MUTATION_ADDITION = 2,
DOM_MUTATION_REMOVAL = 3
} dom_mutation_type;
 
typedef struct dom_mutation_event dom_mutation_event;
 
dom_exception _dom_mutation_event_get_related_node(dom_mutation_event *evt,
struct dom_node **node);
#define dom_mutation_event_get_related_node(e, n) \
_dom_mutation_event_get_related_node(\
(dom_mutation_event *) (e), (struct dom_node **) (n))
 
dom_exception _dom_mutation_event_get_prev_value(dom_mutation_event *evt,
dom_string **ret);
#define dom_mutation_event_get_prev_value(e, r) \
_dom_mutation_event_get_prev_value((dom_mutation_event *) (e), \
(dom_string **) (r))
 
dom_exception _dom_mutation_event_get_new_value(dom_mutation_event *evt,
dom_string **ret);
#define dom_mutation_event_get_new_value(e, r) \
_dom_mutation_event_get_new_value((dom_mutation_event *) (e), \
(dom_string **) (r))
 
dom_exception _dom_mutation_event_get_attr_name(dom_mutation_event *evt,
dom_string **ret);
#define dom_mutation_event_get_attr_name(e, r) \
_dom_mutation_event_get_attr_name((dom_mutation_event *) (e), \
(dom_string **) (r))
 
dom_exception _dom_mutation_event_get_attr_change(dom_mutation_event *evt,
dom_mutation_type *type);
#define dom_mutation_event_get_attr_change(e, t) \
_dom_mutation_event_get_attr_change((dom_mutation_event *) (e),\
(dom_mutation_type *) (t))
 
dom_exception _dom_mutation_event_init(dom_mutation_event *evt,
dom_string *type, bool bubble, bool cancelable,
struct dom_node *node, dom_string *prev_value,
dom_string *new_value, dom_string *attr_name,
dom_mutation_type change);
#define dom_mutation_event_init(e, t, b, c, n, p, nv, a, ch) \
_dom_mutation_event_init((dom_mutation_event *) (e), \
(dom_string *) (t), (bool) (b), (bool) (c), \
(struct dom_node *) (n), (dom_string *) (p), \
(dom_string *) (nv), (dom_string *) (a), \
(dom_mutation_type) (ch))
 
dom_exception _dom_mutation_event_init_ns(dom_mutation_event *evt,
dom_string *namespace, dom_string *type,
bool bubble, bool cancelable, struct dom_node *node,
dom_string *prev_value, dom_string *new_value,
dom_string *attr_name, dom_mutation_type change);
#define dom_mutation_event_init_ns(e, n, t, b, c, nd, p, nv, a, ch) \
_dom_mutation_event_init_ns((dom_mutation_event *) (e), \
(dom_string *) (n), (dom_string *) (t),\
(bool) (b), (bool) (c), (struct dom_node *) (nd), \
(dom_string *) (p), (dom_string *) (nv),\
(dom_string *) (a), (dom_mutation_type) (ch))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/events/mutation_name_event.h
0,0 → 1,54
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_mutation_name_event_h_
#define dom_events_mutation_name_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_node;
 
typedef struct dom_mutation_name_event dom_mutation_name_event;
 
dom_exception _dom_mutation_name_event_get_prev_namespace(
dom_mutation_name_event *evt, dom_string **namespace);
#define dom_mutation_name_event_get_prev_namespace(e, n) \
_dom_mutation_name_event_get_prev_namespace(\
(dom_mutation_name_event *) (e), (dom_string **) (n))
 
dom_exception _dom_mutation_name_event_get_prev_node_name(
dom_mutation_name_event *evt, dom_string **name);
#define dom_mutation_name_event_get_prev_node_name(e, n) \
_dom_mutation_name_event_get_prev_node_name(\
(dom_mutation_name_event *) (e), (dom_string **) (n))
 
dom_exception _dom_mutation_name_event_init(dom_mutation_name_event *evt,
dom_string *type, bool bubble, bool cancelable,
struct dom_node *node, dom_string *prev_ns,
dom_string *prev_name);
#define dom_mutation_name_event_init(e, t, b, c, n, p, pn) \
_dom_mutation_name_event_init((dom_mutation_name_event *) (e), \
(dom_string *) (t), (bool) (b), (bool) (c), \
(struct dom_node *) (n), (dom_string *) (p), \
(dom_string *) (pn))
 
dom_exception _dom_mutation_name_event_init_ns(dom_mutation_name_event *evt,
dom_string *namespace, dom_string *type,
bool bubble, bool cancelable, struct dom_node *node,
dom_string *prev_ns, dom_string *prev_name);
#define dom_mutation_name_event_init_ns(e, n, t, b, c, nv, p, pn) \
_dom_mutation_name_event_init_ns(\
(dom_mutation_name_event *) (e), (dom_string *) (n),\
(dom_string *) (t), (bool) (b), (bool) (c),\
(struct dom_node *) (nv), (dom_string *) (p), \
(dom_string *) (pn))
 
#endif
 
 
/contrib/network/netsurf/libdom/include/dom/events/text_event.h
0,0 → 1,41
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_text_event_h_
#define dom_events_text_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_abstract_view;
 
typedef struct dom_text_event dom_text_event;
 
dom_exception _dom_text_event_get_data(dom_text_event *evt,
dom_string **data);
#define dom_text_event_get_data(e, d) _dom_text_event_get_data(\
(dom_text_event *) (e), (dom_string **) (d))
 
dom_exception _dom_text_event_init(dom_text_event *evt,
dom_string *type, bool bubble, bool cancelable,
struct dom_abstract_view *view, dom_string *data);
#define dom_text_event_init(e, t, b, c, v, d) _dom_text_event_init( \
(dom_text_event *) (e), (dom_string *) (t), (bool) (b), \
(bool) (c), (struct dom_abstract_view *) (v),\
(dom_string *) (d))
 
dom_exception _dom_text_event_init_ns(dom_text_event *evt,
dom_string *namespace_name, dom_string *type,
bool bubble, bool cancelable, struct dom_abstract_view *view,
dom_string *data);
#define dom_text_event_init_ns(e, n, t, b, c, v, d) _dom_text_event_init_ns( \
(dom_text_event *) (e), (dom_string *) (n), \
(dom_string *) (t), (bool) (b), (bool) (c), \
(struct dom_abstract_view *) (v), (dom_string *) (d))
 
#endif
/contrib/network/netsurf/libdom/include/dom/events/ui_event.h
0,0 → 1,45
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_events_ui_event_h_
#define dom_events_ui_event_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_abstract_view;
 
typedef struct dom_ui_event dom_ui_event;
 
dom_exception _dom_ui_event_get_view(dom_ui_event *evt,
struct dom_abstract_view **view);
#define dom_ui_event_get_view(e, v) _dom_ui_event_get_view( \
(dom_ui_event *) (e), (struct dom_abstract_view **) (v))
 
dom_exception _dom_ui_event_get_detail(dom_ui_event *evt,
int32_t *detail);
#define dom_ui_event_get_detail(e, d) _dom_ui_event_get_detail(\
(dom_ui_event *) (e), (int32_t *) (d))
 
dom_exception _dom_ui_event_init(dom_ui_event *evt, dom_string *type,
bool bubble, bool cancelable, struct dom_abstract_view *view,
int32_t detail);
#define dom_ui_event_init(e, t, b, c, v, d) _dom_ui_event_init( \
(dom_ui_event *) (e), (dom_string *) (t), (bool) (b), \
(bool) (c), (struct dom_abstract_view *) (v), (int32_t) (d))
 
dom_exception _dom_ui_event_init_ns(dom_ui_event *evt,
dom_string *namespace, dom_string *type,
bool bubble, bool cancelable, struct dom_abstract_view *view,
int32_t detail);
#define dom_ui_event_init_ns(e, n, t, b, c, v, d) _dom_ui_event_init_ns( \
(dom_ui_event *) (e), (dom_string *) (n), \
(dom_string *) (t), (bool) (b), (bool) (c), \
(struct dom_abstract_view *) (v), (int32_t) (d))
 
#endif
/contrib/network/netsurf/libdom/include/dom/functypes.h
0,0 → 1,35
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_functypes_h_
#define dom_functypes_h_
 
#include <stddef.h>
#include <inttypes.h>
 
typedef unsigned int uint32_t;
 
/**
* Severity levels for dom_msg function, based on syslog(3)
*/
enum {
DOM_MSG_DEBUG,
DOM_MSG_INFO,
DOM_MSG_NOTICE,
DOM_MSG_WARNING,
DOM_MSG_ERROR,
DOM_MSG_CRITICAL,
DOM_MSG_ALERT,
DOM_MSG_EMERGENCY
};
 
/**
* Type of DOM message function
*/
typedef void (*dom_msg)(uint32_t severity, void *ctx, const char *msg, ...);
 
#endif
/contrib/network/netsurf/libdom/include/dom/html/html_anchor_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_applet_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_area_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_base_element.h
0,0 → 1,14
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_base_element_h_
#define dom_html_base_element_h_
 
typedef struct dom_html_base_element dom_html_base_element;
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_basefont_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_body_element.h
0,0 → 1,53
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Daniel Silverstone <dsilvers@netsurf-browser.org>
*/
 
#ifndef dom_html_body_element_h_
#define dom_html_body_element_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
typedef struct dom_html_body_element dom_html_body_element;
 
dom_exception dom_html_body_element_get_a_link(dom_html_body_element *ele,
dom_string **a_link);
 
dom_exception dom_html_body_element_set_a_link(dom_html_body_element *ele,
dom_string *a_link);
 
dom_exception dom_html_body_element_get_v_link(dom_html_body_element *ele,
dom_string **v_link);
 
dom_exception dom_html_body_element_set_v_link(dom_html_body_element *ele,
dom_string *v_link);
 
dom_exception dom_html_body_element_get_background(dom_html_body_element *ele,
dom_string **background);
 
dom_exception dom_html_body_element_set_background(dom_html_body_element *ele,
dom_string *background);
 
dom_exception dom_html_body_element_get_bg_color(dom_html_body_element *ele,
dom_string **bg_color);
 
dom_exception dom_html_body_element_set_bg_color(dom_html_body_element *ele,
dom_string *bg_color);
 
dom_exception dom_html_body_element_get_link(dom_html_body_element *ele,
dom_string **link);
 
dom_exception dom_html_body_element_set_link(dom_html_body_element *ele,
dom_string *link);
 
dom_exception dom_html_body_element_get_text(dom_html_body_element *ele,
dom_string **text);
 
dom_exception dom_html_body_element_set_text(dom_html_body_element *ele,
dom_string *text);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_br_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_button_element.h
0,0 → 1,54
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Daniel Silverstone <dsilvers@netsurf-browser.org>
*/
 
#ifndef dom_html_button_element_h_
#define dom_html_button_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/html/html_form_element.h>
 
typedef struct dom_html_button_element dom_html_button_element;
 
dom_exception dom_html_button_element_get_form(
dom_html_button_element *button, dom_html_form_element **form);
 
dom_exception dom_html_button_element_get_access_key(
dom_html_button_element *button, dom_string **access_key);
 
dom_exception dom_html_button_element_set_access_key(
dom_html_button_element *button, dom_string *access_key);
 
dom_exception dom_html_button_element_get_disabled(
dom_html_button_element *button, bool *disabled);
 
dom_exception dom_html_button_element_set_disabled(
dom_html_button_element *button, bool disabled);
 
dom_exception dom_html_button_element_get_name(
dom_html_button_element *button, dom_string **name);
 
dom_exception dom_html_button_element_set_name(
dom_html_button_element *button, dom_string *name);
 
dom_exception dom_html_button_element_get_tab_index(
dom_html_button_element *button, int32_t *tab_index);
 
dom_exception dom_html_button_element_set_tab_index(
dom_html_button_element *button, uint32_t tab_index);
 
dom_exception dom_html_button_element_get_type(
dom_html_button_element *button, dom_string **type);
 
dom_exception dom_html_button_element_get_value(
dom_html_button_element *button, dom_string **value);
 
dom_exception dom_html_button_element_set_value(
dom_html_button_element *button, dom_string *value);
 
#endif
/contrib/network/netsurf/libdom/include/dom/html/html_collection.h
0,0 → 1,29
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_html_collection_h_
#define dom_html_collection_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_node;
 
typedef struct dom_html_collection dom_html_collection;
 
dom_exception dom_html_collection_get_length(dom_html_collection *col,
uint32_t *len);
dom_exception dom_html_collection_item(dom_html_collection *col,
uint32_t index, struct dom_node **node);
dom_exception dom_html_collection_named_item(dom_html_collection *col,
dom_string *name, struct dom_node **node);
 
void dom_html_collection_ref(dom_html_collection *col);
void dom_html_collection_unref(dom_html_collection *col);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_directory_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_div_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_dlist_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_document.h
0,0 → 1,245
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_html_document_h_
#define dom_html_document_h_
 
#include <dom/core/document.h>
#include <dom/core/exceptions.h>
#include <dom/functypes.h>
#include <dom/events/document_event.h>
 
struct dom_element;
struct dom_html_collection;
struct dom_html_element;
struct dom_nodelist;
 
typedef struct dom_html_document dom_html_document;
 
typedef struct dom_html_document_vtable {
struct dom_document_vtable base;
 
dom_exception (*get_title)(dom_html_document *doc,
dom_string **title);
dom_exception (*set_title)(dom_html_document *doc,
dom_string *title);
dom_exception (*get_referrer)(dom_html_document *doc,
dom_string **referrer);
dom_exception (*get_domain)(dom_html_document *doc,
dom_string **domain);
dom_exception (*get_url)(dom_html_document *doc,
dom_string **url);
dom_exception (*get_body)(dom_html_document *doc,
struct dom_html_element **body);
dom_exception (*set_body)(dom_html_document *doc,
struct dom_html_element *body);
dom_exception (*get_images)(dom_html_document *doc,
struct dom_html_collection **col);
dom_exception (*get_applets)(dom_html_document *doc,
struct dom_html_collection **col);
dom_exception (*get_links)(dom_html_document *doc,
struct dom_html_collection **col);
dom_exception (*get_forms)(dom_html_document *doc,
struct dom_html_collection **col);
dom_exception (*get_anchors)(dom_html_document *doc,
struct dom_html_collection **col);
dom_exception (*get_cookie)(dom_html_document *doc,
dom_string **cookie);
dom_exception (*set_cookie)(dom_html_document *doc,
dom_string *cookie);
 
dom_exception (*open)(dom_html_document *doc);
dom_exception (*close)(dom_html_document *doc);
dom_exception (*write)(dom_html_document *doc,
dom_string *text);
dom_exception (*writeln)(dom_html_document *doc,
dom_string *text);
dom_exception (*get_elements_by_name)(dom_html_document *doc,
dom_string *name, struct dom_nodelist **list);
} dom_html_document_vtable;
 
static inline dom_exception dom_html_document_get_title(
dom_html_document *doc, dom_string **title)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_title(doc, title);
}
#define dom_html_document_get_title(d, t) \
dom_html_document_get_title((dom_html_document *) (d), (t))
 
static inline dom_exception dom_html_document_set_title(dom_html_document *doc,
dom_string *title)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
set_title(doc, title);
}
#define dom_html_document_set_title(d, t) \
dom_html_document_set_title((dom_html_document *) (d), (t))
 
static inline dom_exception dom_html_document_get_referrer(dom_html_document *doc,
dom_string **referrer)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_referrer(doc, referrer);
}
#define dom_html_document_get_referrer(d, r) \
dom_html_document_get_referrer((dom_html_document *) (d), (r))
 
static inline dom_exception dom_html_document_get_domain(dom_html_document *doc,
dom_string **domain)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_domain(doc, domain);
}
#define dom_html_document_get_domain(d, t) \
dom_html_document_get_domain((dom_html_document *) (d), (t))
 
static inline dom_exception dom_html_document_get_url(dom_html_document *doc,
dom_string **url)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_url(doc, url);
}
#define dom_html_document_get_url(d, u) \
dom_html_document_get_url((dom_html_document *) (d), (u))
 
static inline dom_exception dom_html_document_get_body(dom_html_document *doc,
struct dom_html_element **body)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_body(doc, body);
}
#define dom_html_document_get_body(d, b) \
dom_html_document_get_title((dom_html_document *) (d), \
(struct dom_html_element **) (b))
 
static inline dom_exception dom_html_document_set_body(dom_html_document *doc,
struct dom_html_element *body)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
set_body(doc, body);
}
#define dom_html_document_set_body(d, b) \
dom_html_document_set_body((dom_html_document *) (d), \
(struct dom_html_element **) (b))
 
static inline dom_exception dom_html_document_get_images(dom_html_document *doc,
struct dom_html_collection **col)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_images(doc, col);
}
#define dom_html_document_get_images(d, c) \
dom_html_document_get_images((dom_html_document *) (d), \
(struct dom_html_collection **) (c))
 
static inline dom_exception dom_html_document_get_applets(dom_html_document *doc,
struct dom_html_collection **col)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_applets(doc, col);
}
#define dom_html_document_get_applets(d, c) \
dom_html_document_get_applets((dom_html_document *) (d), \
(struct dom_html_collection **) (c))
 
static inline dom_exception dom_html_document_get_links(dom_html_document *doc,
struct dom_html_collection **col)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_links(doc, col);
}
#define dom_html_document_get_links(d, c) \
dom_html_document_get_links((dom_html_document *) (d), \
(struct dom_html_collection **) (c))
 
static inline dom_exception dom_html_document_get_forms(dom_html_document *doc,
struct dom_html_collection **col)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_forms(doc, col);
}
#define dom_html_document_get_forms(d, c) \
dom_html_document_get_forms((dom_html_document *) (d), \
(struct dom_html_collection **) (c))
 
static inline dom_exception dom_html_document_get_anchors(dom_html_document *doc,
struct dom_html_collection **col)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_anchors(doc, col);
}
#define dom_html_document_get_anchors(d, c) \
dom_html_document_get_title((dom_html_document *) (d), \
(struct dom_html_collection **) (c))
 
static inline dom_exception dom_html_document_get_cookie(dom_html_document *doc,
dom_string **cookie)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_cookie(doc, cookie);
}
#define dom_html_document_get_cookie(d, c) \
dom_html_document_get_title((dom_html_document *) (d), (c))
 
static inline dom_exception dom_html_document_set_cookie(dom_html_document *doc,
dom_string *cookie)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
set_cookie(doc, cookie);
}
#define dom_html_document_set_cookie(d, c) \
dom_html_document_set_cookie((dom_html_document *) (d), (c))
 
 
static inline dom_exception dom_html_document_open(dom_html_document *doc)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
open(doc);
}
#define dom_html_document_open(d) \
dom_html_document_open((dom_html_document *) (d))
 
static inline dom_exception dom_html_document_close(dom_html_document *doc)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
close(doc);
}
#define dom_html_document_close(d) \
dom_html_document_close((dom_html_document *) (d))
 
 
static inline dom_exception dom_html_document_write(dom_html_document *doc,
dom_string *text)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
write(doc, text);
}
#define dom_html_document_write(d, t) \
dom_html_document_write((dom_html_document *) (d), (t))
 
static inline dom_exception dom_html_document_writeln(dom_html_document *doc,
dom_string *text)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
writeln(doc, text);
}
#define dom_html_document_writeln(d, t) \
dom_html_document_writeln((dom_html_document *) (d), (t))
 
static inline dom_exception dom_html_document_get_elements_by_name(dom_html_document *doc,
dom_string *name, struct dom_nodelist **list)
{
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_elements_by_name(doc, name, list);
}
#define dom_html_document_get_elements_by_name(d, n, l) \
dom_html_document_get_element_by_name((dom_html_document *) (d), \
(n), (struct dom_nodelist **) (l))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_element.h
0,0 → 1,131
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_html_element_h_
#define dom_html_element_h_
 
#include <dom/core/element.h>
 
typedef struct dom_html_element dom_html_element;
 
typedef struct dom_html_element_vtable {
struct dom_element_vtable base;
dom_exception (*dom_html_element_get_id)(struct dom_html_element *element,
dom_string **id);
dom_exception (*dom_html_element_set_id)(struct dom_html_element *element,
dom_string *id);
dom_exception (*dom_html_element_get_title)(struct dom_html_element *element,
dom_string **title);
dom_exception (*dom_html_element_set_title)(struct dom_html_element *element,
dom_string *title);
dom_exception (*dom_html_element_get_lang)(struct dom_html_element *element,
dom_string **lang);
dom_exception (*dom_html_element_set_lang)(struct dom_html_element *element,
dom_string *lang);
dom_exception (*dom_html_element_get_dir)(struct dom_html_element *element,
dom_string **dir);
dom_exception (*dom_html_element_set_dir)(struct dom_html_element *element,
dom_string *dir);
dom_exception (*dom_html_element_get_class_name)(struct dom_html_element *element,
dom_string **class_name);
dom_exception (*dom_html_element_set_class_name)(struct dom_html_element *element,
dom_string *class_name);
} dom_html_element_vtable;
 
static inline dom_exception dom_html_element_get_id(struct dom_html_element *element,
dom_string **id)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_get_id(element, id);
}
#define dom_html_element_get_id(e, id) dom_html_element_get_id( \
(dom_html_element *) (e), (id))
 
static inline dom_exception dom_html_element_set_id(struct dom_html_element *element,
dom_string *id)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_set_id(element, id);
}
#define dom_html_element_set_id(e, id) dom_html_element_set_id( \
(dom_html_element *) (e), (id))
 
static inline dom_exception dom_html_element_get_title(struct dom_html_element *element,
dom_string **title)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_get_title(element, title);
}
#define dom_html_element_get_title(e, title) dom_html_element_get_title( \
(dom_html_element *) (e), (title))
 
static inline dom_exception dom_html_element_set_title(struct dom_html_element *element,
dom_string *title)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_set_title(element, title);
}
#define dom_html_element_set_title(e, title) dom_html_element_set_title( \
(dom_html_element *) (e), (title))
 
static inline dom_exception dom_html_element_get_lang(struct dom_html_element *element,
dom_string **lang)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_get_lang(element, lang);
}
#define dom_html_element_get_lang(e, lang) dom_html_element_get_lang( \
(dom_html_element *) (e), (lang))
 
static inline dom_exception dom_html_element_set_lang(struct dom_html_element *element,
dom_string *lang)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_set_lang(element, lang);
}
#define dom_html_element_set_lang(e, lang) dom_html_element_set_lang( \
(dom_html_element *) (e), (lang))
 
static inline dom_exception dom_html_element_get_dir(struct dom_html_element *element,
dom_string **dir)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_get_dir(element, dir);
}
#define dom_html_element_get_dir(e, dir) dom_html_element_get_dir( \
(dom_html_element *) (e), (dir))
 
static inline dom_exception dom_html_element_set_dir(struct dom_html_element *element,
dom_string *dir)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_set_dir(element, dir);
}
#define dom_html_element_set_dir(e, dir) dom_html_element_set_dir( \
(dom_html_element *) (e), (dir))
 
static inline dom_exception dom_html_element_get_class_name(struct dom_html_element *element,
dom_string **class_name)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_get_class_name(element, class_name);
}
#define dom_html_element_get_class_name(e, class_name) dom_html_element_get_class_name( \
(dom_html_element *) (e), (class_name))
 
static inline dom_exception dom_html_element_set_class_name(struct dom_html_element *element,
dom_string *class_name)
{
return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
dom_html_element_set_class_name(element, class_name);
}
#define dom_html_element_set_class_name(e, class_name) dom_html_element_set_class_name( \
(dom_html_element *) (e), (class_name))
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_fieldset_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_font_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_form_element.h
0,0 → 1,57
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_form_element_h_
#define dom_html_form_element_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_html_collection;
 
typedef struct dom_html_form_element dom_html_form_element;
 
dom_exception dom_html_form_element_get_elements(dom_html_form_element *ele,
struct dom_html_collection **col);
dom_exception dom_html_form_element_get_length(dom_html_form_element *ele,
uint32_t *len);
 
dom_exception dom_html_form_element_get_accept_charset(
dom_html_form_element *ele, dom_string **accept_charset);
 
dom_exception dom_html_form_element_set_accept_charset(
dom_html_form_element *ele, dom_string *accept_charset);
 
dom_exception dom_html_form_element_get_action(
dom_html_form_element *ele, dom_string **action);
 
dom_exception dom_html_form_element_set_action(
dom_html_form_element *ele, dom_string *action);
 
dom_exception dom_html_form_element_get_enctype(
dom_html_form_element *ele, dom_string **enctype);
 
dom_exception dom_html_form_element_set_enctype(
dom_html_form_element *ele, dom_string *enctype);
 
dom_exception dom_html_form_element_get_method(
dom_html_form_element *ele, dom_string **method);
 
dom_exception dom_html_form_element_set_method(
dom_html_form_element *ele, dom_string *method);
 
dom_exception dom_html_form_element_get_target(
dom_html_form_element *ele, dom_string **target);
 
dom_exception dom_html_form_element_set_target(
dom_html_form_element *ele, dom_string *target);
 
dom_exception dom_html_form_element_submit(dom_html_form_element *ele);
dom_exception dom_html_form_element_reset(dom_html_form_element *ele);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_frame_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_frameset_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_head_element.h
0,0 → 1,21
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_head_element_h_
#define dom_html_head_element_h_
 
#include <dom/html/html_element.h>
 
typedef struct dom_html_head_element dom_html_head_element;
 
dom_exception dom_html_head_element_get_profile(
struct dom_html_head_element *element, dom_string **profile);
dom_exception dom_html_head_element_set_profile(
struct dom_html_head_element *element, dom_string *profile);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_heading_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_hr_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_html_element.h
0,0 → 1,22
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_html_element_h_
#define dom_html_html_element_h_
 
#include <dom/html/html_element.h>
 
typedef struct dom_html_html_element dom_html_html_element;
 
dom_exception dom_html_html_element_get_version(
struct dom_html_html_element *element, dom_string **version);
dom_exception dom_html_html_element_set_version(
struct dom_html_html_element *element, dom_string *version);
 
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_iframe_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_image_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_input_element.h
0,0 → 1,125
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Daniel Silverstone <dsilvers@netsurf-browser.org>
*/
 
#ifndef dom_html_input_element_h_
#define dom_html_input_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/html/html_form_element.h>
 
typedef struct dom_html_input_element dom_html_input_element;
 
dom_exception dom_html_input_element_get_default_value(
dom_html_input_element *input, dom_string **default_value);
 
dom_exception dom_html_input_element_set_default_value(
dom_html_input_element *input, dom_string *default_value);
 
dom_exception dom_html_input_element_get_default_checked(
dom_html_input_element *input, bool *default_checked);
 
dom_exception dom_html_input_element_set_default_checked(
dom_html_input_element *input, bool default_checked);
 
dom_exception dom_html_input_element_get_form(
dom_html_input_element *input, dom_html_form_element **form);
 
dom_exception dom_html_input_element_get_accept(
dom_html_input_element *input, dom_string **accept);
 
dom_exception dom_html_input_element_set_accept(
dom_html_input_element *input, dom_string *accept);
 
dom_exception dom_html_input_element_get_access_key(
dom_html_input_element *input, dom_string **access_key);
 
dom_exception dom_html_input_element_set_access_key(
dom_html_input_element *input, dom_string *access_key);
 
dom_exception dom_html_input_element_get_align(
dom_html_input_element *input, dom_string **align);
 
dom_exception dom_html_input_element_set_align(
dom_html_input_element *input, dom_string *align);
 
dom_exception dom_html_input_element_get_alt(
dom_html_input_element *input, dom_string **alt);
 
dom_exception dom_html_input_element_set_alt(
dom_html_input_element *input, dom_string *alt);
 
dom_exception dom_html_input_element_get_checked(
dom_html_input_element *input, bool *checked);
 
dom_exception dom_html_input_element_set_checked(
dom_html_input_element *input, bool checked);
 
dom_exception dom_html_input_element_get_disabled(
dom_html_input_element *input, bool *disabled);
 
dom_exception dom_html_input_element_set_disabled(
dom_html_input_element *input, bool disabled);
 
dom_exception dom_html_input_element_get_max_length(
dom_html_input_element *input, int32_t *max_length);
 
dom_exception dom_html_input_element_set_max_length(
dom_html_input_element *input, uint32_t max_length);
 
dom_exception dom_html_input_element_get_name(
dom_html_input_element *input, dom_string **name);
 
dom_exception dom_html_input_element_set_name(
dom_html_input_element *input, dom_string *name);
 
dom_exception dom_html_input_element_get_read_only(
dom_html_input_element *input, bool *read_only);
 
dom_exception dom_html_input_element_set_read_only(
dom_html_input_element *input, bool read_only);
 
dom_exception dom_html_input_element_get_size(
dom_html_input_element *input, dom_string **size);
 
dom_exception dom_html_input_element_set_size(
dom_html_input_element *input, dom_string *size);
 
dom_exception dom_html_input_element_get_src(
dom_html_input_element *input, dom_string **src);
 
dom_exception dom_html_input_element_set_src(
dom_html_input_element *input, dom_string *src);
 
dom_exception dom_html_input_element_get_tab_index(
dom_html_input_element *input, int32_t *tab_index);
 
dom_exception dom_html_input_element_set_tab_index(
dom_html_input_element *input, uint32_t tab_index);
 
dom_exception dom_html_input_element_get_type(
dom_html_input_element *input, dom_string **type);
 
dom_exception dom_html_input_element_get_use_map(
dom_html_input_element *input, dom_string **use_map);
 
dom_exception dom_html_input_element_set_use_map(
dom_html_input_element *input, dom_string *use_map);
 
dom_exception dom_html_input_element_get_value(
dom_html_input_element *input, dom_string **value);
 
dom_exception dom_html_input_element_set_value(
dom_html_input_element *input, dom_string *value);
 
dom_exception dom_html_input_element_blur(dom_html_input_element *ele);
dom_exception dom_html_input_element_focus(dom_html_input_element *ele);
dom_exception dom_html_input_element_select(dom_html_input_element *ele);
dom_exception dom_html_input_element_click(dom_html_input_element *ele);
 
#endif
/contrib/network/netsurf/libdom/include/dom/html/html_isindex_element.h
0,0 → 1,26
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_isindex_element_h_
#define dom_html_isindex_element_h_
 
#include <dom/core/exceptions.h>
 
struct dom_html_form_element;
 
/**
* Note: the HTML 4.01 spec said: this element is deprecated, use
* <INPUT> element instead.
*/
 
typedef struct dom_html_isindex_element dom_html_isindex_element;
 
dom_exception dom_html_isindex_element_get_form(dom_html_isindex_element *ele,
struct dom_html_form_element **form);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_label_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_legend_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_li_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_link_element.h
0,0 → 1,72
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_link_element_h_
#define dom_html_link_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
typedef struct dom_html_link_element dom_html_link_element;
 
dom_exception dom_html_link_element_get_disabled(dom_html_link_element *ele,
bool *disabled);
 
dom_exception dom_html_link_element_set_disabled(dom_html_link_element *ele,
bool disabled);
 
dom_exception dom_html_link_element_get_charset(dom_html_link_element *ele,
dom_string **charset);
 
dom_exception dom_html_link_element_set_charset(dom_html_link_element *ele,
dom_string *charset);
 
dom_exception dom_html_link_element_get_href(dom_html_link_element *ele,
dom_string **href);
 
dom_exception dom_html_link_element_set_href(dom_html_link_element *ele,
dom_string *href);
 
dom_exception dom_html_link_element_get_hreflang(dom_html_link_element *ele,
dom_string **hreflang);
 
dom_exception dom_html_link_element_set_hreflang(dom_html_link_element *ele,
dom_string *hreflang);
 
dom_exception dom_html_link_element_get_media(dom_html_link_element *ele,
dom_string **media);
 
dom_exception dom_html_link_element_set_media(dom_html_link_element *ele,
dom_string *media);
 
dom_exception dom_html_link_element_get_rel(dom_html_link_element *ele,
dom_string **rel);
 
dom_exception dom_html_link_element_set_rel(dom_html_link_element *ele,
dom_string *rel);
 
dom_exception dom_html_link_element_get_rev(dom_html_link_element *ele,
dom_string **rev);
 
dom_exception dom_html_link_element_set_rev(dom_html_link_element *ele,
dom_string *rev);
 
dom_exception dom_html_link_element_get_target(dom_html_link_element *ele,
dom_string **target);
 
dom_exception dom_html_link_element_set_target(dom_html_link_element *ele,
dom_string *target);
 
dom_exception dom_html_link_element_get_type(dom_html_link_element *ele,
dom_string **type);
 
dom_exception dom_html_link_element_set_type(dom_html_link_element *ele,
dom_string *type);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_map_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_menu_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_meta_element.h
0,0 → 1,40
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_meta_element_h_
#define dom_html_meta_element_h_
 
#include <dom/core/string.h>
 
typedef struct dom_html_meta_element dom_html_meta_element;
 
dom_exception dom_html_meta_element_get_content(dom_html_meta_element *ele,
dom_string **content);
 
dom_exception dom_html_meta_element_set_content(dom_html_meta_element *ele,
dom_string *content);
 
dom_exception dom_html_meta_element_get_http_equiv(dom_html_meta_element *ele,
dom_string **http_equiv);
 
dom_exception dom_html_meta_element_set_http_equiv(dom_html_meta_element *ele,
dom_string *http_equiv);
 
dom_exception dom_html_meta_element_get_name(dom_html_meta_element *ele,
dom_string **name);
 
dom_exception dom_html_meta_element_set_name(dom_html_meta_element *ele,
dom_string *name);
 
dom_exception dom_html_meta_element_get_scheme(dom_html_meta_element *ele,
dom_string **scheme);
 
dom_exception dom_html_meta_element_set_scheme(dom_html_meta_element *ele,
dom_string *scheme);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_mod_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_object_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_olist_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_opt_group_element.h
0,0 → 1,33
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Daniel Silverstone <dsilvers@netsurf-browser.org>
*/
 
#ifndef dom_html_opt_group_element_h_
#define dom_html_opt_group_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/html/html_form_element.h>
 
typedef struct dom_html_opt_group_element dom_html_opt_group_element;
 
dom_exception dom_html_opt_group_element_get_form(
dom_html_opt_group_element *opt_group, dom_html_form_element **form);
 
dom_exception dom_html_opt_group_element_get_disabled(
dom_html_opt_group_element *opt_group, bool *disabled);
 
dom_exception dom_html_opt_group_element_set_disabled(
dom_html_opt_group_element *opt_group, bool disabled);
 
dom_exception dom_html_opt_group_element_get_label(
dom_html_opt_group_element *opt_group, dom_string **label);
 
dom_exception dom_html_opt_group_element_set_label(
dom_html_opt_group_element *opt_group, dom_string *label);
 
#endif
/contrib/network/netsurf/libdom/include/dom/html/html_option_element.h
0,0 → 1,57
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 John-Mark Bell <jmb@netsurf-browser.org>
*/
 
#ifndef dom_html_option_element_h_
#define dom_html_option_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/html/html_form_element.h>
 
typedef struct dom_html_option_element dom_html_option_element;
 
dom_exception dom_html_option_element_get_form(
dom_html_option_element *option, dom_html_form_element **form);
 
dom_exception dom_html_option_element_get_default_selected(
dom_html_option_element *option, bool *default_selected);
 
dom_exception dom_html_option_element_set_default_selected(
dom_html_option_element *option, bool default_selected);
 
dom_exception dom_html_option_element_get_text(
dom_html_option_element *option, dom_string **text);
 
dom_exception dom_html_option_element_get_index(
dom_html_option_element *option, unsigned long *index);
 
dom_exception dom_html_option_element_get_disabled(
dom_html_option_element *option, bool *disabled);
 
dom_exception dom_html_option_element_set_disabled(
dom_html_option_element *option, bool disabled);
 
dom_exception dom_html_option_element_get_label(
dom_html_option_element *option, dom_string **label);
 
dom_exception dom_html_option_element_set_label(
dom_html_option_element *option, dom_string *label);
 
dom_exception dom_html_option_element_get_selected(
dom_html_option_element *option, bool *selected);
 
dom_exception dom_html_option_element_set_selected(
dom_html_option_element *option, bool selected);
 
dom_exception dom_html_option_element_get_value(
dom_html_option_element *option, dom_string **value);
 
dom_exception dom_html_option_element_set_value(
dom_html_option_element *option, dom_string *value);
 
#endif
/contrib/network/netsurf/libdom/include/dom/html/html_options_collection.h
0,0 → 1,33
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_html_options_collection_h_
#define dom_html_options_collection_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
struct dom_node;
 
typedef struct dom_html_options_collection dom_html_options_collection;
 
dom_exception dom_html_options_collection_get_length(
dom_html_options_collection *col, uint32_t *len);
dom_exception dom_html_options_collection_set_length(
dom_html_options_collection *col, uint32_t len);
dom_exception dom_html_options_collection_item(
dom_html_options_collection *col, uint32_t index,
struct dom_node **node);
dom_exception dom_html_options_collection_named_item(
dom_html_options_collection *col, dom_string *name,
struct dom_node **node);
 
void dom_html_options_collection_ref(dom_html_options_collection *col);
void dom_html_options_collection_unref(dom_html_options_collection *col);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_paragraph_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_param_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_pre_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_quote_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_script_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_select_element.h
0,0 → 1,88
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
#ifndef dom_html_select_element_h_
#define dom_html_select_element_h_
 
#include <stdbool.h>
 
#include <dom/core/exceptions.h>
 
#include <dom/html/html_form_element.h>
 
typedef struct dom_html_select_element dom_html_select_element;
 
struct dom_html_options_collection;
struct dom_html_element;
 
dom_exception dom_html_select_element_get_type(
dom_html_select_element *ele, dom_string **type);
 
dom_exception dom_html_select_element_get_selected_index(
dom_html_select_element *ele, int32_t *index);
dom_exception dom_html_select_element_set_selected_index(
dom_html_select_element *ele, int32_t index);
 
dom_exception dom_html_select_element_get_value(
dom_html_select_element *ele, dom_string **value);
dom_exception dom_html_select_element_set_value(
dom_html_select_element *ele, dom_string *value);
 
dom_exception dom_html_select_element_get_length(
dom_html_select_element *ele, uint32_t *len);
dom_exception dom_html_select_element_set_length(
dom_html_select_element *ele, uint32_t len);
 
dom_exception dom_html_select_element_get_form(
dom_html_select_element *ele, dom_html_form_element **form);
 
dom_exception dom__html_select_element_get_options(
dom_html_select_element *ele,
struct dom_html_options_collection **col);
#define dom_html_select_element_get_options(e, c) \
dom__html_select_element_get_options((dom_html_select_element *) (e), \
(struct dom_html_options_collection **) (c))
 
dom_exception dom_html_select_element_get_disabled(
dom_html_select_element *ele, bool *disabled);
dom_exception dom_html_select_element_set_disabled(
dom_html_select_element *ele, bool disabled);
 
dom_exception dom_html_select_element_get_multiple(
dom_html_select_element *ele, bool *multiple);
dom_exception dom_html_select_element_set_multiple(
dom_html_select_element *ele, bool multiple);
 
dom_exception dom_html_select_element_get_name(
dom_html_select_element *ele, dom_string **name);
dom_exception dom_html_select_element_set_name(
dom_html_select_element *ele, dom_string *name);
 
dom_exception dom_html_select_element_get_size(
dom_html_select_element *ele, int32_t *size);
dom_exception dom_html_select_element_set_size(
dom_html_select_element *ele, int32_t size);
 
dom_exception dom_html_select_element_get_tab_index(
dom_html_select_element *ele, int32_t *tab_index);
dom_exception dom_html_select_element_set_tab_index(
dom_html_select_element *ele, int32_t tab_index);
 
/* Functions */
dom_exception dom__html_select_element_add(dom_html_select_element *select,
struct dom_html_element *ele, struct dom_html_element *before);
#define dom_html_select_element_add(s, e, b) \
dom__html_select_element_add((dom_html_select_element *) (s), \
(struct dom_html_element *) (e), \
(struct dom_html_element *) (b))
dom_exception dom_html_select_element_remove(dom_html_select_element *ele,
int32_t index);
dom_exception dom_html_select_element_blur(struct dom_html_select_element *ele);
dom_exception dom_html_select_element_focus(struct dom_html_select_element *ele);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_style_element.h
0,0 → 1,23
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_style_element_h_
#define dom_html_style_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
 
typedef struct dom_html_style_element dom_html_style_element;
 
dom_exception dom_html_style_element_get_disabled(dom_html_style_element *ele,
bool *disabled);
 
dom_exception dom_html_style_element_set_disabled(dom_html_style_element *ele,
bool disabled);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_table_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_tablecaption_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_tablecell_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_tablecol_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_tablerow_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_tablesection_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
 
/contrib/network/netsurf/libdom/include/dom/html/html_text_area_element.h
0,0 → 1,82
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Daniel Silverstone <dsilvers@netsurf-browser.org>
*/
 
#ifndef dom_html_text_area_element_h_
#define dom_html_text_area_element_h_
 
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
#include <dom/html/html_form_element.h>
 
typedef struct dom_html_text_area_element dom_html_text_area_element;
 
dom_exception dom_html_text_area_element_get_default_value(
dom_html_text_area_element *text_area, dom_string **default_value);
 
dom_exception dom_html_text_area_element_set_default_value(
dom_html_text_area_element *text_area, dom_string *default_value);
 
dom_exception dom_html_text_area_element_get_form(
dom_html_text_area_element *text_area, dom_html_form_element **form);
 
dom_exception dom_html_text_area_element_get_access_key(
dom_html_text_area_element *text_area, dom_string **access_key);
 
dom_exception dom_html_text_area_element_set_access_key(
dom_html_text_area_element *text_area, dom_string *access_key);
 
dom_exception dom_html_text_area_element_get_disabled(
dom_html_text_area_element *text_area, bool *disabled);
 
dom_exception dom_html_text_area_element_set_disabled(
dom_html_text_area_element *text_area, bool disabled);
 
dom_exception dom_html_text_area_element_get_cols(
dom_html_text_area_element *text_area, int32_t *cols);
 
dom_exception dom_html_text_area_element_set_cols(
dom_html_text_area_element *text_area, uint32_t cols);
 
dom_exception dom_html_text_area_element_get_rows(
dom_html_text_area_element *text_area, int32_t *rows);
 
dom_exception dom_html_text_area_element_set_rows(
dom_html_text_area_element *text_area, uint32_t rows);
 
dom_exception dom_html_text_area_element_get_name(
dom_html_text_area_element *text_area, dom_string **name);
 
dom_exception dom_html_text_area_element_set_name(
dom_html_text_area_element *text_area, dom_string *name);
 
dom_exception dom_html_text_area_element_get_read_only(
dom_html_text_area_element *text_area, bool *read_only);
 
dom_exception dom_html_text_area_element_set_read_only(
dom_html_text_area_element *text_area, bool read_only);
 
dom_exception dom_html_text_area_element_get_tab_index(
dom_html_text_area_element *text_area, int32_t *tab_index);
 
dom_exception dom_html_text_area_element_set_tab_index(
dom_html_text_area_element *text_area, uint32_t tab_index);
 
dom_exception dom_html_text_area_element_get_type(
dom_html_text_area_element *text_area, dom_string **type);
 
dom_exception dom_html_text_area_element_get_value(
dom_html_text_area_element *text_area, dom_string **value);
 
dom_exception dom_html_text_area_element_set_value(
dom_html_text_area_element *text_area, dom_string *value);
 
dom_exception dom_html_text_area_element_blur(dom_html_text_area_element *ele);
dom_exception dom_html_text_area_element_focus(dom_html_text_area_element *ele);
dom_exception dom_html_text_area_element_select(dom_html_text_area_element *ele);
 
#endif
/contrib/network/netsurf/libdom/include/dom/html/html_title_element.h
0,0 → 1,23
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
 
#ifndef dom_html_title_element_h_
#define dom_html_title_element_h_
 
#include <dom/core/exceptions.h>
#include <dom/core/string.h>
 
typedef struct dom_html_title_element dom_html_title_element;
 
dom_exception dom_html_title_element_get_text(dom_html_title_element *ele,
dom_string **text);
 
dom_exception dom_html_title_element_set_text(dom_html_title_element *ele,
dom_string *text);
 
#endif
 
/contrib/network/netsurf/libdom/include/dom/html/html_ulist_element.h
0,0 → 1,7
/*
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/