diff options
author | Julian Eisel <julian@blender.org> | 2020-03-06 18:56:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-06 19:19:23 +0300 |
commit | b2ee1770d4c31078518f4ec9edd5196a41345162 (patch) | |
tree | 6b7f6ff9057322245fc3b3407bece3f1c0cb3eb5 /source/blender/editors/space_outliner/outliner_draw.c | |
parent | b825a95ec311a169d33fe21e28418f11a516c82f (diff) |
Cleanup: Rename ARegion variables from ar to region
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 167 |
1 files changed, 87 insertions, 80 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 8985f32d23e..1c26dc8f834 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -987,7 +987,7 @@ static bool outliner_restrict_properties_collection_set(Scene *scene, static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ViewLayer *view_layer, - ARegion *ar, + ARegion *region, SpaceOutliner *soops, ListBase *lb, RestrictPropertiesActive props_active_parent) @@ -1058,7 +1058,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, TreeStoreElem *tselem = TREESTORE(te); RestrictPropertiesActive props_active = props_active_parent; - if (te->ys + 2 * UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) { + if (te->ys + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && te->ys <= region->v2d.cur.ymax) { if (tselem->type == TSE_R_LAYER && (soops->outlinevis == SO_SCENES)) { if (soops->show_restrict_flags & SO_RESTRICT_RENDER) { /* View layer render toggle. */ @@ -1069,7 +1069,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, VIEW_LAYER_RENDER, 0, ICON_RESTRICT_RENDER_OFF, - (int)(ar->v2d.cur.xmax - restrict_offsets.render), + (int)(region->v2d.cur.xmax - restrict_offsets.render), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1103,7 +1103,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.hide), + (int)(region->v2d.cur.xmax - restrict_offsets.hide), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1130,7 +1130,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.select), + (int)(region->v2d.cur.xmax - restrict_offsets.select), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1155,7 +1155,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.viewport), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1180,7 +1180,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.render), + (int)(region->v2d.cur.xmax - restrict_offsets.render), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1211,7 +1211,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.hide), + (int)(region->v2d.cur.xmax - restrict_offsets.hide), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1240,7 +1240,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.viewport), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1263,7 +1263,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.render), + (int)(region->v2d.cur.xmax - restrict_offsets.render), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1292,7 +1292,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, BONE_HIDDEN_P, 0, ICON_RESTRICT_VIEW_OFF, - (int)(ar->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.viewport), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1313,7 +1313,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, BONE_UNSELECTABLE, 0, ICON_RESTRICT_SELECT_OFF, - (int)(ar->v2d.cur.xmax - restrict_offsets.select), + (int)(region->v2d.cur.xmax - restrict_offsets.select), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1337,7 +1337,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, BONE_HIDDEN_A, 0, ICON_RESTRICT_VIEW_OFF, - (int)(ar->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.viewport), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1358,7 +1358,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, BONE_UNSELECTABLE, 0, ICON_RESTRICT_SELECT_OFF, - (int)(ar->v2d.cur.xmax - restrict_offsets.select), + (int)(region->v2d.cur.xmax - restrict_offsets.select), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1383,7 +1383,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, GP_LAYER_HIDE, 0, ICON_HIDE_OFF, - (int)(ar->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.viewport), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1404,7 +1404,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, GP_LAYER_LOCKED, 0, ICON_UNLOCKED, - (int)(ar->v2d.cur.xmax - restrict_offsets.select), + (int)(region->v2d.cur.xmax - restrict_offsets.select), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1436,7 +1436,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.hide), + (int)(region->v2d.cur.xmax - restrict_offsets.hide), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1465,7 +1465,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.holdout), + (int)(region->v2d.cur.xmax - restrict_offsets.holdout), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1495,7 +1495,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.indirect_only), + (int)(region->v2d.cur.xmax - restrict_offsets.indirect_only), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1527,7 +1527,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.viewport), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1564,7 +1564,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.render), + (int)(region->v2d.cur.xmax - restrict_offsets.render), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1599,7 +1599,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, UI_BTYPE_ICON_TOGGLE, 0, 0, - (int)(ar->v2d.cur.xmax - restrict_offsets.select), + (int)(region->v2d.cur.xmax - restrict_offsets.select), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1639,17 +1639,21 @@ static void outliner_draw_restrictbuts(uiBlock *block, } if (TSELEM_OPEN(tselem, soops)) { - outliner_draw_restrictbuts(block, scene, view_layer, ar, soops, &te->subtree, props_active); + outliner_draw_restrictbuts( + block, scene, view_layer, region, soops, &te->subtree, props_active); } } } -static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOutliner *soops, ListBase *lb) +static void outliner_draw_userbuts(uiBlock *block, + ARegion *region, + SpaceOutliner *soops, + ListBase *lb) { for (TreeElement *te = lb->first; te; te = te->next) { TreeStoreElem *tselem = TREESTORE(te); - if (te->ys + 2 * UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) { + if (te->ys + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && te->ys <= region->v2d.cur.ymax) { if (tselem->type == 0) { uiBut *bt; ID *id = tselem->id; @@ -1667,7 +1671,7 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOutliner *s UI_BTYPE_BUT, 1, buf, - (int)(ar->v2d.cur.xmax - OL_TOG_USER_BUTS_USERS), + (int)(region->v2d.cur.xmax - OL_TOG_USER_BUTS_USERS), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1692,7 +1696,7 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOutliner *s LIB_FAKEUSER, 1, icon, - (int)(ar->v2d.cur.xmax - OL_TOG_USER_BUTS_STATUS), + (int)(region->v2d.cur.xmax - OL_TOG_USER_BUTS_STATUS), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1710,7 +1714,7 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOutliner *s LIB_FAKEUSER, 1, (id->flag & LIB_FAKEUSER) ? "F" : " ", - (int)(ar->v2d.cur.xmax - OL_TOG_USER_BUTS_FAKEUSER), + (int)(region->v2d.cur.xmax - OL_TOG_USER_BUTS_FAKEUSER), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1727,14 +1731,14 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOutliner *s } if (TSELEM_OPEN(tselem, soops)) { - outliner_draw_userbuts(block, ar, soops, &te->subtree); + outliner_draw_userbuts(block, region, soops, &te->subtree); } } } -static void outliner_draw_rnacols(ARegion *ar, int sizex) +static void outliner_draw_rnacols(ARegion *region, int sizex) { - View2D *v2d = &ar->v2d; + View2D *v2d = ®ion->v2d; float miny = v2d->cur.ymin; if (miny < v2d->tot.ymin) { @@ -1761,14 +1765,14 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex) } static void outliner_draw_rnabuts( - uiBlock *block, ARegion *ar, SpaceOutliner *soops, int sizex, ListBase *lb) + uiBlock *block, ARegion *region, SpaceOutliner *soops, int sizex, ListBase *lb) { PointerRNA *ptr; PropertyRNA *prop; for (TreeElement *te = lb->first; te; te = te->next) { TreeStoreElem *tselem = TREESTORE(te); - if (te->ys + 2 * UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) { + if (te->ys + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && te->ys <= region->v2d.cur.ymax) { if (tselem->type == TSE_RNA_PROPERTY) { ptr = &te->rnaptr; prop = te->directdata; @@ -1831,14 +1835,14 @@ static void outliner_draw_rnabuts( } if (TSELEM_OPEN(tselem, soops)) { - outliner_draw_rnabuts(block, ar, soops, sizex, &te->subtree); + outliner_draw_rnabuts(block, region, soops, sizex, &te->subtree); } } } static void outliner_buttons(const bContext *C, uiBlock *block, - ARegion *ar, + ARegion *region, const float restrict_column_width, TreeElement *te) { @@ -1872,7 +1876,7 @@ static void outliner_buttons(const bContext *C, (soops->show_restrict_flags & SO_RESTRICT_ENABLE)) { spx += UI_UNIT_X; } - dx = ar->v2d.cur.xmax - (spx + restrict_column_width + 0.2f * UI_UNIT_X); + dx = region->v2d.cur.xmax - (spx + restrict_column_width + 0.2f * UI_UNIT_X); bt = uiDefBut(block, UI_BTYPE_TEXT, @@ -1891,7 +1895,7 @@ static void outliner_buttons(const bContext *C, UI_but_func_rename_set(bt, namebutton_cb, tselem); /* returns false if button got removed */ - if (false == UI_but_active_only(C, ar, block, bt)) { + if (false == UI_but_active_only(C, region, block, bt)) { tselem->flag &= ~TSE_TEXTBUT; /* bad! (notifier within draw) without this, we don't get a refresh */ @@ -2941,7 +2945,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, const uiFontStyle *fstyle, const TreeViewContext *tvc, - ARegion *ar, + ARegion *region, SpaceOutliner *soops, TreeElement *te, bool draw_grayed_out, @@ -2959,12 +2963,12 @@ static void outliner_draw_tree_element(bContext *C, float icon_bgcolor[4], icon_border[4]; outliner_icon_background_colors(icon_bgcolor, icon_border); - if (*starty + 2 * UI_UNIT_Y >= ar->v2d.cur.ymin && *starty <= ar->v2d.cur.ymax) { + if (*starty + 2 * UI_UNIT_Y >= region->v2d.cur.ymin && *starty <= region->v2d.cur.ymax) { const float alpha_fac = ((te->flag & TE_DISABLED) || (te->flag & TE_CHILD_NOT_IN_COLLECTION) || draw_grayed_out) ? 0.5f : 1.0f; - int xmax = ar->v2d.cur.xmax; + int xmax = region->v2d.cur.xmax; if ((tselem->flag & TSE_TEXTBUT) && (*te_edit == NULL)) { *te_edit = te; @@ -3190,7 +3194,7 @@ static void outliner_draw_tree_element(bContext *C, block, fstyle, tvc, - ar, + region, soops, ten, draw_childs_grayed_out, @@ -3330,7 +3334,7 @@ static void outliner_draw_hierarchy_lines(SpaceOutliner *soops, immUnbindProgram(); } -static void outliner_draw_struct_marks(ARegion *ar, +static void outliner_draw_struct_marks(ARegion *region, SpaceOutliner *soops, ListBase *lb, int *starty) @@ -3345,14 +3349,14 @@ static void outliner_draw_struct_marks(ARegion *ar, uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immThemeColorShadeAlpha(TH_BACK, -15, -200); - immRecti(pos, 0, *starty + 1, (int)ar->v2d.cur.xmax, *starty + UI_UNIT_Y - 1); + immRecti(pos, 0, *starty + 1, (int)region->v2d.cur.xmax, *starty + UI_UNIT_Y - 1); immUnbindProgram(); } } *starty -= UI_UNIT_Y; if (TSELEM_OPEN(tselem, soops)) { - outliner_draw_struct_marks(ar, soops, &te->subtree, starty); + outliner_draw_struct_marks(region, soops, &te->subtree, starty); if (tselem->type == TSE_RNA_STRUCT) { GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -3361,7 +3365,7 @@ static void outliner_draw_struct_marks(ARegion *ar, immBegin(GPU_PRIM_LINES, 2); immVertex2f(pos, 0, (float)*starty + UI_UNIT_Y); - immVertex2f(pos, ar->v2d.cur.xmax, (float)*starty + UI_UNIT_Y); + immVertex2f(pos, region->v2d.cur.xmax, (float)*starty + UI_UNIT_Y); immEnd(); immUnbindProgram(); @@ -3371,7 +3375,7 @@ static void outliner_draw_struct_marks(ARegion *ar, } static void outliner_draw_highlights_recursive(uint pos, - const ARegion *ar, + const ARegion *region, const SpaceOutliner *soops, const ListBase *lb, const float col_selection[4], @@ -3391,16 +3395,16 @@ static void outliner_draw_highlights_recursive(uint pos, /* selection status */ if ((tselem->flag & TSE_ACTIVE) && (tselem->flag & TSE_SELECTED)) { immUniformColor4fv(col_active); - immRecti(pos, 0, start_y, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y); + immRecti(pos, 0, start_y, (int)region->v2d.cur.xmax, start_y + UI_UNIT_Y); } else if (tselem->flag & TSE_SELECTED) { immUniformColor4fv(col_selection); - immRecti(pos, 0, start_y, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y); + immRecti(pos, 0, start_y, (int)region->v2d.cur.xmax, start_y + UI_UNIT_Y); } /* highlights */ if (tselem->flag & (TSE_DRAG_ANY | TSE_HIGHLIGHTED | TSE_SEARCHMATCH)) { - const int end_x = (int)ar->v2d.cur.xmax; + const int end_x = (int)region->v2d.cur.xmax; if (tselem->flag & TSE_DRAG_ANY) { /* drag and drop highlight */ @@ -3443,7 +3447,7 @@ static void outliner_draw_highlights_recursive(uint pos, *io_start_y -= UI_UNIT_Y; if (TSELEM_OPEN(tselem, soops)) { outliner_draw_highlights_recursive(pos, - ar, + region, soops, &te->subtree, col_selection, @@ -3456,7 +3460,10 @@ static void outliner_draw_highlights_recursive(uint pos, } } -static void outliner_draw_highlights(ARegion *ar, SpaceOutliner *soops, int startx, int *starty) +static void outliner_draw_highlights(ARegion *region, + SpaceOutliner *soops, + int startx, + int *starty) { const float col_highlight[4] = {1.0f, 1.0f, 1.0f, 0.13f}; float col_selection[4], col_active[4], col_searchmatch[4]; @@ -3473,7 +3480,7 @@ static void outliner_draw_highlights(ARegion *ar, SpaceOutliner *soops, int star uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); outliner_draw_highlights_recursive(pos, - ar, + region, soops, &soops->tree, col_selection, @@ -3489,7 +3496,7 @@ static void outliner_draw_highlights(ARegion *ar, SpaceOutliner *soops, int star static void outliner_draw_tree(bContext *C, uiBlock *block, const TreeViewContext *tvc, - ARegion *ar, + ARegion *region, SpaceOutliner *soops, const float restrict_column_width, TreeElement **te_edit) @@ -3502,40 +3509,40 @@ static void outliner_draw_tree(bContext *C, if (soops->outlinevis == SO_DATA_API) { /* struct marks */ - starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; - outliner_draw_struct_marks(ar, soops, &soops->tree, &starty); + starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; + outliner_draw_struct_marks(region, soops, &soops->tree, &starty); } /* draw highlights before hierarchy */ - starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; + starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; startx = 0; - outliner_draw_highlights(ar, soops, startx, &starty); + outliner_draw_highlights(region, soops, startx, &starty); /* set scissor so tree elements or lines can't overlap restriction icons */ float scissor[4] = {0}; if (restrict_column_width > 0.0f) { - int mask_x = BLI_rcti_size_x(&ar->v2d.mask) - (int)restrict_column_width + 1; + int mask_x = BLI_rcti_size_x(®ion->v2d.mask) - (int)restrict_column_width + 1; CLAMP_MIN(mask_x, 0); GPU_scissor_get_f(scissor); - GPU_scissor(0, 0, mask_x, ar->winy); + GPU_scissor(0, 0, mask_x, region->winy); } // gray hierarchy lines - starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET; + starty = (int)region->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET; startx = UI_UNIT_X / 2 - (U.pixelsize + 1) / 2; outliner_draw_hierarchy_lines(soops, &soops->tree, startx, &starty); // items themselves - starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; + starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; startx = 0; for (TreeElement *te = soops->tree.first; te; te = te->next) { outliner_draw_tree_element(C, block, fstyle, tvc, - ar, + region, soops, te, (te->flag & TE_DRAGGING) != 0, @@ -3551,11 +3558,11 @@ static void outliner_draw_tree(bContext *C, } } -static void outliner_back(ARegion *ar) +static void outliner_back(ARegion *region) { int ystart; - ystart = (int)ar->v2d.tot.ymax; + ystart = (int)region->v2d.tot.ymax; ystart = UI_UNIT_Y * (ystart / (UI_UNIT_Y)) - OL_Y_OFFSET; GPUVertFormat *format = immVertexFormat(); @@ -3567,9 +3574,9 @@ static void outliner_back(ARegion *ar) UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating); immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]); - const float x1 = 0.0f, x2 = ar->v2d.cur.xmax; + const float x1 = 0.0f, x2 = region->v2d.cur.xmax; float y1 = ystart, y2; - int tot = (int)floor(ystart - ar->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y); + int tot = (int)floor(ystart - region->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y); if (tot > 0) { immBegin(GPU_PRIM_TRIS, 6 * tot); @@ -3604,7 +3611,7 @@ static int outliner_width(SpaceOutliner *soops, int max_tree_width, float restri } } -static void outliner_update_viewable_area(ARegion *ar, +static void outliner_update_viewable_area(ARegion *region, SpaceOutliner *soops, int tree_width, int tree_height, @@ -3616,7 +3623,7 @@ static void outliner_update_viewable_area(ARegion *ar, /* extend size to allow for horizontal scrollbar and extra offset */ sizey += V2D_SCROLL_HEIGHT + OL_Y_OFFSET; - UI_view2d_totRect_set(&ar->v2d, sizex, sizey); + UI_view2d_totRect_set(®ion->v2d, sizex, sizey); } /* ****************************************************** */ @@ -3625,8 +3632,8 @@ static void outliner_update_viewable_area(ARegion *ar, void draw_outliner(const bContext *C) { Main *mainvar = CTX_data_main(C); - ARegion *ar = CTX_wm_region(C); - View2D *v2d = &ar->v2d; + ARegion *region = CTX_wm_region(C); + View2D *v2d = ®ion->v2d; SpaceOutliner *soops = CTX_wm_space_outliner(C); uiBlock *block; TreeElement *te_edit = NULL; @@ -3634,7 +3641,7 @@ void draw_outliner(const bContext *C) TreeViewContext tvc; outliner_viewcontext_init(C, &tvc); - outliner_build_tree(mainvar, tvc.scene, tvc.view_layer, soops, ar); // always + outliner_build_tree(mainvar, tvc.scene, tvc.view_layer, soops, region); // always /* If global sync select is dirty, flag other outliners */ if (ED_outliner_select_sync_is_dirty(C)) { @@ -3654,9 +3661,9 @@ void draw_outliner(const bContext *C) /* draw outliner stuff (background, hierarchy lines and names) */ const float restrict_column_width = outliner_restrict_columns_width(soops); - outliner_back(ar); - block = UI_block_begin(C, ar, __func__, UI_EMBOSS); - outliner_draw_tree((bContext *)C, block, &tvc, ar, soops, restrict_column_width, &te_edit); + outliner_back(region); + block = UI_block_begin(C, region, __func__, UI_EMBOSS); + outliner_draw_tree((bContext *)C, block, &tvc, region, soops, restrict_column_width, &te_edit); /* Compute outliner dimensions after it has been drawn. */ int tree_width, tree_height; @@ -3668,34 +3675,34 @@ void draw_outliner(const bContext *C) if (soops->outlinevis == SO_DATA_API) { int buttons_start_x = outliner_data_api_buttons_start_x(tree_width); /* draw rna buttons */ - outliner_draw_rnacols(ar, buttons_start_x); + outliner_draw_rnacols(region, buttons_start_x); UI_block_emboss_set(block, UI_EMBOSS); - outliner_draw_rnabuts(block, ar, soops, buttons_start_x, &soops->tree); + outliner_draw_rnabuts(block, region, soops, buttons_start_x, &soops->tree); UI_block_emboss_set(block, UI_EMBOSS_NONE); } else if (soops->outlinevis == SO_ID_ORPHANS) { /* draw user toggle columns */ - outliner_draw_userbuts(block, ar, soops, &soops->tree); + outliner_draw_userbuts(block, region, soops, &soops->tree); } else if (restrict_column_width > 0.0f) { /* draw restriction columns */ RestrictPropertiesActive props_active; memset(&props_active, 1, sizeof(RestrictPropertiesActive)); outliner_draw_restrictbuts( - block, tvc.scene, tvc.view_layer, ar, soops, &soops->tree, props_active); + block, tvc.scene, tvc.view_layer, region, soops, &soops->tree, props_active); } UI_block_emboss_set(block, UI_EMBOSS); /* Draw edit buttons if necessary. */ if (te_edit) { - outliner_buttons(C, block, ar, restrict_column_width, te_edit); + outliner_buttons(C, block, region, restrict_column_width, te_edit); } UI_block_end(C, block); UI_block_draw(C, block); /* Update total viewable region. */ - outliner_update_viewable_area(ar, soops, tree_width, tree_height, restrict_column_width); + outliner_update_viewable_area(region, soops, tree_width, tree_height, restrict_column_width); } |