patch [#33609] Syntax highlighting for OSL in Text Editor
authorCampbell Barton <ideasman42@gmail.com>
Sat, 29 Dec 2012 18:25:03 +0000 (18:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 29 Dec 2012 18:25:03 +0000 (18:25 +0000)
from Patrick Boelens (senshi). with modifications to split it into its own function.

also added C style multi-line comment support /* ... */

I've left out the part of this patch that sets the language in the space, since I think this might be better stored in the text block.

For now it simply uses OSL syntax highlighting when the extension is '.osl'.

13 files changed:
doc/python_api/sphinx_doc_gen.py
source/blender/blenkernel/BKE_blender.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/resources.c
source/blender/editors/space_text/CMakeLists.txt
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_format.c
source/blender/editors/space_text/text_format.h
source/blender/editors/space_text/text_format_osl.c [new file with mode: 0644]
source/blender/makesdna/DNA_text_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 441a6c04efe795080a763c402bceb41209e153c9..af6ddac937ebb3b8310de2f2835e10737333d753 100644 (file)
@@ -612,6 +612,10 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
     '''
     function or class method to sphinx
     '''
+    
+    if type(py_func) == type(bpy.types.Space.draw_handler_add):
+        return
+    
     arg_str = inspect.formatargspec(*inspect.getargspec(py_func))
 
     if not is_class:
index 11759a82e60408354144e286793596b54e0e87ed..ecd38403d7211662a61d76f155eb6b5a619bcae8 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         265
-#define BLENDER_SUBVERSION      3
+#define BLENDER_SUBVERSION      4
 
 /* 262 was the last editmesh release but it has compatibility code for bmesh data */
 #define BLENDER_MINVERSION      262
index 119c26b2fd5016d0ef1edaa017ac461d75c9f398..a114981a700b69ad05069671cd29fce46eb27452 100644 (file)
@@ -122,8 +122,10 @@ enum {
 
        TH_SYNTAX_B,
        TH_SYNTAX_V,
+       TH_SYNTAX_R,
        TH_SYNTAX_C,
        TH_SYNTAX_L,
+       TH_SYNTAX_D,
        TH_SYNTAX_N,
        
        TH_BONE_SOLID,
index f605616dc504f91735e1e38e79440fbdf6d133c5..b078125612693e347ea15859af4b1b40360c6afc 100644 (file)
@@ -358,6 +358,10 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
                                        cp = ts->syntaxc; break;
                                case TH_SYNTAX_L:
                                        cp = ts->syntaxl; break;
+                               case TH_SYNTAX_D:
+                                       cp = ts->syntaxd; break;
+                               case TH_SYNTAX_R:
+                                       cp = ts->syntaxr; break;
                                case TH_SYNTAX_N:
                                        cp = ts->syntaxn; break;
 
@@ -880,10 +884,12 @@ void ui_theme_init_default(void)
        
        /* syntax highlighting */
        rgba_char_args_set(btheme->text.syntaxn,    0, 0, 200, 255);    /* Numbers  Blue*/
-       rgba_char_args_set(btheme->text.syntaxl,    100, 0, 0, 255);    /* Strings  red */
-       rgba_char_args_set(btheme->text.syntaxc,    0, 100, 50, 255);   /* Comments greenish */
-       rgba_char_args_set(btheme->text.syntaxv,    95, 95, 0, 255);    /* Special */
-       rgba_char_args_set(btheme->text.syntaxb,    128, 0, 80, 255);   /* Builtin, red-purple */
+       rgba_char_args_set(btheme->text.syntaxl,    100, 0, 0, 255);    /* Strings  Red */
+       rgba_char_args_set(btheme->text.syntaxc,    0, 100, 50, 255);   /* Comments  Greenish */
+       rgba_char_args_set(btheme->text.syntaxv,    95, 95, 0, 255);    /* Special  Yellow*/
+       rgba_char_args_set(btheme->text.syntaxd,    50, 0, 140, 255);   /* Decorator/Preprocessor Dir.  Blue-purple */
+       rgba_char_args_set(btheme->text.syntaxr,    140, 60, 0, 255);   /* Reserved  Orange*/
+       rgba_char_args_set(btheme->text.syntaxb,    128, 0, 80, 255);   /* Builtin  Red-purple */
        
        /* space oops */
        btheme->toops = btheme->tv3d;
@@ -2081,6 +2087,14 @@ void init_userdef_do_versions(void)
                        }
                }
        }
