![]() |
![]() |
![]() |
Conglomerate Programmer's Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
typedef CongNodePtr; CongNodePtr cong_node_prev (CongNodePtr node); CongNodePtr cong_node_next (CongNodePtr node); CongNodePtr cong_node_first_child (CongNodePtr node); CongNodePtr cong_node_parent (CongNodePtr node); gboolean cong_node_is_element (CongNodePtr node, const gchar *ns_uri, const gchar *local_name); gboolean cong_node_is_element_from_set (CongNodePtr node, const gchar *ns_uri, const gchar **local_name_array, guint num_local_names, guint *output_index); xmlNsPtr cong_node_get_ns (CongNodePtr node); const gchar * cong_node_get_ns_uri (CongNodePtr node); const gchar * cong_node_get_ns_prefix (CongNodePtr node); const gchar * cong_node_get_local_name (CongNodePtr node); gchar * cong_node_get_qualified_name (CongNodePtr node); xmlNsPtr cong_node_get_ns_for_uri (CongNodePtr node, const gchar *ns_uri); xmlNsPtr cong_node_get_ns_for_prefix (CongNodePtr node, const gchar *prefix); xmlNsPtr cong_node_get_attr_ns (CongNodePtr node, const char *qualified_name, const char **output_name); gchar * cong_node_get_path (CongNodePtr node); gchar * cong_node_debug_description (CongNodePtr node); const gchar * cong_node_type_description (CongNodeType node_type); gchar* cong_node_get_attribute (CongNodePtr node, xmlNsPtr ns_ptr, const gchar *local_attribute_name); gboolean cong_node_has_attribute (CongNodePtr node, xmlNsPtr ns_ptr, const gchar *local_attribute_name); void cong_node_self_test (CongNodePtr node); void cong_node_self_test_recursive (CongNodePtr node); void cong_node_recursive_set_doc (CongNodePtr node, xmlDocPtr xml_doc); CongNodePtr cong_node_recursive_dup (CongNodePtr node); gboolean cong_node_is_descendant_of (CongNodePtr node, CongNodePtr potential_ancestor); gboolean cong_node_should_recurse (CongNodePtr node); #define CONG_NODE_SELF_TEST (node) int cong_node_get_length (CongNodePtr node); CongNodePtr cong_node_new_element (xmlNsPtr ns, const gchar *tagname, CongDocument *doc); CongNodePtr cong_node_new_element_from_dispspec (CongDispspecElement *element, CongDocument *doc); CongNodePtr cong_node_new_text (const gchar *text, CongDocument *doc); CongNodePtr cong_node_new_text_len (const gchar *text, int len, CongDocument *doc); CongNodePtr cong_node_new_comment (const gchar *comment, CongDocument *doc); void cong_node_free (CongNodePtr node); gchar * cong_node_generate_source (CongNodePtr node); gchar * cong_node_generate_child_source (CongNodePtr node); gchar * cong_node_generate_source_from_byte_offset (CongNodePtr node, int byte_offset); gchar * cong_node_generate_source_up_to_byte_offset (CongNodePtr node, int byte_offset); gchar * cong_node_generate_source_between_byte_offsets (CongNodePtr node, int start_byte_offset, int end_byte_offset); void cong_node_private_make_orphan (CongNodePtr node); void cong_node_private_add_after (CongNodePtr node, CongNodePtr older_sibling); void cong_node_private_add_before (CongNodePtr node, CongNodePtr younger_sibling); void cong_node_private_set_parent (CongNodePtr node, CongNodePtr adoptive_parent, gboolean add_to_end); void cong_node_private_set_text (CongNodePtr node, const gchar *new_content); void cong_node_private_set_attribute (CongNodePtr node, xmlNs *ns_ptr, const gchar *local_attribute_name, const gchar *value); void cong_node_private_remove_attribute (CongNodePtr node, xmlNs *ns_ptr, const gchar *local_attribute_name); CongNodePtr cong_node_get_child_by_name (CongNodePtr node, const gchar *ns_uri, const gchar *local_name); CongNodePtr cong_node_get_first_text_node_descendant (CongNodePtr node); gboolean cong_node_should_be_visible_in_editor (CongNodePtr node); gboolean cong_node_is_valid_cursor_location (CongNodePtr node); gboolean cong_node_supports_byte_offsets (CongNodePtr node); gboolean cong_node_can_be_cut (CongNodePtr node); gboolean cong_node_can_be_copied (CongNodePtr node); int cong_node_get_ordering (CongNodePtr n0, CongNodePtr n1); CongNodePtr cong_node_calc_first_node_in_subtree_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data); CongNodePtr cong_node_calc_final_node_in_subtree_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data); CongNodePtr cong_node_calc_prev_node_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data); CongNodePtr cong_node_calc_next_node_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data);
CongNodePtr cong_node_first_child (CongNodePtr node);
TODO: Write me
|
|
Returns : |
CongNodePtr cong_node_parent (CongNodePtr node);
TODO: Write me
|
|
Returns : |
gboolean cong_node_is_element (CongNodePtr node, const gchar *ns_uri, const gchar *local_name);
Handy method for deciding if you've found a element with the given name, as opposed to text nodes, comments, elements with other names etc.
|
|
|
|
|
|
Returns : |
TRUE if the node is an element with the correct name, FALSE otherwise |
gboolean cong_node_is_element_from_set (CongNodePtr node, const gchar *ns_uri, const gchar **local_name_array, guint num_local_names, guint *output_index);
Handy method for deciding if you've found a element with one of the given names in the set, as opposed to text nodes, comments, elements with other names etc.
|
|
|
URI of the namespace shared by all the element in the search set |
|
array of element local names within the namespace |
|
size of search array |
|
pointer to write index of result to, or NULL if you don't care |
Returns : |
TRUE if the node is an element with the correct name, FALSE otherwise |
const gchar * cong_node_get_ns_uri (CongNodePtr node);
TODO: Write me
|
|
Returns : |
const gchar * cong_node_get_ns_prefix (CongNodePtr node);
TODO: Write me
|
|
Returns : |
const gchar * cong_node_get_local_name (CongNodePtr node);
TODO: Write me
|
|
Returns : |
gchar * cong_node_get_qualified_name (CongNodePtr node);
Builds a string of the form "ns_prefix:local_name" for an element inside a namespace or simply "local_name" for the rest.
|
an XML element |
Returns : |
a freshly-allocated string which the caller must g_free |
xmlNsPtr cong_node_get_ns_for_uri (CongNodePtr node, const gchar *ns_uri);
|
|
|
|
Returns : |
xmlNsPtr cong_node_get_ns_for_prefix (CongNodePtr node, const gchar *prefix);
|
|
|
|
Returns : |
xmlNsPtr cong_node_get_attr_ns (CongNodePtr node, const char *qualified_name, const char **output_name);
|
|
|
|
|
|
Returns : |
gchar * cong_node_get_path (CongNodePtr node);
Method for getting an XPath to the node.
|
an XML node |
Returns : |
the XPath as a freshly allocated string, which must be freed using g_free |
gchar * cong_node_debug_description (CongNodePtr node);
TODO: Write me
|
|
Returns : |
const gchar * cong_node_type_description (CongNodeType node_type);
TODO: Write me
|
|
Returns : |
gchar* cong_node_get_attribute (CongNodePtr node, xmlNsPtr ns_ptr, const gchar *local_attribute_name);
Returns the content of the attribute specified through local_attribute_name
and
ns_ptr
.
|
XML node which has the attribute. |
|
Attribute's namespace, can be NULL (if it is the default namespace it MUST NOT be NULL but the coresponding xmlNs). |
|
Name of the attribute, without namespace prefix. |
Returns : |
The content of the attribute, to be freed by the caller. Will be NULL if not found in node and no default in DTD available |
gboolean cong_node_has_attribute (CongNodePtr node, xmlNsPtr ns_ptr, const gchar *local_attribute_name);
|
XML node which has the attribute. |
|
Attribute's namespace, can be NULL (if it is the default namespace it MUST NOT be NULL but the coresponding xmlNs). |
|
Name of the attribute, without namespace prefix. |
Returns : |
Returns TRUE if the attribute specified through local_attribute_name and
ns_ptr is found in the node or as default in the DTD.
|
void cong_node_self_test_recursive (CongNodePtr node);
TODO: Write me
|
void cong_node_recursive_set_doc (CongNodePtr node, xmlDocPtr xml_doc);
TODO: Write me
|
|
|
CongNodePtr cong_node_recursive_dup (CongNodePtr node);
TODO: Write me
|
|
Returns : |
gboolean cong_node_is_descendant_of (CongNodePtr node, CongNodePtr potential_ancestor);
TODO: Write me
|
|
|
|
Returns : |
gboolean cong_node_should_recurse (CongNodePtr node);
TODO: Write me
|
|
Returns : |
int cong_node_get_length (CongNodePtr node);
TODO: Write me
|
|
Returns : |
CongNodePtr cong_node_new_element (xmlNsPtr ns, const gchar *tagname, CongDocument *doc);
TODO: Write me
|
|
|
|
|
|
Returns : |
CongNodePtr cong_node_new_element_from_dispspec (CongDispspecElement *element, CongDocument *doc);
TODO: Write me
|
|
|
|
Returns : |
CongNodePtr cong_node_new_text (const gchar *text, CongDocument *doc);
TODO: Write me
|
|
|
|
Returns : |
CongNodePtr cong_node_new_text_len (const gchar *text, int len, CongDocument *doc);
TODO: Write me
|
|
|
|
|
|
Returns : |
CongNodePtr cong_node_new_comment (const gchar *comment, CongDocument *doc);
|
|
|
|
Returns : |
gchar * cong_node_generate_source (CongNodePtr node);
Generate XML source for the node
|
The node for which the XML source is to be generated |
Returns : |
the XML source for the node as a UTF8 string. The caller is responsible for freeing this with g_free |
gchar * cong_node_generate_child_source (CongNodePtr node);
Generate XML source for the node's children, concatenated together as a UTF8 string. Should handle entity references correctly. The result does not include the XML source for the node itself.
|
The parent node |
Returns : |
the XML source for the node's children as a UTF8 string. The caller is responsible for freeing this with g_free |
gchar * cong_node_generate_source_from_byte_offset (CongNodePtr node, int byte_offset);
TODO: Write me
|
|
|
|
Returns : |
gchar * cong_node_generate_source_up_to_byte_offset (CongNodePtr node, int byte_offset);
TODO: Write me
|
|
|
|
Returns : |
gchar * cong_node_generate_source_between_byte_offsets (CongNodePtr node, int start_byte_offset, int end_byte_offset);
TODO: Write me
|
|
|
|
|
|
Returns : |
void cong_node_private_make_orphan (CongNodePtr node);
TODO: Write me
|
void cong_node_private_add_after (CongNodePtr node, CongNodePtr older_sibling);
TODO: Write me
|
|
|
void cong_node_private_add_before (CongNodePtr node, CongNodePtr younger_sibling);
TODO: Write me
|
|
|
void cong_node_private_set_parent (CongNodePtr node, CongNodePtr adoptive_parent, gboolean add_to_end);
TODO: Write me
|
|
|
|
|
void cong_node_private_set_text (CongNodePtr node, const gchar *new_content);
TODO: Write me
|
|
|
void cong_node_private_set_attribute (CongNodePtr node, xmlNs *ns_ptr, const gchar *local_attribute_name, const gchar *value);
TODO: Write me
|
|
|
|
|
|
|
void cong_node_private_remove_attribute (CongNodePtr node, xmlNs *ns_ptr, const gchar *local_attribute_name);
TODO: Write me
|
|
|
|
|
CongNodePtr cong_node_get_child_by_name (CongNodePtr node, const gchar *ns_uri, const gchar *local_name);
This function searches the children of node
looking for elements of the given name.
|
the parent node |
|
URI of namespace to search for, or NULL |
|
the local name within any namespace of the element to search for |
Returns : |
the first child element matching the given name, or NULL if there are none |
CongNodePtr cong_node_get_first_text_node_descendant (CongNodePtr node);
TODO: Write me
|
|
Returns : |
gboolean cong_node_should_be_visible_in_editor (CongNodePtr node);
The function determines if the node ought to be visible in the main editor view.
As described in bug 123367, TEXT nodes that are either empty or purely whitespace should only appear in the main editor view if the DTD allows PCDATA at the location in the document. Otherwise the text is probably merely formatting to prettify the source view. *
|
a node to be tested |
Returns : |
a gboolean which is TRUE iff the node ought to be visible in the main editor view |
gboolean cong_node_is_valid_cursor_location (CongNodePtr node);
The function detemines if the node is a suitable location for the cursor.
It currently only tests for TEXT nodes, but will eventually be expanded to allow COMMENT nodes as well.
|
a node to be tested |
Returns : |
a gboolean which is TRUE iff it is safe to put the cursor inside this node |
gboolean cong_node_supports_byte_offsets (CongNodePtr node);
The function determines if CongLocation objects that reference this node can have meaningful byte offsets
Only TEXT, COMMENT and CDATA_SECTION nodes can currently have meaningful byte offsets.
|
a node to be tested |
Returns : |
a gboolean which is TRUE if CongLocations that reference this node can have a meaningful byte offset |
gboolean cong_node_can_be_cut (CongNodePtr node);
TODO: Write me
|
|
Returns : |
gboolean cong_node_can_be_copied (CongNodePtr node);
TODO: Write me
|
|
Returns : |
int cong_node_get_ordering (CongNodePtr n0, CongNodePtr n1);
This functions compares the location of two nodes in the xml tree and returns a numeric comparsion representing their locations in a depth-first traversal.
|
first node to be compared |
|
second node to be compared |
Returns : |
negative if n0 is reached before n1, zero if they are the same node, positive if n0 is reached after n1 |
CongNodePtr cong_node_calc_first_node_in_subtree_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data);
Finds the first node in a depth-first traversal of the subtree below this node that satisfies the predicate.
Note that node
is the initial node of the tree (and hence is tested first)
|
the top of the subtree |
|
the CongNodePredicate to test nodes for |
|
user-supplied data passed to the predicate |
Returns : |
the appropriate node satisfying predicate , or NULL if there are none
|
CongNodePtr cong_node_calc_final_node_in_subtree_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data);
Finds the final node in a depth-first traversal of the subtree below this node that satisfies the predicate.
Note that node
is the initial node of the tree (and hence is tested last)
|
the top of the subtree |
|
the CongNodePredicate to test nodes for |
|
user-supplied data passed to the predicate |
Returns : |
the appropriate node satisfying predicate , or NULL if there are none
|
CongNodePtr cong_node_calc_prev_node_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data);
Finds the first preceding node relative to the input that satisfies the predicate, in an imagined depth-first traversal of the document. Includes ancestors.
|
the start of the search |
|
the CongNodePredicate to test nodes for |
|
user-supplied data passed to the predicate |
Returns : |
the appropriate node satisfying predicate , or NULL if there are none
|
CongNodePtr cong_node_calc_next_node_satisfying (CongNodePtr node, CongNodePredicate predicate, gpointer user_data);
Finds the first following node relative to the input that satisfies the predicate, in an imagined depth-first traversal of the document. Includes ancestors.
|
the start of the search |
|
the CongNodePredicate to test nodes for |
|
user-supplied data passed to the predicate |
Returns : |
the appropriate node satisfying predicate , or NULL if there are none
|