CodeSlayer

CodeSlayer — The plugins context.

Synopsis

#include <codeslayer/codeslayer.h>

struct              CodeSlayer;
CodeSlayer *        codeslayer_new                      (GtkWindow *window,
                                                         CodeSlayerPreferences *preferences,
                                                         CodeSlayerProcesses *processes,
                                                         CodeSlayerMenuBar *menu_bar,
                                                         CodeSlayerNotebook *notebook,
                                                         CodeSlayerProjects *projects,
                                                         CodeSlayerProjectProperties *project_properties,
                                                         CodeSlayerSidePane *side_pane,
                                                         CodeSlayerBottomPane *bottom_pane,
                                                         CodeSlayerGroups *groups);
gboolean            codeslayer_select_editor            (CodeSlayer *codeslayer,
                                                         CodeSlayerDocument *document);
gboolean            codeslayer_select_editor_by_file_path
                                                        (CodeSlayer *codeslayer,
                                                         const gchar *file_path,
                                                         gint line_number);
CodeSlayerEditor *  codeslayer_get_active_editor        (CodeSlayer *codeslayer);
CodeSlayerDocument * codeslayer_get_active_editor_document
                                                        (CodeSlayer *codeslayer);
CodeSlayerProject * codeslayer_get_active_editor_project
                                                        (CodeSlayer *codeslayer);
const gchar *       codeslayer_get_active_editor_file_path
                                                        (CodeSlayer *codeslayer);
GList *             codeslayer_get_all_editors          (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 *menuitem);
void                codeslayer_add_to_menubar           (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);
void                codeslayer_remove_from_menu_bar     (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);
void                codeslayer_remove_from_menubar      (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);
void                codeslayer_add_to_projects_popup    (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);
void                codeslayer_remove_from_projects_popup
                                                        (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);
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_menubar_accel_group  (CodeSlayer *codeslayer);
GtkAccelGroup *     codeslayer_get_menu_bar_accel_group (CodeSlayer *codeslayer);
CodeSlayerGroup *   codeslayer_get_group                (CodeSlayer *codeslayer);
gchar *             codeslayer_get_group_config_folder_path
                                                        (CodeSlayer *codeslayer);
gchar *             codeslayer_get_project_config_folder_path
                                                        (CodeSlayer *codeslayer,
                                                         CodeSlayerProject *project);
gchar *             codeslayer_get_plugins_config_folder_path
                                                        (CodeSlayer *codeslayer);
CodeSlayerGroup *   codeslayer_get_active_group         (CodeSlayer *codeslayer);
gchar *             codeslayer_get_active_group_folder_path
                                                        (CodeSlayer *codeslayer);
gchar *             codeslayer_get_configuration_folder_path
                                                        (CodeSlayer *codeslayer);
CodeSlayerProject * codeslayer_get_project_by_file_path (CodeSlayer *codeslayer,
                                                         const gchar *file_path);
CodeSlayerPreferences * codeslayer_get_preferences      (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);
CodeSlayerEditorLinker * codeslayer_create_editor_linker
                                                        (CodeSlayer *codeslayer,
                                                         GtkTextView *text_view);
CodeSlayerEditorLinker * codeslayer_get_editor_linker   (CodeSlayer *codeslayer,
                                                         GtkTextView *text_view);

Object Hierarchy

  GObject
   +----CodeSlayer

Signals

  "editor-added"                                   : No Hooks
  "editor-removed"                                 : No Hooks
  "editor-saved"                                   : No Hooks
  "editor-switched"                                : No Hooks
  "editors-all-saved"                              : No Hooks
  "path-navigated"                                 : No Hooks
  "project-properties-opened"                      : No Hooks
  "project-properties-saved"                       : No Hooks
  "projects-changed"                               : No Hooks

Description

Details

struct CodeSlayer

struct CodeSlayer;

codeslayer_new ()

CodeSlayer *        codeslayer_new                      (GtkWindow *window,
                                                         CodeSlayerPreferences *preferences,
                                                         CodeSlayerProcesses *processes,
                                                         CodeSlayerMenuBar *menu_bar,
                                                         CodeSlayerNotebook *notebook,
                                                         CodeSlayerProjects *projects,
                                                         CodeSlayerProjectProperties *project_properties,
                                                         CodeSlayerSidePane *side_pane,
                                                         CodeSlayerBottomPane *bottom_pane,
                                                         CodeSlayerGroups *groups);

codeslayer_select_editor ()

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

Finds the editor based on the document file path. First it will find the document in the tree and then open up the editor in the notebook. It is Ok to call this method as much as you want because after the editor 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 editor is able to be found in the tree.

codeslayer_select_editor_by_file_path ()

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

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

codeslayer :

a CodeSlayer.

file_path :

the path to the editor to open.

line_number :

the line in the editor to scroll to.

Returns :

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

codeslayer_get_active_editor ()

