~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/editors/space_node/node_intern.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
struct ARegionType;
41
41
struct View2D;
42
42
struct bContext;
 
43
struct wmWindow;
43
44
struct wmWindowManager;
 
45
struct wmEvent;
44
46
struct bNodeTemplate;
45
47
struct bNode;
46
48
struct bNodeSocket;
47
49
struct bNodeLink;
48
50
struct Main;
 
51
struct wmKeyConfig;
49
52
 
50
53
/* temp data to pass on to modal */
51
 
typedef struct bNodeLinkDrag
52
 
{
 
54
typedef struct bNodeLinkDrag {
53
55
        struct bNodeLinkDrag *next, *prev;
54
56
        
55
 
        struct bNode *node;
56
 
        struct bNodeSocket *sock;
57
 
        struct bNodeLink *link;
 
57
        /* List of links dragged by the operator.
 
58
         * Note: This is a list of LinkData structs on top of the actual bNodeLinks.
 
59
         * This way the links can be added to the node tree while being stored in this list.
 
60
         */
 
61
        ListBase links;
58
62
        int in_out;
59
63
} bNodeLinkDrag;
60
64
 
61
65
/* space_node.c */
62
66
ARegion *node_has_buttons_region(ScrArea *sa);
 
67
ARegion *node_has_tools_region(ScrArea *sa);
63
68
 
64
69
/* node_header.c */
65
70
void node_menus_register(void);
66
71
 
67
72
/* node_draw.c */
68
 
void node_socket_circle_draw(struct bNodeTree *ntree, struct bNodeSocket *sock, float size);
 
73
int node_get_colorid(struct bNode *node);
 
74
void node_socket_circle_draw(struct bNodeTree *ntree, struct bNodeSocket *sock, float size, int highlight);
 
75
int node_get_resize_cursor(int directions);
 
76
void node_draw_shadow(struct SpaceNode *snode, struct bNode *node, float radius, float alpha);
69
77
void node_draw_default(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *node);
70
78
void node_update_default(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node);
 
79
int node_select_area_default(struct bNode *node, int x, int y);
 
80
int node_tweak_area_default(struct bNode *node, int x, int y);
71
81
void node_update_nodetree(const struct bContext *C, struct bNodeTree *ntree, float offsetx, float offsety);
72
82
void node_draw_nodetree(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, struct bNodeTree *ntree);
73
83
void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d);
74
84
 
 
85
void node_set_cursor(struct wmWindow *win, struct SpaceNode *snode);
 
86
        /* DPI scaled coords */
 
87
void node_to_view(struct bNode *node, float x, float y, float *rx, float *ry);
 
88
void node_from_view(struct bNode *node, float x, float y, float *rx, float *ry);
 
89
 
75
90
/* node_buttons.c */
76
91
void node_buttons_register(struct ARegionType *art);
77
92
void NODE_OT_properties(struct wmOperatorType *ot);
78
93
 
 
94
/* node_toolbar.c */
 
95
void node_toolbar_register(struct ARegionType *art);
 
96
void NODE_OT_toolbar(struct wmOperatorType *ot);
 
97
 
79
98
/* node_ops.c */
80
99
void node_operatortypes(void);
81
 
void node_keymap(wmKeyConfig *keyconf);
 
100
void node_keymap(struct wmKeyConfig *keyconf);
82
101
 
83
102
/* node_select.c */
84
103
void node_select(struct bNode *node);
93
112
void node_select_single(struct bContext *C, struct bNode *node);
94
113
 
95
114
void NODE_OT_select(struct wmOperatorType *ot);
96
 
void NODE_OT_select_all(wmOperatorType *ot);
97
 
void NODE_OT_select_linked_to(wmOperatorType *ot);
98
 
void NODE_OT_select_linked_from(wmOperatorType *ot);
 
115
void NODE_OT_select_all(struct wmOperatorType *ot);
 
116
void NODE_OT_select_linked_to(struct wmOperatorType *ot);
 
117
void NODE_OT_select_linked_from(struct wmOperatorType *ot);
99
118
void NODE_OT_select_border(struct wmOperatorType *ot);
 
119
void NODE_OT_select_lasso(struct wmOperatorType *ot);
100
120
void NODE_OT_select_same_type(struct wmOperatorType *ot);
101
 
void NODE_OT_select_same_type_next(wmOperatorType *ot);
102
 
void NODE_OT_select_same_type_prev(wmOperatorType *ot);
 
