diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-09 23:20:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-11 01:06:54 +0300 |
commit | 5c6e3337801b493926210e96237be2b495fc5d1b (patch) | |
tree | 5ca4bd778c2d552a7eaf0645c3c1bc6be86d9e5d /source/blender/editors/space_node/node_templates.c | |
parent | 2b107beffd9b408ac1464288d07ee96214c09a30 (diff) |
UI Refactor T41640
Make the UI API more consistent and reduce confusion with some naming.
mainly:
- API function calls
- enum values
some internal static functions have been left for now
Diffstat (limited to 'source/blender/editors/space_node/node_templates.c')
-rw-r--r-- | source/blender/editors/space_node/node_templates.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 99a481e5d82..692aebb9072 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -454,7 +454,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) if (first) { column = uiLayoutColumn(layout, 0); - uiBlockSetCurLayout(block, column); + UI_block_layout_set_current(block, column); uiItemL(column, IFACE_(cname), ICON_NODE); but = block->buttons.last; @@ -466,7 +466,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) if (!cur_node_name || !STREQ(cur_node_name, items[i].node_name)) { cur_node_name = items[i].node_name; /* XXX Do not use uiItemL here, it would add an empty icon as we are in a menu! */ - uiDefBut(block, LABEL, 0, IFACE_(cur_node_name), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_(cur_node_name), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, ""); } @@ -478,12 +478,12 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) icon = ICON_NONE; } - but = uiDefIconTextBut(block, BUT, 0, icon, name, 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, + but = uiDefIconTextBut(block, UI_BTYPE_BUT, 0, icon, name, 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Add node to input")); argN = MEM_dupallocN(arg); argN->item = items[i]; - uiButSetNFunc(but, ui_node_link, argN, NULL); + UI_but_funcN_set(but, ui_node_link, argN, NULL); } if (items) @@ -511,8 +511,8 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_ bNodeSocket *sock = arg->sock; bNodeTreeType *ntreetype = arg->ntree->typeinfo; - uiBlockSetFlag(block, UI_BLOCK_NO_FLIP); - uiBlockSetCurLayout(block, layout); + UI_block_flag_enable(block, UI_BLOCK_NO_FLIP); + UI_block_layout_set_current(block, layout); split = uiLayoutSplit(layout, 0.0f, false); arg->bmain = bmain; @@ -523,20 +523,20 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_ ntreetype->foreach_nodeclass(scene, arg, node_menu_column_foreach_cb); column = uiLayoutColumn(split, false); - uiBlockSetCurLayout(block, column); + UI_block_layout_set_current(block, column); if (sock->link) { uiItemL(column, IFACE_("Link"), ICON_NONE); but = block->buttons.last; but->drawflag = UI_BUT_TEXT_LEFT; - but = uiDefBut(block, BUT, 0, IFACE_("Remove"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, + but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Remove"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Remove nodes connected to the input")); - uiButSetNFunc(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_REMOVE)); + UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_REMOVE)); - but = uiDefBut(block, BUT, 0, IFACE_("Disconnect"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, + but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Disconnect"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Disconnect nodes connected to the input")); - uiButSetNFunc(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_DISCONNECT)); + UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_DISCONNECT)); } ui_node_menu_column(arg, NODE_CLASS_GROUP, N_("Group")); @@ -553,7 +553,7 @@ void uiTemplateNodeLink(uiLayout *layout, bNodeTree *ntree, bNode *node, bNodeSo arg->node = node; arg->sock = sock; - uiBlockSetCurLayout(block, layout); + UI_block_layout_set_current(block, layout); if (sock->link || sock->type == SOCK_SHADER || (sock->flag & SOCK_HIDE_VALUE)) { char name[UI_MAX_NAME_STR]; @@ -563,7 +563,7 @@ void uiTemplateNodeLink(uiLayout *layout, bNodeTree *ntree, bNode *node, bNodeSo else but = uiDefIconMenuBut(block, ui_template_node_link_menu, NULL, ICON_NONE, 0, 0, UI_UNIT_X, UI_UNIT_Y, ""); - uiButSetMenuFromPulldown(but); + UI_but_type_set_menu_from_pulldown(but); but->flag |= UI_BUT_NODE_LINK; but->poin = (char *)but; @@ -638,7 +638,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, row = uiLayoutRow(split, true); if (depth > 0) { - uiBlockSetEmboss(block, UI_EMBOSSN); + UI_block_emboss_set(block, UI_EMBOSS_NONE); 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; @@ -650,7 +650,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, bt = block->buttons.last; bt->rect.xmax = UI_UNIT_X / 2; - uiBlockSetEmboss(block, UI_EMBOSS); + UI_block_emboss_set(block, UI_EMBOSS); } uiItemL(row, label, ICON_NONE); |