Blender
V3.3
|
#include <cstdarg>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_screen.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "ED_screen.h"
#include "interface_intern.h"
#include "interface_regions_intern.h"
Go to the source code of this file.
PopUp Region (Generic)
Definition in file interface_region_popup.cc.
Definition at line 387 of file interface_region_popup.cc.
References C, LISTBASE_FOREACH, UI_block_draw(), and ARegion::uiblocks.
Referenced by ui_popup_block_create().
|
static |
Use to refresh centered popups on screen resizing (for splash).
Definition at line 397 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 352 of file interface_region_popup.cc.
References 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(), ARegion::do_draw, LISTBASE_FOREACH_MUTABLE, uiPopupBlockHandle::popup_create_vars, RGN_REFRESH_UI, ui_popup_block_refresh(), and ARegion::uiblocks.
Referenced by ui_popup_block_create().
Definition at line 416 of file interface_region_popup.cc.
References uiBlock::buttons, uiBlock::flag, LISTBASE_FOREACH, uiBlock::rect, UI_BLOCK_NO_WIN_CLIP, UI_POPUP_MENU_TOP, UI_SCREEN_MARGIN, WM_window_pixels_x(), WM_window_pixels_y(), 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 | ||
) |
Definition at line 749 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_screen(), CTX_wm_window(), uiPopupBlockCreate::event_xy, wmWindow::eventstate, uiBlock::handle, uiPopupBlockCreate::handle_create_func, ARegion::handlers, uiPopupBlockHandle::popup_create_vars, uiPopupBlockHandle::region, RGN_TYPE_TEMPORARY, type, ARegion::type, 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(), and UI_popup_menu_end().
void ui_popup_block_free | ( | bContext * | C, |
uiPopupBlockHandle * | handle | ||
) |
Definition at line 812 of file interface_region_popup.cc.
References uiPopupBlockCreate::arg, uiPopupBlockCreate::arg_free, uiPopupBlockCreate::butregion, C, LISTBASE_FOREACH, MEM_freeN, uiPopupBlockHandle::menuretval, uiPopupBlockHandle::popup_create_vars, UI_BLOCK_KEEP_OPEN, UI_BLOCK_POPOVER, ui_popup_block_remove(), UI_RETURN_OK, and ARegion::uiblocks.
Referenced by ui_block_open_end(), UI_popup_block_close(), ui_popup_handler(), and ui_popup_handler_remove().
|
static |
Definition at line 62 of file interface_region_popup.cc.
References 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, ListBase::first, uiBlock::handle, left, LISTBASE_FOREACH, max_ff(), uiPopupBlockHandle::max_size_x, uiPopupBlockHandle::max_size_y, uiSafetyRct::parent, uiPopupBlockHandle::prev_butrct, uiPopupBlockHandle::prev_dir1, uiPopupBlockHandle::prev_dir2, uiBut::rect, uiBlock::rect, uiPopupBlockHandle::refresh, right, uiBlock::saferct, uiBlock::safety, uiSafetyRct::safety, top, uiBut::type, UI_BLOCK_CONTAINS_SUBMENU_BUT, UI_block_order_flip(), ui_block_to_window_rctf(), UI_BTYPE_PULLDOWN, UI_BUT_ALIGN_LEFT, UI_BUT_ALIGN_TOP, 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_UNIT_X, UI_UNIT_Y, WM_window_pixels_x(), WM_window_pixels_y(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by ui_popup_block_refresh().
uiBlock* ui_popup_block_refresh | ( | struct bContext * | C, |
uiPopupBlockHandle * | handle, | ||
struct ARegion * | butregion, | ||
uiBut * | but | ||
) |
Called for creating new popups and refreshing existing ones.
Definition at line 538 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_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, ListBase::first, uiBlock::flag, PieMenuData::flags, uiBlock::handle, uiPopupBlockCreate::handle_create_func, LISTBASE_FOREACH, MEM_freeN, offset, uiBlock::oldblock, 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, uiBlock::saferct, uiBlock::safety, uiSafetyRct::safety, uiPopupBlockHandle::scrolloffset, UI_BLOCK_BOUNDS_POPUP_CENTER, ui_block_calc_pie_segment(), UI_block_end_ex(), UI_BLOCK_LOOP, UI_BLOCK_POPOVER, UI_BLOCK_POPUP, UI_BLOCK_RADIAL, 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_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, ARegion::uiblocks, UNPACK2, uiBlock::winmat, ARegion::winrct, WM_window_pixels_x(), WM_window_pixels_y(), wmGetProjectionMatrix(), rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by ui_block_region_refresh(), and ui_popup_block_create().
|
static |
Definition at line 496 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_remove_timer(), and WM_window_get_active_screen().
Referenced by ui_popup_block_free().
Definition at line 457 of file interface_region_popup.cc.
References uiBlock::buttons, ListBase::first, uiBlock::flag, ListBase::last, LISTBASE_FOREACH, uiBlock::rect, 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().
Translate any popup regions (so we can drag them).
Definition at line 40 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::uiblocks, UNPACK2, and ARegion::winrct.
Referenced by ui_handle_menu_event().