Blender
V3.3
|
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_addon.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
#include "BKE_screen.h"
#include "ED_asset.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "interface_intern.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
Go to the source code of this file.
Macros | |
#define | USE_KEYMAP_ADD_HACK |
Functions | |
Panel Context Menu | |
void | ui_popup_context_menu_for_panel (bContext *C, ARegion *region, Panel *panel) |
Generic context popup menus.
Definition in file interface_context_menu.c.
#define USE_KEYMAP_ADD_HACK |
Definition at line 48 of file interface_context_menu.c.
Definition at line 134 of file interface_context_menu.c.
References C, NULL, uiBut::opcontext, shortcut_free_operator_property(), shortcut_get_operator_property(), ui_but_add_shortcut(), and WM_key_event_operator_string().
Referenced by menu_add_shortcut(), menu_change_shortcut(), and remove_shortcut_func().
Definition at line 211 of file interface_context_menu.c.
References BLT_I18NCONTEXT_OPERATOR_DEFAULT, but_shortcut_name_func(), C, CTX_IFACE_, CTX_wm_manager(), EVT_AKEY, g_kmi_id_hack, wmWindowManager::id, wmKeyMapItem::id, KM_ANY, KM_PRESS, ptr, RNA_pointer_create(), shortcut_get_operator_property(), UI_block_begin(), UI_block_bounds_set_popup(), UI_block_direction_set(), UI_block_func_handle_set(), UI_block_layout(), UI_DIR_CENTER_Y, UI_EMBOSS, UI_ITEM_R_FULL_EVENT, UI_ITEM_R_IMMEDIATE, UI_LAYOUT_PANEL, UI_LAYOUT_VERTICAL, UI_style_get_dpi(), uiItemL(), uiItemR(), WM_keyconfig_update(), WM_keymap_add_item(), WM_keymap_guess_opname(), WM_keymap_item_find_id(), and WM_keymap_item_properties_reset().
Referenced by popup_add_shortcut_func().
Definition at line 272 of file interface_context_menu.c.
References C, g_kmi_id_hack, uiBut::opcontext, shortcut_free_operator_property(), shortcut_get_operator_property(), UNUSED_VARS, WM_keymap_guess_opname(), WM_keymap_item_find_id(), and WM_keymap_remove_item().
Referenced by popup_add_shortcut_func().
Definition at line 158 of file interface_context_menu.c.
References BLI_assert, BLT_I18NCONTEXT_OPERATOR_DEFAULT, but_shortcut_name_func(), C, CTX_IFACE_, CTX_wm_manager(), EVT_TYPE_MASK_HOTKEY_EXCLUDE, EVT_TYPE_MASK_HOTKEY_INCLUDE, wmWindowManager::id, NULL, uiBut::opcontext, ptr, RNA_pointer_create(), shortcut_free_operator_property(), shortcut_get_operator_property(), UI_block_begin(), UI_block_bounds_set_popup(), UI_block_direction_set(), UI_block_flag_enable(), UI_block_func_handle_set(), UI_block_layout(), UI_BLOCK_MOVEMOUSE_QUIT, UI_DIR_CENTER_Y, UI_EMBOSS, UI_ITEM_R_FULL_EVENT, UI_ITEM_R_IMMEDIATE, UI_LAYOUT_PANEL, UI_LAYOUT_VERTICAL, UI_style_get_dpi(), uiItemL(), uiItemR(), and WM_key_event_operator().
Referenced by popup_change_shortcut_func(), and ui_popup_context_menu_for_button().
Definition at line 322 of file interface_context_menu.c.
References C, menu_add_shortcut(), menu_add_shortcut_cancel(), NULL, and UI_popup_block_ex().
Referenced by ui_popup_context_menu_for_button().
Definition at line 293 of file interface_context_menu.c.
References C, menu_change_shortcut(), NULL, and UI_popup_block_invoke().
Referenced by ui_popup_context_menu_for_button().
|
static |
Definition at line 428 of file interface_context_menu.c.
References C, ED_screen_user_menu_ensure(), and ui_but_user_menu_add().
Referenced by ui_popup_context_menu_for_button().
Definition at line 436 of file interface_context_menu.c.
References ED_screen_user_menu_item_remove(), and bUserMenu::items.
Referenced by ui_popup_context_menu_for_button().
Definition at line 299 of file interface_context_menu.c.
References BLI_assert, but_shortcut_name_func(), C, EVT_TYPE_MASK_HOTKEY_EXCLUDE, EVT_TYPE_MASK_HOTKEY_INCLUDE, NULL, uiBut::opcontext, shortcut_free_operator_property(), shortcut_get_operator_property(), WM_key_event_operator(), and WM_keymap_remove_item().
Referenced by ui_popup_context_menu_for_button().
|
static |
Definition at line 127 of file interface_context_menu.c.
References IDP_FreeProperty().
Referenced by but_shortcut_name_func(), menu_add_shortcut_cancel(), menu_change_shortcut(), remove_shortcut_func(), and ui_popup_context_menu_for_button().
|
static |
Definition at line 76 of file interface_context_menu.c.
References C, PointerRNA::data, PanelType::idname, MenuType::idname, wmOperatorType::idname, IDP_AddToGroup(), IDP_CopyProperty(), IDP_GROUP, IDP_New(), IDP_NewString(), NULL, uiBut::opptr, uiBut::optype, PROP_BOOLEAN, PROP_ENUM, RNA_property_type(), uiBut::rnaprop, shortcut_property_from_rna(), UI_but_menutype_get(), and UI_but_paneltype_get().
Referenced by but_shortcut_name_func(), menu_add_shortcut(), menu_add_shortcut_cancel(), menu_change_shortcut(), remove_shortcut_func(), and ui_popup_context_menu_for_button().
|
static |
Definition at line 54 of file interface_context_menu.c.
References C, IDP_AddToGroup(), IDP_GROUP, IDP_New(), IDP_NewString(), MEM_freeN, NULL, uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, and WM_context_path_resolve_property_full().
Referenced by shortcut_get_operator_property().
Definition at line 328 of file interface_context_menu.c.
References C, MEM_freeN, NULL, uiBut::optype, PROP_BOOLEAN, result, RNA_property_type(), uiBut::rnapoin, uiBut::rnaprop, UI_but_menutype_get(), and WM_context_path_resolve_full().
Referenced by ui_but_user_menu_add(), and ui_popup_context_menu_for_button().
|
static |
Definition at line 444 of file interface_context_menu.c.
References BLI_assert, BLI_split_dirfile(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, CTX_IFACE_, ELEM, file, FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, NULL, ot, PROP_DIRPATH, PROP_FILEPATH, ptr, RNA_property_string_get(), RNA_property_subtype(), RNA_string_set(), uiItemFullO_ptr(), UNUSED_VARS_NDEBUG, WM_OP_INVOKE_DEFAULT, and WM_operatortype_find().
Referenced by ui_popup_context_menu_for_button().
Definition at line 373 of file interface_context_menu.c.
References BLI_assert, BPY_run_string_as_string(), C, PointerRNA::data, uiBut::drawstr, ED_screen_user_menu_item_add_menu(), ED_screen_user_menu_item_add_operator(), ED_screen_user_menu_item_add_prop(), bUserMenu::items, MEM_freeN, NULL, uiBut::opcontext, uiBut::opptr, uiBut::optype, RNA_property_identifier(), RNA_string_get(), uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, SNPRINTF, STRNCPY, ui_but_drawstr_without_sep_char(), UI_but_is_tool(), ui_but_is_user_menu_compatible(), UI_but_menutype_get(), and WM_context_path_resolve_full().
Referenced by popup_user_menu_add_or_replace_func().
|
static |
Definition at line 350 of file interface_context_menu.c.
References C, PointerRNA::data, ED_screen_user_menu_item_find_menu(), ED_screen_user_menu_item_find_operator(), ED_screen_user_menu_item_find_prop(), bUserMenu::items, MEM_freeN, NULL, uiBut::opcontext, uiBut::opptr, uiBut::optype, return(), RNA_property_identifier(), uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, UI_but_menutype_get(), and WM_context_path_resolve_full().
Referenced by ui_popup_context_menu_for_button().
Definition at line 483 of file interface_context_menu.c.
References ANIM_driver_can_paste(), ID::asset_data, BKE_addon_find(), BLI_assert, uiBut::block, BLT_I18NCONTEXT_OPERATOR_DEFAULT, uiButViewItem::but, BUT_GET_LABEL, C, uiBut::context, CTX_data_main(), CTX_data_pointer_get_type(), CTX_IFACE_, CTX_store_get(), CTX_store_set(), CTX_wm_menu(), CTX_wm_region(), PointerRNA::data, ED_asset_can_mark_single_from_context(), ED_screen_user_menus_find(), ED_screens_footer_tools_menu_create(), ED_screens_header_tools_menu_create(), ED_screens_navigation_bar_tools_menu_create(), ELEM, EVT_TYPE_MASK_ALL, uiBut::flag, wmOperatorType::flag, id, IFACE_, is_disabled, ISKEYBOARD, ISNDOF_BUTTON, label, MEM_freeN, uiButTab::menu, menu_change_shortcut(), NULL, uiBut::opcontext, uiBut::optype, ot, PointerRNA::owner_id, MenuType::poll, popup_add_shortcut_func(), popup_change_shortcut_func(), popup_user_menu_add_or_replace_func(), popup_user_menu_remove_func(), PROP_BOOLEAN, PROP_DIRPATH, PROP_ENUM, PROP_FILEPATH, PROP_FLOAT, PROP_INT, PROP_POINTER, PROP_STRING, ptr, ARegion::regiontype, remove_shortcut_func(), RGN_TYPE_FOOTER, RGN_TYPE_HEADER, RGN_TYPE_NAV_BAR, RGN_TYPE_TOOL_HEADER, RNA_boolean_set(), RNA_OVERRIDE_STATUS_OVERRIDABLE, RNA_property_animateable(), RNA_property_array_length(), RNA_property_is_idprop(), RNA_property_override_library_status(), RNA_property_path_from_ID_check(), RNA_property_subtype(), RNA_property_type(), RNA_string_set(), uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, shortcut_free_operator_property(), shortcut_get_operator_property(), TIP_, uiBut::type, type, wmKeyMapItem::type, PointerRNA::type, ui_block_is_menu(), ui_block_is_popup_any(), UI_BTYPE_BUT, UI_BTYPE_IMAGE, UI_BTYPE_LABEL, UI_BTYPE_SEARCH_MENU, UI_BTYPE_TAB, UI_BTYPE_VIEW_ITEM, UI_BUT_ANIMATED, UI_BUT_ANIMATED_KEY, UI_BUT_DISABLED, UI_BUT_DRIVEN, UI_but_flag_enable(), UI_but_func_set(), ui_but_is_user_menu_compatible(), ui_but_menu_add_path_operators(), UI_but_online_manual_id(), UI_BUT_OVERRIDDEN, UI_but_string_info_get(), ui_but_user_menu_find(), ui_jump_to_target_button_poll(), ui_list_find_mouse_over(), ui_list_row_find_mouse_over(), UI_menutype_draw(), UI_popup_menu_begin(), UI_popup_menu_end_or_cancel(), UI_popup_menu_layout(), ui_rna_collection_search_update_fn(), UI_UNIT_Y, UI_view_item_context_menu_build(), ui_view_item_find_mouse_over(), uiDefBlockBut(), uiDefIconTextBut(), uiItemBooleanO(), uiItemFullO(), uiItemFullO_ptr(), uiItemM_ptr(), uiItemMenuF(), uiItemO(), uiItemS(), uiLayoutColumn(), uiLayoutContextCopy(), uiLayoutGetBlock(), uiLayoutGetContextStore(), uiLayoutGetWidth(), uiLayoutSetContextFromBut(), uiLayoutSetEnabled(), uiLayoutSetOperatorContext(), USER_DEVELOPER_UI, uiButViewItem::view_item, w(), WM_key_event_operator(), WM_keymap_guess_opname(), WM_menutype_find(), WM_OP_EXEC_DEFAULT, WM_OP_INVOKE_DEFAULT, WM_operatortype_find(), and wmEvent::xy.
Referenced by ui_do_button(), and ui_search_menu_create_context_menu().
void ui_popup_context_menu_for_panel | ( | struct bContext * | C, |
struct ARegion * | region, | ||
struct Panel * | panel | ||
) |
menu to show when right clicking on the panel header
Definition at line 1269 of file interface_context_menu.c.
References BLI_snprintf(), uiBlock::buttons, C, CTX_wm_screen(), uiBut::flag, bScreen::id, IFACE_, ListBase::last, NULL, PanelType::parent, ptr, RNA_pointer_create(), Panel::type, UI_BUT_HAS_SEP_CHAR, UI_panel_can_be_pinned(), UI_panel_category_is_visible(), UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), UI_SEP_CHAR_S, uiItemR(), and uiLayoutGetBlock().
Referenced by ui_handler_panel_region().
|
static |
Definition at line 208 of file interface_context_menu.c.
Referenced by menu_add_shortcut(), and menu_add_shortcut_cancel().