From 902a103f8092b6a69e28ea76f3cfdca14dc9a8b8 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 20 Jan 2022 10:36:56 -0600 Subject: 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 --- source/blender/editors/space_node/node_ops.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/space_node/node_ops.cc') diff --git a/source/blender/editors/space_node/node_ops.cc b/source/blender/editors/space_node/node_ops.cc index a6264f151e4..2ca475f6948 100644 --- a/source/blender/editors/space_node/node_ops.cc +++ b/source/blender/editors/space_node/node_ops.cc @@ -35,6 +35,8 @@ #include "node_intern.hh" /* own include */ +namespace blender::ed::space_node { + void node_operatortypes() { WM_operatortype_append(NODE_OT_select); @@ -127,6 +129,17 @@ void node_operatortypes() WM_operatortype_append(NODE_OT_cryptomatte_layer_remove); } +void node_keymap(struct wmKeyConfig *keyconf) +{ + /* Entire Editor only ----------------- */ + WM_keymap_ensure(keyconf, "Node Generic", SPACE_NODE, 0); + + /* Main Region only ----------------- */ + WM_keymap_ensure(keyconf, "Node Editor", SPACE_NODE, 0); +} + +} // namespace blender::ed::space_node + void ED_operatormacros_node() { wmOperatorType *ot; @@ -203,12 +216,3 @@ void ED_operatormacros_node() WM_operatortype_macro_define(ot, "NODE_OT_links_detach"); WM_operatortype_macro_define(ot, "NODE_OT_translate_attach"); } - -void node_keymap(struct wmKeyConfig *keyconf) -{ - /* Entire Editor only ----------------- */ - WM_keymap_ensure(keyconf, "Node Generic", SPACE_NODE, 0); - - /* Main Region only ----------------- */ - WM_keymap_ensure(keyconf, "Node Editor", SPACE_NODE, 0); -} -- cgit v1.2.3