![]() |
Oyranos Color Management System API - Version 0.9.6 |
xml handling More...
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "oyranos_config_internal.h"
#include "oyranos.h"
#include "oyranos_alpha.h"
#include "oyranos_debug.h"
#include "oyranos_helper.h"
#include "oyranos_internal.h"
#include "oyranos_string.h"
Macros | |
#define | OY_XFORMS_CSS "\ <style type=\"text/css\"> \n\ @namespace xf url(\"http://www.w3.org/2002/xforms\");\n\ xf|label {\n\ font-family: Helvetica, Geneva, Lucida, sans-serif;\n\ width: 24ex;\n\ text-align: right;\n\ padding-right: 1em;\n\ }\n\ xf|select1 { display: table-row; }\n\ xf|select1 xf|label, xf|choices xf|label { display: table-cell; }\n\ </style>" |
default CSS More... | |
Functions | |
void | oyWriteOptionToXML_ (oyGROUP_e group, oyWIDGET_e start, oyWIDGET_e end, char **text, uint32_t flags) |
char * | oyGetHtmlHeader (const char **options, oyAlloc_f allocate_func) |
write a HTML page header More... | |
void | oyWriteOptionToHTML_ (oyGROUP_e group, oyWIDGET_e start, oyWIDGET_e end, char **text) |
write a option to HTML More... | |
char * | oyDescriptionToHTML (int group, const char **options, oyAlloc_f allocateFunc) |
write a HTML description page More... | |
int | oyXFORMsRenderUi (const char *xforms, oyUiHandler_s **ui_handlers, oyPointer user_data) |
render the UI by a selected toolkit More... | |
char * | oyXFORMsFromModelAndUi (const char *data, const char *ui_text, const char **namespaces, const char *head_injection, oyAlloc_f allocate_func) |
join data and UI More... | |
int | oyXMLNodeNameIs (xmlNodePtr cur, const char *node_name) |
string compare with a joined namespace and node name More... | |
const char * | oyXFORMsModelGetAttrValue (xmlNodePtr cur, const char *attr_name) |
get the xml elements attribute value More... | |
const char * | oyXFORMsModelGetXPathValue (xmlNodePtr cur, const char *attr_name, const char **xpath) |
get the xforms model value of a corresponding layout node More... | |
const char * | oyXML2NodeValue (xmlNodePtr cur) |
get a node childs text value More... | |
xml handling
Oyranos is an open source Color Management System
#define OY_XFORMS_CSS "\ <style type=\"text/css\"> \n\ @namespace xf url(\"http://www.w3.org/2002/xforms\");\n\ xf|label {\n\ font-family: Helvetica, Geneva, Lucida, sans-serif;\n\ width: 24ex;\n\ text-align: right;\n\ padding-right: 1em;\n\ }\n\ xf|select1 { display: table-row; }\n\ xf|select1 xf|label, xf|choices xf|label { display: table-cell; }\n\ </style>" |
default CSS
The short stylesheet should cover the Oyranos subset of XFORMS elements.
Referenced by oyXFORMsFromModelAndUi().
char* oyDescriptionToHTML | ( | int | group, |
const char ** | options, | ||
oyAlloc_f | allocateFunc | ||
) |
write a HTML description page
Function oyDescriptionToHTML
group | currently only oyGROUP_ALL |
options | zero terminated paired key/value strings
|
allocate_func | the user allocator |
References oyGetHtmlHeader(), oyGROUP_ALL, oyGROUP_BEHAVIOUR_EFFECT, oyGROUP_BEHAVIOUR_MISSMATCH, oyGROUP_BEHAVIOUR_MIXED_MODE_DOCUMENTS, oyGROUP_BEHAVIOUR_PROOF, oyGROUP_BEHAVIOUR_RENDERING, oyGROUP_DEFAULT_PROFILES, OYRANOS_DEVEL_YEAR, OYRANOS_VERSION_NAME, oyWIDGET_ACTION_OPEN_MISMATCH_CMYK, oyWIDGET_ACTION_UNTAGGED_ASSIGN, oyWIDGET_BEHAVIOUR_END, oyWIDGET_DEFAULT_PROFILE_END, oyWIDGET_MIXED_MOD_DOCUMENTS_PRINT, oyWIDGET_MIXED_MOD_DOCUMENTS_SCREEN, oyWIDGET_RENDERING_INTENT, oyWIDGET_RENDERING_INTENT_PROOF, and oyWriteOptionToHTML_().
char* oyGetHtmlHeader | ( | const char ** | options, |
oyAlloc_f | allocate_func | ||
) |
write a HTML page header
Function oyGetHtmlHeader
options | zero terminated paired key/value strings |
allocate_func | the user allocator |
References oyVersionString().
Referenced by oyDescriptionToHTML().
void oyWriteOptionToHTML_ | ( | oyGROUP_e | group, |
oyWIDGET_e | start, | ||
oyWIDGET_e | end, | ||
char ** | text | ||
) |
write a option to HTML
Function oyWriteOptionToHTML_ write option range to text, allocating memory on demand
Referenced by oyDescriptionToHTML().
void oyWriteOptionToXML_ | ( | oyGROUP_e | group, |
oyWIDGET_e | start, | ||
oyWIDGET_e | end, | ||
char ** | text, | ||
uint32_t | flags | ||
) |
write option range to text, allocating memory on demand
[in] | flags | - 1: add group start
|
References oyGROUP_ALL, oyGROUP_BEHAVIOUR_EFFECT, oyGROUP_BEHAVIOUR_MISSMATCH, oyGROUP_BEHAVIOUR_MIXED_MODE_DOCUMENTS, oyGROUP_BEHAVIOUR_PROOF, oyGROUP_BEHAVIOUR_RENDERING, oyGROUP_DEFAULT_PROFILES, oySCOPE_USER, oyWIDGET_ACTION_OPEN_MISMATCH_CMYK, oyWIDGET_ACTION_UNTAGGED_ASSIGN, oyWIDGET_BEHAVIOUR_END, oyWIDGET_DEFAULT_PROFILE_END, oyWIDGET_MIXED_MOD_DOCUMENTS_PRINT, oyWIDGET_MIXED_MOD_DOCUMENTS_SCREEN, oyWIDGET_RENDERING_INTENT, and oyWIDGET_RENDERING_INTENT_PROOF.
char* oyXFORMsFromModelAndUi | ( | const char * | data, |
const char * | ui_text, | ||
const char ** | namespaces, | ||
const char * | head_injection, | ||
oyAlloc_f | allocate_func | ||
) |
join data and UI
Function oyXFORMsFromModelAndUi
[in] | data | data text |
[in] | ui_text | ui text |
[in] | namespaces | url style namespaces |
[in] | head_injection | html text to include in the HEAD section With a NULL pointer Oyranos will implicit insert a default CSS. |
[in] | allocate_func | user allocator |
References oy_domain_codeset, and OY_XFORMS_CSS.
const char* oyXFORMsModelGetAttrValue | ( | xmlNodePtr | cur, |
const char * | attr_name | ||
) |
get the xml elements attribute value
Function oyXFORMsModelGetAttrValue
[in] | cur | the libxml2 node |
[in] | attr_name | the nodes attribute |
References oy_debug.
Referenced by oyXFORMsModelGetXPathValue().
const char* oyXFORMsModelGetXPathValue | ( | xmlNodePtr | cur, |
const char * | attr_name, | ||
const char ** | xpath | ||
) |
get the xforms model value of a corresponding layout node
Function oyXFORMsModelGetXPathValue
[in] | cur | the libxml2 node |
[in] | attr_name | the nodes attribute, only "ref" ? |
[out] | xpath | the xpath of the referenced key |
References oyXFORMsModelGetAttrValue().
int oyXFORMsRenderUi | ( | const char * | xforms, |
oyUiHandler_s ** | ui_handlers, | ||
oyPointer | user_data | ||
) |
render the UI by a selected toolkit
Function oyXFORMsRenderUi Parse the XFORMS XML and render with the selected toolkit UI handlers.
[in] | xforms | XFORMS text |
[in] | ui_handlers | the toolkit specific XFORMS handlers |
[in,out] | user_data | user context passed to ui_handlers |
const char* oyXML2NodeValue | ( | xmlNodePtr | cur | ) |
get a node childs text value
Function oyXML2NodeValue
[in] | cur | the libxml2 node |
References oy_debug.
int oyXMLNodeNameIs | ( | xmlNodePtr | cur, |
const char * | node_name | ||
) |
string compare with a joined namespace and node name
Function oyXMLNodeNameIs
References oy_debug.