diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 06:51:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 06:51:46 +0400 |
commit | 2f348d8b5d7d897ad44d192a2fd5f2b99b906c76 (patch) | |
tree | 1b2612031fd1cb0e521c2e0e444e7b0bd2b77646 /source/blender/editors/interface | |
parent | d6fd5266d0514e6d31fd0e11aab5322846d78589 (diff) |
style cleanup: mainly for mesh code, also some WM function use.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 32 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 42 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 42 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 34 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 96 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 64 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 28 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 36 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 170 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 40 |
12 files changed, 300 insertions, 300 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4f84b05a16f..229a9dea471 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -137,10 +137,10 @@ void ui_block_to_window_rct(const ARegion *ar, uiBlock *block, rctf *graph, rcti ui_block_to_window_fl(ar, block, &tmpr.xmin, &tmpr.ymin); ui_block_to_window_fl(ar, block, &tmpr.xmax, &tmpr.ymax); - winr->xmin= tmpr.xmin; - winr->ymin= tmpr.ymin; - winr->xmax= tmpr.xmax; - winr->ymax= tmpr.ymax; + winr->xmin = tmpr.xmin; + winr->ymin = tmpr.ymin; + winr->xmax = tmpr.xmax; + winr->ymax = tmpr.ymax; } void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y) /* for mouse cursor */ @@ -295,10 +295,10 @@ void ui_bounds_block(uiBlock *block) if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10; else xof= 40; - block->safety.xmin= block->minx-xof; - block->safety.ymin= block->miny-xof; - block->safety.xmax= block->maxx+xof; - block->safety.ymax= block->maxy+xof; + block->safety.xmin = block->minx-xof; + block->safety.ymin = block->miny-xof; + block->safety.xmax = block->maxx+xof; + block->safety.ymax = block->maxy+xof; } static void ui_centered_bounds_block(const bContext *C, uiBlock *block) @@ -504,10 +504,10 @@ static void ui_draw_linkline(uiLinkLine *line) if(line->from==NULL || line->to==NULL) return; - rect.xmin= (line->from->x1+line->from->x2)/2.0f; - rect.ymin= (line->from->y1+line->from->y2)/2.0f; - rect.xmax= (line->to->x1+line->to->x2)/2.0f; - rect.ymax= (line->to->y1+line->to->y2)/2.0f; + rect.xmin = (line->from->x1+line->from->x2)/2.0f; + rect.ymin = (line->from->y1+line->from->y2)/2.0f; + rect.xmax = (line->to->x1+line->to->x2)/2.0f; + rect.ymax = (line->to->y1+line->to->y2)/2.0f; if(line->flag & UI_SELECT) glColor3ub(100,100,100); @@ -975,14 +975,14 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u gx= (but?but->x1:block->minx) + (block->panel?block->panel->ofsx:0.0f); gy= (but?but->y1:block->miny) + (block->panel?block->panel->ofsy:0.0f); - rect->xmin= floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); - rect->ymin= floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); + rect->xmin = floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); + rect->ymin = floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); gx= (but?but->x2:block->maxx) + (block->panel?block->panel->ofsx:0.0f); gy= (but?but->y2:block->maxy) + (block->panel?block->panel->ofsy:0.0f); - rect->xmax= floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); - rect->ymax= floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); + rect->xmax = floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); + rect->ymax = floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); } diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 39ae2ec37f4..c8fbda8c28a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1303,10 +1303,10 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect /* need scissor test, curve can draw outside of boundary */ glGetIntegerv(GL_VIEWPORT, scissor); - scissor_new.xmin= ar->winrct.xmin + rect->xmin; - scissor_new.ymin= ar->winrct.ymin + rect->ymin; - scissor_new.xmax= ar->winrct.xmin + rect->xmax; - scissor_new.ymax= ar->winrct.ymin + rect->ymax; + scissor_new.xmin = ar->winrct.xmin + rect->xmin; + scissor_new.ymin = ar->winrct.ymin + rect->ymin; + scissor_new.xmax = ar->winrct.xmin + rect->xmax; + scissor_new.ymax = ar->winrct.ymin + rect->ymax; BLI_isect_rcti(&scissor_new, &ar->winrct, &scissor_new); glScissor(scissor_new.xmin, scissor_new.ymin, scissor_new.xmax-scissor_new.xmin, scissor_new.ymax-scissor_new.ymin); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4cd89b2f191..de5f12d597e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -651,12 +651,12 @@ static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event) ui_window_to_block(ar, but->block, &x, &y); - rect.xmin= but->x1; rect.xmax= but->x2; - rect.ymin= but->y1; rect.ymax= but->y2; + rect.xmin = but->x1; rect.xmax = but->x2; + rect.ymin = but->y1; rect.ymax = but->y2; if(but->imb); /* use button size itself */ else if(but->flag & UI_ICON_LEFT) { - rect.xmax= rect.xmin + (rect.ymax-rect.ymin); + rect.xmax = rect.xmin + (rect.ymax-rect.ymin); } else { int delta= (rect.xmax-rect.xmin) - (rect.ymax-rect.ymin); @@ -3295,8 +3295,8 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx float rgb[3]; float hsv[3]; - rect.xmin= but->x1; rect.xmax= but->x2; - rect.ymin= but->y1; rect.ymax= but->y2; + rect.xmin = but->x1; rect.xmax = but->x2; + rect.ymin = but->y1; rect.ymax = but->y2; ui_get_but_vectorf(but, rgb); copy_v3_v3(hsv, ui_block_hsv_get(but->block)); @@ -3801,8 +3801,8 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx int changed= 1; float /* dx, */ dy, yfac=1.f; /* UNUSED */ - /* rect.xmin= but->x1; rect.xmax= but->x2; */ - /* rect.ymin= but->y1; rect.ymax= but->y2; */ + /* rect.xmin = but->x1; rect.xmax = but->x2; */ + /* rect.ymin = but->y1; rect.ymax = but->y2; */ /* dx = mx - data->draglastx; */ /* UNUSED */ dy = my - data->draglasty; @@ -3884,8 +3884,8 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx, int changed= 1; float /* dx, */ dy /* , yfac=1.f */; /* UNUSED */ - /* rect.xmin= but->x1; rect.xmax= but->x2; */ - /* rect.ymin= but->y1; rect.ymax= but->y2; */ + /* rect.xmin = but->x1; rect.xmax = but->x2; */ + /* rect.ymin = but->y1; rect.ymax = but->y2; */ /* dx = mx - data->draglastx; */ /* UNUSED */ dy = my - data->draglasty; @@ -3967,8 +3967,8 @@ static int ui_numedit_but_VECTORSCOPE(uiBut *but, uiHandleButtonData *data, int int changed= 1; /* float dx, dy; */ - /* rect.xmin= but->x1; rect.xmax= but->x2; */ - /* rect.ymin= but->y1; rect.ymax= but->y2; */ + /* rect.xmin = but->x1; rect.xmax = but->x2; */ + /* rect.ymin = but->y1; rect.ymax = but->y2; */ /* dx = mx - data->draglastx; */ /* dy = my - data->draglasty; */ @@ -4507,11 +4507,11 @@ static int ui_but_menu(bContext *C, uiBut *but) IDProperty *prop= (but->opptr)? but->opptr->data: NULL; int w = uiLayoutGetWidth(layout); wmKeyMap *km; - wmKeyMapItem *kmi= NULL; + wmKeyMapItem *kmi = NULL; int kmi_id= WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km); if (kmi_id) - kmi= WM_keymap_item_find_id(km, kmi_id); + kmi = WM_keymap_item_find_id(km, kmi_id); /* keyboard shortcuts */ if ((kmi) && ISKEYBOARD(kmi->type)) { @@ -4882,22 +4882,22 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y) ui_window_to_region(ar, &mx, &my); /* make a copy of the mask rect, and tweak accordingly for hidden scrollbars */ - mask_rct.xmin= v2d->mask.xmin; - mask_rct.xmax= v2d->mask.xmax; - mask_rct.ymin= v2d->mask.ymin; - mask_rct.ymax= v2d->mask.ymax; + mask_rct.xmin = v2d->mask.xmin; + mask_rct.xmax = v2d->mask.xmax; + mask_rct.ymin = v2d->mask.ymin; + mask_rct.ymax = v2d->mask.ymax; if (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE|V2D_SCROLL_VERTICAL_FULLR)) { if (v2d->scroll & V2D_SCROLL_LEFT) - mask_rct.xmin= v2d->vert.xmin; + mask_rct.xmin = v2d->vert.xmin; else if (v2d->scroll & V2D_SCROLL_RIGHT) - mask_rct.xmax= v2d->vert.xmax; + mask_rct.xmax = v2d->vert.xmax; } if (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_HORIZONTAL_FULLR)) { if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) - mask_rct.ymin= v2d->hor.ymin; + mask_rct.ymin = v2d->hor.ymin; else if (v2d->scroll & V2D_SCROLL_TOP) - mask_rct.ymax= v2d->hor.ymax; + mask_rct.ymax = v2d->hor.ymax; } /* check if in the rect */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 723ffb355a2..1c2f2cacf62 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -388,7 +388,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in if(layer_used & (1<<(a+b*colbuts))) icon= ICON_LAYER_USED; else icon= ICON_BLANK1; - but= uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth); + but = uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth); if(subtype == PROP_LAYER_MEMBER) uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+b*colbuts)); } @@ -396,7 +396,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in if(layer_used & (1<<(a+len/2+b*colbuts))) icon= ICON_LAYER_USED; else icon= ICON_BLANK1; - but= uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth); + but = uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth); if(subtype == PROP_LAYER_MEMBER) uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+len/2+b*colbuts)); } @@ -421,7 +421,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in col= a % dim_size[0]; row= a / dim_size[0]; - but= uiDefAutoButR(block, ptr, prop, a, "", ICON_NONE, x + w*col, y+(dim_size[1]*UI_UNIT_Y)-(row*UI_UNIT_Y), w, UI_UNIT_Y); + but = uiDefAutoButR(block, ptr, prop, a, "", ICON_NONE, x + w*col, y+(dim_size[1]*UI_UNIT_Y)-(row*UI_UNIT_Y), w, UI_UNIT_Y); if(slider && but->type==NUM) but->type= NUMSLI; } @@ -460,7 +460,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in for(a=0; a<len; a++) { if(!icon_only) str[0]= RNA_property_array_item_char(prop, a); if(boolarr) icon= boolarr[a] ? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT; - but= uiDefAutoButR(block, ptr, prop, a, str, icon, 0, 0, w, UI_UNIT_Y); + but = uiDefAutoButR(block, ptr, prop, a, str, icon, 0, 0, w, UI_UNIT_Y); if(slider && but->type==NUM) but->type= NUMSLI; if(toggle && but->type==OPTION) @@ -496,11 +496,11 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt itemw= ui_text_icon_width(block->curlayout, name, icon, 0); if(icon && name[0] && !icon_only) - but= uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); else if(icon) - but= uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); else - but= uiDefButR_prop(block, ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefButR_prop(block, ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); if(ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL) but->flag |= UI_TEXT_LEFT; @@ -554,7 +554,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w-UI_UNIT_X, h); /* BUTTONS_OT_file_browse calls uiFileBrowseContextProperty */ - but= uiDefIconButO(block, BUT, subtype==PROP_DIRPATH ? + but = uiDefIconButO(block, BUT, subtype==PROP_DIRPATH ? "BUTTONS_OT_directory_browse" : "BUTTONS_OT_file_browse", WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL); @@ -568,14 +568,14 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n WM_keymap_item_to_string(ptr->data, buf, sizeof(buf)); - but= uiDefButR_prop(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL); uiButSetFunc(but, ui_keymap_but_cb, but, NULL); if (flag & UI_ITEM_R_IMMEDIATE) uiButSetFlag(but, UI_BUT_IMMEDIATE); } } else - but= uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY))? NULL: "", icon, x, y, w, h); + but = uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY))? NULL: "", icon, x, y, w, h); uiBlockSetCurLayout(block, layout); return but; @@ -625,7 +625,7 @@ static void ui_item_disabled(uiLayout *layout, const char *name) w= ui_text_icon_width(layout, name, 0, 0); - but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag |= UI_BUT_DISABLED; but->lock = 1; but->lockstr = ""; @@ -666,7 +666,7 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *nam } } else { - but= uiDefButO_ptr(block, BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL); + but = uiDefButO_ptr(block, BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL); } assert(but->optype != NULL); @@ -1105,7 +1105,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } /* single button */ else { - but= uiDefAutoButR(block, ptr, prop, index, name, icon, 0, 0, w, h); + but = uiDefAutoButR(block, ptr, prop, index, name, icon, 0, 0, w, h); if(slider && but->type==NUM) but->type= NUMSLI; @@ -1463,11 +1463,11 @@ static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCre w -= 10; if(name[0] && icon) - but= uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip); + but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip); else if(icon) - but= uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip); + but = uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip); else - but= uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip); + but = uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip); if(argN) { /* ugly .. */ but->poin= (char*)but; @@ -1486,7 +1486,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const { MenuType *mt; - mt= WM_menutype_find(menuname, FALSE); + mt = WM_menutype_find(menuname, FALSE); if(mt==NULL) { RNA_warning("not found %s", menuname); @@ -1494,7 +1494,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const } if(!name) { - name= IFACE_(mt->label); + name = IFACE_(mt->label); } if(layout->root->type == UI_LAYOUT_MENU && !icon) @@ -1520,11 +1520,11 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon) w= ui_text_icon_width(layout, name, icon, 0); if(icon && name[0]) - but= uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); else if(icon) - but= uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); else - but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); return but; } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index c5abcd46437..ffb8b0acf37 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -441,7 +441,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r Panel *panel= block->panel; rcti hrect; int pnl_icons; - const char *activename= IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname); + const char *activename = IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname); /* + 0.001f to avoid flirting with float inaccuracy */ if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f; @@ -453,7 +453,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r hrect= *rect; if(dir == 'h') { - hrect.xmin= rect->xmin+pnl_icons; + hrect.xmin = rect->xmin+pnl_icons; hrect.ymin += 2.0f/block->aspect; uiStyleFontDraw(&style->paneltitle, &hrect, activename); } @@ -461,7 +461,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r /* ignore 'pnl_icons', otherwise the text gets offset horizontally * + 0.001f to avoid flirting with float inaccuracy */ - hrect.xmin= rect->xmin + (PNL_ICON+5)/block->aspect + 0.001f; + hrect.xmin = rect->xmin + (PNL_ICON+5)/block->aspect + 0.001f; uiStyleFontDrawRotated(&style->paneltitle, &hrect, activename); } } @@ -473,10 +473,10 @@ static void rectf_scale(rctf *rect, float scale) float sizex= 0.5f*scale*(rect->xmax - rect->xmin); float sizey= 0.5f*scale*(rect->ymax - rect->ymin); - rect->xmin= centx - sizex; - rect->xmax= centx + sizex; - rect->ymin= centy - sizey; - rect->ymax= centy + sizey; + rect->xmin = centx - sizex; + rect->xmax = centx + sizex; + rect->ymin = centy - sizey; + rect->ymax = centy + sizey; } /* panel integrated in buttonswindow, tool/property lists etc */ @@ -494,8 +494,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) /* calculate header rect */ /* + 0.001f to prevent flicker due to float inaccuracy */ headrect= *rect; - headrect.ymin= headrect.ymax; - headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f); + headrect.ymin = headrect.ymax; + headrect.ymax = headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f); { float minx= rect->xmin; @@ -533,10 +533,10 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) ui_draw_aligned_panel_header(style, block, &headrect, 'h'); /* itemrect smaller */ - itemrect.xmax= headrect.xmax - 5.0f/block->aspect; - itemrect.xmin= itemrect.xmax - (headrect.ymax-headrect.ymin); - itemrect.ymin= headrect.ymin; - itemrect.ymax= headrect.ymax; + itemrect.xmax = headrect.xmax - 5.0f/block->aspect; + itemrect.xmin = itemrect.xmax - (headrect.ymax-headrect.ymin); + itemrect.ymin = headrect.ymin; + itemrect.ymax = headrect.ymax; rectf_scale(&itemrect, 0.7f); ui_draw_panel_dragwidget(&itemrect); @@ -582,10 +582,10 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) UI_ThemeColor(TH_TEXT); /* itemrect smaller */ - itemrect.xmin= headrect.xmin + 5.0f/block->aspect; - itemrect.xmax= itemrect.xmin + (headrect.ymax-headrect.ymin); - itemrect.ymin= headrect.ymin; - itemrect.ymax= headrect.ymax; + itemrect.xmin = headrect.xmin + 5.0f/block->aspect; + itemrect.xmax = itemrect.xmin + (headrect.ymax-headrect.ymin); + itemrect.ymin = headrect.ymin; + itemrect.ymax = headrect.ymax; rectf_scale(&itemrect, 0.35f); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 9b60915898d..b375b8d154f 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -386,8 +386,8 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) /* draw text */ uiStyleFontSet(&data->fstyle); - bbox.ymax= bbox.ymax - 0.5f*((bbox.ymax - bbox.ymin) - data->toth); - bbox.ymin= bbox.ymax - data->lineh; + bbox.ymax = bbox.ymax - 0.5f*((bbox.ymax - bbox.ymin) - data->toth); + bbox.ymin = bbox.ymax - data->lineh; for (i = 0; i < data->totline; i++) { glColor3fv(tip_colors[data->color_id[i]]); @@ -656,16 +656,16 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) } /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM; + data->bbox.xmin = MENU_SHADOW_SIDE; + data->bbox.xmax = x2-x1 + MENU_SHADOW_SIDE; + data->bbox.ymin = MENU_SHADOW_BOTTOM; + data->bbox.ymax = y2-y1 + MENU_SHADOW_BOTTOM; /* region bigger for shadow */ - ar->winrct.xmin= x1 - MENU_SHADOW_SIDE; - ar->winrct.xmax= x2 + MENU_SHADOW_SIDE; - ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= y2 + MENU_TOP; + ar->winrct.xmin = x1 - MENU_SHADOW_SIDE; + ar->winrct.xmax = x2 + MENU_SHADOW_SIDE; + ar->winrct.ymin = y1 - MENU_SHADOW_BOTTOM; + ar->winrct.ymax = y2 + MENU_TOP; /* adds subwindow */ ED_region_init(C, ar); @@ -812,11 +812,11 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr) int buth= (data->bbox.ymax-data->bbox.ymin - 2*MENU_TOP)/SEARCH_ITEMS; *rect= data->bbox; - rect->xmin= data->bbox.xmin + 3.0f; - rect->xmax= data->bbox.xmax - 3.0f; + rect->xmin = data->bbox.xmin + 3.0f; + rect->xmax = data->bbox.xmax - 3.0f; - rect->ymax= data->bbox.ymax - MENU_TOP - itemnr*buth; - rect->ymin= rect->ymax - buth; + rect->ymax = data->bbox.ymax - MENU_TOP - itemnr*buth; + rect->ymin = rect->ymax - buth; } } @@ -1099,10 +1099,10 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) ar->winrct= butregion->winrct; /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= (ar->winrct.xmax-ar->winrct.xmin) - MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM; + data->bbox.xmin = MENU_SHADOW_SIDE; + data->bbox.xmax = (ar->winrct.xmax-ar->winrct.xmin) - MENU_SHADOW_SIDE; + data->bbox.ymin = MENU_SHADOW_BOTTOM; + data->bbox.ymax = (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM; /* check if button is lower half */ if( but->y2 < (but->block->miny+but->block->maxy)/2 ) { @@ -1166,16 +1166,16 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) } /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM; + data->bbox.xmin = MENU_SHADOW_SIDE; + data->bbox.xmax = x2-x1 + MENU_SHADOW_SIDE; + data->bbox.ymin = MENU_SHADOW_BOTTOM; + data->bbox.ymax = y2-y1 + MENU_SHADOW_BOTTOM; /* region bigger for shadow */ - ar->winrct.xmin= x1 - MENU_SHADOW_SIDE; - ar->winrct.xmax= x2 + MENU_SHADOW_SIDE; - ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= y2; + ar->winrct.xmin = x1 - MENU_SHADOW_SIDE; + ar->winrct.xmax = x2 + MENU_SHADOW_SIDE; + ar->winrct.ymin = y1 - MENU_SHADOW_BOTTOM; + ar->winrct.ymax = y2; } /* adds subwindow */ @@ -1262,8 +1262,8 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, short dir1= 0, dir2=0; /* transform to window coordinates, using the source button region/block */ - butrct.xmin= but->x1; butrct.xmax= but->x2; - butrct.ymin= but->y1; butrct.ymax= but->y2; + butrct.xmin = but->x1; butrct.xmax = but->x2; + butrct.ymin = but->y1; butrct.ymax = but->y2; ui_block_to_window_fl(butregion, but->block, &butrct.xmin, &butrct.ymin); ui_block_to_window_fl(butregion, but->block, &butrct.xmax, &butrct.ymax); @@ -1443,31 +1443,31 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, /* when you are outside parent button, safety there should be smaller */ // parent button to left - if( midx < block->minx ) block->safety.xmin= block->minx-3; - else block->safety.xmin= block->minx-40; + if( midx < block->minx ) block->safety.xmin = block->minx-3; + else block->safety.xmin = block->minx-40; // parent button to right - if( midx > block->maxx ) block->safety.xmax= block->maxx+3; - else block->safety.xmax= block->maxx+40; + if( midx > block->maxx ) block->safety.xmax = block->maxx+3; + else block->safety.xmax = block->maxx+40; // parent button on bottom - if( midy < block->miny ) block->safety.ymin= block->miny-3; - else block->safety.ymin= block->miny-40; + if( midy < block->miny ) block->safety.ymin = block->miny-3; + else block->safety.ymin = block->miny-40; // parent button on top - if( midy > block->maxy ) block->safety.ymax= block->maxy+3; - else block->safety.ymax= block->maxy+40; + if( midy > block->maxy ) block->safety.ymax = block->maxy+3; + else block->safety.ymax = block->maxy+40; // exception for switched pulldowns... if(dir1 && (dir1 & block->direction)==0) { - if(dir2==UI_RIGHT) block->safety.xmax= block->maxx+3; - if(dir2==UI_LEFT) block->safety.xmin= block->minx-3; + if(dir2==UI_RIGHT) block->safety.xmax = block->maxx+3; + if(dir2==UI_LEFT) block->safety.xmin = block->minx-3; } block->direction= dir1; } else { - block->safety.xmin= block->minx-40; - block->safety.ymin= block->miny-40; - block->safety.xmax= block->maxx+40; - block->safety.ymax= block->maxy+40; + block->safety.xmin = block->minx-40; + block->safety.ymin = block->miny-40; + block->safety.xmax = block->maxx+40; + block->safety.ymax = block->maxy+40; } /* keep a list of these, needed for pulldown menus */ @@ -1615,10 +1615,10 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut /* the block and buttons were positioned in window space as in 2.4x, now * these menu blocks are regions so we bring it back to region space. * additionally we add some padding for the menu shadow or rounded menus */ - ar->winrct.xmin= block->minx - MENU_SHADOW_SIDE; - ar->winrct.xmax= block->maxx + MENU_SHADOW_SIDE; - ar->winrct.ymin= block->miny - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= block->maxy + MENU_TOP; + ar->winrct.xmin = block->minx - MENU_SHADOW_SIDE; + ar->winrct.xmax = block->maxx + MENU_SHADOW_SIDE; + ar->winrct.ymin = block->miny - MENU_SHADOW_BOTTOM; + ar->winrct.ymax = block->maxy + MENU_TOP; block->minx -= ar->winrct.xmin; block->maxx -= ar->winrct.xmin; @@ -2457,7 +2457,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) uiDefIconTextBut(pup->block, LABEL, 0, icon, titlestr, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); } else { - but= uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag= UI_TEXT_LEFT; } } @@ -2629,7 +2629,7 @@ void uiPupMenuInvoke(bContext *C, const char *idname) uiPopupMenu *pup; uiLayout *layout; Menu menu; - MenuType *mt= WM_menutype_find(idname, TRUE); + MenuType *mt = WM_menutype_find(idname, TRUE); if(mt==NULL) { printf("%s: named menu \"%s\" not found\n", __func__, idname); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 65e2b98f4b9..580b0ff05dc 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -219,10 +219,10 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str) angle= 90.0f; /* translate rect to vertical */ - txtrect.xmin= rect->xmin - (rect->ymax - rect->ymin); - txtrect.ymin= rect->ymin - (rect->xmax - rect->xmin); - txtrect.xmax= rect->xmin; - txtrect.ymax= rect->ymin; + txtrect.xmin = rect->xmin - (rect->ymax - rect->ymin); + txtrect.ymin = rect->ymin - (rect->xmax - rect->xmin); + txtrect.xmax = rect->xmin; + txtrect.ymax = rect->ymin; /* clip is very strict, so we give it some space */ /* clipping is done without rotation, so make rect big enough to contain both positions */ diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 2b225fb56c2..ca6b37f9013 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -182,7 +182,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, ""); uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); } /* list view */ @@ -190,7 +190,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); } @@ -360,7 +360,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str if(flag & UI_ID_PREVIEWS) { - but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, + but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, TIP_(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); @@ -374,7 +374,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str template->preview= 1; } else if(flag & UI_ID_BROWSE) { - but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, + but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, TIP_(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); @@ -394,18 +394,18 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str //text_idbutton(id, name); name[0]= '\0'; - but= uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL); + but = uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME)); if(user_alert) uiButSetFlag(but, UI_BUT_REDALERT); if(id->lib) { if(id->flag & LIB_INDIRECT) { - but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Indirect library datablock, cannot change")); uiButSetFlag(but, UI_BUT_DISABLED); } else { - but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Direct linked library datablock, click to make local")); if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib)) uiButSetFlag(but, UI_BUT_DISABLED); @@ -419,7 +419,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str BLI_snprintf(numstr, sizeof(numstr), "%d", id->us); - but= uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Display number of users of this data (click to make a single-user copy)")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); @@ -438,11 +438,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6; if(newop) { - but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL); + but = uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but = uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } @@ -454,11 +454,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6; if(openop) { - but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL); + but = uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but = uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } @@ -469,12 +469,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str /* delete button */ if(id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK)==0) { if(unlinkop) { - but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); + but = uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); /* so we can access the template from operators, font unlinking needs this */ uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL); } else { - but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); @@ -787,7 +787,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, /* place holder button */ uiBlockSetEmboss(block, UI_EMBOSSN); - but= uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL); + but = uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL); uiButSetFlag(but, UI_BUT_DISABLED); uiBlockSetEmboss(block, UI_EMBOSS); } @@ -1431,8 +1431,8 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); colorband_buttons_layout(layout, block, cptr.data, &rect, !expand, cb); @@ -1463,8 +1463,8 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); //colorband_buttons_layout(layout, block, cptr.data, &rect, !expand, cb); @@ -1503,8 +1503,8 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname) cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); @@ -1540,8 +1540,8 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); @@ -1937,7 +1937,7 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam col = uiLayoutColumn(layout, 0); row= uiLayoutRow(col, 1); - but= uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, ""); + but = uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, ""); if(lock) { but->flag |= UI_BUT_COLOR_LOCK; @@ -2046,7 +2046,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname, else if(used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer)) icon = ICON_LAYER_USED; - but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2); + but = uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2); uiButSetFunc(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer)); but->type= TOG; } @@ -2108,7 +2108,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe /* list item behind label & other buttons */ sub= uiLayoutRow(overlap, 0); - but= uiDefButR_prop(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); + but = uiDefButR_prop(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); uiButSetFlag(but, UI_BUT_NO_TOOLTIP); sub= uiLayoutRow(overlap, 0); @@ -2366,7 +2366,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * row= uiLayoutRow(col, 0); icon= list_item_icon_get(C, &itemptr, rnaicon, 1); - but= uiDefIconButR_prop(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); + but = uiDefIconButR_prop(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); uiButSetFlag(but, UI_BUT_NO_TOOLTIP); @@ -2407,7 +2407,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * /* next/prev button */ BLI_snprintf(numstr, sizeof(numstr), "%d :", i); - but= uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); + but = uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); if(i == 0) uiButSetFlag(but, UI_BUT_DISABLED); } @@ -2519,7 +2519,7 @@ void uiTemplateOperatorSearch(uiLayout *layout) block= uiLayoutGetBlock(layout); uiBlockSetCurLayout(block, layout); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); } @@ -2644,12 +2644,12 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) /* make a box around the report to make it stand out */ uiBlockBeginAlign(block); - but= uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); + but = uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); /* set the report's bg color in but->col - ROUNDBOX feature */ rgb_float_to_uchar(but->col, rti->col); but->col[3]= 255; - but= uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); + but = uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); but->col[0]= but->col[1]= but->col[2]= FTOCHAR(rti->greyscale); but->col[3]= 255; @@ -2683,7 +2683,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused)) { - wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p; + wmKeyMapItem *kmi = (wmKeyMapItem*)kmi_p; WM_keyconfig_update_tag(NULL, kmi); } diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 610e9f8762d..6692bd7bea8 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -64,11 +64,11 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind return NULL; if(icon && name && name[0] == '\0') - but= uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else if(icon) - but= uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } case PROP_INT: @@ -78,29 +78,29 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind if(arraylen && index == -1) { if(ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) - but= uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL); } else if(RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR) - but= uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } case PROP_ENUM: if(icon && name && name[0] == '\0') - but= uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else if(icon) - but= uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; case PROP_STRING: if(icon && name && name[0] == '\0') - but= uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else if(icon) - but= uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; case PROP_POINTER: { PointerRNA pptr; @@ -112,13 +112,13 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind if(icon == ICON_DOT) icon= 0; - but= uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } case PROP_COLLECTION: { char text[256]; BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop)); - but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); + but = uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); uiButSetFlag(but, UI_BUT_DISABLED); break; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a8df7ec7d35..32cb3f94ee7 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2347,35 +2347,35 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat if(horizontal) { fac= (rect->xmax - rect->xmin)/(size); - rect1.xmin= rect1.xmin + ceilf(fac*((float)value - but->softmin)); - rect1.xmax= rect1.xmin + ceilf(fac*(but->a1 - but->softmin)); + rect1.xmin = rect1.xmin + ceilf(fac*((float)value - but->softmin)); + rect1.xmax = rect1.xmin + ceilf(fac*(but->a1 - but->softmin)); /* ensure minimium size */ min= rect->ymax - rect->ymin; if(rect1.xmax - rect1.xmin < min) { - rect1.xmax= rect1.xmin + min; + rect1.xmax = rect1.xmin + min; if(rect1.xmax > rect->xmax) { - rect1.xmax= rect->xmax; - rect1.xmin= MAX2(rect1.xmax - min, rect->xmin); + rect1.xmax = rect->xmax; + rect1.xmin = MAX2(rect1.xmax - min, rect->xmin); } } } else { fac= (rect->ymax - rect->ymin)/(size); - rect1.ymax= rect1.ymax - ceilf(fac*((float)value - but->softmin)); - rect1.ymin= rect1.ymax - ceilf(fac*(but->a1 - but->softmin)); + rect1.ymax = rect1.ymax - ceilf(fac*((float)value - but->softmin)); + rect1.ymin = rect1.ymax - ceilf(fac*(but->a1 - but->softmin)); /* ensure minimium size */ min= rect->xmax - rect->xmin; if(rect1.ymax - rect1.ymin < min) { - rect1.ymax= rect1.ymin + min; + rect1.ymax = rect1.ymin + min; if(rect1.ymax > rect->ymax) { - rect1.ymax= rect->ymax; - rect1.ymin= MAX2(rect1.ymax - min, rect->ymin); + rect1.ymax = rect->ymax; + rect1.ymin = MAX2(rect1.ymax - min, rect->ymin); } } } @@ -2421,10 +2421,10 @@ static void widget_link(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect, in UI_ThemeColor(TH_TEXT_HI); - rectlink.xmin= (rect->xmin+rect->xmax)/2; - rectlink.ymin= (rect->ymin+rect->ymax)/2; - rectlink.xmax= but->linkto[0]; - rectlink.ymax= but->linkto[1]; + rectlink.xmin = (rect->xmin+rect->xmax)/2; + rectlink.ymin = (rect->ymin+rect->ymax)/2; + rectlink.xmax = but->linkto[0]; + rectlink.ymax = but->linkto[1]; ui_draw_link_bezier(&rectlink); } @@ -2468,13 +2468,13 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin); /* left part of slider, always rounded */ - rect1.xmax= rect1.xmin + ceil(offs+1.0f); + rect1.xmax = rect1.xmin + ceil(offs+1.0f); round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT), &rect1, offs); wtb1.outline= 0; widgetbase_draw(&wtb1, wcol); /* right part of slider, interpolate roundness */ - rect1.xmax= rect1.xmin + fac + offs; + rect1.xmax = rect1.xmin + fac + offs; rect1.xmin+= floor(offs-1.0f); if(rect1.xmax + offs > rect->xmax) offs*= (rect1.xmax + offs - rect->xmax)/offs; @@ -2687,7 +2687,7 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UN widget_init(&wtb); /* square */ - recttemp.xmax= recttemp.xmin + (recttemp.ymax-recttemp.ymin); + recttemp.xmax = recttemp.xmin + (recttemp.ymax-recttemp.ymin); /* smaller */ delta= 1 + (recttemp.ymax-recttemp.ymin)/8; @@ -3313,7 +3313,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic /* part text right aligned */ if(cpoin) { fstyle->align= UI_STYLE_TEXT_RIGHT; - rect->xmax= _rect.xmax - 5; + rect->xmax = _rect.xmax - 5; uiStyleFontDraw(fstyle, rect, cpoin+1); *cpoin= '|'; } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 142584f62fd..8c67502978a 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -86,9 +86,9 @@ static void view2d_masks(View2D *v2d) int scroll; /* mask - view frame */ - v2d->mask.xmin= v2d->mask.ymin= 0; - v2d->mask.xmax= v2d->winx - 1; /* -1 yes! masks are pixels */ - v2d->mask.ymax= v2d->winy - 1; + v2d->mask.xmin = v2d->mask.ymin = 0; + v2d->mask.xmax = v2d->winx - 1; /* -1 yes! masks are pixels */ + v2d->mask.ymax = v2d->winy - 1; #if 0 // XXX see above @@ -114,29 +114,29 @@ static void view2d_masks(View2D *v2d) if (scroll & V2D_SCROLL_LEFT) { /* on left-hand edge of region */ v2d->vert= v2d->mask; - v2d->vert.xmax= V2D_SCROLL_WIDTH; - v2d->mask.xmin= v2d->vert.xmax + 1; + v2d->vert.xmax = V2D_SCROLL_WIDTH; + v2d->mask.xmin = v2d->vert.xmax + 1; } else if (scroll & V2D_SCROLL_RIGHT) { /* on right-hand edge of region */ v2d->vert= v2d->mask; v2d->vert.xmax++; /* one pixel extra... was leaving a minor gap... */ - v2d->vert.xmin= v2d->vert.xmax - V2D_SCROLL_WIDTH; - v2d->mask.xmax= v2d->vert.xmin - 1; + v2d->vert.xmin = v2d->vert.xmax - V2D_SCROLL_WIDTH; + v2d->mask.xmax = v2d->vert.xmin - 1; } /* horizontal scroller */ if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) { /* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */ v2d->hor= v2d->mask; - v2d->hor.ymax= V2D_SCROLL_HEIGHT; - v2d->mask.ymin= v2d->hor.ymax + 1; + v2d->hor.ymax = V2D_SCROLL_HEIGHT; + v2d->mask.ymin = v2d->hor.ymax + 1; } else if (scroll & V2D_SCROLL_TOP) { /* on upper edge of region */ v2d->hor= v2d->mask; - v2d->hor.ymin= v2d->hor.ymax - V2D_SCROLL_HEIGHT; - v2d->mask.ymax= v2d->hor.ymin - 1; + v2d->hor.ymin = v2d->hor.ymax - V2D_SCROLL_HEIGHT; + v2d->mask.ymax = v2d->hor.ymin - 1; } /* adjust vertical scroller if there's a horizontal scroller, to leave corner free */ @@ -144,11 +144,11 @@ static void view2d_masks(View2D *v2d) /* just set y min/max for vertical scroller to y min/max of mask as appropriate */ if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) { /* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */ - v2d->vert.ymin= v2d->mask.ymin; + v2d->vert.ymin = v2d->mask.ymin; } else if (scroll & V2D_SCROLL_TOP) { /* on upper edge of region */ - v2d->vert.ymax= v2d->mask.ymax; + v2d->vert.ymax = v2d->mask.ymax; } } } @@ -196,9 +196,9 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y); v2d->keeptot= V2D_KEEPTOT_BOUNDS; - v2d->tot.xmin= v2d->tot.ymin= 0.0f; - v2d->tot.xmax= (float)(winx - 1); - v2d->tot.ymax= (float)(winy - 1); + v2d->tot.xmin = v2d->tot.ymin = 0.0f; + v2d->tot.xmax = (float)(winx - 1); + v2d->tot.ymax = (float)(winy - 1); v2d->cur= v2d->tot; @@ -281,18 +281,18 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->scroll |= V2D_SCROLL_HORIZONTAL_HIDE; v2d->scroll &= ~V2D_SCROLL_VERTICAL_HIDE; - v2d->tot.xmin= 0.0f; - v2d->tot.xmax= winx; + v2d->tot.xmin = 0.0f; + v2d->tot.xmax = winx; - v2d->tot.ymax= 0.0f; - v2d->tot.ymin= -winy; + v2d->tot.ymax = 0.0f; + v2d->tot.ymin = -winy; - v2d->cur.xmin= 0.0f; + v2d->cur.xmin = 0.0f; /* bad workaround for keeping zoom level with scrollers */ - v2d->cur.xmax= (winx - V2D_SCROLL_WIDTH)*panelzoom; + v2d->cur.xmax = (winx - V2D_SCROLL_WIDTH)*panelzoom; - v2d->cur.ymax= 0.0f; - v2d->cur.ymin= (-winy)*panelzoom; + v2d->cur.ymax = 0.0f; + v2d->cur.ymin = (-winy)*panelzoom; } break; @@ -546,8 +546,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* width */ if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_X|V2D_LIMITZOOM)) ) { /* if zoom doesn't have to be maintained, just clamp edges */ - if (cur->xmin < tot->xmin) cur->xmin= tot->xmin; - if (cur->xmax > tot->xmax) cur->xmax= tot->xmax; + if (cur->xmin < tot->xmin) cur->xmin = tot->xmin; + if (cur->xmax > tot->xmax) cur->xmax = tot->xmax; } else if (v2d->keeptot == V2D_KEEPTOT_STRICT) { /* This is an exception for the outliner (and later channel-lists, headers) @@ -595,8 +595,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) temp= (tot->xmax + tot->xmin) * 0.5f; diff= curheight * 0.5f; - cur->xmin= temp - diff; - cur->xmax= temp + diff; + cur->xmin = temp - diff; + cur->xmax = temp + diff; } else if (cur->xmin < tot->xmin) { /* move cur across so that it sits at minimum of tot */ @@ -629,8 +629,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* height */ if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_Y|V2D_LIMITZOOM)) ) { /* if zoom doesn't have to be maintained, just clamp edges */ - if (cur->ymin < tot->ymin) cur->ymin= tot->ymin; - if (cur->ymax > tot->ymax) cur->ymax= tot->ymax; + if (cur->ymin < tot->ymin) cur->ymin = tot->ymin; + if (cur->ymax > tot->ymax) cur->ymax = tot->ymax; } else { /* This here occurs when: @@ -645,8 +645,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) temp= (tot->ymax + tot->ymin) * 0.5f; diff= curheight * 0.5f; - cur->ymin= temp - diff; - cur->ymax= temp + diff; + cur->ymin = temp - diff; + cur->ymax = temp + diff; } else if (cur->ymin < tot->ymin) { /* there's still space remaining, so shift up */ @@ -680,7 +680,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* width is in negative-x half */ if (v2d->cur.xmax > 0) { v2d->cur.xmin -= v2d->cur.xmax; - v2d->cur.xmax= 0.0f; + v2d->cur.xmax = 0.0f; } } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { @@ -738,13 +738,13 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) if (ar->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) { if (flag == V2D_LOCK_COPY) { /* other views with locks on must copy active */ - ar->v2d.cur.ymin= v2dcur->cur.ymin; - ar->v2d.cur.ymax= v2dcur->cur.ymax; + ar->v2d.cur.ymin = v2dcur->cur.ymin; + ar->v2d.cur.ymax = v2dcur->cur.ymax; } else { /* V2D_LOCK_SET */ /* active must copy others */ - v2dcur->cur.ymin= ar->v2d.cur.ymin; - v2dcur->cur.ymax= ar->v2d.cur.ymax; + v2dcur->cur.ymin = ar->v2d.cur.ymin; + v2dcur->cur.ymax = ar->v2d.cur.ymax; } /* region possibly changed, so refresh */ @@ -764,13 +764,13 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) if (ar->v2d.flag & V2D_VIEWSYNC_SCREEN_TIME) { if (flag == V2D_LOCK_COPY) { /* other views with locks on must copy active */ - ar->v2d.cur.xmin= v2dcur->cur.xmin; - ar->v2d.cur.xmax= v2dcur->cur.xmax; + ar->v2d.cur.xmin = v2dcur->cur.xmin; + ar->v2d.cur.xmax = v2dcur->cur.xmax; } else { /* V2D_LOCK_SET */ /* active must copy others */ - v2dcur->cur.xmin= ar->v2d.cur.xmin; - v2dcur->cur.xmax= ar->v2d.cur.xmax; + v2dcur->cur.xmin = ar->v2d.cur.xmin; + v2dcur->cur.xmax = ar->v2d.cur.xmax; } /* region possibly changed, so refresh */ @@ -797,39 +797,39 @@ void UI_view2d_curRect_reset (View2D *v2d) /* handle width - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { /* width is in negative-x half */ - v2d->cur.xmin= (float)-width; - v2d->cur.xmax= 0.0f; + v2d->cur.xmin = (float)-width; + v2d->cur.xmax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { /* width is in positive-x half */ - v2d->cur.xmin= 0.0f; - v2d->cur.xmax= (float)width; + v2d->cur.xmin = 0.0f; + v2d->cur.xmax = (float)width; } else { /* width is centered around x==0 */ const float dx= (float)width / 2.0f; - v2d->cur.xmin= -dx; - v2d->cur.xmax= dx; + v2d->cur.xmin = -dx; + v2d->cur.xmax = dx; } /* handle height - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { /* height is in negative-y half */ - v2d->cur.ymin= (float)-height; - v2d->cur.ymax= 0.0f; + v2d->cur.ymin = (float)-height; + v2d->cur.ymax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { /* height is in positive-y half */ - v2d->cur.ymin= 0.0f; - v2d->cur.ymax= (float)height; + v2d->cur.ymin = 0.0f; + v2d->cur.ymax = (float)height; } else { /* height is centered around y==0 */ const float dy= (float)height / 2.0f; - v2d->cur.ymin= -dy; - v2d->cur.ymax= dy; + v2d->cur.ymin = -dy; + v2d->cur.ymax = dy; } } @@ -860,39 +860,39 @@ void UI_view2d_totRect_set_resize (View2D *v2d, int width, int height, int resiz /* handle width - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { /* width is in negative-x half */ - v2d->tot.xmin= (float)-width; - v2d->tot.xmax= 0.0f; + v2d->tot.xmin = (float)-width; + v2d->tot.xmax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { /* width is in positive-x half */ - v2d->tot.xmin= 0.0f; - v2d->tot.xmax= (float)width; + v2d->tot.xmin = 0.0f; + v2d->tot.xmax = (float)width; } else { /* width is centered around x==0 */ const float dx= (float)width / 2.0f; - v2d->tot.xmin= -dx; - v2d->tot.xmax= dx; + v2d->tot.xmin = -dx; + v2d->tot.xmax = dx; } /* handle height - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { /* height is in negative-y half */ - v2d->tot.ymin= (float)-height; - v2d->tot.ymax= 0.0f; + v2d->tot.ymin = (float)-height; + v2d->tot.ymax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { /* height is in positive-y half */ - v2d->tot.ymin= 0.0f; - v2d->tot.ymax= (float)height; + v2d->tot.ymin = 0.0f; + v2d->tot.ymax = (float)height; } else { /* height is centered around y==0 */ const float dy= (float)height / 2.0f; - v2d->tot.ymin= -dy; - v2d->tot.ymax= dy; + v2d->tot.ymin = -dy; + v2d->tot.ymax = dy; } /* make sure that 'cur' rect is in a valid state as a result of these changes */ @@ -918,10 +918,10 @@ int UI_view2d_tab_set(View2D *v2d, int tab) offset= default_offset; v2d->cur.xmax += offset[0] - v2d->cur.xmin; - v2d->cur.xmin= offset[0]; + v2d->cur.xmin = offset[0]; v2d->cur.ymin += offset[1] - v2d->cur.ymax; - v2d->cur.ymax= offset[1]; + v2d->cur.ymax = offset[1]; /* validation should happen in subsequent totRect_set */ @@ -996,12 +996,12 @@ void UI_view2d_view_ortho(View2D *v2d) /* XXX ton: this flag set by outliner, for icons */ if(v2d->flag & V2D_PIXELOFS_X) { - curmasked.xmin= floorf(curmasked.xmin) - 0.001f; - curmasked.xmax= floorf(curmasked.xmax) - 0.001f; + curmasked.xmin = floorf(curmasked.xmin) - 0.001f; + curmasked.xmax = floorf(curmasked.xmax) - 0.001f; } if(v2d->flag & V2D_PIXELOFS_Y) { - curmasked.ymin= floorf(curmasked.ymin) - 0.001f; - curmasked.ymax= floorf(curmasked.ymax) - 0.001f; + curmasked.ymin = floorf(curmasked.ymin) - 0.001f; + curmasked.ymax = floorf(curmasked.ymax) - 0.001f; } /* set matrix on all appropriate axes */ @@ -1565,10 +1565,10 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v rcti slider; int state; - slider.xmin= vs->hor_min; - slider.xmax= vs->hor_max; - slider.ymin= hor.ymin; - slider.ymax= hor.ymax; + slider.xmin = vs->hor_min; + slider.xmax = vs->hor_max; + slider.ymin = hor.ymin; + slider.ymax = hor.ymax; state= (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SCROLL_PRESSED:0; @@ -1676,10 +1676,10 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v rcti slider; int state; - slider.xmin= vert.xmin; - slider.xmax= vert.xmax; - slider.ymin= vs->vert_min; - slider.ymax= vs->vert_max; + slider.xmin = vert.xmin; + slider.xmax = vert.xmax; + slider.ymin = vs->vert_min; + slider.ymax = vs->vert_max; state= (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SCROLL_PRESSED:0; @@ -1779,14 +1779,14 @@ void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowhe if ELEM(NULL, v2d, rect) return; if ((columnwidth <= 0) && (rowheight <= 0)) { - rect->xmin= rect->xmax= 0.0f; - rect->ymin= rect->ymax= 0.0f; + rect->xmin = rect->xmax = 0.0f; + rect->ymin = rect->ymax = 0.0f; return; } /* x-coordinates */ - rect->xmin= startx + (float)(columnwidth * column); - rect->xmax= startx + (float)(columnwidth * (column + 1)); + rect->xmin = startx + (float)(columnwidth * column); + rect->xmax = startx + (float)(columnwidth * (column + 1)); if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { /* simply negate the values for the coordinates if in negative half */ @@ -1795,8 +1795,8 @@ void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowhe } /* y-coordinates */ - rect->ymin= starty + (float)(rowheight * row); - rect->ymax= starty + (float)(rowheight * (row + 1)); + rect->ymin = starty + (float)(rowheight * row); + rect->ymax = starty + (float)(rowheight * (row + 1)); if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { /* simply negate the values for the coordinates if in negative half */ diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 16613d3acee..29850c91480 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1116,12 +1116,12 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) * if zoom is allowed to be changed */ if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) { - v2d->cur.xmin= rect.xmin; - v2d->cur.xmax= rect.xmax; + v2d->cur.xmin = rect.xmin; + v2d->cur.xmax = rect.xmax; } if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) { - v2d->cur.ymin= rect.ymin; - v2d->cur.ymax= rect.ymax; + v2d->cur.ymin = rect.ymin; + v2d->cur.ymax = rect.ymax; } } else /* if (gesture_mode == GESTURE_MODAL_OUT) */ { @@ -1138,16 +1138,16 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) zoom= size / (rect.xmax - rect.xmin); center= (v2d->cur.xmax + v2d->cur.xmin) * 0.5f; - v2d->cur.xmin= center - (size * zoom); - v2d->cur.xmax= center + (size * zoom); + v2d->cur.xmin = center - (size * zoom); + v2d->cur.xmax = center + (size * zoom); } if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) { size= (v2d->cur.ymax - v2d->cur.ymin); zoom= size / (rect.ymax - rect.ymin); center= (v2d->cur.ymax + v2d->cur.ymin) * 0.5f; - v2d->cur.ymin= center - (size * zoom); - v2d->cur.ymax= center + (size * zoom); + v2d->cur.ymin = center - (size * zoom); + v2d->cur.ymax = center + (size * zoom); } } @@ -1616,29 +1616,29 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op)) winx= (float)(v2d->mask.xmax - v2d->mask.xmin + 1); winy= (float)(v2d->mask.ymax - v2d->mask.ymin + 1); - v2d->cur.xmax= v2d->cur.xmin + winx; - v2d->cur.ymax= v2d->cur.ymin + winy; + v2d->cur.xmax = v2d->cur.xmin + winx; + v2d->cur.ymax = v2d->cur.ymin + winy; /* align */ if (v2d->align) { /* posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { - v2d->cur.xmax= 0.0f; - v2d->cur.xmin= -winx*style->panelzoom; + v2d->cur.xmax = 0.0f; + v2d->cur.xmin = -winx*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { - v2d->cur.xmax= winx*style->panelzoom; - v2d->cur.xmin= 0.0f; + v2d->cur.xmax = winx*style->panelzoom; + v2d->cur.xmin = 0.0f; } /* - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { - v2d->cur.ymax= 0.0f; - v2d->cur.ymin= -winy*style->panelzoom; + v2d->cur.ymax = 0.0f; + v2d->cur.ymin = -winy*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { - v2d->cur.ymax= winy*style->panelzoom; - v2d->cur.ymin= 0.0f; + v2d->cur.ymax = winy*style->panelzoom; + v2d->cur.ymin = 0.0f; } } @@ -1689,7 +1689,7 @@ void UI_view2d_operatortypes(void) void UI_view2d_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "View2D", 0, 0); wmKeyMapItem *kmi; /* scrollers */ @@ -1742,7 +1742,7 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); /* Alternative keymap for buttons listview */ - keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); + keymap = WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0); |