diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 29212a6c246..aeed452c039 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -76,7 +76,7 @@ set(SRC NOD_texture.h intern/node_common.h intern/node_exec.h - intern/node_util.h + intern/node_util.hh ) set(LIB diff --git a/source/blender/nodes/composite/node_composite_tree.cc b/source/blender/nodes/composite/node_composite_tree.cc index 46134eebd03..9d442e8ea95 100644 --- a/source/blender/nodes/composite/node_composite_tree.cc +++ b/source/blender/nodes/composite/node_composite_tree.cc @@ -25,7 +25,7 @@ #include "UI_resources.h" #include "node_common.h" -#include "node_util.h" +#include "node_util.hh" #include "RNA_access.h" #include "RNA_prototypes.h" diff --git a/source/blender/nodes/composite/node_composite_util.hh b/source/blender/nodes/composite/node_composite_util.hh index 15a8362bafa..b883af05ff3 100644 --- a/source/blender/nodes/composite/node_composite_util.hh +++ b/source/blender/nodes/composite/node_composite_util.hh @@ -13,7 +13,7 @@ #include "BLT_translation.h" #include "node_composite_register.hh" -#include "node_util.h" +#include "node_util.hh" #include "NOD_composite.h" #include "NOD_socket.h" diff --git a/source/blender/nodes/function/node_function_util.cc b/source/blender/nodes/function/node_function_util.cc index fe55f3c9d52..3cee9cbf29e 100644 --- a/source/blender/nodes/function/node_function_util.cc +++ b/source/blender/nodes/function/node_function_util.cc @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "node_function_util.hh" -#include "node_util.h" +#include "node_util.hh" #include "NOD_add_node_search.hh" #include "NOD_socket_search_link.hh" diff --git a/source/blender/nodes/function/node_function_util.hh b/source/blender/nodes/function/node_function_util.hh index 493c4f8bb84..67155332b02 100644 --- a/source/blender/nodes/function/node_function_util.hh +++ b/source/blender/nodes/function/node_function_util.hh @@ -19,7 +19,7 @@ #include "NOD_socket_declarations.hh" #include "node_function_register.hh" -#include "node_util.h" +#include "node_util.hh" #include "FN_multi_function_builder.hh" diff --git a/source/blender/nodes/geometry/node_geometry_util.cc b/source/blender/nodes/geometry/node_geometry_util.cc index 6ba11d3620e..bddd4775c85 100644 --- a/source/blender/nodes/geometry/node_geometry_util.cc +++ b/source/blender/nodes/geometry/node_geometry_util.cc @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "node_geometry_util.hh" -#include "node_util.h" +#include "node_util.hh" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" diff --git a/source/blender/nodes/geometry/node_geometry_util.hh b/source/blender/nodes/geometry/node_geometry_util.hh index 7d94fe13195..bebb09e54b2 100644 --- a/source/blender/nodes/geometry/node_geometry_util.hh +++ b/source/blender/nodes/geometry/node_geometry_util.hh @@ -25,7 +25,7 @@ #include "RNA_access.h" #include "node_geometry_register.hh" -#include "node_util.h" +#include "node_util.hh" #ifdef WITH_OPENVDB # include diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc index 8f57851568b..9a6088803b8 100644 --- a/source/blender/nodes/intern/node_common.cc +++ b/source/blender/nodes/intern/node_common.cc @@ -37,7 +37,7 @@ #include "NOD_socket_declarations.hh" #include "NOD_socket_declarations_geometry.hh" #include "node_common.h" -#include "node_util.h" +#include "node_util.hh" using blender::Map; using blender::MultiValueMap; diff --git a/source/blender/nodes/intern/node_exec.cc b/source/blender/nodes/intern/node_exec.cc index 74dc73c84e2..61ae1ff2ab2 100644 --- a/source/blender/nodes/intern/node_exec.cc +++ b/source/blender/nodes/intern/node_exec.cc @@ -18,7 +18,7 @@ #include "MEM_guardedalloc.h" #include "node_exec.h" -#include "node_util.h" +#include "node_util.hh" static int node_exec_socket_use_stack(bNodeSocket *sock) { diff --git a/source/blender/nodes/intern/node_exec.h b/source/blender/nodes/intern/node_exec.h index 1c24d20da16..ccdec401e73 100644 --- a/source/blender/nodes/intern/node_exec.h +++ b/source/blender/nodes/intern/node_exec.h @@ -13,7 +13,7 @@ #include "BKE_node.h" -#include "node_util.h" +#include "node_util.hh" #include "RNA_types.h" diff --git a/source/blender/nodes/intern/node_util.cc b/source/blender/nodes/intern/node_util.cc index b725b24ba0b..3ac03dad68e 100644 --- a/source/blender/nodes/intern/node_util.cc +++ b/source/blender/nodes/intern/node_util.cc @@ -30,7 +30,7 @@ #include "NOD_common.h" -#include "node_util.h" +#include "node_util.hh" /* -------------------------------------------------------------------- */ /** \name Storage Data diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h deleted file mode 100644 index c599c45495e..00000000000 --- a/source/blender/nodes/intern/node_util.h +++ /dev/null @@ -1,101 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later - * Copyright 2007 Blender Foundation */ - -/** \file - * \ingroup nodes - */ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -struct bNode; -struct bNodeTree; - -/* data for initializing node execution */ -typedef struct bNodeExecContext { - struct bNodeInstanceHash *previews; -} bNodeExecContext; - -typedef struct bNodeExecData { - void *data; /* custom data storage */ - struct bNodePreview *preview; /* optional preview image */ -} bNodeExecData; - -/**** Storage Data ****/ - -void node_free_curves(struct bNode *node); -void node_free_standard_storage(struct bNode *node); - -void node_copy_curves(struct bNodeTree *dest_ntree, - struct bNode *dest_node, - const struct bNode *src_node); -void node_copy_standard_storage(struct bNodeTree *dest_ntree, - struct bNode *dest_node, - const struct bNode *src_node); -void *node_initexec_curves(struct bNodeExecContext *context, - struct bNode *node, - bNodeInstanceKey key); - -/**** Updates ****/ -void node_sock_label(struct bNodeSocket *sock, const char *name); -void node_sock_label_clear(struct bNodeSocket *sock); -void node_math_update(struct bNodeTree *ntree, struct bNode *node); - -/**** Labels ****/ -void node_blend_label(const struct bNodeTree *ntree, - const struct bNode *node, - char *label, - int maxlen); -void node_image_label(const struct bNodeTree *ntree, - const struct bNode *node, - char *label, - int maxlen); -void node_math_label(const struct bNodeTree *ntree, - const struct bNode *node, - char *label, - int maxlen); -void node_vector_math_label(const struct bNodeTree *ntree, - const struct bNode *node, - char *label, - int maxlen); -void node_filter_label(const struct bNodeTree *ntree, - const struct bNode *node, - char *label, - int maxlen); -void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode); - -/*** Link Handling */ - -/** - * By default there are no links we don't want to connect, when inserting. - */ -bool node_insert_link_default(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link); - -float node_socket_get_float(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock); -void node_socket_set_float(struct bNodeTree *ntree, - struct bNode *node, - struct bNodeSocket *sock, - float value); -void node_socket_get_color(struct bNodeTree *ntree, - struct bNode *node, - struct bNodeSocket *sock, - float *value); -void node_socket_set_color(struct bNodeTree *ntree, - struct bNode *node, - struct bNodeSocket *sock, - const float *value); -void node_socket_get_vector(struct bNodeTree *ntree, - struct bNode *node, - struct bNodeSocket *sock, - float *value); -void node_socket_set_vector(struct bNodeTree *ntree, - struct bNode *node, - struct bNodeSocket *sock, - const float *value); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/nodes/intern/node_util.hh b/source/blender/nodes/intern/node_util.hh new file mode 100644 index 00000000000..6ae3619c2c2 --- /dev/null +++ b/source/blender/nodes/intern/node_util.hh @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright 2007 Blender Foundation */ + +/** \file + * \ingroup nodes + */ + +#pragma once + +struct bNode; +struct bNodeTree; + +/* data for initializing node execution */ +struct bNodeExecContext { + struct bNodeInstanceHash *previews; +}; + +struct bNodeExecData { + void *data; /* custom data storage */ + bNodePreview *preview; /* optional preview image */ +}; + +/**** Storage Data ****/ + +void node_free_curves(bNode *node); +void node_free_standard_storage(bNode *node); + +void node_copy_curves(bNodeTree *dest_ntree, + bNode *dest_node, + const bNode *src_node); +void node_copy_standard_storage(bNodeTree *dest_ntree, + bNode *dest_node, + const bNode *src_node); +void *node_initexec_curves(bNodeExecContext *context, + bNode *node, + bNodeInstanceKey key); + +/**** Updates ****/ +void node_sock_label(bNodeSocket *sock, const char *name); +void node_sock_label_clear(bNodeSocket *sock); +void node_math_update(bNodeTree *ntree, bNode *node); + +/**** Labels ****/ +void node_blend_label(const bNodeTree *ntree, + const bNode *node, + char *label, + int maxlen); +void node_image_label(const bNodeTree *ntree, + const bNode *node, + char *label, + int maxlen); +void node_math_label(const bNodeTree *ntree, + const bNode *node, + char *label, + int maxlen); +void node_vector_math_label(const bNodeTree *ntree, + const bNode *node, + char *label, + int maxlen); +void node_filter_label(const bNodeTree *ntree, + const bNode *node, + char *label, + int maxlen); +void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode); + +/*** Link Handling */ + +/** + * By default there are no links we don't want to connect, when inserting. + */ +bool node_insert_link_default(bNodeTree *ntree, bNode *node, bNodeLink *link); + +float node_socket_get_float(bNodeTree *ntree, bNode *node, bNodeSocket *sock); +void node_socket_set_float(bNodeTree *ntree, + bNode *node, + bNodeSocket *sock, + float value); +void node_socket_get_color(bNodeTree *ntree, + bNode *node, + bNodeSocket *sock, + float *value); +void node_socket_set_color(bNodeTree *ntree, + bNode *node, + bNodeSocket *sock, + const float *value); +void node_socket_get_vector(bNodeTree *ntree, + bNode *node, + bNodeSocket *sock, + float *value); +void node_socket_set_vector(bNodeTree *ntree, + bNode *node, + bNodeSocket *sock, + const float *value); diff --git a/source/blender/nodes/shader/node_shader_tree.cc b/source/blender/nodes/shader/node_shader_tree.cc index c7f2266c7e6..0b02f443a2a 100644 --- a/source/blender/nodes/shader/node_shader_tree.cc +++ b/source/blender/nodes/shader/node_shader_tree.cc @@ -48,7 +48,7 @@ #include "node_common.h" #include "node_exec.h" #include "node_shader_util.hh" -#include "node_util.h" +#include "node_util.hh" using blender::Array; using blender::Vector; diff --git a/source/blender/nodes/shader/node_shader_util.hh b/source/blender/nodes/shader/node_shader_util.hh index 6ebfd441405..2e2f6f39a6b 100644 --- a/source/blender/nodes/shader/node_shader_util.hh +++ b/source/blender/nodes/shader/node_shader_util.hh @@ -56,7 +56,7 @@ #include "NOD_socket_declarations.hh" #include "node_shader_register.hh" -#include "node_util.h" +#include "node_util.hh" #include "RE_pipeline.h" #include "RE_texture.h" diff --git a/source/blender/nodes/texture/node_texture_tree.cc b/source/blender/nodes/texture/node_texture_tree.cc index 3f84895b5d4..6465f15e35d 100644 --- a/source/blender/nodes/texture/node_texture_tree.cc +++ b/source/blender/nodes/texture/node_texture_tree.cc @@ -27,7 +27,7 @@ #include "node_common.h" #include "node_exec.h" #include "node_texture_util.hh" -#include "node_util.h" +#include "node_util.hh" #include "DEG_depsgraph.h" diff --git a/source/blender/nodes/texture/node_texture_util.hh b/source/blender/nodes/texture/node_texture_util.hh index edb6e1661a3..b862241d039 100644 --- a/source/blender/nodes/texture/node_texture_util.hh +++ b/source/blender/nodes/texture/node_texture_util.hh @@ -39,7 +39,7 @@ #include "NOD_texture.h" #include "node_texture_register.hh" -#include "node_util.h" +#include "node_util.hh" #include "BLT_translation.h"