2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/**
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  $ Id $ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  * * * * *  BEGIN  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  This  program  is  free  software ;  you  can  redistribute  it  and / or 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  modify  it  under  the  terms  of  the  GNU  General  Public  License 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  as  published  by  the  Free  Software  Foundation ;  either  version  2 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  of  the  License ,  or  ( at  your  option )  any  later  version .  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  This  program  is  distributed  in  the  hope  that  it  will  be  useful , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  but  WITHOUT  ANY  WARRANTY ;  without  even  the  implied  warranty  of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE .   See  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  GNU  General  Public  License  for  more  details . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  You  should  have  received  a  copy  of  the  GNU  General  Public  License 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  along  with  this  program ;  if  not ,  write  to  the  Free  Software  Foundation , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Inc . ,  59  Temple  Place  -  Suite  330 ,  Boston ,  MA   02111 - 1307 ,  USA . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  The  Original  Code  is  Copyright  ( C )  2008  Blender  Foundation . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  All  rights  reserved . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Contributor ( s ) :  Blender  Foundation 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  * * * * *  END  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  <string.h> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  <stdio.h> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-22 18:39:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "DNA_object_types.h" 
  
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# include  "DNA_space_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_scene_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_screen_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_windowmanager_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "MEM_guardedalloc.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BLI_blenlib.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-18 02:56:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_context.h" 
  
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# include  "BKE_screen.h" 
  
						 
					
						
							
								
									
										
										
										
											2009-04-22 18:39:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_utildefines.h" 
  
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "ED_screen.h" 
  
						 
					
						
							
								
									
										
										
										
											2008-12-19 12:48:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "ED_types.h" 
  
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# include  "ED_util.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "WM_api.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "WM_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BIF_gl.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BIF_glutil.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "UI_interface.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "UI_resources.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "UI_view2d.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "buttons_intern.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* ************************ header area region *********************** */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  do_viewmenu ( bContext  * C ,  void  * arg ,  int  event )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									SpaceButs  * sbuts =  ( SpaceButs * ) CTX_wm_space_data ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ScrArea  * sa =  CTX_wm_area ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch ( event )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  1 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  2 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											sbuts - > align =  event ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											sbuts - > re_align =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ED_area_tag_redraw ( sa ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
  organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
  too, this is done with a uiDefMenuBut, which takes a pointer
  to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
  specific to making popup menus. Will convert the other
  conformation popup menu functions to use this too so we can
  remove some code.
* Extended uiMenu functions, now there is is also:
  BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
  menu code further here. Did not remove the uiDefMenu functions as
  they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
  for popup menus. It tried to find out in advance what the size
  of the menu was but this is difficult with keymap strings in
  there, now uiPopupBoundsBlock can figure this out afterwards and
  ensure the popup is within the window bounds. Will convert some
  other functions to use this too.
											 
										 
										
											2009-01-30 12:18:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  uiBlock  * dummy_viewmenu ( bContext  * C ,  ARegion  * ar ,  void  * arg_unused )  
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									SpaceButs  * sbuts =  ( SpaceButs * ) CTX_wm_space_data ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ScrArea  * sa =  CTX_wm_area ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									short  yco =  0 ,  menuwidth = 120 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
											
												2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
  Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
  (was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
  to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
  a several calls using different args.
Further just added the missing includes, and removed unused vars.
											 
										 
										
											2009-04-14 15:59:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									block =  uiBeginBlock ( C ,  ar ,  " dummy_viewmenu " ,  UI_EMBOSSP ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									uiBlockSetButmFunc ( block ,  do_viewmenu ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( sbuts - > align  = =  1 )  uiDefIconTextBut ( block ,  BUTM ,  1 ,  ICON_CHECKBOX_HLT ,  " Horizontal " ,  0 ,  yco - = 20 ,  menuwidth ,  19 ,  NULL ,  0.0 ,  0.0 ,  1 ,  1 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  uiDefIconTextBut ( block ,  BUTM ,  1 ,  ICON_CHECKBOX_DEHLT ,  " Horizontal " ,  0 ,  yco - = 20 ,  menuwidth ,  19 ,  NULL ,  0.0 ,  0.0 ,  1 ,  1 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( sbuts - > align  = =  2 )  uiDefIconTextBut ( block ,  BUTM ,  1 ,  ICON_CHECKBOX_HLT ,  " Vertical " ,  0 ,  yco - = 20 ,  menuwidth ,  19 ,  NULL ,  0.0 ,  0.0 ,  1 ,  2 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  uiDefIconTextBut ( block ,  BUTM ,  1 ,  ICON_CHECKBOX_DEHLT ,  " Vertical " ,  0 ,  yco - = 20 ,  menuwidth ,  19 ,  NULL ,  0.0 ,  0.0 ,  1 ,  2 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( sa - > headertype = = HEADERTOP )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										uiBlockSetDirection ( block ,  UI_DOWN ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBlockSetDirection ( block ,  UI_TOP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBlockFlipOrder ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiTextBoundsBlock ( block ,  50 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiEndBlock ( C ,  block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define B_CONTEXT_SWITCH	101 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define B_BUTSPREVIEW		102 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define B_NEWFRAME			103 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  do_buttons_buttons ( bContext  * C ,  void  * arg ,  int  event )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch ( event )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  B_NEWFRAME : 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-27 16:09:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											WM_event_add_notifier ( C ,  NC_SCENE | ND_FRAME ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 13:11:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										case  B_CONTEXT_SWITCH : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-21 15:30:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										case  B_BUTSPREVIEW : 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 13:11:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ED_area_tag_redraw ( CTX_wm_area ( C ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-21 23:39:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  buttons_header_buttons ( const  bContext  * C ,  ARegion  * ar )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2008-12-18 02:56:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ScrArea  * sa =  CTX_wm_area ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									SpaceButs  * sbuts =  ( SpaceButs * ) CTX_wm_space_data ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-22 18:39:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * ob =  CTX_data_active_object ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-22 18:39:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  xco ,  yco =  3 ,  dataicon =  ICON_OBJECT_DATA ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
											
												2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
  Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
  (was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
  to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
  a several calls using different args.
Further just added the missing includes, and removed unused vars.
											 
										 
										
											2009-04-14 15:59:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									block =  uiBeginBlock ( C ,  ar ,  " header buttons " ,  UI_EMBOSS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									uiBlockSetHandleFunc ( block ,  do_buttons_buttons ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-12-14 12:16:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									xco =  ED_area_header_standardbuttons ( C ,  block ,  yco ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ( sa - > flag  &  HEADER_NO_PULLDOWN ) = = 0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  xmax ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										xmax =  GetButStringLength ( " View " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-18 02:56:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										uiDefPulldownBut ( block ,  dummy_viewmenu ,  CTX_wm_area ( C ) ,  
							 
						 
					
						
							
								
									
										
										
										
											2009-04-12 13:40:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														 " View " ,  xco ,  yco ,  xmax - 3 ,  20 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										xco + = xmax ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 15:38:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// DATA Icons
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-22 18:39:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if ( ob )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										switch ( ob - > type )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-04 07:04:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											case  OB_EMPTY :  dataicon =  ICON_EMPTY_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_MESH :  dataicon =  ICON_MESH_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_CURVE :  dataicon =  ICON_CURVE_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_SURF :  dataicon =  ICON_SURFACE_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_FONT :  dataicon =  ICON_FONT_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_MBALL :  dataicon =  ICON_META_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_LAMP :  dataicon =  ICON_LAMP_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_CAMERA :  dataicon =  ICON_CAMERA_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_LATTICE :  dataicon =  ICON_LATTICE_DATA ;  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  OB_ARMATURE :  dataicon =  ICON_ARMATURE_DATA ;  break ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-22 18:39:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											default :  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlockSetEmboss ( block ,  UI_EMBOSS ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-18 18:20:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// if object selection changed, validate button selection
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ob  & &  ( ob - > type  = =  OB_LAMP )  & &  ELEM3 ( sbuts - > mainb ,  ( float ) BCONTEXT_MATERIAL ,  ( float ) BCONTEXT_PARTICLE ,  ( float ) BCONTEXT_PHYSICS ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sbuts - > mainb  =  ( float ) BCONTEXT_DATA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ob  & &  ( ob - > type  = =  OB_EMPTY )  & &  ELEM3 ( sbuts - > mainb ,  ( float ) BCONTEXT_MATERIAL ,  ( float ) BCONTEXT_TEXTURE ,  ( float ) BCONTEXT_PARTICLE ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sbuts - > mainb  =  ( float ) BCONTEXT_DATA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ( ob  & &  ELEM ( ob - > type ,  OB_CAMERA ,  OB_ARMATURE ) )  & &  ELEM4 ( sbuts - > mainb ,  ( float ) BCONTEXT_MATERIAL ,  ( float ) BCONTEXT_TEXTURE ,  ( float ) BCONTEXT_PARTICLE ,  ( float ) BCONTEXT_PHYSICS ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sbuts - > mainb  =  ( float ) BCONTEXT_DATA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ( ob  & &  ( ob - > type  ! =  OB_ARMATURE ) )  & &  ( sbuts - > mainb  = =  ( float ) BCONTEXT_BONE ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sbuts - > mainb  =  ( float ) BCONTEXT_DATA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 15:38:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 if ( ! ob  & &  ! ELEM ( sbuts - > mainb ,  ( float ) BCONTEXT_SCENE ,  ( float ) BCONTEXT_WORLD ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sbuts - > mainb  =  ( float ) BCONTEXT_WORLD ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-21 15:30:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_SCENE , 			xco ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_SCENE ,  0 ,  0 ,  " Scene " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_WORLD , 		xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_WORLD ,  0 ,  0 ,  " World " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 15:38:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if ( ob )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_OBJECT_DATA , 	xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_OBJECT ,  0 ,  0 ,  " Object " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ELEM5 ( ob - > type ,  OB_MESH ,  OB_CURVE ,  OB_SURF ,  OB_FONT ,  OB_LATTICE ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_MODIFIER , 	xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_MODIFIER ,  0 ,  0 ,  " Modifier " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	dataicon , 		xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_DATA ,  0 ,  0 ,  " Object Data " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ( ob - > type  = =  OB_ARMATURE ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_BONE_DATA , 	xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_BONE ,  0 ,  0 ,  " Bone " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ELEM5 ( ob - > type ,  OB_MESH ,  OB_SURF ,  OB_MBALL ,  OB_CURVE ,  OB_FONT ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uiDefIconButS ( block ,  ROW ,  B_BUTSPREVIEW , 	ICON_MATERIAL , 			xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_MATERIAL ,  0 ,  0 ,  " Material " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ELEM6 ( ob - > type ,  OB_MESH ,  OB_SURF ,  OB_MBALL ,  OB_CURVE ,  OB_FONT ,  OB_LAMP ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uiDefIconButS ( block ,  ROW ,  B_BUTSPREVIEW , 	ICON_TEXTURE , 	xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_TEXTURE ,  0 ,  0 ,  " Texture " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ELEM5 ( ob - > type ,  OB_MESH ,  OB_SURF ,  OB_MBALL ,  OB_CURVE ,  OB_FONT ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_PARTICLES , 	xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_PARTICLE ,  0 ,  0 ,  " Particles " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ELEM6 ( ob - > type ,  OB_MESH ,  OB_SURF ,  OB_MBALL ,  OB_CURVE ,  OB_FONT ,  OB_EMPTY ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uiDefIconButS ( block ,  ROW ,  B_CONTEXT_SWITCH , 	ICON_PHYSICS , 	xco + = XIC ,  yco ,  XIC ,  YIC ,  & ( sbuts - > mainb ) ,  0.0 ,  ( float ) BCONTEXT_PHYSICS ,  0 ,  0 ,  " Physics " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									xco + =  XIC ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									xco + = XIC ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-18 02:56:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiDefButI ( block ,  NUM ,  B_NEWFRAME ,  " " , 	( xco + 20 ) , yco , 60 , YIC ,  & ( CTX_data_scene ( C ) - > r . cfra ) ,  1.0 ,  MAXFRAMEF ,  0 ,  0 ,  " Displays Current Frame of animation. Click to change. " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									xco + =  80 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// XXX	buttons_active_id(&id, &idfrom);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//	sbuts->lockpoin= id;
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* always as last  */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-15 13:23:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_view2d_totRect_set ( & ar - > v2d ,  xco + XIC + 80 ,  ar - > v2d . tot . ymax - ar - > v2d . tot . ymin ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiEndBlock ( C ,  block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 13:11:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiDrawBlock ( C ,  block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-13 19:00:54 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}