[Bf-blender-cvs] [a28d2a16b7f] custom-manipulators: Use term 'manipulator' for RNA instead of 'widget'
Campbell Barton
noreply at git.blender.org
Mon Jun 5 15:34:25 CEST 2017
Commit: a28d2a16b7fb10d03a228232e123fd460f025aba
Author: Campbell Barton
Date: Mon Jun 5 23:33:32 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBa28d2a16b7fb10d03a228232e123fd460f025aba
Use term 'manipulator' for RNA instead of 'widget'
Annoying to have different names for RNA/DNA.
===================================================================
M source/blender/makesrna/RNA_access.h
M source/blender/makesrna/intern/rna_internal.h
M source/blender/makesrna/intern/rna_wm.c
M source/blender/makesrna/intern/rna_wm_api.c
M source/blender/python/intern/CMakeLists.txt
R085 source/blender/python/intern/bpy_widgetgroup_wrap.c source/blender/python/intern/bpy_manipulatorgroup_wrap.c
R076 source/blender/python/intern/bpy_widgetgroup_wrap.h source/blender/python/intern/bpy_manipulatorgroup_wrap.h
===================================================================
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index a91cc019803..9fb7cb0580c 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -374,6 +374,7 @@ extern StructRNA RNA_LineStyleThicknessModifier_Tangent;
extern StructRNA RNA_LockedTrackConstraint;
extern StructRNA RNA_Macro;
extern StructRNA RNA_MagicTexture;
+extern StructRNA RNA_Manipulator;
extern StructRNA RNA_MarbleTexture;
extern StructRNA RNA_MaskModifier;
extern StructRNA RNA_MaskSequence;
@@ -706,7 +707,6 @@ extern StructRNA RNA_Window;
extern StructRNA RNA_WindowManager;
extern StructRNA RNA_WipeSequence;
extern StructRNA RNA_WireframeModifier;
-extern StructRNA RNA_Widget;
extern StructRNA RNA_WoodTexture;
extern StructRNA RNA_WorkSpace;
extern StructRNA RNA_World;
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index ebe5996cf26..95f014ee437 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -268,7 +268,7 @@ void RNA_api_image(struct StructRNA *srna);
void RNA_api_lattice(struct StructRNA *srna);
void RNA_api_operator(struct StructRNA *srna);
void RNA_api_macro(struct StructRNA *srna);
-void RNA_api_widgetgroup(struct StructRNA *srna);
+void RNA_api_manipulatorgroup(struct StructRNA *srna);
void RNA_api_keyconfig(struct StructRNA *srna);
void RNA_api_keyconfigs(struct StructRNA *srna);
void RNA_api_keyingset(struct StructRNA *srna);
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 4becec87882..56b096fbe79 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -457,7 +457,7 @@ EnumPropertyItem rna_enum_wm_report_items[] = {
{0, NULL, 0, NULL, NULL}
};
-EnumPropertyItem rna_enum_wm_widget_type_items[] = {
+EnumPropertyItem rna_enum_wm_manipulator_type_items[] = {
{WT_TRANSLATE, "TRANSLATE", ICON_MAN_TRANS, "Translate", "Add a widget for moving objects"},
{WT_ROTATE, "ROTATE", ICON_MAN_ROT, "Rotate", "Add a widget for rotating objects"},
{WT_SCALE, "SCALE", ICON_MAN_SCALE, "Scale", "Add a widget for scaling objects"},
@@ -553,21 +553,21 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties);
}
-static void rna_WidgetGroup_name_get(PointerRNA *ptr, char *value)
+static void rna_ManipulatorGroup_name_get(PointerRNA *ptr, char *value)
{
wmManipulatorGroup *wgroup = ptr->data;
strcpy(value, wgroup->type->name);
(void)wgroup;
}
-static int rna_WidgetGroup_name_length(PointerRNA *ptr)
+static int rna_ManipulatorGroup_name_length(PointerRNA *ptr)
{
wmManipulatorGroup *wgroup = ptr->data;
return strlen(wgroup->type->name);
(void)wgroup;
}
-static void rna_WidgetGroup_bl_label_set(PointerRNA *ptr, const char *value)
+static void rna_ManipulatorGroup_bl_label_set(PointerRNA *ptr, const char *value)
{
wmManipulatorGroup *data = ptr->data;
const char *str = data->type->name;
@@ -577,7 +577,7 @@ static void rna_WidgetGroup_bl_label_set(PointerRNA *ptr, const char *value)
assert(!"setting the bl_label on a non-builtin operator");
}
-static int rna_WidgetGroup_has_reports_get(PointerRNA *ptr)
+static int rna_ManipulatorGroup_has_reports_get(PointerRNA *ptr)
{
wmManipulatorGroup *wgroup = ptr->data;
return (wgroup->reports && wgroup->reports->list.first);
@@ -1556,7 +1556,7 @@ static void rna_Operator_bl_undo_group_set(PointerRNA *ptr, const char *value)
}
#ifdef WITH_PYTHON
-static void rna_WidgetGroup_unregister(struct Main *bmain, StructRNA *type)
+static void rna_ManipulatorGroup_unregister(struct Main *bmain, StructRNA *type)
{
//const char *idname;
wmManipulatorGroupType *wgrouptype = RNA_struct_blender_type_get(type);
@@ -1576,10 +1576,10 @@ static void rna_WidgetGroup_unregister(struct Main *bmain, StructRNA *type)
RNA_struct_free(&BLENDER_RNA, type);
}
-static bool widgetgroup_poll(const bContext *C, wmManipulatorGroupType *wgrouptype)
+static bool manipulatorgroup_poll(const bContext *C, wmManipulatorGroupType *wgrouptype)
{
- extern FunctionRNA rna_WidgetGroup_poll_func;
+ extern FunctionRNA rna_ManipulatorGroup_poll_func;
PointerRNA ptr;
ParameterList list;
@@ -1588,7 +1588,7 @@ static bool widgetgroup_poll(const bContext *C, wmManipulatorGroupType *wgroupty
int visible;
RNA_pointer_create(NULL, wgrouptype->ext.srna, NULL, &ptr); /* dummy */
- func = &rna_WidgetGroup_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
+ func = &rna_ManipulatorGroup_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -1602,16 +1602,16 @@ static bool widgetgroup_poll(const bContext *C, wmManipulatorGroupType *wgroupty
return visible;
}
-static void widgetgroup_draw(const bContext *C, wmManipulatorGroup *wgroup)
+static void manipulatorgroup_draw(const bContext *C, wmManipulatorGroup *wgroup)
{
- extern FunctionRNA rna_WidgetGroup_draw_func;
+ extern FunctionRNA rna_ManipulatorGroup_draw_func;
PointerRNA wgroup_ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, wgroup->type->ext.srna, wgroup, &wgroup_ptr);
- func = &rna_WidgetGroup_draw_func; /* RNA_struct_find_function(&wgroupr, "draw"); */
+ func = &rna_ManipulatorGroup_draw_func; /* RNA_struct_find_function(&wgroupr, "draw"); */
RNA_parameter_list_create(&list, &wgroup_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -1620,9 +1620,9 @@ static void widgetgroup_draw(const bContext *C, wmManipulatorGroup *wgroup)
RNA_parameter_list_free(&list);
}
-static wmKeyMap *widgetgroup_keymap_init(const wmManipulatorGroupType *wgrouptype, wmKeyConfig *config)
+static wmKeyMap *manipulatorgroup_keymap_init(const wmManipulatorGroupType *wgrouptype, wmKeyConfig *config)
{
- extern FunctionRNA rna_WidgetGroup_keymap_init_func;
+ extern FunctionRNA rna_ManipulatorGroup_keymap_init_func;
const char *wgroupname = wgrouptype->name;
void *ret;
@@ -1631,7 +1631,7 @@ static wmKeyMap *widgetgroup_keymap_init(const wmManipulatorGroupType *wgrouptyp
FunctionRNA *func;
RNA_pointer_create(NULL, wgrouptype->ext.srna, NULL, &ptr); /* dummy */
- func = &rna_WidgetGroup_keymap_init_func; /* RNA_struct_find_function(&wgroupr, "keymap_init"); */
+ func = &rna_ManipulatorGroup_keymap_init_func; /* RNA_struct_find_function(&wgroupr, "keymap_init"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "keyconfig", &config);
@@ -1651,14 +1651,14 @@ static wmKeyMap *widgetgroup_keymap_init(const wmManipulatorGroupType *wgrouptyp
/* same as exec(), but call cancel */
static void operator_cancel(bContext *C, wmManipulatorGroup *op)
{
- extern FunctionRNA rna_WidgetGroup_cancel_func;
+ extern FunctionRNA rna_ManipulatorGroup_cancel_func;
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func = &rna_WidgetGroup_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
+ func = &rna_ManipulatorGroup_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -1668,9 +1668,9 @@ static void operator_cancel(bContext *C, wmManipulatorGroup *op)
}
#endif
-void widgetgroup_wrapper(wmManipulatorGroupType *mgrouptype, void *userdata);
+void manipulatorgroup_wrapper(wmManipulatorGroupType *mgrouptype, void *userdata);
-static StructRNA *rna_WidgetGroup_register(
+static StructRNA *rna_ManipulatorGroup_register(
Main *bmain, ReportList *reports, void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
@@ -1680,16 +1680,16 @@ static StructRNA *rna_WidgetGroup_register(
PointerRNA wgptr;
int have_function[3];
- /* setup dummy widgetgroup & widgetgroup type to store static properties in */
+ /* setup dummy manipulatorgroup & manipulatorgroup type to store static properties in */
dummywg.type = &dummywgt;
- RNA_pointer_create(NULL, &RNA_WidgetGroup, &dummywg, &wgptr);
+ RNA_pointer_create(NULL, &RNA_ManipulatorGroup, &dummywg, &wgptr);
/* validate the python class */
if (validate(&wgptr, data, have_function) != 0)
return NULL;
if (strlen(identifier) >= sizeof(dummywgt.idname)) {
- BKE_reportf(reports, RPT_ERROR, "Registering widgetgroup class: '%s' is too long, maximum length is %d",
+ BKE_reportf(reports, RPT_ERROR, "Registering manipulatorgroup class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummywgt.idname));
return NULL;
}
@@ -1703,11 +1703,11 @@ static StructRNA *rna_WidgetGroup_register(
wmManipulatorMapType *wmaptype = WM_manipulatormaptype_ensure(&wmap_params);
if (wmaptype == NULL) {
- BKE_reportf(reports, RPT_ERROR, "Area type does not support widgets");
+ BKE_reportf(reports, RPT_ERROR, "Area type does not support manipulators");
return NULL;
}
- /* check if we have registered this widgetgroup type before, and remove it */
+ /* check if we have registered this manipulatorgroup type before, and remove it */
{
wmManipulatorGroupType *wgrouptype = WM_manipulatorgrouptype_find(wmaptype, dummywgt.idname);
if (wgrouptype && wgrouptype->ext.srna) {
@@ -1716,20 +1716,20 @@ static StructRNA *rna_WidgetGroup_register(
}
}
- /* create a new widgetgroup type */
- dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_WidgetGroup);
- RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); /* widgetgroup properties are registered separately */
+ /* create a new manipulatorgroup type */
+ dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_ManipulatorGroup);
+ RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); /* manipulatorgroup properties are registered separately */
dummywgt.ext.data = data;
dummywgt.ext.call = call;
dummywgt.ext.free = free;
/* We used to register wid
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list