diff options
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 109 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 104 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 84 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 75 |
8 files changed, 343 insertions, 52 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index eff4d1f6397..e5092c82304 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -766,7 +766,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) { uiBut *but; - unsigned int meny_key_mask= 0; + unsigned int menu_key_mask= 0; unsigned char menu_key; const char *str_pt; int pass; @@ -788,8 +788,8 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) if(but->str) { for(str_pt= but->str; *str_pt; ) { menu_key= tolower(*str_pt); - if((menu_key >= 'a' && menu_key <= 'z') && !(meny_key_mask & 1<<(menu_key-'a'))) { - meny_key_mask |= 1<<(menu_key-'a'); + if((menu_key >= 'a' && menu_key <= 'z') && !(menu_key_mask & 1<<(menu_key-'a'))) { + menu_key_mask |= 1<<(menu_key-'a'); break; } @@ -816,7 +816,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) } /* if all keys have been used just exit, unlikely */ - if(meny_key_mask == (1<<26)-1) { + if(menu_key_mask == (1<<26)-1) { return; } } @@ -1224,7 +1224,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3]) int a, tot; if(but->editvec) { - VECCOPY(vec, but->editvec); + copy_v3_v3(vec, but->editvec); } if(but->rnaprop) { @@ -1248,7 +1248,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3]) } else if(but->pointype == FLO) { float *fp= (float *)but->poin; - VECCOPY(vec, fp); + copy_v3_v3(vec, fp); } else { if (but->editvec==NULL) { diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 3d08e761090..4bc0963aad4 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -34,6 +34,7 @@ #include "DNA_color_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "DNA_movieclip_types.h" #include "BLI_math.h" #include "BLI_rect.h" @@ -1501,6 +1502,114 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect fdrawbox(rect->xmin, rect->ymin, rect->xmax, rect->ymax); } +static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy) +{ + ImBuf *scaleibuf; + int x, y, w= ibuf->x*zoomx, h= ibuf->y*zoomy; + scaleibuf= IMB_allocImBuf(w, h, 32, IB_rect); + + for(y= 0; y<scaleibuf->y; y++) { + for (x= 0; x<scaleibuf->x; x++) { + int pixel= scaleibuf->x*y + x; + int orig_pixel= ibuf->x*(int)(((float)y)/zoomy) + (int)(((float)x)/zoomx); + char *rrgb= (char*)scaleibuf->rect + pixel*4; + char *orig_rrgb= (char*)ibuf->rect + orig_pixel*4; + rrgb[0]= orig_rrgb[0]; + rrgb[1]= orig_rrgb[1]; + rrgb[2]= orig_rrgb[2]; + rrgb[3]= orig_rrgb[3]; + } + } + + return scaleibuf; +} + +void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) +{ + rctf rect; + int ok= 0; + GLint scissor[4]; + MovieClipScopes *scopes = (MovieClipScopes *)but->poin; + + rect.xmin = (float)recti->xmin+1; + rect.xmax = (float)recti->xmax-1; + rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2; + rect.ymax = (float)recti->ymax-1; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + /* need scissor test, preview image can draw outside of boundary */ + glGetIntegerv(GL_VIEWPORT, scissor); + glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1)); + + if(scopes->track_disabled) { + glColor4f(0.7f, 0.3f, 0.3f, 0.3f); + uiSetRoundBox(15); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + + ok= 1; + } + else if(scopes->track_preview) { + int a, off_x, off_y; + float zoomx, zoomy; + ImBuf *drawibuf; + + glPushMatrix(); + + /* draw content of pattern area */ + glScissor(ar->winrct.xmin+rect.xmin, ar->winrct.ymin+rect.ymin, scissor[2], scissor[3]); + + zoomx= (rect.xmax-rect.xmin) / (scopes->track_preview->x-2.f); + zoomy= (rect.ymax-rect.ymin) / (scopes->track_preview->y-2.f); + + off_x= ((int)scopes->track_pos[0]-scopes->track_pos[0]-0.5)*zoomx; + off_y= ((int)scopes->track_pos[1]-scopes->track_pos[1]-0.5)*zoomy; + + drawibuf= scale_trackpreview_ibuf(scopes->track_preview, zoomx, zoomy); + glaDrawPixelsSafe(off_x+rect.xmin, off_y+rect.ymin, rect.xmax-rect.xmin+1.f-off_x, rect.ymax-rect.ymin+1.f-off_y, drawibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, drawibuf->rect); + + IMB_freeImBuf(drawibuf); + + /* draw cross for pizel position */ + glTranslatef(off_x+rect.xmin+scopes->track_pos[0]*zoomx, off_y+rect.ymin+scopes->track_pos[1]*zoomy, 0.f); + glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin+rect.ymin, rect.xmax-rect.xmin, rect.ymax-rect.ymin); + + for(a= 0; a< 2; a++) { + if(a==1) { + glLineStipple(3, 0xaaaa); + glEnable(GL_LINE_STIPPLE); + UI_ThemeColor(TH_SEL_MARKER); + } + else { + UI_ThemeColor(TH_MARKER_OUTLINE); + } + + glBegin(GL_LINES); + glVertex2f(-10.0f, 0.0f); + glVertex2f(10.0f, 0.0f); + glVertex2f(0.0f, -10.0f); + glVertex2f(0.0f, 10.0f); + glEnd(); + } + + glDisable(GL_LINE_STIPPLE); + glPopMatrix(); + + ok= 1; + } + + if(!ok) { + glColor4f(0.f, 0.f, 0.f, 0.3f); + uiSetRoundBox(15); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + } + + /* outline, scale gripper */ + draw_scope_end(&rect, scissor); + + glDisable(GL_BLEND); +} /* ****************************************************** */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 0ba141163b3..c871c87983c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -56,6 +56,7 @@ #include "BKE_idprop.h" #include "BKE_report.h" #include "BKE_texture.h" +#include "BKE_tracking.h" #include "BKE_unit.h" #include "ED_screen.h" @@ -259,7 +260,7 @@ static uiBut *ui_but_last(uiBlock *block) static int ui_is_a_warp_but(uiBut *but) { if(U.uiflag & USER_CONTINUOUS_MOUSE) - if(ELEM3(but->type, NUM, NUMABS, HSVCIRCLE)) + if(ELEM4(but->type, NUM, NUMABS, HSVCIRCLE, TRACKPREVIEW)) return TRUE; return FALSE; @@ -922,6 +923,13 @@ static void ui_apply_but_WAVEFORM(bContext *C, uiBut *but, uiHandleButtonData *d data->applied= 1; } +static void ui_apply_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data) +{ + ui_apply_but_func(C, but); + data->retval= but->retval; + data->applied= 1; +} + static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, int interactive) { @@ -944,7 +952,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut data->origstr= NULL; data->value= data->origvalue; data->origvalue= 0.0; - VECCOPY(data->vec, data->origvec); + copy_v3_v3(data->vec, data->origvec); data->origvec[0]= data->origvec[1]= data->origvec[2]= 0.0f; } else { @@ -1051,6 +1059,9 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut case WAVEFORM: ui_apply_but_WAVEFORM(C, but, data); break; + case TRACKPREVIEW: + ui_apply_but_TRACKPREVIEW(C, but, data); + break; default: break; } @@ -2121,7 +2132,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data break; case COL: ui_get_but_vectorf(but, data->origvec); - VECCOPY(data->vec, data->origvec); + copy_v3_v3(data->vec, data->origvec); but->editvec= data->vec; handlefunc= ui_block_func_COL; @@ -4254,6 +4265,88 @@ static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmE return WM_UI_HANDLER_CONTINUE; } +static int ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data, int mx, int my, int shift) +{ + MovieClipScopes *scopes = (MovieClipScopes *)but->poin; + int changed= 1; + float dx, dy; + + dx = mx - data->draglastx; + dy = my - data->draglasty; + + if(shift) { + dx /= 5.0f; + dy /= 5.0f; + } + + if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) { + /* resize preview widget itself */ + scopes->track_preview_height = (but->y2 - but->y1) + (data->dragstarty - my); + } else { + if(scopes->marker) { + if(scopes->marker->framenr!=scopes->framenr) + scopes->marker= BKE_tracking_ensure_marker(scopes->track, scopes->framenr); + + scopes->marker->flag&= ~(MARKER_DISABLED|MARKER_TRACKED); + scopes->marker->pos[0]+= -dx*scopes->slide_scale[0] / (but->block->maxx-but->block->minx); + scopes->marker->pos[1]+= -dy*scopes->slide_scale[1] / (but->block->maxy-but->block->miny); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL); + } + + scopes->ok= 0; + } + + data->draglastx= mx; + data->draglasty= my; + + return changed; +} + +static int ui_do_but_TRACKPREVIEW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event) +{ + int mx, my; + + mx= event->x; + my= event->y; + ui_window_to_block(data->region, block, &mx, &my); + + if(data->state == BUTTON_STATE_HIGHLIGHT) { + if(event->type==LEFTMOUSE && event->val==KM_PRESS) { + data->dragstartx= mx; + data->dragstarty= my; + data->draglastx= mx; + data->draglasty= my; + button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); + + /* also do drag the first time */ + if(ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift)) + ui_numedit_apply(C, block, but, data); + + return WM_UI_HANDLER_BREAK; + } + } + else if(data->state == BUTTON_STATE_NUM_EDITING) { + if(event->type == ESCKEY) { + data->cancel= 1; + data->escapecancel= 1; + button_activate_state(C, but, BUTTON_STATE_EXIT); + } + else if(event->type == MOUSEMOVE) { + if(mx!=data->draglastx || my!=data->draglasty) { + if(ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift)) + ui_numedit_apply(C, block, but, data); + } + } + else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) { + button_activate_state(C, but, BUTTON_STATE_EXIT); + } + return WM_UI_HANDLER_BREAK; + } + + return WM_UI_HANDLER_CONTINUE; +} + static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) { uiBut *but = (uiBut *)arg1; @@ -4791,6 +4884,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) case INLINK: retval= ui_do_but_LINK(C, but, data, event); break; + case TRACKPREVIEW: + retval= ui_do_but_TRACKPREVIEW(C, block, but, data, event); + break; } return retval; @@ -5727,7 +5823,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * /* copy over return values from the closing menu */ if(menu->menuretval == UI_RETURN_OK || menu->menuretval == UI_RETURN_UPDATE) { if(but->type == COL) - VECCOPY(data->vec, menu->retvec) + copy_v3_v3(data->vec, menu->retvec); else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) data->value= menu->retvalue; } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 9c5fafaf167..29447d492c5 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -454,6 +454,7 @@ void ui_draw_but_COLORBAND(uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_NORMAL(uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_CURVE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); +void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); /* interface_handlers.c */ extern void ui_button_activate_do(struct bContext *C, struct ARegion *ar, uiBut *but); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 4791d2652dc..edbd5c5684e 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2126,7 +2126,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT); - VECCOPY(handle->retvec, but->editvec); + copy_v3_v3(handle->retvec, but->editvec); uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 730a2ccb0bd..6a3e6025653 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2483,6 +2483,7 @@ void uiTemplateOperatorSearch(uiLayout *layout) #define B_STOPANIM 3 #define B_STOPCOMPO 4 #define B_STOPSEQ 5 +#define B_STOPCLIP 6 static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) { @@ -2502,6 +2503,9 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) case B_STOPSEQ: WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); break; + case B_STOPCLIP: + WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); + break; } } @@ -2527,6 +2531,10 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) if(WM_jobs_test(wm, sa)) owner = sa; handle_event = B_STOPSEQ; + } else if(sa->spacetype==SPACE_CLIP) { + if(WM_jobs_test(wm, sa)) + owner = sa; + handle_event= B_STOPCLIP; } else { Scene *scene; /* another scene can be rendering too, for example via compositor */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c5ac4f5aa88..8ab48ac8ffa 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1510,7 +1510,7 @@ static void widget_state(uiWidgetType *wt, int state) wt->wcol= *(wt->wcol_theme); if(state & UI_SELECT) { - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel) + copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel); if(state & UI_BUT_ANIMATED_KEY) widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend); @@ -1519,7 +1519,7 @@ static void widget_state(uiWidgetType *wt, int state) else if(state & UI_BUT_DRIVEN) widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend); - VECCOPY(wt->wcol.text, wt->wcol.text_sel); + copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel); if(state & UI_SELECT) SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown); @@ -1604,7 +1604,7 @@ static void widget_state_option_menu(uiWidgetType *wt, int state) else { bTheme *btheme= U.themes.first; /* XXX */ - VECCOPY(wt->wcol.text, btheme->tui.wcol_menu_back.text); + copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text); } } @@ -1619,11 +1619,11 @@ static void widget_state_pulldown(uiWidgetType *wt, int state) { wt->wcol= *(wt->wcol_theme); - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel); - VECCOPY(wt->wcol.outline, wt->wcol.inner); + copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel); + copy_v3_v3_char(wt->wcol.outline, wt->wcol.inner); if(state & UI_ACTIVE) - VECCOPY(wt->wcol.text, wt->wcol.text_sel); + copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel); } /* special case, menu items */ @@ -1637,8 +1637,8 @@ static void widget_state_menu_item(uiWidgetType *wt, int state) wt->wcol.text[2]= 0.5f*(wt->wcol.text[2]+wt->wcol.text_sel[2]); } else if(state & UI_ACTIVE) { - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel); - VECCOPY(wt->wcol.text, wt->wcol.text_sel); + copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel); + copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel); } } @@ -1874,38 +1874,38 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) break; case UI_GRAD_H: hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); - VECCOPY(col1[1], col1[0]); - VECCOPY(col1[2], col1[0]); - VECCOPY(col1[3], col1[0]); + copy_v3_v3(col1[1], col1[0]); + copy_v3_v3(col1[2], col1[0]); + copy_v3_v3(col1[3], col1[0]); break; case UI_GRAD_S: hsv_to_rgb(1.0, 0.0, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]); - VECCOPY(col1[0], col1[1]); - VECCOPY(col1[2], col1[1]); - VECCOPY(col1[3], col1[1]); + copy_v3_v3(col1[0], col1[1]); + copy_v3_v3(col1[2], col1[1]); + copy_v3_v3(col1[3], col1[1]); break; case UI_GRAD_V: hsv_to_rgb(1.0, 1.0, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]); - VECCOPY(col1[0], col1[2]); - VECCOPY(col1[1], col1[2]); - VECCOPY(col1[3], col1[2]); + copy_v3_v3(col1[0], col1[2]); + copy_v3_v3(col1[1], col1[2]); + copy_v3_v3(col1[3], col1[2]); break; default: assert(!"invalid 'type' argument"); hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]); - VECCOPY(col1[0], col1[2]); - VECCOPY(col1[1], col1[2]); - VECCOPY(col1[3], col1[2]); + copy_v3_v3(col1[0], col1[2]); + copy_v3_v3(col1[1], col1[2]); + copy_v3_v3(col1[3], col1[2]); } /* old below */ for(dx=0.0f; dx<1.0f; dx+= 0.05f) { // previous color - VECCOPY(col0[0], col1[0]); - VECCOPY(col0[1], col1[1]); - VECCOPY(col0[2], col1[2]); - VECCOPY(col0[3], col1[3]); + copy_v3_v3(col0[0], col1[0]); + copy_v3_v3(col0[1], col1[1]); + copy_v3_v3(col0[2], col1[2]); + copy_v3_v3(col0[3], col1[3]); // new color switch(type) { @@ -1929,21 +1929,21 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) break; case UI_GRAD_H: hsv_to_rgb(dx, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); - VECCOPY(col1[1], col1[0]); - VECCOPY(col1[2], col1[0]); - VECCOPY(col1[3], col1[0]); + copy_v3_v3(col1[1], col1[0]); + copy_v3_v3(col1[2], col1[0]); + copy_v3_v3(col1[3], col1[0]); break; case UI_GRAD_S: hsv_to_rgb(h, dx, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]); - VECCOPY(col1[0], col1[1]); - VECCOPY(col1[2], col1[1]); - VECCOPY(col1[3], col1[1]); + copy_v3_v3(col1[0], col1[1]); + copy_v3_v3(col1[2], col1[1]); + copy_v3_v3(col1[3], col1[1]); break; case UI_GRAD_V: hsv_to_rgb(h, 1.0, dx, &col1[2][0], &col1[2][1], &col1[2][2]); - VECCOPY(col1[0], col1[2]); - VECCOPY(col1[1], col1[2]); - VECCOPY(col1[3], col1[2]); + copy_v3_v3(col1[0], col1[2]); + copy_v3_v3(col1[1], col1[2]); + copy_v3_v3(col1[3], col1[2]); break; } @@ -2197,7 +2197,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat SWAP(short, wcol->shadetop, wcol->shadedown); - QUATCOPY(wcol->inner, wcol->item); + copy_v4_v4_char(wcol->inner, wcol->item); if(wcol->shadetop>wcol->shadedown) wcol->shadetop+= 20; /* XXX violates themes... */ @@ -2369,9 +2369,9 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s if(!(state & UI_TEXTINPUT)) { /* slider part */ - VECCOPY(outline, wcol->outline); - VECCOPY(wcol->outline, wcol->item); - VECCOPY(wcol->inner, wcol->item); + copy_v3_v3_char(outline, wcol->outline); + copy_v3_v3_char(wcol->outline, wcol->item); + copy_v3_v3_char(wcol->inner, wcol->item); if(!(state & UI_SELECT)) SWAP(short, wcol->shadetop, wcol->shadedown); @@ -2397,7 +2397,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs); widgetbase_draw(&wtb1, wcol); - VECCOPY(wcol->outline, outline); + copy_v3_v3_char(wcol->outline, outline); if(!(state & UI_SELECT)) SWAP(short, wcol->shadetop, wcol->shadedown); @@ -2624,7 +2624,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED( widget_init(&wtb); - VECCOPY(old_col, wcol->inner); + copy_v3_v3_char(old_col, wcol->inner); /* abuse but->hsv - if it's non-zero, use this color as the box's background */ if (but->col[3]) { @@ -2643,7 +2643,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED( /* XXX, this doesnt work right since the color applies to buttons outside the box too. */ glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0); - VECCOPY(wcol->inner, old_col); + copy_v3_v3_char(wcol->inner, old_col); } static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) @@ -3078,6 +3078,10 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct wt= widget_type(UI_WTYPE_SCROLL); break; + case TRACKPREVIEW: + ui_draw_but_TRACKPREVIEW(ar, but, &tui->wcol_regular, rect); + break; + default: wt= widget_type(UI_WTYPE_REGULAR); } diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 921a1879bb7..5f392daeec6 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -153,6 +153,9 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case SPACE_LOGIC: ts= &btheme->tlogic; break; + case SPACE_CLIP: + ts= &btheme->tclip; + break; default: ts= &btheme->tv3d; break; @@ -409,6 +412,27 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case TH_PREVIEW_BACK: cp= ts->preview_back; break; + + case TH_MARKER_OUTLINE: + cp= ts->marker_outline; break; + case TH_MARKER: + cp= ts->marker; break; + case TH_ACT_MARKER: + cp= ts->act_marker; break; + case TH_SEL_MARKER: + cp= ts->sel_marker; break; + case TH_BUNDLE_SOLID: + cp= ts->bundle_solid; break; + case TH_DIS_MARKER: + cp= ts->dis_marker; break; + case TH_PATH_BEFORE: + cp= ts->path_before; break; + case TH_PATH_AFTER: + cp= ts->path_after; break; + case TH_CAMERA_PATH: + cp= ts->camera_path; break; + case TH_LOCK_MARKER: + cp= ts->lock_marker; break; } } } @@ -533,6 +557,7 @@ static void ui_theme_init_new(bTheme *btheme) ui_theme_init_new_do(&btheme->tlogic); ui_theme_init_new_do(&btheme->tuserpref); ui_theme_init_new_do(&btheme->tconsole); + ui_theme_init_new_do(&btheme->tclip); } @@ -639,7 +664,9 @@ void ui_theme_init_default(void) SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255); SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw - + + SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255); + SETCOL(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255); /* space buttons */ /* to have something initialized */ @@ -777,6 +804,23 @@ void ui_theme_init_default(void) /* space logic */ btheme->tlogic= btheme->tv3d; SETCOL(btheme->tlogic.back, 100, 100, 100, 255); + + /* space clip */ + btheme->tclip= btheme->tv3d; + + SETCOL(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255); + SETCOL(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255); + SETCOL(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255); + SETCOL(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255); + SETCOL(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255); + SETCOL(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255); + SETCOL(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255); + SETCOL(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255); + SETCOL(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255); + SETCOL(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255); + SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff); + SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff); + btheme->tclip.handle_vertex_size= 4; } @@ -1590,6 +1634,35 @@ void init_userdef_do_versions(void) } } + { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + if(btheme->tv3d.bundle_solid[3] == 0) + SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255); + + if(btheme->tv3d.camera_path[3] == 0) + SETCOL(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255); + + if((btheme->tclip.back[3]) == 0) { + btheme->tclip= btheme->tv3d; + + SETCOL(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255); + SETCOL(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255); + SETCOL(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255); + SETCOL(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255); + SETCOL(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255); + SETCOL(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255); + SETCOL(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255); + SETCOL(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255); + SETCOL(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255); + SETCOL(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255); + SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff); + SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff); + btheme->tclip.handle_vertex_size= 4; + } + } + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; |