CodeSlayerDocument

CodeSlayerDocument — Represents the source file to create the source view.

Synopsis

#include <codeslayer/codeslayer-document.h>

struct              CodeSlayerDocument;
CodeSlayerDocument * codeslayer_document_new            (void);
const gchar *       codeslayer_document_get_name        (CodeSlayerDocument *document);
const gchar *       codeslayer_document_get_file_path   (CodeSlayerDocument *document);
void                codeslayer_document_set_file_path   (CodeSlayerDocument *document,
                                                         const gchar *file_path);
const gint          codeslayer_document_get_line_number (CodeSlayerDocument *document);
void                codeslayer_document_set_line_number (CodeSlayerDocument *document,
                                                         const gint line_number);
CodeSlayerProject * codeslayer_document_get_project     (CodeSlayerDocument *document);
void                codeslayer_document_set_project     (CodeSlayerDocument *document,
                                                         CodeSlayerProject *project);
GtkSourceView *     codeslayer_document_get_source_view (CodeSlayerDocument *document);
void                codeslayer_document_set_source_view (CodeSlayerDocument *document,
                                                         GtkSourceView *source_view);
GtkTreeRowReference * codeslayer_document_get_tree_row_reference
                                                        (CodeSlayerDocument *document);
void                codeslayer_document_set_tree_row_reference
                                                        (CodeSlayerDocument *document,
                                                         GtkTreeRowReference *tree_row_reference);

Object Hierarchy

  GObject
   +----CodeSlayerDocument

Properties

  "file-path"                gchar*                : Read / Write
  "line-number"              gint                  : Read / Write
  "name"                     gchar*                : Read / Write
  "project"                  CodeSlayerProject*    : Read / Write
  "source-view"              CodeSlayerSourceView*  : Read / Write
  "tree-row-reference"       gpointer              : Read / Write

Description

The document represents the source file loaded into the source view. 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 source view.

Details

struct CodeSlayerDocument

struct CodeSlayerDocument;

codeslayer_document_new ()

CodeSlayerDocument * codeslayer_document_new            (void);

Creates a new CodeSlayerDocument.

Returns :

a new CodeSlayerDocument.

codeslayer_document_get_name ()

const gchar *       codeslayer_document_get_name        (CodeSlayerDocument *document);

document :

a CodeSlayerDocument.

Returns :

the name of the document.

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_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 source view.

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 source view.

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.

codeslayer_document_get_source_view ()

GtkSourceView *     codeslayer_document_get_source_view (CodeSlayerDocument *document);

document :

a CodeSlayerDocument.

Returns :

the CodeSlayerSourceView that this document is attached to.

codeslayer_document_set_source_view ()

void                codeslayer_document_set_source_view (CodeSlayerDocument *document,
                                                         GtkSourceView *source_view);

document :

a CodeSlayerDocument.

source_view :

the CodeSlayerSourceView that this document is attached to.

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.

Property Details

The "file-path" property

  "file-path"                gchar*                : Read / Write

File Path.

Default value: ""


The "line-number" property

  "line-number"              gint                  : Read / Write

Line Number.

Allowed values: [0,100000]

Default value: 0


The "name" property

  "name"                     gchar*                : Read / Write

The name of the document.

Default value: ""


The "project" property

  "project"                  CodeSlayerProject*    : Read / Write

a CodeSlayerProject.


The "source-view" property

  "source-view"              CodeSlayerSourceView*  : Read / Write

CodeSlayerSourceView.


The "tree-row-reference" property

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

GtkTreeRowReference.