Blender V4.3
interface_region_popup.cc File Reference
#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.

Functions

Utility Functions
void ui_popup_translate (ARegion *region, const int mdiff[2])
 
static void ui_popup_block_position (wmWindow *window, ARegion *butregion, uiBut *but, uiBlock *block)
 
Menu Block Creation
static void ui_block_region_refresh (const bContext *C, ARegion *region)
 
static void ui_block_region_draw (const bContext *C, ARegion *region)
 
static void ui_block_region_popup_window_listener (const wmRegionListenerParams *params)
 
static void ui_popup_block_clip (wmWindow *window, uiBlock *block)
 
void ui_popup_block_scrolltest (uiBlock *block)
 
static void ui_popup_block_remove (bContext *C, uiPopupBlockHandle *handle)
 
void ui_layout_panel_popup_scroll_apply (Panel *panel, const float dy)
 
void UI_popup_dummy_panel_set (ARegion *region, uiBlock *block)
 
uiBlockui_popup_block_refresh (bContext *C, uiPopupBlockHandle *handle, ARegion *butregion, uiBut *but)
 
uiPopupBlockHandleui_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)
 
void ui_popup_block_free (bContext *C, uiPopupBlockHandle *handle)
 

Detailed Description

PopUp Region (Generic)

Definition in file interface_region_popup.cc.

Function Documentation

◆ ui_block_region_draw()

static void ui_block_region_draw ( const bContext * C,
ARegion * region )
static

Definition at line 447 of file interface_region_popup.cc.

References LISTBASE_FOREACH, and UI_block_draw().

Referenced by ui_popup_block_create().

◆ ui_block_region_popup_window_listener()

static void ui_block_region_popup_window_listener ( const wmRegionListenerParams * params)
static

Use to refresh centered popups on screen resizing (for splash).

Definition at line 457 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().

◆ ui_block_region_refresh()

◆ ui_layout_panel_popup_scroll_apply()

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 596 of file interface_region_popup.cc.

References LayoutPanels::bodies, LayoutPanels::headers, Panel_Runtime::layout_panels, and Panel::runtime.

Referenced by ui_menu_scroll_apply_offset_y(), and ui_popup_block_refresh().

◆ ui_popup_block_clip()

◆ ui_popup_block_create()

◆ ui_popup_block_free()

◆ ui_popup_block_position()

◆ 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 628 of file interface_region_popup.cc.

References uiBlock::aspect, BLI_addhead(), BLI_assert, BLI_rctf_recenter(), BLI_rctf_size_x(), BLI_rctf_size_y(), uiBut::block, uiBlock::bounds_type, uiBlock::buttons, copy_v2_v2(), create_func(), CTX_wm_window(), uiBlock::direction, ED_region_floating_init(), ED_region_tag_redraw(), ED_region_update_rect(), ELEM, uiBlock::endblock, wmWindow::event_last_handled, wmWindow::eventstate, uiBlock::flag, PieMenuData::flags, FLT_MAX, uiBlock::handle, LISTBASE_FOREACH, max_ff(), MEM_freeN(), min_ff(), uiBlock::oldblock, uiBlock::panel, PieMenuData::pie_center_init, PieMenuData::pie_center_spawned, uiBlock::pie_data, uiBlock::rect, uiBlock::saferct, uiBlock::safety, uiSafetyRct::safety, 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, WM_window_native_pixel_size(), wmGetProjectionMatrix(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ui_block_region_refresh(), and ui_popup_block_create().

◆ ui_popup_block_remove()

◆ ui_popup_block_scrolltest()

◆ UI_popup_dummy_panel_set()

void UI_popup_dummy_panel_set ( ARegion * region,
uiBlock * block )

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 611 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, and Panel::runtime.

Referenced by ui_paneltype_draw_impl(), wm_block_create_redo(), wm_block_dialog_create(), and wm_operator_ui_create().

◆ ui_popup_translate()

void ui_popup_translate ( ARegion * region,
const int mdiff[2] )

Translate any popup regions (so we can drag them).

Definition at line 41 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, and UNPACK2.

Referenced by ui_handle_menu_event().