Blender V5.3
rna_workspace.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "RNA_define.hh"
10#include "RNA_enum_types.hh"
11#include "RNA_types.hh"
12
13#include "WM_api.hh"
14#include "WM_types.hh"
15
16#include "rna_internal.hh"
17
18#include "DNA_workspace_types.h"
19
20#ifdef RNA_RUNTIME
21
22# include "BLI_listbase.hh"
23# include "BLI_string.hh"
24
25# include "BKE_global.hh"
26# include "BKE_paint.hh"
27# include "BKE_paint_types.hh"
28# include "BKE_report.hh"
29# include "BKE_workspace.hh"
30
31# include "DNA_screen_types.h"
32# include "DNA_space_types.h"
33
34# include "ED_asset.hh"
35# include "ED_paint.hh"
36# include "ED_sequencer.hh"
37
38# include "RNA_access.hh"
39
40# include "WM_toolsystem.hh"
41
42namespace blender {
43
44static void rna_window_update_all(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
45{
47}
48
49void rna_workspace_screens_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
50{
51 WorkSpace *workspace = id_cast<WorkSpace *>(ptr->owner_id);
52 rna_iterator_listbase_begin(iter, ptr, &workspace->layouts, nullptr);
53}
54
55static PointerRNA rna_workspace_screens_item_get(CollectionPropertyIterator *iter)
56{
57 WorkSpaceLayout *layout = static_cast<WorkSpaceLayout *>(rna_iterator_listbase_get(iter));
59
60 return RNA_id_pointer_create(reinterpret_cast<ID *>(screen));
61}
62
63/* workspace.owner_ids */
64
65static wmOwnerID *rna_WorkSpace_owner_ids_new(WorkSpace *workspace, const char *name)
66{
67 wmOwnerID *owner_id = MEM_new<wmOwnerID>(__func__);
68 BLI_addtail(&workspace->owner_ids, owner_id);
69 STRNCPY(owner_id->name, name);
71 return owner_id;
72}
73
74static void rna_WorkSpace_owner_ids_remove(WorkSpace *workspace,
75 ReportList *reports,
76 PointerRNA *wstag_ptr)
77{
78 wmOwnerID *owner_id = static_cast<wmOwnerID *>(wstag_ptr->data);
79 if (BLI_remlink_safe(&workspace->owner_ids, owner_id) == false) {
80 BKE_reportf(reports,
82 "wmOwnerID '%s' not in workspace '%s'",
83 owner_id->name,
84 workspace->id.name + 2);
85 return;
86 }
87
88 MEM_delete(owner_id);
89 wstag_ptr->invalidate();
90
92}
93
94static void rna_WorkSpace_owner_ids_clear(WorkSpace *workspace)
95{
96 workspace->owner_ids.free_no_destruct();
98}
99
100static int rna_WorkSpace_asset_library_get(PointerRNA *ptr)
101{
102 const WorkSpace *workspace = static_cast<WorkSpace *>(ptr->data);
103 return ed::asset::library_reference_to_enum_value(&workspace->asset_library_ref);
104}
105
106static void rna_WorkSpace_asset_library_set(PointerRNA *ptr, int value)
107{
108 WorkSpace *workspace = static_cast<WorkSpace *>(ptr->data);
110}
111
112static bToolRef *rna_WorkSpace_tools_from_tkey(WorkSpace *workspace,
113 const bToolKey *tkey,
114 bool create)
115{
116 if (create) {
117 bToolRef *tref;
118 WM_toolsystem_ref_ensure(workspace, tkey, &tref);
119 return tref;
120 }
121 return WM_toolsystem_ref_find(workspace, tkey);
122}
123
124static bToolRef *rna_WorkSpace_tools_from_space_view3d_mode(WorkSpace *workspace,
125 int mode,
126 bool create)
127{
128 bToolKey key{};
130 key.mode = mode;
131 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
132}
133
134static bToolRef *rna_WorkSpace_tools_from_space_image_mode(WorkSpace *workspace,
135 int mode,
136 bool create)
137{
138 bToolKey key{};
140 key.mode = mode;
141 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
142}
143
144static bToolRef *rna_WorkSpace_tools_from_space_node(WorkSpace *workspace, bool create)
145{
146 bToolKey key{};
148 key.mode = 0;
149 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
150}
151static bToolRef *rna_WorkSpace_tools_from_space_sequencer(WorkSpace *workspace,
152 int mode,
153 bool create)
154{
155 bToolKey key{};
156 key.space_type = SPACE_SEQ;
157 key.mode = mode;
158 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
159}
160const EnumPropertyItem *rna_WorkSpace_tools_mode_itemf(bContext * /*C*/,
161 PointerRNA *ptr,
162 PropertyRNA * /*prop*/,
163 bool * /*r_free*/)
164{
165 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
166 switch (tref->space_type) {
167 case SPACE_VIEW3D:
169 case SPACE_IMAGE:
171 case SPACE_SEQ:
173 }
175}
176
177static bool rna_WorkSpaceTool_use_paint_canvas_get(PointerRNA *ptr)
178{
179 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
180 return ED_paint_brush_type_use_canvas(nullptr, tref);
181}
182
183static int rna_WorkSpaceTool_index_get(PointerRNA *ptr)
184{
185 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
186 return (tref->runtime) ? tref->runtime->index : 0;
187}
188
189static bool rna_WorkSpaceTool_has_datablock_get(PointerRNA *ptr)
190{
191 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
192 return (tref->runtime) ? (tref->runtime->data_block[0] != '\0') : false;
193}
194
195static bool rna_WorkSpaceTool_use_brushes_get(PointerRNA *ptr)
196{
197 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
198 return (tref->runtime) ? ((tref->runtime->flag & TOOLREF_FLAG_USE_BRUSHES) != 0) : false;
199}
200
201static int rna_WorkSpaceTool_brush_type_get(PointerRNA *ptr)
202{
203 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
204 return tref->runtime ? tref->runtime->brush_type : -1;
205}
206
208 PointerRNA *ptr,
209 PropertyRNA * /*prop*/,
210 bool *r_free)
211{
212
213 PaintMode paint_mode = [&]() {
214 if (ptr->type == RNA_WorkSpaceTool) {
215 const bToolRef *tref = static_cast<bToolRef *>(ptr->data);
216 return BKE_paintmode_get_from_tool(tref);
217 }
219 }();
220
221 EnumPropertyItem *items = nullptr;
222 int totitem = 0;
223
224 EnumPropertyItem unset_item = {
225 -1, "ANY", 0, "Any", "Do not limit this tool to a specific brush type"};
226 RNA_enum_item_add(&items, &totitem, &unset_item);
227
228 if (paint_mode != PaintMode::Invalid) {
229 const EnumPropertyItem *valid_items = BKE_paint_get_tool_enum_from_paintmode(paint_mode);
230 RNA_enum_items_add(&items, &totitem, valid_items);
231 }
232
233 RNA_enum_item_end(&items, &totitem);
234
235 *r_free = true;
236 return items;
237}
238
239static void rna_WorkSpaceTool_widget_get(PointerRNA *ptr, char *value)
240{
241 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
242 strcpy(value, tref->runtime ? tref->runtime->gizmo_group : "");
243}
244
245static int rna_WorkSpaceTool_widget_length(PointerRNA *ptr)
246{
247 bToolRef *tref = static_cast<bToolRef *>(ptr->data);
248 return tref->runtime ? strlen(tref->runtime->gizmo_group) : 0;
249}
250
251static void rna_workspace_sync_scene_time_update(bContext *C, PointerRNA * /*ptr*/)
252{
254}
255
256} // namespace blender
257
258#else /* RNA_RUNTIME */
259
260namespace blender {
261
263{
264 StructRNA *srna;
265 PropertyRNA *prop;
266
267 srna = RNA_def_struct(brna, "wmOwnerID", nullptr);
268 RNA_def_struct_sdna(srna, "wmOwnerID");
269 RNA_def_struct_ui_text(srna, "Work Space UI Tag", "");
270
271 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
272 RNA_def_property_ui_text(prop, "Name", "");
274}
275
277{
278 StructRNA *srna;
279
280 FunctionRNA *func;
281 PropertyRNA *parm;
282
283 RNA_def_property_srna(cprop, "wmOwnerIDs");
284 srna = RNA_def_struct(brna, "wmOwnerIDs", nullptr);
285 RNA_def_struct_sdna(srna, "WorkSpace");
286 RNA_def_struct_ui_text(srna, "WorkSpace UI Tags", "");
287
288 /* add owner_id */
289 func = RNA_def_function(srna, "new", "rna_WorkSpace_owner_ids_new");
290 RNA_def_function_ui_description(func, "Add ui tag");
291 parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the tag");
293 /* return type */
294 parm = RNA_def_pointer(func, "owner_id", "wmOwnerID", "", "");
296 RNA_def_function_return(func, parm);
297
298 /* remove owner_id */
299 func = RNA_def_function(srna, "remove", "rna_WorkSpace_owner_ids_remove");
301 RNA_def_function_ui_description(func, "Remove ui tag");
302 /* owner_id to remove */
303 parm = RNA_def_pointer(func, "owner_id", "wmOwnerID", "", "Tag to remove");
306
307 /* clear all modifiers */
308 func = RNA_def_function(srna, "clear", "rna_WorkSpace_owner_ids_clear");
309 RNA_def_function_ui_description(func, "Remove all tags");
310}
311
313{
314 StructRNA *srna;
315 PropertyRNA *prop;
316
317 srna = RNA_def_struct(brna, "WorkSpaceTool", nullptr);
318 RNA_def_struct_sdna(srna, "bToolRef");
319 RNA_def_struct_ui_text(srna, "Work Space Tool", "");
320
321 prop = RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
322 RNA_def_property_ui_text(prop, "Identifier", "");
324
325 prop = RNA_def_property(srna, "idname_fallback", PROP_STRING, PROP_NONE);
326 RNA_def_property_ui_text(prop, "Identifier Fallback", "");
327
328 prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
330 RNA_def_property_ui_text(prop, "Index", "");
331 RNA_def_property_int_funcs(prop, "rna_WorkSpaceTool_index_get", nullptr, nullptr);
332
333 prop = RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
334 RNA_def_property_enum_sdna(prop, nullptr, "space_type");
337 RNA_def_property_ui_text(prop, "Space Type", "");
338
339 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
340 RNA_def_property_enum_sdna(prop, nullptr, "mode");
342 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_WorkSpace_tools_mode_itemf");
343 RNA_def_property_ui_text(prop, "Tool Mode", "");
345
346 prop = RNA_def_property(srna, "use_paint_canvas", PROP_BOOLEAN, PROP_NONE);
348 RNA_def_property_ui_text(prop, "Index", "");
349 RNA_def_property_boolean_funcs(prop, "rna_WorkSpaceTool_use_paint_canvas_get", nullptr);
350 RNA_def_property_ui_text(prop, "Use Paint Canvas", "Does this tool use a painting canvas");
351
353
354 prop = RNA_def_property(srna, "has_datablock", PROP_BOOLEAN, PROP_NONE);
356 RNA_def_property_ui_text(prop, "Has Data-Block", "");
357 RNA_def_property_boolean_funcs(prop, "rna_WorkSpaceTool_has_datablock_get", nullptr);
358
359 prop = RNA_def_property(srna, "use_brushes", PROP_BOOLEAN, PROP_NONE);
361 RNA_def_property_ui_text(prop, "Uses Brushes", "");
362 RNA_def_property_boolean_funcs(prop, "rna_WorkSpaceTool_use_brushes_get", nullptr);
363
364 prop = RNA_def_property(srna, "brush_type", PROP_ENUM, PROP_NONE);
367 "Brush Type",
368 "If the tool uses brushes and is limited to a specific brush type, the "
369 "identifier of the brush type");
372 prop, "rna_WorkSpaceTool_brush_type_get", nullptr, "rna_WorkSpaceTool_brush_type_itemf");
373
375
376 prop = RNA_def_property(srna, "widget", PROP_STRING, PROP_NONE);
378 RNA_def_property_ui_text(prop, "Widget", "");
380 prop, "rna_WorkSpaceTool_widget_get", "rna_WorkSpaceTool_widget_length", nullptr);
381
383}
384
386{
387 StructRNA *srna;
388
389 FunctionRNA *func;
390 PropertyRNA *parm;
391
392 RNA_def_property_srna(cprop, "wmTools");
393 srna = RNA_def_struct(brna, "wmTools", nullptr);
394 RNA_def_struct_sdna(srna, "WorkSpace");
395 RNA_def_struct_ui_text(srna, "WorkSpace UI Tags", "");
396
397 /* add owner_id */
398 func = RNA_def_function(
399 srna, "from_space_view3d_mode", "rna_WorkSpace_tools_from_space_view3d_mode");
401 parm = RNA_def_enum(func, "mode", rna_enum_context_mode_items, 0, "", "Object mode");
403 RNA_def_boolean(func, "create", false, "Create", "");
404 /* return type */
405 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
406 RNA_def_function_return(func, parm);
407
408 func = RNA_def_function(
409 srna, "from_space_image_mode", "rna_WorkSpace_tools_from_space_image_mode");
411 parm = RNA_def_enum(
412 func, "mode", rna_enum_space_image_mode_all_items, 0, "", "Image space mode");
414 RNA_def_boolean(func, "create", false, "Create", "");
415 /* return type */
416 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
417 RNA_def_function_return(func, parm);
418
419 func = RNA_def_function(srna, "from_space_node", "rna_WorkSpace_tools_from_space_node");
421 RNA_def_boolean(func, "create", false, "Create", "");
422 /* return type */
423 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
424 RNA_def_function_return(func, parm);
425
426 func = RNA_def_function(
427 srna, "from_space_sequencer", "rna_WorkSpace_tools_from_space_sequencer");
429 parm = RNA_def_enum(
430 func, "mode", rna_enum_space_sequencer_view_type_items, 0, "", "Sequencer view type");
432 RNA_def_boolean(func, "create", false, "Create", "");
433 /* return type */
434 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
435 RNA_def_function_return(func, parm);
436}
437
439{
440 StructRNA *srna;
441 PropertyRNA *prop;
442
443 srna = RNA_def_struct(brna, "WorkSpace", "ID");
444 RNA_def_struct_sdna(srna, "WorkSpace");
446 srna, "Workspace", "Workspace data-block, defining the working environment for the user");
447 /* TODO: real icon, just to show something */
448 RNA_def_struct_ui_icon(srna, ICON_WORKSPACE);
449
450 prop = RNA_def_property(srna, "screens", PROP_COLLECTION, PROP_NONE);
451 RNA_def_property_collection_sdna(prop, nullptr, "layouts", nullptr);
452 RNA_def_property_struct_type(prop, "Screen");
454 "rna_workspace_screens_begin",
455 nullptr,
456 nullptr,
457 "rna_workspace_screens_item_get",
458 nullptr,
459 nullptr,
460 nullptr,
461 nullptr);
462 RNA_def_property_ui_text(prop, "Screens", "Screen layouts of a workspace");
463
464 prop = RNA_def_property(srna, "owner_ids", PROP_COLLECTION, PROP_NONE);
465 RNA_def_property_struct_type(prop, "wmOwnerID");
466 RNA_def_property_ui_text(prop, "UI Tags", "");
467 rna_def_workspace_owner_ids(brna, prop);
468
469 prop = RNA_def_property(srna, "tools", PROP_COLLECTION, PROP_NONE);
470 RNA_def_property_collection_sdna(prop, nullptr, "tools", nullptr);
471 RNA_def_property_struct_type(prop, "WorkSpaceTool");
472 RNA_def_property_ui_text(prop, "Tools", "");
473 rna_def_workspace_tools(brna, prop);
474
475 prop = RNA_def_property(srna, "object_mode", PROP_ENUM, PROP_NONE);
478 prop, "Object Mode", "Switch to this object mode when activating the workspace");
479
480 prop = RNA_def_property(srna, "use_pin_scene", PROP_BOOLEAN, PROP_NONE);
483 "Pin Scene",
484 "Remember the last used scene for the workspace and switch to it "
485 "whenever this workspace is activated again");
487
488 /* Flags */
489 prop = RNA_def_property(srna, "use_filter_by_owner", PROP_BOOLEAN, PROP_NONE);
492 RNA_def_property_ui_text(prop, "Use UI Tags", "Filter the UI by tags");
493 RNA_def_property_update(prop, 0, "rna_window_update_all");
494
496 srna, "rna_WorkSpace_asset_library_get", "rna_WorkSpace_asset_library_set");
498 "Asset Library",
499 "Active asset library to show in the UI, not used by the Asset Browser "
500 "(which has its own active asset library)");
502
503 prop = RNA_def_property(srna, "sequencer_scene", PROP_POINTER, PROP_NONE);
504 RNA_def_property_pointer_sdna(prop, nullptr, "sequencer_scene");
505 RNA_def_property_ui_text(prop, "Sequencer Scene", "");
507 RNA_def_property_update(prop, NC_WINDOW, "rna_workspace_sync_scene_time_update");
508
509 prop = RNA_def_property(srna, "use_scene_time_sync", PROP_BOOLEAN, PROP_NONE);
512 prop, "Sync Scene Time", "Set the active scene and time based on the current scene strip");
514 RNA_def_property_update(prop, NC_WINDOW, "rna_workspace_sync_scene_time_update");
515
516 RNA_api_workspace(srna);
517}
518
520{
523
524 rna_def_workspace(brna);
525}
526
527} // namespace blender
528
529#endif /* RNA_RUNTIME */
#define C
Definition RandGen.cpp:29
#define ND_ASSET_LIST_READING
Definition WM_types.hh:593
#define NC_WINDOW
Definition WM_types.hh:388
#define ND_MODIFIER
Definition WM_types.hh:503
#define NC_WORKSPACE
Definition WM_types.hh:389
#define NC_ASSET
Definition WM_types.hh:417
#define NA_REMOVED
Definition WM_types.hh:637
#define NC_OBJECT
Definition WM_types.hh:392
int library_reference_to_enum_value(const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value(int value)
void sync_active_scene_and_time_with_scene_strip(bContext &C)
BMesh Iterators.
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_workspace(BlenderRNA *brna)
@ WORKSPACE_USE_FILTER_BY_ORIGIN
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
char * STRNCPY(char(&dst)[N], const char *src)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_space_type_items[]
Definition rna_space.cc:91
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
@ FUNC_USE_REPORTS
static void rna_def_workspace_owner(BlenderRNA *brna)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void rna_def_workspace(BlenderRNA *brna)
bToolRef * WM_toolsystem_ref_find(WorkSpace *workspace, const bToolKey *tkey)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
const EnumPropertyItem rna_enum_context_mode_items[]
static void rna_def_workspace_tool(BlenderRNA *brna)
bool ED_paint_brush_type_use_canvas(bContext *C, bToolRef *tref)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
const EnumPropertyItem * rna_WorkSpaceTool_brush_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
void RNA_api_workspace(StructRNA *srna)
@ PROP_BOOLEAN
Definition RNA_types.hh:210
@ PROP_POINTER
Definition RNA_types.hh:215
@ PROP_STRING
Definition RNA_types.hh:213
@ PROP_COLLECTION
Definition RNA_types.hh:216
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
PropertyRNA * rna_def_asset_library_ui_reference_common(StructRNA *srna, const char *get, const char *set)
Definition rna_asset.cc:896
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
Definition rna_space.cc:209
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_api_workspace_tool(StructRNA *srna)
PaintMode BKE_paintmode_get_from_tool(const bToolRef *tref)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:34
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
const EnumPropertyItem rna_enum_workspace_object_mode_items[]
Definition rna_object.cc:77
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
const EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(PaintMode mode)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
bScreen * BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS
Definition workspace.cc:709
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:477
@ PROP_EDITABLE
Definition RNA_types.hh:376
@ PROP_THICK_WRAP
Definition RNA_types.hh:493
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:465
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
@ PROP_ANIMATABLE
Definition RNA_types.hh:389
static void rna_def_workspace_tools(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:161
bool WM_toolsystem_ref_ensure(WorkSpace *workspace, const bToolKey *tkey, bToolRef **r_tref)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_define_verify_sdna(bool verify)
static void rna_def_workspace_owner_ids(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
Definition rna_space.cc:314
@ PARM_REQUIRED
Definition RNA_types.hh:631
@ PARM_RNAPTR
Definition RNA_types.hh:633
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
@ Invalid
Definition types.hh:42
AssetLibraryReference asset_library_ref
bToolRef_Runtime * runtime