Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2008 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * 00022 * Contributor(s): Blender Foundation 00023 * 00024 * ***** END GPL LICENSE BLOCK ***** 00025 */ 00026 00031 #ifndef ED_NODE_INTERN_H 00032 #define ED_NODE_INTERN_H 00033 00034 #include <stddef.h> /* for size_t */ 00035 #include "UI_interface.h" 00036 00037 /* internal exports only */ 00038 00039 struct ARegion; 00040 struct ARegionType; 00041 struct View2D; 00042 struct bContext; 00043 struct wmWindowManager; 00044 struct bNodeTemplate; 00045 struct bNode; 00046 struct bNodeSocket; 00047 struct bNodeLink; 00048 struct Main; 00049 00050 /* temp data to pass on to modal */ 00051 typedef struct bNodeLinkDrag 00052 { 00053 struct bNodeLinkDrag *next, *prev; 00054 00055 struct bNode *node; 00056 struct bNodeSocket *sock; 00057 struct bNodeLink *link; 00058 int in_out; 00059 } bNodeLinkDrag; 00060 00061 /* space_node.c */ 00062 ARegion *node_has_buttons_region(ScrArea *sa); 00063 00064 /* node_header.c */ 00065 void node_header_buttons(const bContext *C, ARegion *ar); 00066 void node_menus_register(void); 00067 00068 /* node_draw.c */ 00069 void node_socket_circle_draw(struct bNodeTree *ntree, struct bNodeSocket *sock, float size); 00070 void node_draw_default(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *node); 00071 void node_update_default(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node); 00072 void node_update_nodetree(const struct bContext *C, struct bNodeTree *ntree, float offsetx, float offsety); 00073 void node_draw_nodetree(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, struct bNodeTree *ntree); 00074 void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d); 00075 00076 /* node_buttons.c */ 00077 void node_buttons_register(struct ARegionType *art); 00078 void NODE_OT_properties(struct wmOperatorType *ot); 00079 00080 /* node_ops.c */ 00081 void node_operatortypes(void); 00082 void node_keymap(wmKeyConfig *keyconf); 00083 00084 /* node_select.c */ 00085 void node_deselect_all(struct SpaceNode *snode); 00086 int node_select_same_type(struct SpaceNode *snode); 00087 int node_select_same_type_np(struct SpaceNode *snode, int dir); 00088 void node_select_single(struct bContext *C, struct bNode *node); 00089 00090 void NODE_OT_select(struct wmOperatorType *ot); 00091 void NODE_OT_select_all(wmOperatorType *ot); 00092 void NODE_OT_select_linked_to(wmOperatorType *ot); 00093 void NODE_OT_select_linked_from(wmOperatorType *ot); 00094 void NODE_OT_select_border(struct wmOperatorType *ot); 00095 void NODE_OT_select_same_type(struct wmOperatorType *ot); 00096 void NODE_OT_select_same_type_next(wmOperatorType *ot); 00097 void NODE_OT_select_same_type_prev(wmOperatorType *ot); 00098 00099 /* node_state.c */ 00100 void NODE_OT_view_all(struct wmOperatorType *ot); 00101 00102 /* drawnode.c */ 00103 void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link); 00104 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 ); 00105 int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol); 00106 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 ); 00107 void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage); 00108 void draw_nodespace_color_info(struct ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4]); 00109 00110 /* node_edit.c */ 00111 void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *treetype); 00112 void snode_notify(bContext *C, SpaceNode *snode); 00113 void snode_dag_update(bContext *C, SpaceNode *snode); 00114 bNode *node_add_node(struct SpaceNode *snode, struct Main *bmain, struct Scene *scene, struct bNodeTemplate *ntemp, float locx, float locy); 00115 void snode_set_context(SpaceNode *snode, Scene *scene); 00116 void snode_make_group_editable(SpaceNode *snode, bNode *gnode); 00117 void snode_composite_job(const struct bContext *C, ScrArea *sa); 00118 bNode *node_tree_get_editgroup(bNodeTree *ntree); 00119 void node_tree_verify_groups(bNodeTree *nodetree); 00120 void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace); 00121 int node_has_hidden_sockets(bNode *node, short flag); 00122 void node_set_hidden_sockets(SpaceNode *snode, bNode *node, short flag, int set); 00123 int node_render_changed_exec(bContext *, wmOperator *); 00124 00125 void NODE_OT_duplicate(struct wmOperatorType *ot); 00126 void NODE_OT_delete(struct wmOperatorType *ot); 00127 void NODE_OT_delete_reconnect(struct wmOperatorType *ot); 00128 void NODE_OT_resize(struct wmOperatorType *ot); 00129 00130 void NODE_OT_link(struct wmOperatorType *ot); 00131 void NODE_OT_link_make(struct wmOperatorType *ot); 00132 void NODE_OT_links_cut(struct wmOperatorType *ot); 00133 00134 void NODE_OT_group_make(struct wmOperatorType *ot); 00135 void NODE_OT_group_ungroup(struct wmOperatorType *ot); 00136 void NODE_OT_group_edit(struct wmOperatorType *ot); 00137 void NODE_OT_group_socket_add(struct wmOperatorType *ot); 00138 void NODE_OT_group_socket_remove(struct wmOperatorType *ot); 00139 void NODE_OT_group_socket_move_up(struct wmOperatorType *ot); 00140 void NODE_OT_group_socket_move_down(struct wmOperatorType *ot); 00141 00142 void NODE_OT_mute_toggle(struct wmOperatorType *ot); 00143 void NODE_OT_hide_toggle(struct wmOperatorType *ot); 00144 void NODE_OT_hide_socket_toggle(struct wmOperatorType *ot); 00145 void NODE_OT_preview_toggle(struct wmOperatorType *ot); 00146 void NODE_OT_options_toggle(struct wmOperatorType *ot); 00147 00148 void NODE_OT_show_cyclic_dependencies(struct wmOperatorType *ot); 00149 void NODE_OT_link_viewer(struct wmOperatorType *ot); 00150 void NODE_OT_read_fullsamplelayers(struct wmOperatorType *ot); 00151 void NODE_OT_read_renderlayers(struct wmOperatorType *ot); 00152 void NODE_OT_render_changed(struct wmOperatorType *ot); 00153 00154 void NODE_OT_backimage_move(struct wmOperatorType *ot); 00155 void NODE_OT_backimage_zoom(struct wmOperatorType *ot); 00156 void NODE_OT_backimage_sample(wmOperatorType *ot); 00157 00158 void NODE_OT_add_file(struct wmOperatorType *ot); 00159 00160 void NODE_OT_new_node_tree(struct wmOperatorType *ot); 00161 00162 extern const char *node_context_dir[]; 00163 00164 // XXXXXX 00165 00166 // XXX from BSE_node.h 00167 #define HIDDEN_RAD 15.0f 00168 #define BASIS_RAD 8.0f 00169 #define NODE_DYS (U.widget_unit/2) 00170 #define NODE_DY U.widget_unit 00171 #define NODE_SOCKSIZE 5 00172 00173 // XXX button events (butspace) 00174 enum { 00175 B_NOP = 0, 00176 B_REDR = 1, 00177 B_NODE_USEMAT, 00178 B_NODE_USESCENE, 00179 B_NODE_USETEX, 00180 B_TEXBROWSE, 00181 B_TEXALONE, 00182 B_TEXLOCAL, 00183 B_TEXDELETE, 00184 B_TEXPRV, 00185 B_AUTOTEXNAME, 00186 B_KEEPDATA, 00187 B_NODE_EXEC, 00188 B_MATPRV, 00189 B_NODE_LOADIMAGE, 00190 B_NODE_SETIMAGE, 00191 } eNodeSpace_ButEvents; 00192 00193 #endif /* ED_NODE_INTERN_H */