[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55537] trunk/blender/source/blender/ editors: code cleanup: remove unused button type HSVSLI

Campbell Barton ideasman42 at gmail.com
Sat Mar 23 17:03:14 CET 2013


Revision: 55537
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55537
Author:   campbellbarton
Date:     2013-03-23 16:03:13 +0000 (Sat, 23 Mar 2013)
Log Message:
-----------
code cleanup: remove unused button type HSVSLI

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/UI_interface.h
    trunk/blender/source/blender/editors/interface/interface.c
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_widgets.c

Modified: trunk/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_interface.h	2013-03-23 14:09:16 UTC (rev 55536)
+++ trunk/blender/source/blender/editors/include/UI_interface.h	2013-03-23 16:03:13 UTC (rev 55537)
@@ -223,7 +223,7 @@
 	NUMSLI        = (14 << 9),
 	COLOR         = (15 << 9),
 	IDPOIN        = (16 << 9),
-	HSVSLI        = (17 << 9),  /* UNUSED, but code still references */
+	/* HSVSLI     = (17 << 9), */  /* UNUSED */
 	SCROLL        = (18 << 9),
 	BLOCK         = (19 << 9),
 	BUTM          = (20 << 9),
@@ -922,5 +922,4 @@
 int  UI_editsource_enable_check(void);
 void UI_editsource_active_but_test(uiBut *but);
 
-#endif /*  __UI_INTERFACE_H__ */
-
+#endif  /* __UI_INTERFACE_H__ */

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2013-03-23 14:09:16 UTC (rev 55536)
+++ trunk/blender/source/blender/editors/interface/interface.c	2013-03-23 16:03:13 UTC (rev 55537)
@@ -1492,18 +1492,6 @@
 				break;
 		}
 	}
-	else if (but->type == HSVSLI) {
-		float *fp, hsv[3];
-		
-		fp = (but->editvec) ? but->editvec : (float *)but->poin;
-		rgb_to_hsv_v(fp, hsv);
-
-		switch (but->str[0]) {
-			case 'H': value = hsv[0]; break;
-			case 'S': value = hsv[1]; break;
-			case 'V': value = hsv[2]; break;
-		}
-	}
 	else if (but->pointype == UI_BUT_POIN_CHAR) {
 		value = *(char *)but->poin;
 	}
@@ -1570,21 +1558,6 @@
 	else if (but->pointype == 0) {
 		/* pass */
 	}
-	else if (but->type == HSVSLI) {
-		float *fp, hsv[3];
-		
-		fp = (but->editvec) ? but->editvec : (float *)but->poin;
-		rgb_to_hsv_v(fp, hsv);
-		
-		switch (but->str[0]) {
-			case 'H': hsv[0] = value; break;
-			case 'S': hsv[1] = value; break;
-			case 'V': hsv[2] = value; break;
-		}
-		
-		hsv_to_rgb_v(hsv, fp);
-		
-	}
 	else {
 		/* first do rounding */
 		if (but->pointype == UI_BUT_POIN_CHAR) {
@@ -2300,7 +2273,6 @@
 		case SLI:
 		case SCROLL:
 		case NUMSLI:
-		case HSVSLI:
 			UI_GET_BUT_VALUE_INIT(but, value);
 			if (value < (double)but->hardmin) ui_set_but_val(but, but->hardmin);
 			else if (value > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
@@ -2360,7 +2332,6 @@
 	
 		case NUM:
 		case NUMSLI:
-		case HSVSLI:
 		case NUMABS:
 
 			UI_GET_BUT_VALUE_INIT(but, value);
@@ -2786,7 +2757,7 @@
 	
 	but->pos = -1;   /* cursor invisible */
 
-	if (ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) {    /* add a space to name */
+	if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) {    /* add a space to name */
 		/* slen remains unchanged from previous assignment, ensure this stays true */
 		if (slen > 0 && slen < UI_MAX_NAME_STR - 2) {
 			if (but->str[slen - 1] != ' ') {

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-03-23 14:09:16 UTC (rev 55536)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-03-23 16:03:13 UTC (rev 55537)
@@ -1270,8 +1270,6 @@
 		case NUMSLI:
 			ui_apply_but_NUM(C, but, data);
 			break;
-		case HSVSLI:
-			break;
 		case TOG3:
 			ui_apply_but_TOG3(C, but, data);
 			break;
@@ -1393,7 +1391,7 @@
 	}
 	
 	/* numeric value */
-	if (ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) {
+	if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
 		
 		if (but->poin == NULL && but->rnapoin.data == NULL) {
 			/* pass */
@@ -2053,7 +2051,7 @@
 		return;
 
 	for (but = actbut->next; but; but = but->next) {
-		if (ELEM8(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+		if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
 			if (!(but->flag & UI_BUT_DISABLED)) {
 				data->postbut = but;
 				data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2062,7 +2060,7 @@
 		}
 	}
 	for (but = block->buttons.first; but != actbut; but = but->next) {
-		if (ELEM8(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+		if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
 			if (!(but->flag & UI_BUT_DISABLED)) {
 				data->postbut = but;
 				data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2081,7 +2079,7 @@
 		return;
 
 	for (but = actbut->prev; but; but = but->prev) {
-		if (ELEM8(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+		if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
 			if (!(but->flag & UI_BUT_DISABLED)) {
 				data->postbut = but;
 				data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2090,7 +2088,7 @@
 		}
 	}
 	for (but = block->buttons.last; but != actbut; but = but->prev) {
-		if (ELEM8(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+		if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
 			if (!(but->flag & UI_BUT_DISABLED)) {
 				data->postbut = but;
 				data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -3121,10 +3119,6 @@
 		offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
 		deler = BLI_rctf_size_x(&but->rect) - offs;
 	}
-	else if (but->type == HSVSLI) {
-		offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
-		deler = (BLI_rctf_size_x(&but->rect) / 2.0f) - offs;
-	}
 	else if (but->type == SCROLL) {
 		const float size = (is_horizontal) ? BLI_rctf_size_x(&but->rect) : -BLI_rctf_size_y(&but->rect);
 		deler = size * (but->softmax - but->softmin) / (but->softmax - but->softmin + but->a1);
@@ -5423,7 +5417,6 @@
 			break;
 		case SLI:
 		case NUMSLI:
-		case HSVSLI:
 			retval = ui_do_but_SLI(C, block, but, data, event);
 			break;
 		case ROUNDBOX:

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-03-23 14:09:16 UTC (rev 55536)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-03-23 16:03:13 UTC (rev 55537)
@@ -3224,7 +3224,6 @@
 				break;
 				
 			case NUMSLI:
-			case HSVSLI:
 				wt = widget_type(UI_WTYPE_SLIDER);
 				break;
 				




More information about the Bf-blender-cvs mailing list