4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2008 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
29 /** \file blender/editors/space_node/node_intern.h
33 #ifndef ED_NODE_INTERN_H
34 #define ED_NODE_INTERN_H
36 /* internal exports only */
42 struct wmWindowManager;
47 /* temp data to pass on to modal */
48 typedef struct bNodeLinkDrag
50 struct bNodeLinkDrag *next, *prev;
53 struct bNodeSocket *sock;
54 struct bNodeLink *link;
59 ARegion *node_has_buttons_region(ScrArea *sa);
62 void node_header_buttons(const bContext *C, ARegion *ar);
63 void node_menus_register(void);
66 void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d);
69 void node_buttons_register(struct ARegionType *art);
70 void NODE_OT_properties(struct wmOperatorType *ot);
73 void node_operatortypes(void);
74 void node_keymap(wmKeyConfig *keyconf);
77 void NODE_OT_select(struct wmOperatorType *ot);
78 void NODE_OT_select_all(wmOperatorType *ot);
79 void NODE_OT_select_linked_to(wmOperatorType *ot);
80 void NODE_OT_select_linked_from(wmOperatorType *ot);
81 void NODE_OT_visibility_toggle(struct wmOperatorType *ot);
82 void NODE_OT_view_all(struct wmOperatorType *ot);
83 void NODE_OT_select_border(struct wmOperatorType *ot);
84 void NODE_OT_select_same_type(struct wmOperatorType *ot);
85 void NODE_OT_select_same_type_next(wmOperatorType *ot);
86 void NODE_OT_select_same_type_prev(wmOperatorType *ot);
89 void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link);
90 void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3 );
91 int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol);
92 void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage);
93 void draw_nodespace_color_info(ARegion *ar, int channels, int x, int y, char *cp, float *fp);
96 void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *treetype);
97 void snode_notify(bContext *C, SpaceNode *snode);
98 bNode *next_node(bNodeTree *ntree);
99 bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float locy);
100 void snode_set_context(SpaceNode *snode, Scene *scene);
101 void snode_make_group_editable(SpaceNode *snode, bNode *gnode);
102 void node_set_active(SpaceNode *snode, bNode *node);
103 void node_deselectall(SpaceNode *snode);
104 int node_select_same_type(SpaceNode *snode);
105 int node_select_same_type_np(SpaceNode *snode, int dir);
106 void snode_composite_job(const struct bContext *C, ScrArea *sa);
107 bNode *node_tree_get_editgroup(bNodeTree *ntree);
108 void node_tree_verify_groups(bNodeTree *nodetree);
109 void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace);
110 int node_has_hidden_sockets(bNode *node);
111 void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set);
112 int node_render_changed_exec(bContext *, wmOperator *);
114 void NODE_OT_duplicate(struct wmOperatorType *ot);
115 void NODE_OT_delete(struct wmOperatorType *ot);
116 void NODE_OT_resize(struct wmOperatorType *ot);
118 void NODE_OT_link(struct wmOperatorType *ot);
119 void NODE_OT_link_make(struct wmOperatorType *ot);
120 void NODE_OT_links_cut(struct wmOperatorType *ot);
122 void NODE_OT_group_make(struct wmOperatorType *ot);
123 void NODE_OT_group_ungroup(struct wmOperatorType *ot);
124 void NODE_OT_group_edit(struct wmOperatorType *ot);
125 void NODE_OT_group_socket_add(struct wmOperatorType *ot);
126 void NODE_OT_group_socket_remove(struct wmOperatorType *ot);
127 void NODE_OT_group_socket_move_up(struct wmOperatorType *ot);
128 void NODE_OT_group_socket_move_down(struct wmOperatorType *ot);
130 void NODE_OT_mute_toggle(struct wmOperatorType *ot);
131 void NODE_OT_hide_toggle(struct wmOperatorType *ot);
132 void NODE_OT_hide_socket_toggle(struct wmOperatorType *ot);
133 void NODE_OT_preview_toggle(struct wmOperatorType *ot);
135 void NODE_OT_show_cyclic_dependencies(struct wmOperatorType *ot);
136 void NODE_OT_link_viewer(struct wmOperatorType *ot);
137 void NODE_OT_read_fullsamplelayers(struct wmOperatorType *ot);
138 void NODE_OT_read_renderlayers(struct wmOperatorType *ot);
139 void NODE_OT_render_changed(struct wmOperatorType *ot);
141 void NODE_OT_backimage_move(struct wmOperatorType *ot);
142 void NODE_OT_backimage_zoom(struct wmOperatorType *ot);
143 void NODE_OT_backimage_sample(wmOperatorType *ot);
145 void NODE_OT_add_file(struct wmOperatorType *ot);
147 extern const char *node_context_dir[];
151 // XXX from BSE_node.h
152 #define HIDDEN_RAD 15.0f
153 #define BASIS_RAD 8.0f
156 #define NODE_SOCKSIZE 5
158 // XXX button events (butspace)
176 } eNodeSpace_ButEvents;
178 #endif /* ED_NODE_INTERN_H */