Cleanup: Remove unused node editor button event defines
These defines seem to be left over from the initial implementation of the node editor. In a few places the values were used in button creation, but the callbacks never checked the value anyway. Node uiBlocks also had a callback what would never do anything since the value it checked for was never used.
This commit is contained in:
@@ -302,16 +302,6 @@ void ED_node_sort(bNodeTree *ntree)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_node_internal_buttons(bContext *C, void *UNUSED(node_v), int event)
|
|
||||||
{
|
|
||||||
if (event == B_NODE_EXEC) {
|
|
||||||
SpaceNode *snode = CTX_wm_space_node(C);
|
|
||||||
if (snode && snode->id) {
|
|
||||||
ED_node_tag_update_id(snode->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void node_uiblocks_init(const bContext *C, bNodeTree *ntree)
|
static void node_uiblocks_init(const bContext *C, bNodeTree *ntree)
|
||||||
{
|
{
|
||||||
/* Add node uiBlocks in drawing order - prevents events going to overlapping nodes. */
|
/* Add node uiBlocks in drawing order - prevents events going to overlapping nodes. */
|
||||||
@@ -321,7 +311,6 @@ static void node_uiblocks_init(const bContext *C, bNodeTree *ntree)
|
|||||||
char uiblockstr[32];
|
char uiblockstr[32];
|
||||||
BLI_snprintf(uiblockstr, sizeof(uiblockstr), "node buttons %p", (void *)node);
|
BLI_snprintf(uiblockstr, sizeof(uiblockstr), "node buttons %p", (void *)node);
|
||||||
node->block = UI_block_begin(C, CTX_wm_region(C), uiblockstr, UI_EMBOSS);
|
node->block = UI_block_begin(C, CTX_wm_region(C), uiblockstr, UI_EMBOSS);
|
||||||
UI_block_func_handle_set(node->block, do_node_internal_buttons, node);
|
|
||||||
|
|
||||||
/* this cancels events for background nodes */
|
/* this cancels events for background nodes */
|
||||||
UI_block_flag_enable(node->block, UI_BLOCK_CLIP_EVENTS);
|
UI_block_flag_enable(node->block, UI_BLOCK_CLIP_EVENTS);
|
||||||
@@ -1354,7 +1343,7 @@ static void node_draw_basis(const bContext *C,
|
|||||||
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
||||||
uiBut *but = uiDefIconBut(node->block,
|
uiBut *but = uiDefIconBut(node->block,
|
||||||
UI_BTYPE_BUT_TOGGLE,
|
UI_BTYPE_BUT_TOGGLE,
|
||||||
B_REDR,
|
0,
|
||||||
ICON_MATERIAL,
|
ICON_MATERIAL,
|
||||||
iconofs,
|
iconofs,
|
||||||
rct->ymax - NODE_DY,
|
rct->ymax - NODE_DY,
|
||||||
@@ -1380,7 +1369,7 @@ static void node_draw_basis(const bContext *C,
|
|||||||
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
||||||
uiBut *but = uiDefIconBut(node->block,
|
uiBut *but = uiDefIconBut(node->block,
|
||||||
UI_BTYPE_BUT_TOGGLE,
|
UI_BTYPE_BUT_TOGGLE,
|
||||||
B_REDR,
|
0,
|
||||||
ICON_NODETREE,
|
ICON_NODETREE,
|
||||||
iconofs,
|
iconofs,
|
||||||
rct->ymax - NODE_DY,
|
rct->ymax - NODE_DY,
|
||||||
@@ -1432,7 +1421,7 @@ static void node_draw_basis(const bContext *C,
|
|||||||
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
||||||
uiBut *but = uiDefBut(node->block,
|
uiBut *but = uiDefBut(node->block,
|
||||||
UI_BTYPE_BUT_TOGGLE,
|
UI_BTYPE_BUT_TOGGLE,
|
||||||
B_REDR,
|
0,
|
||||||
"",
|
"",
|
||||||
rct->xmin + 0.35f * U.widget_unit,
|
rct->xmin + 0.35f * U.widget_unit,
|
||||||
rct->ymax - NODE_DY / 2.2f - but_size / 2,
|
rct->ymax - NODE_DY / 2.2f - but_size / 2,
|
||||||
@@ -1607,7 +1596,7 @@ static void node_draw_hidden(const bContext *C,
|
|||||||
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
|
||||||
uiBut *but = uiDefBut(node->block,
|
uiBut *but = uiDefBut(node->block,
|
||||||
UI_BTYPE_BUT_TOGGLE,
|
UI_BTYPE_BUT_TOGGLE,
|
||||||
B_REDR,
|
0,
|
||||||
"",
|
"",
|
||||||
rct->xmin + 0.35f * U.widget_unit,
|
rct->xmin + 0.35f * U.widget_unit,
|
||||||
centy - but_size / 2,
|
centy - but_size / 2,
|
||||||
|
@@ -307,26 +307,6 @@ extern const char *node_context_dir[];
|
|||||||
#define NODE_RESIZE_MARGIN (0.20f * U.widget_unit)
|
#define NODE_RESIZE_MARGIN (0.20f * U.widget_unit)
|
||||||
#define NODE_LINK_RESOL 12
|
#define NODE_LINK_RESOL 12
|
||||||
|
|
||||||
/* Button events (butspace) */
|
|
||||||
enum eNodeSpace_ButEvents {
|
|
||||||
B_NOP = 0,
|
|
||||||
B_REDR = 1,
|
|
||||||
B_NODE_USEMAT,
|
|
||||||
B_NODE_USESCENE,
|
|
||||||
B_NODE_USETEX,
|
|
||||||
B_TEXBROWSE,
|
|
||||||
B_TEXALONE,
|
|
||||||
B_TEXLOCAL,
|
|
||||||
B_TEXDELETE,
|
|
||||||
B_TEXPRV,
|
|
||||||
B_AUTOTEXNAME,
|
|
||||||
B_KEEPDATA,
|
|
||||||
B_NODE_EXEC,
|
|
||||||
B_MATPRV,
|
|
||||||
B_NODE_LOADIMAGE,
|
|
||||||
B_NODE_SETIMAGE,
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user