![]() |
![]() |
![]() |
CodeSlayer Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <codeslayer/codeslayer-document.h> struct CodeSlayerDocument; CodeSlayerDocument * codeslayer_document_new (void
); const gint codeslayer_document_get_line_number (CodeSlayerDocument *document
); void codeslayer_document_set_line_number (CodeSlayerDocument *document
,const gint line_number
); GtkTreeRowReference * codeslayer_document_get_tree_row_reference (CodeSlayerDocument *document
); void codeslayer_document_set_tree_row_reference (CodeSlayerDocument *document
,GtkTreeRowReference *tree_row_reference
); const gchar * codeslayer_document_get_file_path (CodeSlayerDocument *document
); void codeslayer_document_set_file_path (CodeSlayerDocument *document
,const gchar *file_path
); const gboolean codeslayer_document_get_active (CodeSlayerDocument *document
); void codeslayer_document_set_active (CodeSlayerDocument *document
,const gboolean active
); CodeSlayerProject * codeslayer_document_get_project (CodeSlayerDocument *document
); void codeslayer_document_set_project (CodeSlayerDocument *document
,CodeSlayerProject *project
);
"active" gboolean : Read / Write "file-path" gchar* : Read / Write "line-number" gint : Read / Write "project" CodeSlayerProject* : Read / Write "tree-row-reference" gpointer : Read / Write
The document represents the source file loaded into the editor. This
abstraction is very useful because you can create a document and then
pass it to the codeslayer_projects_select_document()
method.
This in turn selects the document in the projects tree and adds a page in
the notebook. It also automatically takes into account features like the
documents line number. This means that if you load a document that has
the line number specified it will load the document and the scroll to the
proper line in the editor.
CodeSlayerDocument * codeslayer_document_new (void
);
Creates a new CodeSlayerDocument.
Returns : |
a new CodeSlayerDocument. |
const gint codeslayer_document_get_line_number (CodeSlayerDocument *document
);
|
a CodeSlayerDocument. |
Returns : |
the line number to scroll to when loaded into the editor. |
void codeslayer_document_set_line_number (CodeSlayerDocument *document
,const gint line_number
);
|
a CodeSlayerDocument. |
|
the line number to scroll to when loaded into the editor. |
GtkTreeRowReference * codeslayer_document_get_tree_row_reference
(CodeSlayerDocument *document
);
|
a CodeSlayerDocument. |
Returns : |
the GtkTreeRowReference within the projects tree. |
void codeslayer_document_set_tree_row_reference (CodeSlayerDocument *document
,GtkTreeRowReference *tree_row_reference
);
|
a CodeSlayerDocument. |
|
a GtkTreeRowReference so the document can keep its position within the projects tree. |
const gchar * codeslayer_document_get_file_path (CodeSlayerDocument *document
);
|
a CodeSlayerDocument. |
Returns : |
the fully qualified path to the document. |
void codeslayer_document_set_file_path (CodeSlayerDocument *document
,const gchar *file_path
);
Note: this is not a URI, but rather a normal file path.
|
a CodeSlayerDocument. |
|
the fully qualified path to the document. |
const gboolean codeslayer_document_get_active (CodeSlayerDocument *document
);
Note: this is only used when the active group is first loaded up so that the corresponding editor is selected. After that it is not updated until the active group is saved.
|
a CodeSlayerDocument. |
Returns : |
is TRUE if this is the active document in the project. |
void codeslayer_document_set_active (CodeSlayerDocument *document
,const gboolean active
);
|
a CodeSlayerDocument. |
|
TRUE if this is the active document in the project. |
CodeSlayerProject * codeslayer_document_get_project (CodeSlayerDocument *document
);
|
a CodeSlayerDocument. |
Returns : |
the CodeSlayerProject that this document is a part of. |
void codeslayer_document_set_project (CodeSlayerDocument *document
,CodeSlayerProject *project
);
|
a CodeSlayerDocument. |
|
the CodeSlayerProject that this document is a part of. |
"active"
property"active" gboolean : Read / Write
The currently selected document.
Default value: FALSE
"file-path"
property"file-path" gchar* : Read / Write
The fully qualified file path where the document is located.
Default value: ""
"line-number"
property"line-number" gint : Read / Write
The line that the editor should scroll to.
Allowed values: [0,100000]
Default value: 0
"tree-row-reference"
property"tree-row-reference" gpointer : Read / Write
The reference to the node in the tree.