From 10c2254d412d7cbee0b0d9f8b7c74a9d3ce69b69 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 3 Apr 2020 12:51:03 +0200 Subject: Cleanup: Continue renaming ARegion variables from ar to region Continuation of b2ee1770d4c3, now non-single word variables are also renamed. Part of T74432. Also ran clang-format on affected files. --- source/blender/blenkernel/intern/screen.c | 12 +- source/blender/blenloader/intern/versioning_250.c | 32 +++--- source/blender/blenloader/intern/versioning_280.c | 79 ++++++------- source/blender/editors/include/ED_screen.h | 4 +- source/blender/editors/include/ED_view3d.h | 4 +- .../interface/interface_eyedropper_datablock.c | 4 +- .../editors/interface/interface_eyedropper_depth.c | 4 +- .../blender/editors/interface/interface_handlers.c | 24 ++-- source/blender/editors/interface/interface_ops.c | 6 +- .../editors/interface/interface_region_hud.c | 32 +++--- .../editors/interface/interface_region_popup.c | 4 +- source/blender/editors/screen/area.c | 8 +- source/blender/editors/screen/area_query.c | 14 +-- source/blender/editors/screen/screen_edit.c | 18 +-- source/blender/editors/screen/screen_ops.c | 42 +++---- source/blender/editors/sculpt_paint/sculpt.c | 8 +- source/blender/editors/space_clip/space_clip.c | 126 ++++++++++----------- source/blender/editors/space_file/file_ops.c | 4 +- source/blender/editors/space_file/space_file.c | 32 +++--- source/blender/editors/space_graph/graph_utils.c | 24 ++-- .../editors/space_sequencer/space_sequencer.c | 86 +++++++------- source/blender/editors/space_view3d/space_view3d.c | 26 ++--- source/blender/editors/space_view3d/view3d_edit.c | 6 +- source/blender/editors/space_view3d/view3d_utils.c | 8 +- source/blender/editors/space_view3d/view3d_view.c | 15 +-- source/blender/editors/undo/ed_undo.c | 16 +-- source/blender/makesrna/intern/rna_space.c | 16 +-- source/blender/windowmanager/intern/wm_draw.c | 8 +- .../blender/windowmanager/intern/wm_event_system.c | 8 +- source/blender/windowmanager/intern/wm_operators.c | 10 +- .../windowmanager/intern/wm_splash_screen.c | 4 +- .../blender/windowmanager/intern/wm_toolsystem.c | 4 +- source/blender/windowmanager/intern/wm_tooltip.c | 4 +- 33 files changed, 348 insertions(+), 344 deletions(-) diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index dbf460fdea2..6c888e7b19e 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -748,19 +748,19 @@ ARegion *BKE_area_find_region_active_win(ScrArea *sa) ARegion *BKE_area_find_region_xy(ScrArea *sa, const int regiontype, int x, int y) { - ARegion *ar_found = NULL; + ARegion *region_found = NULL; if (sa) { ARegion *region; for (region = sa->regionbase.first; region; region = region->next) { if ((regiontype == RGN_TYPE_ANY) || (region->regiontype == regiontype)) { if (BLI_rcti_isect_pt(®ion->winrct, x, y)) { - ar_found = region; + region_found = region; break; } } } } - return ar_found; + return region_found; } /** @@ -768,16 +768,16 @@ ARegion *BKE_area_find_region_xy(ScrArea *sa, const int regiontype, int x, int y */ ARegion *BKE_screen_find_region_xy(bScreen *sc, const int regiontype, int x, int y) { - ARegion *ar_found = NULL; + ARegion *region_found = NULL; for (ARegion *region = sc->regionbase.first; region; region = region->next) { if ((regiontype == RGN_TYPE_ANY) || (region->regiontype == regiontype)) { if (BLI_rcti_isect_pt(®ion->winrct, x, y)) { - ar_found = region; + region_found = region; break; } } } - return ar_found; + return region_found; } /** diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index bb80aaaaa5a..68e654a8cd5 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -136,7 +136,7 @@ static void sequencer_init_preview_region(ARegion *region) static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) { ARegion *region; - ARegion *ar_main; + ARegion *region_main; if (sl) { /* first channels for ipo action nla... */ @@ -205,14 +205,14 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) region->alignment = RGN_ALIGN_TOP; break; case SPACE_SEQ: - ar_main = (ARegion *)lb->first; - for (; ar_main; ar_main = ar_main->next) { - if (ar_main->regiontype == RGN_TYPE_WINDOW) { + region_main = (ARegion *)lb->first; + for (; region_main; region_main = region_main->next) { + if (region_main->regiontype == RGN_TYPE_WINDOW) { break; } } region = MEM_callocN(sizeof(ARegion), "preview area for sequencer"); - BLI_insertlinkbefore(lb, ar_main, region); + BLI_insertlinkbefore(lb, region_main, region); sequencer_init_preview_region(region); break; case SPACE_VIEW3D: @@ -1235,7 +1235,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { ARegion *region; - ARegion *ar_main; + ARegion *region_main; ListBase *regionbase; SpaceSeq *sseq = (SpaceSeq *)sl; @@ -1253,14 +1253,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) sseq->mainb = SEQ_DRAW_IMG_IMBUF; } - ar_main = (ARegion *)regionbase->first; - for (; ar_main; ar_main = ar_main->next) { - if (ar_main->regiontype == RGN_TYPE_WINDOW) { + region_main = (ARegion *)regionbase->first; + for (; region_main; region_main = region_main->next) { + if (region_main->regiontype == RGN_TYPE_WINDOW) { break; } } region = MEM_callocN(sizeof(ARegion), "preview area for sequencer"); - BLI_insertlinkbefore(regionbase, ar_main, region); + BLI_insertlinkbefore(regionbase, region_main, region); sequencer_init_preview_region(region); } } @@ -1433,7 +1433,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { - ARegion *ar_preview; + ARegion *region_preview; ListBase *regionbase; if (sl == sa->spacedata.first) { @@ -1443,14 +1443,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) regionbase = &sl->regionbase; } - ar_preview = (ARegion *)regionbase->first; - for (; ar_preview; ar_preview = ar_preview->next) { - if (ar_preview->regiontype == RGN_TYPE_PREVIEW) { + region_preview = (ARegion *)regionbase->first; + for (; region_preview; region_preview = region_preview->next) { + if (region_preview->regiontype == RGN_TYPE_PREVIEW) { break; } } - if (ar_preview && (ar_preview->regiontype == RGN_TYPE_PREVIEW)) { - sequencer_init_preview_region(ar_preview); + if (region_preview && (region_preview->regiontype == RGN_TYPE_PREVIEW)) { + sequencer_init_preview_region(region_preview); } } } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index b3c0473e173..ac0c0c3da39 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -609,9 +609,9 @@ static void do_versions_remove_region(ListBase *regionbase, ARegion *region) static void do_versions_remove_regions_by_type(ListBase *regionbase, int regiontype) { - ARegion *region, *ar_next; - for (region = regionbase->first; region; region = ar_next) { - ar_next = region->next; + ARegion *region, *region_next; + for (region = regionbase->first; region; region = region_next) { + region_next = region->next; if (region->regiontype == regiontype) { do_versions_remove_region(regionbase, region); } @@ -2934,9 +2934,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; - ARegion *ar_header = do_versions_find_region_or_null(regionbase, RGN_TYPE_HEADER); + ARegion *region_header = do_versions_find_region_or_null(regionbase, RGN_TYPE_HEADER); - if (!ar_header) { + if (!region_header) { /* Headers should always be first in the region list, except if there's also a * tool-header. These were only introduced in later versions though, so should be * fine to always insert headers first. */ @@ -2959,16 +2959,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_PROPERTIES) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; ARegion *region = MEM_callocN(sizeof(ARegion), "navigation bar for properties"); - ARegion *ar_header = NULL; + ARegion *region_header = NULL; - for (ar_header = regionbase->first; ar_header; ar_header = ar_header->next) { - if (ar_header->regiontype == RGN_TYPE_HEADER) { + for (region_header = regionbase->first; region_header; + region_header = region_header->next) { + if (region_header->regiontype == RGN_TYPE_HEADER) { break; } } - BLI_assert(ar_header); + BLI_assert(region_header); - BLI_insertlinkafter(regionbase, ar_header, region); + BLI_insertlinkafter(regionbase, region_header, region); region->regiontype = RGN_TYPE_NAV_BAR; region->alignment = RGN_ALIGN_LEFT; @@ -3468,13 +3469,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!execute_region) { ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase; - ARegion *ar_navbar = BKE_spacedata_find_region_type(sl, area, RGN_TYPE_NAV_BAR); + ARegion *region_navbar = BKE_spacedata_find_region_type(sl, area, RGN_TYPE_NAV_BAR); execute_region = MEM_callocN(sizeof(ARegion), "execute region for properties"); - BLI_assert(ar_navbar); + BLI_assert(region_navbar); - BLI_insertlinkafter(regionbase, ar_navbar, execute_region); + BLI_insertlinkafter(regionbase, region_navbar, execute_region); execute_region->regiontype = RGN_TYPE_EXECUTE; execute_region->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; @@ -3711,8 +3712,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARegion *region = do_versions_add_region(RGN_TYPE_FOOTER, "footer for text"); region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP : RGN_ALIGN_BOTTOM; - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - BLI_insertlinkafter(regionbase, ar_header, region); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + BLI_insertlinkafter(regionbase, region_header, region); } } } @@ -3804,8 +3805,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) region = do_versions_add_region(RGN_TYPE_TOOL_HEADER, "tool header"); region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - BLI_insertlinkbefore(regionbase, ar_header, region); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + BLI_insertlinkbefore(regionbase, region_header, region); /* Hide by default, enable for painting workspaces (startup only). */ region->flag |= RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER; } @@ -4136,24 +4137,25 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_FILE) { SpaceFile *sfile = (SpaceFile *)sl; ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; - ARegion *ar_ui = do_versions_find_region(regionbase, RGN_TYPE_UI); - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - ARegion *ar_toolprops = do_versions_find_region_or_null(regionbase, - RGN_TYPE_TOOL_PROPS); + ARegion *region_ui = do_versions_find_region(regionbase, RGN_TYPE_UI); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + ARegion *region_toolprops = do_versions_find_region_or_null(regionbase, + RGN_TYPE_TOOL_PROPS); /* Reinsert UI region so that it spawns entire area width */ - BLI_remlink(regionbase, ar_ui); - BLI_insertlinkafter(regionbase, ar_header, ar_ui); + BLI_remlink(regionbase, region_ui); + BLI_insertlinkafter(regionbase, region_header, region_ui); - ar_ui->flag |= RGN_FLAG_DYNAMIC_SIZE; + region_ui->flag |= RGN_FLAG_DYNAMIC_SIZE; - if (ar_toolprops && (ar_toolprops->alignment == (RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV))) { + if (region_toolprops && + (region_toolprops->alignment == (RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV))) { SpaceType *stype = BKE_spacetype_from_id(sl->spacetype); /* Remove empty region at old location. */ BLI_assert(sfile->op == NULL); - BKE_area_region_free(stype, ar_toolprops); - BLI_freelinkN(regionbase, ar_toolprops); + BKE_area_region_free(stype, region_toolprops); + BLI_freelinkN(regionbase, region_toolprops); } if (sfile->params) { @@ -4244,24 +4246,25 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } else if (sl->spacetype == SPACE_FILE) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; - ARegion *ar_tools = do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOLS); - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + ARegion *region_tools = do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOLS); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - if (ar_tools) { - ARegion *ar_next = ar_tools->next; + if (region_tools) { + ARegion *region_next = region_tools->next; /* We temporarily had two tools regions, get rid of the second one. */ - if (ar_next && ar_next->regiontype == RGN_TYPE_TOOLS) { - do_versions_remove_region(regionbase, ar_next); + if (region_next && region_next->regiontype == RGN_TYPE_TOOLS) { + do_versions_remove_region(regionbase, region_next); } - BLI_remlink(regionbase, ar_tools); - BLI_insertlinkafter(regionbase, ar_header, ar_tools); + BLI_remlink(regionbase, region_tools); + BLI_insertlinkafter(regionbase, region_header, region_tools); } else { - ar_tools = do_versions_add_region(RGN_TYPE_TOOLS, "versioning file tools region"); - BLI_insertlinkafter(regionbase, ar_header, ar_tools); - ar_tools->alignment = RGN_ALIGN_LEFT; + region_tools = do_versions_add_region(RGN_TYPE_TOOLS, + "versioning file tools region"); + BLI_insertlinkafter(regionbase, region_header, region_tools); + region_tools->alignment = RGN_ALIGN_LEFT; } } } diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 0785b0e97f7..7430f491d91 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -184,7 +184,7 @@ void ED_area_tag_refresh(ScrArea *sa); void ED_area_do_refresh(struct bContext *C, ScrArea *sa); struct AZone *ED_area_azones_update(ScrArea *sa, const int mouse_xy[]); void ED_area_status_text(ScrArea *sa, const char *str); -void ED_area_newspace(struct bContext *C, ScrArea *sa, int type, const bool skip_ar_exit); +void ED_area_newspace(struct bContext *C, ScrArea *sa, int type, const bool skip_region_exit); void ED_area_prevspace(struct bContext *C, ScrArea *sa); void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2); int ED_area_headersize(void); @@ -442,7 +442,7 @@ bool ED_region_overlap_isect_xy_with_margin(const ARegion *region, const int event_xy[2], const int margin); -bool ED_region_panel_category_gutter_calc_rect(const ARegion *region, rcti *r_ar_gutter); +bool ED_region_panel_category_gutter_calc_rect(const ARegion *region, rcti *r_region_gutter); bool ED_region_panel_category_gutter_isect_xy(const ARegion *region, const int event_xy[2]); bool ED_region_contains_xy(const struct ARegion *region, const int event_xy[2]); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index bb065ee0008..86ad35cfa9f 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -560,10 +560,10 @@ bool edge_inside_circle(const float cent[2], struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); bool ED_view3d_context_user_region(struct bContext *C, struct View3D **r_v3d, - struct ARegion **r_ar); + struct ARegion **r_region); bool ED_view3d_area_user_region(const struct ScrArea *sa, const struct View3D *v3d, - struct ARegion **r_ar); + struct ARegion **r_region); bool ED_operator_rv3d_user_region_poll(struct bContext *C); void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d); diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c index 93599b8727a..bf118481be2 100644 --- a/source/blender/editors/interface/interface_eyedropper_datablock.c +++ b/source/blender/editors/interface/interface_eyedropper_datablock.c @@ -155,7 +155,7 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int ScrArea *sa = BKE_screen_find_area_xy(screen, -1, mx, my); ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); ddr->name[0] = '\0'; @@ -208,7 +208,7 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int } CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } /* sets the ID, returns success */ diff --git a/source/blender/editors/interface/interface_eyedropper_depth.c b/source/blender/editors/interface/interface_eyedropper_depth.c index a5e60adec55..26a6109e8cf 100644 --- a/source/blender/editors/interface/interface_eyedropper_depth.c +++ b/source/blender/editors/interface/interface_eyedropper_depth.c @@ -160,7 +160,7 @@ static void depthdropper_depth_sample_pt( Scene *scene = CTX_data_scene(C); ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); ddr->name[0] = '\0'; @@ -209,7 +209,7 @@ static void depthdropper_depth_sample_pt( } CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } /* sets the sample depth RGB, maintaining A */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index d378613c035..61c59643bcd 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1874,7 +1874,7 @@ static bool ui_but_drag_init(bContext *C, #ifdef USE_DRAG_TOGGLE if (ui_drag_toggle_but_is_supported(but)) { uiDragToggleHandle *drag_info = MEM_callocN(sizeof(*drag_info), __func__); - ARegion *ar_prev; + ARegion *region_prev; /* call here because regular mouse-up event wont run, * typically 'button_activate_exit()' handles this */ @@ -1887,7 +1887,7 @@ static bool ui_but_drag_init(bContext *C, copy_v2_v2_int(drag_info->xy_last, &event->x); /* needed for toggle drag on popups */ - ar_prev = CTX_wm_region(C); + region_prev = CTX_wm_region(C); CTX_wm_region_set(C, data->region); WM_event_add_ui_handler(C, @@ -1897,7 +1897,7 @@ static bool ui_but_drag_init(bContext *C, drag_info, WM_HANDLER_BLOCKING); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); /* Initialize alignment for single row/column regions, * otherwise we use the relative position of the first other button dragged over. */ @@ -1906,13 +1906,13 @@ static bool ui_but_drag_init(bContext *C, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER)) { - const int ar_alignment = RGN_ALIGN_ENUM_FROM_MASK(data->region->alignment); + const int region_alignment = RGN_ALIGN_ENUM_FROM_MASK(data->region->alignment); int lock_axis = -1; - if (ELEM(ar_alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) { + if (ELEM(region_alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) { lock_axis = 0; } - else if (ELEM(ar_alignment, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) { + else if (ELEM(region_alignment, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) { lock_axis = 1; } if (lock_axis != -1) { @@ -8326,16 +8326,16 @@ void UI_context_active_but_prop_handle(bContext *C) wmOperator *UI_context_active_operator_get(const struct bContext *C) { - ARegion *ar_ctx = CTX_wm_region(C); + ARegion *region_ctx = CTX_wm_region(C); uiBlock *block; /* background mode */ - if (ar_ctx == NULL) { + if (region_ctx == NULL) { return NULL; } /* scan active regions ui */ - for (block = ar_ctx->uiblocks.first; block; block = block->next) { + for (block = region_ctx->uiblocks.first; block; block = block->next) { if (block->ui_operator) { return block->ui_operator; } @@ -8347,7 +8347,7 @@ wmOperator *UI_context_active_operator_get(const struct bContext *C) ARegion *region; for (region = sc->regionbase.first; region; region = region->next) { - if (region == ar_ctx) { + if (region == region_ctx) { continue; } for (block = region->uiblocks.first; block; block = block->next) { @@ -8470,10 +8470,10 @@ void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but) event.customdata = but; event.customdatafree = false; - ARegion *ar_ctx = CTX_wm_region(C); + ARegion *region_ctx = CTX_wm_region(C); CTX_wm_region_set(C, region); ui_do_button(C, but->block, but, &event); - CTX_wm_region_set(C, ar_ctx); + CTX_wm_region_set(C, region_ctx); } /** diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index b418cb4a1ac..5a4a549ea3e 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1622,11 +1622,11 @@ static int ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *ev { bScreen *sc = CTX_wm_screen(C); const bool skip_depressed = RNA_boolean_get(op->ptr, "skip_depressed"); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); ARegion *region = sc ? BKE_screen_find_region_xy(sc, RGN_TYPE_ANY, event->x, event->y) : NULL; if (region == NULL) { - region = ar_prev; + region = region_prev; } if (region == NULL) { @@ -1635,7 +1635,7 @@ static int ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *ev CTX_wm_region_set(C, region); uiBut *but = UI_context_active_but_get(C); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); if (but == NULL) { return OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c index f77739b5114..e0fc7a3ee71 100644 --- a/source/blender/editors/interface/interface_region_hud.c +++ b/source/blender/editors/interface/interface_region_hud.c @@ -75,14 +75,14 @@ static bool last_redo_poll(const bContext *C, short region_type) * wrong context. */ ScrArea *sa = CTX_wm_area(C); - ARegion *ar_op = (region_type != -1) ? BKE_area_find_region_type(sa, region_type) : NULL; - ARegion *ar_prev = CTX_wm_region(C); - CTX_wm_region_set((bContext *)C, ar_op); + ARegion *region_op = (region_type != -1) ? BKE_area_find_region_type(sa, region_type) : NULL; + ARegion *region_prev = CTX_wm_region(C); + CTX_wm_region_set((bContext *)C, region_op); if (WM_operator_repeat_check(C, op) && WM_operator_check_ui_empty(op->type) == false) { success = WM_operator_poll((bContext *)C, op->type); } - CTX_wm_region_set((bContext *)C, ar_prev); + CTX_wm_region_set((bContext *)C, region_prev); } return success; } @@ -253,9 +253,9 @@ ARegionType *ED_area_type_hud(int space_type) static ARegion *hud_region_add(ScrArea *sa) { ARegion *region = MEM_callocN(sizeof(ARegion), "area region"); - ARegion *ar_win = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - if (ar_win) { - BLI_insertlinkbefore(&sa->regionbase, ar_win, region); + ARegion *region_win = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + if (region_win) { + BLI_insertlinkbefore(&sa->regionbase, region_win, region); } else { BLI_addtail(&sa->regionbase, region); @@ -265,10 +265,10 @@ static ARegion *hud_region_add(ScrArea *sa) region->overlap = true; region->flag |= RGN_FLAG_DYNAMIC_SIZE; - if (ar_win) { + if (region_win) { float x, y; - UI_view2d_scroller_size_get(&ar_win->v2d, &x, &y); + UI_view2d_scroller_size_get(®ion_win->v2d, &x, &y); region->runtime.offset_x = x; region->runtime.offset_y = y; } @@ -316,9 +316,9 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) bool init = false; bool was_hidden = region == NULL || region->visible == false; - ARegion *ar_op = CTX_wm_region(C); - BLI_assert((ar_op == NULL) || (ar_op->regiontype != RGN_TYPE_HUD)); - if (!last_redo_poll(C, ar_op ? ar_op->regiontype : -1)) { + ARegion *region_op = CTX_wm_region(C); + BLI_assert((region_op == NULL) || (region_op->regiontype != RGN_TYPE_HUD)); + if (!last_redo_poll(C, region_op ? region_op->regiontype : -1)) { if (region) { ED_region_tag_redraw(region); hud_region_hide(region); @@ -350,8 +350,8 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) hrd = MEM_callocN(sizeof(*hrd), __func__); region->regiondata = hrd; } - if (ar_op) { - hrd->regionid = ar_op->regiontype; + if (region_op) { + hrd->regionid = region_op->regiontype; } else { hrd->regionid = -1; @@ -380,7 +380,7 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) /* We shouldn't need to do this every time :S */ /* XXX, this is evil! - it also makes the menu show on first draw. :( */ if (region->visible) { - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); CTX_wm_region_set((bContext *)C, region); hud_region_layout(C, region); if (was_hidden) { @@ -391,7 +391,7 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) .ymax = region->winy, }; } - CTX_wm_region_set((bContext *)C, ar_prev); + CTX_wm_region_set((bContext *)C, region_prev); } region->visible = !((region->flag & RGN_FLAG_HIDDEN) || (region->flag & RGN_FLAG_TOO_SMALL)); diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index ba9a5026ce3..7e32a91d08d 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -526,7 +526,7 @@ static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle) { wmWindow *ctx_win = CTX_wm_window(C); ScrArea *ctx_sa = CTX_wm_area(C); - ARegion *ctx_ar = CTX_wm_region(C); + ARegion *ctx_region = CTX_wm_region(C); wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = ctx_win; @@ -551,7 +551,7 @@ static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle) /* Reset context (area and region were NULL'ed when chaning context window). */ CTX_wm_window_set(C, ctx_win); CTX_wm_area_set(C, ctx_sa); - CTX_wm_region_set(C, ctx_ar); + CTX_wm_region_set(C, ctx_region); /* reset to region cursor (only if there's not another menu open) */ if (BLI_listbase_is_empty(&sc->regionbase)) { diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 56ea59c1d6e..efa98c358df 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2076,9 +2076,9 @@ void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2) } /** - * \param skip_ar_exit: Skip calling area exit callback. Set for opening temp spaces. + * \param skip_region_exit: Skip calling area exit callback. Set for opening temp spaces. */ -void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exit) +void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region_exit) { wmWindow *win = CTX_wm_window(C); @@ -2104,14 +2104,14 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi /* in some cases (opening temp space) we don't want to * call area exit callback, so we temporarily unset it */ - if (skip_ar_exit && sa->type) { + if (skip_region_exit && sa->type) { sa->type->exit = NULL; } ED_area_exit(C, sa); /* restore old area exit callback */ - if (skip_ar_exit && sa->type) { + if (skip_region_exit && sa->type) { sa->type->exit = sa_exit; } diff --git a/source/blender/editors/screen/area_query.c b/source/blender/editors/screen/area_query.c index 739f1b93e07..d569e56e11b 100644 --- a/source/blender/editors/screen/area_query.c +++ b/source/blender/editors/screen/area_query.c @@ -73,19 +73,19 @@ bool ED_region_overlap_isect_any_xy(const ScrArea *area, const int event_xy[2]) return false; } -bool ED_region_panel_category_gutter_calc_rect(const ARegion *region, rcti *r_ar_gutter) +bool ED_region_panel_category_gutter_calc_rect(const ARegion *region, rcti *r_region_gutter) { - *r_ar_gutter = region->winrct; + *r_region_gutter = region->winrct; if (UI_panel_category_is_visible(region)) { const int category_tabs_width = round_fl_to_int(UI_view2d_scale_get_x(®ion->v2d) * UI_PANEL_CATEGORY_MARGIN_WIDTH); const int alignment = RGN_ALIGN_ENUM_FROM_MASK(region->alignment); if (alignment == RGN_ALIGN_LEFT) { - r_ar_gutter->xmax = r_ar_gutter->xmin + category_tabs_width; + r_region_gutter->xmax = r_region_gutter->xmin + category_tabs_width; } else if (alignment == RGN_ALIGN_RIGHT) { - r_ar_gutter->xmin = r_ar_gutter->xmax - category_tabs_width; + r_region_gutter->xmin = r_region_gutter->xmax - category_tabs_width; } else { BLI_assert(!"Unsupported alignment"); @@ -97,9 +97,9 @@ bool ED_region_panel_category_gutter_calc_rect(const ARegion *region, rcti *r_ar bool ED_region_panel_category_gutter_isect_xy(const ARegion *region, const int event_xy[2]) { - rcti ar_gutter; - if (ED_region_panel_category_gutter_calc_rect(region, &ar_gutter)) { - return BLI_rcti_isect_pt_v(&ar_gutter, event_xy); + rcti region_gutter; + if (ED_region_panel_category_gutter_calc_rect(region, ®ion_gutter)) { + return BLI_rcti_isect_pt_v(®ion_gutter, event_xy); } return false; } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 0151a0fcb0d..01a30f7d6a4 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -687,7 +687,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) ScrArea *sa = NULL; ARegion *region; - ARegion *ar_prev = scr->active_region; + ARegion *region_prev = scr->active_region; ED_screen_areas_iter(win, scr, area_iter) { @@ -714,7 +714,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) } /* Check for redraw headers. */ - if (ar_prev != scr->active_region) { + if (region_prev != scr->active_region) { ED_screen_areas_iter(win, scr, area_iter) { @@ -723,20 +723,20 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) for (region = area_iter->regionbase.first; region; region = region->next) { /* Call old area's deactivate if assigned. */ - if (region == ar_prev && area_iter->type->deactivate) { + if (region == region_prev && area_iter->type->deactivate) { area_iter->type->deactivate(area_iter); } - if (region == ar_prev && region != scr->active_region) { - wmGizmoMap *gzmap = ar_prev->gizmo_map; + if (region == region_prev && region != scr->active_region) { + wmGizmoMap *gzmap = region_prev->gizmo_map; if (gzmap) { if (WM_gizmo_highlight_set(gzmap, NULL)) { - ED_region_tag_redraw_no_rebuild(ar_prev); + ED_region_tag_redraw_no_rebuild(region_prev); } } } - if (region == ar_prev || region == scr->active_region) { + if (region == region_prev || region == scr->active_region) { do_draw = true; } } @@ -758,9 +758,9 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) } else { /* Notifier invokes freeing the buttons... causing a bit too much redraws. */ - region_cursor_set_ex(win, sa, scr->active_region, ar_prev != scr->active_region); + region_cursor_set_ex(win, sa, scr->active_region, region_prev != scr->active_region); - if (ar_prev != scr->active_region) { + if (region_prev != scr->active_region) { /* This used to be a notifier, but needs to be done immediate * because it can undo setting the right button as active due * to delayed notifier handling. */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index ae8dd829d8d..5eb676cd25c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2641,11 +2641,11 @@ static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd) if ((rmd->region->flag & RGN_FLAG_HIDDEN) == 0) { if (rmd->region->regiontype == RGN_TYPE_HEADER) { - ARegion *ar_tool_header = BKE_area_find_region_type(rmd->sa, RGN_TYPE_TOOL_HEADER); - if (ar_tool_header != NULL) { - if ((ar_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER) == 0 && - (ar_tool_header->flag & RGN_FLAG_HIDDEN) != 0) { - region_toggle_hidden(C, ar_tool_header, 0); + ARegion *region_tool_header = BKE_area_find_region_type(rmd->sa, RGN_TYPE_TOOL_HEADER); + if (region_tool_header != NULL) { + if ((region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER) == 0 && + (region_tool_header->flag & RGN_FLAG_HIDDEN) != 0) { + region_toggle_hidden(C, region_tool_header, 0); } } } @@ -3848,17 +3848,17 @@ static int region_quadview_exec(bContext *C, wmOperator *op) region->alignment = 0; if (sa->spacetype == SPACE_VIEW3D) { - ARegion *ar_iter; + ARegion *region_iter; RegionView3D *rv3d = region->regiondata; /* if this is a locked view, use settings from 'User' view */ if (rv3d->viewlock) { View3D *v3d_user; - ARegion *ar_user; + ARegion *region_user; - if (ED_view3d_context_user_region(C, &v3d_user, &ar_user)) { - if (region != ar_user) { - SWAP(void *, region->regiondata, ar_user->regiondata); + if (ED_view3d_context_user_region(C, &v3d_user, ®ion_user)) { + if (region != region_user) { + SWAP(void *, region->regiondata, region_user->regiondata); rv3d = region->regiondata; } } @@ -3869,9 +3869,9 @@ static int region_quadview_exec(bContext *C, wmOperator *op) rv3d->rflag &= ~RV3D_CLIPPING; /* Accumulate locks, in case they're mixed. */ - for (ar_iter = sa->regionbase.first; ar_iter; ar_iter = ar_iter->next) { - if (ar_iter->regiontype == RGN_TYPE_WINDOW) { - RegionView3D *rv3d_iter = ar_iter->regiondata; + for (region_iter = sa->regionbase.first; region_iter; region_iter = region_iter->next) { + if (region_iter->regiontype == RGN_TYPE_WINDOW) { + RegionView3D *rv3d_iter = region_iter->regiondata; rv3d->viewlock_quad |= rv3d_iter->viewlock; } } @@ -4140,9 +4140,9 @@ void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UN uiItemR(layout, &ptr, "show_region_header", 0, IFACE_("Show Header"), ICON_NONE); } - ARegion *ar_header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + ARegion *region_header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); uiLayout *col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, (ar_header->flag & RGN_FLAG_HIDDEN) == 0); + uiLayoutSetActive(col, (region_header->flag & RGN_FLAG_HIDDEN) == 0); if (BKE_area_find_region_type(sa, RGN_TYPE_TOOL_HEADER)) { uiItemR(col, &ptr, "show_region_tool_header", 0, IFACE_("Show Tool Settings"), ICON_NONE); @@ -5070,7 +5070,7 @@ static void SCREEN_OT_delete(wmOperatorType *ot) typedef struct RegionAlphaInfo { ScrArea *sa; - ARegion *region, *child_ar; /* other region */ + ARegion *region, *child_region; /* other region */ int hidden; } RegionAlphaInfo; @@ -5107,8 +5107,8 @@ static void region_blend_end(bContext *C, ARegion *region, const bool is_running /* always send redraw */ ED_region_tag_redraw(region); - if (rgi->child_ar) { - ED_region_tag_redraw(rgi->child_ar); + if (rgi->child_region) { + ED_region_tag_redraw(rgi->child_region); } /* if running timer was hiding, the flag toggle went wrong */ @@ -5159,7 +5159,7 @@ void ED_region_visibility_change_update_animated(bContext *C, ScrArea *sa, ARegi if (region->next) { if (region->next->alignment & RGN_SPLIT_PREV) { - rgi->child_ar = region->next; + rgi->child_region = region->next; } } @@ -5183,8 +5183,8 @@ static int region_blend_invoke(bContext *C, wmOperator *UNUSED(op), const wmEven /* always send redraws */ ED_region_tag_redraw(rgi->region); - if (rgi->child_ar) { - ED_region_tag_redraw(rgi->child_ar); + if (rgi->child_region) { + ED_region_tag_redraw(rgi->child_region); } /* end timer? */ diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index fede8ce97ca..8d4870f5dd8 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -9275,7 +9275,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) /* Set context to 3D view. */ ScrArea *prev_sa = CTX_wm_area(C); - ARegion *prev_ar = CTX_wm_region(C); + ARegion *prev_region = CTX_wm_region(C); CTX_wm_area_set(C, sa); CTX_wm_region_set(C, region); @@ -9295,7 +9295,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) case SAMPLE_DETAIL_DYNTOPO: if (BKE_pbvh_type(ss->pbvh) != PBVH_BMESH) { CTX_wm_area_set(C, prev_sa); - CTX_wm_region_set(C, prev_ar); + CTX_wm_region_set(C, prev_region); return OPERATOR_CANCELLED; } sample_detail_dyntopo(C, &vc, region, mx, my); @@ -9303,7 +9303,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) case SAMPLE_DETAIL_VOXEL: if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { CTX_wm_area_set(C, prev_sa); - CTX_wm_region_set(C, prev_ar); + CTX_wm_region_set(C, prev_region); return OPERATOR_CANCELLED; } sample_detail_voxel(C, &vc, mx, my); @@ -9312,7 +9312,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) /* Restore context. */ CTX_wm_area_set(C, prev_sa); - CTX_wm_region_set(C, prev_ar); + CTX_wm_region_set(C, prev_region); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 4b9c872ffce..82fb429d36c 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -645,11 +645,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa) wmWindow *window = CTX_wm_window(C); Scene *scene = CTX_data_scene(C); SpaceClip *sc = (SpaceClip *)sa->spacedata.first; - ARegion *ar_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - ARegion *ar_tools = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); - ARegion *ar_preview = ED_clip_has_preview_region(C, sa); - ARegion *ar_properties = ED_clip_has_properties_region(sa); - ARegion *ar_channels = ED_clip_has_channels_region(sa); + ARegion *region_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ARegion *region_tools = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); + ARegion *region_preview = ED_clip_has_preview_region(C, sa); + ARegion *region_properties = ED_clip_has_properties_region(sa); + ARegion *region_channels = ED_clip_has_channels_region(sa); bool main_visible = false, preview_visible = false, tools_visible = false; bool properties_visible = false, channels_visible = false; bool view_changed = false; @@ -669,7 +669,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa) properties_visible = false; channels_visible = false; - reinit_preview_region(C, ar_preview); + reinit_preview_region(C, region_preview); break; case SC_VIEW_DOPESHEET: main_visible = false; @@ -678,128 +678,128 @@ static void clip_refresh(const bContext *C, ScrArea *sa) properties_visible = false; channels_visible = true; - reinit_preview_region(C, ar_preview); + reinit_preview_region(C, region_preview); break; } if (main_visible) { - if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag &= ~RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; + if (region_main && (region_main->flag & RGN_FLAG_HIDDEN)) { + region_main->flag &= ~RGN_FLAG_HIDDEN; + region_main->v2d.flag &= ~V2D_IS_INITIALISED; view_changed = true; } - if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { - ar_main->alignment = RGN_ALIGN_NONE; + if (region_main && region_main->alignment != RGN_ALIGN_NONE) { + region_main->alignment = RGN_ALIGN_NONE; view_changed = true; } } else { - if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag |= RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_main->handlers); + if (region_main && !(region_main->flag & RGN_FLAG_HIDDEN)) { + region_main->flag |= RGN_FLAG_HIDDEN; + region_main->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_main->handlers); view_changed = true; } - if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { - ar_main->alignment = RGN_ALIGN_NONE; + if (region_main && region_main->alignment != RGN_ALIGN_NONE) { + region_main->alignment = RGN_ALIGN_NONE; view_changed = true; } } if (properties_visible) { - if (ar_properties && (ar_properties->flag & RGN_FLAG_HIDDEN)) { - ar_properties->flag &= ~RGN_FLAG_HIDDEN; - ar_properties->v2d.flag &= ~V2D_IS_INITIALISED; + if (region_properties && (region_properties->flag & RGN_FLAG_HIDDEN)) { + region_properties->flag &= ~RGN_FLAG_HIDDEN; + region_properties->v2d.flag &= ~V2D_IS_INITIALISED; view_changed = true; } - if (ar_properties && ar_properties->alignment != RGN_ALIGN_RIGHT) { - ar_properties->alignment = RGN_ALIGN_RIGHT; + if (region_properties && region_properties->alignment != RGN_ALIGN_RIGHT) { + region_properties->alignment = RGN_ALIGN_RIGHT; view_changed = true; } } else { - if (ar_properties && !(ar_properties->flag & RGN_FLAG_HIDDEN)) { - ar_properties->flag |= RGN_FLAG_HIDDEN; - ar_properties->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_properties->handlers); + if (region_properties && !(region_properties->flag & RGN_FLAG_HIDDEN)) { + region_properties->flag |= RGN_FLAG_HIDDEN; + region_properties->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_properties->handlers); view_changed = true; } - if (ar_properties && ar_properties->alignment != RGN_ALIGN_NONE) { - ar_properties->alignment = RGN_ALIGN_NONE; + if (region_properties && region_properties->alignment != RGN_ALIGN_NONE) { + region_properties->alignment = RGN_ALIGN_NONE; view_changed = true; } } if (tools_visible) { - if (ar_tools && (ar_tools->flag & RGN_FLAG_HIDDEN)) { - ar_tools->flag &= ~RGN_FLAG_HIDDEN; - ar_tools->v2d.flag &= ~V2D_IS_INITIALISED; + if (region_tools && (region_tools->flag & RGN_FLAG_HIDDEN)) { + region_tools->flag &= ~RGN_FLAG_HIDDEN; + region_tools->v2d.flag &= ~V2D_IS_INITIALISED; view_changed = true; } - if (ar_tools && ar_tools->alignment != RGN_ALIGN_LEFT) { - ar_tools->alignment = RGN_ALIGN_LEFT; + if (region_tools && region_tools->alignment != RGN_ALIGN_LEFT) { + region_tools->alignment = RGN_ALIGN_LEFT; view_changed = true; } } else { - if (ar_tools && !(ar_tools->flag & RGN_FLAG_HIDDEN)) { - ar_tools->flag |= RGN_FLAG_HIDDEN; - ar_tools->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_tools->handlers); + if (region_tools && !(region_tools->flag & RGN_FLAG_HIDDEN)) { + region_tools->flag |= RGN_FLAG_HIDDEN; + region_tools->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_tools->handlers); view_changed = true; } - if (ar_tools && ar_tools->alignment != RGN_ALIGN_NONE) { - ar_tools->alignment = RGN_ALIGN_NONE; + if (region_tools && region_tools->alignment != RGN_ALIGN_NONE) { + region_tools->alignment = RGN_ALIGN_NONE; view_changed = true; } } if (preview_visible) { - if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag &= ~RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - ar_preview->v2d.cur = ar_preview->v2d.tot; + if (region_preview && (region_preview->flag & RGN_FLAG_HIDDEN)) { + region_preview->flag &= ~RGN_FLAG_HIDDEN; + region_preview->v2d.flag &= ~V2D_IS_INITIALISED; + region_preview->v2d.cur = region_preview->v2d.tot; view_changed = true; } - if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { - ar_preview->alignment = RGN_ALIGN_NONE; + if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) { + region_preview->alignment = RGN_ALIGN_NONE; view_changed = true; } } else { - if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag |= RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_preview->handlers); + if (region_preview && !(region_preview->flag & RGN_FLAG_HIDDEN)) { + region_preview->flag |= RGN_FLAG_HIDDEN; + region_preview->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_preview->handlers); view_changed = true; } - if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { - ar_preview->alignment = RGN_ALIGN_NONE; + if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) { + region_preview->alignment = RGN_ALIGN_NONE; view_changed = true; } } if (channels_visible) { - if (ar_channels && (ar_channels->flag & RGN_FLAG_HIDDEN)) { - ar_channels->flag &= ~RGN_FLAG_HIDDEN; - ar_channels->v2d.flag &= ~V2D_IS_INITIALISED; + if (region_channels && (region_channels->flag & RGN_FLAG_HIDDEN)) { + region_channels->flag &= ~RGN_FLAG_HIDDEN; + region_channels->v2d.flag &= ~V2D_IS_INITIALISED; view_changed = true; } - if (ar_channels && ar_channels->alignment != RGN_ALIGN_LEFT) { - ar_channels->alignment = RGN_ALIGN_LEFT; + if (region_channels && region_channels->alignment != RGN_ALIGN_LEFT) { + region_channels->alignment = RGN_ALIGN_LEFT; view_changed = true; } } else { - if (ar_channels && !(ar_channels->flag & RGN_FLAG_HIDDEN)) { - ar_channels->flag |= RGN_FLAG_HIDDEN; - ar_channels->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_channels->handlers); + if (region_channels && !(region_channels->flag & RGN_FLAG_HIDDEN)) { + region_channels->flag |= RGN_FLAG_HIDDEN; + region_channels->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_channels->handlers); view_changed = true; } - if (ar_channels && ar_channels->alignment != RGN_ALIGN_NONE) { - ar_channels->alignment = RGN_ALIGN_NONE; + if (region_channels && region_channels->alignment != RGN_ALIGN_NONE) { + region_channels->alignment = RGN_ALIGN_NONE; view_changed = true; } } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index cb574e35422..8c963e32046 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1869,7 +1869,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const w { ScrArea *sa = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); - ARegion *region, *ar_ctx = CTX_wm_region(C); + ARegion *region, *region_ctx = CTX_wm_region(C); const bool is_horizontal = (sfile->layout->flag & FILE_LAYOUT_HOR) != 0; int i; @@ -2033,7 +2033,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const w ED_region_tag_redraw(region); /* and restore context */ - CTX_wm_region_set(C, ar_ctx); + CTX_wm_region_set(C, region_ctx); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 1574dbbeb76..59383626972 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -55,7 +55,7 @@ #include "filelist.h" #include "fsmenu.h" -static ARegion *file_execute_region_ensure(ScrArea *sa, ARegion *ar_prev) +static ARegion *file_execute_region_ensure(ScrArea *sa, ARegion *region_prev) { ARegion *region; @@ -64,7 +64,7 @@ static ARegion *file_execute_region_ensure(ScrArea *sa, ARegion *ar_prev) } region = MEM_callocN(sizeof(ARegion), "execute region for file"); - BLI_insertlinkafter(&sa->regionbase, ar_prev, region); + BLI_insertlinkafter(&sa->regionbase, region_prev, region); region->regiontype = RGN_TYPE_EXECUTE; region->alignment = RGN_ALIGN_BOTTOM; region->flag = RGN_FLAG_DYNAMIC_SIZE; @@ -72,7 +72,7 @@ static ARegion *file_execute_region_ensure(ScrArea *sa, ARegion *ar_prev) return region; } -static ARegion *file_tool_props_region_ensure(ScrArea *sa, ARegion *ar_prev) +static ARegion *file_tool_props_region_ensure(ScrArea *sa, ARegion *region_prev) { ARegion *region; @@ -82,7 +82,7 @@ static ARegion *file_tool_props_region_ensure(ScrArea *sa, ARegion *ar_prev) /* add subdiv level; after execute region */ region = MEM_callocN(sizeof(ARegion), "tool props for file"); - BLI_insertlinkafter(&sa->regionbase, ar_prev, region); + BLI_insertlinkafter(&sa->regionbase, region_prev, region); region->regiontype = RGN_TYPE_TOOL_PROPS; region->alignment = RGN_ALIGN_RIGHT; @@ -232,31 +232,31 @@ static void file_ensure_valid_region_state(bContext *C, SpaceFile *sfile, FileSelectParams *params) { - ARegion *ar_ui = BKE_area_find_region_type(sa, RGN_TYPE_UI); - ARegion *ar_props = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS); - ARegion *ar_execute = BKE_area_find_region_type(sa, RGN_TYPE_EXECUTE); + ARegion *region_ui = BKE_area_find_region_type(sa, RGN_TYPE_UI); + ARegion *region_props = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS); + ARegion *region_execute = BKE_area_find_region_type(sa, RGN_TYPE_EXECUTE); bool needs_init = false; /* To avoid multiple ED_area_initialize() calls. */ /* If there's an file-operation, ensure we have the option and execute region */ - if (sfile->op && (ar_props == NULL)) { - ar_execute = file_execute_region_ensure(sa, ar_ui); - ar_props = file_tool_props_region_ensure(sa, ar_execute); + if (sfile->op && (region_props == NULL)) { + region_execute = file_execute_region_ensure(sa, region_ui); + region_props = file_tool_props_region_ensure(sa, region_execute); if (params->flag & FILE_HIDE_TOOL_PROPS) { - ar_props->flag |= RGN_FLAG_HIDDEN; + region_props->flag |= RGN_FLAG_HIDDEN; } else { - ar_props->flag &= ~RGN_FLAG_HIDDEN; + region_props->flag &= ~RGN_FLAG_HIDDEN; } needs_init = true; } /* If there's _no_ file-operation, ensure we _don't_ have the option and execute region */ - else if ((sfile->op == NULL) && (ar_props != NULL)) { - BLI_assert(ar_execute != NULL); + else if ((sfile->op == NULL) && (region_props != NULL)) { + BLI_assert(region_execute != NULL); - ED_region_remove(C, sa, ar_props); - ED_region_remove(C, sa, ar_execute); + ED_region_remove(C, sa, region_props); + ED_region_remove(C, sa, region_execute); needs_init = true; } diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index 0af94904ba6..34c1958734d 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -62,14 +62,14 @@ void ED_drivers_editor_init(bContext *C, ScrArea *sa) sipo->mode = SIPO_MODE_DRIVERS; /* Show Properties Region (or else the settings can't be edited) */ - ARegion *ar_props = BKE_area_find_region_type(sa, RGN_TYPE_UI); - if (ar_props) { - UI_panel_category_active_set(ar_props, "Drivers"); + ARegion *region_props = BKE_area_find_region_type(sa, RGN_TYPE_UI); + if (region_props) { + UI_panel_category_active_set(region_props, "Drivers"); - ar_props->flag &= ~RGN_FLAG_HIDDEN; + region_props->flag &= ~RGN_FLAG_HIDDEN; /* XXX: Adjust width of this too? */ - ED_region_visibility_change_update(C, sa, ar_props); + ED_region_visibility_change_update(C, sa, region_props); } else { printf("%s: Couldn't find properties region for Drivers Editor - %p\n", __func__, sa); @@ -79,15 +79,15 @@ void ED_drivers_editor_init(bContext *C, ScrArea *sa) /* TODO: Have a way of not resetting this every time? * (e.g. So that switching back and forth between editors doesn't keep jumping?) */ - ARegion *ar_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - if (ar_main) { + ARegion *region_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + if (region_main) { /* XXX: Ideally we recenter based on the range instead... */ - ar_main->v2d.tot.xmin = -2.0f; - ar_main->v2d.tot.ymin = -2.0f; - ar_main->v2d.tot.xmax = 2.0f; - ar_main->v2d.tot.ymax = 2.0f; + region_main->v2d.tot.xmin = -2.0f; + region_main->v2d.tot.ymin = -2.0f; + region_main->v2d.tot.xmax = 2.0f; + region_main->v2d.tot.ymax = 2.0f; - ar_main->v2d.cur = ar_main->v2d.tot; + region_main->v2d.cur = region_main->v2d.tot; } } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 447bf27099d..2cd3f624455 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -223,88 +223,88 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) wmWindowManager *wm = CTX_wm_manager(C); wmWindow *window = CTX_wm_window(C); SpaceSeq *sseq = (SpaceSeq *)sa->spacedata.first; - ARegion *ar_main = sequencer_find_region(sa, RGN_TYPE_WINDOW); - ARegion *ar_preview = sequencer_find_region(sa, RGN_TYPE_PREVIEW); + ARegion *region_main = sequencer_find_region(sa, RGN_TYPE_WINDOW); + ARegion *region_preview = sequencer_find_region(sa, RGN_TYPE_PREVIEW); bool view_changed = false; switch (sseq->view) { case SEQ_VIEW_SEQUENCE: - if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag &= ~RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; + if (region_main && (region_main->flag & RGN_FLAG_HIDDEN)) { + region_main->flag &= ~RGN_FLAG_HIDDEN; + region_main->v2d.flag &= ~V2D_IS_INITIALISED; view_changed = true; } - if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag |= RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_preview->handlers); + if (region_preview && !(region_preview->flag & RGN_FLAG_HIDDEN)) { + region_preview->flag |= RGN_FLAG_HIDDEN; + region_preview->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_preview->handlers); view_changed = true; } - if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { - ar_main->alignment = RGN_ALIGN_NONE; + if (region_main && region_main->alignment != RGN_ALIGN_NONE) { + region_main->alignment = RGN_ALIGN_NONE; view_changed = true; } - if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { - ar_preview->alignment = RGN_ALIGN_NONE; + if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) { + region_preview->alignment = RGN_ALIGN_NONE; view_changed = true; } break; case SEQ_VIEW_PREVIEW: - if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag |= RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_main->handlers); + if (region_main && !(region_main->flag & RGN_FLAG_HIDDEN)) { + region_main->flag |= RGN_FLAG_HIDDEN; + region_main->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext *)C, ®ion_main->handlers); view_changed = true; } - if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag &= ~RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - ar_preview->v2d.cur = ar_preview->v2d.tot; + if (region_preview && (region_preview->flag & RGN_FLAG_HIDDEN)) { + region_preview->flag &= ~RGN_FLAG_HIDDEN; + region_preview->v2d.flag &= ~V2D_IS_INITIALISED; + region_preview->v2d.cur = region_preview->v2d.tot; view_changed = true; } - if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { - ar_main->alignment = RGN_ALIGN_NONE; + if (region_main && region_main->alignment != RGN_ALIGN_NONE) { + region_main->alignment = RGN_ALIGN_NONE; view_changed = true; } - if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { - ar_preview->alignment = RGN_ALIGN_NONE; + if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) { + region_preview->alignment = RGN_ALIGN_NONE; view_changed = true; } break; case SEQ_VIEW_SEQUENCE_PREVIEW: - if (ar_main && ar_preview) { + if (region_main && region_preview) { /* Get available height (without DPI correction). */ const float height = (sa->winy - ED_area_headersize()) / UI_DPI_FAC; /* We reuse hidden region's size, allows to find same layout as before if we just switch * between one 'full window' view and the combined one. This gets lost if we switch to both * 'full window' views before, though... Better than nothing. */ - if (ar_main->flag & RGN_FLAG_HIDDEN) { - ar_main->flag &= ~RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; - ar_preview->sizey = (int)(height - ar_main->sizey); + if (region_main->flag & RGN_FLAG_HIDDEN) { + region_main->flag &= ~RGN_FLAG_HIDDEN; + region_main->v2d.flag &= ~V2D_IS_INITIALISED; + region_preview->sizey = (int)(height - region_main->sizey); view_changed = true; } - if (ar_preview->flag & RGN_FLAG_HIDDEN) { - ar_preview->flag &= ~RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - ar_preview->v2d.cur = ar_preview->v2d.tot; - ar_main->sizey = (int)(height - ar_preview->sizey); + if (region_preview->flag & RGN_FLAG_HIDDEN) { + region_preview->flag &= ~RGN_FLAG_HIDDEN; + region_preview->v2d.flag &= ~V2D_IS_INITIALISED; + region_preview->v2d.cur = region_preview->v2d.tot; + region_main->sizey = (int)(height - region_preview->sizey); view_changed = true; } - if (ar_main->alignment != RGN_ALIGN_NONE) { - ar_main->alignment = RGN_ALIGN_NONE; + if (region_main->alignment != RGN_ALIGN_NONE) { + region_main->alignment = RGN_ALIGN_NONE; view_changed = true; } - if (ar_preview->alignment != RGN_ALIGN_TOP) { - ar_preview->alignment = RGN_ALIGN_TOP; + if (region_preview->alignment != RGN_ALIGN_TOP) { + region_preview->alignment = RGN_ALIGN_TOP; view_changed = true; } /* Final check that both preview and main height are reasonable! */ - if (ar_preview->sizey < 10 || ar_main->sizey < 10 || - ar_preview->sizey + ar_main->sizey > height) { - ar_preview->sizey = (int)(height * 0.4f + 0.5f); - ar_main->sizey = (int)(height - ar_preview->sizey); + if (region_preview->sizey < 10 || region_main->sizey < 10 || + region_preview->sizey + region_main->sizey > height) { + region_preview->sizey = (int)(height * 0.4f + 0.5f); + region_main->sizey = (int)(height - region_preview->sizey); view_changed = true; } } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 13c5bddd3bf..e5f1de7d5eb 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -101,12 +101,12 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) /* ideally would return an rv3d but in some cases the region is needed too * so return that, the caller can then access the region->regiondata */ -bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) +bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region) { ScrArea *sa = CTX_wm_area(C); *r_v3d = NULL; - *r_ar = NULL; + *r_region = NULL; if (sa && sa->spacetype == SPACE_VIEW3D) { ARegion *region = CTX_wm_region(C); @@ -117,11 +117,11 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) if ((region->regiontype == RGN_TYPE_WINDOW) && (rv3d = region->regiondata) && (rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) { *r_v3d = v3d; - *r_ar = region; + *r_region = region; return true; } else { - if (ED_view3d_area_user_region(sa, v3d, r_ar)) { + if (ED_view3d_area_user_region(sa, v3d, r_region)) { *r_v3d = v3d; return true; } @@ -136,11 +136,11 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) * Similar to #ED_view3d_context_user_region() but does not use context. Always performs a lookup. * Also works if \a v3d is not the active space. */ -bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion **r_ar) +bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion **r_region) { RegionView3D *rv3d = NULL; - ARegion *ar_unlock_user = NULL; - ARegion *ar_unlock = NULL; + ARegion *region_unlock_user = NULL; + ARegion *region_unlock = NULL; const ListBase *region_list = (v3d == sa->spacedata.first) ? &sa->regionbase : &v3d->regionbase; BLI_assert(v3d->spacetype == SPACE_VIEW3D); @@ -150,9 +150,9 @@ bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion ** if (region->regiondata && region->regiontype == RGN_TYPE_WINDOW) { rv3d = region->regiondata; if ((rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) { - ar_unlock = region; + region_unlock = region; if (rv3d->persp == RV3D_PERSP || rv3d->persp == RV3D_CAMOB) { - ar_unlock_user = region; + region_unlock_user = region; break; } } @@ -160,13 +160,13 @@ bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion ** } /* camera/perspective view get priority when the active region is locked */ - if (ar_unlock_user) { - *r_ar = ar_unlock_user; + if (region_unlock_user) { + *r_region = region_unlock_user; return true; } - if (ar_unlock) { - *r_ar = ar_unlock; + if (region_unlock) { + *r_region = region_unlock; return true; } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index e650f5581ff..09be73c87d1 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -529,10 +529,10 @@ static void viewops_data_create(bContext *C, negate_v3_v3(rv3d->ofs, dvec); } else { - const float mval_ar_mid[2] = {(float)vod->region->winx / 2.0f, - (float)vod->region->winy / 2.0f}; + const float mval_region_mid[2] = {(float)vod->region->winx / 2.0f, + (float)vod->region->winy / 2.0f}; - ED_view3d_win_to_3d(vod->v3d, vod->region, vod->dyn_ofs, mval_ar_mid, rv3d->ofs); + ED_view3d_win_to_3d(vod->v3d, vod->region, vod->dyn_ofs, mval_region_mid, rv3d->ofs); negate_v3(rv3d->ofs); } negate_v3(vod->dyn_ofs); diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 2637fb6d1db..5db26e26f0b 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -866,7 +866,7 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *region) /* 'clip' is used to know if our clip setting has changed */ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) { - ARegion *ar_sync = NULL; + ARegion *region_sync = NULL; RegionView3D *rv3d = region->regiondata; short viewlock; /* this function copies flags from the first of the 3 other quadview @@ -892,15 +892,15 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) rv3d->rflag &= ~RV3D_BOXCLIP; } - /* use ar_sync so we sync with one of the aligned views below + /* use region_sync so we sync with one of the aligned views below * else the view jumps on changing view settings like 'clip' * since it copies from the perspective view */ - ar_sync = region; + region_sync = region; } } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, ar_sync ? ar_sync : sa->regionbase.last); + view3d_boxview_sync(sa, region_sync ? region_sync : sa->regionbase.last); } /* ensure locked regions have an axis, locked user views don't make much sense */ diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 522d1a15e3f..3dc5b3025aa 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -615,17 +615,18 @@ static void sync_viewport_camera_smoothview(bContext *C, if (v3d->scenelock) { ListBase *lb = (space_link == area->spacedata.first) ? &area->regionbase : &space_link->regionbase; - for (ARegion *other_ar = lb->first; other_ar != NULL; other_ar = other_ar->next) { - if (other_ar->regiontype == RGN_TYPE_WINDOW) { - if (other_ar->regiondata) { - RegionView3D *other_rv3d = other_ar->regiondata; + for (ARegion *other_region = lb->first; other_region != NULL; + other_region = other_region->next) { + if (other_region->regiontype == RGN_TYPE_WINDOW) { + if (other_region->regiondata) { + RegionView3D *other_rv3d = other_region->regiondata; if (other_rv3d->persp == RV3D_CAMOB) { Object *other_camera_old = other_v3d->camera; other_v3d->camera = ob; ED_view3d_lastview_store(other_rv3d); ED_view3d_smooth_view(C, other_v3d, - other_ar, + other_region, smooth_viewtx, &(const V3D_SmoothParams){ .camera_old = other_camera_old, @@ -704,9 +705,9 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op) bool ED_operator_rv3d_user_region_poll(bContext *C) { View3D *v3d_dummy; - ARegion *ar_dummy; + ARegion *region_dummy; - return ED_view3d_context_user_region(C, &v3d_dummy, &ar_dummy); + return ED_view3d_context_user_region(C, &v3d_dummy, ®ion_dummy); } void VIEW3D_OT_object_as_camera(wmOperatorType *ot) diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 123fd5f35da..9db957f8031 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -558,11 +558,11 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op) struct Scene *scene = CTX_data_scene(C); /* keep in sync with logic in view3d_panel_operator_redo() */ - ARegion *ar_orig = CTX_wm_region(C); - ARegion *ar_win = BKE_area_find_region_active_win(CTX_wm_area(C)); + ARegion *region_orig = CTX_wm_region(C); + ARegion *region_win = BKE_area_find_region_active_win(CTX_wm_area(C)); - if (ar_win) { - CTX_wm_region_set(C, ar_win); + if (region_win) { + CTX_wm_region_set(C, region_win); } if ((WM_operator_repeat_check(C, op)) && (WM_operator_poll(C, op->type)) && @@ -585,9 +585,9 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op) if (op->type->check) { if (op->type->check(C, op)) { /* check for popup and re-layout buttons */ - ARegion *ar_menu = CTX_wm_menu(C); - if (ar_menu) { - ED_region_tag_refresh_ui(ar_menu); + ARegion *region_menu = CTX_wm_menu(C); + if (region_menu) { + ED_region_tag_refresh_ui(region_menu); } } } @@ -610,7 +610,7 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op) } /* set region back */ - CTX_wm_region_set(C, ar_orig); + CTX_wm_region_set(C, region_orig); } else { CLOG_WARN(&LOG, "called with NULL 'op'"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index cf515792252..7bff13bf1a6 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -576,31 +576,31 @@ static ScrArea *rna_area_from_space(PointerRNA *ptr) static void area_region_from_regiondata(bScreen *sc, void *regiondata, ScrArea **r_sa, - ARegion **r_ar) + ARegion **r_region) { ScrArea *sa; ARegion *region; *r_sa = NULL; - *r_ar = NULL; + *r_region = NULL; for (sa = sc->areabase.first; sa; sa = sa->next) { for (region = sa->regionbase.first; region; region = region->next) { if (region->regiondata == regiondata) { *r_sa = sa; - *r_ar = region; + *r_region = region; return; } } } } -static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_ar) +static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_region) { bScreen *sc = (bScreen *)ptr->owner_id; void *regiondata = ptr->data; - area_region_from_regiondata(sc, regiondata, r_sa, r_ar); + area_region_from_regiondata(sc, regiondata, r_sa, r_region); } /* -------------------------------------------------------------------- */ @@ -680,9 +680,9 @@ static void rna_Space_show_region_header_set(PointerRNA *ptr, bool value) bool value_for_tool_header = value; if (value == true) { ScrArea *sa = rna_area_from_space(ptr); - ARegion *ar_tool_header = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_HEADER); - if (ar_tool_header != NULL) { - value_for_tool_header = !(ar_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER); + ARegion *region_tool_header = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_HEADER); + if (region_tool_header != NULL) { + value_for_tool_header = !(region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER); } } rna_Space_bool_from_region_flag_set_by_type( diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index ebfdd8a5f6a..b8bee118e3e 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -213,7 +213,7 @@ static void wm_region_test_gizmo_do_draw(bContext *C, gzgroup = gzgroup->next) { if (tag_redraw && (gzgroup->type->flag & WM_GIZMOGROUPTYPE_VR_REDRAWS)) { ScrArea *ctx_sa = CTX_wm_area(C); - ARegion *ctx_ar = CTX_wm_region(C); + ARegion *ctx_region = CTX_wm_region(C); CTX_wm_area_set(C, sa); CTX_wm_region_set(C, region); @@ -224,7 +224,7 @@ static void wm_region_test_gizmo_do_draw(bContext *C, /* Reset. */ CTX_wm_area_set(C, ctx_sa); - CTX_wm_region_set(C, ctx_ar); + CTX_wm_region_set(C, ctx_region); } for (wmGizmo *gz = gzgroup->gizmos.first; gz; gz = gz->next) { @@ -1052,13 +1052,13 @@ void WM_redraw_windows(bContext *C) { wmWindow *win_prev = CTX_wm_window(C); ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); wm_draw_update(C); CTX_wm_window_set(C, win_prev); CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } /** \} */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 1a794e9bf0b..8d7155b5ea8 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -839,7 +839,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca /* FIXME, temp setting window, see other call to UI_popup_menu_reports for why */ wmWindow *win_prev = CTX_wm_window(C); ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); if (win_prev == NULL) { CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); @@ -849,7 +849,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca CTX_wm_window_set(C, win_prev); CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } } @@ -2296,7 +2296,7 @@ static int wm_handler_fileselect_do(bContext *C, * it can be removed without breaking anything but then no linking errors - campbell */ wmWindow *win_prev = CTX_wm_window(C); ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); if (win_prev == NULL) { CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); @@ -2314,7 +2314,7 @@ static int wm_handler_fileselect_do(bContext *C, CTX_wm_window_set(C, win_prev); CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } /* for WM_operator_pystring only, custom report handling is done above */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index c3446a016f1..4a4e373d15e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3201,13 +3201,13 @@ static void redraw_timer_step(bContext *C, CTX_wm_menu_set(C, NULL); for (sa_iter = screen->areabase.first; sa_iter; sa_iter = sa_iter->next) { - ARegion *ar_iter; + ARegion *region_iter; CTX_wm_area_set(C, sa_iter); - for (ar_iter = sa_iter->regionbase.first; ar_iter; ar_iter = ar_iter->next) { - if (ar_iter->visible) { - CTX_wm_region_set(C, ar_iter); - wm_draw_region_test(C, sa_iter, ar_iter); + for (region_iter = sa_iter->regionbase.first; region_iter; region_iter = region_iter->next) { + if (region_iter->visible) { + CTX_wm_region_set(C, region_iter); + wm_draw_region_test(C, sa_iter, region_iter); } } } diff --git a/source/blender/windowmanager/intern/wm_splash_screen.c b/source/blender/windowmanager/intern/wm_splash_screen.c index 9c7ed52b0f9..0a1553cb3e1 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.c +++ b/source/blender/windowmanager/intern/wm_splash_screen.c @@ -71,8 +71,8 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void *arg_u static void wm_block_splash_refreshmenu(bContext *C, void *UNUSED(arg_block), void *UNUSED(arg)) { - ARegion *ar_menu = CTX_wm_menu(C); - ED_region_tag_refresh_ui(ar_menu); + ARegion *region_menu = CTX_wm_menu(C); + ED_region_tag_refresh_ui(region_menu); } static void wm_block_splash_add_label(uiBlock *block, const char *label, int x, int *y) diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 551250ec747..1abef2ec173 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -759,7 +759,7 @@ void WM_toolsystem_update_from_context_view3d(bContext *C) if (!BLI_listbase_is_single(&wm->windows)) { wmWindow *win_prev = CTX_wm_window(C); ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); for (wmWindow *win = wm->windows.first; win; win = win->next) { if (win != win_prev) { @@ -772,7 +772,7 @@ void WM_toolsystem_update_from_context_view3d(bContext *C) CTX_wm_window_set(C, win_prev); CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } } } diff --git a/source/blender/windowmanager/intern/wm_tooltip.c b/source/blender/windowmanager/intern/wm_tooltip.c index da2afda5e24..4d64acefca4 100644 --- a/source/blender/windowmanager/intern/wm_tooltip.c +++ b/source/blender/windowmanager/intern/wm_tooltip.c @@ -119,7 +119,7 @@ void WM_tooltip_init(bContext *C, wmWindow *win) { ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + ARegion *region_prev = CTX_wm_region(C); CTX_wm_area_set(C, screen->tool_tip->area_from); CTX_wm_region_set(C, screen->tool_tip->region_from); screen->tool_tip->region = screen->tool_tip->init(C, @@ -128,7 +128,7 @@ void WM_tooltip_init(bContext *C, wmWindow *win) &pass_delay, &screen->tool_tip->exit_on_event); CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); + CTX_wm_region_set(C, region_prev); } copy_v2_v2_int(screen->tool_tip->event_xy, &win->eventstate->x); -- cgit v1.2.3