Kaydet (Commit) 17bbfa36 authored tarafından Nick Treleaven's avatar Nick Treleaven

Add filetypes_get_conf_extension() and use in highlighting.c.

Fix a memory leak in load_keyfiles().
Group C-like default syntax in init_c_like_styleset().
Make C-like comment colour darker; make globalclass brighter to
distinguish it from word colour.
Make Java use same default syntax highlighting colours as C.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@936 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 2857094e
2006-10-27 Nick Treleaven <nick.treleaven@btinternet.com>
* src/highlighting.c, src/filetypes.c, src/filetypes.h,
data/filetypes.java, data/filetypes.cpp, data/filetypes.ferite,
data/filetypes.c, data/filetypes.d:
Add filetypes_get_conf_extension() and use in highlighting.c.
Fix a memory leak in load_keyfiles().
Group C-like default syntax in init_c_like_styleset().
Make C-like comment colour darker; make globalclass brighter to
distinguish it from word colour.
Make Java use same default syntax highlighting colours as C.
2006-10-26 Nick Treleaven <nick.treleaven@btinternet.com> 2006-10-26 Nick Treleaven <nick.treleaven@btinternet.com>
* src/keybindings.c, src/keybindings.h: * src/keybindings.c, src/keybindings.h:
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
[styling] [styling]
# foreground;background;bold;italic # foreground;background;bold;italic
default=0x000000;0xffffff;false;false default=0x000000;0xffffff;false;false
comment=0xff0000;0xffffff;false;false comment=0xd00000;0xffffff;false;false
commentline=0xff0000;0xffffff;false;false commentline=0xd00000;0xffffff;false;false
commentdoc=0xff0000;0xffffff;false;false commentdoc=0xd00000;0xffffff;false;false
number=0x007f00;0xffffff;false;false number=0x007f00;0xffffff;false;false
word=0x00007f;0xffffff;true;false word=0x00007f;0xffffff;true;false
word2=0x991111;0xffffff;true;false word2=0x991111;0xffffff;true;false
...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false ...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false
stringeol=0x000000;0xe0c0e0;false;false stringeol=0x000000;0xe0c0e0;false;false
verbatim=0x101030;0xffffff;false;false verbatim=0x101030;0xffffff;false;false
regex=0x105090;0xffffff;false;false regex=0x105090;0xffffff;false;false
commentlinedoc=0xff0000;0xffffff;true;false commentlinedoc=0xd00000;0xffffff;true;false
commentdockeyword=0xff0000;0xffffff;true;true commentdockeyword=0xd00000;0xffffff;true;true
globalclass=0x1111bb;0xffffff;true;false globalclass=0x0000d0;0xffffff;true;false
# whether arguments of preprocessor commands should be styled (only first argument is used) # whether arguments of preprocessor commands should be styled (only first argument is used)
# 1 to enable, 0 to disable # 1 to enable, 0 to disable
styling_within_preprocessor=1;0;false;false styling_within_preprocessor=1;0;false;false
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
[styling] [styling]
# foreground;background;bold;italic # foreground;background;bold;italic
default=0x000000;0xffffff;false;false default=0x000000;0xffffff;false;false
comment=0xff0000;0xffffff;false;false comment=0xd00000;0xffffff;false;false
commentline=0xff0000;0xffffff;false;false commentline=0xd00000;0xffffff;false;false
commentdoc=0xff0000;0xffffff;false;false commentdoc=0xd00000;0xffffff;false;false
number=0x007f00;0xffffff;false;false number=0x007f00;0xffffff;false;false
word=0x00007f;0xffffff;true;false word=0x00007f;0xffffff;true;false
word2=0x991111;0xffffff;true;false word2=0x991111;0xffffff;true;false
...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false ...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false
stringeol=0x000000;0xe0c0e0;false;false stringeol=0x000000;0xe0c0e0;false;false
verbatim=0x101030;0xffffff;false;false verbatim=0x101030;0xffffff;false;false
regex=0x105090;0xffffff;false;false regex=0x105090;0xffffff;false;false
commentlinedoc=0xff0000;0xffffff;true;false commentlinedoc=0xd00000;0xffffff;true;false
commentdockeyword=0xff0000;0xffffff;true;true commentdockeyword=0xd00000;0xffffff;true;true
globalclass=0x1111bb;0xffffff;true;false globalclass=0x0000d0;0xffffff;true;false
# whether arguments of preprocessor commands should be styled (only first argument is used) # whether arguments of preprocessor commands should be styled (only first argument is used)
# 1 to enable, 0 to disable # 1 to enable, 0 to disable
styling_within_preprocessor=1;0;false;false styling_within_preprocessor=1;0;false;false
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
[styling] [styling]
# foreground;background;bold;italic # foreground;background;bold;italic
default=0x000000;0xffffff;false;false default=0x000000;0xffffff;false;false
comment=0xff0000;0xffffff;false;false comment=0xd00000;0xffffff;false;false
commentline=0xff0000;0xffffff;false;false commentline=0xd00000;0xffffff;false;false
commentdoc=0xff0000;0xffffff;false;false commentdoc=0xd00000;0xffffff;false;false
number=0x007f00;0xffffff;false;false number=0x007f00;0xffffff;false;false
word=0x111199;0xffffff;true;false word=0x111199;0xffffff;true;false
word2=0x7f0000;0xffffff;true;false word2=0x7f0000;0xffffff;true;false
...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false ...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false
stringeol=0x000000;0xe0c0e0;false;false stringeol=0x000000;0xe0c0e0;false;false
verbatim=0x301010;0xffffff;false;false verbatim=0x301010;0xffffff;false;false
regex=0x105090;0xffffff;false;false regex=0x105090;0xffffff;false;false
commentlinedoc=0xff0000;0xffffff;true;false commentlinedoc=0xd00000;0xffffff;true;false
commentdockeyword=0xff0000;0xffffff;true;true commentdockeyword=0xd00000;0xffffff;true;true
globalclass=0x1111bb;0xffffff;true;false globalclass=0x0000d0;0xffffff;true;false
# whether arguments of preprocessor commands should be styled (only first argument is used) # whether arguments of preprocessor commands should be styled (only first argument is used)
# 1 to enable, 0 to disable # 1 to enable, 0 to disable
styling_within_preprocessor=1;0;false;false styling_within_preprocessor=1;0;false;false
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
[styling] [styling]
# foreground;background;bold;italic # foreground;background;bold;italic
default=0x000000;0xffffff;false;false default=0x000000;0xffffff;false;false
comment=0xff0000;0xffffff;false;false comment=0xd00000;0xffffff;false;false
commentline=0xff0000;0xffffff;false;false commentline=0xd00000;0xffffff;false;false
commentdoc=0xff0000;0xffffff;false;false commentdoc=0xd00000;0xffffff;false;false
number=0x007f00;0xffffff;false;false number=0x007f00;0xffffff;false;false
word=0x00007f;0xffffff;true;false word=0x00007f;0xffffff;true;false
word2=0x991111;0xffffff;true;false word2=0x991111;0xffffff;true;false
...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false ...@@ -17,9 +17,9 @@ identifier=0x000000;0xffffff;false;false
stringeol=0x000000;0xe0c0e0;false;false stringeol=0x000000;0xe0c0e0;false;false
verbatim=0x101030;0xffffff;false;false verbatim=0x101030;0xffffff;false;false
regex=0x105090;0xffffff;false;false regex=0x105090;0xffffff;false;false
commentlinedoc=0xff0000;0xffffff;true;false commentlinedoc=0xd00000;0xffffff;true;false
commentdockeyword=0xff0000;0xffffff;true;true commentdockeyword=0xd00000;0xffffff;true;true
globalclass=0x1111bb;0xffffff;true;false globalclass=0x0000d0;0xffffff;true;false
[keywords] [keywords]
# all items must be in one line # all items must be in one line
......
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
[styling] [styling]
# foreground;background;bold;italic # foreground;background;bold;italic
default=0x000000;0xffffff;false;false default=0x000000;0xffffff;false;false
comment=0xff0000;0xffffff;false;false comment=0xd00000;0xffffff;false;false
commentline=0xff0000;0xffffff;false;false commentline=0xd00000;0xffffff;false;false
commentdoc=0xff0000;0xffffff;false;false commentdoc=0xd00000;0xffffff;false;false
number=0x007f00;0xffffff;false;false number=0x007f00;0xffffff;false;false
word=0x111199;0xffffff;true;false word=0x00007f;0xffffff;true;false
word2=0x7f0000;0xffffff;true;false word2=0x991111;0xffffff;true;false
string=0xff901e;0xffffff;false;false string=0xff901e;0xffffff;false;false
character=0xff901e;0xffffff;false;false character=0xff901e;0xffffff;false;false
uuid=0x404080;0xffffff;false;false uuid=0x404080;0xffffff;false;false
preprocessor=0x007f7f;0xffffff;false;false preprocessor=0x007F7F;0xffffff;false;false
operator=0x301010;0xffffff;false;false operator=0x301010;0xffffff;false;false
identifier=0x404000;0xffffff;false;false identifier=0x000000;0xffffff;false;false
stringeol=0x000000;0xe0c0e0;false;false stringeol=0x000000;0xe0c0e0;false;false
verbatim=0x406090;0x0000ff;false;false verbatim=0x101030;0xffffff;false;false
regex=0x905010;0xffffff;false;false regex=0x105090;0xffffff;false;false
commentlinedoc=0xff0000;0xffffff;true;true commentlinedoc=0xd00000;0xffffff;true;false
commentdockeyword=0xff0000;0xffffff;true;true commentdockeyword=0xd00000;0xffffff;true;true
globalclass=0x409010;0xffffff;true;false globalclass=0x0000d0;0xffffff;true;false
[keywords] [keywords]
primary=abstract assert break case catch class const continue default do else extends final finally for future generic goto if implements import inner instanceof interface native new outer package private protected public rest return static super switch synchronized this throw throws transient try var volatile while primary=abstract assert break case catch class const continue default do else extends final finally for future generic goto if implements import inner instanceof interface native new outer package private protected public rest return static super switch synchronized this throw throws transient try var volatile while
......
...@@ -968,12 +968,13 @@ void filetypes_get_config(GKeyFile *config, GKeyFile *configh, gint ft) ...@@ -968,12 +968,13 @@ void filetypes_get_config(GKeyFile *config, GKeyFile *configh, gint ft)
} }
static gchar *get_conf_extension(gint filetype_idx) gchar *filetypes_get_conf_extension(gint filetype_idx)
{ {
gchar *result, *tmp = g_strdup(filetypes[filetype_idx]->name); gchar *result, *tmp = g_strdup(filetypes[filetype_idx]->name);
switch (filetype_idx) switch (filetype_idx)
{ {
case GEANY_FILETYPES_ALL: result = g_strdup("common"); break;
case GEANY_FILETYPES_CPP: result = g_strdup("cpp"); break; case GEANY_FILETYPES_CPP: result = g_strdup("cpp"); break;
case GEANY_FILETYPES_MAKE: result = g_strdup("makefile"); break; case GEANY_FILETYPES_MAKE: result = g_strdup("makefile"); break;
case GEANY_FILETYPES_OMS: result = g_strdup("oms"); break; case GEANY_FILETYPES_OMS: result = g_strdup("oms"); break;
...@@ -998,7 +999,7 @@ void filetypes_save_commands() ...@@ -998,7 +999,7 @@ void filetypes_save_commands()
if (! bp->modified) continue; if (! bp->modified) continue;
ext = get_conf_extension(i); ext = filetypes_get_conf_extension(i);
fname = g_strconcat(conf_prefix, ext, NULL); fname = g_strconcat(conf_prefix, ext, NULL);
g_free(ext); g_free(ext);
......
...@@ -133,4 +133,6 @@ void filetypes_select_radio_item(const filetype *ft); ...@@ -133,4 +133,6 @@ void filetypes_select_radio_item(const filetype *ft);
GtkFileFilter *filetypes_create_file_filter(filetype *ft); GtkFileFilter *filetypes_create_file_filter(filetype *ft);
gchar *filetypes_get_conf_extension(gint filetype_idx);
#endif #endif
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment