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__
31 #define MAX_NAME_LEN 50
32 #define PROJECT_TYPE 1
39 NEW_PROJECT_TYPE_PYTHON
,
40 NEW_PROJECT_TYPE_NONE
,
46 gchar
*path
; ///< path to disk file
56 GHashTable
*tags
; ///< project tags
60 extern const gchar
* project_type_string
[NEW_PROJECT_TYPE_SIZE
];
61 extern void * project_type_filter
[NEW_PROJECT_TYPE_SIZE
];
64 struct GeanyProject
* geany_project_new(const gchar
*path
);
65 void geany_project_free(struct GeanyProject
*prj
);
67 void geany_project_regenerate_file_list(struct GeanyProject
*prj
);
69 gboolean
geany_project_add_file(struct GeanyProject
*prj
, const gchar
*path
);
70 gboolean
geany_project_remove_file(struct GeanyProject
*prj
, const gchar
*path
);
71 void geany_project_save(struct GeanyProject
*prj
);
73 void geany_project_set_name(struct GeanyProject
*prj
, const gchar
*name
);
74 void geany_project_set_type_int(struct GeanyProject
*prj
, gint val
);
75 void geany_project_set_type_string(struct GeanyProject
*prj
, const gchar
* val
);
76 void geany_project_set_regenerate(struct GeanyProject
*prj
, gboolean val
);
78 void geany_project_set_description(struct GeanyProject
*prj
, const gchar
*description
);
79 void geany_project_set_base_path(struct GeanyProject
*prj
, const gchar
*base_path
);
80 void geany_project_set_run_cmd(struct GeanyProject
*prj
, const gchar
*run_cmd
);
82 void geany_project_set_tags_from_list(struct GeanyProject
*prj
, GSList
* files
);
86 void create_sidebar();
87 void destroy_sidebar();
89 void sidebar_refresh();
94 gboolean
xproject_add_file(const gchar
*path
);
95 gboolean
xproject_remove_file(const gchar
* path
);
96 void xproject_update_tag(const gchar
*filename
);
97 void xproject_cleanup();
98 void xproject_close(gboolean cache
);
101 void tools_menu_init();
102 void tools_menu_uninit();
104 void on_new_project(GtkMenuItem
* menuitem
, gpointer user_data
);
105 void on_preferences(GtkMenuItem
* menuitem
, gpointer user_data
);
106 void on_delete_project(GtkMenuItem
* menuitem
, gpointer user_data
);
107 void on_add_file(GtkMenuItem
* menuitem
, gpointer user_data
);
108 void on_find_in_project(GtkMenuItem
* menuitem
, gpointer user_data
);
113 gchar
* find_file_path(const gchar
* dir
, const gchar
* filename
);
114 gchar
* normpath(const gchar
* filename
);
115 gchar
* get_full_path(const gchar
* location
, const gchar
* path
);
116 gchar
* get_relative_path(const gchar
* location
, const gchar
* path
);
118 gint
config_length(GKeyFile
*config
, const gchar
*section
, const gchar
* name
);
119 void save_config(GKeyFile
*config
, const gchar
* path
);
120 GSList
*get_file_list(const gchar
*path
, guint
*length
, gboolean (*func
)(const gchar
*), GError
**error
);
123 extern struct GeanyProject
*g_current_project
;