diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-15 23:46:56 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-15 23:46:56 +0400 |
commit | 4c12550fe89a6a14ae246c37a97626c1b55c2b19 (patch) | |
tree | 7ef62e8cb93ccd5ff72e5e2a150b0e75cc14db9a /source/blender/makesrna/intern | |
parent | 4f743dd0cc9e2a229402f08905c01ec248a038bf (diff) |
Fix #29208: Text.clear() and Text.write() did not redraw text editor.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_text_api.c | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index a464948c3ac..6dbf7b9c553 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2481,7 +2481,7 @@ static RNAProcessItem PROCESS_ITEMS[]= { {"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}, diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c index ec669b28918..acfcad80f19 100644 --- a/source/blender/makesrna/intern/rna_text_api.c +++ b/source/blender/makesrna/intern/rna_text_api.c @@ -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 @@ void RNA_api_text(StructRNA *srna) 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); |