|
Blender V4.5
|
#include <algorithm>#include <cstdarg>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "BLI_listbase.h"#include "BLI_math_vector.h"#include "BLI_rect.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_screen.hh"#include "WM_api.hh"#include "WM_types.hh"#include "UI_interface.hh"#include "ED_screen.hh"#include "interface_intern.hh"#include "interface_regions_intern.hh"Go to the source code of this file.
PopUp Region (Generic)
Definition in file interface_region_popup.cc.
Definition at line 448 of file interface_region_popup.cc.
References C, LISTBASE_FOREACH, ARegion::runtime, and UI_block_draw().
Referenced by ui_popup_block_create().
|
static |
Use to refresh centered popups on screen resizing (for splash).
Definition at line 458 of file interface_region_popup.cc.
References wmNotifier::action, wmNotifier::category, ED_region_tag_refresh_ui(), NA_EDITED, NC_WINDOW, and params.
Referenced by ui_popup_block_create().
Definition at line 411 of file interface_region_popup.cc.
References BLI_assert, uiPopupBlockCreate::but, uiPopupBlockCreate::butregion, C, uiPopupBlockHandle::can_refresh, uiPopupBlockHandle::ctx_area, uiPopupBlockHandle::ctx_region, CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), LISTBASE_FOREACH_MUTABLE, uiPopupBlockHandle::popup_create_vars, ARegion::regiontype, RGN_REFRESH_UI, RGN_TYPE_TEMPORARY, ARegion::runtime, and ui_popup_block_refresh().
Referenced by ui_popup_block_create().
| void ui_layout_panel_popup_scroll_apply | ( | Panel * | panel, |
| const float | dy ) |
Apply scroll to layout panels when the main panel is used in popups.
Definition at line 593 of file interface_region_popup.cc.
References LayoutPanels::bodies, LayoutPanelBody::end_y, LayoutPanelHeader::end_y, LayoutPanels::headers, Panel_Runtime::layout_panels, Panel::runtime, LayoutPanelBody::start_y, and LayoutPanelHeader::start_y.
Referenced by ui_menu_scroll_apply_offset_y(), and ui_popup_block_refresh().
Definition at line 477 of file interface_region_popup.cc.
References uiBlock::buttons, uiBlock::flag, uiBlock::rect, UI_BLOCK_NO_WIN_CLIP, UI_POPUP_MENU_TOP, UI_SCREEN_MARGIN, WM_window_native_pixel_size(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by ui_popup_block_refresh().
| uiPopupBlockHandle * ui_popup_block_create | ( | bContext * | C, |
| ARegion * | butregion, | ||
| uiBut * | but, | ||
| uiBlockCreateFunc | create_func, | ||
| uiBlockHandleCreateFunc | handle_create_func, | ||
| void * | arg, | ||
| uiFreeArgFunc | arg_free, | ||
| const bool | can_refresh ) |
Definition at line 873 of file interface_region_popup.cc.
References uiPopupBlockCreate::arg, uiPopupBlockCreate::arg_free, uiBlock::bounds_type, uiPopupBlockCreate::but, uiPopupBlockCreate::butregion, C, uiPopupBlockHandle::can_refresh, copy_v2_v2_int(), create_func(), uiPopupBlockCreate::create_func, uiPopupBlockHandle::ctx_area, uiPopupBlockHandle::ctx_region, CTX_wm_area(), CTX_wm_region(), CTX_wm_region_popup(), CTX_wm_region_popup_set(), CTX_wm_screen(), CTX_wm_window(), ARegionType::draw, uiPopupBlockCreate::event_xy, wmWindow::eventstate, uiBlock::handle, uiPopupBlockCreate::handle_create_func, ARegionType::layout, ARegionType::listener, uiPopupBlockHandle::popup_create_vars, uiPopupBlockHandle::region, ARegionType::regionid, RGN_TYPE_TEMPORARY, ARegion::runtime, uiBlock::tooltipdisabled, UI_BLOCK_BOUNDS_POPUP_CENTER, ui_block_region_draw(), ui_block_region_popup_window_listener(), ui_block_region_refresh(), UI_but_tooltip_timer_remove(), UI_context_active_but_get(), ui_popup_block_refresh(), UI_region_handlers_add(), ui_region_temp_add(), WM_CURSOR_DEFAULT, WM_cursor_set(), and wmEvent::xy.
Referenced by ui_block_open_begin(), UI_pie_menu_end(), UI_popover_end(), ui_popover_panel_create(), UI_popup_block_ex(), UI_popup_block_invoke_ex(), ui_popup_menu_create_impl(), and UI_popup_menu_end().
| void ui_popup_block_free | ( | bContext * | C, |
| uiPopupBlockHandle * | handle ) |
Definition at line 965 of file interface_region_popup.cc.
References uiPopupBlockCreate::arg, uiPopupBlockCreate::arg_free, BKE_panel_free(), uiPopupBlockCreate::butregion, C, ED_workspace_status_text(), LISTBASE_FOREACH, uiPopupBlockHandle::menuretval, uiPopupBlockHandle::popup_create_vars, uiPopupBlockHandle::region, ARegion::runtime, ui_block_is_menu(), UI_BLOCK_KEEP_OPEN, UI_BLOCK_POPOVER, ui_popup_block_remove(), and UI_RETURN_OK.
Referenced by ui_block_open_end(), UI_popup_block_close(), ui_popup_handler(), and ui_popup_handler_remove().
|
static |
Definition at line 64 of file interface_region_popup.cc.
References uiBlock::aspect, BLI_addhead(), BLI_assert, BLI_duplicatelist(), BLI_freelistN(), BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_init_minmax(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rctf_translate(), BLI_rctf_union(), uiBut::block, uiBlock::buttons, uiBlock::content_hints, uiBlock::direction, uiBut::drawflag, ELEM, LayoutPanelBody::end_y, LayoutPanelHeader::end_y, uiBlock::handle, Vector< T, InlineBufferCapacity, Allocator >::is_empty(), left, max_ff(), uiPopupBlockHandle::max_size_x, uiPopupBlockHandle::max_size_y, MEM_callocN(), uiBlock::panel, uiSafetyRct::parent, uiPopupBlockHandle::prev_butrct, uiPopupBlockHandle::prev_dir1, uiPopupBlockHandle::prev_dir2, uiBlock::rect, uiBut::rect, uiPopupBlockHandle::refresh, uiBlock::saferct, uiBlock::safety, uiSafetyRct::safety, LayoutPanelBody::start_y, LayoutPanelHeader::start_y, top, uiBut::type, U, UI_BLOCK_CONTAINS_SUBMENU_BUT, ui_block_to_window_rctf(), UI_BTYPE_COLOR, UI_BTYPE_POPOVER, UI_BTYPE_PULLDOWN, UI_BUT_ALIGN_LEFT, UI_BUT_ALIGN_TOP, ui_but_menu_draw_as_popover(), ui_but_update(), UI_DIR_ALL, UI_DIR_CENTER_X, UI_DIR_CENTER_Y, UI_DIR_DOWN, UI_DIR_LEFT, UI_DIR_RIGHT, UI_DIR_UP, UI_MENU_PADDING, UI_MENU_SUBMENU_PADDING, UI_POPUP_MENU_TOP, UI_SCALE_FAC, UI_SCREEN_MARGIN, UI_UNIT_X, UI_UNIT_Y, WM_window_native_pixel_size(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by ui_popup_block_refresh().
| uiBlock * ui_popup_block_refresh | ( | bContext * | C, |
| uiPopupBlockHandle * | handle, | ||
| ARegion * | butregion, | ||
| uiBut * | but ) |
Called for creating new popups and refreshing existing ones.
Definition at line 625 of file interface_region_popup.cc.
References uiPopupBlockCreate::arg, uiBlock::aspect, BLI_addhead(), BLI_assert, BLI_rctf_recenter(), BLI_rctf_size_x(), BLI_rctf_size_y(), uiBut::block, uiBlock::bounds_type, uiBlock::buttons, C, uiPopupBlockHandle::can_refresh, copy_v2_v2(), create_func(), uiPopupBlockCreate::create_func, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_data_scene(), CTX_wm_window(), uiBlock::direction, uiPopupBlockHandle::direction, ED_region_floating_init(), ED_region_tag_redraw(), ED_region_update_rect(), ELEM, uiBlock::endblock, wmWindow::event_last_handled, uiPopupBlockCreate::event_xy, wmWindow::eventstate, uiBlock::flag, PieMenuData::flags, FLT_MAX, uiBlock::handle, uiPopupBlockCreate::handle_create_func, max_ff(), MEM_callocN(), min_ff(), uiBlock::oldblock, uiBlock::panel, PieMenuData::pie_center_init, PieMenuData::pie_center_spawned, uiBlock::pie_data, uiPopupBlockHandle::popup_create_vars, uiPopupBlockHandle::prev_block_rect, uiBlock::rect, uiPopupBlockHandle::refresh, uiPopupBlockHandle::region, ARegion::regiondata, ARegion::runtime, uiBlock::saferct, uiBlock::safety, uiSafetyRct::safety, uiPopupBlockHandle::scrolloffset, U, UI_BLOCK_BOUNDS_POPUP_CENTER, ui_block_calc_pie_segment(), UI_block_end_ex(), ui_block_is_menu(), UI_BLOCK_LOOP, UI_BLOCK_NO_ACCELERATOR_KEYS, UI_BLOCK_PIE_MENU, UI_BLOCK_POPOVER, UI_BLOCK_POPUP, UI_BLOCK_THEME_STYLE_POPUP, UI_block_theme_style_set(), UI_block_translate(), UI_block_update_from_old(), UI_blocklist_free_inactive(), UI_DIR_DOWN, UI_DIR_UP, ui_layout_panel_popup_scroll_apply(), UI_MENU_SCROLL_PAD, UI_PIE_INITIAL_DIRECTION, ui_popup_block_clip(), ui_popup_block_position(), ui_popup_block_scrolltest(), UI_POPUP_MARGIN, UI_POPUP_MENU_TOP, UI_RADIAL_NONE, UI_SCREEN_MARGIN, UI_UNIT_Y, UNPACK2, uiBlock::winmat, ARegion::winrct, WM_window_native_pixel_size(), wmGetProjectionMatrix(), rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.
Referenced by ui_block_region_refresh(), and ui_popup_block_create().
|
static |
Definition at line 551 of file interface_region_popup.cc.
References BLI_assert, BLI_findindex(), BLI_listbase_is_empty(), C, CTX_wm_area(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_window(), CTX_wm_window_set(), LISTBASE_FOREACH, uiPopupBlockHandle::region, bScreen::regionbase, uiPopupBlockHandle::scrolltimer, wmWindow::tag_cursor_refresh, ui_region_temp_remove(), wmWindowManager::windows, WM_event_timer_remove(), and WM_window_get_active_screen().
Referenced by ui_popup_block_free().
| void ui_popup_block_scrolltest | ( | uiBlock * | block | ) |
Definition at line 512 of file interface_region_popup.cc.
References uiBlock::buttons, uiBlock::flag, uiBlock::rect, Vector< T, InlineBufferCapacity, Allocator >::size(), UI_BLOCK_CLIPBOTTOM, UI_BLOCK_CLIPTOP, UI_MENU_SCROLL_ARROW, UI_SCROLLED, rctf::ymax, and rctf::ymin.
Referenced by ui_menu_scroll_apply_offset_y(), and ui_popup_block_refresh().
Set a dummy panel in the popup block to support using layout panels, the panel is linked to the popup region so layout panels state can be persistent until the popup is closed.
Definition at line 608 of file interface_region_popup.cc.
References BKE_panel_new(), Panel_Runtime::block, LayoutPanels::clear(), PanelType::flag, Panel_Runtime::layout_panels, uiBlock::panel, PANEL_TYPE_NO_HEADER, ARegion::runtime, and Panel::runtime.
Referenced by ui_paneltype_draw_impl(), wm_block_create_redo(), wm_block_dialog_create(), and wm_operator_ui_create().
| void ui_popup_translate | ( | ARegion * | region, |
| const int | mdiff[2] ) |
Translate any popup regions (so we can drag them).
Definition at line 42 of file interface_region_popup.cc.
References BLI_rctf_init(), BLI_rctf_translate(), BLI_rcti_translate(), ED_region_tag_redraw(), ED_region_update_rect(), LISTBASE_FOREACH, uiPopupBlockHandle::prev_block_rect, ARegion::runtime, UNPACK2, and ARegion::winrct.
Referenced by ui_handle_menu_event().