2005-11-22 12:26:26 +00:00
|
|
|
/*
|
|
|
|
* filetypes.c - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
2007-01-14 17:36:42 +00:00
|
|
|
* Copyright 2005-2007 Enrico Tröger <enrico.troeger@uvena.de>
|
2007-01-13 20:16:09 +00:00
|
|
|
* Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.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
|
2006-05-10 19:54:44 +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
|
|
|
*/
|
|
|
|
|
2007-02-24 11:41:56 +00:00
|
|
|
/*
|
|
|
|
* Filetype detection, file extensions and filetype menu items.
|
|
|
|
*/
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "geany.h"
|
|
|
|
#include "filetypes.h"
|
|
|
|
#include "highlighting.h"
|
|
|
|
#include "support.h"
|
|
|
|
#include "templates.h"
|
2006-01-23 17:05:29 +00:00
|
|
|
#include "msgwindow.h"
|
2006-10-01 16:14:45 +00:00
|
|
|
#include "utils.h"
|
2006-10-06 23:23:05 +00:00
|
|
|
#include "document.h"
|
|
|
|
#include "sciwrappers.h"
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
|
2006-08-05 12:25:49 +00:00
|
|
|
/* This is the order of unique ids used in the config file.
|
|
|
|
* The order must not be changed but can be appended to. */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
FILETYPE_UID_C = 0, // 0
|
|
|
|
FILETYPE_UID_CPP, // 1
|
|
|
|
FILETYPE_UID_JAVA, // 2
|
|
|
|
FILETYPE_UID_PERL, // 3
|
|
|
|
FILETYPE_UID_PHP, // 4
|
|
|
|
FILETYPE_UID_XML, // 5
|
|
|
|
FILETYPE_UID_DOCBOOK, // 6
|
|
|
|
FILETYPE_UID_PYTHON, // 7
|
|
|
|
FILETYPE_UID_LATEX, // 8
|
|
|
|
FILETYPE_UID_PASCAL, // 9
|
|
|
|
FILETYPE_UID_SH, // 10
|
|
|
|
FILETYPE_UID_MAKE, // 11
|
|
|
|
FILETYPE_UID_CSS, // 12
|
|
|
|
FILETYPE_UID_CONF, // 13
|
|
|
|
FILETYPE_UID_ASM, // 14
|
|
|
|
FILETYPE_UID_SQL, // 15
|
|
|
|
FILETYPE_UID_CAML, // 16
|
|
|
|
FILETYPE_UID_OMS, // 17
|
|
|
|
FILETYPE_UID_RUBY, // 18
|
|
|
|
FILETYPE_UID_TCL, // 19
|
|
|
|
FILETYPE_UID_ALL, // 20
|
|
|
|
FILETYPE_UID_D, // 21
|
2006-08-27 17:39:34 +00:00
|
|
|
FILETYPE_UID_FORTRAN, // 22
|
|
|
|
FILETYPE_UID_DIFF, // 23
|
2006-09-01 17:07:49 +00:00
|
|
|
FILETYPE_UID_FERITE, // 24
|
2006-11-13 22:11:19 +00:00
|
|
|
FILETYPE_UID_HTML, // 25
|
2007-01-13 20:16:09 +00:00
|
|
|
FILETYPE_UID_VHDL, // 26
|
|
|
|
FILETYPE_UID_JS, // 27
|
|
|
|
FILETYPE_UID_LUA // 28
|
2006-08-05 12:25:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
static void filetypes_create_menu_item(GtkWidget *menu, gchar *label, filetype *ftype);
|
|
|
|
static void filetypes_init_build_programs(filetype *ftype);
|
|
|
|
|
2006-08-03 22:17:10 +00:00
|
|
|
static GtkWidget *radio_items[GEANY_MAX_FILE_TYPES];
|
2006-04-27 18:06:35 +00:00
|
|
|
|
|
|
|
|
2006-08-05 12:25:49 +00:00
|
|
|
// If uid is valid, return corresponding filetype, otherwise NULL.
|
|
|
|
filetype *filetypes_get_from_uid(gint uid)
|
|
|
|
{
|
|
|
|
switch (uid)
|
|
|
|
{
|
|
|
|
case FILETYPE_UID_C: return filetypes[GEANY_FILETYPES_C];
|
|
|
|
case FILETYPE_UID_CPP: return filetypes[GEANY_FILETYPES_CPP];
|
|
|
|
case FILETYPE_UID_JAVA: return filetypes[GEANY_FILETYPES_JAVA];
|
|
|
|
case FILETYPE_UID_PERL: return filetypes[GEANY_FILETYPES_PERL];
|
|
|
|
case FILETYPE_UID_PHP: return filetypes[GEANY_FILETYPES_PHP];
|
|
|
|
case FILETYPE_UID_XML: return filetypes[GEANY_FILETYPES_XML];
|
|
|
|
case FILETYPE_UID_DOCBOOK: return filetypes[GEANY_FILETYPES_DOCBOOK];
|
|
|
|
case FILETYPE_UID_PYTHON: return filetypes[GEANY_FILETYPES_PYTHON];
|
|
|
|
case FILETYPE_UID_LATEX: return filetypes[GEANY_FILETYPES_LATEX];
|
|
|
|
case FILETYPE_UID_PASCAL: return filetypes[GEANY_FILETYPES_PASCAL];
|
|
|
|
case FILETYPE_UID_SH: return filetypes[GEANY_FILETYPES_SH];
|
|
|
|
case FILETYPE_UID_MAKE: return filetypes[GEANY_FILETYPES_MAKE];
|
|
|
|
case FILETYPE_UID_CSS: return filetypes[GEANY_FILETYPES_CSS];
|
|
|
|
case FILETYPE_UID_CONF: return filetypes[GEANY_FILETYPES_CONF];
|
|
|
|
case FILETYPE_UID_ASM: return filetypes[GEANY_FILETYPES_ASM];
|
|
|
|
case FILETYPE_UID_SQL: return filetypes[GEANY_FILETYPES_SQL];
|
|
|
|
case FILETYPE_UID_CAML: return filetypes[GEANY_FILETYPES_CAML];
|
|
|
|
case FILETYPE_UID_OMS: return filetypes[GEANY_FILETYPES_OMS];
|
|
|
|
case FILETYPE_UID_RUBY: return filetypes[GEANY_FILETYPES_RUBY];
|
|
|
|
case FILETYPE_UID_TCL: return filetypes[GEANY_FILETYPES_TCL];
|
|
|
|
case FILETYPE_UID_ALL: return filetypes[GEANY_FILETYPES_ALL];
|
|
|
|
case FILETYPE_UID_D: return filetypes[GEANY_FILETYPES_D];
|
2006-08-15 17:57:41 +00:00
|
|
|
case FILETYPE_UID_FORTRAN: return filetypes[GEANY_FILETYPES_FORTRAN];
|
2006-09-01 17:07:49 +00:00
|
|
|
case FILETYPE_UID_DIFF: return filetypes[GEANY_FILETYPES_DIFF];
|
2006-08-27 17:39:34 +00:00
|
|
|
case FILETYPE_UID_FERITE: return filetypes[GEANY_FILETYPES_FERITE];
|
2006-09-01 17:07:49 +00:00
|
|
|
case FILETYPE_UID_HTML: return filetypes[GEANY_FILETYPES_HTML];
|
2006-11-13 22:11:19 +00:00
|
|
|
case FILETYPE_UID_VHDL: return filetypes[GEANY_FILETYPES_VHDL];
|
2007-01-13 20:16:09 +00:00
|
|
|
case FILETYPE_UID_JS: return filetypes[GEANY_FILETYPES_JS];
|
|
|
|
case FILETYPE_UID_LUA: return filetypes[GEANY_FILETYPES_LUA];
|
2006-08-05 12:25:49 +00:00
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
/* inits the filetype array and fill it with the known filetypes
|
|
|
|
* and create the filetype menu*/
|
2006-10-06 23:23:05 +00:00
|
|
|
void filetypes_init_types()
|
2005-11-22 12:26:26 +00:00
|
|
|
{
|
|
|
|
GtkWidget *filetype_menu = lookup_widget(app->window, "set_filetype1_menu");
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define C // these macros are only to ease navigation
|
|
|
|
filetypes[GEANY_FILETYPES_C] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->id = GEANY_FILETYPES_C;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->uid = FILETYPE_UID_C;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->lang = 0;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->name = g_strdup("C");
|
|
|
|
filetypes[GEANY_FILETYPES_C]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_C]->title = g_strdup(_("C source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_C]->extension = g_strdup("c");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->pattern = g_new0(gchar*, 3);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->pattern[0] = g_strdup("*.c");
|
|
|
|
filetypes[GEANY_FILETYPES_C]->pattern[1] = g_strdup("*.h");
|
|
|
|
filetypes[GEANY_FILETYPES_C]->pattern[2] = NULL;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->comment_open = g_strdup("/*");
|
|
|
|
filetypes[GEANY_FILETYPES_C]->comment_close = g_strdup("*/");
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_C]->style_func_ptr = styleset_c;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_C]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_C]->title, filetypes[GEANY_FILETYPES_C]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define CPP
|
|
|
|
filetypes[GEANY_FILETYPES_CPP] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->id = GEANY_FILETYPES_CPP;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->uid = FILETYPE_UID_CPP;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->item = NULL;
|
2006-07-14 10:15:12 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->lang = 1;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->name = g_strdup("C++");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->title = g_strdup(_("C++ source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->extension = g_strdup("cpp");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern = g_new0(gchar*, 11);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[0] = g_strdup("*.cpp");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[1] = g_strdup("*.cxx");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[2] = g_strdup("*.c++");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[3] = g_strdup("*.cc");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[4] = g_strdup("*.h");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[5] = g_strdup("*.hpp");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[6] = g_strdup("*.hxx");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[7] = g_strdup("*.h++");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[8] = g_strdup("*.hh");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[9] = g_strdup("*.C");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->pattern[10] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->style_func_ptr = styleset_cpp;
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->comment_open = g_strdup("//");
|
|
|
|
filetypes[GEANY_FILETYPES_CPP]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_CPP]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_CPP]->title, filetypes[GEANY_FILETYPES_CPP]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define D
|
|
|
|
filetypes[GEANY_FILETYPES_D] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_D]->id = GEANY_FILETYPES_D;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_D]->uid = FILETYPE_UID_D;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_D]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_D]->lang = 17;
|
|
|
|
filetypes[GEANY_FILETYPES_D]->name = g_strdup("D");
|
|
|
|
filetypes[GEANY_FILETYPES_D]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_D]->title = g_strdup(_("D source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_D]->extension = g_strdup("d");
|
|
|
|
filetypes[GEANY_FILETYPES_D]->pattern = g_new0(gchar*, 3);
|
|
|
|
filetypes[GEANY_FILETYPES_D]->pattern[0] = g_strdup("*.d");
|
|
|
|
filetypes[GEANY_FILETYPES_D]->pattern[1] = g_strdup("*.di");
|
|
|
|
filetypes[GEANY_FILETYPES_D]->pattern[2] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_D]->comment_open = g_strdup("//");
|
|
|
|
filetypes[GEANY_FILETYPES_D]->comment_close = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_D]->style_func_ptr = styleset_d;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_D]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_D]->title, filetypes[GEANY_FILETYPES_D]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define JAVA
|
|
|
|
filetypes[GEANY_FILETYPES_JAVA] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->id = GEANY_FILETYPES_JAVA;
|
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->name = g_strdup("Java");
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->uid = FILETYPE_UID_JAVA;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->lang = 2;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->title = g_strdup(_("Java source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->extension = g_strdup("java");
|
2007-01-14 17:46:39 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->pattern = g_new0(gchar*, 3);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->pattern[0] = g_strdup("*.java");
|
2007-01-14 17:46:39 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->pattern[1] = g_strdup("*.jsp");
|
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->pattern[2] = NULL;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->comment_open = g_strdup("/*");
|
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->comment_close = g_strdup("*/");
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JAVA]->style_func_ptr = styleset_java;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_JAVA]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_JAVA]->title, filetypes[GEANY_FILETYPES_JAVA]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define PAS // to avoid warnings when building under Windows, the symbol PASCAL is there defined
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->id = GEANY_FILETYPES_PASCAL;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->uid = FILETYPE_UID_PASCAL;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->lang = 4;
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->name = g_strdup("Pascal");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->title = g_strdup(_("Pascal source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->extension = g_strdup("pas");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern = g_new0(gchar*, 6);
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern[0] = g_strdup("*.pas");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern[1] = g_strdup("*.pp");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern[2] = g_strdup("*.inc");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern[3] = g_strdup("*.dpr");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern[4] = g_strdup("*.dpk");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->pattern[5] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->style_func_ptr = styleset_pascal;
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->comment_open = g_strdup("{");
|
|
|
|
filetypes[GEANY_FILETYPES_PASCAL]->comment_close = g_strdup("}");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_PASCAL]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_PASCAL]->title, filetypes[GEANY_FILETYPES_PASCAL]);
|
|
|
|
|
|
|
|
#define ASM
|
|
|
|
filetypes[GEANY_FILETYPES_ASM] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->id = GEANY_FILETYPES_ASM;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ASM]->uid = FILETYPE_UID_ASM;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ASM]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ASM]->lang = 9;
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->name = g_strdup("ASM");
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->title = g_strdup(_("Assembler source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->extension = g_strdup("asm");
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->pattern = g_new0(gchar*, 2);
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->pattern[0] = g_strdup("*.asm");
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->style_func_ptr = styleset_asm;
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->comment_open = g_strdup(";");
|
|
|
|
filetypes[GEANY_FILETYPES_ASM]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_ASM]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_ASM]->title, filetypes[GEANY_FILETYPES_ASM]);
|
|
|
|
|
2006-08-15 17:57:41 +00:00
|
|
|
#define FORTRAN
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->id = GEANY_FILETYPES_FORTRAN;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->uid = FILETYPE_UID_FORTRAN;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->item = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->lang = 18;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->name = g_strdup("Fortran");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->title = g_strdup(_("Fortran source file (F77)"));
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->extension = g_strdup("f");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern = g_new0(gchar*, 7);
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[0] = g_strdup("*.f");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[1] = g_strdup("*.for");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[2] = g_strdup("*.ftn");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[3] = g_strdup("*.f77");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[4] = g_strdup("*.f90");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[5] = g_strdup("*.f95");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->pattern[6] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->style_func_ptr = styleset_fortran;
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->comment_open = g_strdup("c");
|
|
|
|
filetypes[GEANY_FILETYPES_FORTRAN]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_FORTRAN]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_FORTRAN]->title, filetypes[GEANY_FILETYPES_FORTRAN]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define CAML
|
|
|
|
filetypes[GEANY_FILETYPES_CAML] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->id = GEANY_FILETYPES_CAML;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CAML]->uid = FILETYPE_UID_CAML;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CAML]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CAML]->lang = -2;
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->name = g_strdup("CAML");
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->has_tags = FALSE;
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->title = g_strdup(_("(O)Caml source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->extension = g_strdup("ml");
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->pattern = g_new0(gchar*, 3);
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->pattern[0] = g_strdup("*.ml");
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->pattern[1] = g_strdup("*.mli");
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->pattern[2] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->style_func_ptr = styleset_caml;
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->comment_open = g_strdup("(*");
|
|
|
|
filetypes[GEANY_FILETYPES_CAML]->comment_close = g_strdup("*)");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_CAML]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_CAML]->title, filetypes[GEANY_FILETYPES_CAML]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define PERL
|
|
|
|
filetypes[GEANY_FILETYPES_PERL] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->id = GEANY_FILETYPES_PERL;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->uid = FILETYPE_UID_PERL;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->lang = 5;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->name = g_strdup("Perl");
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->title = g_strdup(_("Perl source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->extension = g_strdup("perl");
|
2007-02-25 16:33:44 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern = g_new0(gchar*, 6);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern[0] = g_strdup("*.pl");
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern[1] = g_strdup("*.perl");
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern[2] = g_strdup("*.pm");
|
2006-09-29 07:22:46 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern[3] = g_strdup("*.agi");
|
2007-02-25 16:33:44 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern[4] = g_strdup("*.pod");
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->pattern[5] = NULL;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_PERL]->comment_close = NULL;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PERL]->style_func_ptr = styleset_perl;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_PERL]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_PERL]->title, filetypes[GEANY_FILETYPES_PERL]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define PHP
|
|
|
|
filetypes[GEANY_FILETYPES_PHP] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->id = GEANY_FILETYPES_PHP;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->uid = FILETYPE_UID_PHP;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->lang = 6;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->name = g_strdup("PHP");
|
|
|
|
filetypes[GEANY_FILETYPES_PHP]->has_tags = TRUE;
|
2006-09-01 17:07:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->title = g_strdup(_("PHP source file"));
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->extension = g_strdup("php");
|
2006-09-01 17:07:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern = g_new0(gchar*, 6);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern[0] = g_strdup("*.php");
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern[1] = g_strdup("*.php3");
|
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern[2] = g_strdup("*.php4");
|
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern[3] = g_strdup("*.php5");
|
2006-09-01 17:07:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern[4] = g_strdup("*.phtml");
|
|
|
|
filetypes[GEANY_FILETYPES_PHP]->pattern[5] = NULL;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->style_func_ptr = styleset_php;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PHP]->comment_open = g_strdup("//");
|
|
|
|
filetypes[GEANY_FILETYPES_PHP]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_PHP]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_PHP]->title, filetypes[GEANY_FILETYPES_PHP]);
|
|
|
|
|
2007-01-13 20:16:09 +00:00
|
|
|
#define JAVASCRIPT
|
|
|
|
filetypes[GEANY_FILETYPES_JS] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->id = GEANY_FILETYPES_JS;
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->uid = FILETYPE_UID_JS;
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->item = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->lang = 23;
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->name = g_strdup("Javascript");
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->title = g_strdup(_("Javascript source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->extension = g_strdup("js");
|
2007-01-14 17:46:39 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JS]->pattern = g_new0(gchar*, 2);
|
2007-01-13 20:16:09 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JS]->pattern[0] = g_strdup("*.js");
|
2007-01-14 17:46:39 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JS]->pattern[1] = NULL;
|
2007-01-13 20:16:09 +00:00
|
|
|
filetypes[GEANY_FILETYPES_JS]->style_func_ptr = styleset_js;
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->comment_open = g_strdup("//");
|
|
|
|
filetypes[GEANY_FILETYPES_JS]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_JS]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_JS]->title, filetypes[GEANY_FILETYPES_JS]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define PYTHON
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->id = GEANY_FILETYPES_PYTHON;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->uid = FILETYPE_UID_PYTHON;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->lang = 7;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->name = g_strdup("Python");
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->title = g_strdup(_("Python source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->extension = g_strdup("py");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->pattern = g_new0(gchar*, 3);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->pattern[0] = g_strdup("*.py");
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->pattern[1] = g_strdup("*.pyw");
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->pattern[2] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->style_func_ptr = styleset_python;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_PYTHON]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_PYTHON]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_PYTHON]->title, filetypes[GEANY_FILETYPES_PYTHON]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define RUBY
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->id = GEANY_FILETYPES_RUBY;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->uid = FILETYPE_UID_RUBY;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->lang = 14;
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->name = g_strdup("Ruby");
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->title = g_strdup(_("Ruby source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->extension = g_strdup("rb");
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->pattern = g_new0(gchar*, 3);
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->pattern[0] = g_strdup("*.rb");
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->pattern[1] = g_strdup("*.rhtml");
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->pattern[2] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->style_func_ptr = styleset_ruby;
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_RUBY]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_RUBY]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_RUBY]->title, filetypes[GEANY_FILETYPES_RUBY]);
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define TCL
|
|
|
|
filetypes[GEANY_FILETYPES_TCL] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->id = GEANY_FILETYPES_TCL;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_TCL]->uid = FILETYPE_UID_TCL;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_TCL]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_TCL]->lang = 15;
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->name = g_strdup("Tcl");
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->title = g_strdup(_("Tcl source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->extension = g_strdup("tcl");
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->pattern = g_new0(gchar*, 4);
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->pattern[0] = g_strdup("*.tcl");
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->pattern[1] = g_strdup("*.tk");
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->pattern[2] = g_strdup("*.wish");
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->pattern[3] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->style_func_ptr = styleset_tcl;
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_TCL]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_TCL]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_TCL]->title, filetypes[GEANY_FILETYPES_TCL]);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2007-01-13 20:16:09 +00:00
|
|
|
#define LUA
|
|
|
|
filetypes[GEANY_FILETYPES_LUA] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->id = GEANY_FILETYPES_LUA;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->uid = FILETYPE_UID_LUA;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->item = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->lang = 22;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->name = g_strdup("Lua");
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->title = g_strdup(_("Lua source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->extension = g_strdup("lua");
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->pattern = g_new0(gchar*, 2);
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->pattern[0] = g_strdup("*.lua");
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->style_func_ptr = styleset_lua;
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->comment_open = g_strdup("--");
|
|
|
|
filetypes[GEANY_FILETYPES_LUA]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_LUA]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_LUA]->title, filetypes[GEANY_FILETYPES_LUA]);
|
|
|
|
|
2006-08-27 17:39:34 +00:00
|
|
|
#define FERITE
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->id = GEANY_FILETYPES_FERITE;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->uid = FILETYPE_UID_FERITE;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->item = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->lang = 19;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->name = g_strdup("Ferite");
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->title = g_strdup(_("Ferite source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->extension = g_strdup("fe");
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->pattern = g_new0(gchar*, 2);
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->pattern[0] = g_strdup("*.fe");
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->style_func_ptr = styleset_ferite;
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->comment_open = g_strdup("/*");
|
|
|
|
filetypes[GEANY_FILETYPES_FERITE]->comment_close = g_strdup("*/");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_FERITE]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_FERITE]->title, filetypes[GEANY_FILETYPES_FERITE]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define SH
|
|
|
|
filetypes[GEANY_FILETYPES_SH] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->id = GEANY_FILETYPES_SH;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->uid = FILETYPE_UID_SH;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->lang = 16;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->name = g_strdup("Sh");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->title = g_strdup(_("Shell script file"));
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->extension = g_strdup("sh");
|
2006-06-10 14:37:24 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern = g_new0(gchar*, 8);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[0] = g_strdup("*.sh");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[1] = g_strdup("configure");
|
2006-06-10 14:37:24 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[2] = g_strdup("configure.in");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[3] = g_strdup("configure.in.in");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[4] = g_strdup("configure.ac");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[5] = g_strdup("*.ksh");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[6] = g_strdup("*.zsh");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->pattern[7] = NULL;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->style_func_ptr = styleset_sh;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SH]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_SH]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_SH]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_SH]->title, filetypes[GEANY_FILETYPES_SH]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define MAKE
|
|
|
|
filetypes[GEANY_FILETYPES_MAKE] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->id = GEANY_FILETYPES_MAKE;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->uid = FILETYPE_UID_MAKE;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->lang = 3;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->name = g_strdup("Make");
|
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->title = g_strdup(_("Makefile"));
|
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->extension = g_strdup("mak");
|
2007-02-08 16:26:45 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->pattern = utils_strv_new(
|
|
|
|
"*.mak", "*.mk", "GNUmakefile", "makefile", "Makefile", "makefile.*", "Makefile.*", NULL);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->style_func_ptr = styleset_makefile;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_MAKE]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_MAKE]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_MAKE]->title, filetypes[GEANY_FILETYPES_MAKE]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define XML
|
|
|
|
filetypes[GEANY_FILETYPES_XML] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->id = GEANY_FILETYPES_XML;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_XML]->uid = FILETYPE_UID_XML;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_XML]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_XML]->lang = -2;
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->name = g_strdup("XML");
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->has_tags = FALSE;
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->title = g_strdup(_("XML source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->extension = g_strdup("xml");
|
2007-02-08 16:26:45 +00:00
|
|
|
filetypes[GEANY_FILETYPES_XML]->pattern = utils_strv_new(
|
|
|
|
"*.xml", "*.sgml", "*.xsl", "*.xslt", "*.xsd", NULL);
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_XML]->style_func_ptr = styleset_xml;
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->comment_open = g_strdup("<!--");
|
|
|
|
filetypes[GEANY_FILETYPES_XML]->comment_close = g_strdup("-->");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_XML]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_XML]->title, filetypes[GEANY_FILETYPES_XML]);
|
|
|
|
|
|
|
|
#define DOCBOOK
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->id = GEANY_FILETYPES_DOCBOOK;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->uid = FILETYPE_UID_DOCBOOK;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->lang = 12;
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->name = g_strdup("Docbook");
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->title = g_strdup(_("Docbook source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->extension = g_strdup("docbook");
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->pattern = g_new0(gchar*, 2);
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->pattern[0] = g_strdup("*.docbook");
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->style_func_ptr = styleset_docbook;
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->comment_open = g_strdup("<!--");
|
|
|
|
filetypes[GEANY_FILETYPES_DOCBOOK]->comment_close = g_strdup("-->");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_DOCBOOK]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_DOCBOOK]->title, filetypes[GEANY_FILETYPES_DOCBOOK]);
|
|
|
|
|
2006-09-01 17:07:49 +00:00
|
|
|
#define HTML
|
|
|
|
filetypes[GEANY_FILETYPES_HTML] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->id = GEANY_FILETYPES_HTML;
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->uid = FILETYPE_UID_HTML;
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->item = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->lang = -2;
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->name = g_strdup("HTML");
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->has_tags = FALSE;
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->title = g_strdup(_("HTML source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->extension = g_strdup("html");
|
2007-02-08 16:26:45 +00:00
|
|
|
filetypes[GEANY_FILETYPES_HTML]->pattern = utils_strv_new(
|
|
|
|
"*.htm", "*.html", "*.shtml", "*.hta", "*.htd", "*.htt", "*.cfm", NULL);
|
2006-09-01 17:07:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_HTML]->style_func_ptr = styleset_html;
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->comment_open = g_strdup("<!--");
|
|
|
|
filetypes[GEANY_FILETYPES_HTML]->comment_close = g_strdup("-->");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_HTML]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_HTML]->title, filetypes[GEANY_FILETYPES_HTML]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define CSS
|
|
|
|
filetypes[GEANY_FILETYPES_CSS] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->id = GEANY_FILETYPES_CSS;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->uid = FILETYPE_UID_CSS;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->lang = 13;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->name = g_strdup("CSS");
|
2006-05-10 19:54:44 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->has_tags = TRUE;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->title = g_strdup(_("Cascading StyleSheet"));
|
|
|
|
filetypes[GEANY_FILETYPES_CSS]->extension = g_strdup("css");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->pattern = g_new0(gchar*, 2);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->pattern[0] = g_strdup("*.css");
|
|
|
|
filetypes[GEANY_FILETYPES_CSS]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_CSS]->style_func_ptr = styleset_css;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CSS]->comment_open = g_strdup("/*");
|
|
|
|
filetypes[GEANY_FILETYPES_CSS]->comment_close = g_strdup("*/");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_CSS]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_CSS]->title, filetypes[GEANY_FILETYPES_CSS]);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define SQL
|
|
|
|
filetypes[GEANY_FILETYPES_SQL] = g_new0(filetype, 1);
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->id = GEANY_FILETYPES_SQL;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->uid = FILETYPE_UID_SQL;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->lang = 11;
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->name = g_strdup("SQL");
|
2006-05-15 19:49:30 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->has_tags = TRUE;
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->title = g_strdup(_("SQL Dump file"));
|
|
|
|
filetypes[GEANY_FILETYPES_SQL]->extension = g_strdup("sql");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->pattern = g_new0(gchar*, 2);
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->pattern[0] = g_strdup("*.sql");
|
|
|
|
filetypes[GEANY_FILETYPES_SQL]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_SQL]->style_func_ptr = styleset_sql;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_SQL]->comment_open = g_strdup("/*");
|
|
|
|
filetypes[GEANY_FILETYPES_SQL]->comment_close = g_strdup("*/");
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_SQL]);
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_SQL]->title, filetypes[GEANY_FILETYPES_SQL]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define LATEX
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->id = GEANY_FILETYPES_LATEX;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->uid = FILETYPE_UID_LATEX;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->lang = 8;
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->name = g_strdup("LaTeX");
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->title = g_strdup(_("LaTeX source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->extension = g_strdup("tex");
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->pattern = g_new0(gchar*, 4);
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->pattern[0] = g_strdup("*.tex");
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->pattern[1] = g_strdup("*.sty");
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->pattern[2] = g_strdup("*.idx");
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->pattern[3] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->style_func_ptr = styleset_latex;
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->comment_open = g_strdup("%");
|
|
|
|
filetypes[GEANY_FILETYPES_LATEX]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_LATEX]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_LATEX]->title, filetypes[GEANY_FILETYPES_LATEX]);
|
2006-02-10 20:53:17 +00:00
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define OMS
|
|
|
|
filetypes[GEANY_FILETYPES_OMS] = g_new0(filetype, 1);
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->id = GEANY_FILETYPES_OMS;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->uid = FILETYPE_UID_OMS;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->lang = -2;
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->name = g_strdup("O-Matrix");
|
|
|
|
filetypes[GEANY_FILETYPES_OMS]->has_tags = FALSE;
|
|
|
|
filetypes[GEANY_FILETYPES_OMS]->title = g_strdup(_("O-Matrix source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_OMS]->extension = g_strdup("oms");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->pattern = g_new0(gchar*, 2);
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->pattern[0] = g_strdup("*.oms");
|
|
|
|
filetypes[GEANY_FILETYPES_OMS]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_OMS]->style_func_ptr = styleset_oms;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_OMS]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_OMS]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_OMS]);
|
2006-02-10 20:53:17 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_OMS]->title, filetypes[GEANY_FILETYPES_OMS]);
|
|
|
|
|
2006-11-13 22:11:19 +00:00
|
|
|
#define VHDL
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->id = GEANY_FILETYPES_VHDL;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->uid = FILETYPE_UID_VHDL;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->item = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->lang = 21;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->name = g_strdup("VHDL");
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->title = g_strdup(_("VHDL source file"));
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->extension = g_strdup("vhd");
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->pattern = g_new0(gchar*, 3);
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->pattern[0] = g_strdup("*.vhd");
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->pattern[1] = g_strdup("*.vhdl");
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->pattern[2] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->style_func_ptr = styleset_vhdl;
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->comment_open = g_strdup("--");
|
|
|
|
filetypes[GEANY_FILETYPES_VHDL]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_VHDL]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_VHDL]->title, filetypes[GEANY_FILETYPES_VHDL]);
|
|
|
|
|
2006-08-27 17:39:34 +00:00
|
|
|
#define DIFF
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->id = GEANY_FILETYPES_DIFF;
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->uid = FILETYPE_UID_DIFF;
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->item = NULL;
|
2006-10-12 23:02:59 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->lang = 20;
|
2006-08-27 17:39:34 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->name = g_strdup("Diff");
|
2006-10-11 19:45:40 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->has_tags = TRUE;
|
2006-08-27 17:39:34 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->title = g_strdup(_("Diff file"));
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->extension = g_strdup("diff");
|
2007-02-08 16:26:45 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->pattern = utils_strv_new("*.diff", "*.patch", "*.rej", NULL);
|
2006-08-27 17:39:34 +00:00
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->style_func_ptr = styleset_diff;
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_DIFF]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_DIFF]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_DIFF]->title, filetypes[GEANY_FILETYPES_DIFF]);
|
|
|
|
|
2006-07-25 10:13:35 +00:00
|
|
|
#define CONF
|
|
|
|
filetypes[GEANY_FILETYPES_CONF] = g_new0(filetype, 1);
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->id = GEANY_FILETYPES_CONF;
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CONF]->uid = FILETYPE_UID_CONF;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CONF]->item = NULL;
|
2006-07-25 10:13:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_CONF]->lang = 10;
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->name = g_strdup("Conf");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->has_tags = TRUE;
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->title = g_strdup(_("Config file"));
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->extension = g_strdup("conf");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern = g_new0(gchar*, 6);
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern[0] = g_strdup("*.conf");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern[1] = g_strdup("*.ini");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern[2] = g_strdup("config");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern[3] = g_strdup("*rc");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern[4] = g_strdup("*.cfg");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->pattern[5] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->style_func_ptr = styleset_conf;
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->comment_open = g_strdup("#");
|
|
|
|
filetypes[GEANY_FILETYPES_CONF]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_CONF]);
|
|
|
|
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_CONF]->title, filetypes[GEANY_FILETYPES_CONF]);
|
2006-07-09 14:41:53 +00:00
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
#define ALL
|
|
|
|
filetypes[GEANY_FILETYPES_ALL] = g_new0(filetype, 1);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->id = GEANY_FILETYPES_ALL;
|
|
|
|
filetypes[GEANY_FILETYPES_ALL]->name = g_strdup("None");
|
2006-08-05 12:25:49 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->uid = FILETYPE_UID_ALL;
|
2006-08-03 22:17:10 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->item = NULL;
|
2006-06-24 14:36:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->lang = -2;
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->has_tags = FALSE;
|
|
|
|
filetypes[GEANY_FILETYPES_ALL]->title = g_strdup(_("All files"));
|
|
|
|
filetypes[GEANY_FILETYPES_ALL]->extension = g_strdup("*");
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->pattern = g_new0(gchar*, 2);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->pattern[0] = g_strdup("*");
|
|
|
|
filetypes[GEANY_FILETYPES_ALL]->pattern[1] = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_ALL]->style_func_ptr = styleset_none;
|
2006-04-27 18:06:35 +00:00
|
|
|
filetypes[GEANY_FILETYPES_ALL]->comment_open = NULL;
|
|
|
|
filetypes[GEANY_FILETYPES_ALL]->comment_close = NULL;
|
|
|
|
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_ALL]);
|
2005-11-22 12:26:26 +00:00
|
|
|
filetypes_create_menu_item(filetype_menu, _("None"), filetypes[GEANY_FILETYPES_ALL]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-01 16:14:45 +00:00
|
|
|
/* convenience function - NULLs and zeros struct members */
|
2006-04-27 18:06:35 +00:00
|
|
|
static void filetypes_init_build_programs(filetype *ftype)
|
|
|
|
{
|
|
|
|
ftype->programs = g_new0(struct build_programs, 1);
|
2006-05-10 19:54:44 +00:00
|
|
|
|
2006-11-30 15:42:52 +00:00
|
|
|
ftype->actions = g_new0(struct build_actions, 1);
|
2006-04-27 18:06:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-06 23:23:05 +00:00
|
|
|
static filetype *find_shebang(gint idx)
|
|
|
|
{
|
|
|
|
gchar *line = sci_get_line(doc_list[idx].sci, 0);
|
|
|
|
filetype *ft = NULL;
|
|
|
|
|
|
|
|
if (strlen(line) > 2 && line[0] == '#' && line[1]=='!')
|
|
|
|
{
|
|
|
|
/// TODO does g_path_get_basename() also work under Win32 for Unix filenames?
|
|
|
|
gchar *basename_interpreter = g_path_get_basename(line + 2);
|
|
|
|
|
|
|
|
if (strncmp(basename_interpreter, "sh", 2) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_SH];
|
|
|
|
else if (strncmp(basename_interpreter, "bash", 4) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_SH];
|
|
|
|
else if (strncmp(basename_interpreter, "perl", 4) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_PERL];
|
|
|
|
else if (strncmp(basename_interpreter, "python", 6) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_PYTHON];
|
|
|
|
else if (strncmp(basename_interpreter, "php", 3) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_PHP];
|
|
|
|
else if (strncmp(basename_interpreter, "ruby", 4) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_RUBY];
|
|
|
|
else if (strncmp(basename_interpreter, "tcl", 3) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_TCL];
|
|
|
|
else if (strncmp(basename_interpreter, "zsh", 3) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_SH];
|
|
|
|
else if (strncmp(basename_interpreter, "ksh", 3) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_SH];
|
|
|
|
else if (strncmp(basename_interpreter, "csh", 3) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_SH];
|
2006-10-22 17:30:24 +00:00
|
|
|
else if (strncmp(basename_interpreter, "dmd", 3) == 0)
|
|
|
|
ft = filetypes[GEANY_FILETYPES_D];
|
2006-10-06 23:23:05 +00:00
|
|
|
// what else to add?
|
|
|
|
|
|
|
|
g_free(basename_interpreter);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free(line);
|
|
|
|
return ft;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
/* simple filetype selection based on the filename extension */
|
2006-10-06 23:23:05 +00:00
|
|
|
filetype *filetypes_get_from_filename(gint idx)
|
2005-11-22 12:26:26 +00:00
|
|
|
{
|
|
|
|
GPatternSpec *pattern;
|
2006-10-06 23:23:05 +00:00
|
|
|
filetype *ft;
|
|
|
|
gchar *filename;
|
2006-01-23 17:05:29 +00:00
|
|
|
gchar *base_filename, *utf8_filename;
|
2005-11-22 12:26:26 +00:00
|
|
|
gint i, j;
|
|
|
|
|
2006-10-06 23:23:05 +00:00
|
|
|
if (! DOC_IDX_VALID(idx))
|
2006-07-22 13:52:07 +00:00
|
|
|
return filetypes[GEANY_FILETYPES_ALL];
|
2006-10-06 23:23:05 +00:00
|
|
|
|
|
|
|
// try to find a shebang and if found use it prior to the filename extension
|
|
|
|
ft = find_shebang(idx);
|
|
|
|
if (ft != NULL) return ft;
|
|
|
|
|
|
|
|
if (doc_list[idx].file_name == NULL)
|
|
|
|
return filetypes[GEANY_FILETYPES_ALL];
|
|
|
|
else
|
|
|
|
filename = doc_list[idx].file_name;
|
2006-01-23 17:05:29 +00:00
|
|
|
|
|
|
|
// try to get the UTF-8 equivalent for the filename
|
2006-02-10 20:53:17 +00:00
|
|
|
utf8_filename = g_locale_to_utf8(filename, -1, NULL, NULL, NULL);
|
2006-01-23 17:05:29 +00:00
|
|
|
if (utf8_filename == NULL)
|
|
|
|
{
|
2006-07-22 13:52:07 +00:00
|
|
|
return filetypes[GEANY_FILETYPES_ALL];
|
2006-01-23 17:05:29 +00:00
|
|
|
}
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
// to match against the basename of the file(because of Makefile*)
|
2006-01-23 17:05:29 +00:00
|
|
|
base_filename = g_path_get_basename(utf8_filename);
|
2006-02-10 20:53:17 +00:00
|
|
|
g_free(utf8_filename);
|
2006-02-25 22:30:45 +00:00
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
for(i = 0; i < GEANY_MAX_FILE_TYPES; i++)
|
|
|
|
{
|
2006-07-22 13:52:07 +00:00
|
|
|
for (j = 0; filetypes[i]->pattern[j] != NULL; j++)
|
2005-11-22 12:26:26 +00:00
|
|
|
{
|
|
|
|
pattern = g_pattern_spec_new(filetypes[i]->pattern[j]);
|
|
|
|
if (g_pattern_match_string(pattern, base_filename))
|
|
|
|
{
|
|
|
|
g_free(base_filename);
|
|
|
|
g_pattern_spec_free(pattern);
|
|
|
|
return filetypes[i];
|
|
|
|
}
|
|
|
|
g_pattern_spec_free(pattern);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free(base_filename);
|
|
|
|
return filetypes[GEANY_FILETYPES_ALL];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-08-03 22:17:10 +00:00
|
|
|
void filetypes_select_radio_item(const filetype *ft)
|
|
|
|
{
|
|
|
|
// app->ignore_callback has to be set by the caller
|
2006-08-04 21:03:12 +00:00
|
|
|
if (ft == NULL)
|
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
|
|
|
|
radio_items[filetypes[GEANY_FILETYPES_ALL]->id]), TRUE);
|
|
|
|
else
|
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(radio_items[ft->id]), TRUE);
|
2006-08-03 22:17:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-02-19 13:26:06 +00:00
|
|
|
static void
|
|
|
|
on_filetype_change (GtkMenuItem *menuitem,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gint idx = document_get_cur_idx();
|
|
|
|
if (app->ignore_callback || idx < 0 || ! doc_list[idx].is_valid) return;
|
|
|
|
|
|
|
|
document_set_filetype(idx, (filetype*)user_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
static void filetypes_create_menu_item(GtkWidget *menu, gchar *label, filetype *ftype)
|
2005-11-22 12:26:26 +00:00
|
|
|
{
|
2006-08-03 22:17:10 +00:00
|
|
|
static GSList *group = NULL;
|
|
|
|
GtkWidget *tmp;
|
|
|
|
tmp = gtk_radio_menu_item_new_with_label(group, label);
|
|
|
|
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(tmp));
|
|
|
|
radio_items[ftype->id] = tmp;
|
2005-11-22 12:26:26 +00:00
|
|
|
gtk_widget_show(tmp);
|
|
|
|
gtk_container_add(GTK_CONTAINER(menu), tmp);
|
|
|
|
g_signal_connect((gpointer) tmp, "activate", G_CALLBACK(on_filetype_change), (gpointer) ftype);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* frees the array and all related pointers */
|
2006-10-06 23:23:05 +00:00
|
|
|
void filetypes_free_types()
|
2005-11-22 12:26:26 +00:00
|
|
|
{
|
2006-02-25 22:30:45 +00:00
|
|
|
gint i;
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
for(i = 0; i < GEANY_MAX_FILE_TYPES; i++)
|
|
|
|
{
|
|
|
|
if (filetypes[i])
|
|
|
|
{
|
|
|
|
g_free(filetypes[i]->name);
|
|
|
|
g_free(filetypes[i]->title);
|
|
|
|
g_free(filetypes[i]->extension);
|
2006-04-27 18:06:35 +00:00
|
|
|
g_free(filetypes[i]->comment_open);
|
|
|
|
g_free(filetypes[i]->comment_close);
|
|
|
|
g_free(filetypes[i]->programs->compiler);
|
|
|
|
g_free(filetypes[i]->programs->linker);
|
|
|
|
g_free(filetypes[i]->programs->run_cmd);
|
|
|
|
g_free(filetypes[i]->programs->run_cmd2);
|
|
|
|
g_free(filetypes[i]->programs);
|
2006-11-30 15:42:52 +00:00
|
|
|
g_free(filetypes[i]->actions);
|
2006-01-10 17:30:53 +00:00
|
|
|
|
2006-02-25 22:30:45 +00:00
|
|
|
g_strfreev(filetypes[i]->pattern);
|
2006-01-10 17:30:53 +00:00
|
|
|
g_free(filetypes[i]);
|
2005-11-22 12:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
void filetypes_get_config(GKeyFile *config, GKeyFile *configh, gint ft)
|
2006-04-27 18:06:35 +00:00
|
|
|
{
|
|
|
|
gchar *result;
|
|
|
|
GError *error = NULL;
|
|
|
|
gboolean tmp;
|
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
if (config == NULL || configh == NULL || ft < 0 || ft >= GEANY_MAX_FILE_TYPES) return;
|
2006-04-27 18:06:35 +00:00
|
|
|
|
|
|
|
// read comment notes
|
2006-05-15 19:49:30 +00:00
|
|
|
result = g_key_file_get_string(configh, "settings", "comment_open", NULL);
|
|
|
|
if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_open", NULL);
|
2006-04-27 18:06:35 +00:00
|
|
|
if (result != NULL)
|
|
|
|
{
|
|
|
|
g_free(filetypes[ft]->comment_open);
|
|
|
|
filetypes[ft]->comment_open = result;
|
2006-05-10 19:54:44 +00:00
|
|
|
}
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
result = g_key_file_get_string(configh, "settings", "comment_close", NULL);
|
|
|
|
if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_close", NULL);
|
2006-04-27 18:06:35 +00:00
|
|
|
if (result != NULL)
|
|
|
|
{
|
|
|
|
g_free(filetypes[ft]->comment_close);
|
|
|
|
filetypes[ft]->comment_close = result;
|
|
|
|
}
|
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
tmp = g_key_file_get_boolean(configh, "settings", "comment_use_indent", &error);
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
g_error_free(error);
|
|
|
|
error = NULL;
|
|
|
|
tmp = g_key_file_get_boolean(config, "settings", "comment_use_indent", &error);
|
|
|
|
if (error) g_error_free(error);
|
|
|
|
else filetypes[ft]->comment_use_indent = tmp;
|
|
|
|
}
|
2006-04-27 18:06:35 +00:00
|
|
|
else filetypes[ft]->comment_use_indent = tmp;
|
2006-05-10 19:54:44 +00:00
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
// read build settings
|
2006-05-15 19:49:30 +00:00
|
|
|
result = g_key_file_get_string(configh, "build_settings", "compiler", NULL);
|
|
|
|
if (result == NULL) result = g_key_file_get_string(config, "build_settings", "compiler", NULL);
|
2006-04-27 18:06:35 +00:00
|
|
|
if (result != NULL)
|
|
|
|
{
|
|
|
|
filetypes[ft]->programs->compiler = result;
|
2006-11-30 15:42:52 +00:00
|
|
|
filetypes[ft]->actions->can_compile = TRUE;
|
2006-05-10 19:54:44 +00:00
|
|
|
}
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
result = g_key_file_get_string(configh, "build_settings", "linker", NULL);
|
|
|
|
if (result == NULL) result = g_key_file_get_string(config, "build_settings", "linker", NULL);
|
2006-04-27 18:06:35 +00:00
|
|
|
if (result != NULL)
|
|
|
|
{
|
|
|
|
filetypes[ft]->programs->linker = result;
|
2006-11-30 15:42:52 +00:00
|
|
|
filetypes[ft]->actions->can_link = TRUE;
|
2006-05-10 19:54:44 +00:00
|
|
|
}
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
result = g_key_file_get_string(configh, "build_settings", "run_cmd", NULL);
|
|
|
|
if (result == NULL) result = g_key_file_get_string(config, "build_settings", "run_cmd", NULL);
|
2006-04-27 18:06:35 +00:00
|
|
|
if (result != NULL)
|
|
|
|
{
|
|
|
|
filetypes[ft]->programs->run_cmd = result;
|
2006-11-30 15:42:52 +00:00
|
|
|
filetypes[ft]->actions->can_exec = TRUE;
|
2006-05-10 19:54:44 +00:00
|
|
|
}
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2006-05-15 19:49:30 +00:00
|
|
|
result = g_key_file_get_string(configh, "build_settings", "run_cmd2", NULL);
|
|
|
|
if (result == NULL) result = g_key_file_get_string(config, "build_settings", "run_cmd2", NULL);
|
2006-04-27 18:06:35 +00:00
|
|
|
if (result != NULL)
|
|
|
|
{
|
|
|
|
filetypes[ft]->programs->run_cmd2 = result;
|
2006-11-30 15:42:52 +00:00
|
|
|
filetypes[ft]->actions->can_exec = TRUE;
|
2006-05-10 19:54:44 +00:00
|
|
|
}
|
2006-04-27 18:06:35 +00:00
|
|
|
}
|
2006-08-20 20:39:59 +00:00
|
|
|
|
|
|
|
|
2006-10-27 11:30:23 +00:00
|
|
|
gchar *filetypes_get_conf_extension(gint filetype_idx)
|
2006-10-01 16:14:45 +00:00
|
|
|
{
|
|
|
|
gchar *result, *tmp = g_strdup(filetypes[filetype_idx]->name);
|
|
|
|
|
2007-02-19 13:26:06 +00:00
|
|
|
// Handle any special extensions different from lowercase filetype->name
|
2006-10-01 16:14:45 +00:00
|
|
|
switch (filetype_idx)
|
|
|
|
{
|
|
|
|
case GEANY_FILETYPES_CPP: result = g_strdup("cpp"); break;
|
|
|
|
case GEANY_FILETYPES_MAKE: result = g_strdup("makefile"); break;
|
|
|
|
case GEANY_FILETYPES_OMS: result = g_strdup("oms"); break;
|
|
|
|
default: result = g_ascii_strdown(tmp, -1); break;
|
|
|
|
}
|
|
|
|
g_free(tmp);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void filetypes_save_commands()
|
|
|
|
{
|
|
|
|
gchar *conf_prefix = g_strconcat(app->configdir,
|
|
|
|
G_DIR_SEPARATOR_S GEANY_FILEDEFS_SUBDIR G_DIR_SEPARATOR_S "filetypes.", NULL);
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < GEANY_FILETYPES_ALL; i++)
|
|
|
|
{
|
|
|
|
struct build_programs *bp = filetypes[i]->programs;
|
|
|
|
GKeyFile *config_home;
|
|
|
|
gchar *fname, *ext, *data;
|
|
|
|
|
|
|
|
if (! bp->modified) continue;
|
2006-10-04 19:14:57 +00:00
|
|
|
|
2006-10-27 11:30:23 +00:00
|
|
|
ext = filetypes_get_conf_extension(i);
|
2006-10-01 16:14:45 +00:00
|
|
|
fname = g_strconcat(conf_prefix, ext, NULL);
|
|
|
|
g_free(ext);
|
|
|
|
|
|
|
|
config_home = g_key_file_new();
|
|
|
|
g_key_file_load_from_file(config_home, fname, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
|
|
|
|
|
|
|
if (bp->compiler && *bp->compiler)
|
|
|
|
g_key_file_set_string(config_home, "build_settings", "compiler", bp->compiler);
|
|
|
|
if (bp->linker && *bp->linker)
|
|
|
|
g_key_file_set_string(config_home, "build_settings", "linker", bp->linker);
|
|
|
|
if (bp->run_cmd && *bp->run_cmd)
|
|
|
|
g_key_file_set_string(config_home, "build_settings", "run_cmd", bp->run_cmd);
|
|
|
|
if (bp->run_cmd2 && *bp->run_cmd2)
|
|
|
|
g_key_file_set_string(config_home, "build_settings", "run_cmd2", bp->run_cmd2);
|
|
|
|
|
|
|
|
data = g_key_file_to_data(config_home, NULL, NULL);
|
|
|
|
utils_write_file(fname, data);
|
|
|
|
g_free(data);
|
|
|
|
g_key_file_free(config_home);
|
|
|
|
g_free(fname);
|
|
|
|
}
|
|
|
|
g_free(conf_prefix);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-08-20 20:39:59 +00:00
|
|
|
GtkFileFilter *filetypes_create_file_filter(filetype *ft)
|
|
|
|
{
|
|
|
|
GtkFileFilter *new_filter;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
new_filter = gtk_file_filter_new();
|
|
|
|
gtk_file_filter_set_name(new_filter, ft->title);
|
|
|
|
|
|
|
|
// (GEANY_FILETYPES_MAX_PATTERNS - 1) because the last field in pattern is NULL
|
|
|
|
//for (i = 0; i < (GEANY_MAX_PATTERNS - 1) && ft->pattern[i]; i++)
|
|
|
|
for (i = 0; ft->pattern[i]; i++)
|
|
|
|
{
|
|
|
|
gtk_file_filter_add_pattern(new_filter, ft->pattern[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return new_filter;
|
|
|
|
}
|
|
|
|
|
|
|
|
|