Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_topbar/space_topbar.c
| Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
| static void topbar_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region) | static void topbar_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region) | ||||
| { | { | ||||
| if (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_RIGHT) { | if (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_RIGHT) { | ||||
| region->flag |= RGN_FLAG_DYNAMIC_SIZE; | region->flag |= RGN_FLAG_DYNAMIC_SIZE; | ||||
| } | } | ||||
| ED_region_header_init(region); | ED_region_header_init(region); | ||||
| } | } | ||||
| static void topbar_main_region_listener(wmWindow *UNUSED(win), | static void topbar_main_region_listener(const wmRegionListenerParams *params) | ||||
| ScrArea *UNUSED(area), | |||||
| ARegion *region, | |||||
| wmNotifier *wmn, | |||||
| const Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ARegion *region = params->region; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_WM: | case NC_WM: | ||||
| if (wmn->data == ND_HISTORY) { | if (wmn->data == ND_HISTORY) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| case NC_SCENE: | case NC_SCENE: | ||||
| Show All 9 Lines | switch (wmn->category) { | ||||
| case NC_GPENCIL: | case NC_GPENCIL: | ||||
| if (wmn->data == ND_DATA) { | if (wmn->data == ND_DATA) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void topbar_header_listener(wmWindow *UNUSED(win), | static void topbar_header_listener(const wmRegionListenerParams *params) | ||||
| ScrArea *UNUSED(area), | |||||
| ARegion *region, | |||||
| wmNotifier *wmn, | |||||
| const Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ARegion *region = params->region; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_WM: | case NC_WM: | ||||
| if (wmn->data == ND_JOB) { | if (wmn->data == ND_JOB) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| case NC_SPACE: | case NC_SPACE: | ||||
| Show All 9 Lines | switch (wmn->category) { | ||||
| case NC_SCENE: | case NC_SCENE: | ||||
| if (wmn->data == ND_SCENEBROWSE) { | if (wmn->data == ND_SCENEBROWSE) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void topbar_header_region_message_subscribe(const struct bContext *UNUSED(C), | static void topbar_header_region_message_subscribe(const wmRegionMessageSubscribeParams *params) | ||||
| struct WorkSpace *workspace, | |||||
| struct Scene *UNUSED(scene), | |||||
| struct bScreen *UNUSED(screen), | |||||
| struct ScrArea *UNUSED(area), | |||||
| struct ARegion *region, | |||||
| struct wmMsgBus *mbus) | |||||
| { | { | ||||
| struct wmMsgBus *mbus = params->message_bus; | |||||
| WorkSpace *workspace = params->workspace; | |||||
| ARegion *region = params->region; | |||||
| wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { | wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { | ||||
| .owner = region, | .owner = region, | ||||
| .user_data = region, | .user_data = region, | ||||
| .notify = ED_region_do_msg_notify_tag_redraw, | .notify = ED_region_do_msg_notify_tag_redraw, | ||||
| }; | }; | ||||
| WM_msg_subscribe_rna_prop( | WM_msg_subscribe_rna_prop( | ||||
| mbus, &workspace->id, workspace, WorkSpace, tools, &msg_sub_value_region_tag_redraw); | mbus, &workspace->id, workspace, WorkSpace, tools, &msg_sub_value_region_tag_redraw); | ||||
| ▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines | |||||