Final merge of HEAD (bf-blender) into the orange branch.
[blender.git] / source / blender / src / header_oops.c
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
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. 
10  *
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.
15  *
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., 59 Temple Place - Suite 330, Boston, MA        02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21  * All rights reserved.
22  *
23  * The Original Code is: not all of this file anymore.
24  *
25  * Contributor(s): Blender Foundation.
26  *
27  * ***** END GPL LICENSE BLOCK *****
28  */
29
30 #include <stdlib.h>
31 #include <string.h>
32 #include <stdio.h>
33
34 #ifdef HAVE_CONFIG_H
35 #include <config.h>
36 #endif
37
38 #include "BMF_Api.h"
39 #include "BIF_language.h"
40
41 #include "DNA_ID.h"
42 #include "DNA_oops_types.h"
43 #include "DNA_screen_types.h"
44 #include "DNA_space_types.h"
45
46 #include "BKE_global.h"
47 #include "BKE_main.h"
48
49 #include "BIF_gl.h"
50 #include "BIF_interface.h"
51 #include "BIF_resources.h"
52 #include "BIF_screen.h"
53 #include "BIF_editoops.h"
54 #include "BIF_oops.h"
55 #include "BIF_outliner.h"
56 #include "BIF_space.h"
57
58 #include "BSE_drawipo.h"
59 #include "BSE_drawoops.h"
60 #include "BSE_headerbuttons.h"
61
62 #include "blendef.h"
63
64 #include "BKE_depsgraph.h"
65
66 #include "BPY_extern.h"
67 #include "BPY_menus.h"
68
69 static int viewmovetemp = 0;
70
71 void do_oops_buttons(short event)
72 {
73         float dx, dy;
74         
75         /* used for maximize hack */
76         int win_width, win_height; 
77         float aspect_win, aspect_oops, oops_width, oops_height, oops_x_mid, oops_y_mid;
78         
79         
80         if(curarea->win==0) return;
81         
82         if (event == B_NEWOOPS) {
83                 scrarea_queue_winredraw(curarea);
84                 scrarea_queue_headredraw(curarea);
85                 G.soops->lockpoin= 0;
86         } else { /* must be either B_OOPSHOME or B_OOPSVIEWSEL */
87                 init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
88                 if (event == B_OOPSHOME) {
89                         boundbox_oops(0); /* Test all oops blocks */
90                 } else {
91                         boundbox_oops(1); /* Test only selected oops blocks */
92                 }
93                 
94                 
95                 /* Hack to work with test_view2d in drawipo.c
96                 Modify the bounding box so it is maximized to the window aspect
97                 so viewing all oops blocks isnt limited to hoz/vert only.
98                 Cant modify drawipo.c because many other functions use this hos/vert operation - Campbell*/
99                 
100                 win_width= curarea->winrct.xmax - curarea->winrct.xmin;
101                 win_height= curarea->winrct.ymax - curarea->winrct.ymin;
102                 
103                 oops_width = G.v2d->tot.xmax - G.v2d->tot.xmin;
104                 oops_height = G.v2d->tot.ymax - G.v2d->tot.ymin;
105                 
106                 oops_x_mid = (G.v2d->tot.xmax + G.v2d->tot.xmin)*0.5;
107                 oops_y_mid = (G.v2d->tot.ymax + G.v2d->tot.ymin)*0.5;
108                 /* wide windows will be above 1, skinny below 1 */
109                 aspect_win= (float)win_width / (float)win_height; 
110                 aspect_oops = (float)oops_width / (float)oops_height; 
111                 if (aspect_win>aspect_oops) {/* the window is wider then the oops bounds, increase the oops width */
112                         G.v2d->tot.xmin = oops_x_mid - ((oops_x_mid-G.v2d->tot.xmin) * (aspect_win/aspect_oops) ); /* scale the min */
113                         G.v2d->tot.xmax = oops_x_mid + ((G.v2d->tot.xmax-oops_x_mid) * (aspect_win/aspect_oops) );/* scale the max */
114                 } else { /* the window is skinnier then the oops bounds, increase the oops height */
115                         G.v2d->tot.ymin = oops_y_mid - ((oops_y_mid-G.v2d->tot.ymin) * (aspect_oops/aspect_win) ); /* scale the min */
116                         G.v2d->tot.ymax = oops_y_mid + ((G.v2d->tot.ymax-oops_y_mid) * (aspect_oops/aspect_win) );/* scale the max */
117                 }
118                 
119                 /* maybe we should restore the correct values? - do next of its needed */
120                 /* end hack */
121                 
122                 
123                 
124                 G.v2d->cur= G.v2d->tot;
125                 dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
126                 dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
127                 G.v2d->cur.xmin-= dx;
128                 G.v2d->cur.xmax+= dx;
129                 G.v2d->cur.ymin-= dy;
130                 G.v2d->cur.ymax+= dy;           
131                 test_view2d(G.v2d, curarea->winx, curarea->winy);
132                 scrarea_queue_winredraw(curarea);
133         }
134 }
135
136 static void do_oops_viewmenu(void *arg, int event)
137 {
138
139         switch(event) {
140         case 0: /* Shuffle Selected Blocks */
141                 shuffle_oops();
142                 break;
143         case 1: /* Shrink Selected Blocks */
144         shrink_oops();
145         break;
146     case 2: /* View All */
147                 do_oops_buttons(B_OOPSHOME);
148                 break;
149     case 3: /* View All */
150                 do_oops_buttons(B_OOPSVIEWSEL);
151                 break;
152         case 4: /* Maximize Window */
153                 /* using event B_FULL */
154                 break;
155         case 5: /* show outliner */
156                 {
157                         SpaceOops *soops= curarea->spacedata.first;
158                         if(soops->type==SO_OOPS || soops->type==SO_DEPSGRAPH) soops->type= SO_OUTLINER;
159                         else soops->type= SO_OOPS;
160                         init_v2d_oops(curarea, soops);
161                         test_view2d(G.v2d, curarea->winx, curarea->winy);
162                         scrarea_queue_winredraw(curarea);
163                 }
164                 break;
165         case 6:
166                 outliner_toggle_visible(curarea);
167                 break;
168         case 7:
169                 outliner_show_hierarchy(curarea);
170                 break;
171         case 8:
172                 outliner_show_active(curarea);
173                 break;
174         case 9:
175                 outliner_one_level(curarea, 1);
176                 break;
177         case 10:
178                 outliner_one_level(curarea, -1);
179                 break;
180 #ifdef SHOWDEPGRAPH
181         case 11:
182                 // show deps
183                 {
184                         SpaceOops *soops= curarea->spacedata.first;
185                         if(soops->type==SO_OOPS) {
186                                 soops->type= SO_DEPSGRAPH;
187                                 soops->deps_flags = DAG_RL_ALL_BUT_DATA_MASK;
188                         } else 
189                                 soops->type= SO_OOPS;
190                         init_v2d_oops(curarea, soops);
191                         test_view2d(G.v2d, curarea->winx, curarea->winy);
192                         scrarea_queue_winredraw(curarea);
193                 }
194                 break;
195 #endif
196         }
197 }                       
198
199 static uiBlock *oops_viewmenu(void *arg_unused)
200 {
201         SpaceOops *soops= curarea->spacedata.first;
202         uiBlock *block;
203         short yco= 0, menuwidth=120;
204         
205         block= uiNewBlock(&curarea->uiblocks, "oops_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
206         uiBlockSetButmFunc(block, do_oops_viewmenu, NULL);
207         
208         if(soops->type==SO_OOPS) {
209                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
210 #ifdef SHOWDEPGRAPH
211                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
212 #endif
213                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
214
215                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shuffle Selected Blocks|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
216                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink Selected Blocks|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
217
218                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
219
220                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
221                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
222         }
223 #ifdef SHOWDEPGRAPH
224         else if(soops->type==SO_DEPSGRAPH) {
225                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
226                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
227         }
228 #endif
229         else {
230                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
231                 
232                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
233                 
234                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
235                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
236                 
237                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
238
239                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
240                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
241                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
242         }
243         
244         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
245         if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
246         else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
247         
248         if(curarea->headertype==HEADERTOP) {
249                 uiBlockSetDirection(block, UI_DOWN);
250         }
251         else {
252                 uiBlockSetDirection(block, UI_TOP);
253                 uiBlockFlipOrder(block);
254         }
255
256         uiTextBoundsBlock(block, 50);
257         
258         return block;
259 }
260
261
262 static void do_oops_selectmenu(void *arg, int event)
263 {       
264
265         switch(event)
266         {
267         case 0: /* Border Select */
268                 borderselect_oops();
269                 break;
270         case 1: /* Select/Deselect All */
271                 swap_select_all_oops();
272                 break;
273         case 2: /* Linked to Selected */
274                 select_linked_oops();
275                 break;
276         case 3: /* Users of Selected */
277                 select_backlinked_oops();
278                 break;
279         }
280 }
281
282 static uiBlock *oops_selectmenu(void *arg_unused)
283 {
284         uiBlock *block;
285         short yco= 0, menuwidth=120;
286
287         block= uiNewBlock(&curarea->uiblocks, "oops_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
288         uiBlockSetButmFunc(block, do_oops_selectmenu, NULL);
289
290         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
291         
292         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
293
294         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
295
296         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");    
297
298         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked to Selected|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
299         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Users of Selected|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
300
301         if(curarea->headertype==HEADERTOP) {
302                 uiBlockSetDirection(block, UI_DOWN);
303         }
304         else {
305                 uiBlockSetDirection(block, UI_TOP);
306                 uiBlockFlipOrder(block);
307         }
308
309         uiTextBoundsBlock(block, 50);
310
311         return block;
312 }
313
314 static void do_oops_blockmenu(void *arg, int event)
315 {       
316         switch(event)
317         {
318         case 0: /* grab/move */
319                 transform_oops('g', 0);
320                 break;
321         case 1: /* scale */
322                 transform_oops('s', 0);
323                 break;
324         }
325 }
326
327 static uiBlock *oops_blockmenu(void *arg_unused)
328 {
329         uiBlock *block;
330         short yco= 0, menuwidth=120;
331
332         block= uiNewBlock(&curarea->uiblocks, "oops_blockmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
333         uiBlockSetButmFunc(block, do_oops_blockmenu, NULL);
334
335         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
336         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
337
338         if(curarea->headertype==HEADERTOP) {
339                 uiBlockSetDirection(block, UI_DOWN);
340         }
341         else {
342                 uiBlockSetDirection(block, UI_TOP);
343                 uiBlockFlipOrder(block);
344         }
345
346         uiTextBoundsBlock(block, 50);
347
348         return block;
349 }
350
351
352
353 void oops_buttons(void)
354 {       
355         SpaceOops *soops;
356         Oops *oops;
357         uiBlock *block;
358         short xco, xmax;
359         char naam[256];
360
361         soops= curarea->spacedata.first;
362
363         sprintf(naam, "header %d", curarea->headwin);
364         block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
365
366         if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
367         else uiBlockSetCol(block, TH_HEADERDESEL);
368
369         curarea->butspacetype= SPACE_OOPS;
370
371         xco = 8;
372         
373         uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
374
375         xco+= XIC+14;
376
377         uiBlockSetEmboss(block, UI_EMBOSSN);
378         if(curarea->flag & HEADER_NO_PULLDOWN) {
379                 uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
380                                 xco,2,XIC,YIC-2,
381                                 &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus");
382         } else {
383                 uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
384                                 xco,2,XIC,YIC-2,
385                                 &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus");
386         }
387         uiBlockSetEmboss(block, UI_EMBOSS);
388         xco+=XIC;
389
390         if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
391                 /* pull down menus */
392                 uiBlockSetEmboss(block, UI_EMBOSSP);
393         
394                 xmax= GetButStringLength("View");
395                 uiDefPulldownBut(block, oops_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
396                 xco+= xmax;
397                 
398                 if(soops->type==SO_OOPS) {
399                         xmax= GetButStringLength("Select");
400                         uiDefPulldownBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
401                         xco+= xmax;
402                         
403                         xmax= GetButStringLength("Block");
404                         uiDefPulldownBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, "");
405                         xco+= xmax;
406                         
407                 }
408         }
409
410         uiBlockSetEmboss(block, UI_EMBOSS);
411
412         if(soops->type==SO_OOPS) {
413                 /* ZOOM and BORDER */
414                 uiBlockBeginAlign(block);
415                 uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM,  (short)(xco),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (Ctrl MiddleMouse)");
416                 uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE,  (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area");
417                 uiBlockEndAlign(block);
418                 
419                 xco+= 8;
420                 
421                 /* VISIBLE */
422                 uiBlockBeginAlign(block);
423                 uiDefButBitS(block, TOG, OOPS_LAY, B_NEWOOPS, "Layer",          (short)(xco+=XIC),0,XIC+20,YIC, &soops->visiflag, 0, 0, 0, 0, "Only show object datablocks on visible layers");
424                 xco+= 20;
425                 uiDefIconButBitS(block, TOG, OOPS_SCE, B_NEWOOPS, ICON_SCENE_HLT,       (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Scene datablocks");
426                 uiDefIconButBitS(block, TOG, OOPS_OB, B_NEWOOPS, ICON_OBJECT_HLT,       (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Object datablocks");
427                 uiDefIconButBitS(block, TOG, OOPS_ME, B_NEWOOPS, ICON_MESH_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Mesh datablocks");
428                 uiDefIconButBitS(block, TOG, OOPS_CU, B_NEWOOPS, ICON_CURVE_HLT,        (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Curve/Surface/Font datablocks");
429                 uiDefIconButBitS(block, TOG, OOPS_MB, B_NEWOOPS, ICON_MBALL_HLT,        (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Metaball datablocks");
430                 uiDefIconButBitS(block, TOG, OOPS_LT, B_NEWOOPS, ICON_LATTICE_HLT,      (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lattice datablocks");
431                 uiDefIconButBitS(block, TOG, OOPS_LA, B_NEWOOPS, ICON_LAMP_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lamp datablocks");
432                 uiDefIconButBitS(block, TOG, OOPS_MA, B_NEWOOPS, ICON_MATERIAL_HLT,     (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Material datablocks");
433                 uiDefIconButBitS(block, TOG, OOPS_TE, B_NEWOOPS, ICON_TEXTURE_HLT,      (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Texture datablocks");
434                 uiDefIconButBitS(block, TOG, OOPS_IP, B_NEWOOPS, ICON_IPO_HLT,  (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Ipo datablocks");
435                 uiDefIconButBitS(block, TOG, OOPS_IM, B_NEWOOPS, ICON_IMAGE_HLT,        (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image datablocks");
436                 uiDefIconButBitS(block, TOG, OOPS_LI, B_NEWOOPS, ICON_LIBRARY_HLT,      (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library datablocks");
437
438                 uiBlockEndAlign(block);
439           
440                 /* name */
441                 if(G.soops->lockpoin) {
442                         oops= G.soops->lockpoin;
443                         if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name);
444                         else strcpy(naam, oops->id->name);
445                         
446                         cpack(0x0);
447                         glRasterPos2i(xco+=XIC+10,      5);
448                         BMF_DrawString(uiBlockGetCurFont(block), naam);
449
450                 }
451         }
452 #ifdef SHOWDEPGRAPH
453         else if(soops->type==SO_DEPSGRAPH) {
454                 // cpack colors : 0x00FF00 0xFF0000 0xFFFF00 0x000000 0x0000FF 0x00FFFF
455                 static unsigned char colr[21] ={0x00, 0xFF, 0x00, 
456                                                                                 0x00, 0x00, 0xFF,
457                                                                                 0x00, 0xFF, 0xFF,
458                                                                                 0x00, 0x00, 0x00,
459                                                                                 0xFF, 0x00, 0x00,
460                                                                                 0xFF, 0xFF, 0x00,
461                                                                                 0xFF, 0x00, 0x00};
462                 
463                 uiDefButC(      block, COL, 0, "", (short)(xco+=10),0, 5,YIC, colr, 0, 1, 0, 0,  "");
464                 uiDefButS(      block, TOG|BIT|2, B_REDR, "parent", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "parent");
465                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+3, 0, 1, 0, 0,  "");
466                 uiDefButS(      block, TOG|BIT|1, B_REDR, "data", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "data");
467                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+6, 0, 1, 0, 0,  "");
468                 uiDefButS(      block, TOG|BIT|3, B_REDR, "track", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "track");
469                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+9, 0, 1, 0, 0,  "");
470                 uiDefButS(      block, TOG|BIT|4, B_REDR, "path", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "path");
471                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+12, 0, 1, 0, 0,  "");
472                 uiDefButS(      block, TOG|BIT|5, B_REDR, "cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "constraint");
473                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+15, 0, 1, 0, 0,  "");
474                 uiDefButS(      block, TOG|BIT|6, B_REDR, "hook.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "hook");
475                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+18, 0, 1, 0, 0,  "");
476                 uiDefButS(      block, TOG|BIT|7, B_REDR, "d cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "d cons");
477         } 
478 #endif
479         else {
480                 uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4",       xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
481         }
482         
483         /* always do as last */
484         curarea->headbutlen= xco+2*XIC;
485
486         uiDrawBlock(block);
487 }
488