CodeSlayerDocument

CodeSlayerDocument — Represents the source file to create the editor.

Synopsis

#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);

Object Hierarchy

  GObject
   +----CodeSlayerDocument

Properties

  "active"                   gboolean              : Read / Write
  "file-path"                gchar*                : Read / Write
  "line-number"              gint                  : Read / Write
  "project"                  CodeSlayerProject*    : Read / Write
  "project-key"              gchar*                : Read / Write
  "tree-row-reference"       gpointer              : Read / Write

Description

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.

Details

struct CodeSlayerDocument

struct CodeSlayerDocument;

codeslayer_document_new ()

CodeSlayerDocument * codeslayer_document_new            (void);

Creates a new CodeSlayerDocument.

Returns :

a new CodeSlayerDocument.

codeslayer_document_get_line_number ()

const gint          codeslayer_document_get_line_number (CodeSlayerDocument *document);

document :

a CodeSlayerDocument.

Returns :

the line number to scroll to when loaded into the editor.

codeslayer_document_set_line_number ()

void                codeslayer_document_set_line_number (CodeSlayerDocument *document,
                                                         const gint line_number);

document :

a CodeSlayerDocument.

line_number :

the line number to scroll to when loaded into the editor.

codeslayer_document_get_tree_row_reference ()

GtkTreeRowReference * codeslayer_document_get_tree_row_reference
                                                        (CodeSlayerDocument *document);

document :

a CodeSlayerDocument.

Returns :

the GtkTreeRowReference within the projects tree.

codeslayer_document_set_tree_row_reference ()

void                codeslayer_document_set_tree_row_reference
                                                        (CodeSlayerDocument *document,
                                                         GtkTreeRowReference *tree_row_reference);

document :

a CodeSlayerDocument.

tree_row_reference :

a GtkTreeRowReference so the document can keep its position within the projects tree.

codeslayer_document_get_file_path ()

const gchar *       codeslayer_document_get_file_path   (CodeSlayerDocument *document);

document :

a CodeSlayerDocument.

Returns :

the fully qualified path to the document.

codeslayer_document_set_file_path ()

void                codeslayer_document_set_file_path   (CodeSlayerDocument *document,
                                                         const gchar *file_path);

Note: this is not a URI, but rather a normal file path.

document :

a CodeSlayerDocument.

file_path :

the fully qualified path to the document.

codeslayer_document_get_active ()

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.

document :

a CodeSlayerDocument.

Returns :

is TRUE if this is the active document in the project.

codeslayer_document_set_active ()

void                codeslayer_document_set_active      (CodeSlayerDocument *document,
                                                         const gboolean active);

document :

a CodeSlayerDocument.

active :

TRUE if this is the active document in the project.

codeslayer_document_get_project ()

CodeSlayerProject * codeslayer_document_get_project     (CodeSlayerDocument *document);

document :

a CodeSlayerDocument.

Returns :

the CodeSlayerProject that this document is a part of.

codeslayer_document_set_project ()

void                codeslayer_document_set_project     (CodeSlayerDocument *document,
                                                         CodeSlayerProject *project);

document :

a CodeSlayerDocument.

project :

the CodeSlayerProject that this document is a part of.

Property Details

The "active" property

  "active"                   gboolean              : Read / Write

The currently selected document.

Default value: FALSE


The "file-path" property

  "file-path"                gchar*                : Read / Write

The fully qualified file path where the document is located.

Default value: ""


The "line-number" property

  "line-number"              gint                  : Read / Write

The line that the editor should scroll to.

Allowed values: [0,100000]

Default value: 0


The "project" property

  "project"                  CodeSlayerProject*    : Read / Write

a CodeSlayerProject.


The "project-key" property

  "project-key"              gchar*                : Read / Write

Project Key.

Default value: ""


The "tree-row-reference" property

  "tree-row-reference"       gpointer              : Read / Write

The reference to the node in the tree.