From 69f0aa360cb2b603ce1f7434312c62a24b7693f9 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 6 Dec 2010 23:38:53 +0000 Subject: Provide mechanism for binding/client to define the features a document object should support. Utilise this to decide whether to create a raw Document or an HTMLDocument instance. Disable the above decision, as the HTMLDocument implementation is garbage svn path=/trunk/libdom/; revision=11025 --- include/dom/core/implementation.h | 11 +++++++++++ include/dom/html/html_document.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'include/dom') diff --git a/include/dom/core/implementation.h b/include/dom/core/implementation.h index 6b3f143..0094217 100644 --- a/include/dom/core/implementation.h +++ b/include/dom/core/implementation.h @@ -19,6 +19,16 @@ 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); @@ -30,6 +40,7 @@ dom_exception dom_implementation_create_document_type( 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_alloc alloc, void *pw, diff --git a/include/dom/html/html_document.h b/include/dom/html/html_document.h index 00a355e..230024a 100644 --- a/include/dom/html/html_document.h +++ b/include/dom/html/html_document.h @@ -43,7 +43,7 @@ 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_events_default_action_fetcher daf, dom_ui_handler *ui, dom_parser_type pt, dom_html_document **doc); /* Parse a data chunk into the HTMLDocument */ -- cgit v1.2.3