Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCian Jinks <cjinks99@gmail.com>2021-09-22 17:09:31 +0300
committerCian Jinks <cjinks99@gmail.com>2021-09-22 17:09:31 +0300
commite734491048ef2436af41e272b8900f20785ecbe6 (patch)
tree8cee3fc068c782c0ba8cb9a581e768968c565569 /source/blender/makesrna/intern/rna_workspace_api.c
parentf21cd0881948f6eaf16af0b354cd904df7407bda (diff)
parent204b01a254ac2445fea217e5211b2ed6aef631ca (diff)
Merge branch 'master' into soc-2021-knife-toolssoc-2021-knife-tools
Diffstat (limited to 'source/blender/makesrna/intern/rna_workspace_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_workspace_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c
index a2bb89dd5ee..15230f1198b 100644
--- a/source/blender/makesrna/intern/rna_workspace_api.c
+++ b/source/blender/makesrna/intern/rna_workspace_api.c
@@ -29,6 +29,7 @@
#include "DNA_object_types.h"
#include "DNA_windowmanager_types.h"
+#include "DNA_workspace_types.h"
#include "RNA_enum_types.h" /* own include */
@@ -51,6 +52,7 @@ static void rna_WorkSpaceTool_setup(ID *id,
const char *data_block,
const char *op_idname,
int index,
+ int options,
const char *idname_fallback,
const char *keymap_fallback)
{
@@ -62,6 +64,7 @@ static void rna_WorkSpaceTool_setup(ID *id,
STRNCPY(tref_rt.data_block, data_block);
STRNCPY(tref_rt.op, op_idname);
tref_rt.index = index;
+ tref_rt.flag = options;
/* While it's logical to assign both these values from setup,
* it's useful to stored this in DNA for re-use, exceptional case: write to the 'tref'. */
@@ -131,6 +134,11 @@ void RNA_api_workspace_tool(StructRNA *srna)
PropertyRNA *parm;
FunctionRNA *func;
+ static EnumPropertyItem options_items[] = {
+ {TOOLREF_FLAG_FALLBACK_KEYMAP, "KEYMAP_FALLBACK", 0, "Fallback", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
func = RNA_def_function(srna, "setup", "rna_WorkSpaceTool_setup");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Set the tool settings");
@@ -146,6 +154,7 @@ void RNA_api_workspace_tool(StructRNA *srna)
RNA_def_string(func, "data_block", NULL, MAX_NAME, "Data Block", "");
RNA_def_string(func, "operator", NULL, MAX_NAME, "Operator", "");
RNA_def_int(func, "index", 0, INT_MIN, INT_MAX, "Index", "", INT_MIN, INT_MAX);
+ RNA_def_enum_flag(func, "options", options_items, 0, "Tool Options", "");
RNA_def_string(func, "idname_fallback", NULL, MAX_NAME, "Fallback Identifier", "");
RNA_def_string(func, "keymap_fallback", NULL, KMAP_MAX_NAME, "Fallback Key Map", "");