[Bf-blender-cvs] [e50ca40] UI-experiments: Merge branch 'master' into UI-experiments

Julian Eisel noreply at git.blender.org
Tue Aug 25 00:30:14 CEST 2015


Commit: e50ca409b93f798b0407f300df4ee44741a111d2
Author: Julian Eisel
Date:   Tue Aug 25 00:06:33 2015 +0200
Branches: UI-experiments
https://developer.blender.org/rBe50ca409b93f798b0407f300df4ee44741a111d2

Merge branch 'master' into UI-experiments

Conflicts:
	source/blender/editors/interface/interface.c
	source/blender/editors/interface/interface_intern.h

===================================================================



===================================================================

diff --cc source/blender/blenkernel/BKE_blender.h
index 1032e32,2a9583b..a13bd0c
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@@ -42,7 -42,7 +42,7 @@@ extern "C" 
   * and keep comment above the defines.
   * Use STRINGIFY() rather than defining with quotes */
  #define BLENDER_VERSION         275
- #define BLENDER_SUBVERSION      5
 -#define BLENDER_SUBVERSION      4
++#define BLENDER_SUBVERSION      6
  /* Several breakages with 270, e.g. constraint deg vs rad */
  #define BLENDER_MINVERSION      270
  #define BLENDER_MINSUBVERSION   5
diff --cc source/blender/editors/interface/interface.c
index 995aa7c,dcf1143..4c42d5b
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@@ -1316,55 -1330,10 +1337,46 @@@ static void ui_but_to_pixelrect(rcti *r
  	rctf rectf;
  
  	ui_block_to_window_rctf(ar, block, &rectf, (but) ? &but->rect : &block->rect);
- 
- 	rectf.xmin -= ar->winrct.xmin;
- 	rectf.ymin -= ar->winrct.ymin;
- 	rectf.xmax -= ar->winrct.xmin;
- 	rectf.ymax -= ar->winrct.ymin;
- 
- 	rect->xmin = floorf(rectf.xmin);
- 	rect->ymin = floorf(rectf.ymin);
- 	rect->xmax = floorf(rectf.xmax);
- 	rect->ymax = floorf(rectf.ymax);
+ 	BLI_rcti_rctf_copy_floor(rect, &rectf);
+ 	BLI_rcti_translate(rect, -ar->winrct.xmin, -ar->winrct.ymin);
  }
  
- 
 +/* project a rcti to pixels in regionspace */
 +void ui_rcti_to_pixelrect(const ARegion *ar, uiBlock *block, rcti *rct_dst, const rcti *rct_src)
 +{
 +	rcti rect;
 +
 +	ui_block_to_window_rcti(ar, block, &rect, rct_src);
 +
 +	rect.xmin -= ar->winrct.xmin;
 +	rect.ymin -= ar->winrct.ymin;
 +	rect.xmax -= ar->winrct.xmin;
 +	rect.ymax -= ar->winrct.ymin;
 +
 +	rct_dst->xmin = iroundf(rect.xmin);
 +	rct_dst->ymin = iroundf(rect.ymin);
 +	rct_dst->xmax = iroundf(rect.xmax);
 +	rct_dst->ymax = iroundf(rect.ymax);
 +}
 +
 +/* project a rctf to pixels in regionspace */
 +void ui_rctf_to_pixelrect(const ARegion *ar, uiBlock *block, rctf *rct_dst, const rctf *rct_src)
 +{
 +	rctf rect;
 +
 +	ui_block_to_window_rctf(ar, block, &rect, rct_src);
 +
 +	rect.xmin -= ar->winrct.xmin;
 +	rect.ymin -= ar->winrct.ymin;
 +	rect.xmax -= ar->winrct.xmin;
 +	rect.ymax -= ar->winrct.ymin;
 +
 +	rct_dst->xmin = floorf(rect.xmin);
 +	rct_dst->ymin = floorf(rect.ymin);
 +	rct_dst->xmax = floorf(rect.xmax);
 +	rct_dst->ymax = floorf(rect.ymax);
 +}
 +
  /* uses local copy of style, to scale things down, and allow widgets to change stuff */
  void UI_block_draw(const bContext *C, uiBlock *block)
  {
@@@ -2571,10 -2533,10 +2583,14 @@@ static void ui_but_free(const bContext 
  		IMB_freeImBuf((struct ImBuf *)but->poin);
  	}
  
+ 	if (but->dragpoin && (but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
+ 		MEM_freeN(but->dragpoin);
+ 	}
+ 
 +	if ((BLI_listbase_is_empty(&but->subbuts)) == false) {
 +		BLI_freelistN(&but->subbuts);
 +	}
 +
  	BLI_assert(UI_butstore_is_registered(but->block, but) == false);
  
  	MEM_freeN(but);
diff --cc source/blender/editors/interface/interface_handlers.c
index c4f5602,96f6e56..5d2b6e3
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@@ -6531,11 -6541,9 +6532,11 @@@ static bool ui_but_menu(bContext *C, ui
  				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0);
  			}
  			else {
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframe"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframe"),
  				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
  			}
 +
 +			is_first_item = false;
  		}
  		
  		if ((but->flag & UI_BUT_ANIMATED) && (but->rnapoin.type != &RNA_NlaStrip)) {
@@@ -6546,21 -6554,19 +6547,21 @@@
  				               ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 0);
  			}
  			else {
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Keyframes"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Keyframes"),
  				               ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 1);
  			}
 +
 +			is_first_item = false;
  		}
  
  		/* Drivers */
  		if (but->flag & UI_BUT_DRIVEN) {
 -			uiItemS(layout);
 +			ADD_SEPARATOR_CONDITIONAL
  
  			if (is_array_component) {
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Drivers"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Drivers"),
  				               ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Driver"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Driver"),
  				               ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0);
  			}
  			else {
@@@ -6568,25 -6574,23 +6569,25 @@@
  				               ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
  			}
  
