#include <gnome.h>
#include <libxml/parser.h>
#include "mlview-node-editor.h"
#include "mlview-file-selection.h"
#include "mlview-app-context.h"
#include "mlview-xml-document.h"
#include "mlview-xml-document-view.h"
Go to the source code of this file.
Data Structures | |
struct | _MlViewEditor |
The data members of the class MlViewEditor. More... | |
struct | _MlViewEditorClass |
Defines | |
#define | MLVIEW_TYPE_EDITOR (mlview_editor_get_type ()) |
#define | MLVIEW_EDITOR(widget) (GTK_CHECK_CAST ((widget), MLVIEW_TYPE_EDITOR, MlViewEditor)) |
#define | MLVIEW_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), MLVIEW_TYPE_EDITOR, MlViewEditorClass)) |
#define | MLVIEW_IS_EDITOR(widget) (GTK_CHECK_TYPE ((widget), MLVIEW_TYPE_EDITOR)) |
#define | MLVIEW_IS_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), MLVIEW_TYPE_EDITOR)) |
Typedefs | |
typedef _MlViewEditorPrivate | MlViewEditorPrivate |
typedef _MlViewEditor | MlViewEditor |
typedef _MlViewEditorClass | MlViewEditorClass |
Enumerations | |
enum | MLVIEW_XML_DOC_VIEW_TYPE { MLVIEW_XML_DOC_TREE_VIEW } |
Functions | |
guint | mlview_editor_get_type (void) |
the standard type builder of MlViewEditor | |
GtkWidget * | mlview_editor_new (gchar *a_title, MlViewAppContext *a_context) |
Creates and returns a new instance of MlViewEditor. | |
void | mlview_editor_create_new_xml_document (MlViewEditor *a_editor) |
Interactively create a new document. | |
MlViewXMLDocumentView * | mlview_editor_create_new_view_on_document (MlViewEditor *a_editor, MlViewXMLDocument *a_xml_doc, enum MLVIEW_XML_DOC_VIEW_TYPE) |
Creates a new view on an existing document. | |
MlViewXMLDocumentView * | mlview_editor_create_new_view_on_current_document_interactive (MlViewEditor *a_editor) |
Interactively creates a new view on an existing xml document. | |
void | mlview_editor_load_xml_file (MlViewEditor *a_editor, gchar *a_file_path) |
Opens the xml file a_file_path, loads it, build a view to edit it and adds this new view to the editor. | |
void | mlview_editor_open_local_xml_document_interactive (MlViewEditor *editor) |
interactively open/edit a local xml file name. | |
void | mlview_editor_add_xml_document_view (MlViewEditor *a_editor, MlViewXMLDocumentView *a_xml_doc_view) |
Adds a document view to the editor. | |
void | mlview_editor_remove_xml_document_view (MlViewEditor *a_editor, MlViewXMLDocumentView *a_xml_doc_view) |
removes the document view a_xml_doc_view from the editor. | |
void | mlview_editor_set_current_view_name (MlViewEditor *a_editor, gchar *a_name) |
Setter of the name of the currently selected view. | |
void | mlview_editor_set_current_view_name_interactive (MlViewEditor *a_editor) |
Interactively sets the name of the view currently selected in the mlview editor. | |
void | mlview_editor_add_child_node_interactive (MlViewEditor *a_editor) |
Adds a child node to the currently selected node of the currently selected document view. | |
void | mlview_editor_insert_sibling_node_interactive (MlViewEditor *a_editor) |
void | mlview_editor_insert_prev_sibling_node_interactive (MlViewEditor *a_editor) |
Inserts a node as a previous sibling of the node currently selected in the view currently selected. | |
void | mlview_editor_insert_next_sibling_node_interactive (MlViewEditor *a_editor) |
Insert a node as the next sibling of the node currently selected in the view currently selected. | |
void | mlview_editor_cut_node (MlViewEditor *a_editor) |
Cuts the current selected node and it child subtree. | |
void | mlview_editor_copy_node (MlViewEditor *a_editor) |
Copy the current selected node and it children into the node clipboard. | |
xmlDocPtr | mlview_editor_get_current_xml_doc (MlViewEditor *a_editor) |
void | mlview_editor_edit_xml_document (MlViewEditor *a_editor, xmlDocPtr a_doc, gchar *a_doc_name) |
Edits the xml document given in argument. | |
void | mlview_editor_save_xml_document (MlViewEditor *a_editor) |
Interactively saves the underlying xml document of the currently selected document view. | |
void | mlview_editor_save_xml_document_as (MlViewEditor *a_editor, gchar *a_file_path) |
Classical "save as" functionnality. | |
void | mlview_editor_save_xml_document_as_interactive (MlViewEditor *a_editor) |
Interactively saves the underlying document of the currently selected view. | |
gchar * | mlview_editor_get_current_xml_doc_file_path (MlViewEditor *a_editor) |
Getter of the file path of the document associated to the currently selected view. | |
void | mlview_editor_close_xml_document_without_saving (MlViewEditor *a_editor) |
closes the current view without saving the underlying document. | |
void | mlview_editor_save_and_close_xml_document (MlViewEditor *a_editor) |
Saves the underlying document of the currently selected view and closes the view. | |
void | mlview_editor_close_xml_document_interactive (MlViewEditor *a_editor) |
Interactively closes the current document view. | |
void | mlview_editor_close_all_xml_documents_interactive (MlViewEditor *a_editor) |
Closes all the views (and their underlying documents). | |
void | mlview_editor_paste_node_as_prev_sibling (MlViewEditor *a_editor) |
Pastes the last copied/cut as the previous sibling node the of current selected node in the current selected view. | |
void | mlview_editor_paste_node_as_child (MlViewEditor *a_editor) |
pastes the last copied node as a child of the current selected node of the current selected view. | |
void | mlview_editor_paste_node_as_next_sibling (MlViewEditor *a_editor) |
Pastes the last copied/paste node as the next sibling node of the current selected node in the current selected view. | |
void | mlview_editor_expand_tree_to_depth_interactive (MlViewEditor *a_editor) |
Interactively expands the tree beneath the current selected node to the depth graphically selected by the user. | |
GtkCTreeNode * | mlview_editor_find_xml_node_that_contains_str_interactive (MlViewEditor *a_editor) |
Interactively Finds and xml node that contains a given string. | |
void | mlview_editor_edit_settings_interactive (MlViewEditor *a_editor) |
Interactively edits the editor settings. | |
MlViewFileSelection * | mlview_editor_get_file_selector (MlViewEditor *a_editor, gchar *a_title) |
gint | mlview_editor_associate_dtd_interactive (MlViewEditor *a_editor) |
Associates a dtd to the current mlview xml document. | |
gint | mlview_editor_validate (MlViewEditor *a_editor) |
validate the current selected document against the dtd it is associated to. | |
void | mlview_editor_set_app_context (MlViewEditor *a_editor, MlViewAppContext *a_context) |
The setter of the application context associated to the current mlview editor. | |
MlViewAppContext * | mlview_editor_get_app_context (MlViewEditor *a_editor) |
The getter of the application context associated to the current mlview editor. |
Definition in file mlview-editor.h.
|
Definition at line 44 of file mlview-editor.h. Referenced by mlview_app_new(), and mlview_editor_close_all_xml_documents_interactive(). |
|
Definition at line 45 of file mlview-editor.h. |
|
|
Definition at line 47 of file mlview-editor.h. |
|
Definition at line 43 of file mlview-editor.h. Referenced by mlview_editor_new(). |
|
Definition at line 50 of file mlview-editor.h. |
|
Definition at line 51 of file mlview-editor.h. |
|
Definition at line 49 of file mlview-editor.h. |
|
Definition at line 53 of file mlview-editor.h. Referenced by mlview_editor_create_new_view_on_document(). |
|
Adds a child node to the currently selected node of the currently selected document view. It displays a node type picker to let the user choose the type of node he wants.
Definition at line 1368 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_add_child_node_interactive(), and PRIVATE. |
|
Adds a document view to the editor. If a_xml_doc_view is a new document view, adds a new notebook page to the MlViewEditor notebook. The base name of the document is shown in the notebook page tab. If the underlying document of a_xml_doc_view has the same base name as a document already opened, the notebook page tab string will be "basename<nb>" where 'nb' is the number of docs that have the same name in the editor (like in emacs). If a_xml_doc_view is already loaded in the current instance of MlViewEditor, the old instance of a_xml_doc is destroyed (as well as the notebook page that contains it) and the new instance of a_xml_doc is added to the editor.
Definition at line 927 of file mlview-editor.c. References mlview_editor_remove_xml_document_view(), mlview_file_descriptor_get_file_path(), MLVIEW_IS_EDITOR, MLVIEW_IS_XML_DOCUMENT_VIEW, mlview_xml_doc_tree_view_set_all_paned_proportions(), mlview_xml_document_view_get_document(), mlview_xml_document_view_get_file_descriptor(), mlview_xml_document_view_set_name(), and PRIVATE. Referenced by mlview_editor_create_new_view_on_document(), mlview_editor_create_new_xml_document(), mlview_editor_edit_xml_document(), and mlview_editor_load_xml_file(). |
|
Associates a dtd to the current mlview xml document.
Definition at line 1860 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_document_associate_dtd_interactive(), mlview_xml_document_view_get_document(), and PRIVATE. |
|
Closes all the views (and their underlying documents). Save the documents if needed before closing the views.
Definition at line 1735 of file mlview-editor.c. References MLVIEW_EDITOR, mlview_editor_close_xml_document_interactive(), and PRIVATE. |
|
Interactively closes the current document view. Saves the underlying document if needed.
Definition at line 1767 of file mlview-editor.c. References mlview_app_context_set_window_icon(), mlview_editor_close_xml_document_without_saving(), mlview_editor_save_and_close_xml_document(), MLVIEW_IS_EDITOR, mlview_xml_document_needs_saving(), mlview_xml_document_view_get_document(), and PRIVATE. Referenced by mlview_editor_close_all_xml_documents_interactive(). |
|
closes the current view without saving the underlying document.
Definition at line 1672 of file mlview-editor.c. References mlview_editor_remove_xml_document_view(), MLVIEW_IS_EDITOR, and PRIVATE. Referenced by mlview_editor_close_xml_document_interactive(), and mlview_editor_save_and_close_xml_document(). |
|
Copy the current selected node and it children into the node clipboard.
Definition at line 1440 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_copy_node(), and PRIVATE. |
|
Interactively creates a new view on an existing xml document. The view will be created if and only if an non empty document is currently selected in the editor.
Definition at line 847 of file mlview-editor.c. References mlview_editor_create_new_view_on_document(), MLVIEW_IS_EDITOR, mlview_xml_document_view_get_document(), and PRIVATE. |
|
Creates a new view on an existing document.
Definition at line 809 of file mlview-editor.c. References mlview_editor_add_xml_document_view(), MLVIEW_IS_EDITOR, MLVIEW_IS_XML_DOCUMENT, MLVIEW_XML_DOC_VIEW_TYPE, MLVIEW_XML_DOCUMENT_VIEW, and PRIVATE. Referenced by mlview_editor_create_new_view_on_current_document_interactive(). |
|
Interactively create a new document. Asks the user for info like root element, dtd (if validation is switched on) ...etc.
Definition at line 1243 of file mlview-editor.c. References mlview_app_context_get_settings_value(), mlview_app_context_set_window_icon(), mlview_editor_add_xml_document_view(), MLVIEW_IS_EDITOR, mlview_xml_document_add_child_node(), mlview_xml_document_associate_dtd_interactive(), mlview_xml_document_new(), MLVIEW_XML_DOCUMENT_VIEW, PRIVATE, and utils_is_white_string(). |
|
Cuts the current selected node and it child subtree. The cut tree is put in the node clipboard.
Definition at line 1422 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_cut_node(), and PRIVATE. |
|
Interactively edits the editor settings.
Definition at line 1842 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_settings_manager_edit_settings_interactive(), and PRIVATE. |
|
Edits the xml document given in argument. Actually, this method creates a view on this document and adds the view to the editor.
Definition at line 1338 of file mlview-editor.c. References mlview_editor_add_xml_document_view(), MLVIEW_IS_EDITOR, mlview_xml_document_new(), MLVIEW_XML_DOCUMENT_VIEW, and PRIVATE. |
|
Interactively expands the tree beneath the current selected node to the depth graphically selected by the user.
Definition at line 1509 of file mlview-editor.c. References MLVIEW_IS_EDITOR, MLVIEW_IS_XML_DOC_TREE_VIEW, mlview_xml_doc_tree_view_expand_tree_to_depth_interactive(), and PRIVATE. |
|
Interactively Finds and xml node that contains a given string.
Definition at line 1825 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_find_xml_node_that_contains_str_interactive(), and PRIVATE. |
|
The getter of the application context associated to the current mlview editor.
Definition at line 690 of file mlview-editor.c. References MLVIEW_IS_EDITOR, and PRIVATE. |
|
|
|
Getter of the file path of the document associated to the currently selected view.
Definition at line 1530 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_document_get_file_path(), mlview_xml_document_view_get_document(), and PRIVATE. Referenced by mlview_editor_save_xml_document(). |
|
|
|
the standard type builder of MlViewEditor
Definition at line 602 of file mlview-editor.c. |
|
Insert a node as the next sibling of the node currently selected in the view currently selected.
Definition at line 1404 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_insert_next_sibling_node_interactive(), and PRIVATE. |
|
Inserts a node as a previous sibling of the node currently selected in the view currently selected.
Definition at line 1386 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_insert_prev_sibling_node_interactive(), and PRIVATE. |
|
|
|
Opens the xml file a_file_path, loads it, build a view to edit it and adds this new view to the editor.
Definition at line 708 of file mlview-editor.c. References mlview_app_context_sbar_pop_message(), mlview_app_context_sbar_push_message(), mlview_editor_add_xml_document_view(), MLVIEW_IS_EDITOR, mlview_xml_document_open(), MLVIEW_XML_DOCUMENT_VIEW, and PRIVATE. Referenced by main(), and mlview_editor_open_local_xml_document_interactive(). |
|
Creates and returns a new instance of MlViewEditor.
Definition at line 629 of file mlview-editor.c. References mlview_app_context_get_element(), mlview_settings_builder_build_settings(), mlview_settings_builder_get_settings_manager(), mlview_settings_builder_new(), MLVIEW_TYPE_EDITOR, and PRIVATE. Referenced by mlview_app_new(). |
|
interactively open/edit a local xml file name.
Definition at line 762 of file mlview-editor.c. References CANCEL_BUTTON, mlview_app_context_get_file_selector(), mlview_app_context_sbar_pop_message(), mlview_app_context_sbar_push_message(), mlview_app_context_set_window_icon(), mlview_editor_load_xml_file(), MLVIEW_FILE_SELECTION, mlview_file_selection_run(), MLVIEW_IS_EDITOR, MLVIEW_SELECTED_BUTTON, OK_BUTTON, PRIVATE, and WINDOW_CLOSED. |
|
pastes the last copied node as a child of the current selected node of the current selected view.
Definition at line 1459 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_paste_node_as_child(), and PRIVATE. |
|
Pastes the last copied/paste node as the next sibling node of the current selected node in the current selected view.
Definition at line 1492 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_paste_node_as_next_sibling(), and PRIVATE. |
|
Pastes the last copied/cut as the previous sibling node the of current selected node in the current selected view.
Definition at line 1475 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_doc_tree_view_paste_node_as_prev_sibling(), and PRIVATE. |
|
removes the document view a_xml_doc_view from the editor. This method does not save the document.
Definition at line 1129 of file mlview-editor.c. References mlview_file_descriptor_get_file_path(), MLVIEW_IS_EDITOR, MLVIEW_IS_XML_DOCUMENT_VIEW, mlview_xml_document_view_get_document(), mlview_xml_document_view_get_file_descriptor(), and PRIVATE. Referenced by mlview_editor_add_xml_document_view(), and mlview_editor_close_xml_document_without_saving(). |
|
Saves the underlying document of the currently selected view and closes the view.
Definition at line 1689 of file mlview-editor.c. References CANCEL_BUTTON, mlview_app_context_get_file_selector(), mlview_app_context_set_window_icon(), mlview_editor_close_xml_document_without_saving(), mlview_file_selection_run(), MLVIEW_IS_EDITOR, MLVIEW_SELECTED_BUTTON, mlview_xml_document_save_as(), mlview_xml_document_view_get_document(), OK_BUTTON, PRIVATE, and WINDOW_CLOSED. Referenced by mlview_editor_close_xml_document_interactive(). |
|
Interactively saves the underlying xml document of the currently selected document view. If the document has an associated file name, save it in that file or else, asks the user where to save it.
Definition at line 1554 of file mlview-editor.c. References mlview_editor_get_current_xml_doc_file_path(), mlview_editor_save_xml_document_as_interactive(), MLVIEW_IS_EDITOR, mlview_xml_document_save(), mlview_xml_document_view_get_document(), and PRIVATE. |
|
Classical "save as" functionnality. Saves the underlying document of the currently selected view into the file denoted by the file path a_file_path.
Definition at line 1586 of file mlview-editor.c. References mlview_app_context_sbar_pop_message(), mlview_app_context_sbar_push_message(), MLVIEW_IS_EDITOR, mlview_xml_document_save_as(), mlview_xml_document_view_get_document(), mlview_xml_document_view_get_file_descriptor(), mlview_xml_document_view_set_name(), and PRIVATE. Referenced by mlview_editor_save_xml_document_as_interactive(). |
|
Interactively saves the underlying document of the currently selected view. Graphically asks the user where to save the document and saves it.
Definition at line 1633 of file mlview-editor.c. References CANCEL_BUTTON, mlview_app_context_get_file_selector(), mlview_app_context_set_window_icon(), mlview_editor_save_xml_document_as(), mlview_file_selection_run(), MLVIEW_IS_EDITOR, MLVIEW_SELECTED_BUTTON, OK_BUTTON, PRIVATE, and WINDOW_CLOSED. Referenced by mlview_editor_save_xml_document(). |
|
The setter of the application context associated to the current mlview editor.
Definition at line 669 of file mlview-editor.c. References MLVIEW_IS_APP_CONTEXT, MLVIEW_IS_EDITOR, and PRIVATE. Referenced by mlview_app_new(). |
|
Setter of the name of the currently selected view.
Definition at line 875 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_document_view_set_name(), and PRIVATE. |
|
Interactively sets the name of the view currently selected in the mlview editor.
Definition at line 897 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_document_view_set_name_interactive(), and PRIVATE. |
|
validate the current selected document against the dtd it is associated to. If there is no dtd associated to the document, the functions asks the user to associate a dtd to it and then, does the validation
Definition at line 1888 of file mlview-editor.c. References MLVIEW_IS_EDITOR, mlview_xml_document_validate(), mlview_xml_document_view_get_document(), and PRIVATE. |