66
66
ARegion *node_has_buttons_region(ScrArea *sa);
67
67
ARegion *node_has_tools_region(ScrArea *sa);
70
void node_menus_register(void);
69
void snode_group_offset(struct SpaceNode *snode, float *x, float *y); /* transform between View2Ds in the tree path */
73
72
int node_get_colorid(struct bNode *node);
74
void node_socket_circle_draw(struct bNodeTree *ntree, struct bNodeSocket *sock, float size, int highlight);
73
void node_socket_circle_draw(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node,
74
struct bNodeSocket *sock, float size, int highlight);
75
75
int node_get_resize_cursor(int directions);
76
76
void node_draw_shadow(struct SpaceNode *snode, struct bNode *node, float radius, float alpha);
77
void node_draw_default(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *node);
77
void node_draw_default(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode,
78
struct bNodeTree *ntree, struct bNode *node, bNodeInstanceKey key);
78
79
void node_update_default(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node);
79
80
int node_select_area_default(struct bNode *node, int x, int y);
80
81
int node_tweak_area_default(struct bNode *node, int x, int y);
81
void node_update_nodetree(const struct bContext *C, struct bNodeTree *ntree, float offsetx, float offsety);
82
void node_draw_nodetree(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, struct bNodeTree *ntree);
83
void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d);
82
void node_update_nodetree(const struct bContext *C, struct bNodeTree *ntree);
83
void node_draw_nodetree(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode,
84
struct bNodeTree *ntree, bNodeInstanceKey parent_key);
85
void drawnodespace(const bContext *C, ARegion *ar);
85
87
void node_set_cursor(struct wmWindow *win, struct SpaceNode *snode);
86
88
/* DPI scaled coords */
100
102
void node_keymap(struct wmKeyConfig *keyconf);
102
104
/* node_select.c */
103
void node_select(struct bNode *node);
104
void node_deselect(struct bNode *node);
105
105
void node_deselect_all(struct SpaceNode *snode);
106
106
void node_socket_select(struct bNode *node, struct bNodeSocket *sock);
107
107
void node_socket_deselect(struct bNode *node, struct bNodeSocket *sock, int deselect_node);
118
118
void NODE_OT_select_border(struct wmOperatorType *ot);
119
119
void NODE_OT_select_lasso(struct wmOperatorType *ot);
120
120
void NODE_OT_select_same_type(struct wmOperatorType *ot);
121
void NODE_OT_select_same_type_next(struct wmOperatorType *ot);
122
void NODE_OT_select_same_type_prev(struct wmOperatorType *ot);
121
void NODE_OT_select_same_type_step(struct wmOperatorType *ot);
122
void NODE_OT_find_node(struct wmOperatorType *ot);
124
124
/* node_view.c */
125
int space_node_view_flag(struct bContext *C, SpaceNode *snode, ARegion *ar, const int node_flag);
125
127
void NODE_OT_view_all(struct wmOperatorType *ot);
126
128
void NODE_OT_view_selected(struct wmOperatorType *ot);
133
135
void node_draw_link(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link);
134
136
void node_draw_link_bezier(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3);
135
int node_link_bezier_points(struct View2D * v2d, struct SpaceNode * snode, struct bNodeLink * link, float coord_array[][2], int resol);
137
int node_link_bezier_points(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link, float coord_array[][2], int resol);
136
138
// void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3 );
137
void draw_nodespace_back_pix(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode);
139
void draw_nodespace_back_pix(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, bNodeInstanceKey parent_key);
141
bNode *node_add_node(struct SpaceNode *snode, struct Main *bmain, struct Scene *scene,
142
struct bNodeTemplate *ntemp, float locx, float locy);
143
bNode *node_add_node(const struct bContext *C, const char *idname, int type, float locx, float locy);
143
144
void NODE_OT_add_reroute(struct wmOperatorType *ot);
145
void NODE_OT_add_file(struct wmOperatorType *ot);
146
void NODE_OT_new_node_tree(struct wmOperatorType *ot);
146
149
/* node_group.c */
147
150
void NODE_OT_group_make(struct wmOperatorType *ot);
151
void NODE_OT_group_insert(struct wmOperatorType *ot);
148
152
void NODE_OT_group_ungroup(struct wmOperatorType *ot);
149
153
void NODE_OT_group_separate(struct wmOperatorType *ot);
150
154
void NODE_OT_group_edit(struct wmOperatorType *ot);
151
void NODE_OT_group_socket_add(struct wmOperatorType *ot);
152
void NODE_OT_group_socket_remove(struct wmOperatorType *ot);
153
void NODE_OT_group_socket_move_up(struct wmOperatorType *ot);
154
void NODE_OT_group_socket_move_down(struct wmOperatorType *ot);
158
void NODE_OT_add_file(struct wmOperatorType *ot);
159
void NODE_OT_new_node_tree(struct wmOperatorType *ot);
162
157
/* node_relationships.c */
175
170
void NODE_OT_link_viewer(struct wmOperatorType *ot);
177
172
/* node_edit.c */
178
void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *treetype);
179
173
void snode_notify(struct bContext *C, struct SpaceNode *snode);
180
174
void snode_dag_update(struct bContext *C, struct SpaceNode *snode);
181
void snode_set_context(struct SpaceNode *snode, Scene *scene);
182
void snode_make_group_editable(struct SpaceNode *snode, struct bNode *gnode);
175
void snode_set_context(const struct bContext *C);
184
bNode *node_tree_get_editgroup(bNodeTree *ntree);
185
177
void snode_update(struct SpaceNode *snode, struct bNode *node);
186
bNode *editnode_get_active(bNodeTree *ntree);
187
178
int composite_node_active(struct bContext *C);
179
int composite_node_editable(struct bContext *C);
189
181
int node_has_hidden_sockets(bNode *node);
190
182
void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set);
215
207
void NODE_OT_clipboard_copy(struct wmOperatorType *ot);
216
208
void NODE_OT_clipboard_paste(struct wmOperatorType *ot);
210
void NODE_OT_tree_socket_add(struct wmOperatorType *ot);
211
void NODE_OT_tree_socket_remove(struct wmOperatorType *ot);
212
void NODE_OT_tree_socket_move(struct wmOperatorType *ot);
218
214
void NODE_OT_shader_script_update(struct wmOperatorType *ot);
216
void NODE_OT_viewer_border(struct wmOperatorType *ot);
220
218
extern const char *node_context_dir[];
226
224
#define BASIS_RAD (0.4f * U.widget_unit)
227
225
#define NODE_DYS (U.widget_unit / 2)
228
226
#define NODE_DY U.widget_unit
227
#define NODE_SOCKDY (0.08f * U.widget_unit)
229
228
#define NODE_WIDTH(node) (node->width * UI_DPI_FAC)
230
229
#define NODE_MARGIN_X (0.75f * U.widget_unit)
231
230
#define NODE_SOCKSIZE (0.25f * U.widget_unit)
232
231
#define NODE_LINK_RESOL 12
234
233
// XXX button events (butspace)
234
enum eNodeSpace_ButEvents {