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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c250
1 files changed, 187 insertions, 63 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 1cfc80a1730..54d1b1a55b4 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -101,7 +101,7 @@ EnumPropertyItem event_timer_type_items[]= {
{TIMER2, "TIMER2", 0, "Timer 2", ""},
{0, NULL, 0, NULL, NULL}};
-/* not returned: CAPSLOCKKEY, UNKNOWNKEY, GRLESSKEY */
+/* not returned: CAPSLOCKKEY, UNKNOWNKEY */
EnumPropertyItem event_type_items[] = {
{0, "NONE", 0, "", ""},
@@ -175,8 +175,8 @@ EnumPropertyItem event_type_items[] = {
{RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""},
{RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""},
{0, "", 0, NULL, NULL},
- {COMMANDKEY, "COMMAND", 0, "Command", ""},
- {0, "", 0, NULL, NULL},
+ {OSKEY, "OSKEY", 0, "OS Key", ""},
+ {GRLESSKEY, "GRLESS", 0, "Grless", ""},
{ESCKEY, "ESC", 0, "Esc", ""},
{TABKEY, "TAB", 0, "Tab", ""},
{RETKEY, "RET", 0, "Return", ""},
@@ -241,6 +241,11 @@ EnumPropertyItem event_type_items[] = {
{PAGEDOWNKEY, "PAGE_DOWN", 0, "Page Down", ""},
{ENDKEY, "END", 0, "End", ""},
{0, "", 0, NULL, NULL},
+ {MEDIAPLAY, "MEDIA_PLAY", 0, "Media Play/Pause", ""},
+ {MEDIASTOP, "MEDIA_STOP", 0, "Media Stop", ""},
+ {MEDIAFIRST, "MEDIA_FIRST", 0, "Media First", ""},
+ {MEDIALAST, "MEDIA_LAST", 0, "Media Last", ""},
+ {0, "", 0, NULL, NULL},
{WINDEACTIVATE, "WINDOW_DEACTIVATE", 0, "Window Deactivate", ""},
{TIMER, "TIMER", 0, "Timer", ""},
{TIMER0, "TIMER0", 0, "Timer 0", ""},
@@ -265,6 +270,7 @@ EnumPropertyItem operator_flag_items[] = {
{OPTYPE_BLOCKING, "BLOCKING", 0, "Finished", ""},
{OPTYPE_MACRO, "MACRO", 0, "Macro", ""},
{OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer", ""},
+ {OPTYPE_PRESET, "PRESET", 0, "Preset", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem operator_return_items[] = {
@@ -294,6 +300,8 @@ EnumPropertyItem wm_report_items[] = {
#ifdef RNA_RUNTIME
+#include <assert.h>
+
#include "WM_api.h"
#include "BKE_idprop.h"
@@ -588,7 +596,7 @@ static void rna_wmKeyMapItem_idname_set(PointerRNA *ptr, const char *value)
if(strcmp(idname, kmi->idname) != 0) {
BLI_strncpy(kmi->idname, idname, sizeof(kmi->idname));
- WM_keymap_properties_reset(kmi);
+ WM_keymap_properties_reset(kmi, NULL);
}
}
@@ -612,24 +620,40 @@ static int rna_wmKeyMapItem_name_length(PointerRNA *ptr)
return 0;
}
+static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr)
+{
+ wmKeyMapItem *kmi= ptr->data;
+ return kmi->id < 0;
+}
+
static void rna_wmClipboard_get(PointerRNA *ptr, char *value)
{
char *pbuf;
pbuf= WM_clipboard_text_get(FALSE);
- strcpy(value, pbuf);
-
- MEM_freeN(pbuf);
+ if(pbuf) {
+ strcpy(value, pbuf);
+ MEM_freeN(pbuf);
+ }
+ else {
+ value[0]= '\0';
+ }
}
static int rna_wmClipboard_length(PointerRNA *ptr)
{
- char *clipboard;
+ char *pbuf;
int length;
- clipboard = WM_clipboard_text_get(FALSE);
- length = (clipboard?strlen(clipboard):0);
- MEM_freeN(clipboard);
+ pbuf = WM_clipboard_text_get(FALSE);
+ if(pbuf) {
+ length = strlen(pbuf);
+ MEM_freeN(pbuf);
+ }
+ else {
+ length= 0;
+ }
+
return length;
}
@@ -639,10 +663,10 @@ static void rna_wmClipboard_set(PointerRNA *ptr, const char *value)
WM_clipboard_text_set((void *) value, FALSE);
}
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
static void rna_Operator_unregister(const bContext *C, StructRNA *type)
{
- char *idname;
+ const char *idname;
wmOperatorType *ot= RNA_struct_blender_type_get(type);
if(!ot)
@@ -658,7 +682,7 @@ static void rna_Operator_unregister(const bContext *C, StructRNA *type)
idname= ot->idname;
WM_operatortype_remove(ot->idname);
- MEM_freeN(idname);
+ MEM_freeN((void *)idname);
/* not to be confused with the RNA_struct_free that WM_operatortype_remove calls, they are 2 different srna's */
RNA_struct_free(&BLENDER_RNA, type);
@@ -677,7 +701,7 @@ static int operator_poll(bContext *C, wmOperatorType *ot)
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
- ot->ext.call(&ptr, func, &list);
+ ot->ext.call(C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible= *(int*)ret;
@@ -687,7 +711,7 @@ static int operator_poll(bContext *C, wmOperatorType *ot)
return visible;
}
-static int operator_exec(bContext *C, wmOperator *op)
+static int operator_execute(bContext *C, wmOperator *op)
{
PointerRNA opr;
ParameterList list;
@@ -700,7 +724,31 @@ static int operator_exec(bContext *C, wmOperator *op)
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
- op->type->ext.call(&opr, func, &list);
+ op->type->ext.call(C, &opr, func, &list);
+
+ RNA_parameter_get_lookup(&list, "result", &ret);
+ result= *(int*)ret;
+
+ RNA_parameter_list_free(&list);
+
+ return result;
+}
+
+/* same as execute() but no return value */
+static int operator_check(bContext *C, wmOperator *op)
+{
+ PointerRNA opr;
+ ParameterList list;
+ FunctionRNA *func;
+ void *ret;
+ int result;
+
+ RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
+ func= RNA_struct_find_function(&opr, "check");
+
+ RNA_parameter_list_create(&list, &opr, func);
+ RNA_parameter_set_lookup(&list, "context", &C);
+ op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result= *(int*)ret;
@@ -724,7 +772,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "event", &event);
- op->type->ext.call(&opr, func, &list);
+ op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result= *(int*)ret;
@@ -749,7 +797,7 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "event", &event);
- op->type->ext.call(&opr, func, &list);
+ op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result= *(int*)ret;
@@ -770,7 +818,7 @@ static void operator_draw(bContext *C, wmOperator *op)
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
- op->type->ext.call(&opr, func, &list);
+ op->type->ext.call(C, &opr, func, &list);
RNA_parameter_list_free(&list);
}
@@ -781,12 +829,12 @@ void macro_wrapper(wmOperatorType *ot, void *userdata);
static char _operator_idname[OP_MAX_TYPENAME];
static char _operator_name[OP_MAX_TYPENAME];
static char _operator_descr[1024];
-static StructRNA *rna_Operator_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Operator_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmOperatorType dummyot = {0};
wmOperator dummyop= {0};
PointerRNA dummyotr;
- int have_function[5];
+ int have_function[6];
/* setup dummy operator & operator type to store static properties in */
dummyop.type= &dummyot;
@@ -795,30 +843,63 @@ static StructRNA *rna_Operator_register(const bContext *C, ReportList *reports,
dummyot.description= _operator_descr; /* only assigne the pointer, string is NULL'd */
RNA_pointer_create(NULL, &RNA_Operator, &dummyop, &dummyotr);
+ /* clear incase they are left unset */
+ _operator_idname[0]= _operator_name[0]= _operator_descr[0]= '\0';
+
/* validate the python class */
if(validate(&dummyotr, data, have_function) != 0)
return NULL;
{ /* convert foo.bar to FOO_OT_bar
* allocate the description and the idname in 1 go */
- int idlen = strlen(_operator_idname) + 4;
- int namelen = strlen(_operator_name) + 1;
- int desclen = strlen(_operator_descr) + 1;
- char *ch, *ch_arr;
- ch_arr= ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */
- WM_operator_bl_idname(ch, _operator_idname); /* convert the idname from python */
- dummyot.idname= ch;
- ch += idlen;
- strcpy(ch, _operator_name);
- dummyot.name = ch;
- ch += namelen;
- strcpy(ch, _operator_descr);
- dummyot.description = ch;
- }
- if(strlen(identifier) >= sizeof(dummyop.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummyop.idname));
- return NULL;
+ /* inconveniently long name sanity check */
+ {
+ char *ch= _operator_idname;
+ int i;
+ int dot= 0;
+ for(i=0; *ch; i++) {
+ if((*ch >= 'a' && *ch <= 'z') || (*ch >= '0' && *ch <= '9') || *ch == '_') {
+ /* pass */
+ }
+ else if(*ch == '.') {
+ dot++;
+ }
+ else {
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', at position %d", identifier, _operator_idname, i);
+ return NULL;
+ }
+
+ ch++;
+ }
+
+ if(i > ((int)sizeof(dummyop.idname)) - 3) {
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', is too long, maximum length is %d.", identifier, _operator_idname, (int)sizeof(dummyop.idname) - 3);
+ return NULL;
+ }
+
+ if(dot != 1) {
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', must contain 1 '.' character", identifier, _operator_idname);
+ return NULL;
+ }
+ }
+ /* end sanity check */
+
+ {
+ int idlen = strlen(_operator_idname) + 4;
+ int namelen = strlen(_operator_name) + 1;
+ int desclen = strlen(_operator_descr) + 1;
+ char *ch, *ch_arr;
+ ch_arr= ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */
+ WM_operator_bl_idname(ch, _operator_idname); /* convert the idname from python */
+ dummyot.idname= ch;
+ ch += idlen;
+ strcpy(ch, _operator_name);
+ dummyot.name = ch;
+ ch += namelen;
+ strcpy(ch, _operator_descr);
+ dummyot.description = ch;
+ }
}
/* check if we have registered this operator type before, and remove it */
@@ -830,16 +911,17 @@ static StructRNA *rna_Operator_register(const bContext *C, ReportList *reports,
/* create a new menu type */
dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
+ RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */
dummyot.ext.data= data;
dummyot.ext.call= call;
dummyot.ext.free= free;
dummyot.pyop_poll= (have_function[0])? operator_poll: NULL;
- dummyot.exec= (have_function[1])? operator_exec: NULL;
- dummyot.invoke= (have_function[2])? operator_invoke: NULL;
- dummyot.modal= (have_function[3])? operator_modal: NULL;
- dummyot.ui= (have_function[4])? operator_draw: NULL;
-
+ dummyot.exec= (have_function[1])? operator_execute: NULL;
+ dummyot.check= (have_function[2])? operator_check: NULL;
+ dummyot.invoke= (have_function[3])? operator_invoke: NULL;
+ dummyot.modal= (have_function[4])? operator_modal: NULL;
+ dummyot.ui= (have_function[5])? operator_draw: NULL;
WM_operatortype_append_ptr(operator_wrapper, (void *)&dummyot);
/* update while blender is running */
@@ -850,7 +932,7 @@ static StructRNA *rna_Operator_register(const bContext *C, ReportList *reports,
}
-static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_MacroOperator_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmOperatorType dummyot = {0};
wmOperator dummyop= {0};
@@ -886,7 +968,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo
}
if(strlen(identifier) >= sizeof(dummyop.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummyop.idname));
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyop.idname));
return NULL;
}
@@ -914,7 +996,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo
return dummyot.ext.srna;
}
-#endif /* DISABLE_PYTHON */
+#endif /* WITH_PYTHON */
static StructRNA* rna_Operator_refine(PointerRNA *opr)
{
@@ -928,7 +1010,7 @@ static StructRNA* rna_MacroOperator_refine(PointerRNA *opr)
return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Macro;
}
-static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
+static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
// wmWindowManager *wm = CTX_wm_manager(C);
int modifier= 0;
@@ -949,7 +1031,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, char
return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier);
}
-static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, char* propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
+static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
wmWindowManager *wm = CTX_wm_manager(C);
int modifier= 0;
@@ -988,7 +1070,7 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, Report
return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue);
}
-static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid, int modal)
+static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid, int modal)
{
if (modal == 0) {
return WM_keymap_find(keyconf, idname, spaceid, regionid);
@@ -997,12 +1079,12 @@ static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, char *idname, int spaceid,
}
}
-static wmKeyMap *rna_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid)
+static wmKeyMap *rna_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
{
return WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
}
-static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, char *idname)
+static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, const char *idname)
{
wmOperatorType *ot = WM_operatortype_find(idname, 0);
@@ -1012,6 +1094,31 @@ static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, char *idname)
return ot->modalkeymap;
}
+/* just to work around 'const char *' warning and to ensure this is a python op */
+static void rna_Operator_bl_idname_set(PointerRNA *ptr, const char *value)
+{
+ wmOperator *data= (wmOperator*)(ptr->data);
+ char *str= (char *)data->type->idname;
+ if(!str[0]) strcpy(str, value);
+ else assert(!"setting the bl_idname on a non-builtin operator");
+}
+
+static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value)
+{
+ wmOperator *data= (wmOperator*)(ptr->data);
+ char *str= (char *)data->type->name;
+ if(!str[0]) strcpy(str, value);
+ else assert(!"setting the bl_label on a non-builtin operator");
+}
+
+static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value)
+{
+ wmOperator *data= (wmOperator*)(ptr->data);
+ char *str= (char *)data->type->description;
+ if(!str[0]) strcpy(str, value);
+ else assert(!"setting the bl_description on a non-builtin operator");
+}
+
#else /* RNA_RUNTIME */
static void rna_def_operator(BlenderRNA *brna)
@@ -1023,7 +1130,7 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Operator", "Storage of an operator being executed, or registered after execution");
RNA_def_struct_sdna(srna, "wmOperator");
RNA_def_struct_refine_func(srna, "rna_Operator_refine");
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister");
#endif
@@ -1049,19 +1156,25 @@ static void rna_def_operator(BlenderRNA *brna)
/* Registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
- RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
- RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME-3); /* else it uses the pointer size!. -3 because '.' -> '_OT_' */
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_idname_set");
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
- RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
@@ -1086,7 +1199,7 @@ static void rna_def_macro_operator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Macro Operator", "Storage of a macro operator being executed, or registered after execution");
RNA_def_struct_sdna(srna, "wmOperator");
RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine");
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister");
#endif
@@ -1105,18 +1218,24 @@ static void rna_def_macro_operator(BlenderRNA *brna)
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
- RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_idname_set");
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
- RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
@@ -1154,7 +1273,7 @@ static void rna_def_operator_utils(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorMousePath", "IDPropertyGroup");
+ srna= RNA_def_struct(brna, "OperatorMousePath", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Operator Mouse Path", "Mouse path values for operators that record such paths");
prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_XYZ);
@@ -1172,7 +1291,7 @@ static void rna_def_operator_filelist_element(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorFileListElement", "IDPropertyGroup");
+ srna= RNA_def_struct(brna, "OperatorFileListElement", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Operator File List Element", "");
@@ -1479,7 +1598,7 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "idname");
RNA_def_property_ui_text(prop, "Name", "Name of the key configuration");
RNA_def_struct_name_property(srna, prop);
-
+
prop= RNA_def_property(srna, "keymaps", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyMap");
RNA_def_property_ui_text(prop, "Key Maps", "Key maps configured as part of this configuration");
@@ -1635,6 +1754,11 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Active", "Activate or deactivate item");
RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
+ prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "User Defined", "Is this keymap item user defined (doesn't just override a builtin item)");
+ RNA_def_property_boolean_funcs(prop, "rna_KeyMapItem_userdefined_get", NULL);
+
RNA_api_keymapitem(srna);
}