geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

project.c File Reference
#include "project.h"
#include "app.h"
#include "build.h"
#include "dialogs.h"
#include "document.h"
#include "editor.h"
#include "filetypesprivate.h"
#include "geanyobject.h"
#include "keyfile.h"
#include "main.h"
#include "projectprivate.h"
#include "sidebar.h"
#include "stash.h"
#include "support.h"
#include "ui_utils.h"
#include "utils.h"
#include "win32.h"
#include <string.h>
#include <unistd.h>
#include <errno.h>
Include dependency graph for project.c:

Go to the source code of this file.


struct  _PropertyDialogElements


#define SHOW_ERR(args)   dialogs_show_msgbox(GTK_MESSAGE_ERROR, args)
#define SHOW_ERR1(args, more)   dialogs_show_msgbox(GTK_MESSAGE_ERROR, args, more)
#define MAX_NAME_LEN   50
#define PROJECT_DIR   _("projects")
#define COPY_PREF(dest, prefname)    (dest.prefname = priv.prefname)


typedef struct _PropertyDialogElements PropertyDialogElements


static gboolean update_config (const PropertyDialogElements *e, gboolean new_project)
static void on_file_save_button_clicked (GtkButton *button, PropertyDialogElements *e)
static gboolean load_config (const gchar *filename)
static gboolean write_config (void)
static void on_name_entry_changed (GtkEditable *editable, PropertyDialogElements *e)
static void on_entries_changed (GtkEditable *editable, PropertyDialogElements *e)
static void on_radio_long_line_custom_toggled (GtkToggleButton *radio, GtkWidget *spin_long_line)
static void run_new_dialog (PropertyDialogElements *e)
static void apply_editor_prefs (void)
static void init_stash_prefs (void)
static void destroy_project (gboolean open_default)
static gboolean have_session_docs (void)
static gboolean handle_current_session (void)
void project_new (void)
gboolean project_load_file_with_session (const gchar *locale_file_name)
static void run_open_dialog (GtkDialog *dialog)
void project_open (void)
static void update_ui (void)
static void remove_foreach_project_filetype (gpointer data, gpointer user_data)
gboolean project_close (gboolean open_default)
static void on_project_properties_base_path_button_clicked (GtkWidget *button, GtkWidget *base_path_entry)
static void insert_build_page (PropertyDialogElements *e)
static void create_properties_dialog (PropertyDialogElements *e)
static void show_project_properties (gboolean show_build)
void project_properties (void)
void project_build_properties (void)
gboolean project_ask_close (void)
static GeanyProjectcreate_project (void)
static void run_dialog (GtkWidget *dialog, GtkWidget *entry)
gboolean project_load_file (const gchar *locale_file_name)
void project_write_config (void)
 Forces the project file rewrite and emission of the project-save signal. More...
gchar * project_get_base_path (void)
void project_save_prefs (GKeyFile *config)
void project_load_prefs (GKeyFile *config)
void project_setup_prefs (void)
void project_apply_prefs (void)
static void add_stash_group (StashGroup *group, gboolean apply_defaults)
const GeanyFilePrefsproject_get_file_prefs (void)
void project_init (void)
void project_finalize (void)


ProjectPrefs project_prefs = { NULL, FALSE, FALSE }
static GeanyProjectPrivate priv
static GeanyIndentPrefs indentation
static GSList * stash_groups = NULL
struct {
   gchar *   project_file_path
local_prefs = { NULL }

Macro Definition Documentation


#define COPY_PREF (   dest,
)     (dest.prefname = priv.prefname)

Definition at line 1324 of file project.c.


#define MAX_NAME_LEN   50

Definition at line 97 of file project.c.


#define PROJECT_DIR   _("projects")

Definition at line 100 of file project.c.


#define SHOW_ERR (   args)    dialogs_show_msgbox(GTK_MESSAGE_ERROR, args)

Definition at line 95 of file project.c.


#define SHOW_ERR1 (   args,
)    dialogs_show_msgbox(GTK_MESSAGE_ERROR, args, more)

Definition at line 96 of file project.c.

Typedef Documentation

◆ PropertyDialogElements

Function Documentation

◆ add_stash_group()

