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/node_intern.hh | |
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/node_intern.hh')
-rw-r--r-- | source/blender/editors/space_node/node_intern.hh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh index 6016bf5da71..9bd5c0ba00b 100644 --- a/source/blender/editors/space_node/node_intern.hh +++ b/source/blender/editors/space_node/node_intern.hh @@ -45,10 +45,12 @@ struct wmGizmoGroupType; struct wmKeyConfig; struct wmWindow; +namespace blender::ed::space_node { + /** Temporary data used in node link drag modal operator. */ struct bNodeLinkDrag { /** Links dragged by the operator. */ - blender::Vector<bNodeLink *> links; + Vector<bNodeLink *> links; bool from_multi_input_socket; eNodeSocketInOut in_out; @@ -82,7 +84,7 @@ struct SpaceNode_Runtime { float aspect; /** Mouse position for drawing socket-less links and adding nodes. */ - blender::float2 cursor; + float2 cursor; /** For auto compositing. */ bool recalc; @@ -107,12 +109,12 @@ ENUM_OPERATORS(NodeResizeDirection, NODE_RESIZE_LEFT); /** * Transform between View2Ds in the tree path. */ -blender::float2 space_node_group_offset(const SpaceNode &snode); +float2 space_node_group_offset(const SpaceNode &snode); float node_socket_calculate_height(const bNodeSocket &socket); -blender::float2 node_link_calculate_multi_input_position(const blender::float2 &socket_position, - int index, - int total_inputs); +float2 node_link_calculate_multi_input_position(const float2 &socket_position, + int index, + int total_inputs); int node_get_resize_cursor(NodeResizeDirection directions); NodeResizeDirection node_get_resize_direction(const bNode *node, int x, int y); @@ -133,11 +135,11 @@ void node_draw_space(const bContext &C, ARegion ®ion); */ void node_sort(bNodeTree &ntree); -void node_set_cursor(wmWindow &win, SpaceNode &snode, const blender::float2 &cursor); +void node_set_cursor(wmWindow &win, SpaceNode &snode, const float2 &cursor); /* DPI scaled coords */ -blender::float2 node_to_view(const bNode &node, const blender::float2 &co); +float2 node_to_view(const bNode &node, const float2 &co); void node_to_updated_rect(const bNode &node, rctf &r_rect); -blender::float2 node_from_view(const bNode &node, const blender::float2 &co); +float2 node_from_view(const bNode &node, const float2 &co); void node_operatortypes(); void node_keymap(wmKeyConfig *keyconf); @@ -237,7 +239,7 @@ void NODE_OT_group_edit(wmOperatorType *ot); void sort_multi_input_socket_links(SpaceNode &snode, bNode &node, bNodeLink *drag_link, - const blender::float2 *cursor); + const float2 *cursor); void NODE_OT_link(wmOperatorType *ot); void NODE_OT_link_make(wmOperatorType *ot); @@ -267,7 +269,7 @@ int node_render_changed_exec(bContext *, wmOperator *); bool node_find_indicated_socket(SpaceNode &snode, bNode **nodep, bNodeSocket **sockp, - const blender::float2 &cursor, + const float2 &cursor, eNodeSocketInOut in_out); float node_link_dim_factor(const View2D &v2d, const bNodeLink &link); bool node_link_is_hidden_or_dimmed(const View2D &v2d, const bNodeLink &link); @@ -339,8 +341,6 @@ extern const char *node_context_dir[]; #define NODE_RESIZE_MARGIN (0.20f * U.widget_unit) #define NODE_LINK_RESOL 12 -namespace blender::ed::space_node { - Vector<ui::ContextPathItem> context_path_for_space_node(const bContext &C); void invoke_node_link_drag_add_menu(bContext &C, |