#include <gnome.h>
#include <libxml/tree.h>
#include "mlview-node-type-picker.h"
#include "mlview-settings-builder.h"
#include "mlview-app-context.h"
#include "mlview-xml-document.h"
Go to the source code of this file.
Data Structures | |
struct | _MlViewTreeEditor |
struct | _MlViewTreeEditorClass |
Defines | |
#define | MLVIEW_TYPE_TREE_EDITOR (mlview_tree_editor_get_type()) |
This class is the abstraction of a visual tree editor. | |
#define | MLVIEW_TREE_EDITOR(object) (GTK_CHECK_CAST((object),MLVIEW_TYPE_TREE_EDITOR,MlViewTreeEditor)) |
#define | MLVIEW_TREE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST((klass),MLVIEW_TYPE_TREE_EDITOR,MlViewTreeEditorClass)) |
#define | MLVIEW_IS_TREE_EDITOR(object) (GTK_CHECK_TYPE((object),MLVIEW_TYPE_TREE_EDITOR)) |
#define | MLVIEW_IS_TREE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass),MLVIEW_TYPE_TREE_EDITOR)) |
Typedefs | |
typedef _MlViewTreeEditor | MlViewTreeEditor |
typedef _MlViewTreeEditorClass | MlViewTreeEditorClass |
typedef _MlViewTreeEditorPrivate | MlViewTreeEditorPrivate |
Enumerations | |
enum | WhereInTheNodeBitmap { NODE_NAME = 1, NODE_ATTRIBUTE_NAME = 1 << 1, NODE_ATTRIBUTE_VALUE = 1 << 2, NODE_CONTENT = 1 << 3, NODE_ALL_PARTS = NODE_NAME | NODE_ATTRIBUTE_NAME | NODE_ATTRIBUTE_VALUE | NODE_CONTENT } |
In the search api, this bitmap is to specify which part of the xml node (content, name, attibute name etc ...) should be considered for the search. More... | |
Functions | |
guint | mlview_tree_editor_get_type (void) |
the standard type id builder of the MlViewTreeEditor object. | |
GtkWidget * | mlview_tree_editor_new (MlViewAppContext *a_app_context) |
the public constructor of the MlViewTreeEditor. | |
void | mlview_tree_editor_destroy (GtkObject *a_object) |
the destroy signal handler of the mlviewTreeEditorClass. | |
guint | mlview_tree_editor_edit_xml_doc (MlViewTreeEditor *a_editor, MlViewXMLDocument *a_xmldoc, gchar *a_doc_name) |
A very important method in this class (and even in the whole MlView software). | |
void | mlview_tree_editor_update_visual_node (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_visual_node) |
Given a GtkCTreeNode which has been associated to an xmlNode (by calling gtk_ctree_node_set_row_data on the GtkCTreeNode with the xmlNode in param), this function redraws the GtkCTreeNode by updating the string representation of the xml node that apears in the column at the right of the node. | |
void | mlview_tree_editor_update_visual_xml_node (MlViewTreeEditor *a_tree_editor, xmlNode *a_node) |
gint | mlview_tree_editor_add_child_node (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_parent_node, xmlNodePtr a_xml_node) |
xmlNode * | mlview_tree_editor_insert_sibling_node (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_sibling_node, xmlNodePtr a_xml_node, gboolean previous) |
Builds and inserts a sibling node after the a_sibling node in the current visual xml tree. | |
void | mlview_tree_editor_cut_node (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_visual_node) |
Removes the node a_visual_node given in argument and put it in the clipboard. | |
void | mlview_tree_editor_create_new_xml_doc (MlViewTreeEditor *a_tree_editor, MlViewXMLDocument *a_xml_doc) |
Creates a new xml doc. | |
GtkCTreeNode * | mlview_tree_editor_set_root_element (MlViewTreeEditor *a_tree_editor, xmlNodePtr) |
Set the root element to a visual node build from a_xml_node. | |
GtkCTree * | mlview_tree_editor_get_visual_tree (MlViewTreeEditor *a_tree_editor) |
GtkCTreeNode * | mlview_tree_editor_get_current_selected_node (MlViewTreeEditor *a_tree_editor) |
void | mlview_tree_editor_paste_node_as_child (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_visual_parent_node) |
Get the last node put into the clipboard and in insert it into the visual dom. | |
void | mlview_tree_editor_paste_node_as_sibling (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_visual_sibling_node, gboolean a_previous) |
Gets an xml node from the clipboard and pastes it as the previous sibling of the visual node given in argument. | |
xmlDocPtr | mlview_tree_editor_get_xml_document (MlViewTreeEditor *a_tree_editor) |
void | mlview_tree_editor_set_node_type_picker (MlViewTreeEditor *a_tree_editor, MlViewNodeTypePicker *a_node_type_picker) |
MlViewNodeTypePicker * | mlview_tree_editor_get_node_type_picker (MlViewTreeEditor *a_tree_editor) |
void | mlview_tree_editor_add_child_node_interactive (MlViewTreeEditor *a_tree_editor) |
Asks the user for the type of node he wants to add and adds it. | |
void | mlview_tree_editor_insert_sibling_node_interactive (MlViewTreeEditor *a_tree_editor) |
void | mlview_tree_editor_insert_next_sibling_node_interactive (MlViewTreeEditor *a_tree_editor) |
Asks the user for the type of node he wants to insert and inserts it. | |
void | mlview_tree_editor_insert_prev_sibling_node_interactive (MlViewTreeEditor *a_tree_editor) |
Asks the user for the type of node he wants to insert and inserts it. | |
void | mlview_tree_editor_copy_node (MlViewTreeEditor *a_tree_editor, GtkCTreeNode *a_visual_node, gboolean a_recursive) |
GtkCTreeNode * | mlview_tree_editor_find_xml_node_that_contains_str (MlViewTreeEditor *a_tree_editor, const gchar *a_str, const enum WhereInTheNodeBitmap a_where_in_node_bitmap, const gboolean a_start_after) |
GtkCTreeNode * | mlview_tree_editor_find_xml_node_that_contains_str_interactive (MlViewTreeEditor *a_tree_editor) |
mlview_tree_editor_find_xml_node_that_contains_str_interactive | |
void | mlview_tree_editor_set_xml_document_path (MlViewTreeEditor *a_tree_editor, gchar *a_file_path) |
Sets the title of the xml DOM to @a_file_path. | |
void | mlview_tree_editor_set_application_context (MlViewTreeEditor *a_tree_editor, MlViewAppContext *a_app_context) |
MlViewAppContext * | mlview_tree_editor_get_application_context (MlViewTreeEditor *a_tree_editor) |
void | mlview_tree_editor_expand_tree_to_depth (MlViewTreeEditor *a_editor, gint a_depth) |
Expands the current selected visual xml tree to the depth specified by @a_a_depth. | |
void | mlview_tree_editor_update_contextual_menu (MlViewTreeEditor *a_tree_editor, GtkMenu **a_menu_ptr) |
void | mlview_tree_editor_update_child_node_added (MlViewTreeEditor *a_tree_editor, xmlNode *a_parent_node, xmlNode *a_added_node) |
mlview_tree_editor_update_child_node_added : This method visually updates the tree editor to make the addition of child node visible. | |
void | mlview_tree_editor_update_node_cut (MlViewTreeEditor *a_tree_editor, xmlNode *a_parent_node, xmlNode *a_cut_node) |
void | mlview_tree_editor_update_node_pasted (MlViewTreeEditor *a_tree_editor, xmlNode *a_parent_node, xmlNode *a_pasted_node) |
void | mlview_tree_editor_update_sibling_node_inserted (MlViewTreeEditor *a_tree_editor, xmlNode *a_sibling_node, xmlNode *a_inserted_node, gboolean a_previous) |
|
|
Definition at line 44 of file mlview-tree-editor.h. |
|
Definition at line 41 of file mlview-tree-editor.h. Referenced by mlview_tree_editor_destroy(), mlview_tree_editor_update_visual_node(), and mlview_xml_doc_tree_view_construct(). |
|
Definition at line 42 of file mlview-tree-editor.h. |
|
This class is the abstraction of a visual tree editor. Given an xmlNode (gnome-xml) based tree, it can visualize it, support cut/copy/paste operations that modifies directly the underlying xmlNode based tree etc ...
Definition at line 40 of file mlview-tree-editor.h. Referenced by mlview_tree_editor_new(). |
|
Definition at line 47 of file mlview-tree-editor.h. |
|
Definition at line 48 of file mlview-tree-editor.h. |
|
Definition at line 49 of file mlview-tree-editor.h. |
|
In the search api, this bitmap is to specify which part of the xml node (content, name, attibute name etc ...) should be considered for the search.
Definition at line 71 of file mlview-tree-editor.h. Referenced by mlview_tree_editor_find_xml_node_that_contains_str(). |
|
|
|
Asks the user for the type of node he wants to add and adds it.
Definition at line 2294 of file mlview-tree-editor.c. References ADD_CHILD, mlview_app_context_set_window_icon(), MLVIEW_IS_TREE_EDITOR, MLVIEW_NODE_TYPE_PICKER, mlview_node_type_picker_select_node_name_or_content_entry_text(), mlview_node_type_picker_set_title(), mlview_tree_editor_get_node_type_picker(), mlview_tree_editor_set_node_type_picker(), mvliew_node_type_picker_build_element_name_choice_list(), and PRIVATE. Referenced by mlview_xml_doc_tree_view_add_child_node_interactive(). |
|
Definition at line 2093 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_get_visual_tree(), mlview_xml_document_copy_node_to_clipboard(), and PRIVATE. Referenced by mlview_xml_doc_tree_view_copy_node(). |
|
Creates a new xml doc.
Definition at line 2140 of file mlview-tree-editor.c. References mlview_tree_editor_edit_xml_doc(), and PRIVATE. |
|
Removes the node a_visual_node given in argument and put it in the clipboard. Cut also the correponding xmlNode from the dom. Emits the signals "node-cut" and "tree-changed".
Definition at line 2063 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_get_visual_tree(), mlview_xml_document_cut_node(), and PRIVATE. Referenced by mlview_xml_doc_tree_view_cut_node(). |
|
the destroy signal handler of the mlviewTreeEditorClass.
Definition at line 1715 of file mlview-tree-editor.c. References MLVIEW_TREE_EDITOR, and PRIVATE. |
|
A very important method in this class (and even in the whole MlView software). It takes an xml document in parameter, builds the graphical view that matches it and displays it.
Definition at line 1589 of file mlview-tree-editor.c. References mlview_app_context_get_settings_hash_table(), MLVIEW_IS_TREE_EDITOR, MLVIEW_IS_XML_DOCUMENT, mlview_xml_document_get_xml_document(), and PRIVATE. Referenced by mlview_tree_editor_create_new_xml_doc(), and mlview_xml_doc_tree_view_construct(). |
|
Expands the current selected visual xml tree to the depth specified by @a_a_depth. If @a_depth is set to -1 the tree is expanded to the leaves.
Definition at line 2602 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, and PRIVATE. Referenced by mlview_tree_editor_update_child_node_added(), and mlview_xml_doc_tree_view_expand_tree_to_depth_interactive(). |
|
Definition at line 2515 of file mlview-tree-editor.c. References mlview_tree_editor_get_current_selected_node(), mlview_tree_editor_get_xml_document(), PRIVATE, and WhereInTheNodeBitmap. |
|
mlview_tree_editor_find_xml_node_that_contains_str_interactive
Definition at line 2546 of file mlview-tree-editor.c. References mlview_app_context_set_window_icon(), MLVIEW_IS_TREE_EDITOR, and PRIVATE. Referenced by mlview_xml_doc_tree_view_find_xml_node_that_contains_str_interactive(). |
|
Definition at line 1538 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, and PRIVATE. |
|
Definition at line 2122 of file mlview-tree-editor.c. References PRIVATE. Referenced by mlview_tree_editor_find_xml_node_that_contains_str(), mlview_xml_doc_tree_view_copy_node(), mlview_xml_doc_tree_view_cut_node(), mlview_xml_doc_tree_view_paste_node_as_child(), mlview_xml_doc_tree_view_paste_node_as_next_sibling(), and mlview_xml_doc_tree_view_paste_node_as_prev_sibling(). |
|
Definition at line 2500 of file mlview-tree-editor.c. References PRIVATE. Referenced by mlview_tree_editor_add_child_node_interactive(), mlview_tree_editor_insert_next_sibling_node_interactive(), and mlview_tree_editor_insert_prev_sibling_node_interactive(). |
|
the standard type id builder of the MlViewTreeEditor object.
Definition at line 1483 of file mlview-tree-editor.c. |
|
Definition at line 2277 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, and PRIVATE. Referenced by mlview_tree_editor_add_child_node(), mlview_tree_editor_copy_node(), mlview_tree_editor_cut_node(), mlview_tree_editor_insert_sibling_node(), mlview_tree_editor_update_child_node_added(), mlview_tree_editor_update_node_cut(), mlview_tree_editor_update_node_pasted(), and mlview_tree_editor_update_sibling_node_inserted(). |
|
Definition at line 2467 of file mlview-tree-editor.c. References PRIVATE. Referenced by mlview_tree_editor_find_xml_node_that_contains_str(). |
|
Asks the user for the type of node he wants to insert and inserts it.
Definition at line 2417 of file mlview-tree-editor.c. References INSERT_AFTER, mlview_app_context_set_window_icon(), MLVIEW_NODE_TYPE_PICKER, mlview_node_type_picker_new(), mlview_node_type_picker_select_node_name_or_content_entry_text(), mlview_node_type_picker_set_title(), mlview_tree_editor_get_node_type_picker(), mlview_tree_editor_set_node_type_picker(), mvliew_node_type_picker_build_element_name_choice_list(), and PRIVATE. Referenced by mlview_xml_doc_tree_view_insert_next_sibling_node_interactive(). |
|
Asks the user for the type of node he wants to insert and inserts it.
Definition at line 2355 of file mlview-tree-editor.c. References INSERT_BEFORE, mlview_app_context_set_window_icon(), MLVIEW_IS_TREE_EDITOR, MLVIEW_NODE_TYPE_PICKER, mlview_node_type_picker_new(), mlview_node_type_picker_select_node_name_or_content_entry_text(), mlview_node_type_picker_set_title(), mlview_tree_editor_get_node_type_picker(), mlview_tree_editor_set_node_type_picker(), mvliew_node_type_picker_build_element_name_choice_list(), and PRIVATE. Referenced by mlview_xml_doc_tree_view_insert_prev_sibling_node_interactive(). |
|
Builds and inserts a sibling node after the a_sibling node in the current visual xml tree. The newly build node is a child node of a_parent_node and reflects the xml node a_xml_node given in argument. Emit the signals "node-added" and the signal "tree-changed".
Definition at line 2023 of file mlview-tree-editor.c. References mlview_tree_editor_get_visual_tree(), mlview_xml_document_insert_next_sibling_node(), mlview_xml_document_insert_prev_sibling_node(), and PRIVATE. |
|
|
|
the public constructor of the MlViewTreeEditor.
Definition at line 1511 of file mlview-tree-editor.c. References MLVIEW_TYPE_TREE_EDITOR, and PRIVATE. |
|
Get the last node put into the clipboard and in insert it into the visual dom.
Definition at line 2213 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_xml_document_paste_node_as_child(), PRIVATE, and TREE_CHANGED. Referenced by mlview_xml_doc_tree_view_paste_node_as_child(). |
|
Gets an xml node from the clipboard and pastes it as the previous sibling of the visual node given in argument. If the node retrieved from the clipboard is NULL, does nothing.
Definition at line 2247 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_xml_document_paste_node_as_sibling(), PRIVATE, and TREE_CHANGED. Referenced by mlview_xml_doc_tree_view_paste_node_as_next_sibling(), and mlview_xml_doc_tree_view_paste_node_as_prev_sibling(). |
|
Definition at line 1526 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, and PRIVATE. Referenced by mlview_xml_doc_tree_view_set_app_context(). |
|
Definition at line 2483 of file mlview-tree-editor.c. References PRIVATE. Referenced by mlview_tree_editor_add_child_node_interactive(), mlview_tree_editor_insert_next_sibling_node_interactive(), and mlview_tree_editor_insert_prev_sibling_node_interactive(). |
|
Set the root element to a visual node build from a_xml_node. Also set the root element of the dom to a_xml_node.
Definition at line 2161 of file mlview-tree-editor.c. References NODE_ADDED, PRIVATE, and TREE_CHANGED. |
|
Sets the title of the xml DOM to @a_file_path. Updates this information in the tree editor and in the XML DOM.
Definition at line 1559 of file mlview-tree-editor.c. References PRIVATE. Referenced by mlview_xml_doc_tree_view_set_xml_document_path(). |
|
mlview_tree_editor_update_child_node_added : This method visually updates the tree editor to make the addition of child node visible. If the node addition has been already updated, this method does nothing. Upon successfull update, this method makes a_tree_editor fire two signals : "node-added", "tree-changed".
Definition at line 1763 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_expand_tree_to_depth(), mlview_tree_editor_get_visual_tree(), mlview_tree_editor_update_visual_node(), NODE_ADDED, PRIVATE, and TREE_CHANGED. Referenced by mlview_tree_editor_update_node_pasted(). |
|
Definition at line 2637 of file mlview-tree-editor.c. References ADD_CHILD, INSERT_AFTER, INSERT_BEFORE, MLVIEW_IS_TREE_EDITOR, and PRIVATE. Referenced by mlview_xml_doc_tree_view_update_contextual_menu(). |
|
Definition at line 1814 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_get_visual_tree(), mlview_tree_editor_update_visual_node(), NODE_CUT, PRIVATE, and TREE_CHANGED. |
|
Definition at line 1863 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_get_visual_tree(), mlview_tree_editor_update_child_node_added(), NODE_PASTED, and PRIVATE. |
|
Definition at line 1894 of file mlview-tree-editor.c. References mlview_app_context_get_xpm(), MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_get_visual_tree(), mlview_tree_editor_update_visual_node(), and PRIVATE. |
|
Given a GtkCTreeNode which has been associated to an xmlNode (by calling gtk_ctree_node_set_row_data on the GtkCTreeNode with the xmlNode in param), this function redraws the GtkCTreeNode by updating the string representation of the xml node that apears in the column at the right of the node. This method is to be called each time an xml node is modified (i.e name, attribute, or namespace def changes)
Definition at line 1672 of file mlview-tree-editor.c. References MLVIEW_TREE_EDITOR, and PRIVATE. Referenced by mlview_tree_editor_update_child_node_added(), mlview_tree_editor_update_node_cut(), mlview_tree_editor_update_sibling_node_inserted(), and mlview_tree_editor_update_visual_xml_node(). |
|
Definition at line 1643 of file mlview-tree-editor.c. References MLVIEW_IS_TREE_EDITOR, mlview_tree_editor_update_visual_node(), and PRIVATE. |