121
void NODE_OT_select_same_type_next(struct wmOperatorType *ot);
 
122
void NODE_OT_select_same_type_prev(struct wmOperatorType *ot);
103
123
 
104
 
/* node_state.c */
 
124
/* node_view.c */
105
125
void NODE_OT_view_all(struct wmOperatorType *ot);
 
126
void NODE_OT_view_selected(struct wmOperatorType *ot);
 
127
 
 
128
void NODE_OT_backimage_move(struct wmOperatorType *ot);
 
129
void NODE_OT_backimage_zoom(struct wmOperatorType *ot);
 
130
void NODE_OT_backimage_sample(struct wmOperatorType *ot);
106
131
 
107
132
/* drawnode.c */
108
 
void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link);
109
 
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 );
110
 
int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol);
111
 
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 );
112
 
void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage);
 
133
void node_draw_link(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link);
 
134
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);
 
136
// 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);
 
138
 
 
139
 
 
140
/* node_add.c */
 
141
bNode *node_add_node(struct SpaceNode *snode, struct Main *bmain, struct Scene *scene,
 
142
                     struct bNodeTemplate *ntemp, float locx, float locy);
 
143
void NODE_OT_add_reroute(struct wmOperatorType *ot);
 
144
 
 
145
 
 
146
/* node_group.c */
 
147
void NODE_OT_group_make(struct wmOperatorType *ot);
 
148
void NODE_OT_group_ungroup(struct wmOperatorType *ot);
 
149
void NODE_OT_group_separate(struct wmOperatorType *ot);
 
150
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);
 
155
 
 
156
 
 
157
/* note_add.c */
 
158
void NODE_OT_add_file(struct wmOperatorType *ot);
 
159
void NODE_OT_new_node_tree(struct wmOperatorType *ot);
 
160
 
 
161
 
 
162
/* node_relationships.c */
 
163
void NODE_OT_link(struct wmOperatorType *ot);
 
164
void NODE_OT_link_make(struct wmOperatorType *ot);
 
165
void NODE_OT_links_cut(struct wmOperatorType *ot);
 
166
void NODE_OT_links_detach(struct wmOperatorType *ot);
 
167
 
 
168
void NODE_OT_parent_set(struct wmOperatorType *ot);
 
169
void NODE_OT_parent_clear(struct wmOperatorType *ot);
 
170
void NODE_OT_join(struct wmOperatorType *ot);
 
171
void NODE_OT_attach(struct wmOperatorType *ot);
 
172
void NODE_OT_detach(struct wmOperatorType *ot);
 
173
 
 
174
void NODE_OT_show_cyclic_dependencies(struct wmOperatorType *ot);
 
175
void NODE_OT_link_viewer(struct wmOperatorType *ot);
113
176
 
114
177
/* node_edit.c */
115
178
void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *treetype);
116
 
void snode_notify(bContext *C, SpaceNode *snode);
117
 
void snode_dag_update(bContext *C, SpaceNode *snode);
118
 
bNode *node_add_node(struct SpaceNode *snode, struct Main *bmain, struct Scene *scene, struct bNodeTemplate *ntemp, float locx, float locy);
119
 
void snode_set_context(SpaceNode *snode, Scene *scene);
120
 
void snode_make_group_editable(SpaceNode *snode, bNode *gnode);
121
 
void snode_composite_job(const struct bContext *C, ScrArea *sa);
 
179
void snode_notify(struct bContext *C, struct SpaceNode *snode);
 
180
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);
 
183
 
122
184
bNode *node_tree_get_editgroup(bNodeTree *ntree);
123
 
void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace);
 
185
void snode_update(struct SpaceNode *snode, struct bNode *node);
 
186
bNode *editnode_get_active(bNodeTree *ntree);
 
187
int composite_node_active(struct bContext *C);
 
188
 
124
189
int node_has_hidden_sockets(bNode *node);
125
190
void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set);
126
 
int node_render_changed_exec(bContext *, wmOperator *);
 
191
int node_render_changed_exec(bContext *, struct wmOperator *);
127
192
int node_find_indicated_socket(struct SpaceNode *snode, struct bNode **nodep, struct bNodeSocket **sockp, int in_out);
128
193
 
129
194
void NODE_OT_duplicate(struct wmOperatorType *ot);
131
196
void NODE_OT_delete_reconnect(struct wmOperatorType *ot);
132
197
void NODE_OT_resize(struct wmOperatorType *ot);
133
198
 
