|
Blender
V2.59
|
00001 /* 00002 * $Id: outliner_intern.h 39291 2011-08-11 05:46:18Z campbellbarton $ 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 00034 #ifndef ED_OUTLINER_INTERN_H 00035 #define ED_OUTLINER_INTERN_H 00036 00037 #include "RNA_types.h" 00038 00039 /* internal exports only */ 00040 00041 struct wmWindowManager; 00042 struct wmOperatorType; 00043 struct TreeStoreElem; 00044 struct bContext; 00045 struct Scene; 00046 struct ARegion; 00047 struct ID; 00048 struct Object; 00049 00050 typedef struct TreeElement { 00051 struct TreeElement *next, *prev, *parent; 00052 ListBase subtree; 00053 float xs, ys; // do selection 00054 int store_index; // offset in tree store 00055 short flag; // flag for non-saved stuff 00056 short index; // index for data arrays 00057 short idcode; // from TreeStore id 00058 short xend; // width of item display, for select 00059 const char *name; 00060 void *directdata; // Armature Bones, Base, Sequence, Strip... 00061 PointerRNA rnaptr; // RNA Pointer 00062 } TreeElement; 00063 00064 /* TreeElement->flag */ 00065 #define TE_ACTIVE 1 00066 #define TE_ICONROW 2 00067 #define TE_LAZY_CLOSED 4 00068 #define TE_FREE_NAME 8 00069 00070 /* TreeStoreElem types */ 00071 #define TSE_NLA 1 00072 #define TSE_NLA_ACTION 2 00073 #define TSE_DEFGROUP_BASE 3 00074 #define TSE_DEFGROUP 4 00075 #define TSE_BONE 5 00076 #define TSE_EBONE 6 00077 #define TSE_CONSTRAINT_BASE 7 00078 #define TSE_CONSTRAINT 8 00079 #define TSE_MODIFIER_BASE 9 00080 #define TSE_MODIFIER 10 00081 #define TSE_LINKED_OB 11 00082 #define TSE_SCRIPT_BASE 12 00083 #define TSE_POSE_BASE 13 00084 #define TSE_POSE_CHANNEL 14 00085 #define TSE_ANIM_DATA 15 00086 #define TSE_DRIVER_BASE 16 00087 #define TSE_DRIVER 17 00088 00089 #define TSE_PROXY 18 00090 #define TSE_R_LAYER_BASE 19 00091 #define TSE_R_LAYER 20 00092 #define TSE_R_PASS 21 00093 #define TSE_LINKED_MAT 22 00094 /* NOTE, is used for light group */ 00095 #define TSE_LINKED_LAMP 23 00096 #define TSE_POSEGRP_BASE 24 00097 #define TSE_POSEGRP 25 00098 #define TSE_SEQUENCE 26 00099 #define TSE_SEQ_STRIP 27 00100 #define TSE_SEQUENCE_DUP 28 00101 #define TSE_LINKED_PSYS 29 00102 #define TSE_RNA_STRUCT 30 00103 #define TSE_RNA_PROPERTY 31 00104 #define TSE_RNA_ARRAY_ELEM 32 00105 #define TSE_NLA_TRACK 33 00106 #define TSE_KEYMAP 34 00107 #define TSE_KEYMAP_ITEM 35 00108 00109 /* button events */ 00110 #define OL_NAMEBUTTON 1 00111 00112 /* get TreeStoreElem associated with a TreeElement 00113 * < a: (TreeElement) tree element to find stored element for 00114 */ 00115 #define TREESTORE(a) ((a)?soops->treestore->data+(a)->store_index:NULL) 00116 00117 /* size constants */ 00118 #define OL_Y_OFFSET 2 00119 00120 #define OL_TOG_RESTRICT_VIEWX (UI_UNIT_X*3) 00121 #define OL_TOG_RESTRICT_SELECTX (UI_UNIT_X*2) 00122 #define OL_TOG_RESTRICT_RENDERX UI_UNIT_X 00123 00124 #define OL_TOGW OL_TOG_RESTRICT_VIEWX 00125 00126 #define OL_RNA_COLX (UI_UNIT_X*15) 00127 #define OL_RNA_COL_SIZEX (UI_UNIT_X*7.5) 00128 #define OL_RNA_COL_SPACEX (UI_UNIT_X*2.5) 00129 00130 00131 /* outliner_tree.c ----------------------------------------------- */ 00132 00133 void outliner_free_tree(ListBase *lb); 00134 00135 TreeElement *outliner_find_tse(struct SpaceOops *soops, TreeStoreElem *tse); 00136 TreeElement *outliner_find_id(struct SpaceOops *soops, ListBase *lb, struct ID *id); 00137 struct ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode); 00138 00139 void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct SpaceOops *soops); 00140 00141 /* outliner_draw.c ---------------------------------------------- */ 00142 00143 void draw_outliner(const struct bContext *C); 00144 00145 /* outliner_select.c -------------------------------------------- */ 00146 00147 void outliner_select(struct SpaceOops *soops, ListBase *lb, int *index, short *selecting); 00148 00149 int tree_element_type_active(struct bContext *C, struct Scene *scene, struct SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set); 00150 int tree_element_active(struct bContext *C, struct Scene *scene, SpaceOops *soops, TreeElement *te, int set); 00151 00152 /* outliner_edit.c ---------------------------------------------- */ 00153 00154 void outliner_do_object_operation(struct bContext *C, struct Scene *scene, struct SpaceOops *soops, struct ListBase *lb, 00155 void (*operation_cb)(struct bContext *C, struct Scene *scene, struct TreeElement *, struct TreeStoreElem *, TreeStoreElem *)); 00156 00157 int common_restrict_check(struct bContext *C, struct Object *ob); 00158 00159 int outliner_has_one_flag(struct SpaceOops *soops, ListBase *lb, short flag, short curlevel); 00160 void outliner_set_flag(struct SpaceOops *soops, ListBase *lb, short flag, short set); 00161 00162 void object_toggle_visibility_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem); 00163 void object_toggle_selectability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem); 00164 void object_toggle_renderability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem); 00165 00166 /* ...................................................... */ 00167 00168 void OUTLINER_OT_item_activate(struct wmOperatorType *ot); 00169 void OUTLINER_OT_item_openclose(struct wmOperatorType *ot); 00170 void OUTLINER_OT_item_rename(struct wmOperatorType *ot); 00171 00172 void OUTLINER_OT_show_one_level(struct wmOperatorType *ot); 00173 void OUTLINER_OT_show_active(struct wmOperatorType *ot); 00174 void OUTLINER_OT_show_hierarchy(struct wmOperatorType *ot); 00175 00176 void OUTLINER_OT_selected_toggle(struct wmOperatorType *ot); 00177 void OUTLINER_OT_expanded_toggle(struct wmOperatorType *ot); 00178 00179 void OUTLINER_OT_scroll_page(struct wmOperatorType *ot); 00180 00181 void OUTLINER_OT_renderability_toggle(struct wmOperatorType *ot); 00182 void OUTLINER_OT_selectability_toggle(struct wmOperatorType *ot); 00183 void OUTLINER_OT_visibility_toggle(struct wmOperatorType *ot); 00184 00185 void OUTLINER_OT_keyingset_add_selected(struct wmOperatorType *ot); 00186 void OUTLINER_OT_keyingset_remove_selected(struct wmOperatorType *ot); 00187 00188 void OUTLINER_OT_drivers_add_selected(struct wmOperatorType *ot); 00189 void OUTLINER_OT_drivers_delete_selected(struct wmOperatorType *ot); 00190 00191 /* outliner_tools.c ---------------------------------------------- */ 00192 00193 void OUTLINER_OT_operation(struct wmOperatorType *ot); 00194 void OUTLINER_OT_object_operation(struct wmOperatorType *ot); 00195 void OUTLINER_OT_group_operation(struct wmOperatorType *ot); 00196 void OUTLINER_OT_id_operation(struct wmOperatorType *ot); 00197 void OUTLINER_OT_data_operation(struct wmOperatorType *ot); 00198 void OUTLINER_OT_animdata_operation(struct wmOperatorType *ot); 00199 void OUTLINER_OT_action_set(struct wmOperatorType *ot); 00200 00201 /* ---------------------------------------------------------------- */ 00202 00203 /* outliner_ops.c */ 00204 void outliner_operatortypes(void); 00205 void outliner_keymap(struct wmKeyConfig *keyconf); 00206 00207 /* outliner_header.c */ 00208 void outliner_header_buttons(const struct bContext *C, struct ARegion *ar); 00209 00210 #endif /* ED_OUTLINER_INTERN_H */