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/editors/space_node/node_templates.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/editors/space_node/node_templates.c')
-rw-r--r--source/blender/editors/space_node/node_templates.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 83c11e69d84..a67a8791a64 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -207,7 +207,7 @@ static void node_socket_add_replace(const bContext *C, bNodeTree *ntree, bNode *
break;
if (node_from)
- if (node_from->inputs.first || node_from->typeinfo->uifunc || node_from->typeinfo->uifuncbut)
+ if (node_from->inputs.first || node_from->typeinfo->draw_buttons || node_from->typeinfo->draw_buttons_ex)
node_from = NULL;
if (node_prev && node_prev->type == type && node_link_item_compare(node_prev, item)) {
@@ -586,13 +586,13 @@ static void ui_node_draw_node(uiLayout *layout, bContext *C, bNodeTree *ntree, b
RNA_pointer_create(&ntree->id, &RNA_Node, node, &nodeptr);
- if (node->typeinfo->uifunc) {
+ if (node->typeinfo->draw_buttons) {
if (node->type != NODE_GROUP) {
split = uiLayoutSplit(layout, 0.35f, FALSE);
col = uiLayoutColumn(split, FALSE);
col = uiLayoutColumn(split, FALSE);
- node->typeinfo->uifunc(col, C, &nodeptr);
+ node->typeinfo->draw_buttons(col, C, &nodeptr);
}
}
@@ -639,7 +639,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
if (depth > 0) {
uiBlockSetEmboss(block, UI_EMBOSSN);
- if (lnode && (lnode->inputs.first || (lnode->typeinfo->uifunc && lnode->type != NODE_GROUP))) {
+ if (lnode && (lnode->inputs.first || (lnode->typeinfo->draw_buttons && lnode->type != NODE_GROUP))) {
int icon = (input->flag & SOCK_COLLAPSED) ? ICON_DISCLOSURE_TRI_RIGHT : ICON_DISCLOSURE_TRI_DOWN;
uiItemR(row, &inputptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", icon);
}