2005-11-22 12:26:26 +00:00
|
|
|
/*
|
|
|
|
* filetypes.h - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
2006-01-10 17:30:53 +00:00
|
|
|
* Copyright 2006 Enrico Troeger <enrico.troeger@uvena.de>
|
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
|
2006-05-16 19:04:04 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
2005-11-27 20:46:36 +00:00
|
|
|
* $Id$
|
2005-11-22 12:26:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GEANY_FILETYPES_H
|
|
|
|
#define GEANY_FILETYPES_H 1
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2006-04-27 18:06:35 +00:00
|
|
|
GEANY_FILETYPES_C = 0, // 0
|
|
|
|
GEANY_FILETYPES_CPP, // 1
|
2006-07-25 10:13:35 +00:00
|
|
|
GEANY_FILETYPES_D, // 2
|
|
|
|
GEANY_FILETYPES_JAVA, // 3
|
|
|
|
GEANY_FILETYPES_PASCAL, // 4
|
|
|
|
GEANY_FILETYPES_ASM, // 5
|
|
|
|
GEANY_FILETYPES_CAML, // 6
|
|
|
|
GEANY_FILETYPES_PERL, // 7
|
|
|
|
GEANY_FILETYPES_PHP, // 8
|
|
|
|
GEANY_FILETYPES_PYTHON, // 9
|
|
|
|
GEANY_FILETYPES_RUBY, // 10
|
|
|
|
GEANY_FILETYPES_TCL, // 11
|
|
|
|
GEANY_FILETYPES_SH, // 12
|
|
|
|
GEANY_FILETYPES_MAKE, // 13
|
|
|
|
GEANY_FILETYPES_XML, // 14
|
|
|
|
GEANY_FILETYPES_DOCBOOK, // 15
|
|
|
|
/*
|
|
|
|
GEANY_FILETYPES_HTML, // 16
|
|
|
|
*/
|
|
|
|
GEANY_FILETYPES_CSS, // 17
|
|
|
|
GEANY_FILETYPES_SQL, // 18
|
|
|
|
GEANY_FILETYPES_LATEX, // 19
|
|
|
|
GEANY_FILETYPES_OMS, // 20
|
|
|
|
GEANY_FILETYPES_CONF, // 21
|
|
|
|
GEANY_FILETYPES_ALL, // 22
|
|
|
|
GEANY_MAX_FILE_TYPES // 23
|
2005-11-22 12:26:26 +00:00
|
|
|
};
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
struct build_menu_items
|
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *item_compile;
|
|
|
|
GtkWidget *item_link;
|
|
|
|
GtkWidget *item_exec;
|
|
|
|
gboolean can_compile;
|
|
|
|
gboolean can_link;
|
|
|
|
gboolean can_exec;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct build_programs
|
|
|
|
{
|
|
|
|
gchar *compiler;
|
|
|
|
gchar *linker;
|
|
|
|
gchar *run_cmd;
|
|
|
|
gchar *run_cmd2;
|
|
|
|
};
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
typedef struct filetype
|
|
|
|
{
|
2006-04-27 18:06:35 +00:00
|
|
|
guint id;
|
2006-07-25 10:13:35 +00:00
|
|
|
guint uid; // unique id as reference for saved filetype in config file
|
2006-08-03 22:17:10 +00:00
|
|
|
GtkWidget *item; // holds a pointer to the menu item for this filetypes
|
2006-06-24 14:36:35 +00:00
|
|
|
langType lang; // represents the langType of tagmanager(see the table
|
|
|
|
// in tagmanager/parsers.h), -1 represents all, -2 none
|
2006-04-27 18:06:35 +00:00
|
|
|
gchar *name; // will be used as name for tagmanager
|
|
|
|
gboolean has_tags; // indicates whether there is a tag parser for it or not
|
|
|
|
gchar *title; // will be shown in the file open dialog
|
|
|
|
gchar *extension;
|
|
|
|
gchar **pattern;
|
|
|
|
gchar *comment_open;
|
|
|
|
gchar *comment_close;
|
|
|
|
gboolean comment_use_indent;
|
|
|
|
struct build_programs *programs;
|
|
|
|
struct build_menu_items *menu_items;
|
|
|
|
void (*style_func_ptr) (ScintillaObject*);
|
2005-11-22 12:26:26 +00:00
|
|
|
} filetype;
|
|
|
|
|
|
|
|
filetype *filetypes[GEANY_MAX_FILE_TYPES];
|
|
|
|
|
|
|
|
|
2006-08-05 12:25:49 +00:00
|
|
|
// If uid is valid, return corresponding filetype, otherwise NULL.
|
|
|
|
filetype *filetypes_get_from_uid(gint uid);
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
/* inits the filetype array and fill it with the known filetypes
|
|
|
|
* and create the filetype menu*/
|
|
|
|
void filetypes_init_types(void);
|
|
|
|
|
|
|
|
/* simple filetype selection based on the filename extension */
|
|
|
|
filetype *filetypes_get_from_filename(const gchar *filename);
|
|
|
|
|
|
|
|
/* frees the array and all related pointers */
|
|
|
|
void filetypes_free_types(void);
|
|
|
|
|
|
|
|
gchar *filetypes_get_template(filetype *ft);
|
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
void filetypes_get_config(GKeyFile *config, GKeyFile *configh, gint ft);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2006-08-03 22:17:10 +00:00
|
|
|
void filetypes_select_radio_item(const filetype *ft);
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|