Blender V4.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
9#include "RNA_define.hh"
10#include "RNA_enum_types.hh"
11#include "RNA_types.hh"
12
13#include "BKE_workspace.hh"
14
15#include "ED_render.hh"
16
17#include "RE_engine.h"
18
19#include "WM_api.hh"
20#include "WM_types.hh"
21
22#include "rna_internal.hh"
23
24#include "DNA_workspace_types.h"
25
26#ifdef RNA_RUNTIME
27
28# include "BLI_listbase.h"
29
30# include "BKE_global.hh"
31# include "BKE_paint.hh"
32
33# include "DNA_object_types.h"
34# include "DNA_screen_types.h"
35# include "DNA_space_types.h"
36
37# include "ED_asset.hh"
38# include "ED_paint.hh"
39
40# include "RNA_access.hh"
41
42# include "WM_toolsystem.hh"
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 = (WorkSpace *)ptr->owner_id;
52 rna_iterator_listbase_begin(iter, &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_pointer_inherit_refine(&iter->parent, &RNA_Screen, 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 = static_cast<wmOwnerID *>(MEM_callocN(sizeof(*owner_id), __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_freeN(owner_id);
89 RNA_POINTER_INVALIDATE(wstag_ptr);
90
92}
93
94static void rna_WorkSpace_owner_ids_clear(WorkSpace *workspace)
95{
96 BLI_freelistN(&workspace->owner_ids);
98}
99
100static int rna_WorkSpace_asset_library_get(PointerRNA *ptr)
101{
102 const WorkSpace *workspace = static_cast<WorkSpace *>(ptr->data);
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*/,
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_image_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
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", "Donnot 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
251#else /* RNA_RUNTIME */
252
254{
255 StructRNA *srna;
256 PropertyRNA *prop;
257
258 srna = RNA_def_struct(brna, "wmOwnerID", nullptr);
259 RNA_def_struct_sdna(srna, "wmOwnerID");
260 RNA_def_struct_ui_text(srna, "Work Space UI Tag", "");
261
262 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
263 RNA_def_property_ui_text(prop, "Name", "");
265}
266
268{
269 StructRNA *srna;
270
271 FunctionRNA *func;
272 PropertyRNA *parm;
273
274 RNA_def_property_srna(cprop, "wmOwnerIDs");
275 srna = RNA_def_struct(brna, "wmOwnerIDs", nullptr);
276 RNA_def_struct_sdna(srna, "WorkSpace");
277 RNA_def_struct_ui_text(srna, "WorkSpace UI Tags", "");
278
279 /* add owner_id */
280 func = RNA_def_function(srna, "new", "rna_WorkSpace_owner_ids_new");
281 RNA_def_function_ui_description(func, "Add ui tag");
282 parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the tag");
284 /* return type */
285 parm = RNA_def_pointer(func, "owner_id", "wmOwnerID", "", "");
286 RNA_def_function_return(func, parm);
287
288 /* remove owner_id */
289 func = RNA_def_function(srna, "remove", "rna_WorkSpace_owner_ids_remove");
291 RNA_def_function_ui_description(func, "Remove ui tag");
292 /* owner_id to remove */
293 parm = RNA_def_pointer(func, "owner_id", "wmOwnerID", "", "Tag to remove");
296
297 /* clear all modifiers */
298 func = RNA_def_function(srna, "clear", "rna_WorkSpace_owner_ids_clear");
299 RNA_def_function_ui_description(func, "Remove all tags");
300}
301
303{
304 StructRNA *srna;
305 PropertyRNA *prop;
306
307 srna = RNA_def_struct(brna, "WorkSpaceTool", nullptr);
308 RNA_def_struct_sdna(srna, "bToolRef");
309 RNA_def_struct_ui_text(srna, "Work Space Tool", "");
310
311 prop = RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
312 RNA_def_property_ui_text(prop, "Identifier", "");
314
315 prop = RNA_def_property(srna, "idname_fallback", PROP_STRING, PROP_NONE);
316 RNA_def_property_ui_text(prop, "Identifier Fallback", "");
317
318 prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
320 RNA_def_property_ui_text(prop, "Index", "");
321 RNA_def_property_int_funcs(prop, "rna_WorkSpaceTool_index_get", nullptr, nullptr);
322
323 prop = RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
324 RNA_def_property_enum_sdna(prop, nullptr, "space_type");
327 RNA_def_property_ui_text(prop, "Space Type", "");
328
329 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
330 RNA_def_property_enum_sdna(prop, nullptr, "mode");
332 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_WorkSpace_tools_mode_itemf");
333 RNA_def_property_ui_text(prop, "Tool Mode", "");
335
336 prop = RNA_def_property(srna, "use_paint_canvas", PROP_BOOLEAN, PROP_NONE);
338 RNA_def_property_ui_text(prop, "Index", "");
339 RNA_def_property_boolean_funcs(prop, "rna_WorkSpaceTool_use_paint_canvas_get", nullptr);
340 RNA_def_property_ui_text(prop, "Use Paint Canvas", "Does this tool use a painting canvas");
341
343
344 prop = RNA_def_property(srna, "has_datablock", PROP_BOOLEAN, PROP_NONE);
346 RNA_def_property_ui_text(prop, "Has Data-Block", "");
347 RNA_def_property_boolean_funcs(prop, "rna_WorkSpaceTool_has_datablock_get", nullptr);
348
349 prop = RNA_def_property(srna, "use_brushes", PROP_BOOLEAN, PROP_NONE);
351 RNA_def_property_ui_text(prop, "Uses Brushes", "");
352 RNA_def_property_boolean_funcs(prop, "rna_WorkSpaceTool_use_brushes_get", nullptr);
353
354 prop = RNA_def_property(srna, "brush_type", PROP_ENUM, PROP_NONE);
357 "Brush Type",
358 "If the tool uses brushes and is limited to a specific brush type, the "
359 "identifier of the brush type");
362 prop, "rna_WorkSpaceTool_brush_type_get", nullptr, "rna_WorkSpaceTool_brush_type_itemf");
363
365
366 prop = RNA_def_property(srna, "widget", PROP_STRING, PROP_NONE);
368 RNA_def_property_ui_text(prop, "Widget", "");
370 prop, "rna_WorkSpaceTool_widget_get", "rna_WorkSpaceTool_widget_length", nullptr);
371
373}
374
376{
377 StructRNA *srna;
378
379 FunctionRNA *func;
380 PropertyRNA *parm;
381
382 RNA_def_property_srna(cprop, "wmTools");
383 srna = RNA_def_struct(brna, "wmTools", nullptr);
384 RNA_def_struct_sdna(srna, "WorkSpace");
385 RNA_def_struct_ui_text(srna, "WorkSpace UI Tags", "");
386
387 /* add owner_id */
388 func = RNA_def_function(
389 srna, "from_space_view3d_mode", "rna_WorkSpace_tools_from_space_view3d_mode");
391 parm = RNA_def_enum(func, "mode", rna_enum_context_mode_items, 0, "", "");
393 RNA_def_boolean(func, "create", false, "Create", "");
394 /* return type */
395 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
396 RNA_def_function_return(func, parm);
397
398 func = RNA_def_function(
399 srna, "from_space_image_mode", "rna_WorkSpace_tools_from_space_image_mode");
401 parm = RNA_def_enum(func, "mode", rna_enum_space_image_mode_all_items, 0, "", "");
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(srna, "from_space_node", "rna_WorkSpace_tools_from_space_node");
410 RNA_def_boolean(func, "create", false, "Create", "");
411 /* return type */
412 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
413 RNA_def_function_return(func, parm);
414
415 func = RNA_def_function(
416 srna, "from_space_sequencer", "rna_WorkSpace_tools_from_space_sequencer");
418 parm = RNA_def_enum(func, "mode", rna_enum_space_sequencer_view_type_items, 0, "", "");
420 RNA_def_boolean(func, "create", false, "Create", "");
421 /* return type */
422 parm = RNA_def_pointer(func, "result", "WorkSpaceTool", "", "");
423 RNA_def_function_return(func, parm);
424}
425
427{
428 StructRNA *srna;
429 PropertyRNA *prop;
430
431 srna = RNA_def_struct(brna, "WorkSpace", "ID");
432 RNA_def_struct_sdna(srna, "WorkSpace");
434 srna, "Workspace", "Workspace data-block, defining the working environment for the user");
435 /* TODO: real icon, just to show something */
436 RNA_def_struct_ui_icon(srna, ICON_WORKSPACE);
437
438 prop = RNA_def_property(srna, "screens", PROP_COLLECTION, PROP_NONE);
439 RNA_def_property_collection_sdna(prop, nullptr, "layouts", nullptr);
440 RNA_def_property_struct_type(prop, "Screen");
442 "rna_workspace_screens_begin",
443 nullptr,
444 nullptr,
445 "rna_workspace_screens_item_get",
446 nullptr,
447 nullptr,
448 nullptr,
449 nullptr);
450 RNA_def_property_ui_text(prop, "Screens", "Screen layouts of a workspace");
451
452 prop = RNA_def_property(srna, "owner_ids", PROP_COLLECTION, PROP_NONE);
453 RNA_def_property_struct_type(prop, "wmOwnerID");
454 RNA_def_property_ui_text(prop, "UI Tags", "");
455 rna_def_workspace_owner_ids(brna, prop);
456
457 prop = RNA_def_property(srna, "tools", PROP_COLLECTION, PROP_NONE);
458 RNA_def_property_collection_sdna(prop, nullptr, "tools", nullptr);
459 RNA_def_property_struct_type(prop, "WorkSpaceTool");
460 RNA_def_property_ui_text(prop, "Tools", "");
461 rna_def_workspace_tools(brna, prop);
462
463 prop = RNA_def_property(srna, "object_mode", PROP_ENUM, PROP_NONE);
466 prop, "Object Mode", "Switch to this object mode when activating the workspace");
467
468 prop = RNA_def_property(srna, "use_pin_scene", PROP_BOOLEAN, PROP_NONE);
471 "Pin Scene",
472 "Remember the last used scene for the workspace and switch to it "
473 "whenever this workspace is activated again");
475
476 /* Flags */
477 prop = RNA_def_property(srna, "use_filter_by_owner", PROP_BOOLEAN, PROP_NONE);
480 RNA_def_property_ui_text(prop, "Use UI Tags", "Filter the UI by tags");
481 RNA_def_property_update(prop, 0, "rna_window_update_all");
482
484 srna, "rna_WorkSpace_asset_library_get", "rna_WorkSpace_asset_library_set");
486 "Asset Library",
487 "Active asset library to show in the UI, not used by the Asset Browser "
488 "(which has its own active asset library)");
490
491 RNA_api_workspace(srna);
492}
493
495{
498
499 rna_def_workspace(brna);
500}
501
502#endif /* RNA_RUNTIME */
PaintMode
Definition BKE_paint.hh:99
const EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(PaintMode mode)
Definition paint.cc:408
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
Definition paint.cc:506
PaintMode BKE_paintmode_get_from_tool(const bToolRef *tref)
Definition paint.cc:565
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bScreen * BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS
Definition workspace.cc:638
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:153
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
#define STRNCPY(dst, src)
Definition BLI_string.h:593
Object is a sort of wrapper for general info.
@ SPACE_NODE
@ SPACE_SEQ
@ SPACE_IMAGE
@ SPACE_VIEW3D
@ WORKSPACE_USE_FILTER_BY_ORIGIN
@ WORKSPACE_USE_PIN_SCENE
@ TOOLREF_FLAG_USE_BRUSHES
bool ED_image_paint_brush_type_use_canvas(bContext *C, bToolRef *tref)
#define RNA_POINTER_INVALIDATE(ptr)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_COLLECTION
Definition RNA_types.hh:71
PropertyFlag
Definition RNA_types.hh:201
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_NONE
Definition RNA_types.hh:136
#define ND_ASSET_LIST_READING
Definition WM_types.hh:516
#define NC_WINDOW
Definition WM_types.hh:342
#define ND_MODIFIER
Definition WM_types.hh:429
#define NC_WORKSPACE
Definition WM_types.hh:343
#define NC_ASSET
Definition WM_types.hh:371
#define NA_REMOVED
Definition WM_types.hh:553
#define NC_OBJECT
Definition WM_types.hh:346
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
int library_reference_to_enum_value(const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value(int value)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
PropertyRNA * rna_def_asset_library_reference_common(StructRNA *srna, const char *get, const char *set)
Definition rna_asset.cc:720
const EnumPropertyItem rna_enum_context_mode_items[]
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
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_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
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_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
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)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem * rna_WorkSpaceTool_brush_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
void RNA_api_workspace_tool(StructRNA *srna)
void RNA_api_workspace(StructRNA *srna)
const EnumPropertyItem rna_enum_workspace_object_mode_items[]
Definition rna_object.cc:95
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:35
const EnumPropertyItem rna_enum_space_type_items[]
Definition rna_space.cc:97
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
Definition rna_space.cc:202
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
Definition rna_space.cc:310
static void rna_def_workspace_tool(BlenderRNA *brna)
static void rna_def_workspace_owner_ids(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_workspace_tools(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_workspace_owner(BlenderRNA *brna)
void RNA_def_workspace(BlenderRNA *brna)
static void rna_def_workspace(BlenderRNA *brna)
char name[66]
Definition DNA_ID.h:425
ID * owner_id
Definition RNA_types.hh:40
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
Wrapper for bScreen.
AssetLibraryReference asset_library_ref
bToolRef_Runtime * runtime
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126
bToolRef * WM_toolsystem_ref_find(WorkSpace *workspace, const bToolKey *tkey)
bool WM_toolsystem_ref_ensure(WorkSpace *workspace, const bToolKey *tkey, bToolRef **r_tref)