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