Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Show All 35 Lines | |||||
| #include <stddef.h> /* offsetof() */ | #include <stddef.h> /* offsetof() */ | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_workspace_types.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utf8.h" | #include "BLI_string_utf8.h" | ||||
| #include "BLI_rect.h" | #include "BLI_rect.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| Show All 12 Lines | |||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "wm_subwindow.h" | #include "wm_subwindow.h" | ||||
| #include "WM_message.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "BPY_extern.h" | #include "BPY_extern.h" | ||||
| #include "ED_screen.h" | |||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| #include "interface_intern.h" | #include "interface_intern.h" | ||||
| /* avoid unneeded calls to ui_but_value_get */ | /* avoid unneeded calls to ui_but_value_get */ | ||||
| #define UI_BUT_VALUE_UNSET DBL_MAX | #define UI_BUT_VALUE_UNSET DBL_MAX | ||||
| #define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value) = ui_but_value_get(_but); } (void)0 | #define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value) = ui_but_value_get(_but); } (void)0 | ||||
| ▲ Show 20 Lines • Show All 1,192 Lines • ▼ Show 20 Lines | if (but->optype) { | ||||
| if (but->context) | if (but->context) | ||||
| CTX_store_set((bContext *)C, NULL); | CTX_store_set((bContext *)C, NULL); | ||||
| } | } | ||||
| ui_but_anim_flag(but, (scene) ? scene->r.cfra : 0.0f); | ui_but_anim_flag(but, (scene) ? scene->r.cfra : 0.0f); | ||||
| } | } | ||||
| { | |||||
| struct wmMsgBus *mbus = CTX_wm_message_bus(C); | |||||
| if (mbus) { | |||||
| uiBut *but_prev = NULL; | |||||
| /* possibly we should keep the region this block is contained in? */ | |||||
| ARegion *ar = CTX_wm_region(C); | |||||
| for (but = block->buttons.first; but; but = but->next) { | |||||
| if (but->rnapoin.type && but->rnaprop) { | |||||
| /* quick check to avoid adding buttons representing a vector, multiple times. */ | |||||
| if ((but_prev && | |||||
| (but_prev->rnaprop == but->rnaprop) && | |||||
| (but_prev->rnapoin.type == but->rnapoin.type) && | |||||
| (but_prev->rnapoin.data == but->rnapoin.data) && | |||||
| (but_prev->rnapoin.id.data == but->rnapoin.id.data)) == false) | |||||
| { | |||||
| /* TODO: could make this into utility function. */ | |||||
| WM_msg_subscribe_rna( | |||||
| mbus, | |||||
| &(const wmMsgParams_RNA){ .ptr = but->rnapoin, .prop = but->rnaprop, }, | |||||
| &(const wmMsgSubscribeValue){ | |||||
| .owner = ar, | |||||
| .user_data = ar, | |||||
| .notify = ED_region_do_msg_notify_tag_redraw, | |||||
| }); | |||||
| but_prev = but; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| /* handle pending stuff */ | /* handle pending stuff */ | ||||
| if (block->layouts.first) { | if (block->layouts.first) { | ||||
| UI_block_layout_resolve(block, NULL, NULL); | UI_block_layout_resolve(block, NULL, NULL); | ||||
| } | } | ||||
| ui_block_align_calc(block); | ui_block_align_calc(block); | ||||
| if ((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) { | if ((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) { | ||||
| ui_menu_block_set_keyaccels(block); /* could use a different flag to check */ | ui_menu_block_set_keyaccels(block); /* could use a different flag to check */ | ||||
| ▲ Show 20 Lines • Show All 3,475 Lines • Show Last 20 Lines | |||||