- 			uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
+ 			uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
  			        ICON_NONE, "ANIM_OT_copy_driver_button");
  			if (ANIM_driver_can_paste()) {
- 				uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
+ 				uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
  				        ICON_NONE, "ANIM_OT_paste_driver_button");
  			}
 +
 +			is_first_item = false;
  		}
  		else if (but->flag & (UI_BUT_ANIMATED_KEY | UI_BUT_ANIMATED)) {
  			/* pass */
  		}
  		else if (is_anim) {
 -			uiItemS(layout);
 +			ADD_SEPARATOR_CONDITIONAL
  
  			if (is_array_component) {
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Drivers"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add Drivers"),
  				               ICON_NONE, "ANIM_OT_driver_button_add", "all", 1);
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single Driver"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single Driver"),
  				               ICON_NONE, "ANIM_OT_driver_button_add", "all", 0);
  			}
  			else {
@@@ -6595,38 -6599,34 +6596,38 @@@
  			}
  
  			if (ANIM_driver_can_paste()) {
- 				uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
+ 				uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
  				        ICON_NONE, "ANIM_OT_paste_driver_button");
  			}
 +
 +			is_first_item = false;
  		}
  		
  		/* Keying Sets */
  		/* TODO: check on modifyability of Keying Set when doing this */
  		if (is_anim) {
 -			uiItemS(layout);
 +			ADD_SEPARATOR_CONDITIONAL
  
  			if (is_array_component) {
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add All to Keying Set"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add All to Keying Set"),
  				               ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1);
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single to Keying Set"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single to Keying Set"),
  				               ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0);
- 				uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"),
+ 				uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"),
  				        ICON_NONE, "ANIM_OT_keyingset_button_remove");
  			}
  			else {
- 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add to Keying Set"),
+ 				uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add to Keying Set"),
  				               ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1);
- 				uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"),
+ 				uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"),
  				        ICON_NONE, "ANIM_OT_keyingset_button_remove");
  			}
 +
 +			is_first_item = false;
  		}
 -		
 -		uiItemS(layout);
 -		
 +
 +		ADD_SEPARATOR_CONDITIONAL
 +
  		/* Property Operators */
  		
  		/* Copy Property Value
@@@ -6678,26 -6678,20 +6679,26 @@@
  			                        0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
  			UI_but_func_set(but2, popup_change_shortcut_func, but, NULL);
  
- 			but2 = uiDefIconTextBut(block, UI_BTYPE_BUT, 0, 0, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove Shortcut"),
+ 			but2 = uiDefIconTextBut(block, UI_BTYPE_BUT, 0, 0, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove Shortcut"),
  			                        0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
  			UI_but_func_set(but2, remove_shortcut_func, but, NULL);
 +
 +			is_first_item = false;
  		}
  		/* only show 'add' if there's a suitable key map for it to go in */
  		else if (WM_keymap_guess_opname(C, but->optype->idname)) {
- 			but2 = uiDefIconTextBut(block, UI_BTYPE_BUT, 0, 0, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Shortcut"),
+ 			but2 = uiDefIconTextBut(block, UI_BTYPE_BUT, 0, 0, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add Shortcut"),
  			                        0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
  			UI_but_func_set(but2, popup_add_shortcut_func, but, NULL);
 +
 +			is_first_item = false;
  		}
 -		
 -		uiItemS(layout);
 +
 +		ADD_SEPARATOR_CONDITIONAL
  	}
  
 +#undef ADD_SEPARATOR_CONDITIONAL
 +
  	/* Show header tools for header buttons. */
  	if (ui_block_is_menu(but->block) == false) {
  		ARegion *ar = CTX_wm_region(C);
diff --cc source/blender/editors/interface/interface_intern.h
index 7764caa,8ad9770..b790c1f
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@@ -478,8 -450,7 +484,9 @@@ extern void ui_window_to_block_fl(cons
  extern void ui_window_to_block(const struct ARegion *ar, uiBlock *block, int *x, int *y);
  extern void ui_window_to_region(const ARegion *ar, int *x, int *y);
  extern void ui_region_to_window(const struct ARegion *ar, int *x, int *y);
+ extern void ui_re

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list