Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-05-13 20:11:28 +0400
committerTon Roosendaal <ton@blender.org>2005-05-13 20:11:28 +0400
commit2d6481c41c446ba3cc3f635944990d1b1927974f (patch)
tree68e4dba9c8868323a48073a78ebda5752e0c138b /source/blender/src/resources.c
parentec2cbb268906faf81c4808ede188d9ecf9bf4129 (diff)
TextEditor: syntax color support.
Patch provided by Ricki Myers. Works quite obvious, see Theme editor too! Notes about the provided code; - The default syntax colors were screaming! Toned it down to match the default dark on lightgrey background better. - Added: initializing colors in saved themes (usiblender.c) - The implementation of the button for this option was quite clumsy... Blender UI options services this a lot easier. (Same fixed for 'line numbers' option) - Bracket matching now uses as color a mix of backdrop and the selected-text color. Noticed my texteditor did it too... -> I really miss comments in code describing a little bit the thought process behind the code. Like a short introduction on this feature in the top of the drawtext.c, little remarks on new functions. ALso in patch tracker or the mailinglist no docs was mentioned? -> drawtext.c now gets messy quickly... lack of overview, structure, and confusing mix of personal coding styles. For not-active supported code dangerous...
Diffstat (limited to 'source/blender/src/resources.c')
-rw-r--r--source/blender/src/resources.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c
index 20c6262a522..c6f3d6c8ec4 100644
--- a/source/blender/src/resources.c
+++ b/source/blender/src/resources.c
@@ -509,8 +509,17 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
cp= &ts->facedot_size; break;
case TH_NORMAL:
cp= ts->normal; break;
- case TH_BRACKET:
- cp= ts->bracket; break;
+
+ case TH_SYNTAX_B:
+ cp= ts->syntaxb; break;
+ case TH_SYNTAX_V:
+ cp= ts->syntaxv; break;
+ case TH_SYNTAX_C:
+ cp= ts->syntaxc; break;
+ case TH_SYNTAX_L:
+ cp= ts->syntaxl; break;
+ case TH_SYNTAX_N:
+ cp= ts->syntaxn; break;
}
@@ -672,8 +681,12 @@ void BIF_InitTheme(void)
SETCOL(btheme->text.shade2, 0xc6, 0x77, 0x77, 255);
SETCOL(btheme->text.hilite, 255, 0, 0, 255);
- /* Bracket matching */
- SETCOL(btheme->text.bracket, 0xff, 0xff, 0x0, 100);
+ /* syntax highlighting */
+ SETCOL(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
+ SETCOL(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
+ SETCOL(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
+ SETCOL(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
+ SETCOL(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
/* space oops */
btheme->toops= btheme->tv3d;
@@ -803,7 +816,11 @@ char *BIF_ThemeColorsPup(int spacetype)
sprintf(str, "Selected Text %%x%d|", TH_SHADE2); strcat(cp, str);
sprintf(str, "Cursor %%x%d|", TH_HILITE); strcat(cp, str);
strcat(cp,"%l|");
- sprintf(str, "Bracket Matching %%x%d|", TH_BRACKET); strcat(cp, str);
+ sprintf(str, "Syntax Builtin %%x%d|", TH_SYNTAX_B); strcat(cp, str);
+ sprintf(str, "Syntax Special %%x%d|", TH_SYNTAX_V); strcat(cp, str);
+ sprintf(str, "Syntax Comment %%x%d|", TH_SYNTAX_C); strcat(cp, str);
+ sprintf(str, "Syntax Strings %%x%d|", TH_SYNTAX_L); strcat(cp, str);
+ sprintf(str, "Syntax Numbers %%x%d|", TH_SYNTAX_N); strcat(cp, str);
}
else if(spacetype==SPACE_TIME) {
sprintf(str, "Grid %%x%d|", TH_GRID); strcat(cp, str);