2005-11-22 12:26:26 +00:00
|
|
|
/*
|
|
|
|
* build.h - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
2009-01-04 18:30:42 +00:00
|
|
|
* Copyright 2005-2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
|
|
|
* Copyright 2006-2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
2006-01-03 12:39:25 +00:00
|
|
|
* $Id$
|
2005-11-22 12:26:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GEANY_BUILD_H
|
|
|
|
#define GEANY_BUILD_H 1
|
|
|
|
|
2009-04-24 19:31:00 +00:00
|
|
|
#define GEANY_BUILD_ERR_HIGHLIGHT_MAX 100
|
2009-04-21 20:54:50 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
/* Geany Known Build Commands, currently only these can have keybindings
|
|
|
|
* Order is important (see GBO_TO_GBG, GBO_TO_CMD below) */
|
|
|
|
typedef enum
|
2006-10-16 14:15:04 +00:00
|
|
|
{
|
2006-11-11 18:51:33 +00:00
|
|
|
GBO_COMPILE,
|
|
|
|
GBO_BUILD,
|
2006-10-16 14:15:04 +00:00
|
|
|
GBO_MAKE_ALL,
|
|
|
|
GBO_MAKE_CUSTOM,
|
2009-07-09 06:49:42 +00:00
|
|
|
GBO_MAKE_OBJECT,
|
|
|
|
GBO_EXEC,
|
|
|
|
GBO_COUNT /* count of how many */
|
2008-05-16 14:35:41 +00:00
|
|
|
} GeanyBuildType;
|
2006-10-16 14:15:04 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
typedef enum /* build command groups, order as above */
|
|
|
|
{
|
|
|
|
GBG_FT, /* filetype */
|
|
|
|
GBG_NON_FT, /* non filetype */
|
|
|
|
GBG_EXEC, /* execute */
|
|
|
|
GBG_COUNT /* count of how many */
|
|
|
|
} GeanyBuildGroup;
|
|
|
|
|
|
|
|
#define GBG_FIXED GBG_COUNT
|
|
|
|
|
|
|
|
/* convert GBO_xxx to GBG_xxx and command number
|
|
|
|
* Note they are macros so they can be used in static initialisers */
|
|
|
|
#define GBO_TO_GBG(gbo) ((gbo)>GBO_EXEC?GBG_COUNT:((gbo)>=GBO_EXEC?GBG_EXEC:((gbo)>=GBO_MAKE_ALL?GBG_NON_FT:GBG_FT)))
|
|
|
|
#define GBO_TO_CMD(gbo) ((gbo)>=GBO_COUNT?(gbo)-GBO_COUNT:((gbo)>=GBO_EXEC?(gbo)-GBO_EXEC:((gbo)>=GBO_MAKE_ALL?(gbo)-GBO_MAKE_ALL:(gbo))))
|
|
|
|
|
|
|
|
enum GeanyBuildFixedMenuItems
|
|
|
|
{
|
|
|
|
GBF_NEXT_ERROR,
|
|
|
|
GBF_PREV_ERROR,
|
|
|
|
GBF_COMMANDS,
|
|
|
|
GBF_SEP_1,
|
|
|
|
GBF_SEP_2,
|
|
|
|
GBF_SEP_3,
|
|
|
|
GBF_SEP_4,
|
|
|
|
GBF_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum /* build command sources, in increasing priority */
|
|
|
|
{
|
|
|
|
BCS_DEF, /* default */
|
|
|
|
BCS_FT, /* filetype */
|
|
|
|
BCS_HOME_FT,/* filetypes in home */
|
|
|
|
BCS_PREF, /* preferences */
|
|
|
|
BCS_PROJ_FT,/* filetype in project */
|
|
|
|
BCS_PROJ, /* project */
|
|
|
|
BCS_COUNT /* count of how many */
|
|
|
|
} GeanyBuildSource;
|
|
|
|
|
2008-05-16 14:35:41 +00:00
|
|
|
typedef struct GeanyBuildInfo
|
2006-10-16 14:15:04 +00:00
|
|
|
{
|
2009-07-09 06:49:42 +00:00
|
|
|
GeanyBuildGroup grp;
|
|
|
|
gint cmd;
|
2008-05-16 14:35:41 +00:00
|
|
|
GPid pid; /* process id of the spawned process */
|
|
|
|
gchar *dir;
|
|
|
|
guint file_type_id;
|
|
|
|
gchar *custom_target;
|
2009-04-21 20:54:50 +00:00
|
|
|
gint message_count;
|
2008-05-16 14:35:41 +00:00
|
|
|
} GeanyBuildInfo;
|
|
|
|
|
|
|
|
extern GeanyBuildInfo build_info;
|
2006-10-16 14:15:04 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
typedef struct GeanyBuildCommand
|
|
|
|
{
|
|
|
|
gchar *label;
|
|
|
|
gchar *command;
|
|
|
|
gboolean exists;
|
|
|
|
gboolean run_in_base_dir;
|
|
|
|
gboolean changed;
|
|
|
|
} GeanyBuildCommand;
|
|
|
|
|
|
|
|
extern GeanyBuildCommand *non_ft_proj, *exec_proj; /* project command array pointers */
|
2007-09-17 11:16:48 +00:00
|
|
|
|
|
|
|
typedef struct BuildMenuItems
|
2006-11-30 15:42:52 +00:00
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
2009-07-09 06:49:42 +00:00
|
|
|
GtkWidget **menu_item[GBG_COUNT+1]; /* +1 for fixed items */
|
2006-11-30 15:42:52 +00:00
|
|
|
} BuildMenuItems;
|
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
/* opaque pointers returned from build functions and passed back to them */
|
|
|
|
typedef struct TableFields *TableData;
|
2006-10-16 14:15:04 +00:00
|
|
|
|
2008-02-20 11:24:23 +00:00
|
|
|
void build_init(void);
|
2007-08-23 11:34:06 +00:00
|
|
|
|
2008-02-20 11:24:23 +00:00
|
|
|
void build_finalize(void);
|
2006-10-16 14:41:57 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
/* menu configuration dialog functions */
|
|
|
|
GtkWidget *build_commands_table( GeanyDocument *doc, GeanyBuildSource dst, TableData *data, GeanyFiletype *ft );
|
|
|
|
|
|
|
|
gboolean read_build_commands( GeanyBuildCommand ***dstcmd, GeanyBuildSource dst, TableData data, gint response );
|
2007-08-23 11:34:06 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
void free_build_data( TableData data );
|
|
|
|
|
|
|
|
/* build response decode assistance function */
|
2007-01-04 11:49:14 +00:00
|
|
|
gboolean build_parse_make_dir(const gchar *string, gchar **prefix);
|
2006-12-30 16:16:59 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
/* build menu functions */
|
2008-06-15 13:35:48 +00:00
|
|
|
void build_menu_update(GeanyDocument *doc);
|
2006-10-18 19:35:42 +00:00
|
|
|
|
2007-01-03 16:21:44 +00:00
|
|
|
BuildMenuItems *build_get_menu_items(gint filetype_idx);
|
2006-11-30 15:42:52 +00:00
|
|
|
|
2009-01-17 17:59:20 +00:00
|
|
|
void build_toolbutton_build_clicked(GtkAction *action, gpointer user_data);
|
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
void remove_command( GeanyBuildSource src, GeanyBuildGroup grp, gint cmd );
|
|
|
|
|
|
|
|
/* load and store menu configuration */
|
|
|
|
void load_build_menu( GKeyFile *config, GeanyBuildSource dst, gpointer ptr );
|
|
|
|
|
|
|
|
void save_build_menu( GKeyFile *config, gpointer ptr, GeanyBuildSource src );
|
2009-01-17 17:59:20 +00:00
|
|
|
|
2009-07-09 06:49:42 +00:00
|
|
|
void set_build_grp_count( GeanyBuildGroup grp, guint count );
|
2006-10-18 19:35:42 +00:00
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|