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:
authorHans Goudey <h.goudey@me.com>2022-01-20 19:36:56 +0300
committerHans Goudey <h.goudey@me.com>2022-01-20 19:36:56 +0300
commit902a103f8092b6a69e28ea76f3cfdca14dc9a8b8 (patch)
treeeab29e5a8051ee693fbfaccef1d9c384b2de304c /source/blender/editors/space_node/node_templates.cc
parent19622ffc5b84475a6c3b56ff0595811a503f461c (diff)
Cleanup: Move node editor files to proper namespace
This commit moves code in all node editor files to the `blender::ed::space_node` namespace, except for C API functions defined in `ED_node.h`, which can only be moved once all areas calling them are moved to C++. The change is fairly straightforward, I just moved a couple of "ED_" code blocks around to make the namespace more contiguous, and there's the method for adding a pointer to a struct in a C++ namespace in DNA. Differential Revision: https://developer.blender.org/D13871
Diffstat (limited to 'source/blender/editors/space_node/node_templates.cc')
-rw-r--r--source/blender/editors/space_node/node_templates.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/node_templates.cc b/source/blender/editors/space_node/node_templates.cc
index 74c0d2124cd..113e2bd3bb3 100644
--- a/source/blender/editors/space_node/node_templates.cc
+++ b/source/blender/editors/space_node/node_templates.cc
@@ -53,9 +53,10 @@
#include "ED_undo.h"
-using blender::Vector;
using blender::nodes::NodeDeclaration;
+namespace blender::ed::space_node {
+
/************************* Node Socket Manipulation **************************/
/* describes an instance of a node type and a specific socket to link */
@@ -716,9 +717,13 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_
ui_node_menu_column(arg, NODE_CLASS_GROUP, N_("Group"));
}
+} // namespace blender::ed::space_node
+
void uiTemplateNodeLink(
uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
{
+ using namespace blender::ed::space_node;
+
uiBlock *block = uiLayoutGetBlock(layout);
NodeLinkArg *arg;
uiBut *but;
@@ -760,6 +765,8 @@ void uiTemplateNodeLink(
}
}
+namespace blender::ed::space_node {
+
/**************************** Node Tree Layout *******************************/
static void ui_node_draw_input(
@@ -912,9 +919,13 @@ static void ui_node_draw_input(
node->flag &= ~NODE_TEST;
}
+} // namespace blender::ed::space_node
+
void uiTemplateNodeView(
uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
{
+ using namespace blender::ed::space_node;
+
bNode *tnode;
if (!ntree) {