134
 
void NODE_OT_link(struct wmOperatorType *ot);
135
 
void NODE_OT_link_make(struct wmOperatorType *ot);
136
 
void NODE_OT_links_cut(struct wmOperatorType *ot);
137
 
void NODE_OT_links_detach(struct wmOperatorType *ot);
138
 
 
139
 
void NODE_OT_group_make(struct wmOperatorType *ot);
140
 
void NODE_OT_group_ungroup(struct wmOperatorType *ot);
141
 
void NODE_OT_group_edit(struct wmOperatorType *ot);
142
 
void NODE_OT_group_socket_add(struct wmOperatorType *ot);
143
 
void NODE_OT_group_socket_remove(struct wmOperatorType *ot);
144
 
void NODE_OT_group_socket_move_up(struct wmOperatorType *ot);
145
 
void NODE_OT_group_socket_move_down(struct wmOperatorType *ot);
146
 
 
147
199
void NODE_OT_mute_toggle(struct wmOperatorType *ot);
148
200
void NODE_OT_hide_toggle(struct wmOperatorType *ot);
149
201
void NODE_OT_hide_socket_toggle(struct wmOperatorType *ot);
150
202
void NODE_OT_preview_toggle(struct wmOperatorType *ot);
151
203
void NODE_OT_options_toggle(struct wmOperatorType *ot);
 
204
void NODE_OT_node_copy_color(struct wmOperatorType *ot);
152
205
 
153
 
void NODE_OT_show_cyclic_dependencies(struct wmOperatorType *ot);
154
 
void NODE_OT_link_viewer(struct wmOperatorType *ot);
155
206
void NODE_OT_read_fullsamplelayers(struct wmOperatorType *ot);
156
207
void NODE_OT_read_renderlayers(struct wmOperatorType *ot);
157
208
void NODE_OT_render_changed(struct wmOperatorType *ot);
158
209
 
159
 
void NODE_OT_backimage_move(struct wmOperatorType *ot);
160
 
void NODE_OT_backimage_zoom(struct wmOperatorType *ot);
161
 
void NODE_OT_backimage_sample(wmOperatorType *ot);
162
 
 
163
 
void NODE_OT_add_file(struct wmOperatorType *ot);
164
 
 
165
 
void NODE_OT_new_node_tree(struct wmOperatorType *ot);
166
 
 
167
210
void NODE_OT_output_file_add_socket(struct wmOperatorType *ot);
168
211
void NODE_OT_output_file_remove_active_socket(struct wmOperatorType *ot);
 
212
void NODE_OT_output_file_move_active_socket(struct wmOperatorType *ot);
 
213
 
 
214
/* Note: clipboard_cut is a simple macro of copy + delete */
 
215
void NODE_OT_clipboard_copy(struct wmOperatorType *ot);
 
216
void NODE_OT_clipboard_paste(struct wmOperatorType *ot);
 
217
 
 
218
void NODE_OT_shader_script_update(struct wmOperatorType *ot);
169
219
 
170
220
extern const char *node_context_dir[];
171
221
 
172
222
// XXXXXX
173
223
 
174
 
// XXX from BSE_node.h
175
 
#define HIDDEN_RAD              15.0f
176
 
#define BASIS_RAD               8.0f
177
 
#define NODE_DYS                (U.widget_unit/2)
178
 
#define NODE_DY                 U.widget_unit
179
 
#define NODE_SOCKSIZE   5
 
224
// nodes draw without dpi - the view zoom is flexible
 
225
#define HIDDEN_RAD      (0.75f * U.widget_unit)
 
226
#define BASIS_RAD       (0.4f * U.widget_unit)
 
227
#define NODE_DYS        (U.widget_unit / 2)
 
228
#define NODE_DY         U.widget_unit
 
229
#define NODE_WIDTH(node)        (node->width * UI_DPI_FAC)
 
230
#define NODE_MARGIN_X   (0.75f * U.widget_unit)
 
231
#define NODE_SOCKSIZE   (0.25f * U.widget_unit)
 
232
#define NODE_LINK_RESOL 12
180
233
 
181
234
// XXX button events (butspace)
182
235
enum {
183
236
        B_NOP = 0,
184
 
        B_REDR  = 1,
 
237
        B_REDR = 1,
185
238
        B_NODE_USEMAT,
186
239
        B_NODE_USESCENE,
187
240
        B_NODE_USETEX,