CodeSlayerEditor *  codeslayer_get_active_editor        (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

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

codeslayer_get_active_editor_document ()

CodeSlayerDocument * codeslayer_get_active_editor_document
                                                        (CodeSlayer *codeslayer);

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

codeslayer :

a CodeSlayer.

Returns :

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

codeslayer_get_active_editor_project ()

CodeSlayerProject * codeslayer_get_active_editor_project
                                                        (CodeSlayer *codeslayer);

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

codeslayer :

a CodeSlayer.

Returns :

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

codeslayer_get_active_editor_file_path ()

const gchar *       codeslayer_get_active_editor_file_path
                                                        (CodeSlayer *codeslayer);

The file path for the active editor.

codeslayer :

a CodeSlayer.

Returns :

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

codeslayer_get_all_editors ()

GList *             codeslayer_get_all_editors          (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

a GList of CodeSlayerEditor. 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 *menuitem);

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

codeslayer :

a CodeSlayer.

menuitem :

a GtkMenuItem.

codeslayer_add_to_menubar ()

void                codeslayer_add_to_menubar           (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);

Add the given menu item to the menubar tools menu.

codeslayer :

a CodeSlayer.

menuitem :

a GtkMenuItem.

codeslayer_remove_from_menu_bar ()

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

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

codeslayer :

a CodeSlayer.

menuitem :

a GtkMenuItem.

codeslayer_remove_from_menubar ()

void                codeslayer_remove_from_menubar      (CodeSlayer *codeslayer,
                                                         GtkMenuItem *menuitem);

Remove the given menu item from the menubar tools menu.

codeslayer :

a CodeSlayer.

menuitem :

a GtkMenuItem.

codeslayer_add_to_projects_popup ()

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

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

codeslayer :

a CodeSlayer.

menuitem :

a GtkMenuItem.

codeslayer_remove_from_projects_popup ()

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

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

codeslayer :

a CodeSlayer.

menuitem :

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_menubar_accel_group ()

GtkAccelGroup *     codeslayer_get_menubar_accel_group  (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The GtkAccelGroup associated with the menu.

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_group ()

CodeSlayerGroup *   codeslayer_get_group                (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The CodeSlayerGroup that is currently opened.

codeslayer_get_group_config_folder_path ()

gchar *             codeslayer_get_group_config_folder_path
                                                        (CodeSlayer *codeslayer);

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

codeslayer :

a CodeSlayer.

Returns :

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

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_active_group ()

CodeSlayerGroup *   codeslayer_get_active_group         (CodeSlayer *codeslayer);

Warning

codeslayer_get_active_group has been deprecated since version 3.0 and should not be used in newly-written code. use codeslayer_get_group now.

codeslayer :

a CodeSlayer.

Returns :

The CodeSlayerGroup that is currently opened.

codeslayer_get_active_group_folder_path ()

gchar *             codeslayer_get_active_group_folder_path
                                                        (CodeSlayer *codeslayer);

Warning

codeslayer_get_active_group_folder_path has been deprecated since version 3.0 and should not be used in newly-written code. use codeslayer_get_group_config_folder_path now.

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

codeslayer :

a CodeSlayer.

Returns :

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

codeslayer_get_configuration_folder_path ()

gchar *             codeslayer_get_configuration_folder_path
                                                        (CodeSlayer *codeslayer);

Warning

codeslayer_get_configuration_folder_path has been deprecated since version 3.0 and should not be used in newly-written code. use codeslayer_get_plugins_config_folder_path now.

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_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_preferences ()

CodeSlayerPreferences * codeslayer_get_preferences      (CodeSlayer *codeslayer);

codeslayer :

a CodeSlayer.

Returns :

The CodeSlayerPreferences.

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_editor_linker ()

CodeSlayerEditorLinker * codeslayer_create_editor_linker
                                                        (CodeSlayer *codeslayer,
                                                         GtkTextView *text_view);

codeslayer :

a CodeSlayer.

text_view :

the text_view to create the links in.

Returns :

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

codeslayer_get_editor_linker ()

CodeSlayerEditorLinker * codeslayer_get_editor_linker   (CodeSlayer *codeslayer,
                                                         GtkTextView *text_view);

Warning

codeslayer_get_editor_linker has been deprecated since version 3.0 and should not be used in newly-written code. use codeslayer_create_editor_linker now.

codeslayer :

a CodeSlayer.

text_view :

the text_view to create the links in.

Returns :

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

Signal Details

The "editor-added" signal

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

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

codeslayer :

the plugin that received the signal

editor :

the CodeSlayerEditor that was added

user_data :

user data set when the signal handler was connected.

The "editor-removed" signal

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

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

codeslayer :

the plugin that received the signal

editor :

the CodeSlayerEditor that was removed

user_data :

user data set when the signal handler was connected.

The "editor-saved" signal

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

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

codeslayer :

the plugin that received the signal

editor :

the CodeSlayerEditor that was saved

user_data :

user data set when the signal handler was connected.

The "editor-switched" signal

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

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

codeslayer :

the plugin that received the signal

editor :

the CodeSlayerEditor switched to

user_data :

user data set when the signal handler was connected.

The "editors-all-saved" signal

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

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

codeslayer :

the plugin that received the signal

editors :

a GList of CodeSlayerEditor objects that were saved

user_data :

user data set when the signal handler was connected.

The "path-navigated" signal

void                user_function                      (CodeSlayer *codeslayer,
                                                        gchar      *from_file_path,
                                                        gint        from_line_number,
                                                        gchar      *to_file_path,
                                                        gint        to_line_number,
                                                        gpointer    user_data)             : No Hooks

The ::path-navigated signal is emitted when the editor is navigated to in the notebook

codeslayer :

the plugin that received the signal

from_file_path :

the file path navigated from

from_line_number :

the line number navigated from

to_file_path :

the file path navigated to

to_line_number :

the line number navigated to

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.