From b2ee1770d4c31078518f4ec9edd5196a41345162 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 6 Mar 2020 16:56:42 +0100 Subject: 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. --- .../editors/interface/interface_context_menu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/interface/interface_context_menu.c') diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index ae6a71f17e6..c9a46e00520 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -160,7 +160,7 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) shortcut_free_operator_property(prop); } -static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg) +static uiBlock *menu_change_shortcut(bContext *C, ARegion *region, void *arg) { wmWindowManager *wm = CTX_wm_manager(C); uiBlock *block; @@ -186,7 +186,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg) RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr); - block = UI_block_begin(C, ar, "_popup", UI_EMBOSS); + block = UI_block_begin(C, region, "_popup", UI_EMBOSS); UI_block_func_handle_set(block, but_shortcut_name_func, but); UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT); UI_block_direction_set(block, UI_DIR_CENTER_Y); @@ -216,7 +216,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg) static int g_kmi_id_hack; #endif -static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) +static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg) { wmWindowManager *wm = CTX_wm_manager(C); uiBlock *block; @@ -248,7 +248,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr); - block = UI_block_begin(C, ar, "_popup", UI_EMBOSS); + block = UI_block_begin(C, region, "_popup", UI_EMBOSS); UI_block_func_handle_set(block, but_shortcut_name_func, but); UI_block_direction_set(block, UI_DIR_CENTER_Y); @@ -1194,22 +1194,22 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) /* Show header tools for header buttons. */ if (ui_block_is_popup_any(but->block) == false) { - const ARegion *ar = CTX_wm_region(C); + const ARegion *region = CTX_wm_region(C); - if (!ar) { + if (!region) { /* skip */ } - else if (ELEM(ar->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) { + else if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) { uiItemMenuF(layout, IFACE_("Header"), ICON_NONE, ED_screens_header_tools_menu_create, NULL); } - else if (ar->regiontype == RGN_TYPE_NAV_BAR) { + else if (region->regiontype == RGN_TYPE_NAV_BAR) { uiItemMenuF(layout, IFACE_("Navigation Bar"), ICON_NONE, ED_screens_navigation_bar_tools_menu_create, NULL); } - else if (ar->regiontype == RGN_TYPE_FOOTER) { + else if (region->regiontype == RGN_TYPE_FOOTER) { uiItemMenuF(layout, IFACE_("Footer"), ICON_NONE, ED_screens_footer_tools_menu_create, NULL); } } @@ -1231,10 +1231,10 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) /** * menu to show when right clicking on the panel header */ -void ui_popup_context_menu_for_panel(bContext *C, ARegion *ar, Panel *pa) +void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *pa) { bScreen *sc = CTX_wm_screen(C); - const bool has_panel_category = UI_panel_category_is_visible(ar); + const bool has_panel_category = UI_panel_category_is_visible(region); const bool any_item_visible = has_panel_category; PointerRNA ptr; uiPopupMenu *pup; -- cgit v1.2.3