CodeSlayerNotebook

CodeSlayerNotebook — Contains the pages.

Synopsis

#include <codeslayer/codeslayer-notebook.h>

struct              CodeSlayerNotebook;
GtkWidget *         codeslayer_notebook_new             (GtkWindow *window,
                                                         CodeSlayerProfile *profile);
void                codeslayer_notebook_add_document    (CodeSlayerNotebook *notebook,
                                                         CodeSlayerDocument *document);
gboolean            codeslayer_notebook_select_document (CodeSlayerNotebook *notebook,
                                                         CodeSlayerDocument *document);
void                codeslayer_notebook_save_document   (CodeSlayerNotebook *notebook,
                                                         gint page_num);
void                codeslayer_notebook_save_all_documents
                                                        (CodeSlayerNotebook *notebook);
gboolean            codeslayer_notebook_has_unsaved_documents
                                                        (CodeSlayerNotebook *notebook);
gboolean            codeslayer_notebook_has_open_documents
                                                        (CodeSlayerNotebook *notebook);
gboolean            codeslayer_notebook_close_document  (CodeSlayerNotebook *notebook,
                                                         gint page_num);
void                codeslayer_notebook_close_all_documents
                                                        (CodeSlayerNotebook *notebook);
GtkWidget *         codeslayer_notebook_get_active_source_view
                                                        (CodeSlayerNotebook *notebook);
GList *             codeslayer_notebook_get_all_source_views
                                                        (CodeSlayerNotebook *notebook);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkNotebook
                           +----CodeSlayerNotebook

Implemented Interfaces

CodeSlayerNotebook implements AtkImplementorIface and GtkBuildable.

Signals

  "document-saved"                                 : No Hooks
  "documents-all-saved"                            : No Hooks
  "select-document"                                : No Hooks
  "sync-notebook"                                  : No Hooks

Description

A notebook which contains pages of documents to edit.

Details

struct CodeSlayerNotebook

struct CodeSlayerNotebook;

codeslayer_notebook_new ()

GtkWidget *         codeslayer_notebook_new             (GtkWindow *window,
                                                         CodeSlayerProfile *profile);

Creates a new CodeSlayerNotebook.

window :

a GtkWindow.

profile :

a CodeSlayerProfile.

Returns :

a new CodeSlayerNotebook.

codeslayer_notebook_add_document ()

void                codeslayer_notebook_add_document    (CodeSlayerNotebook *notebook,
                                                         CodeSlayerDocument *document);

Add a new page to the notebook based on the document. This method is for internal use only.

notebook :

a CodeSlayerNotebook.

document :

a CodeSlayerDocument.

codeslayer_notebook_select_document ()

gboolean            codeslayer_notebook_select_document (CodeSlayerNotebook *notebook,
                                                         CodeSlayerDocument *document);

notebook :

a CodeSlayerNotebook.

document :

a CodeSlayerDocument.

Returns :

is TRUE if the document is able to be found.

codeslayer_notebook_save_document ()

void                codeslayer_notebook_save_document   (CodeSlayerNotebook *notebook,
                                                         gint page_num);

notebook :

a CodeSlayerNotebook.

page_num :

the notebook page to save.

codeslayer_notebook_save_all_documents ()

void                codeslayer_notebook_save_all_documents
                                                        (CodeSlayerNotebook *notebook);

notebook :

a CodeSlayerNotebook.

codeslayer_notebook_has_unsaved_documents ()

gboolean            codeslayer_notebook_has_unsaved_documents
                                                        (CodeSlayerNotebook *notebook);

notebook :

a CodeSlayerNotebook.

Returns :

is FALSE unless there are documents that need to saved.

codeslayer_notebook_has_open_documents ()

gboolean            codeslayer_notebook_has_open_documents
                                                        (CodeSlayerNotebook *notebook);

notebook :

a CodeSlayerNotebook.

Returns :

is TRUE if there are documents open in the notebook.

codeslayer_notebook_close_document ()

gboolean            codeslayer_notebook_close_document  (CodeSlayerNotebook *notebook,
                                                         gint page_num);

notebook :

a CodeSlayerNotebook.

page_num :

the notebook page to close. Pages begin with 0 starting from the left.

Returns :

is TRUE unless the document needs to be saved. If the document needs to be saved then the page will not be closed and this method will return FALSE.

codeslayer_notebook_close_all_documents ()

void                codeslayer_notebook_close_all_documents
                                                        (CodeSlayerNotebook *notebook);

notebook :

a CodeSlayerNotebook.

codeslayer_notebook_get_active_source_view ()

GtkWidget *         codeslayer_notebook_get_active_source_view
                                                        (CodeSlayerNotebook *notebook);

notebook :

a CodeSlayerNotebook.

Returns :

the active source view.

codeslayer_notebook_get_all_source_views ()

GList *             codeslayer_notebook_get_all_source_views
                                                        (CodeSlayerNotebook *notebook);

notebook :

a CodeSlayerNotebook.

Returns :

a GList of CodeSlayerSourceView. Note: you need to call g_list_free when you are done with the list.

Signal Details

The "document-saved" signal

void                user_function                      (CodeSlayerNotebook *codeslayernotebook,
                                                        gpointer            arg1,
                                                        gpointer            user_data)               : No Hooks

The ::document-saved signal is emitted when an document is saved successfully

codeslayernotebook :

the notebook that received the signal

user_data :

user data set when the signal handler was connected.

The "documents-all-saved" signal

void                user_function                      (CodeSlayerNotebook *codeslayernotebook,
                                                        gpointer            documents,
                                                        gpointer            user_data)               : No Hooks

The ::documents-all-saved signal is emitted when all the documents have been saved successfully

codeslayernotebook :

the notebook that received the signal

documents :

a GList of CodeSlayerSourceView objects that were saved

user_data :

user data set when the signal handler was connected.

The "select-document" signal

void                user_function                      (CodeSlayerNotebook *codeslayernotebook,
                                                        guint               arg1,
                                                        gpointer            user_data)               : No Hooks

The ::document-saved signal is emitted when an document is saved successfully

codeslayernotebook :

the notebook that received the signal

user_data :

user data set when the signal handler was connected.

The "sync-notebook" signal

void                user_function                      (CodeSlayerNotebook *codeslayernotebook,
                                                        gpointer            user_data)               : No Hooks

The ::sync-notebook signal is emitted when the notebook should sync up.

codeslayernotebook :

the notebook that received the signal

user_data :

user data set when the signal handler was connected.