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 | |
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')
10 files changed, 280 insertions, 267 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index 4e77d6940b0..f129bc9e2ea 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -176,7 +176,7 @@ static TreeTraversalAction collection_find_selected_to_add(TreeElement *te, void static int collection_new_exec(bContext *C, wmOperator *op) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -187,7 +187,7 @@ static int collection_new_exec(bContext *C, wmOperator *op) }; if (RNA_boolean_get(op->ptr, "nested")) { - outliner_build_tree(bmain, scene, view_layer, soops, ar); + outliner_build_tree(bmain, scene, view_layer, soops, region); outliner_tree_traverse( soops, &soops->tree, 0, TSE_SELECTED, collection_find_selected_to_add, &data); diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index ecacd55debb..fbf319bea37 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -107,10 +107,10 @@ static TreeElement *outliner_dropzone_find(const SpaceOutliner *soops, static TreeElement *outliner_drop_find(bContext *C, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); float fmval[2]; - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); return outliner_dropzone_find(soops, fmval, true); } @@ -134,11 +134,12 @@ static TreeElement *outliner_drop_insert_find(bContext *C, TreeElementInsertType *r_insert_type) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); TreeElement *te_hovered; float view_mval[2]; - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view( + ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); te_hovered = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); if (te_hovered) { @@ -719,7 +720,7 @@ static bool collection_drop_poll(bContext *C, const char **tooltip) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); bool changed = outliner_flag_set(&soops->tree, TSE_HIGHLIGHTED | TSE_DRAG_ANY, false); CollectionDrop data; @@ -761,13 +762,13 @@ static bool collection_drop_poll(bContext *C, } } if (changed) { - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); } return true; } else { if (changed) { - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); } return false; } @@ -867,12 +868,12 @@ void OUTLINER_OT_collection_drop(wmOperatorType *ot) /* ********************* Outliner Drag Operator ******************** */ static TreeElement *outliner_item_drag_element_find(SpaceOutliner *soops, - ARegion *ar, + ARegion *region, const wmEvent *event) { /* note: using EVT_TWEAK_ events to trigger dragging is fine, * it sends coordinates from where dragging was started */ - const float my = UI_view2d_region_to_view_y(&ar->v2d, event->mval[1]); + const float my = UI_view2d_region_to_view_y(®ion->v2d, event->mval[1]); return outliner_find_item_at_y(soops, &soops->tree, my); } @@ -880,9 +881,9 @@ static int outliner_item_drag_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); - TreeElement *te = outliner_item_drag_element_find(soops, ar, event); + TreeElement *te = outliner_item_drag_element_find(soops, region, event); if (!te) { return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); @@ -894,7 +895,8 @@ static int outliner_item_drag_drop_invoke(bContext *C, } float view_mval[2]; - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view( + ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); if (outliner_item_is_co_within_close_toggle(te, view_mval[0])) { return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); } 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); } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 4503de3beda..945bfb55b1b 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -99,11 +99,12 @@ static int outliner_highlight_update(bContext *C, wmOperator *UNUSED(op), const return OPERATOR_PASS_THROUGH; } - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); float view_mval[2]; - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view( + ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); TreeElement *hovered_te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); @@ -121,7 +122,7 @@ static int outliner_highlight_update(bContext *C, wmOperator *UNUSED(op), const } if (changed) { - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); } return OPERATOR_PASS_THROUGH; @@ -165,11 +166,12 @@ typedef struct OpenCloseData { static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); float view_mval[2]; - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view( + ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); if (event->type == MOUSEMOVE) { TreeElement *te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); @@ -182,7 +184,7 @@ static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEv /* Only toggle openclose on the same level as the first clicked element */ if (te->xs == data->x_location) { outliner_item_openclose(te, data->open, false); - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } } @@ -204,13 +206,14 @@ static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEv static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); const bool toggle_all = RNA_boolean_get(op->ptr, "all"); float view_mval[2]; - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view( + ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); TreeElement *te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); @@ -221,7 +224,7 @@ static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmE (toggle_all && (outliner_flag_is_any_test(&te->subtree, TSE_CLOSED, 1))); outliner_item_openclose(te, open, toggle_all); - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); /* Only toggle once for single click toggling */ if (event->type == LEFTMOUSE) { @@ -315,7 +318,7 @@ void item_object_mode_exit_cb(bContext *C, /* Rename --------------------------------------------------- */ -static void do_item_rename(ARegion *ar, +static void do_item_rename(ARegion *region, TreeElement *te, TreeStoreElem *tselem, ReportList *reports) @@ -370,7 +373,7 @@ static void do_item_rename(ARegion *ar, if (add_textbut) { tselem->flag |= TSE_TEXTBUT; - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } } @@ -382,12 +385,12 @@ void item_rename_cb(bContext *C, TreeStoreElem *tselem, void *UNUSED(user_data)) { - ARegion *ar = CTX_wm_region(C); - do_item_rename(ar, te, tselem, reports); + ARegion *region = CTX_wm_region(C); + do_item_rename(region, te, tselem, reports); } static void do_outliner_item_rename(ReportList *reports, - ARegion *ar, + ARegion *region, TreeElement *te, const float mval[2]) { @@ -396,18 +399,18 @@ static void do_outliner_item_rename(ReportList *reports, /* click on name */ if (mval[0] > te->xs + UI_UNIT_X * 2 && mval[0] < te->xend) { - do_item_rename(ar, te, tselem, reports); + do_item_rename(region, te, tselem, reports); } } for (te = te->subtree.first; te; te = te->next) { - do_outliner_item_rename(reports, ar, te, mval); + do_outliner_item_rename(reports, region, te, mval); } } static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; @@ -417,17 +420,17 @@ static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *even TreeElement *active_element = outliner_find_element_with_flag(&soops->tree, TSE_ACTIVE); if (active_element) { - do_item_rename(ar, active_element, TREESTORE(active_element), op->reports); + do_item_rename(region, active_element, TREESTORE(active_element), op->reports); } else { BKE_report(op->reports, RPT_WARNING, "No active item to rename"); } } else { - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); for (te = soops->tree.first; te; te = te->next) { - do_outliner_item_rename(op->reports, ar, te, fmval); + do_outliner_item_rename(op->reports, region, te, fmval); } } @@ -521,14 +524,14 @@ static int outliner_id_delete_invoke_do(bContext *C, static int outliner_id_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - BLI_assert(ar && soops); + BLI_assert(region && soops); - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); for (te = soops->tree.first; te; te = te->next) { int ret; @@ -633,11 +636,11 @@ static bool outliner_id_remap_find_tree_element(bContext *C, static int outliner_id_remap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); float fmval[2]; if (!RNA_property_is_set(op->ptr, RNA_struct_find_property(op->ptr, "id_type"))) { - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); outliner_id_remap_find_tree_element(C, op, &soops->tree, fmval[1]); } @@ -898,14 +901,14 @@ static int outliner_lib_relocate_invoke_do( static int outliner_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - BLI_assert(ar && soops); + BLI_assert(region && soops); - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); for (te = soops->tree.first; te; te = te->next) { int ret; @@ -946,14 +949,14 @@ void lib_relocate_cb(bContext *C, static int outliner_lib_reload_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - BLI_assert(ar && soops); + BLI_assert(region && soops); - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); for (te = soops->tree.first; te; te = te->next) { int ret; @@ -1111,7 +1114,7 @@ int common_restrict_check(bContext *C, Object *ob) static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); if (outliner_flag_is_any_test(&soops->tree, TSE_CLOSED, 1)) { outliner_flag_set(&soops->tree, TSE_CLOSED, 0); @@ -1120,7 +1123,7 @@ static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op)) outliner_flag_set(&soops->tree, TSE_CLOSED, 1); } - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); return OPERATOR_FINISHED; } @@ -1144,7 +1147,7 @@ void OUTLINER_OT_expanded_toggle(wmOperatorType *ot) static int outliner_select_all_exec(bContext *C, wmOperator *op) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); int action = RNA_enum_get(op->ptr, "action"); if (action == SEL_TOGGLE) { @@ -1169,7 +1172,7 @@ static int outliner_select_all_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); return OPERATOR_FINISHED; } @@ -1217,10 +1220,10 @@ static void outliner_set_coordinates_element_recursive(SpaceOutliner *soops, } /* to retrieve coordinates with redrawing the entire tree */ -void outliner_set_coordinates(ARegion *ar, SpaceOutliner *soops) +void outliner_set_coordinates(ARegion *region, SpaceOutliner *soops) { TreeElement *te; - int starty = (int)(ar->v2d.tot.ymax) - UI_UNIT_Y; + int starty = (int)(region->v2d.tot.ymax) - UI_UNIT_Y; for (te = soops->tree.first; te; te = te->next) { outliner_set_coordinates_element_recursive(soops, te, 0, &starty); @@ -1279,18 +1282,18 @@ static TreeElement *outliner_show_active_get_element(bContext *C, return te; } -static void outliner_show_active(SpaceOutliner *so, ARegion *ar, TreeElement *te, ID *id) +static void outliner_show_active(SpaceOutliner *so, ARegion *region, TreeElement *te, ID *id) { /* open up tree to active object/bone */ if (TREESTORE(te)->id == id) { if (outliner_open_back(te)) { - outliner_set_coordinates(ar, so); + outliner_set_coordinates(region, so); } return; } for (TreeElement *ten = te->subtree.first; ten; ten = ten->next) { - outliner_show_active(so, ar, ten, id); + outliner_show_active(so, region, ten, id); } } @@ -1298,8 +1301,8 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOutliner *so = CTX_wm_space_outliner(C); ViewLayer *view_layer = CTX_data_view_layer(C); - ARegion *ar = CTX_wm_region(C); - View2D *v2d = &ar->v2d; + ARegion *region = CTX_wm_region(C); + View2D *v2d = ®ion->v2d; TreeElement *active_element = outliner_show_active_get_element(C, so, view_layer); @@ -1308,25 +1311,25 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) /* Expand all elements in the outliner with matching ID */ for (TreeElement *te = so->tree.first; te; te = te->next) { - outliner_show_active(so, ar, te, id); + outliner_show_active(so, region, te, id); } /* Also open back from the active_element (only done for the first found occurrence of ID * though). */ - outliner_show_active(so, ar, active_element, id); + outliner_show_active(so, region, active_element, id); /* Center view on first element found */ int size_y = BLI_rcti_size_y(&v2d->mask) + 1; int ytop = (active_element->ys + (size_y / 2)); int delta_y = ytop - v2d->cur.ymax; - outliner_scroll_view(ar, delta_y); + outliner_scroll_view(region, delta_y); } else { return OPERATOR_CANCELLED; } - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); return OPERATOR_FINISHED; } @@ -1348,8 +1351,8 @@ void OUTLINER_OT_show_active(wmOperatorType *ot) static int outliner_scroll_page_exec(bContext *C, wmOperator *op) { - ARegion *ar = CTX_wm_region(C); - int size_y = BLI_rcti_size_y(&ar->v2d.mask) + 1; + ARegion *region = CTX_wm_region(C); + int size_y = BLI_rcti_size_y(®ion->v2d.mask) + 1; bool up = RNA_boolean_get(op->ptr, "up"); @@ -1357,9 +1360,9 @@ static int outliner_scroll_page_exec(bContext *C, wmOperator *op) size_y = -size_y; } - outliner_scroll_view(ar, size_y); + outliner_scroll_view(region, size_y); - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); return OPERATOR_FINISHED; } @@ -1422,7 +1425,7 @@ static TreeElement *outliner_find_name( } static void outliner_find_panel( - Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags) + Scene *UNUSED(scene), ARegion *region, SpaceOutliner *soops, int again, int flags) { ReportList *reports = NULL; // CTX_wm_reports(C); TreeElement *te = NULL; @@ -1463,7 +1466,7 @@ static void outliner_find_panel( if (tselem) { /* expand branches so that it will be visible, we need to get correct coordinates */ if (outliner_open_back(soops, te)) { - outliner_set_coordinates(ar, soops); + outliner_set_coordinates(region, soops); } /* deselect all visible, and select found element */ @@ -1471,17 +1474,17 @@ static void outliner_find_panel( tselem->flag |= TSE_SELECTED; /* make te->ys center of view */ - ytop = (int)(te->ys + BLI_rctf_size_y(&ar->v2d.mask) / 2); + ytop = (int)(te->ys + BLI_rctf_size_y(®ion->v2d.mask) / 2); if (ytop > 0) { ytop = 0; } - ar->v2d.cur.ymax = (float)ytop; - ar->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(&ar->v2d.mask)); + region->v2d.cur.ymax = (float)ytop; + region->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(®ion->v2d.mask)); /* make te->xs ==> te->xend center of view */ - xdelta = (int)(te->xs - ar->v2d.cur.xmin); - ar->v2d.cur.xmin += xdelta; - ar->v2d.cur.xmax += xdelta; + xdelta = (int)(te->xs - region->v2d.cur.xmin); + region->v2d.cur.xmin += xdelta; + region->v2d.cur.xmax += xdelta; /* store selection */ soops->search_tse = *tselem; @@ -1490,7 +1493,7 @@ static void outliner_find_panel( soops->search_flags = flags; /* redraw */ - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); } } else { @@ -1529,7 +1532,7 @@ static void outliner_openclose_level(ListBase *lb, int curlevel, int level, int static int outliner_one_level_exec(bContext *C, wmOperator *op) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); const bool add = RNA_boolean_get(op->ptr, "open"); int level; @@ -1548,7 +1551,7 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op) } } - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); return OPERATOR_FINISHED; } @@ -1640,13 +1643,13 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *soops, List static int outliner_show_hierarchy_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); /* recursively open/close levels */ tree_element_show_hierarchy(scene, soops, &soops->tree); - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index f83f53c5300..4cc8ece0066 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -221,7 +221,7 @@ void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct ViewLayer *view_layer, struct SpaceOutliner *soops, - struct ARegion *ar); + struct ARegion *region); typedef struct IDsSelectedData { struct ListBase selected_array; @@ -361,7 +361,7 @@ void item_object_mode_exit_cb(struct bContext *C, struct TreeStoreElem *tselem, void *user_data); -void outliner_set_coordinates(struct ARegion *ar, struct SpaceOutliner *soops); +void outliner_set_coordinates(struct ARegion *region, struct SpaceOutliner *soops); void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all); @@ -494,7 +494,7 @@ bool outliner_tree_traverse(const SpaceOutliner *soops, float outliner_restrict_columns_width(const struct SpaceOutliner *soops); TreeElement *outliner_find_element_with_flag(const ListBase *lb, short flag); bool outliner_is_element_visible(const TreeElement *te); -void outliner_scroll_view(struct ARegion *ar, int delta_y); +void outliner_scroll_view(struct ARegion *region, int delta_y); /* outliner_sync.c ---------------------------------------------- */ diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 715b554b154..dd2179da815 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1318,10 +1318,10 @@ static void do_outliner_range_select(bContext *C, } static bool outliner_is_co_within_restrict_columns(const SpaceOutliner *soops, - const ARegion *ar, + const ARegion *region, float view_co_x) { - return (view_co_x > ar->v2d.cur.xmax - outliner_restrict_columns_width(soops)); + return (view_co_x > region->v2d.cur.xmax - outliner_restrict_columns_width(soops)); } /** @@ -1352,15 +1352,15 @@ static int outliner_item_do_activate_from_cursor(bContext *C, const bool use_range, const bool deselect_all) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; float view_mval[2]; bool changed = false, rebuild_tree = false; - UI_view2d_region_to_view(&ar->v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view(®ion->v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]); - if (outliner_is_co_within_restrict_columns(soops, ar, view_mval[0])) { + if (outliner_is_co_within_restrict_columns(soops, region, view_mval[0])) { return OPERATOR_CANCELLED; } @@ -1408,10 +1408,10 @@ static int outliner_item_do_activate_from_cursor(bContext *C, if (changed) { if (rebuild_tree) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } else { - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); } if (soops->flag & SO_SYNC_SELECT) { @@ -1486,7 +1486,7 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); rctf rectf; const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode"); @@ -1496,7 +1496,7 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) } WM_operator_properties_border_to_rctf(op, &rectf); - UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf); + UI_view2d_region_to_view_rctf(®ion->v2d, &rectf, &rectf); for (TreeElement *te = soops->tree.first; te; te = te->next) { outliner_item_box_select(soops, scene, &rectf, te, select); @@ -1504,7 +1504,7 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); if (soops->flag & SO_SYNC_SELECT) { ED_outliner_select_sync_from_outliner(C, soops); @@ -1516,11 +1516,12 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); float view_mval[2]; const bool tweak = RNA_boolean_get(op->ptr, "tweak"); - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view( + ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); /* Find element clicked on */ TreeElement *te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); @@ -1707,25 +1708,25 @@ static TreeElement *find_walk_select_start_element(SpaceOutliner *soops, bool *c } /* Scroll the outliner when the walk element reaches the top or bottom boundary */ -static void outliner_walk_scroll(ARegion *ar, TreeElement *te) +static void outliner_walk_scroll(ARegion *region, TreeElement *te) { /* Account for the header height */ - int y_max = ar->v2d.cur.ymax - UI_UNIT_Y; - int y_min = ar->v2d.cur.ymin; + int y_max = region->v2d.cur.ymax - UI_UNIT_Y; + int y_min = region->v2d.cur.ymin; /* Scroll if walked position is beyond the border */ if (te->ys > y_max) { - outliner_scroll_view(ar, te->ys - y_max); + outliner_scroll_view(region, te->ys - y_max); } else if (te->ys < y_min) { - outliner_scroll_view(ar, -(y_min - te->ys)); + outliner_scroll_view(region, -(y_min - te->ys)); } } static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceOutliner *soops = CTX_wm_space_outliner(C); - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); const short direction = RNA_enum_get(op->ptr, "direction"); const bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -1743,12 +1744,12 @@ static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEven } /* Scroll outliner to focus on walk element */ - outliner_walk_scroll(ar, walk_element); + outliner_walk_scroll(region, walk_element); if (soops->flag & SO_SYNC_SELECT) { ED_outliner_select_sync_from_outliner(C, soops); } - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 2cf106ea07d..63ffe3da27b 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -551,7 +551,7 @@ static void merged_element_search_call_cb(struct bContext *C, void *UNUSED(arg1) * Merged element search menu * Created on activation of a merged or aggregated icon-row icon. */ -static uiBlock *merged_element_search_menu(bContext *C, ARegion *ar, void *data) +static uiBlock *merged_element_search_menu(bContext *C, ARegion *region, void *data) { static char search[64] = ""; uiBlock *block; @@ -560,7 +560,7 @@ static uiBlock *merged_element_search_menu(bContext *C, ARegion *ar, void *data) /* Clear search on each menu creation */ *search = '\0'; - block = UI_block_begin(C, ar, __func__, UI_EMBOSS); + block = UI_block_begin(C, region, __func__, UI_EMBOSS); UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU); UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); @@ -2324,7 +2324,7 @@ static int outliner_operator_menu(bContext *C, const char *opname) } static int do_outliner_operation_event( - bContext *C, ARegion *ar, SpaceOutliner *soops, TreeElement *te, const float mval[2]) + bContext *C, ARegion *region, SpaceOutliner *soops, TreeElement *te, const float mval[2]) { ReportList *reports = CTX_wm_reports(C); // XXX... @@ -2343,7 +2343,7 @@ static int do_outliner_operation_event( /* Only redraw, don't rebuild here because TreeElement pointers will * become invalid and operations will crash. */ - ED_region_tag_redraw_no_rebuild(ar); + ED_region_tag_redraw_no_rebuild(region); } set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel); @@ -2421,7 +2421,7 @@ static int do_outliner_operation_event( } for (te = te->subtree.first; te; te = te->next) { - int retval = do_outliner_operation_event(C, ar, soops, te, mval); + int retval = do_outliner_operation_event(C, region, soops, te, mval); if (retval) { return retval; } @@ -2432,7 +2432,7 @@ static int do_outliner_operation_event( static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); uiBut *but = UI_context_active_but_get(C); TreeElement *te; @@ -2442,10 +2442,10 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent UI_but_tooltip_timer_remove(C, but); } - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); for (te = soops->tree.first; te; te = te->next) { - int retval = do_outliner_operation_event(C, ar, soops, te, fmval); + int retval = do_outliner_operation_event(C, region, soops, te, fmval); if (retval) { return retval; } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 4f896424f08..b8cbb6bb0e3 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1842,13 +1842,13 @@ typedef struct OutlinerTreeElementFocus { * Caller is expected to handle redrawing of ARegion. */ static void outliner_restore_scrolling_position(SpaceOutliner *soops, - ARegion *ar, + ARegion *region, OutlinerTreeElementFocus *focus) { - View2D *v2d = &ar->v2d; + View2D *v2d = ®ion->v2d; if (focus->tselem != NULL) { - outliner_set_coordinates(ar, soops); + outliner_set_coordinates(region, soops); TreeElement *te_new = outliner_find_tree_element(&soops->tree, focus->tselem); @@ -1970,15 +1970,15 @@ static TreeElement *outliner_find_first_desired_element_at_y(const SpaceOutliner * original position as before filtering. */ static void outliner_store_scrolling_position(SpaceOutliner *soops, - ARegion *ar, + ARegion *region, OutlinerTreeElementFocus *focus) { TreeElement *te; - float limit = ar->v2d.cur.ymin; + float limit = region->v2d.cur.ymin; - outliner_set_coordinates(ar, soops); + outliner_set_coordinates(region, soops); - te = outliner_find_first_desired_element_at_y(soops, ar->v2d.cur.ymax, limit); + te = outliner_find_first_desired_element_at_y(soops, region->v2d.cur.ymax, limit); if (te != NULL) { focus->tselem = TREESTORE(te); @@ -2264,7 +2264,7 @@ static void outliner_filter_tree(SpaceOutliner *soops, ViewLayer *view_layer) /* Main entry point for building the tree data-structure that the outliner represents */ // TODO: split each mode into its own function? void outliner_build_tree( - Main *mainvar, Scene *scene, ViewLayer *view_layer, SpaceOutliner *soops, ARegion *ar) + Main *mainvar, Scene *scene, ViewLayer *view_layer, SpaceOutliner *soops, ARegion *region) { TreeElement *te = NULL, *ten; TreeStoreElem *tselem; @@ -2286,12 +2286,12 @@ void outliner_build_tree( BKE_outliner_treehash_rebuild_from_treestore(soops->treehash, soops->treestore); } - if (ar->do_draw & RGN_DRAW_NO_REBUILD) { + if (region->do_draw & RGN_DRAW_NO_REBUILD) { return; } OutlinerTreeElementFocus focus; - outliner_store_scrolling_position(soops, ar, &focus); + outliner_store_scrolling_position(soops, region, &focus); outliner_free_tree(&soops->tree); outliner_storage_cleanup(soops); @@ -2445,7 +2445,7 @@ void outliner_build_tree( } outliner_filter_tree(soops, view_layer); - outliner_restore_scrolling_position(soops, ar, &focus); + outliner_restore_scrolling_position(soops, region, &focus); BKE_main_id_clear_newpoins(mainvar); } diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c index c3984ab16fa..a12defac813 100644 --- a/source/blender/editors/space_outliner/outliner_utils.c +++ b/source/blender/editors/space_outliner/outliner_utils.c @@ -409,38 +409,38 @@ bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_c } /* Scroll view vertically while keeping within total bounds */ -void outliner_scroll_view(ARegion *ar, int delta_y) +void outliner_scroll_view(ARegion *region, int delta_y) { - int y_min = MIN2(ar->v2d.cur.ymin, ar->v2d.tot.ymin); + int y_min = MIN2(region->v2d.cur.ymin, region->v2d.tot.ymin); - ar->v2d.cur.ymax += delta_y; - ar->v2d.cur.ymin += delta_y; + region->v2d.cur.ymax += delta_y; + region->v2d.cur.ymin += delta_y; /* Adjust view if delta placed view outside total area */ int offset; - if (ar->v2d.cur.ymax > -UI_UNIT_Y) { - offset = ar->v2d.cur.ymax; - ar->v2d.cur.ymax -= offset; - ar->v2d.cur.ymin -= offset; + if (region->v2d.cur.ymax > -UI_UNIT_Y) { + offset = region->v2d.cur.ymax; + region->v2d.cur.ymax -= offset; + region->v2d.cur.ymin -= offset; } - else if (ar->v2d.cur.ymin < y_min) { - offset = y_min - ar->v2d.cur.ymin; - ar->v2d.cur.ymax += offset; - ar->v2d.cur.ymin += offset; + else if (region->v2d.cur.ymin < y_min) { + offset = y_min - region->v2d.cur.ymin; + region->v2d.cur.ymax += offset; + region->v2d.cur.ymin += offset; } } /* Get base of object under cursor. Used for eyedropper tool */ Base *ED_outliner_give_base_under_cursor(bContext *C, const int mval[2]) { - ARegion *ar = CTX_wm_region(C); + ARegion *region = CTX_wm_region(C); ViewLayer *view_layer = CTX_data_view_layer(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; Base *base = NULL; float view_mval[2]; - UI_view2d_region_to_view(&ar->v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]); + UI_view2d_region_to_view(®ion->v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]); te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); if (te) { diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 68eea4f278b..ff9b3c8a05b 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -54,36 +54,36 @@ #include "outliner_intern.h" #include "GPU_framebuffer.h" -static void outliner_main_region_init(wmWindowManager *wm, ARegion *ar) +static void outliner_main_region_init(wmWindowManager *wm, ARegion *region) { ListBase *lb; wmKeyMap *keymap; /* make sure we keep the hide flags */ - ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); - ar->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP); /* prevent any noise of past */ - ar->v2d.scroll |= V2D_SCROLL_HORIZONTAL_HIDE; - ar->v2d.scroll |= V2D_SCROLL_VERTICAL_HIDE; + region->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + region->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP); /* prevent any noise of past */ + region->v2d.scroll |= V2D_SCROLL_HORIZONTAL_HIDE; + region->v2d.scroll |= V2D_SCROLL_VERTICAL_HIDE; - ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); - ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); - ar->v2d.keeptot = V2D_KEEPTOT_STRICT; - ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f; + region->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); + region->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); + region->v2d.keeptot = V2D_KEEPTOT_STRICT; + region->v2d.minzoom = region->v2d.maxzoom = 1.0f; - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); + UI_view2d_region_reinit(®ion->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy); /* own keymap */ keymap = WM_keymap_ensure(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0); - WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap); + WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap); /* Add dropboxes */ lb = WM_dropboxmap_find("Outliner", SPACE_OUTLINER, RGN_TYPE_WINDOW); - WM_event_add_dropbox_handler(&ar->handlers, lb); + WM_event_add_dropbox_handler(®ion->handlers, lb); } -static void outliner_main_region_draw(const bContext *C, ARegion *ar) +static void outliner_main_region_draw(const bContext *C, ARegion *region) { - View2D *v2d = &ar->v2d; + View2D *v2d = ®ion->v2d; View2DScrollers *scrollers; /* clear */ @@ -101,13 +101,13 @@ static void outliner_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_scrollers_free(scrollers); } -static void outliner_main_region_free(ARegion *UNUSED(ar)) +static void outliner_main_region_free(ARegion *UNUSED(region)) { } static void outliner_main_region_listener(wmWindow *UNUSED(win), ScrArea *UNUSED(sa), - ARegion *ar, + ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) { @@ -128,11 +128,11 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win), case ND_LAYER_CONTENT: case ND_WORLD: case ND_SCENEBROWSE: - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; } if (wmn->action & NA_EDITED) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_OBJECT: @@ -145,46 +145,46 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win), case ND_DRAW: case ND_PARENT: case ND_OB_SHADING: - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; case ND_CONSTRAINT: /* all constraint actions now, for reordering */ - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; case ND_MODIFIER: /* all modifier actions now */ - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; default: /* Trigger update for NC_OBJECT itself */ - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; } break; case NC_GROUP: /* all actions now, todo: check outliner view mode? */ - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; case NC_LAMP: /* For updating light icons, when changing light type */ if (wmn->data == ND_LIGHTING_DRAW) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_SPACE: if (wmn->data == ND_SPACE_OUTLINER) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_ID: if (wmn->action == NA_RENAME) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_MATERIAL: switch (wmn->data) { case ND_SHADING_LINKS: - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; } break; @@ -192,7 +192,7 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_VERTEX_GROUP: case ND_DATA: - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; } break; @@ -200,38 +200,38 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_NLA_ACTCHANGE: case ND_KEYFRAME: - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); break; case ND_ANIMCHAN: if (wmn->action == NA_SELECTED) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; } break; case NC_GPENCIL: if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_SCREEN: if (ELEM(wmn->data, ND_LAYER)) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_MASK: if (ELEM(wmn->action, NA_ADDED)) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_PAINTCURVE: if (ELEM(wmn->action, NA_ADDED)) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_TEXT: if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; } @@ -242,13 +242,13 @@ static void outliner_main_region_message_subscribe(const struct bContext *UNUSED struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), struct ScrArea *sa, - struct ARegion *ar, + struct ARegion *region, struct wmMsgBus *mbus) { SpaceOutliner *soops = sa->spacedata.first; wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { - .owner = ar, - .user_data = ar, + .owner = region, + .user_data = region, .notify = ED_region_do_msg_notify_tag_redraw, }; @@ -260,23 +260,23 @@ static void outliner_main_region_message_subscribe(const struct bContext *UNUSED /* ************************ header outliner area region *********************** */ /* add handlers, stuff you only do once or on area/region changes */ -static void outliner_header_region_init(wmWindowManager *UNUSED(wm), ARegion *ar) +static void outliner_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region) { - ED_region_header_init(ar); + ED_region_header_init(region); } -static void outliner_header_region_draw(const bContext *C, ARegion *ar) +static void outliner_header_region_draw(const bContext *C, ARegion *region) { - ED_region_header(C, ar); + ED_region_header(C, region); } -static void outliner_header_region_free(ARegion *UNUSED(ar)) +static void outliner_header_region_free(ARegion *UNUSED(region)) { } static void outliner_header_region_listener(wmWindow *UNUSED(win), ScrArea *UNUSED(sa), - ARegion *ar, + ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) { @@ -284,12 +284,12 @@ static void outliner_header_region_listener(wmWindow *UNUSED(win), switch (wmn->category) { case NC_SCENE: if (wmn->data == ND_KEYINGSET) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; case NC_SPACE: if (wmn->data == ND_SPACE_OUTLINER) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw(region); } break; } @@ -299,7 +299,7 @@ static void outliner_header_region_listener(wmWindow *UNUSED(win), static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scene)) { - ARegion *ar; + ARegion *region; SpaceOutliner *soutliner; soutliner = MEM_callocN(sizeof(SpaceOutliner), "initoutliner"); @@ -311,17 +311,17 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED( soutliner->flag |= SO_SYNC_SELECT; /* header */ - ar = MEM_callocN(sizeof(ARegion), "header for outliner"); + region = MEM_callocN(sizeof(ARegion), "header for outliner"); - BLI_addtail(&soutliner->regionbase, ar); - ar->regiontype = RGN_TYPE_HEADER; - ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; + BLI_addtail(&soutliner->regionbase, region); + region->regiontype = RGN_TYPE_HEADER; + region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; /* main region */ - ar = MEM_callocN(sizeof(ARegion), "main region for outliner"); + region = MEM_callocN(sizeof(ARegion), "main region for outliner"); - BLI_addtail(&soutliner->regionbase, ar); - ar->regiontype = RGN_TYPE_WINDOW; + BLI_addtail(&soutliner->regionbase, region); + region->regiontype = RGN_TYPE_WINDOW; return (SpaceLink *)soutliner; } |