diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-03 19:05:59 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-03 19:05:59 +0300 |
commit | cb0fbe1fde4753a8521e3972e5fcaf852ea20f4c (patch) | |
tree | 95ab08b491eabad595802d33aa07dfd6ee553a7b /source/blender/blenkernel/BKE_node.h | |
parent | ab927f5ca7a35393ea28de56e7a8d2a938c5de34 (diff) |
Cleanup: Use typed enum for node resize direction
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index ebbc149fceb..776845b4c99 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -25,6 +25,7 @@ #include "BLI_compiler_compat.h" #include "BLI_ghash.h" +#include "BLI_utildefines.h" #include "DNA_listBase.h" @@ -222,6 +223,16 @@ typedef int (*NodeGPUExecFunction)(struct GPUMaterial *mat, struct GPUNodeStack *in, struct GPUNodeStack *out); +typedef enum NodeResizeDirection { + NODE_RESIZE_NONE = 0, + NODE_RESIZE_TOP = (1 << 0), + NODE_RESIZE_BOTTOM = (1 << 1), + NODE_RESIZE_RIGHT = (1 << 2), + NODE_RESIZE_LEFT = (1 << 3), +} NodeResizeDirection; + +ENUM_OPERATORS(NodeResizeDirection, NODE_RESIZE_LEFT); + /** * \brief Defines a node type. * @@ -274,7 +285,7 @@ typedef struct bNodeType { */ void (*labelfunc)(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen); /** Optional custom resize handle polling. */ - int (*resize_area_func)(struct bNode *node, int x, int y); + NodeResizeDirection (*resize_area_func)(struct bNode *node, int x, int y); /** Optional selection area polling. */ int (*select_area_func)(struct bNode *node, int x, int y); /** Optional tweak area polling (for grabbing). */ @@ -379,12 +390,6 @@ typedef struct bNodeType { #define NODE_CLASS_ATTRIBUTE 42 #define NODE_CLASS_LAYOUT 100 -/* node resize directions */ -#define NODE_RESIZE_TOP 1 -#define NODE_RESIZE_BOTTOM 2 -#define NODE_RESIZE_RIGHT 4 -#define NODE_RESIZE_LEFT 8 - typedef enum eNodeSizePreset { NODE_SIZE_DEFAULT, NODE_SIZE_SMALL, |