36 #include "RNA_prototypes.h"
48 #define USE_KEYMAP_ADD_HACK
62 if (final_data_path ==
NULL) {
90 if (*r_prop ==
NULL) {
93 return "WM_OT_context_toggle";
98 if (*r_prop ==
NULL) {
101 return "WM_OT_context_menu_enum";
111 return "WM_OT_call_menu";
120 return "WM_OT_call_panel";
137 char shortcut_str[128];
141 if (idname ==
NULL) {
147 C, idname, but->
opcontext, prop,
true, shortcut_str,
sizeof(shortcut_str))) {
175 U.runtime.is_dirty =
true;
200 block, 6 *
U.dpi_fac, (
const int[2]){-100 * U.dpi_fac, 36 * U.dpi_fac});
207 #ifdef USE_KEYMAP_ADD_HACK
231 const int kmi_id = kmi->
id;
238 U.runtime.is_dirty =
true;
263 block, 6 *
U.dpi_fac, (
const int[2]){-100 * U.dpi_fac, 36 * U.dpi_fac});
265 #ifdef USE_KEYMAP_ADD_HACK
279 #ifdef USE_KEYMAP_ADD_HACK
284 int kmi_id = WM_key_event_operator_id(
C, idname, but->
opcontext, prop,
true, &km);
316 U.runtime.is_dirty =
true;
337 if (data_path !=
NULL) {
377 char drawstr[
sizeof(but->
drawstr)];
382 if (drawstr[0] ==
'\0') {
389 const char *expr_imports[] = {
"bpy",
"bl_ui",
NULL};
392 "bl_ui.space_toolsystem_common.item_from_id("
394 "bpy.context.space_data.type, "
397 char *expr_result =
NULL;
432 U.runtime.is_dirty =
true;
440 U.runtime.is_dirty =
true;
541 const bool is_array_component = (is_array && but->
rnaindex != -1);
542 const bool is_whole_array = (is_array && but->
rnaindex == -1);
555 if (is_array_component) {
559 "ANIM_OT_keyframe_insert_button",
565 "ANIM_OT_keyframe_insert_button",
571 "ANIM_OT_keyframe_delete_button",
577 "ANIM_OT_keyframe_delete_button",
585 "ANIM_OT_keyframe_insert_button",
591 "ANIM_OT_keyframe_delete_button",
603 if (is_array_component) {
607 "ANIM_OT_keyframe_insert_button",
613 "ANIM_OT_keyframe_insert_button",
621 "ANIM_OT_keyframe_insert_button",
628 if (is_array_component) {
632 "ANIM_OT_keyframe_clear_button",
638 "ANIM_OT_keyframe_clear_button",
646 "ANIM_OT_keyframe_clear_button",
656 if (is_array_component) {
660 "ANIM_OT_driver_button_remove",
666 "ANIM_OT_driver_button_remove",
674 "ANIM_OT_driver_button_remove",
679 if (!is_whole_array) {
683 "ANIM_OT_copy_driver_button");
688 "ANIM_OT_paste_driver_button");
694 "ANIM_OT_driver_button_edit");
700 "SCREEN_OT_drivers_editor_show");
711 "ANIM_OT_driver_button_add");
713 if (!is_whole_array) {
718 "ANIM_OT_paste_driver_button");
725 "SCREEN_OT_drivers_editor_show");
733 if (is_array_component) {
737 "ANIM_OT_keyingset_button_add",
743 "ANIM_OT_keyingset_button_add",
749 "ANIM_OT_keyingset_button_remove");
755 "ANIM_OT_keyingset_button_add",
761 "ANIM_OT_keyingset_button_remove");
765 if (is_overridable) {
772 if (is_array_component) {
780 "Single Override Type",
791 "UI_OT_override_remove_button",
797 "UI_OT_override_remove_button",
804 "UI_OT_override_type_set_button",
816 "UI_OT_override_remove_button",
822 if (is_array_component) {
845 "UI_OT_override_type_set_button",
864 if (is_array_component) {
868 "UI_OT_reset_default_button",
874 "UI_OT_reset_default_button",
882 "UI_OT_reset_default_button",
891 "UI_OT_assign_default_button");
896 if (is_array_component) {
900 "UI_OT_copy_to_selected_button",
906 "UI_OT_copy_to_selected_button",
914 "UI_OT_copy_to_selected_button",
922 "UI_OT_copy_data_path_button");
926 "UI_OT_copy_data_path_button",
935 "UI_OT_copy_as_driver_button");
974 if (mt_idtemplate_liboverride && mt_idtemplate_liboverride->
poll(
C, mt_idtemplate_liboverride)) {
975 uiItemM_ptr(layout, mt_idtemplate_liboverride,
IFACE_(
"Library Override"), ICON_NONE);
990 "UI_OT_jump_to_target_button");
999 bool item_found =
false;
1003 for (
int um_index = 0; um_index < um_array_len; um_index++) {
1050 "Add to a user defined context menu (stored in the user preferences)");
1060 if (idname !=
NULL) {
1107 IFACE_(
"Non-Keyboard Shortcut"),
1117 TIP_(
"Only keyboard shortcuts can be edited that way, "
1118 "please use User Preferences otherwise"));
1177 "WM_OT_doc_view_manual_ui_context");
1194 uiItemO(layout,
NULL, ICON_NONE,
"UI_OT_copy_python_command_button");
1207 "UI_OT_edittranslation_init",
1228 IFACE_(
"Navigation Bar"),
1241 const bool is_inside_listrow = is_inside_listbox ?
1244 if (is_inside_listrow) {
1273 const bool any_item_visible = has_panel_category;
1275 if (!any_item_visible) {
1291 if (has_panel_category) {
1297 IFACE_(
"Shift Left Mouse"));
1298 uiItemR(layout, &
ptr,
"use_pin", 0, tmpstr, ICON_NONE);
struct bAddon * BKE_addon_find(struct ListBase *addon_list, const char *module)
void CTX_store_set(bContext *C, bContextStore *store)
struct ARegion * CTX_wm_menu(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
struct bScreen * CTX_wm_screen(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
bContextStore * CTX_store_get(bContext *C)
struct IDProperty * IDP_New(char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_NewString(const char *st, const char *name, int maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void IDP_FreeProperty(struct IDProperty *prop)
bool IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_NONNULL()
struct IDProperty * IDP_CopyProperty(const struct IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen)
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define UNUSED_VARS_NDEBUG(...)
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
bool bool bool bool BPY_run_string_as_string(struct bContext *C, const char *imports[], const char *expr, struct BPy_RunErrInfo *err_info, char **r_value) ATTR_NONNULL(1
bool ED_asset_can_mark_single_from_context(const struct bContext *C)
struct bUserMenu * ED_screen_user_menu_ensure(struct bContext *C)
bUserMenu ** ED_screen_user_menus_find(const struct bContext *C, uint *r_len)
struct bUserMenuItem_Prop * ED_screen_user_menu_item_find_prop(struct ListBase *lb, const char *context_data_path, const char *prop_id, int prop_index)
void ED_screens_footer_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg)
struct bUserMenuItem_Menu * ED_screen_user_menu_item_find_menu(struct ListBase *lb, const struct MenuType *mt)
void ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg)
void ED_screen_user_menu_item_remove(struct ListBase *lb, struct bUserMenuItem *umi)
void ED_screens_navigation_bar_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg)
void ED_screen_user_menu_item_add_operator(struct ListBase *lb, const char *ui_name, const struct wmOperatorType *ot, const struct IDProperty *prop, wmOperatorCallContext opcontext)
struct bUserMenuItem_Op * ED_screen_user_menu_item_find_operator(struct ListBase *lb, const struct wmOperatorType *ot, struct IDProperty *prop, wmOperatorCallContext opcontext)
void ED_screen_user_menu_item_add_prop(ListBase *lb, const char *ui_name, const char *context_data_path, const char *prop_id, int prop_index)
void ED_screen_user_menu_item_add_menu(struct ListBase *lb, const char *ui_name, const struct MenuType *mt)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
@ RNA_OVERRIDE_STATUS_OVERRIDABLE
void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
bool UI_but_online_manual_id(const uiBut *but, char *r_str, size_t maxlength) ATTR_WARN_UNUSED_RESULT
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
struct bContextStore * uiLayoutGetContextStore(uiLayout *layout)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
const struct uiStyle * UI_style_get_dpi(void)
bool UI_panel_can_be_pinned(const struct Panel *panel)
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void UI_menutype_draw(struct bContext *C, struct MenuType *mt, struct uiLayout *layout)
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
void uiItemL(uiLayout *layout, const char *name, int icon)
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiLayoutContextCopy(uiLayout *layout, struct bContextStore *context)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
void uiItemS(uiLayout *layout)
struct PanelType * UI_but_paneltype_get(uiBut *but)
void uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, wmOperatorCallContext context, int flag, struct PointerRNA *r_opptr)
bool UI_popup_menu_end_or_cancel(struct bContext *C, struct uiPopupMenu *pup)
void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg, struct wmOperator *op)
uiLayout * UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, const struct uiStyle *style)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
struct MenuType * UI_but_menutype_get(uiBut *but)
void uiItemM_ptr(uiLayout *layout, struct MenuType *mt, const char *name, int icon)
bool UI_panel_category_is_visible(const struct ARegion *region)
uiBut * uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
void UI_view_item_context_menu_build(struct bContext *C, const uiViewItemHandle *item_handle, uiLayout *column)
int uiLayoutGetWidth(uiLayout *layout)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
uiBlock * UI_block_begin(const struct bContext *C, struct ARegion *region, const char *name, eUIEmbossType emboss)
void uiItemFullO(uiLayout *layout, const char *opname, const char *name, int icon, struct IDProperty *properties, wmOperatorCallContext context, int flag, struct PointerRNA *r_opptr)
void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
void UI_block_direction_set(uiBlock *block, char direction)
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_popup_block_invoke(struct bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free)
void uiLayoutSetOperatorContext(uiLayout *layout, wmOperatorCallContext opcontext)
bool UI_but_is_tool(const uiBut *but)
void UI_but_flag_enable(uiBut *but, int flag)
void UI_but_string_info_get(struct bContext *C, uiBut *but,...) ATTR_SENTINEL(0)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
@ UI_BLOCK_MOVEMOUSE_QUIT
return(oflags[bm->toolflag_index].f &oflag) !=0
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool ANIM_driver_can_paste(void)
void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_strip)
void ui_rna_collection_search_update_fn(const struct bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first)
uiBut * ui_list_row_find_mouse_over(const struct ARegion *region, const int xy[2]) ATTR_NONNULL(1
uiBut * ui_view_item_find_mouse_over(const struct ARegion *region, const int xy[2]) ATTR_NONNULL(1
bool ui_block_is_popup_any(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
bool ui_jump_to_target_button_poll(struct bContext *C)
size_t ui_but_drawstr_without_sep_char(const uiBut *but, char *str, size_t str_maxlen) ATTR_NONNULL(1
uiBut * ui_list_find_mouse_over(const struct ARegion *region, const struct wmEvent *event) ATTR_WARN_UNUSED_RESULT
void(* MEM_freeN)(void *vmemh)
bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
const char * RNA_property_identifier(const PropertyRNA *prop)
bool RNA_property_animateable(const PointerRNA *ptr, PropertyRNA *prop)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
PropertyType RNA_property_type(PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_is_idprop(const PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
eRNAOverrideStatus RNA_property_override_library_status(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const int index)
struct AssetMetaData * asset_data
char idname[BKE_ST_MAXNAME]
struct PanelType * parent
uiViewItemHandle * view_item
wmOperatorCallContext opcontext
struct bContextStore * context
struct PointerRNA * opptr
struct wmOperatorType * optype
char drawstr[UI_MAX_DRAW_STR]
struct PropertyRNA * rnaprop
struct PointerRNA rnapoin
#define EVT_TYPE_MASK_HOTKEY_INCLUDE
#define ISNDOF_BUTTON(event_type)
#define ISKEYBOARD(event_type)
#define EVT_TYPE_MASK_HOTKEY_EXCLUDE
#define EVT_TYPE_MASK_ALL
wmKeyMapItem * WM_keymap_item_find_id(wmKeyMap *keymap, int id)
void WM_keyconfig_update(wmWindowManager *wm)
bool WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
char * WM_key_event_operator_string(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const bool is_strict, char *result, const int result_len)
wmKeyMapItem * WM_key_event_operator(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const short include_mask, const short exclude_mask, wmKeyMap **r_keymap)
wmKeyMapItem * WM_keymap_add_item(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params)
void WM_keymap_item_properties_reset(wmKeyMapItem *kmi, struct IDProperty *properties)
wmKeyMap * WM_keymap_guess_opname(const bContext *C, const char *opname)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
char * WM_context_path_resolve_property_full(const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index)
char * WM_context_path_resolve_full(bContext *C, const PointerRNA *ptr)