![]() |
![]() |
![]() |
Anjuta Developers Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <libanjuta/interfaces/ianjuta-document-manager.h> #define IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT enum IAnjutaDocumentManagerError; struct IAnjutaDocumentManagerIface; GQuark ianjuta_document_manager_error_quark (void
); void ianjuta_document_manager_add_bookmark (IAnjutaDocumentManager *obj
,GFile *file
,gint line
,GError **err
); IAnjutaEditor * ianjuta_document_manager_add_buffer (IAnjutaDocumentManager *obj
,const gchar *name
,const gchar *content
,GError **err
); void ianjuta_document_manager_add_document (IAnjutaDocumentManager *obj
,IAnjutaDocument *document
,GError **err
); IAnjutaDocument * ianjuta_document_manager_find_document_with_file (IAnjutaDocumentManager *obj
,GFile *file
,GError **err
); IAnjutaDocument * ianjuta_document_manager_get_current_document (IAnjutaDocumentManager *obj
,GError **err
); GList * ianjuta_document_manager_get_doc_widgets (IAnjutaDocumentManager *obj
,GError **err
); GFile * ianjuta_document_manager_get_file (IAnjutaDocumentManager *obj
,const gchar *filename
,GError **err
); IAnjutaEditor * ianjuta_document_manager_goto_file_line (IAnjutaDocumentManager *obj
,GFile *file
,gint lineno
,GError **err
); IAnjutaEditor * ianjuta_document_manager_goto_file_line_mark (IAnjutaDocumentManager *obj
,GFile *file
,gint lineno
,gboolean mark
,GError **err
); gboolean ianjuta_document_manager_remove_document (IAnjutaDocumentManager *obj
,IAnjutaDocument *document
,gboolean save_before
,GError **err
); void ianjuta_document_manager_set_current_document (IAnjutaDocumentManager *obj
,IAnjutaDocument *document
,GError **err
);
#define IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT "document_manager_current_document"
Anjuta shell value set by document manager to the current document
typedef enum { IANJUTA_DOCUMENT_MANAGER_DOESNT_EXIST } IAnjutaDocumentManagerError;
struct IAnjutaDocumentManagerIface { GTypeInterface g_iface; /* Signal */ void (*document_added) (IAnjutaDocumentManager *obj, IAnjutaDocument* doc); /* Signal */ void (*document_removed) (IAnjutaDocumentManager *obj, IAnjutaDocument* doc); void (*add_bookmark) (IAnjutaDocumentManager *obj, GFile* file, gint line, GError **err); IAnjutaEditor* (*add_buffer) (IAnjutaDocumentManager *obj, const gchar *name, const gchar* content, GError **err); void (*add_document) (IAnjutaDocumentManager *obj, IAnjutaDocument* document, GError **err); IAnjutaDocument* (*find_document_with_file) (IAnjutaDocumentManager *obj, GFile* file, GError **err); IAnjutaDocument* (*get_current_document) (IAnjutaDocumentManager *obj, GError **err); GList* (*get_doc_widgets) (IAnjutaDocumentManager *obj, GError **err); GFile* (*get_file) (IAnjutaDocumentManager *obj, const gchar *filename, GError **err); IAnjutaEditor* (*goto_file_line) (IAnjutaDocumentManager *obj, GFile* file, gint lineno, GError **err); IAnjutaEditor* (*goto_file_line_mark) (IAnjutaDocumentManager *obj, GFile* file, gint lineno, gboolean mark, GError **err); gboolean (*remove_document) (IAnjutaDocumentManager *obj, IAnjutaDocument *document, gboolean save_before, GError **err); void (*set_current_document) (IAnjutaDocumentManager *obj, IAnjutaDocument *document, GError **err); };
void ianjuta_document_manager_add_bookmark (IAnjutaDocumentManager *obj
,GFile *file
,gint line
,GError **err
);
IAnjutaEditor * ianjuta_document_manager_add_buffer (IAnjutaDocumentManager *obj
,const gchar *name
,const gchar *content
,GError **err
);
Creates a new editor buffer of the given name and sets the given content as its initial content.
|
Self |
|
Name of the editor buffer. |
|
Initial content of the buffer. |
|
Error propagation and reporting. |
Returns : |
the IAnjutaEditor instance that has been added. [transfer full] |
void ianjuta_document_manager_add_document (IAnjutaDocumentManager *obj
,IAnjutaDocument *document
,GError **err
);
Adds a document to the document manager. This will open a new Notebook tab and show the document there
|
Self |
|
the document to add |
|
Error propagation and reporting. |
IAnjutaDocument * ianjuta_document_manager_find_document_with_file (IAnjutaDocumentManager *obj
,GFile *file
,GError **err
);
Finds the document that has the file loaded. Only the editor that matches the file will be searched.
|
Self |
|
The file to find. |
|
Error propagation and reporting. |
Returns : |
the document that corresponds to given file. NULL if there is no editor loaded with this file. [transfer none] |
IAnjutaDocument * ianjuta_document_manager_get_current_document (IAnjutaDocumentManager *obj
,GError **err
);
Gets the current document.
|
Self |
|
Error propagation and reporting. |
Returns : |
the currently active document. NULL if none is there. [transfer none] |
GList * ianjuta_document_manager_get_doc_widgets (IAnjutaDocumentManager *obj
,GError **err
);
Gets a list of widgets for open documents. Each widget is a GTK_WIDGET(IAnjutaDocument*)
|
Self |
|
Error propagation and reporting. |
Returns : |
a list of widgets for all open documents. The returned list (but not the data in the list) must be freed after use. [element-type GtkWidget][transfer container] |
GFile * ianjuta_document_manager_get_file (IAnjutaDocumentManager *obj
,const gchar *filename
,GError **err
);
Given the short filename, finds the file of the filename, if the editor that has it loaded is found. If there is no editor that has this file opened, returns NULL.
|
Self |
|
short filename |
|
Error propagation and reporting. |
Returns : |
the GFile for the given short filename. [transfer full] |
IAnjutaEditor * ianjuta_document_manager_goto_file_line (IAnjutaDocumentManager *obj
,GFile *file
,gint lineno
,GError **err
);
Loads the given file if not loaded yet, set its editor as current editor and moves cursor to the given line in the editor.
|
Self |
|
file to go to. |
|
the line number in the file to go to. |
|
Error propagation and reporting. |
Returns : |
the editor where the mark has been put. NULL if none. [transfer none] |
IAnjutaEditor * ianjuta_document_manager_goto_file_line_mark (IAnjutaDocumentManager *obj
,GFile *file
,gint lineno
,gboolean mark
,GError **err
);
Loads the given file if not loaded yet, set its editor as current editor
and moves cursor to the given line in the editor. Optionally also marks
the line with line marker if mark
is given TRUE.
|
Self |
|
file to go to. |
|
the line number in the file to go to. |
|
TRUE if the line should be marked with a marker. |
|
Error propagation and reporting |
Returns : |
the editor where the mark has been put. NULL if none. [transfer none] |
gboolean ianjuta_document_manager_remove_document (IAnjutaDocumentManager *obj
,IAnjutaDocument *document
,gboolean save_before
,GError **err
);
Closes and removes the given document. If save_before
is TRUE, also
saves the document before closing.
|
Self |
|
Document to close. |
|
If true, saves the document before closing. |
|
Error propagation and reporting. |
Returns : |
TRUE if the document was removed, else FALSE. |
void ianjuta_document_manager_set_current_document (IAnjutaDocumentManager *obj
,IAnjutaDocument *document
,GError **err
);
Sets the given document as current document.
|
Self |
|
the document to set as current. |
|
Error propagation and reporting. |