Revision: 4444 http://geany.svn.sourceforge.net/geany/?rev=4444&view=rev Author: ntrel Date: 2009-11-24 15:47:44 +0000 (Tue, 24 Nov 2009)
Log Message: ----------- Make stylesets take a ft_id argument so they can be reused fully with custom filetypes, so custom styles and keywords can be set.
Modified Paths: -------------- trunk/ChangeLog trunk/src/highlighting.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-11-23 23:03:39 UTC (rev 4443) +++ trunk/ChangeLog 2009-11-24 15:47:44 UTC (rev 4444) @@ -1,3 +1,10 @@ +2009-11-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/highlighting.c: + Make stylesets take a ft_id argument so they can be reused fully with + custom filetypes, so custom styles and keywords can be set. + + 2009-11-23 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/php.c:
Modified: trunk/src/highlighting.c =================================================================== --- trunk/src/highlighting.c 2009-11-23 23:03:39 UTC (rev 4443) +++ trunk/src/highlighting.c 2009-11-24 15:47:44 UTC (rev 4444) @@ -937,103 +937,95 @@
static void styleset_c_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - styleset_c_like_init(config, config_home, GEANY_FILETYPES_C); + styleset_c_like_init(config, config_home, ft_id);
- style_sets[GEANY_FILETYPES_C].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_C, 0); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_C, 1); - get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_C, 2); - style_sets[GEANY_FILETYPES_C].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); + get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_c(ScintillaObject *sci) +static void styleset_c(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_C; - styleset_c_like(sci, ft_id, TRUE, TRUE);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_C].keywords[0]); - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_C].keywords[2]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]);
/* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[GEANY_FILETYPES_C].keywords[1], + assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang); }
static void styleset_cpp_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - styleset_c_like_init(config, config_home, GEANY_FILETYPES_CPP); + styleset_c_like_init(config, config_home, ft_id);
- style_sets[GEANY_FILETYPES_CPP].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_CPP, 0); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CPP, 1); - get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_CPP, 2); - style_sets[GEANY_FILETYPES_CPP].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); + get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_cpp(ScintillaObject *sci) +static void styleset_cpp(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_CPP; - styleset_c_like(sci, ft_id, TRUE, TRUE);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_CPP].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); /* for SCI_SETKEYWORDS = 1, see below*/ - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_CPP].keywords[2]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]);
/* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[GEANY_FILETYPES_CPP].keywords[1], + assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang); }
static void styleset_glsl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - styleset_c_like_init(config, config_home, GEANY_FILETYPES_GLSL); + styleset_c_like_init(config, config_home, ft_id);
- style_sets[GEANY_FILETYPES_GLSL].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_GLSL, 0); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_GLSL, 1); - get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_GLSL, 2); - style_sets[GEANY_FILETYPES_GLSL].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); + get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_glsl(ScintillaObject *sci) +static void styleset_glsl(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_GLSL; - styleset_c_like(sci, ft_id, TRUE, TRUE);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_GLSL].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); /* for SCI_SETKEYWORDS = 1, see below*/ - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_GLSL].keywords[2]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]);
/* assign global types, merge them with user defined keywords and set them */ - assign_global_and_user_keywords(sci, style_sets[GEANY_FILETYPES_GLSL].keywords[1], + assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang); }
static void styleset_cs_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - styleset_c_like_init(config, config_home, GEANY_FILETYPES_CS); + styleset_c_like_init(config, config_home, ft_id);
- style_sets[GEANY_FILETYPES_CS].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_CS, 0); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CS, 1); - get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_CS, 2); - style_sets[GEANY_FILETYPES_CS].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); + get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_cs(ScintillaObject *sci) +static void styleset_cs(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_CS; - styleset_c_like(sci, ft_id, TRUE, FALSE);
sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); @@ -1046,20 +1038,18 @@
static void styleset_vala_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - styleset_c_like_init(config, config_home, GEANY_FILETYPES_VALA); + styleset_c_like_init(config, config_home, ft_id);
- style_sets[GEANY_FILETYPES_VALA].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_VALA, 0); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_VALA, 1); - get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_VALA, 2); - style_sets[GEANY_FILETYPES_VALA].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); + get_keyfile_keywords(config, config_home, "docComment", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_vala(ScintillaObject *sci) +static void styleset_vala(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_VALA; - styleset_c_like(sci, ft_id, TRUE, FALSE);
sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); @@ -1072,165 +1062,155 @@
static void styleset_pascal_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_PASCAL, 15); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_PASCAL].styling[0]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_PASCAL].styling[1]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_PASCAL].styling[2]); - get_keyfile_style(config, config_home, "comment2", &style_sets[GEANY_FILETYPES_PASCAL].styling[3]); - get_keyfile_style(config, config_home, "commentline", &style_sets[GEANY_FILETYPES_PASCAL].styling[4]); - get_keyfile_style(config, config_home, "preprocessor", &style_sets[GEANY_FILETYPES_PASCAL].styling[5]); - get_keyfile_style(config, config_home, "preprocessor2", &style_sets[GEANY_FILETYPES_PASCAL].styling[6]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_PASCAL].styling[7]); - get_keyfile_style(config, config_home, "hexnumber", &style_sets[GEANY_FILETYPES_PASCAL].styling[8]); - get_keyfile_style(config, config_home, "word", &style_sets[GEANY_FILETYPES_PASCAL].styling[9]); - get_keyfile_style(config, config_home, "string", &style_sets[GEANY_FILETYPES_PASCAL].styling[10]); - get_keyfile_style(config, config_home, "stringeol", &style_sets[GEANY_FILETYPES_PASCAL].styling[11]); - get_keyfile_style(config, config_home, "character", &style_sets[GEANY_FILETYPES_PASCAL].styling[12]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_PASCAL].styling[13]); - get_keyfile_style(config, config_home, "asm", &style_sets[GEANY_FILETYPES_PASCAL].styling[14]); + new_styleset(ft_id, 15); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "comment2", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "commentline", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "preprocessor", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "preprocessor2", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "hexnumber", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "word", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "string", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "stringeol", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "character", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "asm", &style_sets[ft_id].styling[14]);
- style_sets[GEANY_FILETYPES_PASCAL].keywords = g_new(gchar*, 2); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_PASCAL, 0); - style_sets[GEANY_FILETYPES_PASCAL].keywords[1] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 2); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + style_sets[ft_id].keywords[1] = NULL; }
-static void styleset_pascal(ScintillaObject *sci) +static void styleset_pascal(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_PASCAL; - apply_filetype_properties(sci, SCLEX_PASCAL, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_PASCAL].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PASCAL, 0); - set_sci_style(sci, SCE_PAS_DEFAULT, GEANY_FILETYPES_PASCAL, 0); - set_sci_style(sci, SCE_PAS_IDENTIFIER, GEANY_FILETYPES_PASCAL, 1); - set_sci_style(sci, SCE_PAS_COMMENT, GEANY_FILETYPES_PASCAL, 2); - set_sci_style(sci, SCE_PAS_COMMENT2, GEANY_FILETYPES_PASCAL, 3); - set_sci_style(sci, SCE_PAS_COMMENTLINE, GEANY_FILETYPES_PASCAL, 4); - set_sci_style(sci, SCE_PAS_PREPROCESSOR, GEANY_FILETYPES_PASCAL, 5); - set_sci_style(sci, SCE_PAS_PREPROCESSOR2, GEANY_FILETYPES_PASCAL, 6); - set_sci_style(sci, SCE_PAS_NUMBER, GEANY_FILETYPES_PASCAL, 7); - set_sci_style(sci, SCE_PAS_HEXNUMBER, GEANY_FILETYPES_PASCAL, 8); - set_sci_style(sci, SCE_PAS_WORD, GEANY_FILETYPES_PASCAL, 9); - set_sci_style(sci, SCE_PAS_STRING, GEANY_FILETYPES_PASCAL, 10); - set_sci_style(sci, SCE_PAS_STRINGEOL, GEANY_FILETYPES_PASCAL, 11); - set_sci_style(sci, SCE_PAS_CHARACTER, GEANY_FILETYPES_PASCAL, 12); - set_sci_style(sci, SCE_PAS_OPERATOR, GEANY_FILETYPES_PASCAL, 13); - set_sci_style(sci, SCE_PAS_ASM, GEANY_FILETYPES_PASCAL, 14); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_PAS_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_PAS_IDENTIFIER, ft_id, 1); + set_sci_style(sci, SCE_PAS_COMMENT, ft_id, 2); + set_sci_style(sci, SCE_PAS_COMMENT2, ft_id, 3); + set_sci_style(sci, SCE_PAS_COMMENTLINE, ft_id, 4); + set_sci_style(sci, SCE_PAS_PREPROCESSOR, ft_id, 5); + set_sci_style(sci, SCE_PAS_PREPROCESSOR2, ft_id, 6); + set_sci_style(sci, SCE_PAS_NUMBER, ft_id, 7); + set_sci_style(sci, SCE_PAS_HEXNUMBER, ft_id, 8); + set_sci_style(sci, SCE_PAS_WORD, ft_id, 9); + set_sci_style(sci, SCE_PAS_STRING, ft_id, 10); + set_sci_style(sci, SCE_PAS_STRINGEOL, ft_id, 11); + set_sci_style(sci, SCE_PAS_CHARACTER, ft_id, 12); + set_sci_style(sci, SCE_PAS_OPERATOR, ft_id, 13); + set_sci_style(sci, SCE_PAS_ASM, ft_id, 14); }
static void styleset_makefile_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_MAKE, 7); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_MAKE].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_MAKE].styling[1]); - get_keyfile_style(config, config_home, "preprocessor", &style_sets[GEANY_FILETYPES_MAKE].styling[2]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_MAKE].styling[3]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_MAKE].styling[4]); - get_keyfile_style(config, config_home, "target", &style_sets[GEANY_FILETYPES_MAKE].styling[5]); - get_keyfile_style(config, config_home, "ideol", &style_sets[GEANY_FILETYPES_MAKE].styling[6]); + new_styleset(ft_id, 7); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "preprocessor", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "target", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "ideol", &style_sets[ft_id].styling[6]);
- style_sets[GEANY_FILETYPES_MAKE].keywords = NULL; + style_sets[ft_id].keywords = NULL; }
-static void styleset_makefile(ScintillaObject *sci) +static void styleset_makefile(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_MAKE; - apply_filetype_properties(sci, SCLEX_MAKEFILE, ft_id);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_MAKE, 0); - set_sci_style(sci, SCE_MAKE_DEFAULT, GEANY_FILETYPES_MAKE, 0); - set_sci_style(sci, SCE_MAKE_COMMENT, GEANY_FILETYPES_MAKE, 1); - set_sci_style(sci, SCE_MAKE_PREPROCESSOR, GEANY_FILETYPES_MAKE, 2); - set_sci_style(sci, SCE_MAKE_IDENTIFIER, GEANY_FILETYPES_MAKE, 3); - set_sci_style(sci, SCE_MAKE_OPERATOR, GEANY_FILETYPES_MAKE, 4); - set_sci_style(sci, SCE_MAKE_TARGET, GEANY_FILETYPES_MAKE, 5); - set_sci_style(sci, SCE_MAKE_IDEOL, GEANY_FILETYPES_MAKE, 6); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_MAKE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_MAKE_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_MAKE_PREPROCESSOR, ft_id, 2); + set_sci_style(sci, SCE_MAKE_IDENTIFIER, ft_id, 3); + set_sci_style(sci, SCE_MAKE_OPERATOR, ft_id, 4); + set_sci_style(sci, SCE_MAKE_TARGET, ft_id, 5); + set_sci_style(sci, SCE_MAKE_IDEOL, ft_id, 6); }
static void styleset_diff_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_DIFF, 8); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_DIFF].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_DIFF].styling[1]); - get_keyfile_style(config, config_home, "command", &style_sets[GEANY_FILETYPES_DIFF].styling[2]); - get_keyfile_style(config, config_home, "header", &style_sets[GEANY_FILETYPES_DIFF].styling[3]); - get_keyfile_style(config, config_home, "position", &style_sets[GEANY_FILETYPES_DIFF].styling[4]); - get_keyfile_style(config, config_home, "deleted", &style_sets[GEANY_FILETYPES_DIFF].styling[5]); - get_keyfile_style(config, config_home, "added", &style_sets[GEANY_FILETYPES_DIFF].styling[6]); - get_keyfile_style(config, config_home, "changed", &style_sets[GEANY_FILETYPES_DIFF].styling[7]); + new_styleset(ft_id, 8); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "command", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "header", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "position", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "deleted", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "added", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "changed", &style_sets[ft_id].styling[7]);
- style_sets[GEANY_FILETYPES_DIFF].keywords = NULL; + style_sets[ft_id].keywords = NULL; }
-static void styleset_diff(ScintillaObject *sci) +static void styleset_diff(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_DIFF; - apply_filetype_properties(sci, SCLEX_DIFF, ft_id);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_DIFF, 0); - set_sci_style(sci, SCE_DIFF_DEFAULT, GEANY_FILETYPES_DIFF, 0); - set_sci_style(sci, SCE_DIFF_COMMENT, GEANY_FILETYPES_DIFF, 1); - set_sci_style(sci, SCE_DIFF_COMMAND, GEANY_FILETYPES_DIFF, 2); - set_sci_style(sci, SCE_DIFF_HEADER, GEANY_FILETYPES_DIFF, 3); - set_sci_style(sci, SCE_DIFF_POSITION, GEANY_FILETYPES_DIFF, 4); - set_sci_style(sci, SCE_DIFF_DELETED, GEANY_FILETYPES_DIFF, 5); - set_sci_style(sci, SCE_DIFF_ADDED, GEANY_FILETYPES_DIFF, 6); - set_sci_style(sci, SCE_DIFF_CHANGED, GEANY_FILETYPES_DIFF, 7); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_DIFF_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_DIFF_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_DIFF_COMMAND, ft_id, 2); + set_sci_style(sci, SCE_DIFF_HEADER, ft_id, 3); + set_sci_style(sci, SCE_DIFF_POSITION, ft_id, 4); + set_sci_style(sci, SCE_DIFF_DELETED, ft_id, 5); + set_sci_style(sci, SCE_DIFF_ADDED, ft_id, 6); + set_sci_style(sci, SCE_DIFF_CHANGED, ft_id, 7); }
static void styleset_latex_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_LATEX, 5); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_LATEX].styling[0]); - get_keyfile_style(config, config_home, "command", &style_sets[GEANY_FILETYPES_LATEX].styling[1]); - get_keyfile_style(config, config_home, "tag", &style_sets[GEANY_FILETYPES_LATEX].styling[2]); - get_keyfile_style(config, config_home, "math", &style_sets[GEANY_FILETYPES_LATEX].styling[3]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_LATEX].styling[4]); + new_styleset(ft_id, 5); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "command", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "tag", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "math", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[4]);
- style_sets[GEANY_FILETYPES_LATEX].keywords = g_new(gchar*, 2); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_LATEX, 0); - style_sets[GEANY_FILETYPES_LATEX].keywords[1] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 2); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + style_sets[ft_id].keywords[1] = NULL; }
-static void styleset_latex(ScintillaObject *sci) +static void styleset_latex(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_LATEX; - apply_filetype_properties(sci, SCLEX_LATEX, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_LATEX].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_LATEX, 0); - set_sci_style(sci, SCE_L_DEFAULT, GEANY_FILETYPES_LATEX, 0); - set_sci_style(sci, SCE_L_COMMAND, GEANY_FILETYPES_LATEX, 1); - set_sci_style(sci, SCE_L_TAG, GEANY_FILETYPES_LATEX, 2); - set_sci_style(sci, SCE_L_MATH, GEANY_FILETYPES_LATEX, 3); - set_sci_style(sci, SCE_L_COMMENT, GEANY_FILETYPES_LATEX, 4); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_L_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_L_COMMAND, ft_id, 1); + set_sci_style(sci, SCE_L_TAG, ft_id, 2); + set_sci_style(sci, SCE_L_MATH, ft_id, 3); + set_sci_style(sci, SCE_L_COMMENT, ft_id, 4); }
static void styleset_php_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - style_sets[GEANY_FILETYPES_PHP].styling = NULL; - style_sets[GEANY_FILETYPES_PHP].keywords = NULL; + style_sets[ft_id].styling = NULL; + style_sets[ft_id].keywords = NULL; }
-static void styleset_php(ScintillaObject *sci) +static void styleset_php(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_PHP; - apply_filetype_properties(sci, SCLEX_HTML, ft_id);
/* use the same colouring as for XML */ @@ -1240,15 +1220,13 @@
static void styleset_html_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - style_sets[GEANY_FILETYPES_HTML].styling = NULL; - style_sets[GEANY_FILETYPES_HTML].keywords = NULL; + style_sets[ft_id].styling = NULL; + style_sets[ft_id].keywords = NULL; }
-static void styleset_html(ScintillaObject *sci) +static void styleset_html(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_HTML; - apply_filetype_properties(sci, SCLEX_HTML, ft_id);
/* use the same colouring for HTML; XML and so on */ @@ -1490,27 +1468,25 @@
static void styleset_java_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - styleset_c_like_init(config, config_home, GEANY_FILETYPES_JAVA); + styleset_c_like_init(config, config_home, ft_id);
- style_sets[GEANY_FILETYPES_JAVA].keywords = g_new(gchar*, 5); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_JAVA, 0); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_JAVA, 1); - get_keyfile_keywords(config, config_home, "doccomment", GEANY_FILETYPES_JAVA, 2); - get_keyfile_keywords(config, config_home, "typedefs", GEANY_FILETYPES_JAVA, 3); - style_sets[GEANY_FILETYPES_JAVA].keywords[4] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 5); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 1); + get_keyfile_keywords(config, config_home, "doccomment", ft_id, 2); + get_keyfile_keywords(config, config_home, "typedefs", ft_id, 3); + style_sets[ft_id].keywords[4] = NULL; }
-static void styleset_java(ScintillaObject *sci) +static void styleset_java(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_JAVA; - styleset_c_like(sci, ft_id, FALSE, FALSE);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_JAVA].keywords[0]); - sci_set_keywords(sci, 1, style_sets[GEANY_FILETYPES_JAVA].keywords[1]); - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_JAVA].keywords[2]); - sci_set_keywords(sci, 4, style_sets[GEANY_FILETYPES_JAVA].keywords[3]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 1, style_sets[ft_id].keywords[1]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]); + sci_set_keywords(sci, 4, style_sets[ft_id].keywords[3]);
/* assign global types, merge them with user defined keywords and set them */ assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang); @@ -1519,406 +1495,392 @@
static void styleset_perl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_PERL, 35); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_PERL].styling[0]); - get_keyfile_style(config, config_home, "error", &style_sets[GEANY_FILETYPES_PERL].styling[1]); - get_keyfile_style(config, config_home, "commentline", &style_sets[GEANY_FILETYPES_PERL].styling[2]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_PERL].styling[3]); - get_keyfile_style(config, config_home, "word", &style_sets[GEANY_FILETYPES_PERL].styling[4]); - get_keyfile_style(config, config_home, "string", &style_sets[GEANY_FILETYPES_PERL].styling[5]); - get_keyfile_style(config, config_home, "character", &style_sets[GEANY_FILETYPES_PERL].styling[6]); - get_keyfile_style(config, config_home, "preprocessor", &style_sets[GEANY_FILETYPES_PERL].styling[7]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_PERL].styling[8]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_PERL].styling[9]); - get_keyfile_style(config, config_home, "scalar", &style_sets[GEANY_FILETYPES_PERL].styling[10]); - get_keyfile_style(config, config_home, "pod", &style_sets[GEANY_FILETYPES_PERL].styling[11]); - get_keyfile_style(config, config_home, "regex", &style_sets[GEANY_FILETYPES_PERL].styling[12]); - get_keyfile_style(config, config_home, "array", &style_sets[GEANY_FILETYPES_PERL].styling[13]); - get_keyfile_style(config, config_home, "hash", &style_sets[GEANY_FILETYPES_PERL].styling[14]); - get_keyfile_style(config, config_home, "symboltable", &style_sets[GEANY_FILETYPES_PERL].styling[15]); - get_keyfile_style(config, config_home, "backticks", &style_sets[GEANY_FILETYPES_PERL].styling[16]); - get_keyfile_style(config, config_home, "pod_verbatim", &style_sets[GEANY_FILETYPES_PERL].styling[17]); - get_keyfile_style(config, config_home, "reg_subst", &style_sets[GEANY_FILETYPES_PERL].styling[18]); - get_keyfile_style(config, config_home, "datasection", &style_sets[GEANY_FILETYPES_PERL].styling[19]); - get_keyfile_style(config, config_home, "here_delim", &style_sets[GEANY_FILETYPES_PERL].styling[20]); - get_keyfile_style(config, config_home, "here_q", &style_sets[GEANY_FILETYPES_PERL].styling[21]); - get_keyfile_style(config, config_home, "here_qq", &style_sets[GEANY_FILETYPES_PERL].styling[22]); - get_keyfile_style(config, config_home, "here_qx", &style_sets[GEANY_FILETYPES_PERL].styling[23]); - get_keyfile_style(config, config_home, "string_q", &style_sets[GEANY_FILETYPES_PERL].styling[24]); - get_keyfile_style(config, config_home, "string_qq", &style_sets[GEANY_FILETYPES_PERL].styling[25]); - get_keyfile_style(config, config_home, "string_qx", &style_sets[GEANY_FILETYPES_PERL].styling[26]); - get_keyfile_style(config, config_home, "string_qr", &style_sets[GEANY_FILETYPES_PERL].styling[27]); - get_keyfile_style(config, config_home, "string_qw", &style_sets[GEANY_FILETYPES_PERL].styling[28]); - get_keyfile_style(config, config_home, "variable_indexer", &style_sets[GEANY_FILETYPES_PERL].styling[29]); - get_keyfile_style(config, config_home, "punctuation", &style_sets[GEANY_FILETYPES_PERL].styling[30]); - get_keyfile_style(config, config_home, "longquote", &style_sets[GEANY_FILETYPES_PERL].styling[31]); - get_keyfile_style(config, config_home, "sub_prototype", &style_sets[GEANY_FILETYPES_PERL].styling[32]); - get_keyfile_style(config, config_home, "format_ident", &style_sets[GEANY_FILETYPES_PERL].styling[33]); - get_keyfile_style(config, config_home, "format", &style_sets[GEANY_FILETYPES_PERL].styling[34]); + new_styleset(ft_id, 35); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "error", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "commentline", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "word", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "string", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "character", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "preprocessor", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "scalar", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "pod", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "regex", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "array", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "hash", &style_sets[ft_id].styling[14]); + get_keyfile_style(config, config_home, "symboltable", &style_sets[ft_id].styling[15]); + get_keyfile_style(config, config_home, "backticks", &style_sets[ft_id].styling[16]); + get_keyfile_style(config, config_home, "pod_verbatim", &style_sets[ft_id].styling[17]); + get_keyfile_style(config, config_home, "reg_subst", &style_sets[ft_id].styling[18]); + get_keyfile_style(config, config_home, "datasection", &style_sets[ft_id].styling[19]); + get_keyfile_style(config, config_home, "here_delim", &style_sets[ft_id].styling[20]); + get_keyfile_style(config, config_home, "here_q", &style_sets[ft_id].styling[21]); + get_keyfile_style(config, config_home, "here_qq", &style_sets[ft_id].styling[22]); + get_keyfile_style(config, config_home, "here_qx", &style_sets[ft_id].styling[23]); + get_keyfile_style(config, config_home, "string_q", &style_sets[ft_id].styling[24]); + get_keyfile_style(config, config_home, "string_qq", &style_sets[ft_id].styling[25]); + get_keyfile_style(config, config_home, "string_qx", &style_sets[ft_id].styling[26]); + get_keyfile_style(config, config_home, "string_qr", &style_sets[ft_id].styling[27]); + get_keyfile_style(config, config_home, "string_qw", &style_sets[ft_id].styling[28]); + get_keyfile_style(config, config_home, "variable_indexer", &style_sets[ft_id].styling[29]); + get_keyfile_style(config, config_home, "punctuation", &style_sets[ft_id].styling[30]); + get_keyfile_style(config, config_home, "longquote", &style_sets[ft_id].styling[31]); + get_keyfile_style(config, config_home, "sub_prototype", &style_sets[ft_id].styling[32]); + get_keyfile_style(config, config_home, "format_ident", &style_sets[ft_id].styling[33]); + get_keyfile_style(config, config_home, "format", &style_sets[ft_id].styling[34]);
- style_sets[GEANY_FILETYPES_PERL].keywords = g_new(gchar*, 2); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_PERL, 0); - style_sets[GEANY_FILETYPES_PERL].keywords[1] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 2); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + style_sets[ft_id].keywords[1] = NULL; }
-static void styleset_perl(ScintillaObject *sci) +static void styleset_perl(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_PERL; - apply_filetype_properties(sci, SCLEX_PERL, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_PERL].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PERL, 0); - set_sci_style(sci, SCE_PL_DEFAULT, GEANY_FILETYPES_PERL, 0); - set_sci_style(sci, SCE_PL_ERROR, GEANY_FILETYPES_PERL, 1); - set_sci_style(sci, SCE_PL_COMMENTLINE, GEANY_FILETYPES_PERL, 2); - set_sci_style(sci, SCE_PL_NUMBER, GEANY_FILETYPES_PERL, 3); - set_sci_style(sci, SCE_PL_WORD, GEANY_FILETYPES_PERL, 4); - set_sci_style(sci, SCE_PL_STRING, GEANY_FILETYPES_PERL, 5); - set_sci_style(sci, SCE_PL_CHARACTER, GEANY_FILETYPES_PERL, 6); - set_sci_style(sci, SCE_PL_PREPROCESSOR, GEANY_FILETYPES_PERL, 7); - set_sci_style(sci, SCE_PL_OPERATOR, GEANY_FILETYPES_PERL, 8); - set_sci_style(sci, SCE_PL_IDENTIFIER, GEANY_FILETYPES_PERL, 9); - set_sci_style(sci, SCE_PL_SCALAR, GEANY_FILETYPES_PERL, 10); - set_sci_style(sci, SCE_PL_POD, GEANY_FILETYPES_PERL, 11); - set_sci_style(sci, SCE_PL_REGEX, GEANY_FILETYPES_PERL, 12); - set_sci_style(sci, SCE_PL_ARRAY, GEANY_FILETYPES_PERL, 13); - set_sci_style(sci, SCE_PL_HASH, GEANY_FILETYPES_PERL, 14); - set_sci_style(sci, SCE_PL_SYMBOLTABLE, GEANY_FILETYPES_PERL, 15); - set_sci_style(sci, SCE_PL_BACKTICKS, GEANY_FILETYPES_PERL, 16); - set_sci_style(sci, SCE_PL_POD_VERB, GEANY_FILETYPES_PERL, 17); - set_sci_style(sci, SCE_PL_REGSUBST, GEANY_FILETYPES_PERL, 18); - set_sci_style(sci, SCE_PL_DATASECTION, GEANY_FILETYPES_PERL, 19); - set_sci_style(sci, SCE_PL_HERE_DELIM, GEANY_FILETYPES_PERL, 20); - set_sci_style(sci, SCE_PL_HERE_Q, GEANY_FILETYPES_PERL, 21); - set_sci_style(sci, SCE_PL_HERE_QQ, GEANY_FILETYPES_PERL, 22); - set_sci_style(sci, SCE_PL_HERE_QX, GEANY_FILETYPES_PERL, 23); - set_sci_style(sci, SCE_PL_STRING_Q, GEANY_FILETYPES_PERL, 24); - set_sci_style(sci, SCE_PL_STRING_QQ, GEANY_FILETYPES_PERL, 25); - set_sci_style(sci, SCE_PL_STRING_QX, GEANY_FILETYPES_PERL, 26); - set_sci_style(sci, SCE_PL_STRING_QR, GEANY_FILETYPES_PERL, 27); - set_sci_style(sci, SCE_PL_STRING_QW, GEANY_FILETYPES_PERL, 28); - set_sci_style(sci, SCE_PL_VARIABLE_INDEXER, GEANY_FILETYPES_PERL, 29); - set_sci_style(sci, SCE_PL_PUNCTUATION, GEANY_FILETYPES_PERL, 30); - set_sci_style(sci, SCE_PL_LONGQUOTE, GEANY_FILETYPES_PERL, 31); - set_sci_style(sci, SCE_PL_SUB_PROTOTYPE, GEANY_FILETYPES_PERL, 32); - set_sci_style(sci, SCE_PL_FORMAT_IDENT, GEANY_FILETYPES_PERL, 33); - set_sci_style(sci, SCE_PL_FORMAT, GEANY_FILETYPES_PERL, 34); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_PL_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_PL_ERROR, ft_id, 1); + set_sci_style(sci, SCE_PL_COMMENTLINE, ft_id, 2); + set_sci_style(sci, SCE_PL_NUMBER, ft_id, 3); + set_sci_style(sci, SCE_PL_WORD, ft_id, 4); + set_sci_style(sci, SCE_PL_STRING, ft_id, 5); + set_sci_style(sci, SCE_PL_CHARACTER, ft_id, 6); + set_sci_style(sci, SCE_PL_PREPROCESSOR, ft_id, 7); + set_sci_style(sci, SCE_PL_OPERATOR, ft_id, 8); + set_sci_style(sci, SCE_PL_IDENTIFIER, ft_id, 9); + set_sci_style(sci, SCE_PL_SCALAR, ft_id, 10); + set_sci_style(sci, SCE_PL_POD, ft_id, 11); + set_sci_style(sci, SCE_PL_REGEX, ft_id, 12); + set_sci_style(sci, SCE_PL_ARRAY, ft_id, 13); + set_sci_style(sci, SCE_PL_HASH, ft_id, 14); + set_sci_style(sci, SCE_PL_SYMBOLTABLE, ft_id, 15); + set_sci_style(sci, SCE_PL_BACKTICKS, ft_id, 16); + set_sci_style(sci, SCE_PL_POD_VERB, ft_id, 17); + set_sci_style(sci, SCE_PL_REGSUBST, ft_id, 18); + set_sci_style(sci, SCE_PL_DATASECTION, ft_id, 19); + set_sci_style(sci, SCE_PL_HERE_DELIM, ft_id, 20); + set_sci_style(sci, SCE_PL_HERE_Q, ft_id, 21); + set_sci_style(sci, SCE_PL_HERE_QQ, ft_id, 22); + set_sci_style(sci, SCE_PL_HERE_QX, ft_id, 23); + set_sci_style(sci, SCE_PL_STRING_Q, ft_id, 24); + set_sci_style(sci, SCE_PL_STRING_QQ, ft_id, 25); + set_sci_style(sci, SCE_PL_STRING_QX, ft_id, 26); + set_sci_style(sci, SCE_PL_STRING_QR, ft_id, 27); + set_sci_style(sci, SCE_PL_STRING_QW, ft_id, 28); + set_sci_style(sci, SCE_PL_VARIABLE_INDEXER, ft_id, 29); + set_sci_style(sci, SCE_PL_PUNCTUATION, ft_id, 30); + set_sci_style(sci, SCE_PL_LONGQUOTE, ft_id, 31); + set_sci_style(sci, SCE_PL_SUB_PROTOTYPE, ft_id, 32); + set_sci_style(sci, SCE_PL_FORMAT_IDENT, ft_id, 33); + set_sci_style(sci, SCE_PL_FORMAT, ft_id, 34); }
static void styleset_python_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_PYTHON, 16); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_PYTHON].styling[0]); - get_keyfile_style(config, config_home, "commentline", &style_sets[GEANY_FILETYPES_PYTHON].styling[1]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_PYTHON].styling[2]); - get_keyfile_style(config, config_home, "string", &style_sets[GEANY_FILETYPES_PYTHON].styling[3]); - get_keyfile_style(config, config_home, "character", &style_sets[GEANY_FILETYPES_PYTHON].styling[4]); - get_keyfile_style(config, config_home, "word", &style_sets[GEANY_FILETYPES_PYTHON].styling[5]); - get_keyfile_style(config, config_home, "triple", &style_sets[GEANY_FILETYPES_PYTHON].styling[6]); - get_keyfile_style(config, config_home, "tripledouble", &style_sets[GEANY_FILETYPES_PYTHON].styling[7]); - get_keyfile_style(config, config_home, "classname", &style_sets[GEANY_FILETYPES_PYTHON].styling[8]); - get_keyfile_style(config, config_home, "defname", &style_sets[GEANY_FILETYPES_PYTHON].styling[9]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_PYTHON].styling[10]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_PYTHON].styling[11]); - get_keyfile_style(config, config_home, "commentblock", &style_sets[GEANY_FILETYPES_PYTHON].styling[12]); - get_keyfile_style(config, config_home, "stringeol", &style_sets[GEANY_FILETYPES_PYTHON].styling[13]); - get_keyfile_style(config, config_home, "word2", &style_sets[GEANY_FILETYPES_PYTHON].styling[14]); - get_keyfile_style(config, config_home, "decorator", &style_sets[GEANY_FILETYPES_PYTHON].styling[15]); + new_styleset(ft_id, 16); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "commentline", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "string", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "character", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "word", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "triple", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "tripledouble", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "classname", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "defname", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "commentblock", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "stringeol", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "word2", &style_sets[ft_id].styling[14]); + get_keyfile_style(config, config_home, "decorator", &style_sets[ft_id].styling[15]);
- style_sets[GEANY_FILETYPES_PYTHON].keywords = g_new(gchar*, 3); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_PYTHON, 0); - get_keyfile_keywords(config, config_home, "identifiers", GEANY_FILETYPES_PYTHON, 1); - style_sets[GEANY_FILETYPES_PYTHON].keywords[2] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 3); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "identifiers", ft_id, 1); + style_sets[ft_id].keywords[2] = NULL; }
-static void styleset_python(ScintillaObject *sci) +static void styleset_python(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_PYTHON; - apply_filetype_properties(sci, SCLEX_PYTHON, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_PYTHON].keywords[0]); - sci_set_keywords(sci, 1, style_sets[GEANY_FILETYPES_PYTHON].keywords[1]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 1, style_sets[ft_id].keywords[1]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PYTHON, 0); - set_sci_style(sci, SCE_P_DEFAULT, GEANY_FILETYPES_PYTHON, 0); - set_sci_style(sci, SCE_P_COMMENTLINE, GEANY_FILETYPES_PYTHON, 1); - set_sci_style(sci, SCE_P_NUMBER, GEANY_FILETYPES_PYTHON, 2); - set_sci_style(sci, SCE_P_STRING, GEANY_FILETYPES_PYTHON, 3); - set_sci_style(sci, SCE_P_CHARACTER, GEANY_FILETYPES_PYTHON, 4); - set_sci_style(sci, SCE_P_WORD, GEANY_FILETYPES_PYTHON, 5); - set_sci_style(sci, SCE_P_TRIPLE, GEANY_FILETYPES_PYTHON, 6); - set_sci_style(sci, SCE_P_TRIPLEDOUBLE, GEANY_FILETYPES_PYTHON, 7); - set_sci_style(sci, SCE_P_CLASSNAME, GEANY_FILETYPES_PYTHON, 8); - set_sci_style(sci, SCE_P_DEFNAME, GEANY_FILETYPES_PYTHON, 9); - set_sci_style(sci, SCE_P_OPERATOR, GEANY_FILETYPES_PYTHON, 10); - set_sci_style(sci, SCE_P_IDENTIFIER, GEANY_FILETYPES_PYTHON, 11); - set_sci_style(sci, SCE_P_COMMENTBLOCK, GEANY_FILETYPES_PYTHON, 12); - set_sci_style(sci, SCE_P_STRINGEOL, GEANY_FILETYPES_PYTHON, 13); - set_sci_style(sci, SCE_P_WORD2, GEANY_FILETYPES_PYTHON, 14); - set_sci_style(sci, SCE_P_DECORATOR, GEANY_FILETYPES_PYTHON, 15); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_P_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_P_COMMENTLINE, ft_id, 1); + set_sci_style(sci, SCE_P_NUMBER, ft_id, 2); + set_sci_style(sci, SCE_P_STRING, ft_id, 3); + set_sci_style(sci, SCE_P_CHARACTER, ft_id, 4); + set_sci_style(sci, SCE_P_WORD, ft_id, 5); + set_sci_style(sci, SCE_P_TRIPLE, ft_id, 6); + set_sci_style(sci, SCE_P_TRIPLEDOUBLE, ft_id, 7); + set_sci_style(sci, SCE_P_CLASSNAME, ft_id, 8); + set_sci_style(sci, SCE_P_DEFNAME, ft_id, 9); + set_sci_style(sci, SCE_P_OPERATOR, ft_id, 10); + set_sci_style(sci, SCE_P_IDENTIFIER, ft_id, 11); + set_sci_style(sci, SCE_P_COMMENTBLOCK, ft_id, 12); + set_sci_style(sci, SCE_P_STRINGEOL, ft_id, 13); + set_sci_style(sci, SCE_P_WORD2, ft_id, 14); + set_sci_style(sci, SCE_P_DECORATOR, ft_id, 15); }
static void styleset_cmake_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_CMAKE, 15); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_CMAKE].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_CMAKE].styling[1]); - get_keyfile_style(config, config_home, "stringdq", &style_sets[GEANY_FILETYPES_CMAKE].styling[2]); - get_keyfile_style(config, config_home, "stringlq", &style_sets[GEANY_FILETYPES_CMAKE].styling[3]); - get_keyfile_style(config, config_home, "stringrq", &style_sets[GEANY_FILETYPES_CMAKE].styling[4]); - get_keyfile_style(config, config_home, "command", &style_sets[GEANY_FILETYPES_CMAKE].styling[5]); - get_keyfile_style(config, config_home, "parameters", &style_sets[GEANY_FILETYPES_CMAKE].styling[6]); - get_keyfile_style(config, config_home, "variable", &style_sets[GEANY_FILETYPES_CMAKE].styling[7]); - get_keyfile_style(config, config_home, "userdefined", &style_sets[GEANY_FILETYPES_CMAKE].styling[8]); - get_keyfile_style(config, config_home, "whiledef", &style_sets[GEANY_FILETYPES_CMAKE].styling[9]); - get_keyfile_style(config, config_home, "foreachdef", &style_sets[GEANY_FILETYPES_CMAKE].styling[10]); - get_keyfile_style(config, config_home, "ifdefinedef", &style_sets[GEANY_FILETYPES_CMAKE].styling[11]); - get_keyfile_style(config, config_home, "macrodef", &style_sets[GEANY_FILETYPES_CMAKE].styling[12]); - get_keyfile_style(config, config_home, "stringvar", &style_sets[GEANY_FILETYPES_CMAKE].styling[13]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_CMAKE].styling[14]); + new_styleset(ft_id, 15); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "stringdq", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "stringlq", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "stringrq", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "command", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "parameters", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "variable", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "userdefined", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "whiledef", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "foreachdef", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "ifdefinedef", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "macrodef", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "stringvar", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[14]);
- style_sets[GEANY_FILETYPES_CMAKE].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "commands", GEANY_FILETYPES_CMAKE, 0); - get_keyfile_keywords(config, config_home, "parameters", GEANY_FILETYPES_CMAKE, 1); - get_keyfile_keywords(config, config_home, "userdefined", GEANY_FILETYPES_CMAKE, 2); - style_sets[GEANY_FILETYPES_CMAKE].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "commands", ft_id, 0); + get_keyfile_keywords(config, config_home, "parameters", ft_id, 1); + get_keyfile_keywords(config, config_home, "userdefined", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_cmake(ScintillaObject *sci) +static void styleset_cmake(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_CMAKE; - apply_filetype_properties(sci, SCLEX_CMAKE, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_CMAKE].keywords[0]); - sci_set_keywords(sci, 1, style_sets[GEANY_FILETYPES_CMAKE].keywords[1]); - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_CMAKE].keywords[2]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 1, style_sets[ft_id].keywords[1]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_CMAKE, 0); - set_sci_style(sci, SCE_CMAKE_DEFAULT, GEANY_FILETYPES_CMAKE, 0); - set_sci_style(sci, SCE_CMAKE_COMMENT, GEANY_FILETYPES_CMAKE, 1); - set_sci_style(sci, SCE_CMAKE_STRINGDQ, GEANY_FILETYPES_CMAKE, 2); - set_sci_style(sci, SCE_CMAKE_STRINGLQ, GEANY_FILETYPES_CMAKE, 3); - set_sci_style(sci, SCE_CMAKE_STRINGRQ, GEANY_FILETYPES_CMAKE, 4); - set_sci_style(sci, SCE_CMAKE_COMMANDS, GEANY_FILETYPES_CMAKE, 5); - set_sci_style(sci, SCE_CMAKE_PARAMETERS, GEANY_FILETYPES_CMAKE, 6); - set_sci_style(sci, SCE_CMAKE_VARIABLE, GEANY_FILETYPES_CMAKE, 7); - set_sci_style(sci, SCE_CMAKE_USERDEFINED, GEANY_FILETYPES_CMAKE, 8); - set_sci_style(sci, SCE_CMAKE_WHILEDEF, GEANY_FILETYPES_CMAKE, 9); - set_sci_style(sci, SCE_CMAKE_FOREACHDEF, GEANY_FILETYPES_CMAKE, 10); - set_sci_style(sci, SCE_CMAKE_IFDEFINEDEF, GEANY_FILETYPES_CMAKE, 11); - set_sci_style(sci, SCE_CMAKE_MACRODEF, GEANY_FILETYPES_CMAKE, 12); - set_sci_style(sci, SCE_CMAKE_STRINGVAR, GEANY_FILETYPES_CMAKE, 13); - set_sci_style(sci, SCE_CMAKE_NUMBER, GEANY_FILETYPES_CMAKE, 14); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_CMAKE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_CMAKE_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_CMAKE_STRINGDQ, ft_id, 2); + set_sci_style(sci, SCE_CMAKE_STRINGLQ, ft_id, 3); + set_sci_style(sci, SCE_CMAKE_STRINGRQ, ft_id, 4); + set_sci_style(sci, SCE_CMAKE_COMMANDS, ft_id, 5); + set_sci_style(sci, SCE_CMAKE_PARAMETERS, ft_id, 6); + set_sci_style(sci, SCE_CMAKE_VARIABLE, ft_id, 7); + set_sci_style(sci, SCE_CMAKE_USERDEFINED, ft_id, 8); + set_sci_style(sci, SCE_CMAKE_WHILEDEF, ft_id, 9); + set_sci_style(sci, SCE_CMAKE_FOREACHDEF, ft_id, 10); + set_sci_style(sci, SCE_CMAKE_IFDEFINEDEF, ft_id, 11); + set_sci_style(sci, SCE_CMAKE_MACRODEF, ft_id, 12); + set_sci_style(sci, SCE_CMAKE_STRINGVAR, ft_id, 13); + set_sci_style(sci, SCE_CMAKE_NUMBER, ft_id, 14); }
static void styleset_r_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_R, 12); + new_styleset(ft_id, 12);
- get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_R].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_R].styling[1]); - get_keyfile_style(config, config_home, "kword", &style_sets[GEANY_FILETYPES_R].styling[2]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_R].styling[3]); - get_keyfile_style(config, config_home, "basekword", &style_sets[GEANY_FILETYPES_R].styling[4]); - get_keyfile_style(config, config_home, "otherkword", &style_sets[GEANY_FILETYPES_R].styling[5]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_R].styling[6]); - get_keyfile_style(config, config_home, "string", &style_sets[GEANY_FILETYPES_R].styling[7]); - get_keyfile_style(config, config_home, "string2", &style_sets[GEANY_FILETYPES_R].styling[8]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_R].styling[9]); - get_keyfile_style(config, config_home, "infix", &style_sets[GEANY_FILETYPES_R].styling[10]); - get_keyfile_style(config, config_home, "infixeol", &style_sets[GEANY_FILETYPES_R].styling[11]); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "kword", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "basekword", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "otherkword", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "string", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "string2", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "infix", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "infixeol", &style_sets[ft_id].styling[11]);
- style_sets[GEANY_FILETYPES_R].keywords = g_new(gchar*, 4); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_R, 0); - get_keyfile_keywords(config, config_home, "package", GEANY_FILETYPES_R, 1); - get_keyfile_keywords(config, config_home, "package_other", GEANY_FILETYPES_R, 2); - style_sets[GEANY_FILETYPES_R].keywords[3] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "package", ft_id, 1); + get_keyfile_keywords(config, config_home, "package_other", ft_id, 2); + style_sets[ft_id].keywords[3] = NULL; }
-static void styleset_r(ScintillaObject *sci) +static void styleset_r(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_R; - apply_filetype_properties(sci, SCLEX_R, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_R].keywords[0]); - sci_set_keywords(sci, 1, style_sets[GEANY_FILETYPES_R].keywords[1]); - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_R].keywords[2]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 1, style_sets[ft_id].keywords[1]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_R, 0); - set_sci_style(sci, SCE_R_DEFAULT, GEANY_FILETYPES_R, 0); - set_sci_style(sci, SCE_R_COMMENT, GEANY_FILETYPES_R, 1); - set_sci_style(sci, SCE_R_KWORD, GEANY_FILETYPES_R, 2); - set_sci_style(sci, SCE_R_OPERATOR, GEANY_FILETYPES_R, 3); - set_sci_style(sci, SCE_R_BASEKWORD, GEANY_FILETYPES_R, 4); - set_sci_style(sci, SCE_R_OTHERKWORD, GEANY_FILETYPES_R, 5); - set_sci_style(sci, SCE_R_NUMBER, GEANY_FILETYPES_R, 6); - set_sci_style(sci, SCE_R_STRING, GEANY_FILETYPES_R, 7); - set_sci_style(sci, SCE_R_STRING2, GEANY_FILETYPES_R, 8); - set_sci_style(sci, SCE_R_IDENTIFIER, GEANY_FILETYPES_R, 9); - set_sci_style(sci, SCE_R_INFIX, GEANY_FILETYPES_R, 10); - set_sci_style(sci, SCE_R_INFIXEOL, GEANY_FILETYPES_R, 11); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_R_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_R_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_R_KWORD, ft_id, 2); + set_sci_style(sci, SCE_R_OPERATOR, ft_id, 3); + set_sci_style(sci, SCE_R_BASEKWORD, ft_id, 4); + set_sci_style(sci, SCE_R_OTHERKWORD, ft_id, 5); + set_sci_style(sci, SCE_R_NUMBER, ft_id, 6); + set_sci_style(sci, SCE_R_STRING, ft_id, 7); + set_sci_style(sci, SCE_R_STRING2, ft_id, 8); + set_sci_style(sci, SCE_R_IDENTIFIER, ft_id, 9); + set_sci_style(sci, SCE_R_INFIX, ft_id, 10); + set_sci_style(sci, SCE_R_INFIXEOL, ft_id, 11); }
static void styleset_ruby_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_RUBY, 35); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_RUBY].styling[0]); - get_keyfile_style(config, config_home, "commentline", &style_sets[GEANY_FILETYPES_RUBY].styling[1]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_RUBY].styling[2]); - get_keyfile_style(config, config_home, "string", &style_sets[GEANY_FILETYPES_RUBY].styling[3]); - get_keyfile_style(config, config_home, "character", &style_sets[GEANY_FILETYPES_RUBY].styling[4]); - get_keyfile_style(config, config_home, "word", &style_sets[GEANY_FILETYPES_RUBY].styling[5]); - get_keyfile_style(config, config_home, "global", &style_sets[GEANY_FILETYPES_RUBY].styling[6]); - get_keyfile_style(config, config_home, "symbol", &style_sets[GEANY_FILETYPES_RUBY].styling[7]); - get_keyfile_style(config, config_home, "classname", &style_sets[GEANY_FILETYPES_RUBY].styling[8]); - get_keyfile_style(config, config_home, "defname", &style_sets[GEANY_FILETYPES_RUBY].styling[9]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_RUBY].styling[10]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_RUBY].styling[11]); - get_keyfile_style(config, config_home, "modulename", &style_sets[GEANY_FILETYPES_RUBY].styling[12]); - get_keyfile_style(config, config_home, "backticks", &style_sets[GEANY_FILETYPES_RUBY].styling[13]); - get_keyfile_style(config, config_home, "instancevar", &style_sets[GEANY_FILETYPES_RUBY].styling[14]); - get_keyfile_style(config, config_home, "classvar", &style_sets[GEANY_FILETYPES_RUBY].styling[15]); - get_keyfile_style(config, config_home, "datasection", &style_sets[GEANY_FILETYPES_RUBY].styling[16]); - get_keyfile_style(config, config_home, "heredelim", &style_sets[GEANY_FILETYPES_RUBY].styling[17]); - get_keyfile_style(config, config_home, "worddemoted", &style_sets[GEANY_FILETYPES_RUBY].styling[18]); - get_keyfile_style(config, config_home, "stdin", &style_sets[GEANY_FILETYPES_RUBY].styling[19]); - get_keyfile_style(config, config_home, "stdout", &style_sets[GEANY_FILETYPES_RUBY].styling[20]); - get_keyfile_style(config, config_home, "stderr", &style_sets[GEANY_FILETYPES_RUBY].styling[21]); - get_keyfile_style(config, config_home, "datasection", &style_sets[GEANY_FILETYPES_RUBY].styling[22]); - get_keyfile_style(config, config_home, "regex", &style_sets[GEANY_FILETYPES_RUBY].styling[23]); - get_keyfile_style(config, config_home, "here_q", &style_sets[GEANY_FILETYPES_RUBY].styling[24]); - get_keyfile_style(config, config_home, "here_qq", &style_sets[GEANY_FILETYPES_RUBY].styling[25]); - get_keyfile_style(config, config_home, "here_qx", &style_sets[GEANY_FILETYPES_RUBY].styling[26]); - get_keyfile_style(config, config_home, "string_q", &style_sets[GEANY_FILETYPES_RUBY].styling[27]); - get_keyfile_style(config, config_home, "string_qq", &style_sets[GEANY_FILETYPES_RUBY].styling[28]); - get_keyfile_style(config, config_home, "string_qx", &style_sets[GEANY_FILETYPES_RUBY].styling[29]); - get_keyfile_style(config, config_home, "string_qr", &style_sets[GEANY_FILETYPES_RUBY].styling[30]); - get_keyfile_style(config, config_home, "string_qw", &style_sets[GEANY_FILETYPES_RUBY].styling[31]); - get_keyfile_style(config, config_home, "upper_bound", &style_sets[GEANY_FILETYPES_RUBY].styling[32]); - get_keyfile_style(config, config_home, "error", &style_sets[GEANY_FILETYPES_RUBY].styling[33]); - get_keyfile_style(config, config_home, "pod", &style_sets[GEANY_FILETYPES_RUBY].styling[34]); + new_styleset(ft_id, 35); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "commentline", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "string", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "character", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "word", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "global", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "symbol", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "classname", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "defname", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "modulename", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "backticks", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "instancevar", &style_sets[ft_id].styling[14]); + get_keyfile_style(config, config_home, "classvar", &style_sets[ft_id].styling[15]); + get_keyfile_style(config, config_home, "datasection", &style_sets[ft_id].styling[16]); + get_keyfile_style(config, config_home, "heredelim", &style_sets[ft_id].styling[17]); + get_keyfile_style(config, config_home, "worddemoted", &style_sets[ft_id].styling[18]); + get_keyfile_style(config, config_home, "stdin", &style_sets[ft_id].styling[19]); + get_keyfile_style(config, config_home, "stdout", &style_sets[ft_id].styling[20]); + get_keyfile_style(config, config_home, "stderr", &style_sets[ft_id].styling[21]); + get_keyfile_style(config, config_home, "datasection", &style_sets[ft_id].styling[22]); + get_keyfile_style(config, config_home, "regex", &style_sets[ft_id].styling[23]); + get_keyfile_style(config, config_home, "here_q", &style_sets[ft_id].styling[24]); + get_keyfile_style(config, config_home, "here_qq", &style_sets[ft_id].styling[25]); + get_keyfile_style(config, config_home, "here_qx", &style_sets[ft_id].styling[26]); + get_keyfile_style(config, config_home, "string_q", &style_sets[ft_id].styling[27]); + get_keyfile_style(config, config_home, "string_qq", &style_sets[ft_id].styling[28]); + get_keyfile_style(config, config_home, "string_qx", &style_sets[ft_id].styling[29]); + get_keyfile_style(config, config_home, "string_qr", &style_sets[ft_id].styling[30]); + get_keyfile_style(config, config_home, "string_qw", &style_sets[ft_id].styling[31]); + get_keyfile_style(config, config_home, "upper_bound", &style_sets[ft_id].styling[32]); + get_keyfile_style(config, config_home, "error", &style_sets[ft_id].styling[33]); + get_keyfile_style(config, config_home, "pod", &style_sets[ft_id].styling[34]);
- style_sets[GEANY_FILETYPES_RUBY].keywords = g_new(gchar*, 2); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_RUBY, 0); - style_sets[GEANY_FILETYPES_RUBY].keywords[1] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 2); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + style_sets[ft_id].keywords[1] = NULL; }
-static void styleset_ruby(ScintillaObject *sci) +static void styleset_ruby(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_RUBY; - apply_filetype_properties(sci, SCLEX_RUBY, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_RUBY].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_RUBY, 0); - set_sci_style(sci, SCE_RB_DEFAULT, GEANY_FILETYPES_RUBY, 0); - set_sci_style(sci, SCE_RB_COMMENTLINE, GEANY_FILETYPES_RUBY, 1); - set_sci_style(sci, SCE_RB_NUMBER, GEANY_FILETYPES_RUBY, 2); - set_sci_style(sci, SCE_RB_STRING, GEANY_FILETYPES_RUBY, 3); - set_sci_style(sci, SCE_RB_CHARACTER, GEANY_FILETYPES_RUBY, 4); - set_sci_style(sci, SCE_RB_WORD, GEANY_FILETYPES_RUBY, 5); - set_sci_style(sci, SCE_RB_GLOBAL, GEANY_FILETYPES_RUBY, 6); - set_sci_style(sci, SCE_RB_SYMBOL, GEANY_FILETYPES_RUBY, 7); - set_sci_style(sci, SCE_RB_CLASSNAME, GEANY_FILETYPES_RUBY, 8); - set_sci_style(sci, SCE_RB_DEFNAME, GEANY_FILETYPES_RUBY, 9); - set_sci_style(sci, SCE_RB_OPERATOR, GEANY_FILETYPES_RUBY, 10); - set_sci_style(sci, SCE_RB_IDENTIFIER, GEANY_FILETYPES_RUBY, 11); - set_sci_style(sci, SCE_RB_MODULE_NAME, GEANY_FILETYPES_RUBY, 12); - set_sci_style(sci, SCE_RB_BACKTICKS, GEANY_FILETYPES_RUBY, 13); - set_sci_style(sci, SCE_RB_INSTANCE_VAR, GEANY_FILETYPES_RUBY, 14); - set_sci_style(sci, SCE_RB_CLASS_VAR, GEANY_FILETYPES_RUBY, 15); - set_sci_style(sci, SCE_RB_DATASECTION, GEANY_FILETYPES_RUBY, 16); - set_sci_style(sci, SCE_RB_HERE_DELIM, GEANY_FILETYPES_RUBY, 17); - set_sci_style(sci, SCE_RB_WORD_DEMOTED, GEANY_FILETYPES_RUBY, 18); - set_sci_style(sci, SCE_RB_STDIN, GEANY_FILETYPES_RUBY, 19); - set_sci_style(sci, SCE_RB_STDOUT, GEANY_FILETYPES_RUBY, 20); - set_sci_style(sci, SCE_RB_STDERR, GEANY_FILETYPES_RUBY, 21); - set_sci_style(sci, SCE_RB_DATASECTION, GEANY_FILETYPES_RUBY, 22); - set_sci_style(sci, SCE_RB_REGEX, GEANY_FILETYPES_RUBY, 23); - set_sci_style(sci, SCE_RB_HERE_Q, GEANY_FILETYPES_RUBY, 24); - set_sci_style(sci, SCE_RB_HERE_QQ, GEANY_FILETYPES_RUBY, 25); - set_sci_style(sci, SCE_RB_HERE_QX, GEANY_FILETYPES_RUBY, 26); - set_sci_style(sci, SCE_RB_STRING_Q, GEANY_FILETYPES_RUBY, 27); - set_sci_style(sci, SCE_RB_STRING_QQ, GEANY_FILETYPES_RUBY, 28); - set_sci_style(sci, SCE_RB_STRING_QX, GEANY_FILETYPES_RUBY, 29); - set_sci_style(sci, SCE_RB_STRING_QR, GEANY_FILETYPES_RUBY, 30); - set_sci_style(sci, SCE_RB_STRING_QW, GEANY_FILETYPES_RUBY, 31); - set_sci_style(sci, SCE_RB_UPPER_BOUND, GEANY_FILETYPES_RUBY, 32); - set_sci_style(sci, SCE_RB_ERROR, GEANY_FILETYPES_RUBY, 33); - set_sci_style(sci, SCE_RB_POD, GEANY_FILETYPES_RUBY, 34); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_RB_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_RB_COMMENTLINE, ft_id, 1); + set_sci_style(sci, SCE_RB_NUMBER, ft_id, 2); + set_sci_style(sci, SCE_RB_STRING, ft_id, 3); + set_sci_style(sci, SCE_RB_CHARACTER, ft_id, 4); + set_sci_style(sci, SCE_RB_WORD, ft_id, 5); + set_sci_style(sci, SCE_RB_GLOBAL, ft_id, 6); + set_sci_style(sci, SCE_RB_SYMBOL, ft_id, 7); + set_sci_style(sci, SCE_RB_CLASSNAME, ft_id, 8); + set_sci_style(sci, SCE_RB_DEFNAME, ft_id, 9); + set_sci_style(sci, SCE_RB_OPERATOR, ft_id, 10); + set_sci_style(sci, SCE_RB_IDENTIFIER, ft_id, 11); + set_sci_style(sci, SCE_RB_MODULE_NAME, ft_id, 12); + set_sci_style(sci, SCE_RB_BACKTICKS, ft_id, 13); + set_sci_style(sci, SCE_RB_INSTANCE_VAR, ft_id, 14); + set_sci_style(sci, SCE_RB_CLASS_VAR, ft_id, 15); + set_sci_style(sci, SCE_RB_DATASECTION, ft_id, 16); + set_sci_style(sci, SCE_RB_HERE_DELIM, ft_id, 17); + set_sci_style(sci, SCE_RB_WORD_DEMOTED, ft_id, 18); + set_sci_style(sci, SCE_RB_STDIN, ft_id, 19); + set_sci_style(sci, SCE_RB_STDOUT, ft_id, 20); + set_sci_style(sci, SCE_RB_STDERR, ft_id, 21); + set_sci_style(sci, SCE_RB_DATASECTION, ft_id, 22); + set_sci_style(sci, SCE_RB_REGEX, ft_id, 23); + set_sci_style(sci, SCE_RB_HERE_Q, ft_id, 24); + set_sci_style(sci, SCE_RB_HERE_QQ, ft_id, 25); + set_sci_style(sci, SCE_RB_HERE_QX, ft_id, 26); + set_sci_style(sci, SCE_RB_STRING_Q, ft_id, 27); + set_sci_style(sci, SCE_RB_STRING_QQ, ft_id, 28); + set_sci_style(sci, SCE_RB_STRING_QX, ft_id, 29); + set_sci_style(sci, SCE_RB_STRING_QR, ft_id, 30); + set_sci_style(sci, SCE_RB_STRING_QW, ft_id, 31); + set_sci_style(sci, SCE_RB_UPPER_BOUND, ft_id, 32); + set_sci_style(sci, SCE_RB_ERROR, ft_id, 33); + set_sci_style(sci, SCE_RB_POD, ft_id, 34); }
static void styleset_sh_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_SH, 14); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_SH].styling[0]); - get_keyfile_style(config, config_home, "commentline", &style_sets[GEANY_FILETYPES_SH].styling[1]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_SH].styling[2]); - get_keyfile_style(config, config_home, "word", &style_sets[GEANY_FILETYPES_SH].styling[3]); - get_keyfile_style(config, config_home, "string", &style_sets[GEANY_FILETYPES_SH].styling[4]); - get_keyfile_style(config, config_home, "character", &style_sets[GEANY_FILETYPES_SH].styling[5]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_SH].styling[6]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_SH].styling[7]); - get_keyfile_style(config, config_home, "backticks", &style_sets[GEANY_FILETYPES_SH].styling[8]); - get_keyfile_style(config, config_home, "param", &style_sets[GEANY_FILETYPES_SH].styling[9]); - get_keyfile_style(config, config_home, "scalar", &style_sets[GEANY_FILETYPES_SH].styling[10]); - get_keyfile_style(config, config_home, "error", &style_sets[GEANY_FILETYPES_SH].styling[11]); - get_keyfile_style(config, config_home, "here_delim", &style_sets[GEANY_FILETYPES_SH].styling[12]); - get_keyfile_style(config, config_home, "here_q", &style_sets[GEANY_FILETYPES_SH].styling[13]); + new_styleset(ft_id, 14); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "commentline", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "word", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "string", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "character", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "backticks", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "param", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "scalar", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "error", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "here_delim", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "here_q", &style_sets[ft_id].styling[13]);
- style_sets[GEANY_FILETYPES_SH].keywords = g_new(gchar*, 2); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_SH, 0); - style_sets[GEANY_FILETYPES_SH].keywords[1] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 2); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + style_sets[ft_id].keywords[1] = NULL; }
-static void styleset_sh(ScintillaObject *sci) +static void styleset_sh(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_SH; - apply_filetype_properties(sci, SCLEX_BASH, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_SH].keywords[0]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_SH, 0); - set_sci_style(sci, SCE_SH_DEFAULT, GEANY_FILETYPES_SH, 0); - set_sci_style(sci, SCE_SH_COMMENTLINE, GEANY_FILETYPES_SH, 1); - set_sci_style(sci, SCE_SH_NUMBER, GEANY_FILETYPES_SH, 2); - set_sci_style(sci, SCE_SH_WORD, GEANY_FILETYPES_SH, 3); - set_sci_style(sci, SCE_SH_STRING, GEANY_FILETYPES_SH, 4); - set_sci_style(sci, SCE_SH_CHARACTER, GEANY_FILETYPES_SH, 5); - set_sci_style(sci, SCE_SH_OPERATOR, GEANY_FILETYPES_SH, 6); - set_sci_style(sci, SCE_SH_IDENTIFIER, GEANY_FILETYPES_SH, 7); - set_sci_style(sci, SCE_SH_BACKTICKS, GEANY_FILETYPES_SH, 8); - set_sci_style(sci, SCE_SH_PARAM, GEANY_FILETYPES_SH, 9); - set_sci_style(sci, SCE_SH_SCALAR, GEANY_FILETYPES_SH, 10); - set_sci_style(sci, SCE_SH_ERROR, GEANY_FILETYPES_SH, 11); - set_sci_style(sci, SCE_SH_HERE_DELIM, GEANY_FILETYPES_SH, 12); - set_sci_style(sci, SCE_SH_HERE_Q, GEANY_FILETYPES_SH, 13); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_SH_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_SH_COMMENTLINE, ft_id, 1); + set_sci_style(sci, SCE_SH_NUMBER, ft_id, 2); + set_sci_style(sci, SCE_SH_WORD, ft_id, 3); + set_sci_style(sci, SCE_SH_STRING, ft_id, 4); + set_sci_style(sci, SCE_SH_CHARACTER, ft_id, 5); + set_sci_style(sci, SCE_SH_OPERATOR, ft_id, 6); + set_sci_style(sci, SCE_SH_IDENTIFIER, ft_id, 7); + set_sci_style(sci, SCE_SH_BACKTICKS, ft_id, 8); + set_sci_style(sci, SCE_SH_PARAM, ft_id, 9); + set_sci_style(sci, SCE_SH_SCALAR, ft_id, 10); + set_sci_style(sci, SCE_SH_ERROR, ft_id, 11); + set_sci_style(sci, SCE_SH_HERE_DELIM, ft_id, 12); + set_sci_style(sci, SCE_SH_HERE_Q, ft_id, 13); }
-static void styleset_xml(ScintillaObject *sci) +static void styleset_xml(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_XML; - apply_filetype_properties(sci, SCLEX_XML, ft_id);
/* use the same colouring for HTML; XML and so on */ @@ -1928,87 +1890,85 @@
static void styleset_docbook_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_DOCBOOK, 29); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[0]); - get_keyfile_style(config, config_home, "tag", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[1]); - get_keyfile_style(config, config_home, "tagunknown", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[2]); - get_keyfile_style(config, config_home, "attribute", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[3]); - get_keyfile_style(config, config_home, "attributeunknown", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[4]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[5]); - get_keyfile_style(config, config_home, "doublestring", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[6]); - get_keyfile_style(config, config_home, "singlestring", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[7]); - get_keyfile_style(config, config_home, "other", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[8]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[9]); - get_keyfile_style(config, config_home, "entity", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[10]); - get_keyfile_style(config, config_home, "tagend", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[11]); - get_keyfile_style(config, config_home, "xmlstart", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[12]); - get_keyfile_style(config, config_home, "xmlend", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[13]); - get_keyfile_style(config, config_home, "cdata", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[14]); - get_keyfile_style(config, config_home, "question", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[15]); - get_keyfile_style(config, config_home, "value", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[16]); - get_keyfile_style(config, config_home, "xccomment", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[17]); - get_keyfile_style(config, config_home, "sgml_default", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[18]); - get_keyfile_style(config, config_home, "sgml_comment", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[19]); - get_keyfile_style(config, config_home, "sgml_special", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[20]); - get_keyfile_style(config, config_home, "sgml_command", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[21]); - get_keyfile_style(config, config_home, "sgml_doublestring", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[22]); - get_keyfile_style(config, config_home, "sgml_simplestring", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[23]); - get_keyfile_style(config, config_home, "sgml_1st_param", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[24]); - get_keyfile_style(config, config_home, "sgml_entity", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[25]); - get_keyfile_style(config, config_home, "sgml_block_default", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[26]); - get_keyfile_style(config, config_home, "sgml_1st_param_comment", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[27]); - get_keyfile_style(config, config_home, "sgml_error", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[28]); + new_styleset(ft_id, 29); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "tag", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "tagunknown", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "attribute", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "attributeunknown", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "doublestring", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "singlestring", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "other", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "entity", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "tagend", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "xmlstart", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "xmlend", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "cdata", &style_sets[ft_id].styling[14]); + get_keyfile_style(config, config_home, "question", &style_sets[ft_id].styling[15]); + get_keyfile_style(config, config_home, "value", &style_sets[ft_id].styling[16]); + get_keyfile_style(config, config_home, "xccomment", &style_sets[ft_id].styling[17]); + get_keyfile_style(config, config_home, "sgml_default", &style_sets[ft_id].styling[18]); + get_keyfile_style(config, config_home, "sgml_comment", &style_sets[ft_id].styling[19]); + get_keyfile_style(config, config_home, "sgml_special", &style_sets[ft_id].styling[20]); + get_keyfile_style(config, config_home, "sgml_command", &style_sets[ft_id].styling[21]); + get_keyfile_style(config, config_home, "sgml_doublestring", &style_sets[ft_id].styling[22]); + get_keyfile_style(config, config_home, "sgml_simplestring", &style_sets[ft_id].styling[23]); + get_keyfile_style(config, config_home, "sgml_1st_param", &style_sets[ft_id].styling[24]); + get_keyfile_style(config, config_home, "sgml_entity", &style_sets[ft_id].styling[25]); + get_keyfile_style(config, config_home, "sgml_block_default", &style_sets[ft_id].styling[26]); + get_keyfile_style(config, config_home, "sgml_1st_param_comment", &style_sets[ft_id].styling[27]); + get_keyfile_style(config, config_home, "sgml_error", &style_sets[ft_id].styling[28]);
- style_sets[GEANY_FILETYPES_DOCBOOK].keywords = g_new(gchar*, 3); - get_keyfile_keywords(config, config_home, "elements", GEANY_FILETYPES_DOCBOOK, 0); - get_keyfile_keywords(config, config_home, "dtd", GEANY_FILETYPES_DOCBOOK, 1); - style_sets[GEANY_FILETYPES_DOCBOOK].keywords[2] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 3); + get_keyfile_keywords(config, config_home, "elements", ft_id, 0); + get_keyfile_keywords(config, config_home, "dtd", ft_id, 1); + style_sets[ft_id].keywords[2] = NULL; }
-static void styleset_docbook(ScintillaObject *sci) +static void styleset_docbook(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_DOCBOOK; - apply_filetype_properties(sci, SCLEX_XML, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_DOCBOOK].keywords[0]); - sci_set_keywords(sci, 5, style_sets[GEANY_FILETYPES_DOCBOOK].keywords[1]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 5, style_sets[ft_id].keywords[1]);
/* Unknown tags and attributes are highlighed in red. * If a tag is actually OK, it should be added in lower case to the htmlKeyWords string. */
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_DOCBOOK, 0); - set_sci_style(sci, SCE_H_DEFAULT, GEANY_FILETYPES_DOCBOOK, 0); - set_sci_style(sci, SCE_H_TAG, GEANY_FILETYPES_DOCBOOK, 1); - set_sci_style(sci, SCE_H_TAGUNKNOWN, GEANY_FILETYPES_DOCBOOK, 2); - set_sci_style(sci, SCE_H_ATTRIBUTE, GEANY_FILETYPES_DOCBOOK, 3); - set_sci_style(sci, SCE_H_ATTRIBUTEUNKNOWN, GEANY_FILETYPES_DOCBOOK, 4); - set_sci_style(sci, SCE_H_NUMBER, GEANY_FILETYPES_DOCBOOK, 5); - set_sci_style(sci, SCE_H_DOUBLESTRING, GEANY_FILETYPES_DOCBOOK, 6); - set_sci_style(sci, SCE_H_SINGLESTRING, GEANY_FILETYPES_DOCBOOK, 7); - set_sci_style(sci, SCE_H_OTHER, GEANY_FILETYPES_DOCBOOK, 8); - set_sci_style(sci, SCE_H_COMMENT, GEANY_FILETYPES_DOCBOOK, 9); - set_sci_style(sci, SCE_H_ENTITY, GEANY_FILETYPES_DOCBOOK, 10); - set_sci_style(sci, SCE_H_TAGEND, GEANY_FILETYPES_DOCBOOK, 11); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_H_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_H_TAG, ft_id, 1); + set_sci_style(sci, SCE_H_TAGUNKNOWN, ft_id, 2); + set_sci_style(sci, SCE_H_ATTRIBUTE, ft_id, 3); + set_sci_style(sci, SCE_H_ATTRIBUTEUNKNOWN, ft_id, 4); + set_sci_style(sci, SCE_H_NUMBER, ft_id, 5); + set_sci_style(sci, SCE_H_DOUBLESTRING, ft_id, 6); + set_sci_style(sci, SCE_H_SINGLESTRING, ft_id, 7); + set_sci_style(sci, SCE_H_OTHER, ft_id, 8); + set_sci_style(sci, SCE_H_COMMENT, ft_id, 9); + set_sci_style(sci, SCE_H_ENTITY, ft_id, 10); + set_sci_style(sci, SCE_H_TAGEND, ft_id, 11); SSM(sci, SCI_STYLESETEOLFILLED, SCE_H_XMLSTART, 1); - set_sci_style(sci, SCE_H_XMLSTART, GEANY_FILETYPES_DOCBOOK, 12); - set_sci_style(sci, SCE_H_XMLEND, GEANY_FILETYPES_DOCBOOK, 13); - set_sci_style(sci, SCE_H_CDATA, GEANY_FILETYPES_DOCBOOK, 14); - set_sci_style(sci, SCE_H_QUESTION, GEANY_FILETYPES_DOCBOOK, 15); - set_sci_style(sci, SCE_H_VALUE, GEANY_FILETYPES_DOCBOOK, 16); - set_sci_style(sci, SCE_H_XCCOMMENT, GEANY_FILETYPES_DOCBOOK, 17); - set_sci_style(sci, SCE_H_SGML_DEFAULT, GEANY_FILETYPES_DOCBOOK, 18); - set_sci_style(sci, SCE_H_DEFAULT, GEANY_FILETYPES_DOCBOOK, 19); - set_sci_style(sci, SCE_H_SGML_SPECIAL, GEANY_FILETYPES_DOCBOOK, 20); - set_sci_style(sci, SCE_H_SGML_COMMAND, GEANY_FILETYPES_DOCBOOK, 21); - set_sci_style(sci, SCE_H_SGML_DOUBLESTRING, GEANY_FILETYPES_DOCBOOK, 22); - set_sci_style(sci, SCE_H_SGML_SIMPLESTRING, GEANY_FILETYPES_DOCBOOK, 23); - set_sci_style(sci, SCE_H_SGML_1ST_PARAM, GEANY_FILETYPES_DOCBOOK, 24); - set_sci_style(sci, SCE_H_SGML_ENTITY, GEANY_FILETYPES_DOCBOOK, 25); - set_sci_style(sci, SCE_H_SGML_BLOCK_DEFAULT, GEANY_FILETYPES_DOCBOOK, 26); - set_sci_style(sci, SCE_H_SGML_1ST_PARAM_COMMENT, GEANY_FILETYPES_DOCBOOK, 27); - set_sci_style(sci, SCE_H_SGML_ERROR, GEANY_FILETYPES_DOCBOOK, 28); + set_sci_style(sci, SCE_H_XMLSTART, ft_id, 12); + set_sci_style(sci, SCE_H_XMLEND, ft_id, 13); + set_sci_style(sci, SCE_H_CDATA, ft_id, 14); + set_sci_style(sci, SCE_H_QUESTION, ft_id, 15); + set_sci_style(sci, SCE_H_VALUE, ft_id, 16); + set_sci_style(sci, SCE_H_XCCOMMENT, ft_id, 17); + set_sci_style(sci, SCE_H_SGML_DEFAULT, ft_id, 18); + set_sci_style(sci, SCE_H_DEFAULT, ft_id, 19); + set_sci_style(sci, SCE_H_SGML_SPECIAL, ft_id, 20); + set_sci_style(sci, SCE_H_SGML_COMMAND, ft_id, 21); + set_sci_style(sci, SCE_H_SGML_DOUBLESTRING, ft_id, 22); + set_sci_style(sci, SCE_H_SGML_SIMPLESTRING, ft_id, 23); + set_sci_style(sci, SCE_H_SGML_1ST_PARAM, ft_id, 24); + set_sci_style(sci, SCE_H_SGML_ENTITY, ft_id, 25); + set_sci_style(sci, SCE_H_SGML_BLOCK_DEFAULT, ft_id, 26); + set_sci_style(sci, SCE_H_SGML_1ST_PARAM_COMMENT, ft_id, 27); + set_sci_style(sci, SCE_H_SGML_ERROR, ft_id, 28); }
@@ -2025,1162 +1985,1117 @@
static void styleset_css_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_CSS, 22); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_CSS].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_CSS].styling[1]); - get_keyfile_style(config, config_home, "tag", &style_sets[GEANY_FILETYPES_CSS].styling[2]); - get_keyfile_style(config, config_home, "class", &style_sets[GEANY_FILETYPES_CSS].styling[3]); - get_keyfile_style(config, config_home, "pseudoclass", &style_sets[GEANY_FILETYPES_CSS].styling[4]); - get_keyfile_style(config, config_home, "unknown_pseudoclass", &style_sets[GEANY_FILETYPES_CSS].styling[5]); - get_keyfile_style(config, config_home, "unknown_identifier", &style_sets[GEANY_FILETYPES_CSS].styling[6]); - get_keyfile_style(config, config_home, "operator", &style_sets[GEANY_FILETYPES_CSS].styling[7]); - get_keyfile_style(config, config_home, "identifier", &style_sets[GEANY_FILETYPES_CSS].styling[8]); - get_keyfile_style(config, config_home, "doublestring", &style_sets[GEANY_FILETYPES_CSS].styling[9]); - get_keyfile_style(config, config_home, "singlestring", &style_sets[GEANY_FILETYPES_CSS].styling[10]); - get_keyfile_style(config, config_home, "attribute", &style_sets[GEANY_FILETYPES_CSS].styling[11]); - get_keyfile_style(config, config_home, "value", &style_sets[GEANY_FILETYPES_CSS].styling[12]); - get_keyfile_style(config, config_home, "id", &style_sets[GEANY_FILETYPES_CSS].styling[13]); - get_keyfile_style(config, config_home, "identifier2", &style_sets[GEANY_FILETYPES_CSS].styling[14]); - get_keyfile_style(config, config_home, "important", &style_sets[GEANY_FILETYPES_CSS].styling[15]); - get_keyfile_style(config, config_home, "directive", &style_sets[GEANY_FILETYPES_CSS].styling[16]); - get_keyfile_style(config, config_home, "identifier3", &style_sets[GEANY_FILETYPES_CSS].styling[17]); - get_keyfile_style(config, config_home, "pseudoelement", &style_sets[GEANY_FILETYPES_CSS].styling[18]); - get_keyfile_style(config, config_home, "extended_identifier", &style_sets[GEANY_FILETYPES_CSS].styling[19]); - get_keyfile_style(config, config_home, "extended_pseudoclass", &style_sets[GEANY_FILETYPES_CSS].styling[20]); - get_keyfile_style(config, config_home, "extended_pseudoelement", &style_sets[GEANY_FILETYPES_CSS].styling[21]); + new_styleset(ft_id, 22); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "tag", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "class", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "pseudoclass", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "unknown_pseudoclass", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "unknown_identifier", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "operator", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "identifier", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "doublestring", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "singlestring", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "attribute", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "value", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "id", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "identifier2", &style_sets[ft_id].styling[14]); + get_keyfile_style(config, config_home, "important", &style_sets[ft_id].styling[15]); + get_keyfile_style(config, config_home, "directive", &style_sets[ft_id].styling[16]); + get_keyfile_style(config, config_home, "identifier3", &style_sets[ft_id].styling[17]); + get_keyfile_style(config, config_home, "pseudoelement", &style_sets[ft_id].styling[18]); + get_keyfile_style(config, config_home, "extended_identifier", &style_sets[ft_id].styling[19]); + get_keyfile_style(config, config_home, "extended_pseudoclass", &style_sets[ft_id].styling[20]); + get_keyfile_style(config, config_home, "extended_pseudoelement", &style_sets[ft_id].styling[21]);
- style_sets[GEANY_FILETYPES_CSS].keywords = g_new(gchar*, 9); - get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_CSS, 0); - get_keyfile_keywords(config, config_home, "pseudoclasses", GEANY_FILETYPES_CSS, 1); - get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CSS, 2); - get_keyfile_keywords(config, config_home, "css3_properties", GEANY_FILETYPES_CSS, 3); - get_keyfile_keywords(config, config_home, "pseudo_elements", GEANY_FILETYPES_CSS, 4); - get_keyfile_keywords(config, config_home, "browser_css_properties", GEANY_FILETYPES_CSS, 5); - get_keyfile_keywords(config, config_home, "browser_pseudo_classes", GEANY_FILETYPES_CSS, 6); - get_keyfile_keywords(config, config_home, "browser_pseudo_elements", GEANY_FILETYPES_CSS, 7); - style_sets[GEANY_FILETYPES_CSS].keywords[8] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 9); + get_keyfile_keywords(config, config_home, "primary", ft_id, 0); + get_keyfile_keywords(config, config_home, "pseudoclasses", ft_id, 1); + get_keyfile_keywords(config, config_home, "secondary", ft_id, 2); + get_keyfile_keywords(config, config_home, "css3_properties", ft_id, 3); + get_keyfile_keywords(config, config_home, "pseudo_elements", ft_id, 4); + get_keyfile_keywords(config, config_home, "browser_css_properties", ft_id, 5); + get_keyfile_keywords(config, config_home, "browser_pseudo_classes", ft_id, 6); + get_keyfile_keywords(config, config_home, "browser_pseudo_elements", ft_id, 7); + style_sets[ft_id].keywords[8] = NULL; }
-static void styleset_css(ScintillaObject *sci) +static void styleset_css(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_CSS; guint i;
apply_filetype_properties(sci, SCLEX_CSS, ft_id);
for (i = 0; i < 8; i++) { - sci_set_keywords(sci, i, style_sets[GEANY_FILETYPES_CSS].keywords[i]); + sci_set_keywords(sci, i, style_sets[ft_id].keywords[i]); }
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_CSS, 0); - set_sci_style(sci, SCE_CSS_DEFAULT, GEANY_FILETYPES_CSS, 0); - set_sci_style(sci, SCE_CSS_COMMENT, GEANY_FILETYPES_CSS, 1); - set_sci_style(sci, SCE_CSS_TAG, GEANY_FILETYPES_CSS, 2); - set_sci_style(sci, SCE_CSS_CLASS, GEANY_FILETYPES_CSS, 3); - set_sci_style(sci, SCE_CSS_PSEUDOCLASS, GEANY_FILETYPES_CSS, 4); - set_sci_style(sci, SCE_CSS_UNKNOWN_PSEUDOCLASS, GEANY_FILETYPES_CSS, 5); - set_sci_style(sci, SCE_CSS_UNKNOWN_IDENTIFIER, GEANY_FILETYPES_CSS, 6); - set_sci_style(sci, SCE_CSS_OPERATOR, GEANY_FILETYPES_CSS, 7); - set_sci_style(sci, SCE_CSS_IDENTIFIER, GEANY_FILETYPES_CSS, 8); - set_sci_style(sci, SCE_CSS_DOUBLESTRING, GEANY_FILETYPES_CSS, 9); - set_sci_style(sci, SCE_CSS_SINGLESTRING, GEANY_FILETYPES_CSS, 10); - set_sci_style(sci, SCE_CSS_ATTRIBUTE, GEANY_FILETYPES_CSS, 11); - set_sci_style(sci, SCE_CSS_VALUE, GEANY_FILETYPES_CSS, 12); - set_sci_style(sci, SCE_CSS_ID, GEANY_FILETYPES_CSS, 13); - set_sci_style(sci, SCE_CSS_IDENTIFIER2, GEANY_FILETYPES_CSS, 14); - set_sci_style(sci, SCE_CSS_IMPORTANT, GEANY_FILETYPES_CSS, 15); - set_sci_style(sci, SCE_CSS_DIRECTIVE, GEANY_FILETYPES_CSS, 16); - set_sci_style(sci, SCE_CSS_IDENTIFIER3, GEANY_FILETYPES_CSS, 17); - set_sci_style(sci, SCE_CSS_PSEUDOELEMENT, GEANY_FILETYPES_CSS, 18); - set_sci_style(sci, SCE_CSS_EXTENDED_IDENTIFIER, GEANY_FILETYPES_CSS, 19); - set_sci_style(sci, SCE_CSS_EXTENDED_PSEUDOCLASS, GEANY_FILETYPES_CSS, 20); - set_sci_style(sci, SCE_CSS_EXTENDED_PSEUDOELEMENT, GEANY_FILETYPES_CSS, 21); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_CSS_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_CSS_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_CSS_TAG, ft_id, 2); + set_sci_style(sci, SCE_CSS_CLASS, ft_id, 3); + set_sci_style(sci, SCE_CSS_PSEUDOCLASS, ft_id, 4); + set_sci_style(sci, SCE_CSS_UNKNOWN_PSEUDOCLASS, ft_id, 5); + set_sci_style(sci, SCE_CSS_UNKNOWN_IDENTIFIER, ft_id, 6); + set_sci_style(sci, SCE_CSS_OPERATOR, ft_id, 7); + set_sci_style(sci, SCE_CSS_IDENTIFIER, ft_id, 8); + set_sci_style(sci, SCE_CSS_DOUBLESTRING, ft_id, 9); + set_sci_style(sci, SCE_CSS_SINGLESTRING, ft_id, 10); + set_sci_style(sci, SCE_CSS_ATTRIBUTE, ft_id, 11); + set_sci_style(sci, SCE_CSS_VALUE, ft_id, 12); + set_sci_style(sci, SCE_CSS_ID, ft_id, 13); + set_sci_style(sci, SCE_CSS_IDENTIFIER2, ft_id, 14); + set_sci_style(sci, SCE_CSS_IMPORTANT, ft_id, 15); + set_sci_style(sci, SCE_CSS_DIRECTIVE, ft_id, 16); + set_sci_style(sci, SCE_CSS_IDENTIFIER3, ft_id, 17); + set_sci_style(sci, SCE_CSS_PSEUDOELEMENT, ft_id, 18); + set_sci_style(sci, SCE_CSS_EXTENDED_IDENTIFIER, ft_id, 19); + set_sci_style(sci, SCE_CSS_EXTENDED_PSEUDOCLASS, ft_id, 20); + set_sci_style(sci, SCE_CSS_EXTENDED_PSEUDOELEMENT, ft_id, 21); }
static void styleset_nsis_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_NSIS, 19); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_NSIS].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_NSIS].styling[1]); - get_keyfile_style(config, config_home, "stringdq", &style_sets[GEANY_FILETYPES_NSIS].styling[2]); - get_keyfile_style(config, config_home, "stringlq", &style_sets[GEANY_FILETYPES_NSIS].styling[3]); - get_keyfile_style(config, config_home, "stringrq", &style_sets[GEANY_FILETYPES_NSIS].styling[4]); - get_keyfile_style(config, config_home, "function", &style_sets[GEANY_FILETYPES_NSIS].styling[5]); - get_keyfile_style(config, config_home, "variable", &style_sets[GEANY_FILETYPES_NSIS].styling[6]); - get_keyfile_style(config, config_home, "label", &style_sets[GEANY_FILETYPES_NSIS].styling[7]); - get_keyfile_style(config, config_home, "userdefined", &style_sets[GEANY_FILETYPES_NSIS].styling[8]); - get_keyfile_style(config, config_home, "sectiondef", &style_sets[GEANY_FILETYPES_NSIS].styling[9]); - get_keyfile_style(config, config_home, "subsectiondef", &style_sets[GEANY_FILETYPES_NSIS].styling[10]); - get_keyfile_style(config, config_home, "ifdefinedef", &style_sets[GEANY_FILETYPES_NSIS].styling[11]); - get_keyfile_style(config, config_home, "macrodef", &style_sets[GEANY_FILETYPES_NSIS].styling[12]); - get_keyfile_style(config, config_home, "stringvar", &style_sets[GEANY_FILETYPES_NSIS].styling[13]); - get_keyfile_style(config, config_home, "number", &style_sets[GEANY_FILETYPES_NSIS].styling[14]); - get_keyfile_style(config, config_home, "sectiongroup", &style_sets[GEANY_FILETYPES_NSIS].styling[15]); - get_keyfile_style(config, config_home, "pageex", &style_sets[GEANY_FILETYPES_NSIS].styling[16]); - get_keyfile_style(config, config_home, "functiondef", &style_sets[GEANY_FILETYPES_NSIS].styling[17]); - get_keyfile_style(config, config_home, "commentbox", &style_sets[GEANY_FILETYPES_NSIS].styling[18]); + new_styleset(ft_id, 19); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "stringdq", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "stringlq", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "stringrq", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "function", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "variable", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "label", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "userdefined", &style_sets[ft_id].styling[8]); + get_keyfile_style(config, config_home, "sectiondef", &style_sets[ft_id].styling[9]); + get_keyfile_style(config, config_home, "subsectiondef", &style_sets[ft_id].styling[10]); + get_keyfile_style(config, config_home, "ifdefinedef", &style_sets[ft_id].styling[11]); + get_keyfile_style(config, config_home, "macrodef", &style_sets[ft_id].styling[12]); + get_keyfile_style(config, config_home, "stringvar", &style_sets[ft_id].styling[13]); + get_keyfile_style(config, config_home, "number", &style_sets[ft_id].styling[14]); + get_keyfile_style(config, config_home, "sectiongroup", &style_sets[ft_id].styling[15]); + get_keyfile_style(config, config_home, "pageex", &style_sets[ft_id].styling[16]); + get_keyfile_style(config, config_home, "functiondef", &style_sets[ft_id].styling[17]); + get_keyfile_style(config, config_home, "commentbox", &style_sets[ft_id].styling[18]);
- style_sets[GEANY_FILETYPES_NSIS].keywords = g_new(gchar*, 5); - get_keyfile_keywords(config, config_home, "functions", GEANY_FILETYPES_NSIS, 0); - get_keyfile_keywords(config, config_home, "variables", GEANY_FILETYPES_NSIS, 1); - get_keyfile_keywords(config, config_home, "lables", GEANY_FILETYPES_NSIS, 2); - get_keyfile_keywords(config, config_home, "userdefined", GEANY_FILETYPES_NSIS, 3); - style_sets[GEANY_FILETYPES_NSIS].keywords[4] = NULL; + style_sets[ft_id].keywords = g_new(gchar*, 5); + get_keyfile_keywords(config, config_home, "functions", ft_id, 0); + get_keyfile_keywords(config, config_home, "variables", ft_id, 1); + get_keyfile_keywords(config, config_home, "lables", ft_id, 2); + get_keyfile_keywords(config, config_home, "userdefined", ft_id, 3); + style_sets[ft_id].keywords[4] = NULL; }
-static void styleset_nsis(ScintillaObject *sci) +static void styleset_nsis(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_NSIS; - apply_filetype_properties(sci, SCLEX_NSIS, ft_id);
- sci_set_keywords(sci, 0, style_sets[GEANY_FILETYPES_NSIS].keywords[0]); - sci_set_keywords(sci, 1, style_sets[GEANY_FILETYPES_NSIS].keywords[1]); - sci_set_keywords(sci, 2, style_sets[GEANY_FILETYPES_NSIS].keywords[2]); - sci_set_keywords(sci, 3, style_sets[GEANY_FILETYPES_NSIS].keywords[3]); + sci_set_keywords(sci, 0, style_sets[ft_id].keywords[0]); + sci_set_keywords(sci, 1, style_sets[ft_id].keywords[1]); + sci_set_keywords(sci, 2, style_sets[ft_id].keywords[2]); + sci_set_keywords(sci, 3, style_sets[ft_id].keywords[3]);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_NSIS, 0); - set_sci_style(sci, SCE_NSIS_DEFAULT, GEANY_FILETYPES_NSIS, 0); - set_sci_style(sci, SCE_NSIS_COMMENT, GEANY_FILETYPES_NSIS, 1); - set_sci_style(sci, SCE_NSIS_STRINGDQ, GEANY_FILETYPES_NSIS, 2); - set_sci_style(sci, SCE_NSIS_STRINGLQ, GEANY_FILETYPES_NSIS, 3); - set_sci_style(sci, SCE_NSIS_STRINGRQ, GEANY_FILETYPES_NSIS, 4); - set_sci_style(sci, SCE_NSIS_FUNCTION, GEANY_FILETYPES_NSIS, 5); - set_sci_style(sci, SCE_NSIS_VARIABLE, GEANY_FILETYPES_NSIS, 6); - set_sci_style(sci, SCE_NSIS_LABEL, GEANY_FILETYPES_NSIS, 7); - set_sci_style(sci, SCE_NSIS_USERDEFINED, GEANY_FILETYPES_NSIS, 8); - set_sci_style(sci, SCE_NSIS_SECTIONDEF, GEANY_FILETYPES_NSIS, 9); - set_sci_style(sci, SCE_NSIS_SUBSECTIONDEF, GEANY_FILETYPES_NSIS, 10); - set_sci_style(sci, SCE_NSIS_IFDEFINEDEF, GEANY_FILETYPES_NSIS, 11); - set_sci_style(sci, SCE_NSIS_MACRODEF, GEANY_FILETYPES_NSIS, 12); - set_sci_style(sci, SCE_NSIS_STRINGVAR, GEANY_FILETYPES_NSIS, 13); - set_sci_style(sci, SCE_NSIS_NUMBER, GEANY_FILETYPES_NSIS, 14); - set_sci_style(sci, SCE_NSIS_SECTIONGROUP, GEANY_FILETYPES_NSIS, 15); - set_sci_style(sci, SCE_NSIS_PAGEEX, GEANY_FILETYPES_NSIS, 16); - set_sci_style(sci, SCE_NSIS_FUNCTIONDEF, GEANY_FILETYPES_NSIS, 17); - set_sci_style(sci, SCE_NSIS_COMMENTBOX, GEANY_FILETYPES_NSIS, 18); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_NSIS_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_NSIS_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_NSIS_STRINGDQ, ft_id, 2); + set_sci_style(sci, SCE_NSIS_STRINGLQ, ft_id, 3); + set_sci_style(sci, SCE_NSIS_STRINGRQ, ft_id, 4); + set_sci_style(sci, SCE_NSIS_FUNCTION, ft_id, 5); + set_sci_style(sci, SCE_NSIS_VARIABLE, ft_id, 6); + set_sci_style(sci, SCE_NSIS_LABEL, ft_id, 7); + set_sci_style(sci, SCE_NSIS_USERDEFINED, ft_id, 8); + set_sci_style(sci, SCE_NSIS_SECTIONDEF, ft_id, 9); + set_sci_style(sci, SCE_NSIS_SUBSECTIONDEF, ft_id, 10); + set_sci_style(sci, SCE_NSIS_IFDEFINEDEF, ft_id, 11); + set_sci_style(sci, SCE_NSIS_MACRODEF, ft_id, 12); + set_sci_style(sci, SCE_NSIS_STRINGVAR, ft_id, 13); + set_sci_style(sci, SCE_NSIS_NUMBER, ft_id, 14); + set_sci_style(sci, SCE_NSIS_SECTIONGROUP, ft_id, 15); + set_sci_style(sci, SCE_NSIS_PAGEEX, ft_id, 16); + set_sci_style(sci, SCE_NSIS_FUNCTIONDEF, ft_id, 17); + set_sci_style(sci, SCE_NSIS_COMMENTBOX, ft_id, 18); }
static void styleset_po_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_PO, 9); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_PO].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_PO].styling[1]); - get_keyfile_style(config, config_home, "msgid", &style_sets[GEANY_FILETYPES_PO].styling[2]); - get_keyfile_style(config, config_home, "msgid_text", &style_sets[GEANY_FILETYPES_PO].styling[3]); - get_keyfile_style(config, config_home, "msgstr", &style_sets[GEANY_FILETYPES_PO].styling[4]); - get_keyfile_style(config, config_home, "msgstr_text", &style_sets[GEANY_FILETYPES_PO].styling[5]); - get_keyfile_style(config, config_home, "msgctxt", &style_sets[GEANY_FILETYPES_PO].styling[6]); - get_keyfile_style(config, config_home, "msgctxt_text", &style_sets[GEANY_FILETYPES_PO].styling[7]); - get_keyfile_style(config, config_home, "fuzzy", &style_sets[GEANY_FILETYPES_PO].styling[8]); + new_styleset(ft_id, 9); + get_keyfile_style(config, config_home, "default", &style_sets[ft_id].styling[0]); + get_keyfile_style(config, config_home, "comment", &style_sets[ft_id].styling[1]); + get_keyfile_style(config, config_home, "msgid", &style_sets[ft_id].styling[2]); + get_keyfile_style(config, config_home, "msgid_text", &style_sets[ft_id].styling[3]); + get_keyfile_style(config, config_home, "msgstr", &style_sets[ft_id].styling[4]); + get_keyfile_style(config, config_home, "msgstr_text", &style_sets[ft_id].styling[5]); + get_keyfile_style(config, config_home, "msgctxt", &style_sets[ft_id].styling[6]); + get_keyfile_style(config, config_home, "msgctxt_text", &style_sets[ft_id].styling[7]); + get_keyfile_style(config, config_home, "fuzzy", &style_sets[ft_id].styling[8]);
- style_sets[GEANY_FILETYPES_PO].keywords = NULL; + style_sets[ft_id].keywords = NULL; }
-static void styleset_po(ScintillaObject *sci) +static void styleset_po(ScintillaObject *sci, gint ft_id) { - const filetype_id ft_id = GEANY_FILETYPES_PO; - apply_filetype_properties(sci, SCLEX_PO, ft_id);
- set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PO, 0); - set_sci_style(sci, SCE_PO_DEFAULT, GEANY_FILETYPES_PO, 0); - set_sci_style(sci, SCE_PO_COMMENT, GEANY_FILETYPES_PO, 1); - set_sci_style(sci, SCE_PO_MSGID, GEANY_FILETYPES_PO, 2); - set_sci_style(sci, SCE_PO_MSGID_TEXT, GEANY_FILETYPES_PO, 3); - set_sci_style(sci, SCE_PO_MSGSTR, GEANY_FILETYPES_PO, 4); - set_sci_style(sci, SCE_PO_MSGSTR_TEXT, GEANY_FILETYPES_PO, 5); - set_sci_style(sci, SCE_PO_MSGCTXT, GEANY_FILETYPES_PO, 6); - set_sci_style(sci, SCE_PO_MSGCTXT_TEXT, GEANY_FILETYPES_PO, 7); - set_sci_style(sci, SCE_PO_FUZZY, GEANY_FILETYPES_PO, 8); + set_sci_style(sci, STYLE_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_PO_DEFAULT, ft_id, 0); + set_sci_style(sci, SCE_PO_COMMENT, ft_id, 1); + set_sci_style(sci, SCE_PO_MSGID, ft_id, 2); + set_sci_style(sci, SCE_PO_MSGID_TEXT, ft_id, 3); + set_sci_style(sci, SCE_PO_MSGSTR, ft_id, 4); + set_sci_style(sci, SCE_PO_MSGSTR_TEXT, ft_id, 5); + set_sci_style(sci, SCE_PO_MSGCTXT, ft_id, 6); + set_sci_style(sci, SCE_PO_MSGCTXT_TEXT, ft_id, 7); + set_sci_style(sci, SCE_PO_FUZZY, ft_id, 8); }
static void styleset_conf_init(gint ft_id, GKeyFile *config, GKeyFile *config_home) { - new_styleset(GEANY_FILETYPES_CONF, 6); - get_keyfile_style(config, config_home, "default", &style_sets[GEANY_FILETYPES_CONF].styling[0]); - get_keyfile_style(config, config_home, "comment", &style_sets[GEANY_FILETYPES_CONF].styling[1]); - get_keyfile_style(config, config_home, "section", &style_sets[GEANY_FILETYPES_CONF].styling[2]);
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.