static void add_stash_group ( StashGroup group,
gboolean  apply_defaults 

Definition at line 1259 of file project.c.

References group, stash_group_load_from_key_file(), and stash_groups.

Referenced by init_stash_prefs().

◆ apply_editor_prefs()

static void apply_editor_prefs ( void  )

Definition at line 1091 of file project.c.

References documents, editor_apply_update_prefs(), and foreach_document.

Referenced by destroy_project(), load_config(), and update_config().

◆ create_project()

◆ create_properties_dialog()

◆ destroy_project()

◆ handle_current_session()

◆ have_session_docs()

static gboolean have_session_docs ( void  )

◆ init_stash_prefs()

◆ insert_build_page()

◆ load_config()

◆ on_entries_changed()

static void on_entries_changed ( GtkEditable *  editable,
PropertyDialogElements e 

Definition at line 999 of file project.c.

References _PropertyDialogElements::entries_modified.

Referenced by project_new().

◆ on_file_save_button_clicked()

static void on_file_save_button_clicked ( GtkButton *  button,
PropertyDialogElements e 

◆ on_name_entry_changed()

static void on_name_entry_changed ( GtkEditable *  editable,
PropertyDialogElements e 

◆ on_project_properties_base_path_button_clicked()

static void on_project_properties_base_path_button_clicked ( GtkWidget *  button,
GtkWidget *  base_path_entry 

Definition at line 484 of file project.c.

References _, dialog, and NULL.

Referenced by create_properties_dialog().

◆ on_radio_long_line_custom_toggled()

static void on_radio_long_line_custom_toggled ( GtkToggleButton *  radio,
GtkWidget *  spin_long_line 

Definition at line 1005 of file project.c.

Referenced by create_properties_dialog(), and show_project_properties().

◆ project_apply_prefs()

void project_apply_prefs ( void  )

Definition at line 1249 of file project.c.

References local_prefs, path_entry, SETPTR, ui_lookup_widget(), and ui_widgets.

Referenced by on_prefs_dialog_response().

◆ project_ask_close()

gboolean project_ask_close ( void  )

◆ project_build_properties()

void project_build_properties ( void  )

Definition at line 651 of file project.c.

References show_project_properties().

Referenced by on_set_build_commands_activate().

◆ project_close()

◆ project_finalize()

void project_finalize ( void  )

Definition at line 1348 of file project.c.

Referenced by do_main_quit().

◆ project_get_base_path()

◆ project_get_file_prefs()

const GeanyFilePrefs * project_get_file_prefs ( void  )

Definition at line 1327 of file project.c.

References app, COPY_PREF, file_prefs, and GeanyApp::project.

Referenced by document_save_file().

◆ project_init()

void project_init ( void  )

Definition at line 1343 of file project.c.

Referenced by main_lib().

◆ project_load_file()

◆ project_load_file_with_session()

gboolean project_load_file_with_session ( const gchar *  locale_file_name)

◆ project_load_prefs()

void project_load_prefs ( GKeyFile *  config)

Definition at line 1212 of file project.c.

References cl_options, local_prefs, NULL, PROJECT_DIR, project_prefs, and utils_get_setting_string().

Referenced by configuration_load().

◆ project_new()

◆ project_open()

◆ project_properties()

void project_properties ( void  )

Definition at line 645 of file project.c.

References show_project_properties().

Referenced by on_project_properties1_activate().

◆ project_save_prefs()

void project_save_prefs ( GKeyFile *  config)

Definition at line 1197 of file project.c.

References app, cl_options, FALLBACK, GeanyProject::file_name, local_prefs, NULL, and GeanyApp::project.

Referenced by configuration_save().

◆ project_setup_prefs()

void project_setup_prefs ( void  )

◆ project_write_config()

void project_write_config ( void  )

Forces the project file rewrite and emission of the project-save signal.

Plugins can use this function to save additional project data outside the project dialog.


Definition at line 1159 of file project.c.

References _, SHOW_ERR, and write_config().

Referenced by save_configuration_cb().

◆ remove_foreach_project_filetype()

static void remove_foreach_project_filetype ( gpointer  data,
gpointer  user_data 

◆ run_dialog()

static void run_dialog ( GtkWidget *  dialog,
GtkWidget *  entry 

◆ run_new_dialog()

◆ run_open_dialog()

static void run_open_dialog ( GtkDialog *  dialog)

◆ show_project_properties()

◆ update_config()

◆ update_ui()

static void update_ui ( void  )

◆ write_config()

Variable Documentation

◆ indentation


◆ priv

◆ project_file_path

gchar* project_file_path

Definition at line 63 of file project.c.

◆ project_prefs

◆ stash_groups

GSList* stash_groups = NULL