36static void rna_WorkSpaceTool_setup(
ID *
id,
43 const char *gizmo_group,
45 const char *data_block,
46 const char *op_idname,
49 const char *idname_fallback,
50 const char *keymap_fallback)
55 STRNCPY(tref_rt.keymap, keymap);
56 STRNCPY(tref_rt.gizmo_group, gizmo_group);
57 STRNCPY(tref_rt.data_block, data_block);
59 tref_rt.brush_type = brush_type;
60 tref_rt.index =
index;
65 STRNCPY(tref->idname_fallback, idname_fallback);
66 STRNCPY(tref_rt.keymap_fallback, keymap_fallback);
71static void rna_WorkSpaceTool_refresh_from_context(
ID *
id,
bToolRef *tref,
Main *bmain)
97 if (gzgt !=
nullptr) {
118 func =
RNA_def_function(srna,
"status_text_set_internal",
"ED_workspace_status_text");
121 func,
"Set the status bar text, typically key shortcuts for modal operators");
123 func,
"text",
nullptr, 0,
"Text",
"New string for the status bar, None clears the text");
139 "Allow this tool to use brushes via the asset system"},
140 {0,
nullptr, 0,
nullptr,
nullptr},
169 func =
RNA_def_function(srna,
"operator_properties",
"rna_WorkSpaceTool_operator_properties");
180 srna,
"gizmo_group_properties",
"rna_WorkSpaceTool_gizmo_group_properties");
185 parm =
RNA_def_pointer(func,
"result",
"GizmoGroupProperties",
"",
"");
189 func =
RNA_def_function(srna,
"refresh_from_context",
"rna_WorkSpaceTool_refresh_from_context");
CCL_NAMESPACE_BEGIN struct Options options
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
char * STRNCPY(char(&dst)[N], const char *src)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
wmGizmoGroupType * WM_gizmogrouptype_find(const StringRef idname, bool quiet)
@ TOOLREF_FLAG_USE_BRUSHES
@ TOOLREF_FLAG_FALLBACK_KEYMAP
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_api_workspace(StructRNA *srna)
const EnumPropertyItem rna_enum_window_cursor_items[]
void WM_toolsystem_ref_set_from_runtime(bContext *C, WorkSpace *workspace, bToolRef *tref, const bToolRef_Runtime *tref_rt, const char *idname)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_api_workspace_tool(StructRNA *srna)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void WM_toolsystem_ref_sync_from_context(Main *bmain, WorkSpace *workspace, bToolRef *tref)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)