CodeSlayer

CodeSlayer — The plugins context.

Synopsis

#include <codeslayer/codeslayer.h>

#define             CODESLAYER_HOME
struct              CodeSlayer;
CodeSlayer *        codeslayer_new                      (GtkWindow *window,
                                                         CodeSlayerProfile *profile,
                                                         CodeSlayerProcesses *processes,
                                                         CodeSlayerMenuBar *menu_bar,
                                                         CodeSlayerNotebook *notebook,
                                                         CodeSlayerProjects *projects,
                                                         CodeSlayerProjectProperties *project_properties,
                                                         CodeSlayerSidePane *side_pane,
                                                         CodeSlayerBottomPane *bottom_pane);
gboolean            codeslayer_select_document          (CodeSlayer *codeslayer,
                                                         CodeSlayerDocument *document);
gboolean            codeslayer_select_document_by_file_path
                                                        (CodeSlayer *codeslayer,
                                                         const gchar *file_path,
                                                         gint line_number);
CodeSlayerDocument * codeslayer_get_active_document     (CodeSlayer *codeslayer);
const gchar *       codeslayer_get_active_document_file_path
                                                        (CodeSlayer *codeslayer);
CodeSlayerProject * codeslayer_get_active_document_project
                                                        (CodeSlayer *codeslayer);
GList *             codeslayer_get_all_documents        (CodeSlayer *codeslayer);
void                codeslayer_add_to_side_pane         (CodeSlayer *codeslayer,
                                                         GtkWidget *widget,
                                                         const gchar *title);
void                codeslayer_remove_from_side_pane    (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);
void                codeslayer_add_to_bottom_pane       (CodeSlayer *codeslayer,
                                                         GtkWidget *widget,
                                                         const gchar *title);
void                codeslayer_remove_from_bottom_pane  (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);
void                codeslayer_show_bottom_pane         (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);
void                codeslayer_show_side_pane           (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);
void                codeslayer_add_to_menu_bar          (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);
void                codeslayer_remove_from_menu_bar     (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);
void                codeslayer_add_to_projects_popup    (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);
void                codeslayer_remove_from_projects_popup
                                                        (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);
void                codeslayer_add_to_project_properties
                                                        (CodeSlayer *codeslayer,
                                                         GtkWidget *widget,
                                                         const gchar *title);
void                codeslayer_remove_from_project_properties
                                                        (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);
GtkAccelGroup *     codeslayer_get_menu_bar_accel_group (CodeSlayer *codeslayer);
gchar *             codeslayer_get_project_config_folder_path
                                                        (CodeSlayer *codeslayer,
                                                         CodeSlayerProject *project);
gchar *             codeslayer_get_plugins_config_folder_path
                                                        (CodeSlayer *codeslayer);
gchar *             codeslayer_get_profile_config_folder_path
                                                        (CodeSlayer *codeslayer);
CodeSlayerProject * codeslayer_get_project_by_file_path (CodeSlayer *codeslayer,
                                                         const gchar *file_path);
CodeSlayerRegistry * codeslayer_get_registry            (CodeSlayer *codeslayer);
GList *             codeslayer_get_projects             (CodeSlayer *codeslayer);
GtkWindow *         codeslayer_get_toplevel_window      (CodeSlayer *codeslayer);
gint                codeslayer_add_to_process_bar       (CodeSlayer *codeslayer,
                                                         const gchar *name,
                                                         StopProcessFunc func,
                                                         gpointer data);
void                codeslayer_remove_from_process_bar  (CodeSlayer *codeslayer,
                                                         gint id);
CodeSlayerDocumentLinker * codeslayer_create_document_linker
                                                        (CodeSlayer *codeslayer,
                                                         GtkTextView *text_view);

Object Hierarchy

  GObject
   +----CodeSlayer

Signals

  "document-added"                                 : No Hooks
  "document-removed"                               : No Hooks
  "document-saved"                                 : No Hooks
  "document-switched"                              : No Hooks
  "documents-all-saved"                            : No Hooks
  "project-properties-opened"                      : No Hooks
  "project-properties-saved"                       : No Hooks
  "projects-changed"                               : No Hooks

Description

Details

CODESLAYER_HOME

#define CODESLAYER_HOME ".codeslayer"

struct CodeSlayer

struct CodeSlayer;

codeslayer_new ()

CodeSlayer *        codeslayer_new                      (GtkWindow *window,
                                                         CodeSlayerProfile *profile,
                                                         CodeSlayerProcesses *processes,
                                                         CodeSlayerMenuBar *menu_bar,
                                                         CodeSlayerNotebook *notebook,
                                                         CodeSlayerProjects *projects,
                                                         CodeSlayerProjectProperties *project_properties,
                                                         CodeSlayerSidePane *side_pane,
                                                         CodeSlayerBottomPane *bottom_pane);

codeslayer_select_document ()

gboolean            codeslayer_select_document          (CodeSlayer *codeslayer,
                                                         CodeSlayerDocument *document);

Finds the document based on the file path. First it will find the document in the tree and then open up the document in the notebook. It is Ok to call this method as much as you want because after the document is initially loaded up then subsequent calls are very efficient.

