From 59eaa9030098b7991c3a8bf01f56fe7f2cf0cd36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Sep 2018 05:59:28 +1000 Subject: Cleanup: move area API into own function --- source/blender/makesrna/intern/rna_screen.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 7ca26ab1c9f..0a997ca2163 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -209,11 +209,21 @@ static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area"); } +static void rna_def_area_api(StructRNA *srna) +{ + FunctionRNA *func; + + RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw"); + + func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint"); + RNA_def_function_ui_description(func, "Set the header text"); + RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text"); +} + static void rna_def_area(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - FunctionRNA *func; srna = RNA_def_struct(brna, "Area", NULL); RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor"); @@ -267,11 +277,7 @@ static void rna_def_area(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Height", "Area height"); - RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw"); - - func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint"); - RNA_def_function_ui_description(func, "Set the header text"); - RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text"); + rna_def_area_api(srna); } static void rna_def_view2d_api(StructRNA *srna) -- cgit v1.2.3