Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-23 20:03:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-23 20:03:13 +0400
commit5a87e4d255477e16fb93f805c58f35496faa52ee (patch)
tree645d995d8349ce925a65dcc40f8038be206dfa8e /source/blender/editors
parent1c32b516f718a0becb43e1c44e6d8db4f0a9fcb4 (diff)
code cleanup: remove unused button type HSVSLI
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/UI_interface.h5
-rw-r--r--source/blender/editors/interface/interface.c31
-rw-r--r--source/blender/editors/interface/interface_handlers.c17
-rw-r--r--source/blender/editors/interface/interface_widgets.c1
4 files changed, 8 insertions, 46 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 4077e6d1689..3b4415703d5 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -223,7 +223,7 @@ typedef enum {
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 @@ void UI_template_fix_linking(void);
int UI_editsource_enable_check(void);
void UI_editsource_active_but_test(uiBut *but);
-#endif /* __UI_INTERFACE_H__ */
-
+#endif /* __UI_INTERFACE_H__ */
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index c3304648463..16598511921 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1492,18 +1492,6 @@ double ui_get_but_val(uiBut *but)
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 @@ void ui_set_but_val(uiBut *but, double value)
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 @@ void ui_check_but(uiBut *but)
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 @@ void ui_check_but(uiBut *but)
case NUM:
case NUMSLI:
- case HSVSLI:
case NUMABS:
UI_GET_BUT_VALUE_INIT(but, value);
@@ -2786,7 +2757,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
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] != ' ') {
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 54a173af603..b34f4c9653f 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1270,8 +1270,6 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
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 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
/* 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 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
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 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
}
}
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 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
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 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
}
}
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 @@ static bool ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data,
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 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
break;
case SLI:
case NUMSLI:
- case HSVSLI:
retval = ui_do_but_SLI(C, block, but, data, event);
break;
case ROUNDBOX:
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index c5d97cb7cd9..96c8ded46da 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3224,7 +3224,6 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
case NUMSLI:
- case HSVSLI:
wt = widget_type(UI_WTYPE_SLIDER);
break;