Add OpenGL Shader Language (GLSL) filetype (patch from Colomban
[geany-mirror.git] / src / highlighting.c
blob749fbeba320f0d6d782df28a7dd4873b10db4658
1 /*
2 * highlighting.c - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005-2008 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2008 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * $Id$
24 /**
25 * @file highlighting.h
26 * Syntax highlighting for the different filetypes, using the Scintilla lexers.
29 #include <stdlib.h>
31 #include "SciLexer.h"
32 #include "geany.h"
33 #include "highlighting.h"
34 #include "editor.h"
35 #include "utils.h"
36 #include "filetypes.h"
37 #include "symbols.h"
40 /* Whitespace has to be set after setting wordchars. */
41 #define GEANY_WHITESPACE_CHARS " \t" "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"
43 static gchar *whitespace_chars;
45 static void styleset_markup(ScintillaObject *sci, gboolean set_keywords);
48 typedef struct
50 gsize count; /* number of styles */
51 GeanyLexerStyle *styling; /* array of styles, NULL if not used or uninitialised */
52 gchar **keywords;
53 gchar *wordchars; /* NULL used for style sets with no styles */
54 } StyleSet;
56 /* each filetype has a styleset except GEANY_FILETYPES_NONE, which uses common_style_set */
57 static StyleSet style_sets[GEANY_MAX_BUILT_IN_FILETYPES - 1] = {{0, NULL, NULL, NULL}};
60 enum /* Geany common styling */
62 GCS_DEFAULT,
63 GCS_SELECTION,
64 GCS_BRACE_GOOD,
65 GCS_BRACE_BAD,
66 GCS_MARGIN_LINENUMBER,
67 GCS_MARGIN_FOLDING,
68 GCS_CURRENT_LINE,
69 GCS_CARET,
70 GCS_INDENT_GUIDE,
71 GCS_WHITE_SPACE,
72 GCS_LINE_WRAP_VISUALS,
73 GCS_LINE_WRAP_INDENT,
74 GCS_TRANSLUCENCY,
75 GCS_MARKER_LINE,
76 GCS_MARKER_SEARCH,
77 GCS_MARKER_TRANSLUCENCY,
78 GCS_MAX
81 typedef struct
83 /* can take values 1 or 2 (or 3) */
84 guint marker:2;
85 guint lines:2;
86 guint draw_line:3;
87 } FoldingStyle;
89 static struct
91 GeanyLexerStyle styling[GCS_MAX];
92 FoldingStyle folding_style;
93 gboolean invert_all;
94 gchar *wordchars;
95 } common_style_set;
98 /* used for default styles */
99 typedef struct
101 gchar *name;
102 GeanyLexerStyle *style;
103 } StyleEntry;
106 static void new_style_array(gint file_type_id, gint styling_count)
108 StyleSet *set = &style_sets[file_type_id];
110 set->count = styling_count;
111 set->styling = g_new0(GeanyLexerStyle, styling_count);
115 static void get_keyfile_keywords(GKeyFile *config, GKeyFile *configh, const gchar *section,
116 const gchar *key, gint index, gint pos, const gchar *default_value)
118 gchar *result;
120 if (config == NULL || configh == NULL || section == NULL)
122 style_sets[index].keywords[pos] = g_strdup(default_value);
123 return;
126 result = g_key_file_get_string(configh, section, key, NULL);
127 if (result == NULL) result = g_key_file_get_string(config, section, key, NULL);
129 if (result == NULL)
131 style_sets[index].keywords[pos] = g_strdup(default_value);
133 else
135 style_sets[index].keywords[pos] = result;
140 static void get_keyfile_wordchars(GKeyFile *config, GKeyFile *configh, gchar **wordchars)
142 gchar *result;
144 if (config == NULL || configh == NULL)
146 *wordchars = g_strdup(GEANY_WORDCHARS);
147 return;
150 result = g_key_file_get_string(configh, "settings", "wordchars", NULL);
151 if (result == NULL) result = g_key_file_get_string(config, "settings", "wordchars", NULL);
153 if (result == NULL)
155 *wordchars = g_strdup(GEANY_WORDCHARS);
157 else
158 *wordchars = result;
162 /* convert 0x..RRGGBB to 0x..BBGGRR */
163 static gint rotate_rgb(gint color)
165 return ((color & 0xFF0000) >> 16) +
166 (color & 0x00FF00) +
167 ((color & 0x0000FF) << 16);
171 static void get_keyfile_style(GKeyFile *config, GKeyFile *configh,
172 const gchar *key_name, const GeanyLexerStyle *default_style, GeanyLexerStyle *style)
174 gchar **list;
175 gsize len;
177 g_return_if_fail(config && configh && key_name && default_style && style);
179 list = g_key_file_get_string_list(configh, "styling", key_name, &len, NULL);
180 if (list == NULL)
181 list = g_key_file_get_string_list(config, "styling", key_name, &len, NULL);
183 if (list != NULL && list[0] != NULL)
184 style->foreground = (gint) utils_strtod(list[0], NULL, FALSE);
185 else
186 style->foreground = rotate_rgb(default_style->foreground);
188 if (list != NULL && list[1] != NULL)
189 style->background = (gint) utils_strtod(list[1], NULL, FALSE);
190 else
191 style->background = rotate_rgb(default_style->background);
193 if (list != NULL && list[2] != NULL) style->bold = utils_atob(list[2]);
194 else style->bold = default_style->bold;
196 if (list != NULL && list[3] != NULL) style->italic = utils_atob(list[3]);
197 else style->italic = default_style->italic;
199 g_strfreev(list);
203 static void get_keyfile_hex(GKeyFile *config, GKeyFile *configh,
204 const gchar *section, const gchar *key,
205 const gchar *foreground, const gchar *background, const gchar *bold,
206 GeanyLexerStyle *style)
208 gchar **list;
209 gsize len;
211 if (config == NULL || configh == NULL || section == NULL) return;
213 list = g_key_file_get_string_list(configh, section, key, &len, NULL);
214 if (list == NULL) list = g_key_file_get_string_list(config, section, key, &len, NULL);
216 if (list != NULL && list[0] != NULL)
217 style->foreground = (gint) utils_strtod(list[0], NULL, FALSE);
218 else if (foreground)
219 style->foreground = (gint) utils_strtod(foreground, NULL, FALSE);
221 if (list != NULL && list[1] != NULL)
222 style->background = (gint) utils_strtod(list[1], NULL, FALSE);
223 else if (background)
224 style->background = (gint) utils_strtod(background, NULL, FALSE);
226 if (list != NULL && list[2] != NULL) style->bold = utils_atob(list[2]);
227 else style->bold = utils_atob(bold);
229 if (list != NULL && list[3] != NULL) style->italic = utils_atob(list[3]);
230 else style->italic = FALSE;
232 g_strfreev(list);
236 static void get_keyfile_int(GKeyFile *config, GKeyFile *configh, const gchar *section,
237 const gchar *key, gint fdefault_val, gint sdefault_val,
238 GeanyLexerStyle *style)
240 gchar **list;
241 gchar *end1, *end2;
242 gsize len;
244 if (config == NULL || configh == NULL || section == NULL) return;
246 list = g_key_file_get_string_list(configh, section, key, &len, NULL);
247 if (list == NULL) list = g_key_file_get_string_list(config, section, key, &len, NULL);
249 if (list != NULL && list[0] != NULL) style->foreground = strtol(list[0], &end1, 10);
250 else style->foreground = fdefault_val;
251 if (list != NULL && list[1] != NULL) style->background = strtol(list[1], &end2, 10);
252 else style->background = sdefault_val;
254 /* if there was an error, strtol() returns 0 and end is list[x], so then we use default_val */
255 if (list == NULL || list[0] == end1) style->foreground = fdefault_val;
256 if (list == NULL || list[1] == end2) style->background = sdefault_val;
258 g_strfreev(list);
262 static guint invert(guint icolour)
264 if (common_style_set.invert_all)
266 guint r, g, b;
268 r = 0xffffff - icolour;
269 g = 0xffffff - (icolour >> 8);
270 b = 0xffffff - (icolour >> 16);
271 return (r | (g << 8) | (b << 16));
273 return icolour;
277 static GeanyLexerStyle *get_style(guint ft_id, guint styling_index)
279 g_assert(ft_id < GEANY_MAX_BUILT_IN_FILETYPES);
281 if (ft_id == GEANY_FILETYPES_NONE)
283 g_assert(styling_index < GCS_MAX);
284 return &common_style_set.styling[styling_index];
286 else
288 StyleSet *set = &style_sets[ft_id];
290 g_assert(styling_index < set->count);
291 return &set->styling[styling_index];
296 static void set_sci_style(ScintillaObject *sci, gint style, guint ft_id, guint styling_index)
298 GeanyLexerStyle *style_ptr = get_style(ft_id, styling_index);
300 SSM(sci, SCI_STYLESETFORE, style, invert(style_ptr->foreground));
301 SSM(sci, SCI_STYLESETBACK, style, invert(style_ptr->background));
302 SSM(sci, SCI_STYLESETBOLD, style, style_ptr->bold);
303 SSM(sci, SCI_STYLESETITALIC, style, style_ptr->italic);
307 void highlighting_free_styles()
309 gint i;
311 for (i = 0; i < GEANY_MAX_BUILT_IN_FILETYPES - 1; i++)
313 StyleSet *style_ptr;
314 style_ptr = &style_sets[i];
316 style_ptr->count = 0;
317 g_free(style_ptr->styling);
318 g_strfreev(style_ptr->keywords);
319 g_free(style_ptr->wordchars);
324 static GString *get_global_typenames(gint lang)
326 GString *s = NULL;
328 if (app->tm_workspace)
330 GPtrArray *tags_array = app->tm_workspace->global_tags;
332 if (tags_array)
334 s = symbols_find_tags_as_string(tags_array, TM_GLOBAL_TYPE_MASK, lang);
337 return s;
341 static gchar*
342 get_keyfile_whitespace_chars(GKeyFile *config, GKeyFile *configh)
344 gchar *result;
346 if (config == NULL || configh == NULL)
348 result = NULL;
350 else
352 result = g_key_file_get_string(configh, "settings", "whitespace_chars", NULL);
353 if (result == NULL)
354 result = g_key_file_get_string(config, "settings", "whitespace_chars", NULL);
356 if (result == NULL)
357 result = g_strdup(GEANY_WHITESPACE_CHARS);
358 return result;
362 static void styleset_common_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
364 static gboolean common_style_set_valid = FALSE;
366 if (common_style_set_valid)
367 return;
368 common_style_set_valid = TRUE; /* ensure filetypes.common is only loaded once */
370 get_keyfile_hex(config, config_home, "styling", "default",
371 "0x000000", "0xffffff", "false", &common_style_set.styling[GCS_DEFAULT]);
372 get_keyfile_hex(config, config_home, "styling", "selection",
373 "0xc0c0c0", "0x7f0000", "false", &common_style_set.styling[GCS_SELECTION]);
374 get_keyfile_hex(config, config_home, "styling", "brace_good",
375 "0x000000", "0xffffff", "false", &common_style_set.styling[GCS_BRACE_GOOD]);
376 get_keyfile_hex(config, config_home, "styling", "brace_bad",
377 "0xff0000", "0xffffff", "false", &common_style_set.styling[GCS_BRACE_BAD]);
378 get_keyfile_hex(config, config_home, "styling", "margin_linenumber",
379 "0x000000", "0xd0d0d0", "false", &common_style_set.styling[GCS_MARGIN_LINENUMBER]);
380 get_keyfile_hex(config, config_home, "styling", "margin_folding",
381 "0x000000", "0xdfdfdf", "false", &common_style_set.styling[GCS_MARGIN_FOLDING]);
382 get_keyfile_hex(config, config_home, "styling", "current_line",
383 "0x000000", "0xe5e5e5", "true", &common_style_set.styling[GCS_CURRENT_LINE]);
384 get_keyfile_hex(config, config_home, "styling", "caret",
385 "0x000000", "0x000000", "false", &common_style_set.styling[GCS_CARET]);
386 get_keyfile_hex(config, config_home, "styling", "indent_guide",
387 "0xc0c0c0", "0xffffff", "false", &common_style_set.styling[GCS_INDENT_GUIDE]);
388 get_keyfile_hex(config, config_home, "styling", "white_space",
389 "0xc0c0c0", "0xffffff", "true", &common_style_set.styling[GCS_WHITE_SPACE]);
390 get_keyfile_hex(config, config_home, "styling", "marker_line",
391 "0x000000", "0xffff00", "false", &common_style_set.styling[GCS_MARKER_LINE]);
392 get_keyfile_hex(config, config_home, "styling", "marker_search",
393 "0x000000", "0xB8F4B8", "false", &common_style_set.styling[GCS_MARKER_SEARCH]);
395 /* hack because get_keyfile_int uses a Style struct */
396 GeanyLexerStyle tmp_style;
397 get_keyfile_int(config, config_home, "styling", "folding_style",
398 1, 1, &tmp_style);
399 common_style_set.folding_style.marker = tmp_style.foreground;
400 common_style_set.folding_style.lines = tmp_style.background;
401 get_keyfile_int(config, config_home, "styling", "invert_all",
402 0, 0, &tmp_style);
403 common_style_set.invert_all = tmp_style.foreground;
404 get_keyfile_int(config, config_home, "styling", "folding_horiz_line",
405 2, 0, &tmp_style);
406 common_style_set.folding_style.draw_line = tmp_style.foreground;
407 get_keyfile_int(config, config_home, "styling", "caret_width",
408 1, 0, &tmp_style);
409 common_style_set.styling[GCS_CARET].background = tmp_style.foreground;
410 get_keyfile_int(config, config_home, "styling", "line_wrap_visuals",
411 3, 0, &tmp_style);
412 common_style_set.styling[GCS_LINE_WRAP_VISUALS].foreground = tmp_style.foreground;
413 common_style_set.styling[GCS_LINE_WRAP_VISUALS].background = tmp_style.background;
414 get_keyfile_int(config, config_home, "styling", "line_wrap_indent",
415 0, 0, &tmp_style);
416 common_style_set.styling[GCS_LINE_WRAP_INDENT].foreground = tmp_style.foreground;
417 get_keyfile_int(config, config_home, "styling", "translucency",
418 256, 256, &tmp_style);
419 common_style_set.styling[GCS_TRANSLUCENCY].foreground = tmp_style.foreground;
420 common_style_set.styling[GCS_TRANSLUCENCY].background = tmp_style.background;
421 get_keyfile_int(config, config_home, "styling", "marker_translucency",
422 256, 256, &tmp_style);
423 common_style_set.styling[GCS_MARKER_TRANSLUCENCY].foreground = tmp_style.foreground;
424 common_style_set.styling[GCS_MARKER_TRANSLUCENCY].background = tmp_style.background;
427 get_keyfile_wordchars(config, config_home, &common_style_set.wordchars);
428 whitespace_chars = get_keyfile_whitespace_chars(config, config_home);
433 static void styleset_common(ScintillaObject *sci, gint style_bits, filetype_id ft_id)
435 SSM(sci, SCI_STYLECLEARALL, 0, 0);
437 /* caret colour, style and width */
438 SSM(sci, SCI_SETCARETFORE, invert(common_style_set.styling[GCS_CARET].foreground), 0);
439 SSM(sci, SCI_SETCARETWIDTH, common_style_set.styling[GCS_CARET].background, 0);
440 if (common_style_set.styling[GCS_CARET].bold)
441 SSM(sci, SCI_SETCARETSTYLE, CARETSTYLE_BLOCK, 0);
442 else
443 SSM(sci, SCI_SETCARETSTYLE, CARETSTYLE_LINE, 0);
445 /* colourize the current line */
446 SSM(sci, SCI_SETCARETLINEBACK, invert(common_style_set.styling[GCS_CURRENT_LINE].background), 0);
447 /* bold=enable current line */
448 SSM(sci, SCI_SETCARETLINEVISIBLE, common_style_set.styling[GCS_CURRENT_LINE].bold, 0);
450 /* Translucency for current line and selection */
451 SSM(sci, SCI_SETCARETLINEBACKALPHA, common_style_set.styling[GCS_TRANSLUCENCY].foreground, 0);
452 SSM(sci, SCI_SETSELALPHA, common_style_set.styling[GCS_TRANSLUCENCY].background, 0);
454 /* line wrapping visuals */
455 SSM(sci, SCI_SETWRAPVISUALFLAGS,
456 common_style_set.styling[GCS_LINE_WRAP_VISUALS].foreground, 0);
457 SSM(sci, SCI_SETWRAPVISUALFLAGSLOCATION,
458 common_style_set.styling[GCS_LINE_WRAP_VISUALS].background, 0);
459 SSM(sci, SCI_SETWRAPSTARTINDENT, common_style_set.styling[GCS_LINE_WRAP_INDENT].foreground, 0);
461 /* indicator settings */
462 SSM(sci, SCI_INDICSETSTYLE, 2, INDIC_SQUIGGLE);
463 /* why? if I let this out, the indicator remains green with PHP */
464 SSM(sci, SCI_INDICSETFORE, 0, invert(0x0000ff));
465 SSM(sci, SCI_INDICSETFORE, 2, invert(0x0000ff));
467 /* define marker symbols
468 * 0 -> line marker */
469 SSM(sci, SCI_MARKERDEFINE, 0, SC_MARK_SHORTARROW);
470 SSM(sci, SCI_MARKERSETFORE, 0, invert(common_style_set.styling[GCS_MARKER_LINE].foreground));
471 SSM(sci, SCI_MARKERSETBACK, 0, invert(common_style_set.styling[GCS_MARKER_LINE].background));
472 SSM(sci, SCI_MARKERSETALPHA, 0, common_style_set.styling[GCS_MARKER_TRANSLUCENCY].foreground);
474 /* 1 -> user marker */
475 SSM(sci, SCI_MARKERDEFINE, 1, SC_MARK_PLUS);
476 SSM(sci, SCI_MARKERSETFORE, 1, invert(common_style_set.styling[GCS_MARKER_SEARCH].foreground));
477 SSM(sci, SCI_MARKERSETBACK, 1, invert(common_style_set.styling[GCS_MARKER_SEARCH].background));
478 SSM(sci, SCI_MARKERSETALPHA, 1, common_style_set.styling[GCS_MARKER_TRANSLUCENCY].background);
480 /* 2 -> folding marker, other folding settings */
481 SSM(sci, SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL);
482 SSM(sci, SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS);
484 /* drawing a horizontal line when text if folded */
485 switch (common_style_set.folding_style.draw_line)
487 case 1:
489 SSM(sci, SCI_SETFOLDFLAGS, 4, 0);
490 break;
492 case 2:
494 SSM(sci, SCI_SETFOLDFLAGS, 16, 0);
495 break;
497 default:
499 SSM(sci, SCI_SETFOLDFLAGS, 0, 0);
500 break;
504 /* choose the folding style - boxes or circles, I prefer boxes, so it is default ;-) */
505 switch (common_style_set.folding_style.marker)
507 case 2:
509 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS);
510 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS);
511 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED);
512 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
513 break;
515 default:
517 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS);
518 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS);
519 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED);
520 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED);
521 break;
525 /* choose the folding style - straight or curved, I prefer straight, so it is default ;-) */
526 switch (common_style_set.folding_style.lines)
528 case 2:
530 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE);
531 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE);
532 break;
534 default:
536 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER);
537 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER);
538 break;
542 SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE);
544 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPEN, 0xffffff);
545 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPEN, 0x000000);
546 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDER, 0xffffff);
547 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDER, 0x000000);
548 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDERSUB, 0xffffff);
549 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDERSUB, 0x000000);
550 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDERTAIL, 0xffffff);
551 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDERTAIL, 0x000000);
552 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDEREND, 0xffffff);
553 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDEREND, 0x000000);
554 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPENMID, 0xffffff);
555 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPENMID, 0x000000);
556 SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDERMIDTAIL, 0xffffff);
557 SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDERMIDTAIL, 0x000000);
559 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold", (sptr_t) "1");
560 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.compact", (sptr_t) "0");
561 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.comment", (sptr_t) "1");
562 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.preprocessor", (sptr_t) "1");
563 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.at.else", (sptr_t) "1");
566 /* bold (3rd argument) is whether to override default foreground selection */
567 if (common_style_set.styling[GCS_SELECTION].bold)
568 SSM(sci, SCI_SETSELFORE, 1, invert(common_style_set.styling[GCS_SELECTION].foreground));
569 /* italic (4th argument) is whether to override default background selection */
570 if (common_style_set.styling[GCS_SELECTION].italic)
571 SSM(sci, SCI_SETSELBACK, 1, invert(common_style_set.styling[GCS_SELECTION].background));
573 SSM(sci, SCI_SETSTYLEBITS, style_bits, 0);
576 SSM(sci, SCI_SETFOLDMARGINCOLOUR, 1, invert(common_style_set.styling[GCS_MARGIN_FOLDING].background));
577 /*SSM(sci, SCI_SETFOLDMARGINHICOLOUR, 1, invert(common_style_set.styling[GCS_MARGIN_FOLDING].background));*/
578 set_sci_style(sci, STYLE_LINENUMBER, GEANY_FILETYPES_NONE, GCS_MARGIN_LINENUMBER);
579 set_sci_style(sci, STYLE_BRACELIGHT, GEANY_FILETYPES_NONE, GCS_BRACE_GOOD);
580 set_sci_style(sci, STYLE_BRACEBAD, GEANY_FILETYPES_NONE, GCS_BRACE_BAD);
581 set_sci_style(sci, STYLE_INDENTGUIDE, GEANY_FILETYPES_NONE, GCS_INDENT_GUIDE);
583 /* bold = common whitespace settings enabled */
584 SSM(sci, SCI_SETWHITESPACEFORE, common_style_set.styling[GCS_WHITE_SPACE].bold,
585 invert(common_style_set.styling[GCS_WHITE_SPACE].foreground));
586 SSM(sci, SCI_SETWHITESPACEBACK, common_style_set.styling[GCS_WHITE_SPACE].italic,
587 invert(common_style_set.styling[GCS_WHITE_SPACE].background));
591 /* Assign global typedefs and user secondary keywords */
592 static void assign_global_and_user_keywords(ScintillaObject *sci,
593 const gchar *user_words, gint lang)
595 GString *s;
597 s = get_global_typenames(lang);
598 if (s == NULL)
599 s = g_string_sized_new(200);
600 else
601 g_string_append_c(s, ' '); /* append a space as delimiter to the existing list of words */
603 g_string_append(s, user_words);
605 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) s->str);
606 g_string_free(s, TRUE);
610 /* All stylesets except None should call this. */
611 static void
612 apply_filetype_properties(ScintillaObject *sci, gint lexer, filetype_id ft_id)
614 SSM(sci, SCI_SETLEXER, lexer, 0);
616 SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) style_sets[ft_id].wordchars);
617 /* have to set whitespace after setting wordchars */
618 SSM(sci, SCI_SETWHITESPACECHARS, 0, (sptr_t) whitespace_chars);
620 SSM(sci, SCI_AUTOCSETMAXHEIGHT, editor_prefs.symbolcompletion_max_height, 0);
624 /* Geany generic styles, initialized to defaults.
625 * Ideally these would be used as common styling for all compilable programming
626 * languages (and perhaps partially used for scripting languages too).
627 * Currently only used as default styling for C-like languages. */
628 GeanyLexerStyle gsd_default = {0x000000, 0xffffff, FALSE, FALSE};
629 GeanyLexerStyle gsd_comment = {0xd00000, 0xffffff, FALSE, FALSE};
630 GeanyLexerStyle gsd_comment_doc = {0x3f5fbf, 0xffffff, TRUE, FALSE};
631 GeanyLexerStyle gsd_number = {0x007f00, 0xffffff, FALSE, FALSE};
632 GeanyLexerStyle gsd_reserved_word = {0x00007f, 0xffffff, TRUE, FALSE};
633 GeanyLexerStyle gsd_system_word = {0x991111, 0xffffff, TRUE, FALSE};
634 GeanyLexerStyle gsd_user_word = {0x0000d0, 0xffffff, TRUE, FALSE};
635 GeanyLexerStyle gsd_string = {0xff901e, 0xffffff, FALSE, FALSE};
636 GeanyLexerStyle gsd_pragma = {0x007f7f, 0xffffff, FALSE, FALSE};
637 GeanyLexerStyle gsd_string_eol = {0x000000, 0xe0c0e0, FALSE, FALSE};
640 /* call new_style_array(filetype_idx, >= 20) before using this. */
641 static void
642 styleset_c_like_init(GKeyFile *config, GKeyFile *config_home, gint filetype_idx)
644 static GeanyLexerStyle uuid = {0x404080, 0xffffff, FALSE, FALSE};
645 static GeanyLexerStyle operator = {0x301010, 0xffffff, FALSE, FALSE};
646 static GeanyLexerStyle verbatim = {0x301010, 0xffffff, FALSE, FALSE};
647 static GeanyLexerStyle regex = {0x105090, 0xffffff, FALSE, FALSE};
649 StyleEntry entries[] =
651 {"default", &gsd_default},
652 {"comment", &gsd_comment},
653 {"commentline", &gsd_comment},
654 {"commentdoc", &gsd_comment_doc},
655 {"number", &gsd_number},
656 {"word", &gsd_reserved_word},
657 {"word2", &gsd_system_word},
658 {"string", &gsd_string},
659 {"character", &gsd_string},
660 {"uuid", &uuid},
661 {"preprocessor",&gsd_pragma},
662 {"operator", &operator},
663 {"identifier", &gsd_default},
664 {"stringeol", &gsd_string_eol},
665 {"verbatim", &verbatim},
666 {"regex", &regex},
667 {"commentlinedoc", &gsd_comment_doc},
668 {"commentdockeyword", &gsd_comment_doc},
669 {"commentdockeyworderror", &gsd_comment_doc},
670 {"globalclass", &gsd_user_word}
672 gint i;
674 for (i = 0; i < 20; i++)
675 get_keyfile_style(config, config_home, entries[i].name, entries[i].style,
676 &style_sets[filetype_idx].styling[i]);
680 static void styleset_c_like(ScintillaObject *sci, gint filetype_idx)
682 set_sci_style(sci, STYLE_DEFAULT, filetype_idx, 0);
683 set_sci_style(sci, SCE_C_DEFAULT, filetype_idx, 0);
684 set_sci_style(sci, SCE_C_COMMENT, filetype_idx, 1);
685 set_sci_style(sci, SCE_C_COMMENTLINE, filetype_idx, 2);
686 set_sci_style(sci, SCE_C_COMMENTDOC, filetype_idx, 3);
687 set_sci_style(sci, SCE_C_NUMBER, filetype_idx, 4);
688 set_sci_style(sci, SCE_C_WORD, filetype_idx, 5);
689 set_sci_style(sci, SCE_C_WORD2, filetype_idx, 6);
690 set_sci_style(sci, SCE_C_STRING, filetype_idx, 7);
691 set_sci_style(sci, SCE_C_CHARACTER, filetype_idx, 8);
692 set_sci_style(sci, SCE_C_UUID, filetype_idx, 9);
693 set_sci_style(sci, SCE_C_PREPROCESSOR, filetype_idx, 10);
694 set_sci_style(sci, SCE_C_OPERATOR, filetype_idx, 11);
695 set_sci_style(sci, SCE_C_IDENTIFIER, filetype_idx, 12);
696 set_sci_style(sci, SCE_C_STRINGEOL, filetype_idx, 13);
697 set_sci_style(sci, SCE_C_VERBATIM, filetype_idx, 14);
698 set_sci_style(sci, SCE_C_REGEX, filetype_idx, 15);
699 set_sci_style(sci, SCE_C_COMMENTLINEDOC, filetype_idx, 16);
700 set_sci_style(sci, SCE_C_COMMENTDOCKEYWORD, filetype_idx, 17);
701 set_sci_style(sci, SCE_C_COMMENTDOCKEYWORDERROR, filetype_idx, 18);
702 /* is used for local structs and typedefs */
703 set_sci_style(sci, SCE_C_GLOBALCLASS, filetype_idx, 19);
707 static void styleset_c_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
709 new_style_array(GEANY_FILETYPES_C, 21);
710 styleset_c_like_init(config, config_home, GEANY_FILETYPES_C);
711 get_keyfile_int(config, config_home, "styling", "styling_within_preprocessor",
712 1, 0, &style_sets[GEANY_FILETYPES_C].styling[20]);
714 style_sets[GEANY_FILETYPES_C].keywords = g_new(gchar*, 4);
715 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_C, 0, "if const struct char int float double void long for while do case switch return");
716 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_C, 1, "");
717 get_keyfile_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_C, 2, "TODO FIXME");
718 style_sets[GEANY_FILETYPES_C].keywords[3] = NULL;
720 get_keyfile_wordchars(config, config_home,
721 &style_sets[GEANY_FILETYPES_C].wordchars);
725 static void styleset_c(ScintillaObject *sci)
727 const filetype_id ft_id = GEANY_FILETYPES_C;
729 styleset_common(sci, 5, ft_id);
731 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
733 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_C].keywords[0]);
734 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_C].keywords[2]);
736 /* assign global types, merge them with user defined keywords and set them */
737 assign_global_and_user_keywords(sci, style_sets[GEANY_FILETYPES_C].keywords[1],
738 filetypes[ft_id]->lang);
740 styleset_c_like(sci, GEANY_FILETYPES_C);
742 if (style_sets[GEANY_FILETYPES_C].styling[20].foreground == 1)
743 SSM(sci, SCI_SETPROPERTY, (sptr_t) "styling.within.preprocessor", (sptr_t) "1");
744 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.symbol.$(file.patterns.cpp)", (sptr_t) "#");
745 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.start.$(file.patterns.cpp)", (sptr_t) "if ifdef ifndef");
746 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.middle.$(file.patterns.cpp)", (sptr_t) "else elif");
747 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.end.$(file.patterns.cpp)", (sptr_t) "endif");
751 static void styleset_cpp_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
753 new_style_array(GEANY_FILETYPES_CPP, 21);
754 styleset_c_like_init(config, config_home, GEANY_FILETYPES_CPP);
755 get_keyfile_int(config, config_home, "styling", "styling_within_preprocessor",
756 1, 0, &style_sets[GEANY_FILETYPES_CPP].styling[20]);
758 style_sets[GEANY_FILETYPES_CPP].keywords = g_new(gchar*, 4);
759 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_CPP, 0, "and and_eq asm auto bitand bitor bool break case catch char class compl const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new not not_eq operator or or_eq private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while xor xor_eq");
760 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_CPP, 1, "");
761 get_keyfile_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_CPP, 2, "TODO FIXME");
762 style_sets[GEANY_FILETYPES_CPP].keywords[3] = NULL;
764 get_keyfile_wordchars(config, config_home,
765 &style_sets[GEANY_FILETYPES_CPP].wordchars);
769 static void styleset_cpp(ScintillaObject *sci)
771 const filetype_id ft_id = GEANY_FILETYPES_CPP;
773 styleset_common(sci, 5, ft_id);
775 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
777 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_CPP].keywords[0]);
778 /* for SCI_SETKEYWORDS = 1, see below*/
779 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_CPP].keywords[2]);
781 /* assign global types, merge them with user defined keywords and set them */
782 assign_global_and_user_keywords(sci, style_sets[GEANY_FILETYPES_CPP].keywords[1],
783 filetypes[ft_id]->lang);
785 styleset_c_like(sci, GEANY_FILETYPES_CPP);
787 if (style_sets[GEANY_FILETYPES_CPP].styling[20].foreground == 1)
788 SSM(sci, SCI_SETPROPERTY, (sptr_t) "styling.within.preprocessor", (sptr_t) "1");
789 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.symbol.$(file.patterns.cpp)", (sptr_t) "#");
790 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.start.$(file.patterns.cpp)", (sptr_t) "if ifdef ifndef");
791 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.middle.$(file.patterns.cpp)", (sptr_t) "else elif");
792 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.end.$(file.patterns.cpp)", (sptr_t) "endif");
796 static void styleset_glsl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
798 new_style_array(GEANY_FILETYPES_GLSL, 21);
799 styleset_c_like_init(config, config_home, GEANY_FILETYPES_GLSL);
800 get_keyfile_int(config, config_home, "styling", "styling_within_preprocessor",
801 1, 0, &style_sets[GEANY_FILETYPES_GLSL].styling[20]);
803 style_sets[GEANY_FILETYPES_GLSL].keywords = g_new(gchar*, 4);
804 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_GLSL, 0,
805 "if else switch case default for while do discard return break"
806 "continue true false struct void bool int uint float vec2 vec3"
807 "vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 uvec2 uvec3 uvec4 mat2"
808 "mat3 mat4 mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3"
809 "mat4x4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow"
810 "sampler2DShadow sampler1DArray sampler2DArray sampler1DArrayShadow"
811 "sampler2DArrayShadow isampler1D isampler2D isampler3D isamplerCube"
812 "isampler1DArray isampler2DArray usampler1D usampler2D usampler3D"
813 "usamplerCube usampler1DArray usampler2DArray const invariant"
814 "centroid in out inout attribute uniform varying smooth flat"
815 "noperspective highp mediump lowp");
816 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_GLSL, 1, "");
817 get_keyfile_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_GLSL, 2, "TODO FIXME");
818 style_sets[GEANY_FILETYPES_GLSL].keywords[3] = NULL;
820 get_keyfile_wordchars(config, config_home,
821 &style_sets[GEANY_FILETYPES_GLSL].wordchars);
825 static void styleset_glsl(ScintillaObject *sci)
827 const filetype_id ft_id = GEANY_FILETYPES_GLSL;
829 styleset_common(sci, 5, ft_id);
831 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
833 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_GLSL].keywords[0]);
834 /* for SCI_SETKEYWORDS = 1, see below*/
835 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_GLSL].keywords[2]);
837 /* assign global types, merge them with user defined keywords and set them */
838 assign_global_and_user_keywords(sci, style_sets[GEANY_FILETYPES_GLSL].keywords[1],
839 filetypes[ft_id]->lang);
841 styleset_c_like(sci, GEANY_FILETYPES_GLSL);
843 if (style_sets[GEANY_FILETYPES_GLSL].styling[20].foreground == 1)
844 SSM(sci, SCI_SETPROPERTY, (sptr_t) "styling.within.preprocessor", (sptr_t) "1");
845 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.symbol.$(file.patterns.cpp)", (sptr_t) "#");
846 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.start.$(file.patterns.cpp)", (sptr_t) "if ifdef ifndef");
847 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.middle.$(file.patterns.cpp)", (sptr_t) "else elif");
848 SSM(sci, SCI_SETPROPERTY, (sptr_t) "preprocessor.end.$(file.patterns.cpp)", (sptr_t) "endif");
851 static void styleset_cs_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
853 new_style_array(GEANY_FILETYPES_CS, 21);
854 styleset_c_like_init(config, config_home, GEANY_FILETYPES_CS);
855 get_keyfile_int(config, config_home, "styling", "styling_within_preprocessor",
856 1, 0, &style_sets[GEANY_FILETYPES_CS].styling[20]);
858 style_sets[GEANY_FILETYPES_CS].keywords = g_new(gchar*, 4);
859 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_CS, 0, "\
860 abstract as base bool break byte case catch char checked class \
861 const continue decimal default delegate do double else enum \
862 event explicit extern false finally fixed float for foreach goto if \
863 implicit in int interface internal is lock long namespace new null \
864 object operator out override params private protected public \
865 readonly ref return sbyte sealed short sizeof stackalloc static \
866 string struct switch this throw true try typeof uint ulong \
867 unchecked unsafe ushort using virtual void volatile while");
868 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_CS, 1, "");
869 get_keyfile_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_CS, 2, "");
870 style_sets[GEANY_FILETYPES_CS].keywords[3] = NULL;
872 get_keyfile_wordchars(config, config_home,
873 &style_sets[GEANY_FILETYPES_CS].wordchars);
877 static void styleset_cs(ScintillaObject *sci)
879 const filetype_id ft_id = GEANY_FILETYPES_CS;
881 styleset_common(sci, 5, ft_id);
883 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
885 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[ft_id].keywords[0]);
886 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[ft_id].keywords[2]);
888 /* assign global types, merge them with user defined keywords and set them */
889 assign_global_and_user_keywords(sci, style_sets[ft_id].keywords[1], filetypes[ft_id]->lang);
891 styleset_c_like(sci, ft_id);
893 if (style_sets[ft_id].styling[20].foreground == 1)
894 SSM(sci, ft_id, (sptr_t) "styling.within.preprocessor", (sptr_t) "1");
898 static void styleset_pascal_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
900 new_style_array(GEANY_FILETYPES_PASCAL, 12);
901 get_keyfile_hex(config, config_home, "styling", "default", "0x0000ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[0]);
902 get_keyfile_style(config, config_home, "comment", &gsd_comment, &style_sets[GEANY_FILETYPES_PASCAL].styling[1]);
903 get_keyfile_hex(config, config_home, "styling", "number", "0x007F00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[2]);
904 get_keyfile_hex(config, config_home, "styling", "word", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_PASCAL].styling[3]);
905 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[4]);
906 get_keyfile_hex(config, config_home, "styling", "character", "0x404000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[5]);
907 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[6]);
908 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[7]);
909 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[8]);
910 get_keyfile_hex(config, config_home, "styling", "regex", "0x1b6313", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PASCAL].styling[9]);
911 get_keyfile_style(config, config_home, "commentline", &gsd_comment, &style_sets[GEANY_FILETYPES_PASCAL].styling[10]);
912 get_keyfile_style(config, config_home, "commentdoc", &gsd_comment_doc, &style_sets[GEANY_FILETYPES_PASCAL].styling[11]);
914 style_sets[GEANY_FILETYPES_PASCAL].keywords = g_new(gchar*, 2);
915 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_PASCAL, 0, "word integer char string byte real \
916 for to do until repeat program if uses then else case var begin end \
917 asm unit interface implementation procedure function object try class");
918 style_sets[GEANY_FILETYPES_PASCAL].keywords[1] = NULL;
920 get_keyfile_wordchars(config, config_home,
921 &style_sets[GEANY_FILETYPES_PASCAL].wordchars);
925 static void styleset_pascal(ScintillaObject *sci)
927 const filetype_id ft_id = GEANY_FILETYPES_PASCAL;
929 styleset_common(sci, 5, ft_id);
931 apply_filetype_properties(sci, SCLEX_PASCAL, ft_id);
933 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_PASCAL].keywords[0]);
935 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PASCAL, 0);
936 set_sci_style(sci, SCE_C_DEFAULT, GEANY_FILETYPES_PASCAL, 0);
937 set_sci_style(sci, SCE_C_COMMENT, GEANY_FILETYPES_PASCAL, 1);
938 set_sci_style(sci, SCE_C_NUMBER, GEANY_FILETYPES_PASCAL, 2);
939 set_sci_style(sci, SCE_C_WORD, GEANY_FILETYPES_PASCAL, 3);
940 set_sci_style(sci, SCE_C_STRING, GEANY_FILETYPES_PASCAL, 4);
941 set_sci_style(sci, SCE_C_CHARACTER, GEANY_FILETYPES_PASCAL, 5);
942 set_sci_style(sci, SCE_C_PREPROCESSOR, GEANY_FILETYPES_PASCAL, 6);
943 set_sci_style(sci, SCE_C_OPERATOR, GEANY_FILETYPES_PASCAL, 7);
944 set_sci_style(sci, SCE_C_IDENTIFIER, GEANY_FILETYPES_PASCAL, 8);
945 set_sci_style(sci, SCE_C_REGEX, GEANY_FILETYPES_PASCAL, 9);
946 set_sci_style(sci, SCE_C_COMMENTLINE, GEANY_FILETYPES_PASCAL, 10);
947 set_sci_style(sci, SCE_C_COMMENTDOC, GEANY_FILETYPES_PASCAL, 11);
951 static void styleset_makefile_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
953 new_style_array(GEANY_FILETYPES_MAKE, 7);
954 get_keyfile_hex(config, config_home, "styling", "default", "0x00002f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_MAKE].styling[0]);
955 get_keyfile_style(config, config_home, "comment", &gsd_comment, &style_sets[GEANY_FILETYPES_MAKE].styling[1]);
956 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_MAKE].styling[2]);
957 get_keyfile_hex(config, config_home, "styling", "identifier", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_MAKE].styling[3]);
958 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_MAKE].styling[4]);
959 get_keyfile_hex(config, config_home, "styling", "target", "0x0000ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_MAKE].styling[5]);
960 get_keyfile_hex(config, config_home, "styling", "ideol", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_MAKE].styling[6]);
962 style_sets[GEANY_FILETYPES_MAKE].keywords = NULL;
964 get_keyfile_wordchars(config, config_home,
965 &style_sets[GEANY_FILETYPES_MAKE].wordchars);
969 static void styleset_makefile(ScintillaObject *sci)
971 const filetype_id ft_id = GEANY_FILETYPES_MAKE;
973 styleset_common(sci, 5, ft_id);
975 apply_filetype_properties(sci, SCLEX_MAKEFILE, ft_id);
977 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_MAKE, 0);
978 set_sci_style(sci, SCE_MAKE_DEFAULT, GEANY_FILETYPES_MAKE, 0);
979 set_sci_style(sci, SCE_MAKE_COMMENT, GEANY_FILETYPES_MAKE, 1);
980 set_sci_style(sci, SCE_MAKE_PREPROCESSOR, GEANY_FILETYPES_MAKE, 2);
981 set_sci_style(sci, SCE_MAKE_IDENTIFIER, GEANY_FILETYPES_MAKE, 3);
982 set_sci_style(sci, SCE_MAKE_OPERATOR, GEANY_FILETYPES_MAKE, 4);
983 set_sci_style(sci, SCE_MAKE_TARGET, GEANY_FILETYPES_MAKE, 5);
984 set_sci_style(sci, SCE_MAKE_IDEOL, GEANY_FILETYPES_MAKE, 6);
988 static void styleset_diff_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
990 new_style_array(GEANY_FILETYPES_DIFF, 7);
991 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[0]);
992 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[1]);
993 get_keyfile_hex(config, config_home, "styling", "command", "0x7f7f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[2]);
994 get_keyfile_hex(config, config_home, "styling", "header", "0x7f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[3]);
995 get_keyfile_hex(config, config_home, "styling", "position", "0x00007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[4]);
996 get_keyfile_hex(config, config_home, "styling", "deleted", "0xff2727", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[5]);
997 get_keyfile_hex(config, config_home, "styling", "added", "0x34b034", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DIFF].styling[6]);
999 style_sets[GEANY_FILETYPES_DIFF].keywords = NULL;
1001 get_keyfile_wordchars(config, config_home,
1002 &style_sets[GEANY_FILETYPES_DIFF].wordchars);
1006 static void styleset_diff(ScintillaObject *sci)
1008 const filetype_id ft_id = GEANY_FILETYPES_DIFF;
1010 styleset_common(sci, 5, ft_id);
1012 apply_filetype_properties(sci, SCLEX_DIFF, ft_id);
1014 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_DIFF, 0);
1015 set_sci_style(sci, SCE_DIFF_DEFAULT, GEANY_FILETYPES_DIFF, 0);
1016 set_sci_style(sci, SCE_DIFF_COMMENT, GEANY_FILETYPES_DIFF, 1);
1017 set_sci_style(sci, SCE_DIFF_COMMAND, GEANY_FILETYPES_DIFF, 2);
1018 set_sci_style(sci, SCE_DIFF_HEADER, GEANY_FILETYPES_DIFF, 3);
1019 set_sci_style(sci, SCE_DIFF_POSITION, GEANY_FILETYPES_DIFF, 4);
1020 set_sci_style(sci, SCE_DIFF_DELETED, GEANY_FILETYPES_DIFF, 5);
1021 set_sci_style(sci, SCE_DIFF_ADDED, GEANY_FILETYPES_DIFF, 6);
1025 static void styleset_latex_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1027 new_style_array(GEANY_FILETYPES_LATEX, 5);
1028 get_keyfile_hex(config, config_home, "styling", "default", "0x00002f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LATEX].styling[0]);
1029 get_keyfile_hex(config, config_home, "styling", "command", "0xff0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_LATEX].styling[1]);
1030 get_keyfile_hex(config, config_home, "styling", "tag", "0x007f7f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_LATEX].styling[2]);
1031 get_keyfile_hex(config, config_home, "styling", "math", "0x00007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LATEX].styling[3]);
1032 get_keyfile_hex(config, config_home, "styling", "comment", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LATEX].styling[4]);
1034 style_sets[GEANY_FILETYPES_LATEX].keywords = g_new(gchar*, 2);
1035 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_LATEX, 0, "section subsection begin item");
1036 style_sets[GEANY_FILETYPES_LATEX].keywords[1] = NULL;
1038 get_keyfile_wordchars(config, config_home,
1039 &style_sets[GEANY_FILETYPES_LATEX].wordchars);
1043 static void styleset_latex(ScintillaObject *sci)
1045 const filetype_id ft_id = GEANY_FILETYPES_LATEX;
1047 styleset_common(sci, 5, ft_id);
1049 apply_filetype_properties(sci, SCLEX_LATEX, ft_id);
1051 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_LATEX].keywords[0]);
1053 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_LATEX, 0);
1054 set_sci_style(sci, SCE_L_DEFAULT, GEANY_FILETYPES_LATEX, 0);
1055 set_sci_style(sci, SCE_L_COMMAND, GEANY_FILETYPES_LATEX, 1);
1056 set_sci_style(sci, SCE_L_TAG, GEANY_FILETYPES_LATEX, 2);
1057 set_sci_style(sci, SCE_L_MATH, GEANY_FILETYPES_LATEX, 3);
1058 set_sci_style(sci, SCE_L_COMMENT, GEANY_FILETYPES_LATEX, 4);
1062 static void styleset_php_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1064 style_sets[GEANY_FILETYPES_PHP].styling = NULL;
1065 style_sets[GEANY_FILETYPES_PHP].keywords = NULL;
1067 get_keyfile_wordchars(config, config_home,
1068 &style_sets[GEANY_FILETYPES_PHP].wordchars);
1072 static void styleset_php(ScintillaObject *sci)
1074 const filetype_id ft_id = GEANY_FILETYPES_PHP;
1076 styleset_common(sci, 7, ft_id);
1078 apply_filetype_properties(sci, SCLEX_HTML, ft_id);
1080 SSM(sci, SCI_SETPROPERTY, (sptr_t) "phpscript.mode", (sptr_t) "1");
1082 /* use the same colouring as for XML */
1083 styleset_markup(sci, TRUE);
1087 static void styleset_html_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1089 style_sets[GEANY_FILETYPES_HTML].styling = NULL;
1090 style_sets[GEANY_FILETYPES_HTML].keywords = NULL;
1092 get_keyfile_wordchars(config, config_home,
1093 &style_sets[GEANY_FILETYPES_HTML].wordchars);
1097 static void styleset_html(ScintillaObject *sci)
1099 const filetype_id ft_id = GEANY_FILETYPES_HTML;
1101 styleset_common(sci, 7, ft_id);
1103 apply_filetype_properties(sci, SCLEX_HTML, ft_id);
1105 /* use the same colouring for HTML; XML and so on */
1106 styleset_markup(sci, TRUE);
1110 static void styleset_markup_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1112 new_style_array(GEANY_FILETYPES_XML, 55);
1113 get_keyfile_hex(config, config_home, "styling", "html_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[0]);
1114 get_keyfile_hex(config, config_home, "styling", "html_tag", "0x000099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[1]);
1115 get_keyfile_hex(config, config_home, "styling", "html_tagunknown", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[2]);
1116 get_keyfile_hex(config, config_home, "styling", "html_attribute", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[3]);
1117 get_keyfile_hex(config, config_home, "styling", "html_attributeunknown", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[4]);
1118 get_keyfile_hex(config, config_home, "styling", "html_number", "0x800080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[5]);
1119 get_keyfile_hex(config, config_home, "styling", "html_doublestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[6]);
1120 get_keyfile_hex(config, config_home, "styling", "html_singlestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[7]);
1121 get_keyfile_hex(config, config_home, "styling", "html_other", "0x800080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[8]);
1122 get_keyfile_hex(config, config_home, "styling", "html_comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[9]);
1123 get_keyfile_hex(config, config_home, "styling", "html_entity", "0x800080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[10]);
1124 get_keyfile_hex(config, config_home, "styling", "html_tagend", "0x000080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[11]);
1125 get_keyfile_hex(config, config_home, "styling", "html_xmlstart", "0x000099", "0xf0f0f0", "false", &style_sets[GEANY_FILETYPES_XML].styling[12]);
1126 get_keyfile_hex(config, config_home, "styling", "html_xmlend", "0x000099", "0xf0f0f0", "false", &style_sets[GEANY_FILETYPES_XML].styling[13]);
1127 get_keyfile_hex(config, config_home, "styling", "html_script", "0x000080", "0xf0f0f0", "false", &style_sets[GEANY_FILETYPES_XML].styling[14]);
1128 get_keyfile_hex(config, config_home, "styling", "html_asp", "0x004f4f", "0xf0f0f0", "false", &style_sets[GEANY_FILETYPES_XML].styling[15]);
1129 get_keyfile_hex(config, config_home, "styling", "html_aspat", "0x004f4f", "0xf0f0f0", "false", &style_sets[GEANY_FILETYPES_XML].styling[16]);
1130 get_keyfile_hex(config, config_home, "styling", "html_cdata", "0x660099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[17]);
1131 get_keyfile_hex(config, config_home, "styling", "html_question", "0x0000ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[18]);
1132 get_keyfile_hex(config, config_home, "styling", "html_value", "0x660099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[19]);
1133 get_keyfile_hex(config, config_home, "styling", "html_xccomment", "0x660099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[20]);
1135 get_keyfile_hex(config, config_home, "styling", "sgml_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[21]);
1136 get_keyfile_hex(config, config_home, "styling", "sgml_comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[22]);
1137 get_keyfile_hex(config, config_home, "styling", "sgml_special", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[23]);
1138 get_keyfile_hex(config, config_home, "styling", "sgml_command", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_XML].styling[24]);
1139 get_keyfile_hex(config, config_home, "styling", "sgml_doublestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[25]);
1140 get_keyfile_hex(config, config_home, "styling", "sgml_simplestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[26]);
1141 get_keyfile_hex(config, config_home, "styling", "sgml_1st_param", "0x404080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[27]);
1142 get_keyfile_hex(config, config_home, "styling", "sgml_entity", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[28]);
1143 get_keyfile_hex(config, config_home, "styling", "sgml_block_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[29]);
1144 get_keyfile_hex(config, config_home, "styling", "sgml_1st_param_comment", "0x406090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[30]);
1145 get_keyfile_hex(config, config_home, "styling", "sgml_error", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[31]);
1147 get_keyfile_hex(config, config_home, "styling", "php_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[32]);
1148 get_keyfile_hex(config, config_home, "styling", "php_simplestring", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[33]);
1149 get_keyfile_hex(config, config_home, "styling", "php_hstring", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[34]);
1150 get_keyfile_hex(config, config_home, "styling", "php_number", "0x606000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[35]);
1151 get_keyfile_hex(config, config_home, "styling", "php_word", "0x000099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[36]);
1152 get_keyfile_hex(config, config_home, "styling", "php_variable", "0x7f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[37]);
1153 get_keyfile_hex(config, config_home, "styling", "php_comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[38]);
1154 get_keyfile_hex(config, config_home, "styling", "php_commentline", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[39]);
1155 get_keyfile_hex(config, config_home, "styling", "php_operator", "0x102060", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[40]);
1156 get_keyfile_hex(config, config_home, "styling", "php_hstring_variable", "0x101060", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[41]);
1157 get_keyfile_hex(config, config_home, "styling", "php_complex_variable", "0x105010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[42]);
1159 get_keyfile_hex(config, config_home, "styling", "jscript_start", "0x008080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[43]);
1160 get_keyfile_hex(config, config_home, "styling", "jscript_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[44]);
1161 get_keyfile_hex(config, config_home, "styling", "jscript_comment", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[45]);
1162 get_keyfile_hex(config, config_home, "styling", "jscript_commentline", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[46]);
1163 get_keyfile_hex(config, config_home, "styling", "jscript_commentdoc", "0x3f5fbf", "0xffffff", "true", &style_sets[GEANY_FILETYPES_XML].styling[47]);
1164 get_keyfile_hex(config, config_home, "styling", "jscript_number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[48]);
1165 get_keyfile_hex(config, config_home, "styling", "jscript_word", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[49]);
1166 get_keyfile_hex(config, config_home, "styling", "jscript_keyword", "0x00007f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_XML].styling[50]);
1167 get_keyfile_hex(config, config_home, "styling", "jscript_doublestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[51]);
1168 get_keyfile_hex(config, config_home, "styling", "jscript_singlestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[52]);
1169 get_keyfile_hex(config, config_home, "styling", "jscript_symbols", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_XML].styling[53]);
1170 get_keyfile_hex(config, config_home, "styling", "jscript_stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_XML].styling[54]);
1172 style_sets[GEANY_FILETYPES_XML].keywords = g_new(gchar*, 7);
1173 get_keyfile_keywords(config, config_home, "keywords", "html", GEANY_FILETYPES_XML, 0, "a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dfn dir div dl dt em embed fieldset font form frame frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map menu meta noframes noscript object ol optgroup option p param pre q quality s samp script select small span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var xmlns leftmargin topmargin abbr accept-charset accept accesskey action align alink alt archive axis background bgcolor border cellpadding cellspacing char charoff charset checked cite class classid clear codebase codetype color cols colspan compact content coords data datafld dataformatas datapagesize datasrc datetime declare defer dir disabled enctype face for frame frameborder selected headers height href hreflang hspace http-equiv id ismap label lang language link longdesc marginwidth marginheight maxlength media framespacing method multiple name nohref noresize noshade nowrap object onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseover onmouseout onmouseup onreset onselect onsubmit onunload profile prompt pluginspage readonly rel rev rows rowspan rules scheme scope scrolling shape size span src standby start style summary tabindex target text title type usemap valign value valuetype version vlink vspace width text password checkbox radio submit reset file hidden image public doctype xml");
1174 get_keyfile_keywords(config, config_home, "keywords", "javascript", GEANY_FILETYPES_XML, 1, "abs abstract acos anchor asin atan atan2 big bold boolean break byte case catch ceil char charAt charCodeAt class concat const continue cos Date debugger default delete do double else enum escape eval exp export extends false final finally fixed float floor fontcolor fontsize for fromCharCode function goto if implements import in indexOf Infinity instanceof int interface isFinite isNaN italics join lastIndexOf length link log long Math max MAX_VALUE min MIN_VALUE NaN native NEGATIVE_INFINITY new null Number package parseFloat parseInt pop POSITIVE_INFINITY pow private protected public push random return reverse round shift short sin slice small sort splice split sqrt static strike string String sub substr substring sup super switch synchronized tan this throw throws toLowerCase toString toUpperCase transient true try typeof undefined unescape unshift valueOf var void volatile while with");
1175 get_keyfile_keywords(config, config_home, "keywords", "vbscript", GEANY_FILETYPES_XML, 2, "and as byref byval case call const continue dim do each else elseif end error exit false for function global goto if in loop me new next not nothing on optional or private public redim rem resume select set sub then to true type while with boolean byte currency date double integer long object single string type variant");
1176 get_keyfile_keywords(config, config_home, "keywords", "python", GEANY_FILETYPES_XML, 3, "and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield False None True");
1177 get_keyfile_keywords(config, config_home, "keywords", "php", GEANY_FILETYPES_XML, 4, "abstract and array as bool boolean break case catch cfunction __class__ class clone const continue declare default die __dir__ directory do double echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exception exit extends false __file__ final float for foreach __function__ function goto global if implements include include_once int integer interface isset __line__ list __method__ namespace __namespace__ new null object old_function or parent php_user_filter print private protected public real require require_once resource return __sleep static stdclass string switch this throw true try unset use var __wakeup while xor");
1178 get_keyfile_keywords(config, config_home, "keywords", "sgml", GEANY_FILETYPES_XML, 5, "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION");
1179 style_sets[GEANY_FILETYPES_XML].keywords[6] = NULL;
1181 get_keyfile_wordchars(config, config_home,
1182 &style_sets[GEANY_FILETYPES_XML].wordchars);
1186 static void styleset_markup(ScintillaObject *sci, gboolean set_keywords)
1188 /* Used by several filetypes */
1189 if (style_sets[GEANY_FILETYPES_XML].styling == NULL)
1190 filetypes_load_config(GEANY_FILETYPES_XML, FALSE);
1192 /* manually initialise filetype Python for use with embedded Python */
1193 filetypes_load_config(GEANY_FILETYPES_PYTHON, FALSE);
1195 /* don't set keywords for plain XML */
1196 if (set_keywords)
1198 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_XML].keywords[0]);
1199 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_XML].keywords[1]);
1200 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_XML].keywords[2]);
1201 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_XML].keywords[3]);
1202 SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) style_sets[GEANY_FILETYPES_XML].keywords[4]);
1204 SSM(sci, SCI_SETKEYWORDS, 5, (sptr_t) style_sets[GEANY_FILETYPES_XML].keywords[5]);
1206 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_XML, 0);
1207 set_sci_style(sci, SCE_H_DEFAULT, GEANY_FILETYPES_XML, 0);
1208 set_sci_style(sci, SCE_H_TAG, GEANY_FILETYPES_XML, 1);
1209 set_sci_style(sci, SCE_H_TAGUNKNOWN, GEANY_FILETYPES_XML, 2);
1210 set_sci_style(sci, SCE_H_ATTRIBUTE, GEANY_FILETYPES_XML, 3);
1211 set_sci_style(sci, SCE_H_ATTRIBUTEUNKNOWN, GEANY_FILETYPES_XML, 4);
1212 set_sci_style(sci, SCE_H_NUMBER, GEANY_FILETYPES_XML, 5);
1213 set_sci_style(sci, SCE_H_DOUBLESTRING, GEANY_FILETYPES_XML, 6);
1214 set_sci_style(sci, SCE_H_SINGLESTRING, GEANY_FILETYPES_XML, 7);
1215 set_sci_style(sci, SCE_H_OTHER, GEANY_FILETYPES_XML, 8);
1216 set_sci_style(sci, SCE_H_COMMENT, GEANY_FILETYPES_XML, 9);
1217 set_sci_style(sci, SCE_H_ENTITY, GEANY_FILETYPES_XML, 10);
1218 set_sci_style(sci, SCE_H_TAGEND, GEANY_FILETYPES_XML, 11);
1219 SSM(sci, SCI_STYLESETEOLFILLED, SCE_H_XMLSTART, 1);
1220 set_sci_style(sci, SCE_H_XMLSTART, GEANY_FILETYPES_XML, 12);
1221 set_sci_style(sci, SCE_H_XMLEND, GEANY_FILETYPES_XML, 13);
1222 set_sci_style(sci, SCE_H_SCRIPT, GEANY_FILETYPES_XML, 14);
1223 SSM(sci, SCI_STYLESETEOLFILLED, SCE_H_ASP, 1);
1224 set_sci_style(sci, SCE_H_ASP, GEANY_FILETYPES_XML, 15);
1225 SSM(sci, SCI_STYLESETEOLFILLED, SCE_H_ASPAT, 1);
1226 set_sci_style(sci, SCE_H_ASPAT, GEANY_FILETYPES_XML, 16);
1227 set_sci_style(sci, SCE_H_CDATA, GEANY_FILETYPES_XML, 17);
1228 set_sci_style(sci, SCE_H_QUESTION, GEANY_FILETYPES_XML, 18);
1229 set_sci_style(sci, SCE_H_VALUE, GEANY_FILETYPES_XML, 19);
1230 set_sci_style(sci, SCE_H_XCCOMMENT, GEANY_FILETYPES_XML, 20);
1232 set_sci_style(sci, SCE_H_SGML_DEFAULT, GEANY_FILETYPES_XML, 21);
1233 set_sci_style(sci, SCE_H_SGML_COMMENT, GEANY_FILETYPES_XML, 22);
1234 set_sci_style(sci, SCE_H_SGML_SPECIAL, GEANY_FILETYPES_XML, 23);
1235 set_sci_style(sci, SCE_H_SGML_COMMAND, GEANY_FILETYPES_XML, 24);
1236 set_sci_style(sci, SCE_H_SGML_DOUBLESTRING, GEANY_FILETYPES_XML, 25);
1237 set_sci_style(sci, SCE_H_SGML_SIMPLESTRING, GEANY_FILETYPES_XML, 26);
1238 set_sci_style(sci, SCE_H_SGML_1ST_PARAM, GEANY_FILETYPES_XML, 27);
1239 set_sci_style(sci, SCE_H_SGML_ENTITY, GEANY_FILETYPES_XML, 28);
1240 set_sci_style(sci, SCE_H_SGML_BLOCK_DEFAULT, GEANY_FILETYPES_XML, 29);
1241 set_sci_style(sci, SCE_H_SGML_1ST_PARAM_COMMENT, GEANY_FILETYPES_XML, 30);
1242 set_sci_style(sci, SCE_H_SGML_ERROR, GEANY_FILETYPES_XML, 31);
1244 /* embedded JavaScript */
1245 set_sci_style(sci, SCE_HJ_START, GEANY_FILETYPES_XML, 43);
1246 set_sci_style(sci, SCE_HJ_DEFAULT, GEANY_FILETYPES_XML, 44);
1247 set_sci_style(sci, SCE_HJ_COMMENT, GEANY_FILETYPES_XML, 45);
1248 set_sci_style(sci, SCE_HJ_COMMENTLINE, GEANY_FILETYPES_XML, 46);
1249 set_sci_style(sci, SCE_HJ_COMMENTDOC, GEANY_FILETYPES_XML, 47);
1250 set_sci_style(sci, SCE_HJ_NUMBER, GEANY_FILETYPES_XML, 48);
1251 set_sci_style(sci, SCE_HJ_WORD, GEANY_FILETYPES_XML, 49);
1252 set_sci_style(sci, SCE_HJ_KEYWORD, GEANY_FILETYPES_XML, 50);
1253 set_sci_style(sci, SCE_HJ_DOUBLESTRING, GEANY_FILETYPES_XML, 51);
1254 set_sci_style(sci, SCE_HJ_SINGLESTRING, GEANY_FILETYPES_XML, 52);
1255 set_sci_style(sci, SCE_HJ_SYMBOLS, GEANY_FILETYPES_XML, 53);
1256 set_sci_style(sci, SCE_HJ_STRINGEOL, GEANY_FILETYPES_XML, 54);
1258 /* for HB, VBScript?, use the same styles as for JavaScript */
1259 set_sci_style(sci, SCE_HB_START, GEANY_FILETYPES_XML, 43);
1260 set_sci_style(sci, SCE_HB_DEFAULT, GEANY_FILETYPES_XML, 44);
1261 set_sci_style(sci, SCE_HB_COMMENTLINE, GEANY_FILETYPES_XML, 46);
1262 set_sci_style(sci, SCE_HB_NUMBER, GEANY_FILETYPES_XML, 48);
1263 set_sci_style(sci, SCE_HB_WORD, GEANY_FILETYPES_XML, 49);
1264 set_sci_style(sci, SCE_HB_STRING, GEANY_FILETYPES_XML, 51);
1265 set_sci_style(sci, SCE_HB_IDENTIFIER, GEANY_FILETYPES_XML, 53);
1266 set_sci_style(sci, SCE_HB_STRINGEOL, GEANY_FILETYPES_XML, 54);
1268 /* for HBA, VBScript?, use the same styles as for JavaScript */
1269 set_sci_style(sci, SCE_HBA_START, GEANY_FILETYPES_XML, 43);
1270 set_sci_style(sci, SCE_HBA_DEFAULT, GEANY_FILETYPES_XML, 44);
1271 set_sci_style(sci, SCE_HBA_COMMENTLINE, GEANY_FILETYPES_XML, 46);
1272 set_sci_style(sci, SCE_HBA_NUMBER, GEANY_FILETYPES_XML, 48);
1273 set_sci_style(sci, SCE_HBA_WORD, GEANY_FILETYPES_XML, 49);
1274 set_sci_style(sci, SCE_HBA_STRING, GEANY_FILETYPES_XML, 51);
1275 set_sci_style(sci, SCE_HBA_IDENTIFIER, GEANY_FILETYPES_XML, 53);
1276 set_sci_style(sci, SCE_HBA_STRINGEOL, GEANY_FILETYPES_XML, 54);
1278 /* for HJA, ASP Javascript, use the same styles as for JavaScript */
1279 set_sci_style(sci, SCE_HJA_START, GEANY_FILETYPES_XML, 43);
1280 set_sci_style(sci, SCE_HJA_DEFAULT, GEANY_FILETYPES_XML, 44);
1281 set_sci_style(sci, SCE_HJA_COMMENT, GEANY_FILETYPES_XML, 45);
1282 set_sci_style(sci, SCE_HJA_COMMENTLINE, GEANY_FILETYPES_XML, 46);
1283 set_sci_style(sci, SCE_HJA_COMMENTDOC, GEANY_FILETYPES_XML, 47);
1284 set_sci_style(sci, SCE_HJA_NUMBER, GEANY_FILETYPES_XML, 48);
1285 set_sci_style(sci, SCE_HJA_WORD, GEANY_FILETYPES_XML, 49);
1286 set_sci_style(sci, SCE_HJA_KEYWORD, GEANY_FILETYPES_XML, 50);
1287 set_sci_style(sci, SCE_HJA_DOUBLESTRING, GEANY_FILETYPES_XML, 51);
1288 set_sci_style(sci, SCE_HJA_SINGLESTRING, GEANY_FILETYPES_XML, 52);
1289 set_sci_style(sci, SCE_HJA_SYMBOLS, GEANY_FILETYPES_XML, 53);
1290 set_sci_style(sci, SCE_HJA_STRINGEOL, GEANY_FILETYPES_XML, 54);
1292 /* for embedded Python we use the Python styles */
1293 set_sci_style(sci, SCE_HP_START, GEANY_FILETYPES_XML, 43);
1294 set_sci_style(sci, SCE_HP_DEFAULT, GEANY_FILETYPES_PYTHON, 0);
1295 set_sci_style(sci, SCE_HP_COMMENTLINE, GEANY_FILETYPES_PYTHON, 1);
1296 set_sci_style(sci, SCE_HP_NUMBER, GEANY_FILETYPES_PYTHON, 2);
1297 set_sci_style(sci, SCE_HP_STRING, GEANY_FILETYPES_PYTHON, 3);
1298 set_sci_style(sci, SCE_HP_CHARACTER, GEANY_FILETYPES_PYTHON, 4);
1299 set_sci_style(sci, SCE_HP_WORD, GEANY_FILETYPES_PYTHON, 5);
1300 set_sci_style(sci, SCE_HP_TRIPLE, GEANY_FILETYPES_PYTHON, 6);
1301 set_sci_style(sci, SCE_HP_TRIPLEDOUBLE, GEANY_FILETYPES_PYTHON, 7);
1302 set_sci_style(sci, SCE_HP_CLASSNAME, GEANY_FILETYPES_PYTHON, 8);
1303 set_sci_style(sci, SCE_HP_DEFNAME, GEANY_FILETYPES_PYTHON, 9);
1304 set_sci_style(sci, SCE_HP_OPERATOR, GEANY_FILETYPES_PYTHON, 10);
1305 set_sci_style(sci, SCE_HP_IDENTIFIER, GEANY_FILETYPES_PYTHON, 11);
1307 /* for embedded HPA (what is this?) we use the Python styles */
1308 set_sci_style(sci, SCE_HPA_START, GEANY_FILETYPES_XML, 43);
1309 set_sci_style(sci, SCE_HPA_DEFAULT, GEANY_FILETYPES_PYTHON, 0);
1310 set_sci_style(sci, SCE_HPA_COMMENTLINE, GEANY_FILETYPES_PYTHON, 1);
1311 set_sci_style(sci, SCE_HPA_NUMBER, GEANY_FILETYPES_PYTHON, 2);
1312 set_sci_style(sci, SCE_HPA_STRING, GEANY_FILETYPES_PYTHON, 3);
1313 set_sci_style(sci, SCE_HPA_CHARACTER, GEANY_FILETYPES_PYTHON, 4);
1314 set_sci_style(sci, SCE_HPA_WORD, GEANY_FILETYPES_PYTHON, 5);
1315 set_sci_style(sci, SCE_HPA_TRIPLE, GEANY_FILETYPES_PYTHON, 6);
1316 set_sci_style(sci, SCE_HPA_TRIPLEDOUBLE, GEANY_FILETYPES_PYTHON, 7);
1317 set_sci_style(sci, SCE_HPA_CLASSNAME, GEANY_FILETYPES_PYTHON, 8);
1318 set_sci_style(sci, SCE_HPA_DEFNAME, GEANY_FILETYPES_PYTHON, 9);
1319 set_sci_style(sci, SCE_HPA_OPERATOR, GEANY_FILETYPES_PYTHON, 10);
1320 set_sci_style(sci, SCE_HPA_IDENTIFIER, GEANY_FILETYPES_PYTHON, 11);
1322 /* PHP */
1323 set_sci_style(sci, SCE_HPHP_DEFAULT, GEANY_FILETYPES_XML, 32);
1324 set_sci_style(sci, SCE_HPHP_SIMPLESTRING, GEANY_FILETYPES_XML, 33);
1325 set_sci_style(sci, SCE_HPHP_HSTRING, GEANY_FILETYPES_XML, 34);
1326 set_sci_style(sci, SCE_HPHP_NUMBER, GEANY_FILETYPES_XML, 35);
1327 set_sci_style(sci, SCE_HPHP_WORD, GEANY_FILETYPES_XML, 36);
1328 set_sci_style(sci, SCE_HPHP_VARIABLE, GEANY_FILETYPES_XML, 37);
1329 set_sci_style(sci, SCE_HPHP_COMMENT, GEANY_FILETYPES_XML, 38);
1330 set_sci_style(sci, SCE_HPHP_COMMENTLINE, GEANY_FILETYPES_XML, 39);
1331 set_sci_style(sci, SCE_HPHP_OPERATOR, GEANY_FILETYPES_XML, 40);
1332 set_sci_style(sci, SCE_HPHP_HSTRING_VARIABLE, GEANY_FILETYPES_XML, 41);
1333 set_sci_style(sci, SCE_HPHP_COMPLEX_VARIABLE, GEANY_FILETYPES_XML, 42);
1335 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.html", (sptr_t) "1");
1336 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.html.preprocessor", (sptr_t) "1");
1340 static void styleset_java_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1342 new_style_array(GEANY_FILETYPES_JAVA, 20);
1343 styleset_c_like_init(config, config_home, GEANY_FILETYPES_JAVA);
1345 style_sets[GEANY_FILETYPES_JAVA].keywords = g_new(gchar*, 5);
1346 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_JAVA, 0, "\
1347 abstract assert break case catch class \
1348 const continue default do else extends final finally for future \
1349 generic goto if implements import inner instanceof interface \
1350 native new outer package private protected public rest \
1351 return static super switch synchronized this throw throws \
1352 transient try var volatile while true false null");
1353 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_JAVA, 1, "boolean byte char double float int long null short void");
1354 get_keyfile_keywords(config, config_home, "keywords", "doccomment", GEANY_FILETYPES_JAVA, 2, "return param author throws");
1355 get_keyfile_keywords(config, config_home, "keywords", "typedefs", GEANY_FILETYPES_JAVA, 3, "");
1356 style_sets[GEANY_FILETYPES_JAVA].keywords[4] = NULL;
1358 get_keyfile_wordchars(config, config_home,
1359 &style_sets[GEANY_FILETYPES_JAVA].wordchars);
1363 static void styleset_java(ScintillaObject *sci)
1365 const filetype_id ft_id = GEANY_FILETYPES_JAVA;
1367 styleset_common(sci, 5, ft_id);
1369 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
1371 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_JAVA].keywords[0]);
1372 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_JAVA].keywords[1]);
1373 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_JAVA].keywords[2]);
1374 SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) style_sets[GEANY_FILETYPES_JAVA].keywords[3]);
1376 styleset_c_like(sci, GEANY_FILETYPES_JAVA);
1380 static void styleset_perl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1382 new_style_array(GEANY_FILETYPES_PERL, 30);
1383 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[0]);
1384 get_keyfile_hex(config, config_home, "styling", "error", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[1]);
1385 get_keyfile_style(config, config_home, "commentline", &gsd_comment, &style_sets[GEANY_FILETYPES_PERL].styling[2]);
1386 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[3]);
1387 get_keyfile_hex(config, config_home, "styling", "word", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_PERL].styling[4]);
1388 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[5]);
1389 get_keyfile_hex(config, config_home, "styling", "character", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[6]);
1390 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[7]);
1391 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[8]);
1392 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[9]);
1393 get_keyfile_hex(config, config_home, "styling", "scalar", "0x7f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[10]);
1394 get_keyfile_hex(config, config_home, "styling", "pod", "0x035650", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[11]);
1395 get_keyfile_hex(config, config_home, "styling", "regex", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[12]);
1396 get_keyfile_hex(config, config_home, "styling", "array", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[13]);
1397 get_keyfile_hex(config, config_home, "styling", "hash", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[14]);
1398 get_keyfile_hex(config, config_home, "styling", "symboltable", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[15]);
1399 get_keyfile_hex(config, config_home, "styling", "backticks", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_PERL].styling[16]);
1400 get_keyfile_hex(config, config_home, "styling", "pod_verbatim", "0x004000", "0xc0ffc0", "false", &style_sets[GEANY_FILETYPES_PERL].styling[17]);
1401 get_keyfile_hex(config, config_home, "styling", "reg_subst", "0x000000", "0xf0e080", "false", &style_sets[GEANY_FILETYPES_PERL].styling[18]);
1402 get_keyfile_hex(config, config_home, "styling", "datasection", "0x600000", "0xfff0d8", "false", &style_sets[GEANY_FILETYPES_PERL].styling[19]);
1403 get_keyfile_hex(config, config_home, "styling", "here_delim", "0x000000", "0xddd0dd", "false", &style_sets[GEANY_FILETYPES_PERL].styling[20]);
1404 get_keyfile_hex(config, config_home, "styling", "here_q", "0x7f007f", "0xddd0dd", "false", &style_sets[GEANY_FILETYPES_PERL].styling[21]);
1405 get_keyfile_hex(config, config_home, "styling", "here_qq", "0x7f007f", "0xddd0dd", "true", &style_sets[GEANY_FILETYPES_PERL].styling[22]);
1406 get_keyfile_hex(config, config_home, "styling", "here_qx", "0x7f007f", "0xddd0dd", "true", &style_sets[GEANY_FILETYPES_PERL].styling[23]);
1407 get_keyfile_hex(config, config_home, "styling", "string_q", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[24]);
1408 get_keyfile_hex(config, config_home, "styling", "string_qq", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[25]);
1409 get_keyfile_hex(config, config_home, "styling", "string_qx", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_PERL].styling[26]);
1410 get_keyfile_hex(config, config_home, "styling", "string_qr", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[27]);
1411 get_keyfile_hex(config, config_home, "styling", "string_qw", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[28]);
1412 get_keyfile_hex(config, config_home, "styling", "variable_indexer", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PERL].styling[29]);
1414 style_sets[GEANY_FILETYPES_PERL].keywords = g_new(gchar*, 2);
1415 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_PERL, 0, "\
1416 NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD \
1417 BEGIN CORE DESTROY END EQ GE GT INIT LE LT NE CHECK abs accept \
1418 alarm and atan2 bind binmode bless caller chdir chmod chomp chop \
1419 chown chr chroot close closedir cmp connect continue cos crypt \
1420 dbmclose dbmopen defined delete die do dump each else elsif endgrent \
1421 endhostent endnetent endprotoent endpwent endservent eof eq eval \
1422 exec exists exit exp fcntl fileno flock for foreach fork format \
1423 formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname \
1424 gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername \
1425 getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent \
1426 getpwent getpwnam getpwuid getservbyname getservbyport getservent \
1427 getsockname getsockopt glob gmtime goto grep gt hex if index \
1428 int ioctl join keys kill last lc lcfirst le length link listen \
1429 local localtime lock log lstat lt m map mkdir msgctl msgget msgrcv \
1430 msgsnd my ne next no not oct open opendir or ord our pack package \
1431 pipe pop pos print printf prototype push q qq qr quotemeta qu \
1432 qw qx rand read readdir readline readlink readpipe recv redo \
1433 ref rename require reset return reverse rewinddir rindex rmdir \
1434 s scalar seek seekdir select semctl semget semop send setgrent \
1435 sethostent setnetent setpgrp setpriority setprotoent setpwent \
1436 setservent setsockopt shift shmctl shmget shmread shmwrite shutdown \
1437 sin sleep socket socketpair sort splice split sprintf sqrt srand \
1438 stat study sub substr symlink syscall sysopen sysread sysseek \
1439 system syswrite tell telldir tie tied time times tr truncate \
1440 uc ucfirst umask undef unless unlink unpack unshift untie until \
1441 use utime values vec wait waitpid wantarray warn while write \
1442 x xor y");
1443 style_sets[GEANY_FILETYPES_PERL].keywords[1] = NULL;
1445 get_keyfile_wordchars(config, config_home,
1446 &style_sets[GEANY_FILETYPES_PERL].wordchars);
1450 static void styleset_perl(ScintillaObject *sci)
1452 const filetype_id ft_id = GEANY_FILETYPES_PERL;
1454 styleset_common(sci, 5, ft_id);
1456 apply_filetype_properties(sci, SCLEX_PERL, ft_id);
1458 SSM(sci, SCI_SETPROPERTY, (sptr_t) "styling.within.preprocessor", (sptr_t) "1");
1460 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_PERL].keywords[0]);
1462 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PERL, 0);
1463 set_sci_style(sci, SCE_PL_DEFAULT, GEANY_FILETYPES_PERL, 0);
1464 set_sci_style(sci, SCE_PL_ERROR, GEANY_FILETYPES_PERL, 1);
1465 set_sci_style(sci, SCE_PL_COMMENTLINE, GEANY_FILETYPES_PERL, 2);
1466 set_sci_style(sci, SCE_PL_NUMBER, GEANY_FILETYPES_PERL, 3);
1467 set_sci_style(sci, SCE_PL_WORD, GEANY_FILETYPES_PERL, 4);
1468 set_sci_style(sci, SCE_PL_STRING, GEANY_FILETYPES_PERL, 5);
1469 set_sci_style(sci, SCE_PL_CHARACTER, GEANY_FILETYPES_PERL, 6);
1470 set_sci_style(sci, SCE_PL_PREPROCESSOR, GEANY_FILETYPES_PERL, 7);
1471 set_sci_style(sci, SCE_PL_OPERATOR, GEANY_FILETYPES_PERL, 8);
1472 set_sci_style(sci, SCE_PL_IDENTIFIER, GEANY_FILETYPES_PERL, 9);
1473 set_sci_style(sci, SCE_PL_SCALAR, GEANY_FILETYPES_PERL, 10);
1474 set_sci_style(sci, SCE_PL_POD, GEANY_FILETYPES_PERL, 11);
1475 set_sci_style(sci, SCE_PL_REGEX, GEANY_FILETYPES_PERL, 12);
1476 set_sci_style(sci, SCE_PL_ARRAY, GEANY_FILETYPES_PERL, 13);
1477 set_sci_style(sci, SCE_PL_HASH, GEANY_FILETYPES_PERL, 14);
1478 set_sci_style(sci, SCE_PL_SYMBOLTABLE, GEANY_FILETYPES_PERL, 15);
1479 set_sci_style(sci, SCE_PL_BACKTICKS, GEANY_FILETYPES_PERL, 16);
1480 set_sci_style(sci, SCE_PL_POD_VERB, GEANY_FILETYPES_PERL, 17);
1481 set_sci_style(sci, SCE_PL_REGSUBST, GEANY_FILETYPES_PERL, 18);
1482 set_sci_style(sci, SCE_PL_DATASECTION, GEANY_FILETYPES_PERL, 19);
1483 set_sci_style(sci, SCE_PL_HERE_DELIM, GEANY_FILETYPES_PERL, 20);
1484 set_sci_style(sci, SCE_PL_HERE_Q, GEANY_FILETYPES_PERL, 21);
1485 set_sci_style(sci, SCE_PL_HERE_QQ, GEANY_FILETYPES_PERL, 22);
1486 set_sci_style(sci, SCE_PL_HERE_QX, GEANY_FILETYPES_PERL, 23);
1487 set_sci_style(sci, SCE_PL_STRING_Q, GEANY_FILETYPES_PERL, 24);
1488 set_sci_style(sci, SCE_PL_STRING_QQ, GEANY_FILETYPES_PERL, 25);
1489 set_sci_style(sci, SCE_PL_STRING_QX, GEANY_FILETYPES_PERL, 26);
1490 set_sci_style(sci, SCE_PL_STRING_QR, GEANY_FILETYPES_PERL, 27);
1491 set_sci_style(sci, SCE_PL_STRING_QW, GEANY_FILETYPES_PERL, 28);
1492 set_sci_style(sci, SCE_PL_VARIABLE_INDEXER, GEANY_FILETYPES_PERL, 29);
1496 static void styleset_python_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1498 new_style_array(GEANY_FILETYPES_PYTHON, 16);
1499 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[0]);
1500 get_keyfile_hex(config, config_home, "styling", "commentline", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[1]);
1501 get_keyfile_hex(config, config_home, "styling", "number", "0x400080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[2]);
1502 get_keyfile_hex(config, config_home, "styling", "string", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[3]);
1503 get_keyfile_hex(config, config_home, "styling", "character", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[4]);
1504 get_keyfile_hex(config, config_home, "styling", "word", "0x600080", "0xffffff", "true", &style_sets[GEANY_FILETYPES_PYTHON].styling[5]);
1505 get_keyfile_hex(config, config_home, "styling", "triple", "0x008020", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[6]);
1506 get_keyfile_hex(config, config_home, "styling", "tripledouble", "0x404000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[7]);
1507 get_keyfile_hex(config, config_home, "styling", "classname", "0x003030", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[8]);
1508 get_keyfile_hex(config, config_home, "styling", "defname", "0x000080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[9]);
1509 get_keyfile_hex(config, config_home, "styling", "operator", "0x300080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[10]);
1510 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[11]);
1511 get_keyfile_hex(config, config_home, "styling", "commentblock", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[12]);
1512 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[13]);
1513 get_keyfile_hex(config, config_home, "styling", "word2", "0xdd00a6", "0xffffff", "true", &style_sets[GEANY_FILETYPES_PYTHON].styling[14]);
1514 get_keyfile_hex(config, config_home, "styling", "decorator", "0x808000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_PYTHON].styling[15]);
1516 style_sets[GEANY_FILETYPES_PYTHON].keywords = g_new(gchar*, 3);
1517 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_PYTHON, 0, "and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield False None True");
1518 get_keyfile_keywords(config, config_home, "keywords", "identifiers", GEANY_FILETYPES_PYTHON, 1, "");
1519 style_sets[GEANY_FILETYPES_PYTHON].keywords[2] = NULL;
1521 get_keyfile_wordchars(config, config_home,
1522 &style_sets[GEANY_FILETYPES_PYTHON].wordchars);
1526 static void styleset_python(ScintillaObject *sci)
1528 const filetype_id ft_id = GEANY_FILETYPES_PYTHON;
1530 styleset_common(sci, 5, ft_id);
1532 apply_filetype_properties(sci, SCLEX_PYTHON, ft_id);
1534 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_PYTHON].keywords[0]);
1535 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_PYTHON].keywords[1]);
1537 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_PYTHON, 0);
1538 set_sci_style(sci, SCE_P_DEFAULT, GEANY_FILETYPES_PYTHON, 0);
1539 set_sci_style(sci, SCE_P_COMMENTLINE, GEANY_FILETYPES_PYTHON, 1);
1540 set_sci_style(sci, SCE_P_NUMBER, GEANY_FILETYPES_PYTHON, 2);
1541 set_sci_style(sci, SCE_P_STRING, GEANY_FILETYPES_PYTHON, 3);
1542 set_sci_style(sci, SCE_P_CHARACTER, GEANY_FILETYPES_PYTHON, 4);
1543 set_sci_style(sci, SCE_P_WORD, GEANY_FILETYPES_PYTHON, 5);
1544 set_sci_style(sci, SCE_P_TRIPLE, GEANY_FILETYPES_PYTHON, 6);
1545 set_sci_style(sci, SCE_P_TRIPLEDOUBLE, GEANY_FILETYPES_PYTHON, 7);
1546 set_sci_style(sci, SCE_P_CLASSNAME, GEANY_FILETYPES_PYTHON, 8);
1547 set_sci_style(sci, SCE_P_DEFNAME, GEANY_FILETYPES_PYTHON, 9);
1548 set_sci_style(sci, SCE_P_OPERATOR, GEANY_FILETYPES_PYTHON, 10);
1549 set_sci_style(sci, SCE_P_IDENTIFIER, GEANY_FILETYPES_PYTHON, 11);
1550 set_sci_style(sci, SCE_P_COMMENTBLOCK, GEANY_FILETYPES_PYTHON, 12);
1551 set_sci_style(sci, SCE_P_STRINGEOL, GEANY_FILETYPES_PYTHON, 13);
1552 set_sci_style(sci, SCE_P_WORD2, GEANY_FILETYPES_PYTHON, 14);
1553 set_sci_style(sci, SCE_P_DECORATOR, GEANY_FILETYPES_PYTHON, 15);
1555 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.comment.python", (sptr_t) "1");
1556 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.quotes.python", (sptr_t) "1");
1560 static void styleset_ruby_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1562 new_style_array(GEANY_FILETYPES_RUBY, 35);
1563 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[0]);
1564 get_keyfile_style(config, config_home, "commentline", &gsd_comment, &style_sets[GEANY_FILETYPES_RUBY].styling[1]);
1565 get_keyfile_hex(config, config_home, "styling", "number", "0x400080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[2]);
1566 get_keyfile_hex(config, config_home, "styling", "string", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[3]);
1567 get_keyfile_hex(config, config_home, "styling", "character", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[4]);
1568 get_keyfile_hex(config, config_home, "styling", "word", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[5]);
1569 get_keyfile_hex(config, config_home, "styling", "global", "0x111199", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[6]);
1570 get_keyfile_hex(config, config_home, "styling", "symbol", "0x008020", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[7]);
1571 get_keyfile_hex(config, config_home, "styling", "classname", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[8]);
1572 get_keyfile_hex(config, config_home, "styling", "defname", "0x7f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[9]);
1573 get_keyfile_hex(config, config_home, "styling", "operator", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[10]);
1574 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[11]);
1575 get_keyfile_hex(config, config_home, "styling", "modulename", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[12]);
1576 get_keyfile_hex(config, config_home, "styling", "backticks", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[13]);
1577 get_keyfile_hex(config, config_home, "styling", "instancevar", "0x000000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[14]);
1578 get_keyfile_hex(config, config_home, "styling", "classvar", "0x000000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[15]);
1579 get_keyfile_hex(config, config_home, "styling", "datasection", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[16]);
1580 get_keyfile_hex(config, config_home, "styling", "heredelim", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[17]);
1581 get_keyfile_hex(config, config_home, "styling", "worddemoted", "0x111199", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[18]);
1582 get_keyfile_hex(config, config_home, "styling", "stdin", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[19]);
1583 get_keyfile_hex(config, config_home, "styling", "stdout", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[20]);
1584 get_keyfile_hex(config, config_home, "styling", "stderr", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[21]);
1585 get_keyfile_hex(config, config_home, "styling", "datasection", "0x600000", "0xfff0d8", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[22]);
1586 get_keyfile_hex(config, config_home, "styling", "regex", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[23]);
1587 get_keyfile_hex(config, config_home, "styling", "here_q", "0x7f007f", "0xddd0dd", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[24]);
1588 get_keyfile_hex(config, config_home, "styling", "here_qq", "0x7f007f", "0xddd0dd", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[25]);
1589 get_keyfile_hex(config, config_home, "styling", "here_qx", "0x7f007f", "0xddd0dd", "true", &style_sets[GEANY_FILETYPES_RUBY].styling[26]);
1590 get_keyfile_hex(config, config_home, "styling", "string_q", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[27]);
1591 get_keyfile_hex(config, config_home, "styling", "string_qq", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[28]);
1592 get_keyfile_hex(config, config_home, "styling", "string_qx", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[29]);
1593 get_keyfile_hex(config, config_home, "styling", "string_qr", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[30]);
1594 get_keyfile_hex(config, config_home, "styling", "string_qw", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[31]);
1595 get_keyfile_hex(config, config_home, "styling", "upper_bound", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[32]);
1596 get_keyfile_hex(config, config_home, "styling", "error", "0xe500cc", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[33]);
1597 get_keyfile_hex(config, config_home, "styling", "pod", "0x035650", "0xffffff", "false", &style_sets[GEANY_FILETYPES_RUBY].styling[34]);
1599 style_sets[GEANY_FILETYPES_RUBY].keywords = g_new(gchar*, 2);
1600 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_RUBY, 0, "load define_method attr_accessor attr_writer attr_reader include __FILE__ and def end in or self unless __LINE__ begin defined? ensure module redo super until BEGIN break do false next rescue then when END case else for nil require retry true while alias class elsif if not return undef yield");
1601 style_sets[GEANY_FILETYPES_RUBY].keywords[1] = NULL;
1603 get_keyfile_wordchars(config, config_home,
1604 &style_sets[GEANY_FILETYPES_RUBY].wordchars);
1608 static void styleset_ruby(ScintillaObject *sci)
1610 const filetype_id ft_id = GEANY_FILETYPES_RUBY;
1612 styleset_common(sci, 5, ft_id);
1614 apply_filetype_properties(sci, SCLEX_RUBY, ft_id);
1616 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_RUBY].keywords[0]);
1618 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_RUBY, 0);
1619 set_sci_style(sci, SCE_RB_DEFAULT, GEANY_FILETYPES_RUBY, 0);
1620 set_sci_style(sci, SCE_RB_COMMENTLINE, GEANY_FILETYPES_RUBY, 1);
1621 set_sci_style(sci, SCE_RB_NUMBER, GEANY_FILETYPES_RUBY, 2);
1622 set_sci_style(sci, SCE_RB_STRING, GEANY_FILETYPES_RUBY, 3);
1623 set_sci_style(sci, SCE_RB_CHARACTER, GEANY_FILETYPES_RUBY, 4);
1624 set_sci_style(sci, SCE_RB_WORD, GEANY_FILETYPES_RUBY, 5);
1625 set_sci_style(sci, SCE_RB_GLOBAL, GEANY_FILETYPES_RUBY, 6);
1626 set_sci_style(sci, SCE_RB_SYMBOL, GEANY_FILETYPES_RUBY, 7);
1627 set_sci_style(sci, SCE_RB_CLASSNAME, GEANY_FILETYPES_RUBY, 8);
1628 set_sci_style(sci, SCE_RB_DEFNAME, GEANY_FILETYPES_RUBY, 9);
1629 set_sci_style(sci, SCE_RB_OPERATOR, GEANY_FILETYPES_RUBY, 10);
1630 set_sci_style(sci, SCE_RB_IDENTIFIER, GEANY_FILETYPES_RUBY, 11);
1631 set_sci_style(sci, SCE_RB_MODULE_NAME, GEANY_FILETYPES_RUBY, 12);
1632 set_sci_style(sci, SCE_RB_BACKTICKS, GEANY_FILETYPES_RUBY, 13);
1633 set_sci_style(sci, SCE_RB_INSTANCE_VAR, GEANY_FILETYPES_RUBY, 14);
1634 set_sci_style(sci, SCE_RB_CLASS_VAR, GEANY_FILETYPES_RUBY, 15);
1635 set_sci_style(sci, SCE_RB_DATASECTION, GEANY_FILETYPES_RUBY, 16);
1636 set_sci_style(sci, SCE_RB_HERE_DELIM, GEANY_FILETYPES_RUBY, 17);
1637 set_sci_style(sci, SCE_RB_WORD_DEMOTED, GEANY_FILETYPES_RUBY, 18);
1638 set_sci_style(sci, SCE_RB_STDIN, GEANY_FILETYPES_RUBY, 19);
1639 set_sci_style(sci, SCE_RB_STDOUT, GEANY_FILETYPES_RUBY, 20);
1640 set_sci_style(sci, SCE_RB_STDERR, GEANY_FILETYPES_RUBY, 21);
1641 set_sci_style(sci, SCE_RB_DATASECTION, GEANY_FILETYPES_RUBY, 22);
1642 set_sci_style(sci, SCE_RB_REGEX, GEANY_FILETYPES_RUBY, 23);
1643 set_sci_style(sci, SCE_RB_HERE_Q, GEANY_FILETYPES_RUBY, 24);
1644 set_sci_style(sci, SCE_RB_HERE_QQ, GEANY_FILETYPES_RUBY, 25);
1645 set_sci_style(sci, SCE_RB_HERE_QX, GEANY_FILETYPES_RUBY, 26);
1646 set_sci_style(sci, SCE_RB_STRING_Q, GEANY_FILETYPES_RUBY, 27);
1647 set_sci_style(sci, SCE_RB_STRING_QQ, GEANY_FILETYPES_RUBY, 28);
1648 set_sci_style(sci, SCE_RB_STRING_QX, GEANY_FILETYPES_RUBY, 29);
1649 set_sci_style(sci, SCE_RB_STRING_QR, GEANY_FILETYPES_RUBY, 30);
1650 set_sci_style(sci, SCE_RB_STRING_QW, GEANY_FILETYPES_RUBY, 31);
1651 set_sci_style(sci, SCE_RB_UPPER_BOUND, GEANY_FILETYPES_RUBY, 32);
1652 set_sci_style(sci, SCE_RB_ERROR, GEANY_FILETYPES_RUBY, 33);
1653 set_sci_style(sci, SCE_RB_POD, GEANY_FILETYPES_RUBY, 34);
1657 static void styleset_sh_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1659 new_style_array(GEANY_FILETYPES_SH, 14);
1660 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[0]);
1661 get_keyfile_style(config, config_home, "commentline", &gsd_comment, &style_sets[GEANY_FILETYPES_SH].styling[1]);
1662 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[2]);
1663 get_keyfile_hex(config, config_home, "styling", "word", "0x119911", "0xffffff", "true", &style_sets[GEANY_FILETYPES_SH].styling[3]);
1664 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[4]);
1665 get_keyfile_hex(config, config_home, "styling", "character", "0x404000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[5]);
1666 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[6]);
1667 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[7]);
1668 get_keyfile_hex(config, config_home, "styling", "backticks", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_SH].styling[8]);
1669 get_keyfile_hex(config, config_home, "styling", "param", "0x9f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[9]);
1670 get_keyfile_hex(config, config_home, "styling", "scalar", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[10]);
1671 get_keyfile_hex(config, config_home, "styling", "error", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SH].styling[11]);
1672 get_keyfile_hex(config, config_home, "styling", "here_delim", "0x000000", "0xddd0dd", "false", &style_sets[GEANY_FILETYPES_SH].styling[12]);
1673 get_keyfile_hex(config, config_home, "styling", "here_q", "0x7f007f", "0xddd0dd", "false", &style_sets[GEANY_FILETYPES_SH].styling[13]);
1675 style_sets[GEANY_FILETYPES_SH].keywords = g_new(gchar*, 2);
1676 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_SH, 0, "break case continue do done elif else esac eval exit export fi for goto if in integer return set shift then until while");
1677 style_sets[GEANY_FILETYPES_SH].keywords[1] = NULL;
1679 get_keyfile_wordchars(config, config_home,
1680 &style_sets[GEANY_FILETYPES_SH].wordchars);
1684 static void styleset_sh(ScintillaObject *sci)
1686 const filetype_id ft_id = GEANY_FILETYPES_SH;
1688 styleset_common(sci, 5, ft_id);
1690 apply_filetype_properties(sci, SCLEX_BASH, ft_id);
1692 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_SH].keywords[0]);
1694 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_SH, 0);
1695 set_sci_style(sci, SCE_SH_DEFAULT, GEANY_FILETYPES_SH, 0);
1696 set_sci_style(sci, SCE_SH_COMMENTLINE, GEANY_FILETYPES_SH, 1);
1697 set_sci_style(sci, SCE_SH_NUMBER, GEANY_FILETYPES_SH, 2);
1698 set_sci_style(sci, SCE_SH_WORD, GEANY_FILETYPES_SH, 3);
1699 set_sci_style(sci, SCE_SH_STRING, GEANY_FILETYPES_SH, 4);
1700 set_sci_style(sci, SCE_SH_CHARACTER, GEANY_FILETYPES_SH, 5);
1701 set_sci_style(sci, SCE_SH_OPERATOR, GEANY_FILETYPES_SH, 6);
1702 set_sci_style(sci, SCE_SH_IDENTIFIER, GEANY_FILETYPES_SH, 7);
1703 set_sci_style(sci, SCE_SH_BACKTICKS, GEANY_FILETYPES_SH, 8);
1704 set_sci_style(sci, SCE_SH_PARAM, GEANY_FILETYPES_SH, 9);
1705 set_sci_style(sci, SCE_SH_SCALAR, GEANY_FILETYPES_SH, 10);
1706 set_sci_style(sci, SCE_SH_ERROR, GEANY_FILETYPES_SH, 11);
1707 set_sci_style(sci, SCE_SH_HERE_DELIM, GEANY_FILETYPES_SH, 12);
1708 set_sci_style(sci, SCE_SH_HERE_Q, GEANY_FILETYPES_SH, 13);
1712 static void styleset_xml(ScintillaObject *sci)
1714 const filetype_id ft_id = GEANY_FILETYPES_XML;
1716 styleset_common(sci, 7, ft_id);
1718 apply_filetype_properties(sci, SCLEX_XML, ft_id);
1720 /* use the same colouring for HTML; XML and so on */
1721 styleset_markup(sci, FALSE);
1725 static void styleset_docbook_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1727 new_style_array(GEANY_FILETYPES_DOCBOOK, 29);
1728 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[0]);
1729 get_keyfile_hex(config, config_home, "styling", "tag", "0x000099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[1]);
1730 get_keyfile_hex(config, config_home, "styling", "tagunknown", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[2]);
1731 get_keyfile_hex(config, config_home, "styling", "attribute", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[3]);
1732 get_keyfile_hex(config, config_home, "styling", "attributeunknown", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[4]);
1733 get_keyfile_hex(config, config_home, "styling", "number", "0x800080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[5]);
1734 get_keyfile_hex(config, config_home, "styling", "doublestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[6]);
1735 get_keyfile_hex(config, config_home, "styling", "singlestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[7]);
1736 get_keyfile_hex(config, config_home, "styling", "other", "0x800080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[8]);
1737 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[9]);
1738 get_keyfile_hex(config, config_home, "styling", "entity", "0x800080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[10]);
1739 get_keyfile_hex(config, config_home, "styling", "tagend", "0x000099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[11]);
1740 get_keyfile_hex(config, config_home, "styling", "xmlstart", "0x000099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[12]);
1741 get_keyfile_hex(config, config_home, "styling", "xmlend", "0x000099", "0xf0f0f0", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[13]);
1742 get_keyfile_hex(config, config_home, "styling", "cdata", "0x660099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[14]);
1743 get_keyfile_hex(config, config_home, "styling", "question", "0x0000ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[15]);
1744 get_keyfile_hex(config, config_home, "styling", "value", "0x660099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[16]);
1745 get_keyfile_hex(config, config_home, "styling", "xccomment", "0x660099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[17]);
1746 get_keyfile_hex(config, config_home, "styling", "sgml_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[18]);
1747 get_keyfile_hex(config, config_home, "styling", "sgml_comment", "0x303030", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[19]);
1748 get_keyfile_hex(config, config_home, "styling", "sgml_special", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[20]);
1749 get_keyfile_hex(config, config_home, "styling", "sgml_command", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[21]);
1750 get_keyfile_hex(config, config_home, "styling", "sgml_doublestring", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[22]);
1751 get_keyfile_hex(config, config_home, "styling", "sgml_simplestring", "0x404000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[23]);
1752 get_keyfile_hex(config, config_home, "styling", "sgml_1st_param", "0x404080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[24]);
1753 get_keyfile_hex(config, config_home, "styling", "sgml_entity", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[25]);
1754 get_keyfile_hex(config, config_home, "styling", "sgml_block_default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[26]);
1755 get_keyfile_hex(config, config_home, "styling", "sgml_1st_param_comment", "0x406090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[27]);
1756 get_keyfile_hex(config, config_home, "styling", "sgml_error", "0xff0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_DOCBOOK].styling[28]);
1758 style_sets[GEANY_FILETYPES_DOCBOOK].keywords = g_new(gchar*, 3);
1759 get_keyfile_keywords(config, config_home, "keywords", "elements", GEANY_FILETYPES_DOCBOOK, 0,
1760 "abbrev abstract accel ackno acronym action address affiliation alt anchor \
1761 answer appendix appendixinfo application area areaset areaspec arg article \
1762 articleinfo artpagenums attribution audiodata audioobject author authorblurb \
1763 authorgroup authorinitials beginpage bibliocoverage bibliodiv biblioentry \
1764 bibliography bibliographyinfo biblioid bibliomisc bibliomixed bibliomset \
1765 bibliorelation biblioset bibliosource blockinfo blockquote book bookinfo \
1766 bridgehead callout calloutlist caption caution chapter chapterinfo citation \
1767 citebiblioid citerefentry citetitle city classname classsynopsis classsynopsisinfo \
1768 cmdsynopsis co collab collabname colophon nameend namest colname colspec command computeroutput \
1769 confdates confgroup confnum confsponsor conftitle constant constraint \
1770 constraintdef constructorsynopsis contractnum contractsponsor contrib \
1771 copyright coref corpauthor corpname country database date dedication \
1772 destructorsynopsis edition editor email emphasis entry entrytbl envar \
1773 epigraph equation errorcode errorname errortext errortype example \
1774 exceptionname fax fieldsynopsis figure filename fileref firstname firstterm \
1775 footnote footnoteref foreignphrase formalpara frame funcdef funcparams \
1776 funcprototype funcsynopsis funcsynopsisinfo function glossary glossaryinfo \
1777 glossdef glossdiv glossentry glosslist glosssee glossseealso glossterm \
1778 graphic graphicco group guibutton guiicon guilabel guimenu guimenuitem \
1779 guisubmenu hardware highlights holder honorific htm imagedata imageobject \
1780 imageobjectco important index indexdiv indexentry indexinfo indexterm \
1781 informalequation informalexample informalfigure informaltable initializer \
1782 inlineequation inlinegraphic inlinemediaobject interface interfacename \
1783 invpartnumber isbn issn issuenum itemizedlist itermset jobtitle keycap \
1784 keycode keycombo keysym keyword keywordset label legalnotice lhs lineage \
1785 lineannotation link listitem iteral literallayout lot lotentry manvolnum \
1786 markup medialabel mediaobject mediaobjectco member menuchoice methodname \
1787 methodparam methodsynopsis mm modespec modifier ousebutton msg msgaud \
1788 msgentry msgexplan msginfo msglevel msgmain msgorig msgrel msgset msgsub \
1789 msgtext nonterminal note objectinfo olink ooclass ooexception oointerface \
1790 option optional orderedlist orgdiv orgname otheraddr othercredit othername \
1791 pagenums para paramdef parameter part partinfo partintro personblurb \
1792 personname phone phrase pob postcode preface prefaceinfo primary primaryie \
1793 printhistory procedure production productionrecap productionset productname \
1794 productnumber programlisting programlistingco prompt property pubdate publisher \
1795 publishername pubsnumber qandadiv qandaentry qandaset question quote refclass \
1796 refdescriptor refentry refentryinfo refentrytitle reference referenceinfo \
1797 refmeta refmiscinfo refname refnamediv refpurpose refsect1 refsect1info refsect2 \
1798 refsect2info refsect3 refsect3info refsection refsectioninfo refsynopsisdiv \
1799 refsynopsisdivinfo releaseinfo remark replaceable returnvalue revdescription \
1800 revhistory revision revnumber revremark rhs row sbr screen screenco screeninfo \
1801 screenshot secondary secondaryie sect1 sect1info sect2 sect2info sect3 sect3info \
1802 sect4 sect4info sect5 sect5info section sectioninfo see seealso seealsoie \
1803 seeie seg seglistitem segmentedlist segtitle seriesvolnums set setindex \
1804 setindexinfo setinfo sgmltag shortaffil shortcut sidebar sidebarinfo simpara \
1805 simplelist simplemsgentry simplesect spanspec state step street structfield \
1806 structname subject subjectset subjectterm subscript substeps subtitle \
1807 superscript surname sv symbol synopfragment synopfragmentref synopsis \
1808 systemitem table tbody term tertiary tertiaryie textdata textobject tfoot \
1809 tgroup thead tip title titleabbrev toc tocback tocchap tocentry tocfront \
1810 toclevel1 toclevel2 toclevel3 toclevel4 toclevel5 tocpart token trademark \
1811 type ulink userinput varargs variablelist varlistentry varname videodata \
1812 videoobject void volumenum warning wordasword xref year cols colnum align spanname\
1813 arch condition conformance id lang os remap role revision revisionflag security \
1814 userlevel url vendor xreflabel status label endterm linkend space width");
1815 get_keyfile_keywords(config, config_home, "keywords", "dtd", GEANY_FILETYPES_DOCBOOK, 1, "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION");
1816 style_sets[GEANY_FILETYPES_DOCBOOK].keywords[2] = NULL;
1818 get_keyfile_wordchars(config, config_home,
1819 &style_sets[GEANY_FILETYPES_DOCBOOK].wordchars);
1823 static void styleset_docbook(ScintillaObject *sci)
1825 const filetype_id ft_id = GEANY_FILETYPES_DOCBOOK;
1827 styleset_common(sci, 7, ft_id);
1829 apply_filetype_properties(sci, SCLEX_XML, ft_id);
1831 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_DOCBOOK].keywords[0]);
1832 SSM(sci, SCI_SETKEYWORDS, 5, (sptr_t) style_sets[GEANY_FILETYPES_DOCBOOK].keywords[1]);
1834 /* Unknown tags and attributes are highlighed in red.
1835 * If a tag is actually OK, it should be added in lower case to the htmlKeyWords string. */
1837 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_DOCBOOK, 0);
1838 set_sci_style(sci, SCE_H_DEFAULT, GEANY_FILETYPES_DOCBOOK, 0);
1839 set_sci_style(sci, SCE_H_TAG, GEANY_FILETYPES_DOCBOOK, 1);
1840 set_sci_style(sci, SCE_H_TAGUNKNOWN, GEANY_FILETYPES_DOCBOOK, 2);
1841 set_sci_style(sci, SCE_H_ATTRIBUTE, GEANY_FILETYPES_DOCBOOK, 3);
1842 set_sci_style(sci, SCE_H_ATTRIBUTEUNKNOWN, GEANY_FILETYPES_DOCBOOK, 4);
1843 set_sci_style(sci, SCE_H_NUMBER, GEANY_FILETYPES_DOCBOOK, 5);
1844 set_sci_style(sci, SCE_H_DOUBLESTRING, GEANY_FILETYPES_DOCBOOK, 6);
1845 set_sci_style(sci, SCE_H_SINGLESTRING, GEANY_FILETYPES_DOCBOOK, 7);
1846 set_sci_style(sci, SCE_H_OTHER, GEANY_FILETYPES_DOCBOOK, 8);
1847 set_sci_style(sci, SCE_H_COMMENT, GEANY_FILETYPES_DOCBOOK, 9);
1848 set_sci_style(sci, SCE_H_ENTITY, GEANY_FILETYPES_DOCBOOK, 10);
1849 set_sci_style(sci, SCE_H_TAGEND, GEANY_FILETYPES_DOCBOOK, 11);
1850 SSM(sci, SCI_STYLESETEOLFILLED, SCE_H_XMLSTART, 1);
1851 set_sci_style(sci, SCE_H_XMLSTART, GEANY_FILETYPES_DOCBOOK, 12);
1852 set_sci_style(sci, SCE_H_XMLEND, GEANY_FILETYPES_DOCBOOK, 13);
1853 set_sci_style(sci, SCE_H_CDATA, GEANY_FILETYPES_DOCBOOK, 14);
1854 set_sci_style(sci, SCE_H_QUESTION, GEANY_FILETYPES_DOCBOOK, 15);
1855 set_sci_style(sci, SCE_H_VALUE, GEANY_FILETYPES_DOCBOOK, 16);
1856 set_sci_style(sci, SCE_H_XCCOMMENT, GEANY_FILETYPES_DOCBOOK, 17);
1857 set_sci_style(sci, SCE_H_SGML_DEFAULT, GEANY_FILETYPES_DOCBOOK, 18);
1858 set_sci_style(sci, SCE_H_DEFAULT, GEANY_FILETYPES_DOCBOOK, 19);
1859 set_sci_style(sci, SCE_H_SGML_SPECIAL, GEANY_FILETYPES_DOCBOOK, 20);
1860 set_sci_style(sci, SCE_H_SGML_COMMAND, GEANY_FILETYPES_DOCBOOK, 21);
1861 set_sci_style(sci, SCE_H_SGML_DOUBLESTRING, GEANY_FILETYPES_DOCBOOK, 22);
1862 set_sci_style(sci, SCE_H_SGML_SIMPLESTRING, GEANY_FILETYPES_DOCBOOK, 23);
1863 set_sci_style(sci, SCE_H_SGML_1ST_PARAM, GEANY_FILETYPES_DOCBOOK, 24);
1864 set_sci_style(sci, SCE_H_SGML_ENTITY, GEANY_FILETYPES_DOCBOOK, 25);
1865 set_sci_style(sci, SCE_H_SGML_BLOCK_DEFAULT, GEANY_FILETYPES_DOCBOOK, 26);
1866 set_sci_style(sci, SCE_H_SGML_1ST_PARAM_COMMENT, GEANY_FILETYPES_DOCBOOK, 27);
1867 set_sci_style(sci, SCE_H_SGML_ERROR, GEANY_FILETYPES_DOCBOOK, 28);
1869 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.html", (sptr_t) "1");
1870 SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.html.preprocessor", (sptr_t) "1");
1874 static void styleset_none(ScintillaObject *sci)
1876 const filetype_id ft_id = GEANY_FILETYPES_NONE;
1878 SSM(sci, SCI_SETLEXER, SCLEX_NULL, 0);
1880 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_NONE, GCS_DEFAULT);
1882 styleset_common(sci, 5, ft_id);
1884 SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) common_style_set.wordchars);
1885 SSM(sci, SCI_SETWHITESPACECHARS, 0, (sptr_t) whitespace_chars);
1889 static void styleset_css_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1891 new_style_array(GEANY_FILETYPES_CSS, 16);
1892 get_keyfile_hex(config, config_home, "styling", "default", "0x003399", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[0]);
1893 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[1]);
1894 get_keyfile_hex(config, config_home, "styling", "tag", "0x2166a4", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CSS].styling[2]);
1895 get_keyfile_hex(config, config_home, "styling", "class", "0x007f00", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CSS].styling[3]);
1896 get_keyfile_hex(config, config_home, "styling", "pseudoclass", "0x660010", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CSS].styling[4]);
1897 get_keyfile_hex(config, config_home, "styling", "unknown_pseudoclass", "0xff0099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[5]);
1898 get_keyfile_hex(config, config_home, "styling", "unknown_identifier", "0xff0099", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[6]);
1899 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[7]);
1900 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000099", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CSS].styling[8]);
1901 get_keyfile_hex(config, config_home, "styling", "doublestring", "0x330066", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[9]);
1902 get_keyfile_hex(config, config_home, "styling", "singlestring", "0x330066", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[10]);
1903 get_keyfile_hex(config, config_home, "styling", "attribute", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[11]);
1904 get_keyfile_hex(config, config_home, "styling", "value", "0x303030", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[12]);
1905 get_keyfile_hex(config, config_home, "styling", "id", "0x7f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[13]);
1906 get_keyfile_hex(config, config_home, "styling", "identifier2", "0x6b6bff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CSS].styling[14]);
1907 get_keyfile_hex(config, config_home, "styling", "important", "0xff0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CSS].styling[15]);
1909 style_sets[GEANY_FILETYPES_CSS].keywords = g_new(gchar*, 4);
1910 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_CSS, 0,
1911 "color background-color background-image background-repeat background-attachment background-position background \
1912 font-family font-style font-variant font-weight font-size font \
1913 word-spacing letter-spacing text-decoration vertical-align text-transform text-align text-indent line-height \
1914 margin-top margin-right margin-bottom margin-left margin \
1915 padding-top padding-right padding-bottom padding-left padding \
1916 border-top-width border-right-width border-bottom-width border-left-width border-width \
1917 border-top border-right border-bottom border-left border \
1918 border-color border-style width height float clear \
1919 display white-space list-style-type list-style-image list-style-position list-style");
1920 get_keyfile_keywords(config, config_home, "keywords", "pseudoclasses", GEANY_FILETYPES_CSS, 1, "first-letter first-line link active visited lang first-child focus hover before after left right first");
1921 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_CSS, 2,
1922 "border-top-color border-right-color border-bottom-color border-left-color border-color \
1923 border-top-style border-right-style border-bottom-style border-left-style border-style \
1924 top right bottom left position z-index direction unicode-bidi \
1925 min-width max-width min-height max-height overflow clip visibility content quotes \
1926 counter-reset counter-increment marker-offset \
1927 size marks page-break-before page-break-after page-break-inside page orphans widows \
1928 font-stretch font-size-adjust unicode-range units-per-em src \
1929 panose-1 stemv stemh slope cap-height x-height ascent descent widths bbox definition-src \
1930 baseline centerline mathline topline text-shadow \
1931 caption-side table-layout border-collapse border-spacing empty-cells speak-header \
1932 cursor outline outline-width outline-style outline-color \
1933 volume speak pause-before pause-after pause cue-before cue-after cue \
1934 play-during azimuth elevation speech-rate voice-family pitch pitch-range stress richness \
1935 speak-punctuation speak-numeral");
1936 style_sets[GEANY_FILETYPES_CSS].keywords[3] = NULL;
1938 get_keyfile_wordchars(config, config_home,
1939 &style_sets[GEANY_FILETYPES_CSS].wordchars);
1943 static void styleset_css(ScintillaObject *sci)
1945 const filetype_id ft_id = GEANY_FILETYPES_CSS;
1947 styleset_common(sci, 5, ft_id);
1949 apply_filetype_properties(sci, SCLEX_CSS, ft_id);
1951 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_CSS].keywords[0]);
1952 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_CSS].keywords[1]);
1953 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_CSS].keywords[2]);
1955 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_CSS, 0);
1956 set_sci_style(sci, SCE_CSS_DEFAULT, GEANY_FILETYPES_CSS, 0);
1957 set_sci_style(sci, SCE_CSS_COMMENT, GEANY_FILETYPES_CSS, 1);
1958 set_sci_style(sci, SCE_CSS_TAG, GEANY_FILETYPES_CSS, 2);
1959 set_sci_style(sci, SCE_CSS_CLASS, GEANY_FILETYPES_CSS, 3);
1960 set_sci_style(sci, SCE_CSS_PSEUDOCLASS, GEANY_FILETYPES_CSS, 4);
1961 set_sci_style(sci, SCE_CSS_UNKNOWN_PSEUDOCLASS, GEANY_FILETYPES_CSS, 5);
1962 set_sci_style(sci, SCE_CSS_UNKNOWN_IDENTIFIER, GEANY_FILETYPES_CSS, 6);
1963 set_sci_style(sci, SCE_CSS_OPERATOR, GEANY_FILETYPES_CSS, 7);
1964 set_sci_style(sci, SCE_CSS_IDENTIFIER, GEANY_FILETYPES_CSS, 8);
1965 set_sci_style(sci, SCE_CSS_DOUBLESTRING, GEANY_FILETYPES_CSS, 9);
1966 set_sci_style(sci, SCE_CSS_SINGLESTRING, GEANY_FILETYPES_CSS, 10);
1967 set_sci_style(sci, SCE_CSS_ATTRIBUTE, GEANY_FILETYPES_CSS, 11);
1968 set_sci_style(sci, SCE_CSS_VALUE, GEANY_FILETYPES_CSS, 12);
1969 set_sci_style(sci, SCE_CSS_ID, GEANY_FILETYPES_CSS, 13);
1970 set_sci_style(sci, SCE_CSS_IDENTIFIER2, GEANY_FILETYPES_CSS, 14);
1971 set_sci_style(sci, SCE_CSS_IMPORTANT, GEANY_FILETYPES_CSS, 15);
1975 static void styleset_conf_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
1977 new_style_array(GEANY_FILETYPES_CONF, 6);
1978 get_keyfile_hex(config, config_home, "styling", "default", "0x7f0000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CONF].styling[0]);
1979 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CONF].styling[1]);
1980 get_keyfile_hex(config, config_home, "styling", "section", "0x000090", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CONF].styling[2]);
1981 get_keyfile_hex(config, config_home, "styling", "key", "0x00007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CONF].styling[3]);
1982 get_keyfile_hex(config, config_home, "styling", "assignment", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CONF].styling[4]);
1983 get_keyfile_hex(config, config_home, "styling", "defval", "0x00007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CONF].styling[5]);
1985 style_sets[GEANY_FILETYPES_CONF].keywords = NULL;
1987 get_keyfile_wordchars(config, config_home,
1988 &style_sets[GEANY_FILETYPES_CONF].wordchars);
1992 static void styleset_conf(ScintillaObject *sci)
1994 const filetype_id ft_id = GEANY_FILETYPES_CONF;
1996 styleset_common(sci, 5, ft_id);
1998 apply_filetype_properties(sci, SCLEX_PROPERTIES, ft_id);
2000 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_CONF, 0);
2001 set_sci_style(sci, SCE_PROPS_DEFAULT, GEANY_FILETYPES_CONF, 0);
2002 set_sci_style(sci, SCE_PROPS_COMMENT, GEANY_FILETYPES_CONF, 1);
2003 set_sci_style(sci, SCE_PROPS_SECTION, GEANY_FILETYPES_CONF, 2);
2004 set_sci_style(sci, SCE_PROPS_KEY, GEANY_FILETYPES_CONF, 3);
2005 set_sci_style(sci, SCE_PROPS_ASSIGNMENT, GEANY_FILETYPES_CONF, 4);
2006 set_sci_style(sci, SCE_PROPS_DEFVAL, GEANY_FILETYPES_CONF, 5);
2010 static void styleset_asm_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2012 new_style_array(GEANY_FILETYPES_ASM, 15);
2013 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[0]);
2014 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[1]);
2015 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[2]);
2016 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[3]);
2017 get_keyfile_hex(config, config_home, "styling", "operator", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[4]);
2018 get_keyfile_hex(config, config_home, "styling", "identifier", "0x880000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[5]);
2019 get_keyfile_hex(config, config_home, "styling", "cpuinstruction", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_ASM].styling[6]);
2020 get_keyfile_hex(config, config_home, "styling", "mathinstruction", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_ASM].styling[7]);
2021 get_keyfile_hex(config, config_home, "styling", "register", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[8]);
2022 get_keyfile_hex(config, config_home, "styling", "directive", "0x3d670f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_ASM].styling[9]);
2023 get_keyfile_hex(config, config_home, "styling", "directiveoperand", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[10]);
2024 get_keyfile_hex(config, config_home, "styling", "commentblock", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[11]);
2025 get_keyfile_hex(config, config_home, "styling", "character", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[12]);
2026 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_ASM].styling[13]);
2027 get_keyfile_hex(config, config_home, "styling", "extinstruction", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_ASM].styling[14]);
2029 style_sets[GEANY_FILETYPES_ASM].keywords = g_new(gchar*, 4);
2030 get_keyfile_keywords(config, config_home, "keywords", "instructions", GEANY_FILETYPES_ASM, 0, "HLT LAD SPI ADD SUB MUL DIV JMP JEZ JGZ JLZ SWAP JSR RET PUSHAC POPAC ADDST SUBST MULST DIVST LSA LDS PUSH POP CLI LDI INK LIA DEK LDX");
2031 get_keyfile_keywords(config, config_home, "keywords", "registers", GEANY_FILETYPES_ASM, 1, "");
2032 get_keyfile_keywords(config, config_home, "keywords", "directives", GEANY_FILETYPES_ASM, 2, "ORG LIST NOLIST PAGE EQUIVALENT WORD TEXT");
2033 style_sets[GEANY_FILETYPES_ASM].keywords[3] = NULL;
2035 get_keyfile_wordchars(config, config_home,
2036 &style_sets[GEANY_FILETYPES_ASM].wordchars);
2040 static void styleset_asm(ScintillaObject *sci)
2042 const filetype_id ft_id = GEANY_FILETYPES_ASM;
2044 styleset_common(sci, 5, ft_id);
2046 apply_filetype_properties(sci, SCLEX_ASM, ft_id);
2048 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_ASM].keywords[0]);
2049 /*SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_ASM].keywords[0]);*/
2050 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_ASM].keywords[1]);
2051 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_ASM].keywords[2]);
2052 /*SSM(sci, SCI_SETKEYWORDS, 5, (sptr_t) style_sets[GEANY_FILETYPES_ASM].keywords[0]);*/
2054 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_ASM, 0);
2055 set_sci_style(sci, SCE_ASM_DEFAULT, GEANY_FILETYPES_ASM, 0);
2056 set_sci_style(sci, SCE_ASM_COMMENT, GEANY_FILETYPES_ASM, 1);
2057 set_sci_style(sci, SCE_ASM_NUMBER, GEANY_FILETYPES_ASM, 2);
2058 set_sci_style(sci, SCE_ASM_STRING, GEANY_FILETYPES_ASM, 3);
2059 set_sci_style(sci, SCE_ASM_OPERATOR, GEANY_FILETYPES_ASM, 4);
2060 set_sci_style(sci, SCE_ASM_IDENTIFIER, GEANY_FILETYPES_ASM, 5);
2061 set_sci_style(sci, SCE_ASM_CPUINSTRUCTION, GEANY_FILETYPES_ASM, 6);
2062 set_sci_style(sci, SCE_ASM_MATHINSTRUCTION, GEANY_FILETYPES_ASM, 7);
2063 set_sci_style(sci, SCE_ASM_REGISTER, GEANY_FILETYPES_ASM, 8);
2064 set_sci_style(sci, SCE_ASM_DIRECTIVE, GEANY_FILETYPES_ASM, 9);
2065 set_sci_style(sci, SCE_ASM_DIRECTIVEOPERAND, GEANY_FILETYPES_ASM, 10);
2066 set_sci_style(sci, SCE_ASM_COMMENTBLOCK, GEANY_FILETYPES_ASM, 11);
2067 set_sci_style(sci, SCE_ASM_CHARACTER, GEANY_FILETYPES_ASM, 12);
2068 set_sci_style(sci, SCE_ASM_STRINGEOL, GEANY_FILETYPES_ASM, 13);
2069 set_sci_style(sci, SCE_ASM_EXTINSTRUCTION, GEANY_FILETYPES_ASM, 14);
2073 static void styleset_f77_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2075 new_style_array(GEANY_FILETYPES_F77, 15);
2076 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[0]);
2077 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[1]);
2078 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[2]);
2079 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[3]);
2080 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[4]);
2081 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[5]);
2082 get_keyfile_hex(config, config_home, "styling", "string2", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_F77].styling[6]);
2083 get_keyfile_hex(config, config_home, "styling", "word", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_F77].styling[7]);
2084 get_keyfile_hex(config, config_home, "styling", "word2", "0x000099", "0xffffff", "true", &style_sets[GEANY_FILETYPES_F77].styling[8]);
2085 get_keyfile_hex(config, config_home, "styling", "word3", "0x3d670f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_F77].styling[9]);
2086 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_F77].styling[10]);
2087 get_keyfile_hex(config, config_home, "styling", "operator2", "0x301010", "0xffffff", "true", &style_sets[GEANY_FILETYPES_F77].styling[11]);
2088 get_keyfile_hex(config, config_home, "styling", "continuation", "0x000000", "0xf0e080", "false", &style_sets[GEANY_FILETYPES_F77].styling[12]);
2089 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_F77].styling[13]);
2090 get_keyfile_hex(config, config_home, "styling", "label", "0xa861a8", "0xffffff", "true", &style_sets[GEANY_FILETYPES_F77].styling[14]);
2092 style_sets[GEANY_FILETYPES_F77].keywords = g_new(gchar*, 4);
2093 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_F77, 0, "");
2094 get_keyfile_keywords(config, config_home, "keywords", "intrinsic_functions", GEANY_FILETYPES_F77, 1, "");
2095 get_keyfile_keywords(config, config_home, "keywords", "user_functions", GEANY_FILETYPES_F77, 2, "");
2096 style_sets[GEANY_FILETYPES_F77].keywords[3] = NULL;
2098 get_keyfile_wordchars(config, config_home,
2099 &style_sets[GEANY_FILETYPES_F77].wordchars);
2103 static void styleset_f77(ScintillaObject *sci)
2105 const filetype_id ft_id = GEANY_FILETYPES_F77;
2107 styleset_common(sci, 5, ft_id);
2109 apply_filetype_properties(sci, SCLEX_F77, ft_id);
2111 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_F77].keywords[0]);
2112 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_F77].keywords[1]);
2113 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_F77].keywords[2]);
2115 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_F77, 0);
2116 set_sci_style(sci, SCE_F_DEFAULT, GEANY_FILETYPES_F77, 0);
2117 set_sci_style(sci, SCE_F_COMMENT, GEANY_FILETYPES_F77, 1);
2118 set_sci_style(sci, SCE_F_NUMBER, GEANY_FILETYPES_F77, 2);
2119 set_sci_style(sci, SCE_F_STRING1, GEANY_FILETYPES_F77, 3);
2120 set_sci_style(sci, SCE_F_OPERATOR, GEANY_FILETYPES_F77, 4);
2121 set_sci_style(sci, SCE_F_IDENTIFIER, GEANY_FILETYPES_F77, 5);
2122 set_sci_style(sci, SCE_F_STRING2, GEANY_FILETYPES_F77, 6);
2123 set_sci_style(sci, SCE_F_WORD, GEANY_FILETYPES_F77, 7);
2124 set_sci_style(sci, SCE_F_WORD2, GEANY_FILETYPES_F77, 8);
2125 set_sci_style(sci, SCE_F_WORD3, GEANY_FILETYPES_F77, 9);
2126 set_sci_style(sci, SCE_F_PREPROCESSOR, GEANY_FILETYPES_F77, 10);
2127 set_sci_style(sci, SCE_F_OPERATOR2, GEANY_FILETYPES_F77, 11);
2128 set_sci_style(sci, SCE_F_CONTINUATION, GEANY_FILETYPES_F77, 12);
2129 set_sci_style(sci, SCE_F_STRINGEOL, GEANY_FILETYPES_F77, 13);
2130 set_sci_style(sci, SCE_F_LABEL, GEANY_FILETYPES_F77, 14);
2134 static void styleset_fortran_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2136 new_style_array(GEANY_FILETYPES_FORTRAN, 15);
2137 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[0]);
2138 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[1]);
2139 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[2]);
2140 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[3]);
2141 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[4]);
2142 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[5]);
2143 get_keyfile_hex(config, config_home, "styling", "string2", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_FORTRAN].styling[6]);
2144 get_keyfile_hex(config, config_home, "styling", "word", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_FORTRAN].styling[7]);
2145 get_keyfile_hex(config, config_home, "styling", "word2", "0x000099", "0xffffff", "true", &style_sets[GEANY_FILETYPES_FORTRAN].styling[8]);
2146 get_keyfile_hex(config, config_home, "styling", "word3", "0x3d670f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_FORTRAN].styling[9]);
2147 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[10]);
2148 get_keyfile_hex(config, config_home, "styling", "operator2", "0x301010", "0xffffff", "true", &style_sets[GEANY_FILETYPES_FORTRAN].styling[11]);
2149 get_keyfile_hex(config, config_home, "styling", "continuation", "0x000000", "0xf0e080", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[12]);
2150 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_FORTRAN].styling[13]);
2151 get_keyfile_hex(config, config_home, "styling", "label", "0xa861a8", "0xffffff", "true", &style_sets[GEANY_FILETYPES_FORTRAN].styling[14]);
2153 style_sets[GEANY_FILETYPES_FORTRAN].keywords = g_new(gchar*, 4);
2154 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_FORTRAN, 0, "");
2155 get_keyfile_keywords(config, config_home, "keywords", "intrinsic_functions", GEANY_FILETYPES_FORTRAN, 1, "");
2156 get_keyfile_keywords(config, config_home, "keywords", "user_functions", GEANY_FILETYPES_FORTRAN, 2, "");
2157 style_sets[GEANY_FILETYPES_FORTRAN].keywords[3] = NULL;
2159 get_keyfile_wordchars(config, config_home,
2160 &style_sets[GEANY_FILETYPES_FORTRAN].wordchars);
2164 static void styleset_fortran(ScintillaObject *sci)
2166 const filetype_id ft_id = GEANY_FILETYPES_FORTRAN;
2168 styleset_common(sci, 5, ft_id);
2170 apply_filetype_properties(sci, SCLEX_FORTRAN, ft_id);
2172 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_FORTRAN].keywords[0]);
2173 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_FORTRAN].keywords[1]);
2174 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_FORTRAN].keywords[2]);
2176 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_FORTRAN, 0);
2177 set_sci_style(sci, SCE_F_DEFAULT, GEANY_FILETYPES_FORTRAN, 0);
2178 set_sci_style(sci, SCE_F_COMMENT, GEANY_FILETYPES_FORTRAN, 1);
2179 set_sci_style(sci, SCE_F_NUMBER, GEANY_FILETYPES_FORTRAN, 2);
2180 set_sci_style(sci, SCE_F_STRING1, GEANY_FILETYPES_FORTRAN, 3);
2181 set_sci_style(sci, SCE_F_OPERATOR, GEANY_FILETYPES_FORTRAN, 4);
2182 set_sci_style(sci, SCE_F_IDENTIFIER, GEANY_FILETYPES_FORTRAN, 5);
2183 set_sci_style(sci, SCE_F_STRING2, GEANY_FILETYPES_FORTRAN, 6);
2184 set_sci_style(sci, SCE_F_WORD, GEANY_FILETYPES_FORTRAN, 7);
2185 set_sci_style(sci, SCE_F_WORD2, GEANY_FILETYPES_FORTRAN, 8);
2186 set_sci_style(sci, SCE_F_WORD3, GEANY_FILETYPES_FORTRAN, 9);
2187 set_sci_style(sci, SCE_F_PREPROCESSOR, GEANY_FILETYPES_FORTRAN, 10);
2188 set_sci_style(sci, SCE_F_OPERATOR2, GEANY_FILETYPES_FORTRAN, 11);
2189 set_sci_style(sci, SCE_F_CONTINUATION, GEANY_FILETYPES_FORTRAN, 12);
2190 set_sci_style(sci, SCE_F_STRINGEOL, GEANY_FILETYPES_FORTRAN, 13);
2191 set_sci_style(sci, SCE_F_LABEL, GEANY_FILETYPES_FORTRAN, 14);
2195 static void styleset_sql_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2197 new_style_array(GEANY_FILETYPES_SQL, 15);
2198 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[0]);
2199 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[1]);
2200 get_keyfile_hex(config, config_home, "styling", "commentline", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[2]);
2201 get_keyfile_hex(config, config_home, "styling", "commentdoc", "0x3f5fbf", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[3]);
2202 get_keyfile_hex(config, config_home, "styling", "number", "0x7f7f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[4]);
2203 get_keyfile_hex(config, config_home, "styling", "word", "0x001a7f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_SQL].styling[5]);
2204 get_keyfile_hex(config, config_home, "styling", "word2", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_SQL].styling[6]);
2205 get_keyfile_hex(config, config_home, "styling", "string", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[7]);
2206 get_keyfile_hex(config, config_home, "styling", "character", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[8]);
2207 get_keyfile_hex(config, config_home, "styling", "operator", "0x000000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_SQL].styling[9]);
2208 get_keyfile_hex(config, config_home, "styling", "identifier", "0x111199", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[10]);
2209 get_keyfile_hex(config, config_home, "styling", "sqlplus", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[11]);
2210 get_keyfile_hex(config, config_home, "styling", "sqlplus_prompt", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[12]);
2211 get_keyfile_hex(config, config_home, "styling", "sqlplus_comment", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[13]);
2212 get_keyfile_hex(config, config_home, "styling", "quotedidentifier", "0x111199", "0xffffff", "false", &style_sets[GEANY_FILETYPES_SQL].styling[14]);
2214 style_sets[GEANY_FILETYPES_SQL].keywords = g_new(gchar*, 2);
2215 get_keyfile_keywords(config, config_home, "keywords", "keywords", GEANY_FILETYPES_SQL, 0,
2216 "absolute action add admin after aggregate \
2217 alias all allocate alter and any are array as asc \
2218 assertion at authorization before begin bfile bigint binary bit blob bool boolean both breadth by \
2219 call cascade cascaded case cast catalog char character check class clob close cluster collate \
2220 collation column commit completion connect connection constraint constraints \
2221 constructor continue corresponding create cross cube current \
2222 current_date current_path current_role current_time current_timestamp \
2223 current_user cursor cycle data date day deallocate dec decimal declare default \
2224 deferrable deferred delete depth deref desc describe descriptor destroy destructor \
2225 deterministic diagnostics dictionary dimension disconnect diskgroup distinct domain double drop dynamic \
2226 each else end end-exec equals escape every except exception exec execute exists explain external \
2227 false fetch first fixed flashback float for foreign found from free full function general get global \
2228 go goto grant group grouping having host hour identity if ignore immediate in index indextype indicator \
2229 initialize initially inner inout input insert int integer intersect interval \
2230 into is isolation iterate join key language large last lateral leading left less level like \
2231 limit local localtime localtimestamp locator long map match materialized mediumblob mediumint mediumtext \
2232 merge middleint minus minute modifies modify module month names national natural nchar nclob new next no noaudit \
2233 none not null numeric nvarchar2 object of off old on only open operation option or order ordinality out outer \
2234 output package pad parameter parameters partial path postfix precision prefix preorder prepare preserve primary \
2235 prior privileges procedure profile public purge read reads real recursive ref references referencing regexp regexp_like \
2236 relative rename restrict result return returning returns revoke right role rollback rollup routine row rows \
2237 savepoint schema scroll scope search second section select sequence session session_user set sets size \
2238 smallint some space specific specifictype sql sqlexception sqlstate sqlwarning start state statement static \
2239 structure synonym system_user table tablespace temporary terminate than then time timestamp \
2240 timezone_hour timezone_minute tinyint to trailing transaction translation treat trigger true truncate \
2241 type under union unique unknown unnest update usage user using value values varchar varchar2 variable varying \
2242 view when whenever where with without work write year zone");
2243 style_sets[GEANY_FILETYPES_SQL].keywords[1] = NULL;
2245 get_keyfile_wordchars(config, config_home,
2246 &style_sets[GEANY_FILETYPES_SQL].wordchars);
2250 static void styleset_sql(ScintillaObject *sci)
2252 const filetype_id ft_id = GEANY_FILETYPES_SQL;
2254 styleset_common(sci, 5, ft_id);
2256 apply_filetype_properties(sci, SCLEX_SQL, ft_id);
2258 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_SQL].keywords[0]);
2260 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_SQL, 0);
2261 set_sci_style(sci, SCE_SQL_DEFAULT, GEANY_FILETYPES_SQL, 0);
2262 set_sci_style(sci, SCE_SQL_COMMENT, GEANY_FILETYPES_SQL, 1);
2263 set_sci_style(sci, SCE_SQL_COMMENTLINE, GEANY_FILETYPES_SQL, 2);
2264 set_sci_style(sci, SCE_SQL_COMMENTDOC, GEANY_FILETYPES_SQL, 3);
2265 set_sci_style(sci, SCE_SQL_NUMBER, GEANY_FILETYPES_SQL, 4);
2266 set_sci_style(sci, SCE_SQL_WORD, GEANY_FILETYPES_SQL, 5);
2267 set_sci_style(sci, SCE_SQL_WORD2, GEANY_FILETYPES_SQL, 6);
2268 set_sci_style(sci, SCE_SQL_STRING, GEANY_FILETYPES_SQL, 7);
2269 set_sci_style(sci, SCE_SQL_CHARACTER, GEANY_FILETYPES_SQL, 8);
2270 set_sci_style(sci, SCE_SQL_OPERATOR, GEANY_FILETYPES_SQL, 9);
2271 set_sci_style(sci, SCE_SQL_IDENTIFIER, GEANY_FILETYPES_SQL, 10);
2272 set_sci_style(sci, SCE_SQL_SQLPLUS, GEANY_FILETYPES_SQL, 11);
2273 set_sci_style(sci, SCE_SQL_SQLPLUS_PROMPT, GEANY_FILETYPES_SQL, 12);
2274 set_sci_style(sci, SCE_SQL_SQLPLUS_COMMENT, GEANY_FILETYPES_SQL, 13);
2275 set_sci_style(sci, SCE_SQL_QUOTEDIDENTIFIER, GEANY_FILETYPES_SQL, 14);
2279 static void styleset_haskell_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2281 new_style_array(GEANY_FILETYPES_HASKELL, 17);
2283 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[0]);
2284 get_keyfile_hex(config, config_home, "styling", "commentline", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[1]);
2285 get_keyfile_hex(config, config_home, "styling", "commentblock", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[2]);
2286 get_keyfile_hex(config, config_home, "styling", "commentblock2", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[3]);
2287 get_keyfile_hex(config, config_home, "styling", "commentblock3", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[4]);
2288 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[5]);
2289 get_keyfile_hex(config, config_home, "styling", "keyword", "0x00007f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_HASKELL].styling[6]);
2290 get_keyfile_hex(config, config_home, "styling", "import", "0x991111", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[7]);
2291 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[8]);
2292 get_keyfile_hex(config, config_home, "styling", "character", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[9]);
2293 get_keyfile_hex(config, config_home, "styling", "class", "0x0000d0", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[10]);
2294 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[11]);
2295 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[12]);
2296 get_keyfile_hex(config, config_home, "styling", "instance", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[13]);
2297 get_keyfile_hex(config, config_home, "styling", "capital", "0x635b00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[14]);
2298 get_keyfile_hex(config, config_home, "styling", "module", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[15]);
2299 get_keyfile_hex(config, config_home, "styling", "data", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_HASKELL].styling[16]);
2301 style_sets[GEANY_FILETYPES_HASKELL].keywords = g_new(gchar*, 2);
2302 get_keyfile_keywords(config, config_home, "keywords", "keywords", GEANY_FILETYPES_HASKELL, 0,
2303 "as case class data deriving do else if import in infixl infixr instance let module of primitive qualified then type where");
2304 style_sets[GEANY_FILETYPES_HASKELL].keywords[1] = NULL;
2306 get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_HASKELL].wordchars);
2310 static void styleset_haskell(ScintillaObject *sci)
2312 const filetype_id ft_id = GEANY_FILETYPES_HASKELL;
2314 styleset_common(sci, 5, ft_id);
2316 apply_filetype_properties(sci, SCLEX_HASKELL, ft_id);
2318 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_HASKELL].keywords[0]);
2320 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_HASKELL, 0);
2321 set_sci_style(sci, SCE_HA_DEFAULT, GEANY_FILETYPES_HASKELL, 0);
2322 set_sci_style(sci, SCE_HA_COMMENTLINE, GEANY_FILETYPES_HASKELL, 1);
2323 set_sci_style(sci, SCE_HA_COMMENTBLOCK, GEANY_FILETYPES_HASKELL, 2);
2324 set_sci_style(sci, SCE_HA_COMMENTBLOCK2, GEANY_FILETYPES_HASKELL, 3);
2325 set_sci_style(sci, SCE_HA_COMMENTBLOCK3, GEANY_FILETYPES_HASKELL, 4);
2326 set_sci_style(sci, SCE_HA_NUMBER, GEANY_FILETYPES_HASKELL, 5);
2327 set_sci_style(sci, SCE_HA_KEYWORD, GEANY_FILETYPES_HASKELL, 6);
2328 set_sci_style(sci, SCE_HA_IMPORT, GEANY_FILETYPES_HASKELL, 7);
2329 set_sci_style(sci, SCE_HA_STRING, GEANY_FILETYPES_HASKELL, 8);
2330 set_sci_style(sci, SCE_HA_CHARACTER, GEANY_FILETYPES_HASKELL, 9);
2331 set_sci_style(sci, SCE_HA_CLASS, GEANY_FILETYPES_HASKELL, 10);
2332 set_sci_style(sci, SCE_HA_OPERATOR, GEANY_FILETYPES_HASKELL, 11);
2333 set_sci_style(sci, SCE_HA_IDENTIFIER, GEANY_FILETYPES_HASKELL, 12);
2334 set_sci_style(sci, SCE_HA_INSTANCE, GEANY_FILETYPES_HASKELL, 13);
2335 set_sci_style(sci, SCE_HA_CAPITAL, GEANY_FILETYPES_HASKELL, 14);
2336 set_sci_style(sci, SCE_HA_MODULE, GEANY_FILETYPES_HASKELL, 15);
2337 set_sci_style(sci, SCE_HA_DATA, GEANY_FILETYPES_HASKELL, 16);
2341 static void styleset_caml_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2343 new_style_array(GEANY_FILETYPES_CAML, 14);
2345 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[0]);
2346 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[1]);
2347 get_keyfile_hex(config, config_home, "styling", "comment1", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[2]);
2348 get_keyfile_hex(config, config_home, "styling", "comment2", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[3]);
2349 get_keyfile_hex(config, config_home, "styling", "comment3", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[4]);
2350 get_keyfile_hex(config, config_home, "styling", "number", "0x7f7f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[5]);
2351 get_keyfile_hex(config, config_home, "styling", "keyword", "0x001a7f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CAML].styling[6]);
2352 get_keyfile_hex(config, config_home, "styling", "keyword2", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_CAML].styling[7]);
2353 get_keyfile_hex(config, config_home, "styling", "string", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[8]);
2354 get_keyfile_hex(config, config_home, "styling", "char", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[9]);
2355 get_keyfile_hex(config, config_home, "styling", "operator", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[10]);
2356 get_keyfile_hex(config, config_home, "styling", "identifier", "0x111199", "0xffffff", "false", &style_sets[GEANY_FILETYPES_CAML].styling[11]);
2357 get_keyfile_hex(config, config_home, "styling", "tagname", "0x000000", "0xffe0ff", "true", &style_sets[GEANY_FILETYPES_CAML].styling[12]);
2358 get_keyfile_hex(config, config_home, "styling", "linenum", "0x000000", "0xc0c0c0", "false", &style_sets[GEANY_FILETYPES_CAML].styling[13]);
2360 style_sets[GEANY_FILETYPES_CAML].keywords = g_new(gchar*, 3);
2361 get_keyfile_keywords(config, config_home, "keywords", "keywords", GEANY_FILETYPES_CAML, 0,
2362 "and as assert asr begin class constraint do \
2363 done downto else end exception external false for fun function functor if in include inherit \
2364 initializer land lazy let lor lsl lsr lxor match method mod module mutable new object of open \
2365 or private rec sig struct then to true try type val virtual when while with");
2366 get_keyfile_keywords(config, config_home, "keywords", "keywords_optional", GEANY_FILETYPES_CAML, 1, "option Some None ignore ref");
2367 style_sets[GEANY_FILETYPES_CAML].keywords[2] = NULL;
2369 get_keyfile_wordchars(config, config_home,
2370 &style_sets[GEANY_FILETYPES_CAML].wordchars);
2374 static void styleset_caml(ScintillaObject *sci)
2376 const filetype_id ft_id = GEANY_FILETYPES_CAML;
2378 styleset_common(sci, 5, ft_id);
2380 apply_filetype_properties(sci, SCLEX_CAML, ft_id);
2382 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_CAML].keywords[0]);
2383 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_CAML].keywords[1]);
2385 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_CAML, 0);
2386 set_sci_style(sci, SCE_CAML_DEFAULT, GEANY_FILETYPES_CAML, 0);
2387 set_sci_style(sci, SCE_CAML_COMMENT, GEANY_FILETYPES_CAML, 1);
2388 set_sci_style(sci, SCE_CAML_COMMENT1, GEANY_FILETYPES_CAML, 2);
2389 set_sci_style(sci, SCE_CAML_COMMENT2, GEANY_FILETYPES_CAML, 3);
2390 set_sci_style(sci, SCE_CAML_COMMENT3, GEANY_FILETYPES_CAML, 4);
2391 set_sci_style(sci, SCE_CAML_NUMBER, GEANY_FILETYPES_CAML, 5);
2392 set_sci_style(sci, SCE_CAML_KEYWORD, GEANY_FILETYPES_CAML, 6);
2393 set_sci_style(sci, SCE_CAML_KEYWORD2, GEANY_FILETYPES_CAML, 7);
2394 set_sci_style(sci, SCE_CAML_STRING, GEANY_FILETYPES_CAML, 8);
2395 set_sci_style(sci, SCE_CAML_CHAR, GEANY_FILETYPES_CAML, 9);
2396 set_sci_style(sci, SCE_CAML_OPERATOR, GEANY_FILETYPES_CAML, 10);
2397 set_sci_style(sci, SCE_CAML_IDENTIFIER, GEANY_FILETYPES_CAML, 11);
2398 set_sci_style(sci, SCE_CAML_TAGNAME, GEANY_FILETYPES_CAML, 12);
2399 set_sci_style(sci, SCE_CAML_LINENUM, GEANY_FILETYPES_CAML, 13);
2405 static void styleset_oms_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2407 new_style_array(GEANY_FILETYPES_OMS, 11);
2408 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[0]);
2409 get_keyfile_hex(config, config_home, "styling", "commentline", "0x909090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[1]);
2410 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[2]);
2411 get_keyfile_hex(config, config_home, "styling", "word", "0x991111", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[3]);
2412 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[4]);
2413 get_keyfile_hex(config, config_home, "styling", "character", "0x404000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[5]);
2414 get_keyfile_hex(config, config_home, "styling", "operator", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[6]);
2415 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[7]);
2416 get_keyfile_hex(config, config_home, "styling", "backticks", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_OMS].styling[8]);
2417 get_keyfile_hex(config, config_home, "styling", "param", "0x991111", "0x0000ff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[9]);
2418 get_keyfile_hex(config, config_home, "styling", "scalar", "0x0000ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_OMS].styling[10]);
2420 style_sets[GEANY_FILETYPES_OMS].keywords = g_new(gchar*, 2);
2421 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_OMS, 0, "clear seq fillcols fillrowsgaspect gaddview \
2422 gtitle gxaxis gyaxis max contour gcolor gplot gaddview gxaxis gyaxis gcolor fill coldim gplot \
2423 gtitle clear arcov dpss fspec cos gxaxis gyaxis gtitle gplot gupdate rowdim fill print for to begin \
2424 end write cocreate coinvoke codispsave cocreate codispset copropput colsum sqrt adddialog \
2425 addcontrol addcontrol delwin fillrows function gaspect conjdir");
2426 style_sets[GEANY_FILETYPES_OMS].keywords[1] = NULL;
2428 get_keyfile_wordchars(config, config_home,
2429 &style_sets[GEANY_FILETYPES_OMS].wordchars);
2433 static void styleset_oms(ScintillaObject *sci)
2435 const filetype_id ft_id = GEANY_FILETYPES_OMS;
2437 styleset_common(sci, 5, ft_id);
2439 apply_filetype_properties(sci, SCLEX_OMS, ft_id);
2441 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_OMS].keywords[0]);
2443 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_OMS, 0);
2444 set_sci_style(sci, SCE_SH_DEFAULT, GEANY_FILETYPES_OMS, 0);
2445 set_sci_style(sci, SCE_SH_COMMENTLINE, GEANY_FILETYPES_OMS, 1);
2446 set_sci_style(sci, SCE_SH_NUMBER, GEANY_FILETYPES_OMS, 2);
2447 set_sci_style(sci, SCE_SH_WORD, GEANY_FILETYPES_OMS, 3);
2448 set_sci_style(sci, SCE_SH_STRING, GEANY_FILETYPES_OMS, 4);
2449 set_sci_style(sci, SCE_SH_CHARACTER, GEANY_FILETYPES_OMS, 5);
2450 set_sci_style(sci, SCE_SH_OPERATOR, GEANY_FILETYPES_OMS, 6);
2451 set_sci_style(sci, SCE_SH_IDENTIFIER, GEANY_FILETYPES_OMS, 7);
2452 set_sci_style(sci, SCE_SH_BACKTICKS, GEANY_FILETYPES_OMS, 8);
2453 set_sci_style(sci, SCE_SH_PARAM, GEANY_FILETYPES_OMS, 9);
2454 set_sci_style(sci, SCE_SH_SCALAR, GEANY_FILETYPES_OMS, 10);
2458 static void styleset_tcl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2460 new_style_array(GEANY_FILETYPES_TCL, 16);
2461 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[0]);
2462 get_keyfile_style(config, config_home, "comment", &gsd_comment, &style_sets[GEANY_FILETYPES_TCL].styling[1]);
2463 get_keyfile_style(config, config_home, "commentline", &gsd_comment, &style_sets[GEANY_FILETYPES_TCL].styling[2]);
2464 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[3]);
2465 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[4]);
2466 get_keyfile_hex(config, config_home, "styling", "identifier", "0xa20000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[5]);
2467 get_keyfile_hex(config, config_home, "styling", "wordinquote", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[6]);
2468 get_keyfile_hex(config, config_home, "styling", "inquote", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[7]);
2469 get_keyfile_hex(config, config_home, "styling", "substitution", "0x111199", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[8]);
2470 get_keyfile_hex(config, config_home, "styling", "modifier", "0x7f007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[9]);
2471 get_keyfile_hex(config, config_home, "styling", "expand", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_TCL].styling[10]);
2472 get_keyfile_hex(config, config_home, "styling", "wordtcl", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_TCL].styling[11]);
2473 get_keyfile_hex(config, config_home, "styling", "wordtk", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_TCL].styling[12]);
2474 get_keyfile_hex(config, config_home, "styling", "worditcl", "0x111199", "0xffffff", "true", &style_sets[GEANY_FILETYPES_TCL].styling[13]);
2475 get_keyfile_hex(config, config_home, "styling", "wordtkcmds", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_TCL].styling[14]);
2476 get_keyfile_hex(config, config_home, "styling", "wordexpand", "0x7f0000", "0xffffff", "true", &style_sets[GEANY_FILETYPES_TCL].styling[15]);
2478 style_sets[GEANY_FILETYPES_TCL].keywords = g_new(gchar*, 6);
2479 get_keyfile_keywords(config, config_home, "keywords", "tcl", GEANY_FILETYPES_TCL, 0, "");
2480 get_keyfile_keywords(config, config_home, "keywords", "tk", GEANY_FILETYPES_TCL, 1, "");
2481 get_keyfile_keywords(config, config_home, "keywords", "itcl", GEANY_FILETYPES_TCL, 2, "");
2482 get_keyfile_keywords(config, config_home, "keywords", "tkcommands", GEANY_FILETYPES_TCL, 3, "");
2483 get_keyfile_keywords(config, config_home, "keywords", "expand", GEANY_FILETYPES_TCL, 4, "");
2484 style_sets[GEANY_FILETYPES_TCL].keywords[5] = NULL;
2486 get_keyfile_wordchars(config, config_home,
2487 &style_sets[GEANY_FILETYPES_TCL].wordchars);
2491 static void styleset_tcl(ScintillaObject *sci)
2493 const filetype_id ft_id = GEANY_FILETYPES_TCL;
2495 styleset_common(sci, 5, ft_id);
2497 apply_filetype_properties(sci, SCLEX_TCL, ft_id);
2499 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_TCL].keywords[0]);
2500 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_TCL].keywords[1]);
2501 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_TCL].keywords[2]);
2502 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_TCL].keywords[3]);
2503 SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) style_sets[GEANY_FILETYPES_TCL].keywords[4]);
2505 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_TCL, 0);
2506 set_sci_style(sci, SCE_TCL_DEFAULT, GEANY_FILETYPES_TCL, 0);
2507 set_sci_style(sci, SCE_TCL_COMMENT, GEANY_FILETYPES_TCL, 1);
2508 set_sci_style(sci, SCE_TCL_COMMENTLINE, GEANY_FILETYPES_TCL, 2);
2509 set_sci_style(sci, SCE_TCL_NUMBER, GEANY_FILETYPES_TCL, 3);
2510 set_sci_style(sci, SCE_TCL_OPERATOR, GEANY_FILETYPES_TCL, 4);
2511 set_sci_style(sci, SCE_TCL_IDENTIFIER, GEANY_FILETYPES_TCL, 5);
2512 set_sci_style(sci, SCE_TCL_WORD_IN_QUOTE, GEANY_FILETYPES_TCL, 6);
2513 set_sci_style(sci, SCE_TCL_IN_QUOTE, GEANY_FILETYPES_TCL, 7);
2514 set_sci_style(sci, SCE_TCL_SUBSTITUTION, GEANY_FILETYPES_TCL, 8);
2515 set_sci_style(sci, SCE_TCL_MODIFIER, GEANY_FILETYPES_TCL, 9);
2516 set_sci_style(sci, SCE_TCL_EXPAND, GEANY_FILETYPES_TCL, 10);
2517 set_sci_style(sci, SCE_TCL_WORD, GEANY_FILETYPES_TCL, 11);
2518 set_sci_style(sci, SCE_TCL_WORD2, GEANY_FILETYPES_TCL, 12);
2519 set_sci_style(sci, SCE_TCL_WORD3, GEANY_FILETYPES_TCL, 13);
2520 set_sci_style(sci, SCE_TCL_WORD4, GEANY_FILETYPES_TCL, 14);
2521 set_sci_style(sci, SCE_TCL_WORD5, GEANY_FILETYPES_TCL, 15);
2524 static void styleset_d_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2526 new_style_array(GEANY_FILETYPES_D, 18);
2528 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[0]);
2529 get_keyfile_hex(config, config_home, "styling", "comment", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[1]);
2530 get_keyfile_hex(config, config_home, "styling", "commentline", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[2]);
2531 get_keyfile_hex(config, config_home, "styling", "commentdoc", "0x3f5fbf", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[3]);
2532 get_keyfile_hex(config, config_home, "styling", "commentdocnested", "0x3f5fbf", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[4]);
2533 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[5]);
2534 get_keyfile_hex(config, config_home, "styling", "word", "0x00007f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_D].styling[6]);
2535 get_keyfile_hex(config, config_home, "styling", "word2", "0x991111", "0xffffff", "true", &style_sets[GEANY_FILETYPES_D].styling[7]);
2536 get_keyfile_hex(config, config_home, "styling", "word3", "0x991111", "0xffffff", "true", &style_sets[GEANY_FILETYPES_D].styling[8]);
2537 get_keyfile_hex(config, config_home, "styling", "typedef", "0x0000d0", "0xffffff", "true", &style_sets[GEANY_FILETYPES_D].styling[9]);
2538 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[10]);
2539 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_D].styling[11]);
2540 get_keyfile_hex(config, config_home, "styling", "character", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[12]);
2541 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[13]);
2542 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[14]);
2543 get_keyfile_hex(config, config_home, "styling", "commentlinedoc", "0x3f5fbf", "0xffffff", "true", &style_sets[GEANY_FILETYPES_D].styling[15]);
2544 get_keyfile_hex(config, config_home, "styling", "commentdockeyword", "0x3f5fbf", "0xffffff", "true", &style_sets[GEANY_FILETYPES_D].styling[16]);
2545 get_keyfile_hex(config, config_home, "styling", "commentdockeyworderror", "0x3f5fbf", "0xffffff", "false", &style_sets[GEANY_FILETYPES_D].styling[17]);
2547 style_sets[GEANY_FILETYPES_D].keywords = g_new(gchar*, 5);
2548 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_D, 0,
2549 "__FILE__ __LINE__ __DATA__ __TIME__ __TIMESTAMP__ abstract alias align asm assert auto \
2550 body bool break byte case cast catch cdouble cent cfloat char class const continue creal \
2551 dchar debug default delegate delete deprecated do double else enum export extern false \
2552 final finally float for foreach function goto idouble if ifloat import in inout int \
2553 interface invariant ireal is long mixin module new null out override package pragma \
2554 private protected public real return scope short static struct super switch \
2555 synchronized template this throw true try typedef typeof ubyte ucent uint ulong union \
2556 unittest ushort version void volatile wchar while with");
2557 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_D, 1,
2558 "");
2559 get_keyfile_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_D, 2,
2560 "Authors Bugs Copyright Date Deprecated Examples History License Macros Params Returns \
2561 See_Also Standards Throws Version");
2562 get_keyfile_keywords(config, config_home, "keywords", "types", GEANY_FILETYPES_D, 3,
2563 "");
2564 style_sets[GEANY_FILETYPES_D].keywords[4] = NULL;
2566 get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_D].wordchars);
2570 static void styleset_d(ScintillaObject *sci)
2572 const filetype_id ft_id = GEANY_FILETYPES_D;
2574 styleset_common(sci, 5, ft_id);
2576 apply_filetype_properties(sci, SCLEX_D, ft_id);
2578 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_D].keywords[0]);
2579 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_D].keywords[1]);
2580 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_D].keywords[2]);
2581 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_D].keywords[3]);
2583 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_D, 0);
2584 set_sci_style(sci, SCE_D_DEFAULT, GEANY_FILETYPES_D, 0);
2585 set_sci_style(sci, SCE_D_COMMENT, GEANY_FILETYPES_D, 1);
2586 set_sci_style(sci, SCE_D_COMMENTLINE, GEANY_FILETYPES_D, 2);
2587 set_sci_style(sci, SCE_D_COMMENTDOC, GEANY_FILETYPES_D, 3);
2588 set_sci_style(sci, SCE_D_COMMENTNESTED, GEANY_FILETYPES_D, 4);
2589 set_sci_style(sci, SCE_D_NUMBER, GEANY_FILETYPES_D, 5);
2590 set_sci_style(sci, SCE_D_WORD, GEANY_FILETYPES_D, 6);
2591 set_sci_style(sci, SCE_D_WORD2, GEANY_FILETYPES_D, 7);
2592 set_sci_style(sci, SCE_D_WORD3, GEANY_FILETYPES_D, 8);
2593 set_sci_style(sci, SCE_D_TYPEDEF, GEANY_FILETYPES_D, 9);
2594 set_sci_style(sci, SCE_D_STRING, GEANY_FILETYPES_D, 10);
2595 set_sci_style(sci, SCE_D_STRINGEOL, GEANY_FILETYPES_D, 11);
2596 set_sci_style(sci, SCE_D_CHARACTER, GEANY_FILETYPES_D, 12);
2597 set_sci_style(sci, SCE_D_OPERATOR, GEANY_FILETYPES_D, 13);
2598 set_sci_style(sci, SCE_D_IDENTIFIER, GEANY_FILETYPES_D, 14);
2599 set_sci_style(sci, SCE_D_COMMENTLINEDOC, GEANY_FILETYPES_D, 15);
2600 set_sci_style(sci, SCE_D_COMMENTDOCKEYWORD, GEANY_FILETYPES_D, 16);
2601 set_sci_style(sci, SCE_D_COMMENTDOCKEYWORDERROR, GEANY_FILETYPES_D, 17);
2605 static void styleset_ferite_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2607 new_style_array(GEANY_FILETYPES_FERITE, 20);
2608 styleset_c_like_init(config, config_home, GEANY_FILETYPES_FERITE);
2610 style_sets[GEANY_FILETYPES_FERITE].keywords = g_new(gchar*, 4);
2611 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_FERITE, 0, "false null self super true abstract alias and arguments attribute_missing break case class closure conformsToProtocol constructor continue default deliver destructor diliver directive do else extends eval final fix for function global handle if iferr implements include instanceof isa method_missing modifies monitor namespace new or private protected protocol public raise recipient rename return static switch uses using while");
2612 get_keyfile_keywords(config, config_home, "keywords", "types", GEANY_FILETYPES_FERITE, 1, "boolean string number array object void");
2613 get_keyfile_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_FERITE, 2, "brief class declaration description end example extends function group implements modifies module namespace param protocol return return static type variable warning");
2614 style_sets[GEANY_FILETYPES_FERITE].keywords[3] = NULL;
2616 get_keyfile_wordchars(config, config_home,
2617 &style_sets[GEANY_FILETYPES_FERITE].wordchars);
2621 static void styleset_ferite(ScintillaObject *sci)
2623 const filetype_id ft_id = GEANY_FILETYPES_FERITE;
2625 styleset_common(sci, 5, ft_id);
2627 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
2629 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_FERITE].keywords[0]);
2630 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_FERITE].keywords[1]);
2631 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_FERITE].keywords[2]);
2633 styleset_c_like(sci, GEANY_FILETYPES_FERITE);
2637 static void styleset_vhdl_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2639 new_style_array(GEANY_FILETYPES_VHDL, 15);
2641 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[0]);
2642 get_keyfile_hex(config, config_home, "styling", "comment", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[1]);
2643 get_keyfile_hex(config, config_home, "styling", "comment_line_bang", "0x3f5fbf", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[2]);
2644 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[3]);
2645 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[4]);
2646 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[5]);
2647 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[6]);
2648 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[7]);
2649 get_keyfile_hex(config, config_home, "styling", "keyword", "0x001a7f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_VHDL].styling[8]);
2650 get_keyfile_hex(config, config_home, "styling", "stdoperator", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[9]);
2651 get_keyfile_hex(config, config_home, "styling", "attribute", "0x804020", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[10]);
2652 get_keyfile_hex(config, config_home, "styling", "stdfunction", "0x808020", "0xffffff", "true", &style_sets[GEANY_FILETYPES_VHDL].styling[11]);
2653 get_keyfile_hex(config, config_home, "styling", "stdpackage", "0x208020", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[12]);
2654 get_keyfile_hex(config, config_home, "styling", "stdtype", "0x208080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_VHDL].styling[13]);
2655 get_keyfile_hex(config, config_home, "styling", "userword", "0x804020", "0xffffff", "true", &style_sets[GEANY_FILETYPES_VHDL].styling[14]);
2657 style_sets[GEANY_FILETYPES_VHDL].keywords = g_new(gchar*, 8);
2658 get_keyfile_keywords(config, config_home, "keywords", "keywords", GEANY_FILETYPES_VHDL, 0,
2659 "access after alias all architecture array assert attribute begin block \
2660 body buffer bus case component configuration constant disconnect downto else elsif \
2661 end entity exit file for function generate generic group guarded if impure in inertial \
2662 inout is label library linkage literal loop map new next null of on open others out \
2663 package port postponed procedure process pure range record register reject report \
2664 return select severity shared signal subtype then to transport type unaffected units \
2665 until use variable wait when while with");
2666 get_keyfile_keywords(config, config_home, "keywords", "operators", GEANY_FILETYPES_VHDL, 1,
2667 "abs and mod nand nor not or rem rol ror sla sll sra srl xnor xor");
2668 get_keyfile_keywords(config, config_home, "keywords", "attributes", GEANY_FILETYPES_VHDL, 2,
2669 "left right low high ascending image value pos val succ pred leftof rightof base range \
2670 reverse_range length delayed stable quiet transaction event active last_event last_active \
2671 last_value driving driving_value simple_name path_name instance_name");
2672 get_keyfile_keywords(config, config_home, "keywords", "std_functions", GEANY_FILETYPES_VHDL, 3,
2673 "now readline read writeline write endfile resolved to_bit to_bitvector to_stdulogic \
2674 to_stdlogicvector to_stdulogicvector to_x01 to_x01z to_UX01 rising_edge falling_edge \
2675 is_x shift_left shift_right rotate_left rotate_right resize to_integer to_unsigned \
2676 to_signed std_match to_01");
2677 get_keyfile_keywords(config, config_home, "keywords", "std_packages", GEANY_FILETYPES_VHDL, 4,
2678 "std ieee work standard textio std_logic_1164 std_logic_arith std_logic_misc \
2679 std_logic_signed std_logic_textio std_logic_unsigned numeric_bit numeric_std \
2680 math_complex math_real vital_primitives vital_timing");
2681 get_keyfile_keywords(config, config_home, "keywords", "std_types", GEANY_FILETYPES_VHDL, 5,
2682 "boolean bit character severity_level integer real time delay_length natural positive \
2683 string bit_vector file_open_kind file_open_status line text side width std_ulogic \
2684 std_ulogic_vector std_logic std_logic_vector X01 X01Z UX01 UX01Z unsigned signed");
2685 get_keyfile_keywords(config, config_home, "keywords", "userwords", GEANY_FILETYPES_VHDL, 6, "");
2686 style_sets[GEANY_FILETYPES_VHDL].keywords[7] = NULL;
2688 get_keyfile_wordchars(config, config_home,
2689 &style_sets[GEANY_FILETYPES_VHDL].wordchars);
2693 static void styleset_vhdl(ScintillaObject *sci)
2695 const filetype_id ft_id = GEANY_FILETYPES_VHDL;
2697 styleset_common(sci, 5, ft_id);
2699 apply_filetype_properties(sci, SCLEX_VHDL, ft_id);
2701 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[0]);
2702 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[1]);
2703 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[2]);
2704 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[3]);
2705 SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[4]);
2706 SSM(sci, SCI_SETKEYWORDS, 5, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[5]);
2707 SSM(sci, SCI_SETKEYWORDS, 6, (sptr_t) style_sets[GEANY_FILETYPES_VHDL].keywords[6]);
2709 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_VHDL, 0);
2710 set_sci_style(sci, SCE_VHDL_DEFAULT, GEANY_FILETYPES_VHDL, 0);
2711 set_sci_style(sci, SCE_VHDL_COMMENT, GEANY_FILETYPES_VHDL, 1);
2712 set_sci_style(sci, SCE_VHDL_COMMENTLINEBANG, GEANY_FILETYPES_VHDL, 2);
2713 set_sci_style(sci, SCE_VHDL_NUMBER, GEANY_FILETYPES_VHDL, 3);
2714 set_sci_style(sci, SCE_VHDL_STRING, GEANY_FILETYPES_VHDL, 4);
2715 set_sci_style(sci, SCE_VHDL_OPERATOR, GEANY_FILETYPES_VHDL, 5);
2716 set_sci_style(sci, SCE_VHDL_IDENTIFIER, GEANY_FILETYPES_VHDL, 6);
2717 set_sci_style(sci, SCE_VHDL_STRINGEOL, GEANY_FILETYPES_VHDL, 7);
2718 set_sci_style(sci, SCE_VHDL_KEYWORD, GEANY_FILETYPES_VHDL, 8);
2719 set_sci_style(sci, SCE_VHDL_STDOPERATOR, GEANY_FILETYPES_VHDL, 9);
2720 set_sci_style(sci, SCE_VHDL_ATTRIBUTE, GEANY_FILETYPES_VHDL, 10);
2721 set_sci_style(sci, SCE_VHDL_STDFUNCTION, GEANY_FILETYPES_VHDL, 11);
2722 set_sci_style(sci, SCE_VHDL_STDPACKAGE, GEANY_FILETYPES_VHDL, 12);
2723 set_sci_style(sci, SCE_VHDL_STDTYPE, GEANY_FILETYPES_VHDL, 13);
2724 set_sci_style(sci, SCE_VHDL_USERWORD, GEANY_FILETYPES_VHDL, 14);
2728 static void styleset_js_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2730 new_style_array(GEANY_FILETYPES_JS, 20);
2731 styleset_c_like_init(config, config_home, GEANY_FILETYPES_JS);
2733 style_sets[GEANY_FILETYPES_JS].keywords = g_new(gchar*, 2);
2734 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_JS, 0, "\
2735 abs abstract acos anchor asin atan atan2 big bold boolean break byte \
2736 case catch ceil char charAt charCodeAt class concat const continue cos \
2737 Date debugger default delete do double else enum escape eval exp export \
2738 extends false final finally fixed float floor fontcolor fontsize for \
2739 fromCharCode function goto if implements import in indexOf Infinity \
2740 instanceof int interface isFinite isNaN italics join lastIndexOf length \
2741 link log long Math max MAX_VALUE min MIN_VALUE NaN native NEGATIVE_INFINITY \
2742 new null Number package parseFloat parseInt pop POSITIVE_INFINITY pow private \
2743 protected public push random return reverse round shift short sin slice small \
2744 sort splice split sqrt static strike string String sub substr substring sup \
2745 super switch synchronized tan this throw throws toLowerCase toString \
2746 toUpperCase transient true try typeof undefined unescape unshift valueOf \
2747 var void volatile while with");
2748 style_sets[GEANY_FILETYPES_JS].keywords[1] = NULL;
2750 get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_JS].wordchars);
2754 static void styleset_js(ScintillaObject *sci)
2756 const filetype_id ft_id = GEANY_FILETYPES_JS;
2758 styleset_common(sci, 5, ft_id);
2760 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
2762 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_JS].keywords[0]);
2764 styleset_c_like(sci, GEANY_FILETYPES_JS);
2768 static void styleset_lua_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2770 new_style_array(GEANY_FILETYPES_LUA, 20);
2772 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[0]);
2773 get_keyfile_hex(config, config_home, "styling", "comment", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[1]);
2774 get_keyfile_hex(config, config_home, "styling", "commentline", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[2]);
2775 get_keyfile_hex(config, config_home, "styling", "commentdoc", "0x3f5fbf", "0xffffff", "true", &style_sets[GEANY_FILETYPES_LUA].styling[3]);
2776 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[4]);
2777 get_keyfile_hex(config, config_home, "styling", "word", "0x00007f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_LUA].styling[5]);
2778 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[6]);
2779 get_keyfile_hex(config, config_home, "styling", "character", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[7]);
2780 get_keyfile_hex(config, config_home, "styling", "literalstring", "0x008020", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[8]);
2781 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[9]);
2782 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[10]);
2783 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[11]);
2784 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_LUA].styling[12]);
2785 get_keyfile_hex(config, config_home, "styling", "function_basic", "0x991111", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[13]);
2786 get_keyfile_hex(config, config_home, "styling", "function_other", "0x690000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[14]);
2787 get_keyfile_hex(config, config_home, "styling", "coroutines", "0x66005c", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[15]);
2788 get_keyfile_hex(config, config_home, "styling", "word5", "0x7979ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[16]);
2789 get_keyfile_hex(config, config_home, "styling", "word6", "0xad00ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[17]);
2790 get_keyfile_hex(config, config_home, "styling", "word7", "0x03D000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[18]);
2791 get_keyfile_hex(config, config_home, "styling", "word8", "0xff7600", "0xffffff", "false", &style_sets[GEANY_FILETYPES_LUA].styling[19]);
2793 style_sets[GEANY_FILETYPES_LUA].keywords = g_new(gchar*, 9);
2794 get_keyfile_keywords(config, config_home, "keywords", "keywords", GEANY_FILETYPES_LUA, 0,
2795 "and break do else elseif end false for function if \
2796 in local nil not or repeat return then true until while");
2797 get_keyfile_keywords(config, config_home, "keywords", "function_basic", GEANY_FILETYPES_LUA, 1,
2798 "_VERSION assert collectgarbage dofile error gcinfo loadfile loadstring \
2799 print rawget rawset require tonumber tostring type unpack \
2800 _ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT \
2801 _STDERR _STDIN _STDOUT call dostring foreach foreachi getn globals newtype \
2802 sort tinsert tremove _G getfenv getmetatable ipairs loadlib next pairs pcall \
2803 rawequal setfenv setmetatable xpcall string table math coroutine io os debug \
2804 load module select");
2805 get_keyfile_keywords(config, config_home, "keywords", "function_other", GEANY_FILETYPES_LUA, 2,
2806 "abs acos asin atan atan2 ceil cos deg exp \
2807 floor format frexp gsub ldexp log log10 max min mod rad random randomseed \
2808 sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan \
2809 string.byte string.char string.dump string.find string.len \
2810 string.lower string.rep string.sub string.upper string.format string.gfind string.gsub \
2811 table.concat table.foreach table.foreachi table.getn table.sort table.insert table.remove table.setn \
2812 math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp \
2813 math.floor math.frexp math.ldexp math.log math.log10 math.max math.min math.mod \
2814 math.pi math.pow math.rad math.random math.randomseed math.sin math.sqrt math.tan \
2815 string.gmatch string.match string.reverse table.maxn \
2816 math.cosh math.fmod math.modf math.sinh math.tanh math.huge");
2817 get_keyfile_keywords(config, config_home, "keywords", "coroutines", GEANY_FILETYPES_LUA, 3,
2818 "openfile closefile readfrom writeto appendto remove rename flush seek tmpfile tmpname \
2819 read write clock date difftime execute exit getenv setlocale time coroutine.create \
2820 coroutine.resume coroutine.status coroutine.wrap coroutine.yield io.close io.flush \
2821 io.input io.lines io.open io.output io.read io.tmpfile io.type io.write io.stdin \
2822 io.stdout io.stderr os.clock os.date os.difftime os.execute os.exit os.getenv \
2823 os.remove os.rename os.setlocale os.time os.tmpname coroutine.running package.cpath \
2824 package.loaded package.loadlib package.path package.preload package.seeall io.popen");
2825 get_keyfile_keywords(config, config_home, "keywords", "user1", GEANY_FILETYPES_LUA, 4, "");
2826 get_keyfile_keywords(config, config_home, "keywords", "user2", GEANY_FILETYPES_LUA, 5, "");
2827 get_keyfile_keywords(config, config_home, "keywords", "user3", GEANY_FILETYPES_LUA, 6, "");
2828 get_keyfile_keywords(config, config_home, "keywords", "user4", GEANY_FILETYPES_LUA, 7, "");
2829 style_sets[GEANY_FILETYPES_LUA].keywords[8] = NULL;
2831 get_keyfile_wordchars(config, config_home,
2832 &style_sets[GEANY_FILETYPES_LUA].wordchars);
2836 static void styleset_lua(ScintillaObject *sci)
2838 const filetype_id ft_id = GEANY_FILETYPES_LUA;
2840 styleset_common(sci, 5, ft_id);
2842 apply_filetype_properties(sci, SCLEX_LUA, ft_id);
2844 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[0]);
2845 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[1]);
2846 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[2]);
2847 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[3]);
2848 SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[4]);
2849 SSM(sci, SCI_SETKEYWORDS, 5, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[5]);
2850 SSM(sci, SCI_SETKEYWORDS, 6, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[6]);
2851 SSM(sci, SCI_SETKEYWORDS, 7, (sptr_t) style_sets[GEANY_FILETYPES_LUA].keywords[7]);
2853 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_LUA, 0);
2854 set_sci_style(sci, SCE_LUA_DEFAULT, GEANY_FILETYPES_LUA, 0);
2855 set_sci_style(sci, SCE_LUA_COMMENT, GEANY_FILETYPES_LUA, 1);
2856 set_sci_style(sci, SCE_LUA_COMMENTLINE, GEANY_FILETYPES_LUA, 2);
2857 set_sci_style(sci, SCE_LUA_COMMENTDOC, GEANY_FILETYPES_LUA, 3);
2858 set_sci_style(sci, SCE_LUA_NUMBER, GEANY_FILETYPES_LUA, 4);
2859 set_sci_style(sci, SCE_LUA_WORD, GEANY_FILETYPES_LUA, 5);
2860 set_sci_style(sci, SCE_LUA_STRING, GEANY_FILETYPES_LUA, 6);
2861 set_sci_style(sci, SCE_LUA_CHARACTER, GEANY_FILETYPES_LUA, 7);
2862 set_sci_style(sci, SCE_LUA_LITERALSTRING, GEANY_FILETYPES_LUA, 8);
2863 set_sci_style(sci, SCE_LUA_PREPROCESSOR, GEANY_FILETYPES_LUA, 9);
2864 set_sci_style(sci, SCE_LUA_OPERATOR, GEANY_FILETYPES_LUA, 10);
2865 set_sci_style(sci, SCE_LUA_IDENTIFIER, GEANY_FILETYPES_LUA, 11);
2866 set_sci_style(sci, SCE_LUA_STRINGEOL, GEANY_FILETYPES_LUA, 12);
2867 set_sci_style(sci, SCE_LUA_WORD2, GEANY_FILETYPES_LUA, 13);
2868 set_sci_style(sci, SCE_LUA_WORD3, GEANY_FILETYPES_LUA, 14);
2869 set_sci_style(sci, SCE_LUA_WORD4, GEANY_FILETYPES_LUA, 15);
2870 set_sci_style(sci, SCE_LUA_WORD5, GEANY_FILETYPES_LUA, 16);
2871 set_sci_style(sci, SCE_LUA_WORD6, GEANY_FILETYPES_LUA, 17);
2872 set_sci_style(sci, SCE_LUA_WORD7, GEANY_FILETYPES_LUA, 18);
2873 set_sci_style(sci, SCE_LUA_WORD8, GEANY_FILETYPES_LUA, 19);
2877 static void styleset_basic_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2879 new_style_array(GEANY_FILETYPES_BASIC, 19);
2881 get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[0]);
2882 get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[1]);
2883 get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[2]);
2884 get_keyfile_hex(config, config_home, "styling", "word", "0x00007f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_BASIC].styling[3]);
2885 get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[4]);
2886 get_keyfile_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[5]);
2887 get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[6]);
2888 get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[7]);
2889 get_keyfile_hex(config, config_home, "styling", "date", "0x1a6500", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[8]);
2890 get_keyfile_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[9]);
2891 get_keyfile_hex(config, config_home, "styling", "word2", "0x007f7f", "0xffffff", "true", &style_sets[GEANY_FILETYPES_BASIC].styling[10]);
2892 get_keyfile_hex(config, config_home, "styling", "word3", "0x991111", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[11]);
2893 get_keyfile_hex(config, config_home, "styling", "word4", "0x0000d0", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[12]);
2894 get_keyfile_hex(config, config_home, "styling", "constant", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[13]);
2895 get_keyfile_hex(config, config_home, "styling", "asm", "0x105090", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[14]);
2896 get_keyfile_hex(config, config_home, "styling", "label", "0x007f7f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[15]);
2897 get_keyfile_hex(config, config_home, "styling", "error", "0xd00000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[16]);
2898 get_keyfile_hex(config, config_home, "styling", "hexnumber", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[17]);
2899 get_keyfile_hex(config, config_home, "styling", "binnumber", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_BASIC].styling[18]);
2901 style_sets[GEANY_FILETYPES_BASIC].keywords = g_new(gchar*, 5);
2902 get_keyfile_keywords(config, config_home, "keywords", "keywords", GEANY_FILETYPES_BASIC, 0,
2903 "as asm bit bitreset bitset byte case cint close cls color const \
2904 continue cshort csign csng cubyte cuint culngint custom data \
2905 dim do double else elseif end enum environ eof err error exec exit exp \
2906 export extern field fix for function get gosub goto hex hibyte hiword if iif imp \
2907 input instr int integer is kill left len let lobyte loc local locate lof log long \
2908 longint loop loword lset mklongint mks mkshort mod next not on once open or out \
2909 pointer pos preserve preset private public put read redim rem reset restore return \
2910 sizeof sleep space static step stop str string sub then time timer to type ubound \
2911 ubyte ucase uinteger ulongint union unsigned until ushort using val val64 valint \
2912 wait while with xor");
2913 get_keyfile_keywords(config, config_home, "keywords", "preprocessor", GEANY_FILETYPES_BASIC, 1,
2914 "#define defined #dynamic #else #endif #endmacro #error #if #ifdef #ifndef #inclib #include \
2915 #libpath #line #macro #print #undef");
2916 get_keyfile_keywords(config, config_home, "keywords", "user1", GEANY_FILETYPES_BASIC, 2, "");
2917 get_keyfile_keywords(config, config_home, "keywords", "user2", GEANY_FILETYPES_BASIC, 3, "");
2918 style_sets[GEANY_FILETYPES_BASIC].keywords[4] = NULL;
2920 get_keyfile_wordchars(config, config_home,
2921 &style_sets[GEANY_FILETYPES_BASIC].wordchars);
2925 static void styleset_basic(ScintillaObject *sci)
2927 const filetype_id ft_id = GEANY_FILETYPES_BASIC;
2929 styleset_common(sci, 5, ft_id);
2931 apply_filetype_properties(sci, SCLEX_FREEBASIC, ft_id);
2933 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_BASIC].keywords[0]);
2934 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_BASIC].keywords[1]);
2935 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_BASIC].keywords[2]);
2936 SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_BASIC].keywords[3]);
2938 set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_BASIC, 0);
2939 set_sci_style(sci, SCE_B_DEFAULT, GEANY_FILETYPES_BASIC, 0);
2940 set_sci_style(sci, SCE_B_COMMENT, GEANY_FILETYPES_BASIC, 1);
2941 set_sci_style(sci, SCE_B_NUMBER, GEANY_FILETYPES_BASIC, 2);
2942 set_sci_style(sci, SCE_B_KEYWORD, GEANY_FILETYPES_BASIC, 3);
2943 set_sci_style(sci, SCE_B_STRING, GEANY_FILETYPES_BASIC, 4);
2944 set_sci_style(sci, SCE_B_PREPROCESSOR, GEANY_FILETYPES_BASIC, 5);
2945 set_sci_style(sci, SCE_B_OPERATOR, GEANY_FILETYPES_BASIC, 6);
2946 set_sci_style(sci, SCE_B_IDENTIFIER, GEANY_FILETYPES_BASIC, 7);
2947 set_sci_style(sci, SCE_B_DATE, GEANY_FILETYPES_BASIC, 8);
2948 set_sci_style(sci, SCE_B_STRINGEOL, GEANY_FILETYPES_BASIC, 9);
2949 set_sci_style(sci, SCE_B_KEYWORD2, GEANY_FILETYPES_BASIC, 10);
2950 set_sci_style(sci, SCE_B_KEYWORD3, GEANY_FILETYPES_BASIC, 11);
2951 set_sci_style(sci, SCE_B_KEYWORD4, GEANY_FILETYPES_BASIC, 12);
2952 set_sci_style(sci, SCE_B_CONSTANT, GEANY_FILETYPES_BASIC, 13);
2953 set_sci_style(sci, SCE_B_ASM, GEANY_FILETYPES_BASIC, 14); /* (still?) unused by the lexer */
2954 set_sci_style(sci, SCE_B_LABEL, GEANY_FILETYPES_BASIC, 15);
2955 set_sci_style(sci, SCE_B_ERROR, GEANY_FILETYPES_BASIC, 16);
2956 set_sci_style(sci, SCE_B_HEXNUMBER, GEANY_FILETYPES_BASIC, 17);
2957 set_sci_style(sci, SCE_B_BINNUMBER, GEANY_FILETYPES_BASIC, 18);
2960 static void styleset_haxe_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
2962 new_style_array(GEANY_FILETYPES_HAXE, 20);
2963 styleset_c_like_init(config, config_home, GEANY_FILETYPES_HAXE);
2965 style_sets[GEANY_FILETYPES_HAXE].keywords = g_new(gchar*, 4);
2967 get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_HAXE, 0, "\
2968 abstract break case catch class \
2969 continue default do else enum external extends \
2970 finally float for function goto if implements import in \
2971 interface new package protected public \
2972 return static super switch this throw throws \
2973 try type var while");
2975 get_keyfile_keywords(config, config_home, "keywords", "secondary", GEANY_FILETYPES_HAXE, 1, "\
2976 Bool Enum Float Int Null Void Dynamic String");
2978 get_keyfile_keywords(config, config_home, "keywords", "classes", GEANY_FILETYPES_HAXE, 2, "\
2979 Array ArrayAccess Class Date DateTools \
2980 EReg Enum Hash IntHash IntIter \
2981 Iterable Iterator Lambda List Math Protected \
2982 Reflect Std StringBuf StringTools Type \
2983 UInt ValueType Void Xml XmlType");
2985 style_sets[GEANY_FILETYPES_HAXE].keywords[3] = NULL;
2987 get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_HAXE].wordchars);
2991 static void styleset_haxe(ScintillaObject *sci)
2993 const filetype_id ft_id = GEANY_FILETYPES_HAXE;
2995 styleset_common(sci, 5,ft_id);
2997 apply_filetype_properties(sci, SCLEX_CPP, ft_id);
2999 SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_HAXE].keywords[0]);
3000 SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_HAXE].keywords[1]);
3001 SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_HAXE].keywords[2]);
3003 styleset_c_like(sci, GEANY_FILETYPES_HAXE);
3007 /* lang_name is the name used for the styleset_foo_init function, e.g. foo. */
3008 #define init_styleset_case(ft_id, lang_name) \
3009 case (ft_id): \
3010 styleset_ ## lang_name ## _init(filetype_idx, config, configh); \
3011 break;
3013 /* Called by filetypes_load_config(). */
3014 void highlighting_init_styles(gint filetype_idx, GKeyFile *config, GKeyFile *configh)
3016 /* All stylesets depend on filetypes.common */
3017 if (filetype_idx != GEANY_FILETYPES_NONE)
3018 filetypes_load_config(GEANY_FILETYPES_NONE, FALSE);
3020 switch (filetype_idx)
3022 init_styleset_case(GEANY_FILETYPES_NONE, common);
3023 init_styleset_case(GEANY_FILETYPES_ASM, asm);
3024 init_styleset_case(GEANY_FILETYPES_BASIC, basic);
3025 init_styleset_case(GEANY_FILETYPES_C, c);
3026 init_styleset_case(GEANY_FILETYPES_CAML, caml);
3027 init_styleset_case(GEANY_FILETYPES_CONF, conf);
3028 init_styleset_case(GEANY_FILETYPES_CPP, cpp);
3029 init_styleset_case(GEANY_FILETYPES_CS, cs);
3030 init_styleset_case(GEANY_FILETYPES_CSS, css);
3031 init_styleset_case(GEANY_FILETYPES_D, d);
3032 init_styleset_case(GEANY_FILETYPES_DIFF, diff);
3033 init_styleset_case(GEANY_FILETYPES_DOCBOOK, docbook);
3034 init_styleset_case(GEANY_FILETYPES_FERITE, ferite);
3035 init_styleset_case(GEANY_FILETYPES_F77, f77);
3036 init_styleset_case(GEANY_FILETYPES_FORTRAN, fortran);
3037 init_styleset_case(GEANY_FILETYPES_GLSL, glsl);
3038 init_styleset_case(GEANY_FILETYPES_HASKELL, haskell);
3039 init_styleset_case(GEANY_FILETYPES_HAXE, haxe);
3040 init_styleset_case(GEANY_FILETYPES_HTML, html);
3041 init_styleset_case(GEANY_FILETYPES_JAVA, java);
3042 init_styleset_case(GEANY_FILETYPES_JS, js);
3043 init_styleset_case(GEANY_FILETYPES_LATEX, latex);
3044 init_styleset_case(GEANY_FILETYPES_LUA, lua);
3045 init_styleset_case(GEANY_FILETYPES_MAKE, makefile);
3046 init_styleset_case(GEANY_FILETYPES_OMS, oms);
3047 init_styleset_case(GEANY_FILETYPES_PASCAL, pascal);
3048 init_styleset_case(GEANY_FILETYPES_PERL, perl);
3049 init_styleset_case(GEANY_FILETYPES_PHP, php);
3050 init_styleset_case(GEANY_FILETYPES_PYTHON, python);
3051 init_styleset_case(GEANY_FILETYPES_RUBY, ruby);
3052 init_styleset_case(GEANY_FILETYPES_SH, sh);
3053 init_styleset_case(GEANY_FILETYPES_SQL, sql);
3054 init_styleset_case(GEANY_FILETYPES_TCL, tcl);
3055 init_styleset_case(GEANY_FILETYPES_VHDL, vhdl);
3056 init_styleset_case(GEANY_FILETYPES_XML, markup);
3061 /* lang_name is the name used for the styleset_foo function, e.g. foo. */
3062 #define styleset_case(ft_id, lang_name) \
3063 case (ft_id): \
3064 styleset_ ## lang_name (sci); \
3065 break;
3067 void highlighting_set_styles(ScintillaObject *sci, gint filetype_idx)
3069 filetypes_load_config(filetype_idx, FALSE); /* load filetypes.ext */
3071 /* load tags files (some lexers highlight global typenames) */
3072 if (filetype_idx < GEANY_FILETYPES_NONE)
3073 symbols_global_tags_loaded(filetype_idx);
3075 switch (filetype_idx)
3077 styleset_case(GEANY_FILETYPES_ASM, asm);
3078 styleset_case(GEANY_FILETYPES_BASIC, basic);
3079 styleset_case(GEANY_FILETYPES_C, c);
3080 styleset_case(GEANY_FILETYPES_CAML, caml);
3081 styleset_case(GEANY_FILETYPES_CONF, conf);
3082 styleset_case(GEANY_FILETYPES_CPP, cpp);
3083 styleset_case(GEANY_FILETYPES_CS, cs);
3084 styleset_case(GEANY_FILETYPES_CSS, css);
3085 styleset_case(GEANY_FILETYPES_D, d);
3086 styleset_case(GEANY_FILETYPES_DIFF, diff);
3087 styleset_case(GEANY_FILETYPES_DOCBOOK, docbook);
3088 styleset_case(GEANY_FILETYPES_FERITE, ferite);
3089 styleset_case(GEANY_FILETYPES_F77, f77);
3090 styleset_case(GEANY_FILETYPES_FORTRAN, fortran);
3091 styleset_case(GEANY_FILETYPES_GLSL, glsl);
3092 styleset_case(GEANY_FILETYPES_HASKELL, haskell);
3093 styleset_case(GEANY_FILETYPES_HAXE, haxe);
3094 styleset_case(GEANY_FILETYPES_HTML, html);
3095 styleset_case(GEANY_FILETYPES_JAVA, java);
3096 styleset_case(GEANY_FILETYPES_JS, js);
3097 styleset_case(GEANY_FILETYPES_LATEX, latex);
3098 styleset_case(GEANY_FILETYPES_LUA, lua);
3099 styleset_case(GEANY_FILETYPES_MAKE, makefile);
3100 styleset_case(GEANY_FILETYPES_OMS, oms);
3101 styleset_case(GEANY_FILETYPES_PASCAL, pascal);
3102 styleset_case(GEANY_FILETYPES_PERL, perl);
3103 styleset_case(GEANY_FILETYPES_PHP, php);
3104 styleset_case(GEANY_FILETYPES_PYTHON, python);
3105 styleset_case(GEANY_FILETYPES_RUBY, ruby);
3106 styleset_case(GEANY_FILETYPES_SH, sh);
3107 styleset_case(GEANY_FILETYPES_SQL, sql);
3108 styleset_case(GEANY_FILETYPES_TCL, tcl);
3109 styleset_case(GEANY_FILETYPES_VHDL, vhdl);
3110 styleset_case(GEANY_FILETYPES_XML, xml);
3111 default:
3112 styleset_case(GEANY_FILETYPES_NONE, none);
3117 /** Retrieve a style @a style_id for the filetype @a ft_id.
3118 * If the style was not already initialised
3119 * (e.g. by by opening a file of this type), it will be initialised. The returned pointer is
3120 * owned by Geany and must not be freed.
3121 * @param ft_id Filetype ID, e.g. @c GEANY_FILETYPES_DIFF.
3122 * @param style_id A Scintilla lexer style, e.g. @c SCE_DIFF_ADDED. See scintilla/include/SciLexer.h.
3123 * @return A pointer to the style struct.
3124 * @see Scintilla messages @c SCI_STYLEGETFORE, etc, for use with ScintillaFuncs::send_message(). */
3125 const GeanyLexerStyle *highlighting_get_style(gint ft_id, gint style_id)
3127 if (ft_id < 0 || ft_id > GEANY_MAX_BUILT_IN_FILETYPES)
3128 return NULL;
3130 /* ensure filetype loaded */
3131 filetypes_load_config(ft_id, FALSE);
3133 /* TODO: style_id might not be the real array index (Scintilla styles are not always synced
3134 * with array indices) */
3135 return get_style(ft_id, style_id);