2 * geanyprj - Alternative project support for geany light IDE.
4 * Copyright 2008 Yura Siamashka <yurand2@gmail.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __GEANYPRJ_H__
21 #define __GEANYPRJ_H__
25 # define debug(format, ...) printf((format), __VA_ARGS__)
37 #define MAX_NAME_LEN 50
38 #define PROJECT_TYPE 1
45 NEW_PROJECT_TYPE_PYTHON
,
46 NEW_PROJECT_TYPE_NONE
,
52 gchar
*path
; ///< path to disk file
62 GHashTable
*tags
; ///< project tags
66 extern const gchar
*project_type_string
[NEW_PROJECT_TYPE_SIZE
];
67 extern void *project_type_filter
[NEW_PROJECT_TYPE_SIZE
];
70 struct PluginProject
*geany_project_new();
71 struct PluginProject
*geany_project_load(const gchar
* path
);
72 void geany_project_free(struct PluginProject
*prj
);
74 void geany_project_regenerate_file_list(struct PluginProject
*prj
);
76 gboolean
geany_project_add_file(struct PluginProject
*prj
, const gchar
* path
);
77 gboolean
geany_project_remove_file(struct PluginProject
*prj
, const gchar
* path
);
78 void geany_project_save(struct PluginProject
*prj
);
80 void geany_project_set_path(struct PluginProject
*prj
, const gchar
* path
);
81 void geany_project_set_name(struct PluginProject
*prj
, const gchar
* name
);
82 void geany_project_set_type_int(struct PluginProject
*prj
, gint val
);
83 void geany_project_set_type_string(struct PluginProject
*prj
, const gchar
* val
);
84 void geany_project_set_regenerate(struct PluginProject
*prj
, gboolean val
);
86 void geany_project_set_description(struct PluginProject
*prj
, const gchar
* description
);
87 void geany_project_set_base_path(struct PluginProject
*prj
, const gchar
* base_path
);
88 void geany_project_set_run_cmd(struct PluginProject
*prj
, const gchar
* run_cmd
);
90 void geany_project_set_tags_from_list(struct PluginProject
*prj
, GSList
* files
);
94 void create_sidebar();
95 void destroy_sidebar();
97 void sidebar_refresh();
101 void xproject_init();
102 void xproject_open(const gchar
* path
);
103 gboolean
xproject_add_file(const gchar
* path
);
104 gboolean
xproject_remove_file(const gchar
* path
);
105 void xproject_update_tag(const gchar
* filename
);
106 void xproject_cleanup();
107 void xproject_close(gboolean cache
);
110 void tools_menu_init();
111 void tools_menu_uninit();
113 void on_new_project(GtkMenuItem
* menuitem
, gpointer user_data
);
114 void on_preferences(GtkMenuItem
* menuitem
, gpointer user_data
);
115 void on_delete_project(GtkMenuItem
* menuitem
, gpointer user_data
);
116 void on_add_file(GtkMenuItem
* menuitem
, gpointer user_data
);
117 void on_find_in_project(GtkMenuItem
* menuitem
, gpointer user_data
);
122 gchar
*find_file_path(const gchar
* dir
, const gchar
* filename
);
123 gchar
*normpath(const gchar
* filename
);
124 gchar
*get_full_path(const gchar
* location
, const gchar
* path
);
125 gchar
*get_relative_path(const gchar
* location
, const gchar
* path
);
127 gint
config_length(GKeyFile
* config
, const gchar
* section
, const gchar
* name
);
128 void save_config(GKeyFile
* config
, const gchar
* path
);
129 GSList
*get_file_list(const gchar
* path
, guint
* length
, gboolean(*func
) (const gchar
*),
133 extern struct PluginProject
*g_current_project
;