Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-02-22 14:46:27 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-02-22 14:46:27 +0400
commit6f0cbba0d31b6b9b104df9f63652b40c40583cb3 (patch)
treecf68a8b7c983d959c69affc92b47043a972805a6 /source/blender/blenkernel/BKE_node.h
parentca689e88aac0e33bf0fd9701f5c6174b5ff5f3fd (diff)
Simple preset function for setting common node sizes based on enum instead of explicit numbers.
Most nodes use the default size now and don't need explicit function calls. Most remaining nodes can also use the preset variant instead of explicit size values, these are only needed for a few special nodes. Thanks to Sebastian König for suggesting this and doing the monkey work of changing node definitions.
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r--source/blender/blenkernel/BKE_node.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 5024b3636c5..19fe621ade9 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -261,6 +261,12 @@ typedef struct bNodeType {
#define SOCK_IN 1
#define SOCK_OUT 2
+typedef enum eNodeSizePreset {
+ NODE_SIZE_DEFAULT,
+ NODE_SIZE_SMALL,
+ NODE_SIZE_LARGE
+} eNodeSizePreset;
+
struct bNodeTreeExec;
typedef void (*bNodeTreeCallback)(void *calldata, struct ID *owner_id, struct bNodeTree *ntree);
@@ -419,6 +425,7 @@ void node_type_base(struct bNodeTreeType *ttype, struct bNodeType *nt
const char *name, short nclass, short flag);
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs);
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth);
+void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size);
void node_type_init(struct bNodeType *ntype, void (*initfunc)(struct bNodeTree *ntree, struct bNode *node, struct bNodeTemplate *ntemp));
void node_type_valid(struct bNodeType *ntype, int (*validfunc)(struct bNodeTree *ntree, struct bNodeTemplate *ntemp));
void node_type_storage(struct bNodeType *ntype,