From b657c277f517f4ab0a4da21e4f8c4cb6f8f53013 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 30 Aug 2010 13:06:19 +0000 Subject: Merge branches/struggleyb/libdom-html to trunk. A few additional fixes to reduce the number of regressions to single figures. svn path=/trunk/dom/; revision=10724 --- include/dom/bootstrap/implpriv.h | 17 ----- include/dom/core/attr.h | 46 +++++++++++++ include/dom/core/exceptions.h | 3 +- include/dom/events/document_event.h | 67 +++++++++++++++++-- include/dom/html/html_anchor_element.h | 7 ++ include/dom/html/html_applet_element.h | 7 ++ include/dom/html/html_area_element.h | 7 ++ include/dom/html/html_base_element.h | 14 ++++ include/dom/html/html_basefont_element.h | 7 ++ include/dom/html/html_body_element.h | 14 ++++ include/dom/html/html_br_element.h | 7 ++ include/dom/html/html_button_element.h | 7 ++ include/dom/html/html_collection.h | 29 +++++++++ include/dom/html/html_directory_element.h | 7 ++ include/dom/html/html_div_element.h | 7 ++ include/dom/html/html_dlist_element.h | 7 ++ include/dom/html/html_document.h | 97 ++++++++++++++++++++++++++++ include/dom/html/html_element.h | 26 ++++++++ include/dom/html/html_fieldset_element.h | 7 ++ include/dom/html/html_font_element.h | 7 ++ include/dom/html/html_form_element.h | 25 +++++++ include/dom/html/html_frame_element.h | 7 ++ include/dom/html/html_frameset_element.h | 7 ++ include/dom/html/html_head_element.h | 14 ++++ include/dom/html/html_heading_element.h | 7 ++ include/dom/html/html_hr_element.h | 7 ++ include/dom/html/html_html_element.h | 14 ++++ include/dom/html/html_iframe_element.h | 7 ++ include/dom/html/html_image_element.h | 7 ++ include/dom/html/html_input_element.h | 7 ++ include/dom/html/html_isindex_element.h | 26 ++++++++ include/dom/html/html_label_element.h | 7 ++ include/dom/html/html_legend_element.h | 7 ++ include/dom/html/html_li_element.h | 7 ++ include/dom/html/html_link_element.h | 23 +++++++ include/dom/html/html_map_element.h | 7 ++ include/dom/html/html_menu_element.h | 7 ++ include/dom/html/html_meta_element.h | 14 ++++ include/dom/html/html_mod_element.h | 7 ++ include/dom/html/html_object_element.h | 7 ++ include/dom/html/html_olist_element.h | 7 ++ include/dom/html/html_optgroup_element.h | 7 ++ include/dom/html/html_option_element.h | 7 ++ include/dom/html/html_options_collection.h | 33 ++++++++++ include/dom/html/html_paragraph_element.h | 7 ++ include/dom/html/html_param_element.h | 7 ++ include/dom/html/html_pre_element.h | 7 ++ include/dom/html/html_quote_element.h | 7 ++ include/dom/html/html_script_element.h | 7 ++ include/dom/html/html_select_element.h | 55 ++++++++++++++++ include/dom/html/html_style_element.h | 23 +++++++ include/dom/html/html_table_element.h | 7 ++ include/dom/html/html_tablecaption_element.h | 7 ++ include/dom/html/html_tablecell_element.h | 7 ++ include/dom/html/html_tablecol_element.h | 7 ++ include/dom/html/html_tablerow_element.h | 7 ++ include/dom/html/html_tablesection_element.h | 7 ++ include/dom/html/html_textarea_element.h | 7 ++ include/dom/html/html_title_element.h | 24 +++++++ include/dom/html/html_ulist_element.h | 7 ++ 60 files changed, 827 insertions(+), 24 deletions(-) create mode 100644 include/dom/html/html_anchor_element.h create mode 100644 include/dom/html/html_applet_element.h create mode 100644 include/dom/html/html_area_element.h create mode 100644 include/dom/html/html_base_element.h create mode 100644 include/dom/html/html_basefont_element.h create mode 100644 include/dom/html/html_body_element.h create mode 100644 include/dom/html/html_br_element.h create mode 100644 include/dom/html/html_button_element.h create mode 100644 include/dom/html/html_collection.h create mode 100644 include/dom/html/html_directory_element.h create mode 100644 include/dom/html/html_div_element.h create mode 100644 include/dom/html/html_dlist_element.h create mode 100644 include/dom/html/html_document.h create mode 100644 include/dom/html/html_element.h create mode 100644 include/dom/html/html_fieldset_element.h create mode 100644 include/dom/html/html_font_element.h create mode 100644 include/dom/html/html_form_element.h create mode 100644 include/dom/html/html_frame_element.h create mode 100644 include/dom/html/html_frameset_element.h create mode 100644 include/dom/html/html_head_element.h create mode 100644 include/dom/html/html_heading_element.h create mode 100644 include/dom/html/html_hr_element.h create mode 100644 include/dom/html/html_html_element.h create mode 100644 include/dom/html/html_iframe_element.h create mode 100644 include/dom/html/html_image_element.h create mode 100644 include/dom/html/html_input_element.h create mode 100644 include/dom/html/html_isindex_element.h create mode 100644 include/dom/html/html_label_element.h create mode 100644 include/dom/html/html_legend_element.h create mode 100644 include/dom/html/html_li_element.h create mode 100644 include/dom/html/html_link_element.h create mode 100644 include/dom/html/html_map_element.h create mode 100644 include/dom/html/html_menu_element.h create mode 100644 include/dom/html/html_meta_element.h create mode 100644 include/dom/html/html_mod_element.h create mode 100644 include/dom/html/html_object_element.h create mode 100644 include/dom/html/html_olist_element.h create mode 100644 include/dom/html/html_optgroup_element.h create mode 100644 include/dom/html/html_option_element.h create mode 100644 include/dom/html/html_options_collection.h create mode 100644 include/dom/html/html_paragraph_element.h create mode 100644 include/dom/html/html_param_element.h create mode 100644 include/dom/html/html_pre_element.h create mode 100644 include/dom/html/html_quote_element.h create mode 100644 include/dom/html/html_script_element.h create mode 100644 include/dom/html/html_select_element.h create mode 100644 include/dom/html/html_style_element.h create mode 100644 include/dom/html/html_table_element.h create mode 100644 include/dom/html/html_tablecaption_element.h create mode 100644 include/dom/html/html_tablecell_element.h create mode 100644 include/dom/html/html_tablecol_element.h create mode 100644 include/dom/html/html_tablerow_element.h create mode 100644 include/dom/html/html_tablesection_element.h create mode 100644 include/dom/html/html_textarea_element.h create mode 100644 include/dom/html/html_title_element.h create mode 100644 include/dom/html/html_ulist_element.h (limited to 'include/dom') diff --git a/include/dom/bootstrap/implpriv.h b/include/dom/bootstrap/implpriv.h index 93ce34d..89d3f96 100644 --- a/include/dom/bootstrap/implpriv.h +++ b/include/dom/bootstrap/implpriv.h @@ -243,21 +243,4 @@ struct dom_implementation_source { /* Register a source with the DOM library */ dom_exception dom_register_source(struct dom_implementation_source *source); -/* Create a DOM document */ -dom_exception dom_document_create(struct dom_implementation *impl, - dom_alloc alloc, void *pw, - dom_events_default_action_fetcher daf, - struct dom_document **doc); - -/* Set a document's buffer */ -void dom_document_set_buffer(struct dom_document *doc, uint8_t *buffer, - size_t buffer_len); - -/* Create a DOM document type */ -dom_exception dom_document_type_create(struct dom_string *qname, - struct dom_string *public_id, - struct dom_string *system_id, - dom_alloc alloc, void *pw, - struct dom_document_type **doctype); - #endif diff --git a/include/dom/core/attr.h b/include/dom/core/attr.h index 7ac3956..f5105f7 100644 --- a/include/dom/core/attr.h +++ b/include/dom/core/attr.h @@ -21,6 +21,17 @@ struct dom_string; 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; @@ -102,4 +113,39 @@ static inline dom_exception dom_attr_is_id(struct dom_attr *attr, bool *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 unsigned long 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, unsigned long *value); +dom_exception dom_attr_set_integer(dom_attr *a, unsigned long 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 diff --git a/include/dom/core/exceptions.h b/include/dom/core/exceptions.h index e128016..04c7f18 100644 --- a/include/dom/core/exceptions.h +++ b/include/dom/core/exceptions.h @@ -44,7 +44,8 @@ typedef enum { 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_NO_MEM_ERR = DOM_EXCEPTION_CLASS_INTERNAL + 0, + DOM_ATTR_WRONG_TYPE_ERR = DOM_EXCEPTION_CLASS_INTERNAL + 1 /* our own internal error */ } dom_exception; diff --git a/include/dom/events/document_event.h b/include/dom/events/document_event.h index 3c1ea1b..be0646f 100644 --- a/include/dom/events/document_event.h +++ b/include/dom/events/document_event.h @@ -8,6 +8,8 @@ #ifndef dom_events_document_event_h_ #define dom_events_document_event_h_ +#include + #include struct dom_string; @@ -17,16 +19,69 @@ struct lwc_string_s; 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 * - * @note: When the implementation reach the end of the event flow, it will call - * this function to get the default action handler. If it does not return a - * NULL, the returned dom_event_listener will be invoked as the event is not - * canceled. + * \param type The type of the event + * \param phase The phase of the default action callback + * \param pw The return privat data of the callback function + * \return a callback function, NULL if there is none. */ -typedef struct dom_event_listener *(*dom_events_default_action_fetcher) - (struct lwc_string_s *name, struct lwc_string_s *type); +typedef dom_default_action_callback (*dom_events_default_action_fetcher) + (struct lwc_string_s *type, dom_default_action_phase phase, + void **pw); dom_exception _dom_document_event_create_event(dom_document_event *de, struct dom_string *type, struct dom_event **evt); diff --git a/include/dom/html/html_anchor_element.h b/include/dom/html/html_anchor_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_applet_element.h b/include/dom/html/html_applet_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_area_element.h b/include/dom/html/html_area_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_base_element.h b/include/dom/html/html_base_element.h new file mode 100644 index 0000000..5ff28ee --- /dev/null +++ b/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 + */ + +#ifndef dom_html_base_element_h_ +#define dom_html_base_element_h_ + +typedef struct dom_html_base_element dom_html_base_element; + +#endif + diff --git a/include/dom/html/html_basefont_element.h b/include/dom/html/html_basefont_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_body_element.h b/include/dom/html/html_body_element.h new file mode 100644 index 0000000..4df4ead --- /dev/null +++ b/include/dom/html/html_body_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 + */ + +#ifndef dom_html_body_element_h_ +#define dom_html_body_element_h_ + +typedef struct dom_html_body_element dom_html_body_element; + +#endif + diff --git a/include/dom/html/html_br_element.h b/include/dom/html/html_br_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_button_element.h b/include/dom/html/html_button_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/include/dom/html/html_button_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 + */ + diff --git a/include/dom/html/html_collection.h b/include/dom/html/html_collection.h new file mode 100644 index 0000000..09cf6ed --- /dev/null +++ b/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 + */ + +#ifndef dom_html_collection_h_ +#define dom_html_collection_h_ + +#include + +struct dom_node; +struct dom_string; + +typedef struct dom_html_collection dom_html_collection; + +dom_exception dom_html_collection_get_length(dom_html_collection *col, + unsigned long *len); +dom_exception dom_html_collection_item(dom_html_collection *col, + unsigned long index, struct dom_node **node); +dom_exception dom_html_collection_named_item(dom_html_collection *col, + struct 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 + diff --git a/include/dom/html/html_directory_element.h b/include/dom/html/html_directory_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_div_element.h b/include/dom/html/html_div_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_dlist_element.h b/include/dom/html/html_dlist_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_document.h b/include/dom/html/html_document.h new file mode 100644 index 0000000..00a355e --- /dev/null +++ b/include/dom/html/html_document.h @@ -0,0 +1,97 @@ +/* + * This file is part of libdom. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2009 Bo Yang + */ + +#ifndef dom_html_document_h_ +#define dom_html_document_h_ + +#include +#include +#include + +struct dom_element; +struct dom_html_collection; +struct dom_html_element; +struct dom_nodelist; + +typedef struct dom_html_document dom_html_document; + +typedef enum { + DOM_HTML_PARSER = 0, + DOM_XML_PARSER = 1 +} dom_parser_type; + +/** + * Callbacks for UI related function calls + */ +struct dom_ui_handler { + dom_exception (*element_focus)(struct dom_element *element); + /* Callback for a focus DOM call */ + dom_exception (*element_select)(struct dom_element *element); + /* Callback for a select DOM call */ + dom_exception (*element_blur)(struct dom_element *element); + /* Callback for a blur DOM call */ + dom_exception (*element_enable)(struct dom_element *element, + bool enable); + /* Callback for enable/disable an element */ +}; +typedef struct dom_ui_handler dom_ui_handler; + +/* Create a HTMLDocument */ +dom_exception dom_html_document_create(dom_alloc alloc, void *pw, dom_msg msg, + void *msg_pw, + dom_events_default_action_fetcher daf, dom_ui_handler ui, + dom_parser_type pt, dom_html_document **doc); + +/* Parse a data chunk into the HTMLDocument */ +dom_exception dom_html_document_write_data(uint8_t *data, size_t len); + +/* Notify the HTMLDocument that it is completed */ +dom_exception dom_html_document_complete(void); + +/*-----------------------------------------------------------------------*/ +/* The DOM spec public API */ + +dom_exception dom_html_document_get_title(dom_html_document *doc, + struct dom_string **title); +dom_exception dom_html_document_set_title(dom_html_document *doc, + struct dom_string *title); +dom_exception dom_html_document_get_referer(dom_html_document *doc, + struct dom_string **referer); +dom_exception dom_html_document_get_domain(dom_html_document *doc, + struct dom_string **domain); +dom_exception dom_html_document_get_url(dom_html_document *doc, + struct dom_string **url); +dom_exception dom_html_document_get_body(dom_html_document *doc, + struct dom_html_element **body); +dom_exception dom_html_document_set_body(dom_html_document *doc, + struct dom_html_element *body); +dom_exception dom_html_document_get_images(dom_html_document *doc, + struct dom_html_collection **col); +dom_exception dom_html_document_get_applets(dom_html_document *doc, + struct dom_html_collection **col); +dom_exception dom_html_document_get_links(dom_html_document *doc, + struct dom_html_collection **col); +dom_exception dom_html_document_get_forms(dom_html_document *doc, + struct dom_html_collection **col); +dom_exception dom_html_document_get_anchors(dom_html_document *doc, + struct dom_html_collection **col); +dom_exception dom_html_document_get_cookie(dom_html_document *doc, + struct dom_string **cookie); +dom_exception dom_html_document_set_cookie(dom_html_document *doc, + struct dom_string *cookie); + +dom_exception dom_html_document_open(dom_html_document *doc); +dom_exception dom_html_document_close(dom_html_document *doc); +dom_exception dom_html_document_write(dom_html_document *doc, + struct dom_string *text); +dom_exception dom_html_document_writeln(dom_html_document *doc, + struct dom_string *text); +dom_exception dom_html_document_get_elements_by_name(dom_html_document *doc, + struct dom_string *name, struct dom_nodelist **list); + +#endif + diff --git a/include/dom/html/html_element.h b/include/dom/html/html_element.h new file mode 100644 index 0000000..8c41664 --- /dev/null +++ b/include/dom/html/html_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 + */ + +#ifndef dom_html_element_h_ +#define dom_html_element_h_ + +typedef struct dom_html_element dom_html_element; + +/** + * Note: DOM HTML spec is used to provide a more convenient way to + * access Element's attribute through property. But, for implementation like + * C, such propery provide no more convenience than Element.get(set)Attribute + * function, so we ignore all the propety whose type is DOMString in this + * implementation, clients can always access these property through + * get(set)Attribute methods. + * + * For the readonly property, an readonly Attr node should be created, so once + * these Attr nodes are created, they can not be changed any more. + */ + +#endif + diff --git a/include/dom/html/html_fieldset_element.h b/include/dom/html/html_fieldset_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_font_element.h b/include/dom/html/html_font_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_form_element.h b/include/dom/html/html_form_element.h new file mode 100644 index 0000000..230846c --- /dev/null +++ b/include/dom/html/html_form_element.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 + */ + +#ifndef dom_html_form_element_h_ +#define dom_html_form_element_h_ + +#include + +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, + unsigned long *len); +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 + diff --git a/include/dom/html/html_frame_element.h b/include/dom/html/html_frame_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_frameset_element.h b/include/dom/html/html_frameset_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_head_element.h b/include/dom/html/html_head_element.h new file mode 100644 index 0000000..e00fc19 --- /dev/null +++ b/include/dom/html/html_head_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 + */ + +#ifndef dom_html_head_element_h_ +#define dom_html_head_element_h_ + +typedef struct dom_html_head_element dom_html_head_element; + +#endif + diff --git a/include/dom/html/html_heading_element.h b/include/dom/html/html_heading_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_hr_element.h b/include/dom/html/html_hr_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_html_element.h b/include/dom/html/html_html_element.h new file mode 100644 index 0000000..80ef6af --- /dev/null +++ b/include/dom/html/html_html_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 + */ + +#ifndef dom_html_html_element_h_ +#define dom_html_html_element_h_ + +typedef struct dom_html_html_element dom_html_html_element; + +#endif + diff --git a/include/dom/html/html_iframe_element.h b/include/dom/html/html_iframe_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_image_element.h b/include/dom/html/html_image_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_input_element.h b/include/dom/html/html_input_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/include/dom/html/html_input_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 + */ + diff --git a/include/dom/html/html_isindex_element.h b/include/dom/html/html_isindex_element.h new file mode 100644 index 0000000..4961ccc --- /dev/null +++ b/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 + */ + +#ifndef dom_html_isindex_element_h_ +#define dom_html_isindex_element_h_ + +#include + +struct dom_html_form_element; + +/** + * Note: the HTML 4.01 spec said: this element is deprecated, use + * 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 + diff --git a/include/dom/html/html_label_element.h b/include/dom/html/html_label_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_legend_element.h b/include/dom/html/html_legend_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_li_element.h b/include/dom/html/html_li_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_link_element.h b/include/dom/html/html_link_element.h new file mode 100644 index 0000000..c96d020 --- /dev/null +++ b/include/dom/html/html_link_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 + */ + +#ifndef dom_html_link_element_h_ +#define dom_html_link_element_h_ + +#include +#include + +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); + +#endif + diff --git a/include/dom/html/html_map_element.h b/include/dom/html/html_map_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_menu_element.h b/include/dom/html/html_menu_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_meta_element.h b/include/dom/html/html_meta_element.h new file mode 100644 index 0000000..8ceb459 --- /dev/null +++ b/include/dom/html/html_meta_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 + */ + +#ifndef dom_html_meta_element_h_ +#define dom_html_meta_element_h_ + +typedef struct dom_html_meta_element dom_html_meta_element; + +#endif + diff --git a/include/dom/html/html_mod_element.h b/include/dom/html/html_mod_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_object_element.h b/include/dom/html/html_object_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_olist_element.h b/include/dom/html/html_olist_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_optgroup_element.h b/include/dom/html/html_optgroup_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/include/dom/html/html_optgroup_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 + */ + diff --git a/include/dom/html/html_option_element.h b/include/dom/html/html_option_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/include/dom/html/html_option_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 + */ + diff --git a/include/dom/html/html_options_collection.h b/include/dom/html/html_options_collection.h new file mode 100644 index 0000000..ad8e6aa --- /dev/null +++ b/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 + */ + +#ifndef dom_html_options_collection_h_ +#define dom_html_options_collection_h_ + +#include + +struct dom_node; +struct dom_string; + +typedef struct dom_html_options_collection dom_html_options_collection; + +dom_exception dom_html_options_collection_get_length( + dom_html_options_collection *col, unsigned long *len); +dom_exception dom_html_options_collection_set_length( + dom_html_options_collection *col, unsigned long len); +dom_exception dom_html_options_collection_item( + dom_html_options_collection *col, unsigned long index, + struct dom_node **node); +dom_exception dom_html_options_collection_named_item( + dom_html_options_collection *col, struct 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 + diff --git a/include/dom/html/html_paragraph_element.h b/include/dom/html/html_paragraph_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_param_element.h b/include/dom/html/html_param_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_pre_element.h b/include/dom/html/html_pre_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_quote_element.h b/include/dom/html/html_quote_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_script_element.h b/include/dom/html/html_script_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_select_element.h b/include/dom/html/html_select_element.h new file mode 100644 index 0000000..10c002a --- /dev/null +++ b/include/dom/html/html_select_element.h @@ -0,0 +1,55 @@ +/* + * This file is part of libdom. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2009 Bo Yang + */ + +#ifndef dom_html_select_element_h_ +#define dom_html_select_element_h_ + +#include + +#include + +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_selected_index( + dom_html_select_element *ele, unsigned long *index); +dom_exception dom_html_select_element_set_selected_index( + dom_html_select_element *ele, unsigned long index); +dom_exception dom_html_select_element_get_length( + dom_html_select_element *ele, unsigned long *len); +dom_exception dom_html_select_element_set_length( + dom_html_select_element *ele, unsigned long len); +dom_exception dom_html_select_element_get_options( + dom_html_select_element *ele, + struct dom_html_options_collection **col); +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_size( + dom_html_select_element *ele, unsigned long *size); +dom_exception dom_html_select_element_set_size( + dom_html_select_element *ele, unsigned long size); +dom_exception dom_html_select_element_get_tab_index( + dom_html_select_element *ele, unsigned long *tab_index); +dom_exception dom_html_select_element_set_tab_index( + dom_html_select_element *ele, unsigned long tab_index); + +/* Functions */ +dom_exception dom_html_select_element_add(struct dom_html_element *ele, + struct dom_html_element *before); +dom_exception dom_html_element_blur(struct dom_html_select_element *ele); +dom_exception dom_html_element_focus(struct dom_html_select_element *ele); + +#endif + diff --git a/include/dom/html/html_style_element.h b/include/dom/html/html_style_element.h new file mode 100644 index 0000000..868a043 --- /dev/null +++ b/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 + */ + +#ifndef dom_html_style_element_h_ +#define dom_html_style_element_h_ + +#include +#include + +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 + diff --git a/include/dom/html/html_table_element.h b/include/dom/html/html_table_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_tablecaption_element.h b/include/dom/html/html_tablecaption_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_tablecell_element.h b/include/dom/html/html_tablecell_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_tablecol_element.h b/include/dom/html/html_tablecol_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_tablerow_element.h b/include/dom/html/html_tablerow_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_tablesection_element.h b/include/dom/html/html_tablesection_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + diff --git a/include/dom/html/html_textarea_element.h b/include/dom/html/html_textarea_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/include/dom/html/html_textarea_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 + */ + diff --git a/include/dom/html/html_title_element.h b/include/dom/html/html_title_element.h new file mode 100644 index 0000000..5da766a --- /dev/null +++ b/include/dom/html/html_title_element.h @@ -0,0 +1,24 @@ +/* + * This file is part of libdom. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2009 Bo Yang + */ + +#ifndef dom_html_title_element_h_ +#define dom_html_title_element_h_ + +#include + +struct dom_string; + +typedef struct dom_html_title_element dom_html_title_element; + +dom_exception dom_html_title_element_get_text(dom_html_title_element *ele, + struct dom_string **text); + +dom_exception dom_html_title_element_set_text(dom_html_title_element *ele, + struct dom_string *text); + +#endif + diff --git a/include/dom/html/html_ulist_element.h b/include/dom/html/html_ulist_element.h new file mode 100644 index 0000000..2e182d5 --- /dev/null +++ b/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 + */ + -- cgit v1.2.3