The minimum document attribute that needs to be filled in is the file_path.

codeslayer :

a CodeSlayer.

document :

a CodeSlayerDocument.

Returns :

is TRUE if the document is able to be found in the tree.

codeslayer_select_document_by_file_path ()

gboolean            codeslayer_select_document_by_file_path
                                                        (CodeSlayer *codeslayer,
                                                         const gchar *file_path,
                                                         gint line_number);

Finds the document based on the file path. First it will find the document in the tree and then open up the document in the notebook. It is Ok to call this method as much as you want because after the document is initially loaded up then subsequent calls are very efficient.

codeslayer :

a CodeSlayer.

file_path :

the path to the document to open.

line_number :

the line in the document to scroll to.

Returns :

is TRUE if the document is able to be found in the tree.

codeslayer_get_active_document ()

CodeSlayerDocument * codeslayer_get_active_document     (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The document in the notebook that has focus. Will return NULL if there is no active document.

codeslayer_get_active_document_file_path ()

const gchar *       codeslayer_get_active_document_file_path
                                                        (CodeSlayer *codeslayer);

The file path for the active document.

codeslayer :

a CodeSlayer.

Returns :

a string that is owned by the document and should not be freed.

codeslayer_get_active_document_project ()

CodeSlayerProject * codeslayer_get_active_document_project
                                                        (CodeSlayer *codeslayer);

This is a convenience function so that you can easily get at the project associated with the active document.

codeslayer :

a CodeSlayer.

Returns :

The project that is associated with the active document. Will return NULL if there is no active document.

codeslayer_get_all_documents ()

GList *             codeslayer_get_all_documents        (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

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

codeslayer_add_to_side_pane ()

void                codeslayer_add_to_side_pane         (CodeSlayer *codeslayer,
                                                         GtkWidget *widget,
                                                         const gchar *title);

Add the given widget to the side pane.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

title :

the title for the tab.

codeslayer_remove_from_side_pane ()

void                codeslayer_remove_from_side_pane    (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);

Remove the given widget from the side pane.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

codeslayer_add_to_bottom_pane ()

void                codeslayer_add_to_bottom_pane       (CodeSlayer *codeslayer,
                                                         GtkWidget *widget,
                                                         const gchar *title);

Add the given widget to the bottom pane.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

title :

the title for the tab.

codeslayer_remove_from_bottom_pane ()

void                codeslayer_remove_from_bottom_pane  (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);

Remove the given widget from the bottom pane.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

codeslayer_show_bottom_pane ()

void                codeslayer_show_bottom_pane         (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);

Show the bottom pane and display the tab with the given widget. This should be the same widget that you added to the bottom pane.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

codeslayer_show_side_pane ()

void                codeslayer_show_side_pane           (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);

Show the side pane and display the tab with the given widget. This should be the same widget that you added to the side pane.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

codeslayer_add_to_menu_bar ()

void                codeslayer_add_to_menu_bar          (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);

Add the given menu item to the menu bar tools menu.

codeslayer :

a CodeSlayer.

menu_item :

a GtkMenuItem.

codeslayer_remove_from_menu_bar ()

void                codeslayer_remove_from_menu_bar     (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);

Remove the given menu item from the menu bar tools menu.

codeslayer :

a CodeSlayer.

menu_item :

a GtkMenuItem.

codeslayer_add_to_projects_popup ()

void                codeslayer_add_to_projects_popup    (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);

Add the given menu item to the projects tree tools menu.

codeslayer :

a CodeSlayer.

menu_item :

a GtkMenuItem.

codeslayer_remove_from_projects_popup ()

void                codeslayer_remove_from_projects_popup
                                                        (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menu_item);

Remove the given menu item from the projects tree tools menu.

codeslayer :

a CodeSlayer.

menu_item :

a GtkMenuItem.

codeslayer_add_to_project_properties ()

void                codeslayer_add_to_project_properties
                                                        (CodeSlayer *codeslayer,
                                                         GtkWidget *widget,
                                                         const gchar *title);

Add the given widget to the project properties.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

title :

the title for the tab.

codeslayer_remove_from_project_properties ()

void                codeslayer_remove_from_project_properties
                                                        (CodeSlayer *codeslayer,
                                                         GtkWidget *widget);

Remove the given widget to the project properties.

codeslayer :

a CodeSlayer.

widget :

a GtkWidget.

codeslayer_get_menu_bar_accel_group ()

GtkAccelGroup *     codeslayer_get_menu_bar_accel_group (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The GtkAccelGroup associated with the menu.

codeslayer_get_project_config_folder_path ()

gchar *             codeslayer_get_project_config_folder_path
                                                        (CodeSlayer *codeslayer,
                                                         CodeSlayerProject *project);

The folder path to where you should place project configuration files.

codeslayer :

a CodeSlayer.

project :

a CodeSlayerProject.

Returns :

a newly-allocated string that must be freed with g_free().

codeslayer_get_plugins_config_folder_path ()

gchar *             codeslayer_get_plugins_config_folder_path
                                                        (CodeSlayer *codeslayer);

The folder path to where you should place plugin configuration files.

codeslayer :

a CodeSlayer.

Returns :

a newly-allocated string that must be freed with g_free().

codeslayer_get_profile_config_folder_path ()

gchar *             codeslayer_get_profile_config_folder_path
                                                        (CodeSlayer *codeslayer);

The folder path to where you should place profile configuration files.

codeslayer :

a CodeSlayer.

Returns :

a newly-allocated string that must be freed with g_free().

codeslayer_get_project_by_file_path ()

CodeSlayerProject * codeslayer_get_project_by_file_path (CodeSlayer *codeslayer,
                                                         const gchar *file_path);

codeslayer :

a CodeSlayer.

file_path :

the file path to match against the projects folder path.

Returns :

The CodeSlayerProject if found, otherwise NULL.

codeslayer_get_registry ()

CodeSlayerRegistry * codeslayer_get_registry            (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The CodeSlayerRegistry.

codeslayer_get_projects ()

GList *             codeslayer_get_projects             (CodeSlayer *codeslayer);

codeslayer_get_toplevel_window ()

GtkWindow *         codeslayer_get_toplevel_window      (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The outer most GtkWindow that codeslayer uses.

codeslayer_add_to_process_bar ()

gint                codeslayer_add_to_process_bar       (CodeSlayer *codeslayer,
                                                         const gchar *name,
                                                         StopProcessFunc func,
                                                         gpointer data);

codeslayer :

a CodeSlayer.

name :

the name of the process.

func :

a StopProcessFunc is a callback to request that the process be stopped

data :

user data supplied to the StopProcessFunc

Returns :

The identifier for the process.

codeslayer_remove_from_process_bar ()

void                codeslayer_remove_from_process_bar  (CodeSlayer *codeslayer,
                                                         gint id);

codeslayer_create_document_linker ()

CodeSlayerDocumentLinker * codeslayer_create_document_linker
                                                        (CodeSlayer *codeslayer,
                                                         GtkTextView *text_view);

codeslayer :

a CodeSlayer.

text_view :

the text_view to create the links in.

Returns :

Creates a new CodeSlayerDocumentLinker. You must free this with g_object_unref() when done with it.

Signal Details

The "document-added" signal

void                user_function                      (CodeSlayer         *codeslayer,
                                                        CodeSlayerDocument *document,
                                                        gpointer            user_data)       : No Hooks

The ::document-added signal is emitted when the document is added to the notebook

codeslayer :

the plugin that received the signal

document :

the CodeSlayerSourceView that was added

user_data :

user data set when the signal handler was connected.

The "document-removed" signal

void                user_function                      (CodeSlayer         *codeslayer,
                                                        CodeSlayerDocument *document,
                                                        gpointer            user_data)       : No Hooks

The ::document-removed signal is emitted when the document is removed from the notebook

codeslayer :

the plugin that received the signal

document :

the CodeSlayerSourceView that was removed

user_data :

user data set when the signal handler was connected.

The "document-saved" signal

void                user_function                      (CodeSlayer         *codeslayer,
                                                        CodeSlayerDocument *document,
                                                        gpointer            user_data)       : No Hooks

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

codeslayer :

the plugin that received the signal

document :

the CodeSlayerSourceView that was saved

user_data :

user data set when the signal handler was connected.

The "document-switched" signal

void                user_function                      (CodeSlayer         *codeslayer,
                                                        CodeSlayerDocument *document,
                                                        gpointer            user_data)       : No Hooks

The ::document-switched signal is emitted when the active document is switched in the notebook

codeslayer :

the plugin that received the signal

document :

the CodeSlayerSourceView switched to

user_data :

user data set when the signal handler was connected.

The "documents-all-saved" signal

void                user_function                      (CodeSlayer *codeslayer,
                                                        gpointer    documents,
                                                        gpointer    user_data)       : No Hooks

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

codeslayer :

the plugin 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 "project-properties-opened" signal

void                user_function                      (CodeSlayer        *codeslayer,
                                                        CodeSlayerProject *project_properties,
                                                        gpointer           user_data)               : No Hooks

The ::project-properties-opened signal is emitted when the project properties window is opened

codeslayer :

the plugin that received the signal

project_properties :

the CodeSlayerProjectProperties switched to

user_data :

user data set when the signal handler was connected.

The "project-properties-saved" signal

void                user_function                      (CodeSlayer        *codeslayer,
                                                        CodeSlayerProject *project_properties,
                                                        gpointer           user_data)               : No Hooks

The ::project-properties-saved signal is emitted when the project properties window is closed

codeslayer :

the plugin that received the signal

project_properties :

the CodeSlayerProjectProperties switched to

user_data :

user data set when the signal handler was connected.

The "projects-changed" signal

void                user_function                      (CodeSlayer *codeslayer,
                                                        gpointer    user_data)       : No Hooks

The ::projects-changed signal is invoked when the projects structure changed.

codeslayer :

the plugin that received the signal

user_data :

user data set when the signal handler was connected.