+
+       if (!MAIN_VERSION_ATLEAST(bmain, 266, 4)) {
+               bTheme *btheme;
+               for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+                       rgba_char_args_set(btheme->text.syntaxd,    50, 0, 140, 255);   /* Decorator/Preprocessor Dir.  Blue-purple */
+                       rgba_char_args_set(btheme->text.syntaxr,    140, 60, 0, 255);   /* Reserved  Orange */
+               }
+       }
        
        if (U.pixelsize == 0.0f)
                U.pixelsize = 1.0f;
index 6aaf42127795c1b36795e28cfac5ae7f9212ea3b..b9e4e2f0afa239e33a1dd6203d15b0775916ccb9 100644 (file)
@@ -38,6 +38,7 @@ set(SRC
        space_text.c
        text_draw.c
        text_format.c
+       text_format_osl.c
        text_format_py.c
        text_header.c
        text_ops.c
index 9ac66ca1698c4f592fa2ec37a8eac6d985140f1b..6ebadb3b921acaa9dfc06e75403f10dd9dac859b 100644 (file)
@@ -555,5 +555,6 @@ void ED_spacetype_text(void)
 
        /* register formatters */
        ED_text_format_register_py();
+       ED_text_format_register_osl();
 }
 
index 7d4c9e5af98119d1c67c1f35b15f829e03d72cf5..01df223630a3c6ec83426eeb2d1ea7a55a53c11b 100644 (file)
@@ -131,9 +131,15 @@ static void format_draw_color(char formatchar)
                case 'l': /* Strings */
                        UI_ThemeColor(TH_SYNTAX_L);
                        break;
+               case 'd': /* Preprocessor directive */
+                       UI_ThemeColor(TH_SYNTAX_D);
+                       break;
                case 'v': /* Specials: class, def */
                        UI_ThemeColor(TH_SYNTAX_V);
                        break;
+               case 'r': /* Reserved keywords */
+                       UI_ThemeColor(TH_SYNTAX_R);
+                       break;
                case 'b': /* Keywords: for, print, etc. */
                        UI_ThemeColor(TH_SYNTAX_B);
                        break;
index f7940fc7894c61bdbbf0c3f65d8b9d07eeaa6f0c..9a52cacb1f98be29db41784c7ee91bef7feaccc4 100644 (file)
@@ -147,10 +147,16 @@ void ED_text_format_register(TextFormatType *tft)
        BLI_addtail(&tft_lb, tft);
 }
 
-TextFormatType *ED_text_format_get(Text *UNUSED(text))
+TextFormatType *ED_text_format_get(Text *text)
 {
        /* NOTE: once more types are added we'll need to return some type based on 'text'
         * for now this function is more of a placeholder */
 
-       return tft_lb.first;
+       /* XXX, wrong, but OK for testing */
+       if (BLI_testextensie(text->id.name + 2, ".osl")) {
+               return tft_lb.last;
+       }
+       else {
+               return tft_lb.first;
+       }
 }
