Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_screen.c
| Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | static void rna_def_view2d_api(StructRNA *srna) | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| static const float view_default[2] = {0.0f, 0.0f}; | static const float view_default[2] = {0.0f, 0.0f}; | ||||
| static const int region_default[2] = {0.0f, 0.0f}; | static const int region_default[2] = {0.0f, 0.0f}; | ||||
| func = RNA_def_function(srna, "region_to_view", "rna_View2D_region_to_view"); | func = RNA_def_function(srna, "region_to_view", "rna_View2D_region_to_view"); | ||||
| RNA_def_function_ui_description(func, "Transform region coordinates to 2D view"); | RNA_def_function_ui_description(func, "Transform region coordinates to 2D view"); | ||||
| parm = RNA_def_int(func, "x", 0, INT_MIN, INT_MAX, "x", "Region x coordinate", -10000, 10000); | parm = RNA_def_int(func, "x", 0, INT_MIN, INT_MAX, "x", "Region x coordinate", -10000, 10000); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, "y", 0, INT_MIN, INT_MAX, "y", "Region y coordinate", -10000, 10000); | parm = RNA_def_int(func, "y", 0, INT_MIN, INT_MAX, "y", "Region y coordinate", -10000, 10000); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_float_array(func, "result", 2, view_default, -FLT_MAX, FLT_MAX, "Result", "View coordinates", -10000.0f, 10000.0f); | parm = RNA_def_float_array(func, "result", 2, view_default, -FLT_MAX, FLT_MAX, "Result", "View coordinates", -10000.0f, 10000.0f); | ||||
| RNA_def_property_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, parm); | RNA_def_function_output(func, parm); | ||||
| func = RNA_def_function(srna, "view_to_region", "rna_View2D_view_to_region"); | func = RNA_def_function(srna, "view_to_region", "rna_View2D_view_to_region"); | ||||
| RNA_def_function_ui_description(func, "Transform 2D view coordinates to region"); | RNA_def_function_ui_description(func, "Transform 2D view coordinates to region"); | ||||
| parm = RNA_def_float(func, "x", 0.0f, -FLT_MAX, FLT_MAX, "x", "2D View x coordinate", -10000.0f, 10000.0f); | parm = RNA_def_float(func, "x", 0.0f, -FLT_MAX, FLT_MAX, "x", "2D View x coordinate", -10000.0f, 10000.0f); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_float(func, "y", 0.0f, -FLT_MAX, FLT_MAX, "y", "2D View y coordinate", -10000.0f, 10000.0f); | parm = RNA_def_float(func, "y", 0.0f, -FLT_MAX, FLT_MAX, "y", "2D View y coordinate", -10000.0f, 10000.0f); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_boolean(func, "clip", 1, "Clip", "Clip coordinates to the visible region"); | RNA_def_boolean(func, "clip", 1, "Clip", "Clip coordinates to the visible region"); | ||||
| parm = RNA_def_int_array(func, "result", 2, region_default, INT_MIN, INT_MAX, "Result", "Region coordinates", -10000, 10000); | parm = RNA_def_int_array(func, "result", 2, region_default, INT_MIN, INT_MAX, "Result", "Region coordinates", -10000, 10000); | ||||
| RNA_def_property_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, parm); | RNA_def_function_output(func, parm); | ||||
| } | } | ||||
| static void rna_def_view2d(BlenderRNA *brna) | static void rna_def_view2d(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| /* PropertyRNA *prop; */ | /* PropertyRNA *prop; */ | ||||
| ▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines | |||||