Revision: 41891
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41891
Author:   blendix
Date:     2011-11-15 19:46:56 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
Fix #29208: Text.clear() and Text.write() did not redraw text editor.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/makesrna.c
    trunk/blender/source/blender/makesrna/intern/rna_text_api.c

Modified: trunk/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/makesrna.c     2011-11-15 
19:37:09 UTC (rev 41890)
+++ trunk/blender/source/blender/makesrna/intern/makesrna.c     2011-11-15 
19:46:56 UTC (rev 41891)
@@ -2481,7 +2481,7 @@
        {"rna_space.c", NULL, RNA_def_space},
        {"rna_speaker.c", NULL, RNA_def_speaker},
        {"rna_test.c", NULL, RNA_def_test},
-       {"rna_text.c", NULL, RNA_def_text},
+       {"rna_text.c", "rna_text_api.c", RNA_def_text},
        {"rna_timeline.c", NULL, RNA_def_timeline_marker},
        {"rna_sound.c", NULL, RNA_def_sound},
        {"rna_ui.c", "rna_ui_api.c", RNA_def_ui},

Modified: trunk/blender/source/blender/makesrna/intern/rna_text_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_text_api.c 2011-11-15 
19:37:09 UTC (rev 41890)
+++ trunk/blender/source/blender/makesrna/intern/rna_text_api.c 2011-11-15 
19:46:56 UTC (rev 41891)
@@ -28,11 +28,25 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-
 #include "RNA_define.h"
 
 #ifdef RNA_RUNTIME
 
+#include "WM_api.h"
+#include "WM_types.h"
+
+static void rna_Text_clear(Text *text)
+{
+       clear_text(text);
+       WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
+}
+
+static void rna_Text_write(Text *text, const char *str)
+{
+       write_text(text, str);
+       WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
+}
+
 #else
 
 void RNA_api_text(StructRNA *srna)
@@ -40,10 +54,10 @@
        FunctionRNA *func;
        PropertyRNA *prop;
 
-       func= RNA_def_function(srna, "clear", "clear_text");
+       func= RNA_def_function(srna, "clear", "rna_Text_clear");
        RNA_def_function_ui_description(func, "clear the text block");
 
-       func= RNA_def_function(srna, "write", "write_text");
+       func= RNA_def_function(srna, "write", "rna_Text_write");
        RNA_def_function_ui_description(func, "write text at the cursor 
location and advance to the end of the text block");
        prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this 
datablock");
        RNA_def_property_flag(prop, PROP_REQUIRED);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to