index 0e6c093757966eac6b8fab099e01fbd039cf07ba..dc7f35f8eafb51e978a04e69cf85f04b9b18388e 100644 (file)
@@ -60,7 +60,9 @@ typedef struct TextFormatType {
         *  '!'  Punctuation and other symbols
         *  'n'  Numerals
         *  'l'  String letters
+        *  'd'  Decorator / Preprocessor directive
         *  'v'  Special variables (class, def)
+        *  'r'  Reserved keywords currently not in use, but still prohibited (OSL -> switch e.g.)
         *  'b'  Built-in names (print, for, etc.)
         *  'q'  Other text (identifiers, etc.)
         * It is terminated with a null-terminator '\0' followed by a continuation
@@ -75,6 +77,7 @@ void            ED_text_format_register(TextFormatType *tft);
 
 /* formatters */
 void ED_text_format_register_py(void);
+void ED_text_format_register_osl(void);
 
 #define STR_LITERAL_STARTSWITH(str, str_literal, len_var) \
        (strncmp(str, str_literal, len_var = (sizeof(str_literal) - 1)) == 0)
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c
new file mode 100644 (file)
index 0000000..2d536ca
--- /dev/null
@@ -0,0 +1,331 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/editors/space_text/text_format_py.c
+ *  \ingroup sptext
+ */
+
+#include <string.h>
+
+#include "BLI_blenlib.h"
+
+#include "DNA_text_types.h"
+#include "DNA_space_types.h"
+
+#include "BKE_text.h"
+
+#include "text_format.h"
+
+/* *** Local Functions (for format_line) *** */
+
+static int txtfmt_osl_find_builtinfunc(const char *string)
+{
+       int i, len;
+       /* list is from...
+        * XXX - link to docs!
+        */
+       if      (STR_LITERAL_STARTSWITH(string, "break",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "closure",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "color",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "continue",     len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "do",           len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "else",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "emit",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "float",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "for",          len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "if",           len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "illuminance",  len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "illuminate",   len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "int",          len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "matrix",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "normal",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "output",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "point",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "public",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "return",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "string",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "struct",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "vector",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "void",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "while",        len)) i = len;
+       else                                                          i = 0;
+
+       /* If next source char is an identifier (eg. 'i' in "definate") no match */
+       if (i == 0 || text_check_identifier(string[i]))
+               return -1;
+       return i;
+}
+
+static int txtfmt_osl_find_reserved(const char *string)
+{
+       int i, len;
+       /* list is from...
+        * XXX - link to docs!
+        */
+       if      (STR_LITERAL_STARTSWITH(string, "bool",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "case",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "catch",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "char",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "const",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "delete",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "default",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "double",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "enum",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "extern",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "false",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "friend",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "goto",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "inline",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "long",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "new",          len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "operator",     len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "private",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "protected",    len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "short",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "signed",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "sizeof",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "static",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "switch",       len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "template",     len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "this",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "throw",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "true",         len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "try",          len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "typedef",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "uniform",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "union",        len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "unsigned",     len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "varying",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "virtual",      len)) i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "volatile",     len)) i = len;
+
+       /* If next source char is an identifier (eg. 'i' in "definate") no match */
+       if (i == 0 || text_check_identifier(string[i]))
+               return -1;
+       return i;
+}
+
+/* Checks the specified source string for a Python special name. This name must
+ * start at the beginning of the source string and must be followed by a non-
+ * identifier (see text_check_identifier(char)) or null character.
+ *
+ * If a special name is found, the length of the matching name is returned.
+ * Otherwise, -1 is returned. */
+
+static int txtfmt_osl_find_specialvar(const char *string)
+{
+       int i, len;
+
+       if      (STR_LITERAL_STARTSWITH(string, "shader", len)) i = len;
+       else                                                    i = 0;
+
+       /* If next source char is an identifier (eg. 'i' in "definate") no match */
+       if (i == 0 || text_check_identifier(string[i]))
+               return -1;
+       return i;
+}
+
+/* matches py 'txtfmt_osl_find_decorator' */
+static int txtfmt_osl_find_preprocessor(const char *string)
+{
+       if (string[0] == '#') {
+               int i = 1;
+               /* whitespace is ok '#  foo' */
+               while (string[i] == '\t' || string[i] == ' ') {
+                       i++;
+               }
+               while (text_check_identifier(string[i])) {
+                       i++;
+               }
+               return i;
+       }
+       return -1;
+}
+
+/* not in OSL, keep for now though */
+#if 0
+static int txtfmt_osl_find_bool(const char *string)
+{
+       int i, len;
+
+       if      (STR_LITERAL_STARTSWITH(string, "None",  len))  i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "True",  len))  i = len;
+       else if (STR_LITERAL_STARTSWITH(string, "False", len))  i = len;
+       else                                                    i = 0;
+
+       /* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */
+       if (i == 0 || text_check_identifier(string[i]))
+               return -1;
+       return i;
+}
+#endif
+
+static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_next)
+{
+       FlattenString fs;
+       const char *str;
+       char *fmt;
+       char orig, cont, find, prev = ' ';
+       int len, i;
+
+       /* Get continuation from previous line */
+       if (line->prev && line->prev->format != NULL) {
+               fmt = line->prev->format;
+               cont = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
+       }
+       else {
+               cont = 0;
+       }
+
+       /* Get original continuation from this line */
+       if (line->format != NULL) {
+               fmt = line->format;
+               orig = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
+       }
+       else {
+               orig = 0xFF;
+       }
+
+       len = flatten_string(st, &fs, line->line);
+       str = fs.buf;
+       if (!text_check_format_len(line, len)) {
+               flatten_string_free(&fs);
+               return;
+       }
+       fmt = line->format;
+
+       while (*str) {
+               /* Handle escape sequences by skipping both \ and next char */
+               if (*str == '\\') {
+                       *fmt = prev; fmt++; str++;
+                       if (*str == '\0') break;
+                       *fmt = prev; fmt++; str += BLI_str_utf8_size_safe(str);
+                       continue;
+               }
+               /* Handle continuations */
+               else if (cont) {
+                       /* C-Style comments */
+                       if (cont & TXT_CONT_COMMENT_CXX) {
+                               *fmt = '#';
+                       }
+                       else if (cont & TXT_CONT_COMMENT_C) {
+                               if (*str == '*' && *(str + 1) == '/') {
+                                       *fmt = '#'; fmt++; str++;
+                                       *fmt = '#';
+                                       cont = 0;
+                               }
+                               else {
+                                       *fmt = '#';
+                               }
+                               /* Handle other comments */
+                       }
+                       else {
+                               find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
+                               if (*str == find) cont = 0;
+                               *fmt = 'l';
+                       }
+
+                       str += BLI_str_utf8_size_safe(str) - 1;
+               }
+               /* Not in a string... */
+               else {
+                       /* Deal with comments first */
+                       if (*str == '/' && *(str + 1) == '/') {
+                               cont = TXT_CONT_COMMENT_CXX;
+                               *fmt = '#';
+                       }
+                       /* C-Style (multi-line) comments */
+                       else if (*str == '/' && *(str + 1) == '*') {
+                               cont = TXT_CONT_COMMENT_C;
+                               *fmt = '#'; fmt++; str++;
+                               *fmt = '#';
+                       }
+                       else if (*str == '"' || *str == '\'') {
+                               /* Strings */
+                               find = *str;
+                               cont = (*str == '"') ? TXT_DBLQUOTSTR : TXT_SNGQUOTSTR;
+                               *fmt = 'l';
+                       }
+                       /* Whitespace (all ws. has been converted to spaces) */
+                       else if (*str == ' ') {
+                               *fmt = '_';
+                       }
+                       /* Numbers (digits not part of an identifier and periods followed by digits) */
+                       else if ((prev != 'q' && text_check_digit(*str)) || (*str == '.' && text_check_digit(*(str + 1)))) {
+                               *fmt = 'n';
+                       }
+                       /* Punctuation */
+                       else if ((*str != '#') && text_check_delim(*str)) {
+                               *fmt = '!';
+                       }
+                       /* Identifiers and other text (no previous ws. or delims. so text continues) */
+                       else if (prev == 'q') {
+                               str += BLI_str_utf8_size_safe(str) - 1;
+                               *fmt = 'q';
+                       }
+                       /* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
+                       else {
+                               /* Special vars(v) or built-in keywords(b) */
+                               if      ((i = txtfmt_osl_find_specialvar(str))   != -1) prev = 'v';
+                               else if ((i = txtfmt_osl_find_builtinfunc(str))  != -1) prev = 'b';
+                               else if ((i = txtfmt_osl_find_reserved(str))     != -1) prev = 'r';
+                               else if ((i = txtfmt_osl_find_preprocessor(str)) != -1) prev = 'd';
+
+                               if (i > 0) {
+                                       memset(fmt, prev, i);
+                                       i--; fmt += i; str += i;
+                               }
+                               else {
+                                       str += BLI_str_utf8_size_safe(str) - 1;
+                                       *fmt = 'q';
+                               }
+                       }
+               }
+               prev = *fmt; fmt++; str++;
+       }
+
+       /* Terminate and add continuation char */
+       *fmt = '\0'; fmt++;
+       *fmt = cont;
+
+       /* If continuation has changed and we're allowed, process the next line */
+       if (cont != orig && do_next && line->next) {
+               txtfmt_osl_format_line(st, line->next, do_next);
+       }
+
+       flatten_string_free(&fs);
+}
+
+void ED_text_format_register_osl(void)
+{
+       static TextFormatType tft = {0};
+       static const char *ext[] = {"osl", NULL};
+
+       tft.format_line = txtfmt_osl_format_line;
+       tft.ext = ext;
+
+       ED_text_format_register(&tft);
+}
index 6ce883905d4b19483939a7676c4653e9b2108d3b..cd4e31c25214baa5d9efe60a9238c740913ed979 100644 (file)
@@ -82,5 +82,7 @@ typedef struct Text {
 #define TXT_TRISTR                             0x04 /* triplets of quotes: """ or ''' */
 #define TXT_SNGTRISTR                  0x05 /*(TXT_TRISTR | TXT_SNGQUOTSTR)*/
 #define TXT_DBLTRISTR                  0x06 /*(TXT_TRISTR | TXT_DBLQUOTSTR)*/
+#define TXT_CONT_COMMENT_C             0x08 /* multi-line comments, OSL only (C style) */
+#define TXT_CONT_COMMENT_CXX   0x10 /* single-line comments, OSL only (C++ style) */
 
 #endif
index 1dc25e0ab5e0733641fe57f38dbdb914b286dd77..530caeca910a37abbad2ec161d591ea7960ae689 100644 (file)
@@ -248,6 +248,7 @@ typedef struct ThemeSpace {
 
        char syntaxl[4], syntaxn[4], syntaxb[4]; /* syntax for textwindow and nodes */
        char syntaxv[4], syntaxc[4];
+       char syntaxd[4], syntaxr[4];
        
        char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];             /* for sequence editor */
        char effect[4], hpad0[4], transition[4], meta[4];
index 83076f3a9039b16b0773f97799d5e7140f62afa8..79d6a1d7d6b5e7d34c245b0df844a7bcec348a6c 100644 (file)
@@ -1639,7 +1639,19 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
        prop = RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
        RNA_def_property_float_sdna(prop, NULL, "syntaxv");
        RNA_def_property_array(prop, 3);
-       RNA_def_property_ui_text(prop, "Decorator", "");
+       RNA_def_property_ui_text(prop, "Syntax Special", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+       prop = RNA_def_property(srna, "syntax_preprocessor", PROP_FLOAT, PROP_COLOR_GAMMA);
+       RNA_def_property_float_sdna(prop, NULL, "syntaxd");
+       RNA_def_property_array(prop, 3);
+       RNA_def_property_ui_text(prop, "Syntax PreProcessor", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+       prop = RNA_def_property(srna, "syntax_reserved", PROP_FLOAT, PROP_COLOR_GAMMA);
+       RNA_def_property_float_sdna(prop, NULL, "syntaxr");
+       RNA_def_property_array(prop, 3);
+       RNA_def_property_ui_text(prop, "Syntax Reserved", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
        prop = RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);