diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-20 19:36:56 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-20 19:36:56 +0300 |
commit | 902a103f8092b6a69e28ea76f3cfdca14dc9a8b8 (patch) | |
tree | eab29e5a8051ee693fbfaccef1d9c384b2de304c /source/blender/editors/space_node/space_node.cc | |
parent | 19622ffc5b84475a6c3b56ff0595811a503f461c (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/space_node.cc')
-rw-r--r-- | source/blender/editors/space_node/space_node.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index 8e986217ffe..40a7e3e616e 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -206,6 +206,18 @@ void ED_node_set_active_viewer_key(SpaceNode *snode) } } +void ED_node_cursor_location_get(const SpaceNode *snode, float value[2]) +{ + copy_v2_v2(value, snode->runtime->cursor); +} + +void ED_node_cursor_location_set(SpaceNode *snode, const float value[2]) +{ + copy_v2_v2(snode->runtime->cursor, value); +} + +namespace blender::ed::space_node { + float2 space_node_group_offset(const SpaceNode &snode) { const bNodeTreePath *path = (bNodeTreePath *)snode.treepath.last; @@ -556,16 +568,6 @@ static void node_toolbar_region_draw(const bContext *C, ARegion *region) ED_region_panels(C, region); } -void ED_node_cursor_location_get(const SpaceNode *snode, float value[2]) -{ - copy_v2_v2(value, snode->runtime->cursor); -} - -void ED_node_cursor_location_set(SpaceNode *snode, const float value[2]) -{ - copy_v2_v2(snode->runtime->cursor, value); -} - static void node_cursor(wmWindow *win, ScrArea *area, ARegion *region) { SpaceNode *snode = (SpaceNode *)area->spacedata.first; @@ -978,8 +980,12 @@ static void node_space_subtype_item_extend(bContext *C, EnumPropertyItem **item, } } +} // namespace blender::ed::space_node + void ED_spacetype_node() { + using namespace blender::ed::space_node; + SpaceType *st = MEM_cnew<SpaceType>("spacetype node"); ARegionType *art; |