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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-10-10 15:33:20 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-10-10 15:33:20 +0400
commit77a0b90cdf5d42b774f75b392aa0e3aeb7ed3452 (patch)
tree26f13efed3174bb02f0619476f2888da54777f52 /source/blender/makesrna/intern/rna_nodetree.c
parentbbd9b5f47667138b192b011d338293b217bb4a1e (diff)
Cleanup: Consistent names for draw callbacks in bNodeType.
This aims to establish a common pattern for the various confusing draw callback function pointers in bNodeType: draw_<purpose>_<nodetype>[_ex] Currently there are 4 different types of draw callbacks: * draw_nodetype, draw_nodetype_prepare: Main draw functions, allows specialized node drawing for things like frames and reroute nodes. Not exposed in the API. * draw_buttons, draw_buttons_ex: Optional non-socket buttons, most commonly used callback. Extended version used in sidebar for verbose buttons that don't fit into a node. * draw_backdrop: Draw elements in the backdrop (compositor only). Not exposed in the API. * draw_input, draw_output: Specialized socket drawing for some nodes, only for OutputFile node. Should not be used any further and be removed at some point. Not exposed in the API.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 8ad19735517..e8f393efc98 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1377,8 +1377,8 @@ static bNodeType *rna_Node_register_base(Main *bmain, ReportList *reports, Struc
nt->initfunc_api = (have_function[3]) ? rna_Node_init : NULL;
nt->copyfunc_api = (have_function[4]) ? rna_Node_copy : NULL;
nt->freefunc_api = (have_function[5]) ? rna_Node_free : NULL;
- nt->uifunc = (have_function[6]) ? rna_Node_draw_buttons : NULL;
- nt->uifuncbut = (have_function[7]) ? rna_Node_draw_buttons_ext : NULL;
+ nt->draw_buttons = (have_function[6]) ? rna_Node_draw_buttons : NULL;
+ nt->draw_buttons_ex = (have_function[7]) ? rna_Node_draw_buttons_ext : NULL;
/* sanitize size values in case not all have been registered */
if (nt->maxwidth < nt->minwidth)
@@ -2336,24 +2336,24 @@ static void rna_NodeInternal_update(ID *id, bNode *node)
static void rna_NodeInternal_draw_buttons(ID *id, bNode *node, struct bContext *C, struct uiLayout *layout)
{
- if (node->typeinfo->uifunc) {
+ if (node->typeinfo->draw_buttons) {
PointerRNA ptr;
RNA_pointer_create(id, &RNA_Node, node, &ptr);
- node->typeinfo->uifunc(layout, C, &ptr);
+ node->typeinfo->draw_buttons(layout, C, &ptr);
}
}
static void rna_NodeInternal_draw_buttons_ext(ID *id, bNode *node, struct bContext *C, struct uiLayout *layout)
{
- if (node->typeinfo->uifuncbut) {
+ if (node->typeinfo->draw_buttons_ex) {
PointerRNA ptr;
RNA_pointer_create(id, &RNA_Node, node, &ptr);
- node->typeinfo->uifuncbut(layout, C, &ptr);
+ node->typeinfo->draw_buttons_ex(layout, C, &ptr);
}
- else if (node->typeinfo->uifunc) {
+ else if (node->typeinfo->draw_buttons) {
PointerRNA ptr;
RNA_pointer_create(id, &RNA_Node, node, &ptr);
- node->typeinfo->uifunc(layout, C, &ptr);
+ node->typeinfo->draw_buttons(layout, C, &ptr);
}
}