Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_action/space_action.c
| Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | static void action_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region) | ||||
| ED_region_header_init(region); | ED_region_header_init(region); | ||||
| } | } | ||||
| static void action_header_region_draw(const bContext *C, ARegion *region) | static void action_header_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| ED_region_header(C, region); | ED_region_header(C, region); | ||||
| } | } | ||||
| static void action_channel_region_listener(wmWindow *UNUSED(win), | static void action_channel_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_ANIMATION: | case NC_ANIMATION: | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| break; | break; | ||||
| case NC_SCENE: | case NC_SCENE: | ||||
| switch (wmn->data) { | switch (wmn->data) { | ||||
| case ND_OB_ACTIVE: | case ND_OB_ACTIVE: | ||||
| Show All 29 Lines | switch (wmn->category) { | ||||
| default: | default: | ||||
| if (wmn->data == ND_KEYS) { | if (wmn->data == ND_KEYS) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void saction_channel_region_message_subscribe(const struct bContext *UNUSED(C), | static void saction_channel_region_message_subscribe(const wmRegionMessageSubscribeParams *params) | ||||
| struct WorkSpace *UNUSED(workspace), | |||||
| struct Scene *UNUSED(scene), | |||||
| struct bScreen *screen, | |||||
| struct ScrArea *area, | |||||
| struct ARegion *region, | |||||
| struct wmMsgBus *mbus) | |||||
| { | { | ||||
| struct wmMsgBus *mbus = params->message_bus; | |||||
| bScreen *screen = params->screen; | |||||
| ScrArea *area = params->area; | |||||
| ARegion *region = params->region; | |||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr); | RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr); | ||||
| 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, | ||||
| }; | }; | ||||
| Show All 21 Lines | */ | ||||
| for (int i = 0; i < ARRAY_SIZE(type_array); i++) { | for (int i = 0; i < ARRAY_SIZE(type_array); i++) { | ||||
| msg_key_params.ptr.type = type_array[i]; | msg_key_params.ptr.type = type_array[i]; | ||||
| WM_msg_subscribe_rna_params( | WM_msg_subscribe_rna_params( | ||||
| mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__); | mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void action_main_region_listener(wmWindow *UNUSED(win), | static void action_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_ANIMATION: | case NC_ANIMATION: | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| break; | break; | ||||
| case NC_SCENE: | case NC_SCENE: | ||||
| switch (wmn->data) { | switch (wmn->data) { | ||||
| case ND_RENDER_OPTIONS: | case ND_RENDER_OPTIONS: | ||||
| Show All 37 Lines | switch (wmn->category) { | ||||
| default: | default: | ||||
| if (wmn->data == ND_KEYS) { | if (wmn->data == ND_KEYS) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void saction_main_region_message_subscribe(const struct bContext *C, | static void saction_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params) | ||||
| struct WorkSpace *workspace, | |||||
| struct Scene *scene, | |||||
| struct bScreen *screen, | |||||
| struct ScrArea *area, | |||||
| struct ARegion *region, | |||||
| struct wmMsgBus *mbus) | |||||
| { | { | ||||
| struct wmMsgBus *mbus = params->message_bus; | |||||
| Scene *scene = params->scene; | |||||
| bScreen *screen = params->screen; | |||||
| ScrArea *area = params->area; | |||||
| ARegion *region = params->region; | |||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr); | RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr); | ||||
| 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, | ||||
| }; | }; | ||||
| Show All 18 Lines | /* Timeline depends on scene properties. */ | ||||
| RNA_id_pointer_create(&scene->id, &idptr); | RNA_id_pointer_create(&scene->id, &idptr); | ||||
| for (int i = 0; i < ARRAY_SIZE(props); i++) { | for (int i = 0; i < ARRAY_SIZE(props); i++) { | ||||
| WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__); | WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__); | ||||
| } | } | ||||
| } | } | ||||
| /* Now run the general "channels region" one - since channels and main should be in sync */ | /* Now run the general "channels region" one - since channels and main should be in sync */ | ||||
| saction_channel_region_message_subscribe(C, workspace, scene, screen, area, region, mbus); | saction_channel_region_message_subscribe(params); | ||||
| } | } | ||||
| /* editor level listener */ | /* editor level listener */ | ||||
| static void action_listener(wmWindow *UNUSED(win), | static void action_listener(const wmSpaceTypeListenerParams *params) | ||||
| ScrArea *area, | |||||
| wmNotifier *wmn, | |||||
| Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ScrArea *area = params->area; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| SpaceAction *saction = (SpaceAction *)area->spacedata.first; | SpaceAction *saction = (SpaceAction *)area->spacedata.first; | ||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_GPENCIL: | case NC_GPENCIL: | ||||
| /* only handle these events in GPencil mode for performance considerations */ | /* only handle these events in GPencil mode for performance considerations */ | ||||
| if (saction->mode == SACTCONT_GPENCIL) { | if (saction->mode == SACTCONT_GPENCIL) { | ||||
| if (wmn->action == NA_EDITED) { | if (wmn->action == NA_EDITED) { | ||||
| ▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | case NC_WM: | ||||
| case ND_FILEREAD: | case ND_FILEREAD: | ||||
| ED_area_tag_refresh(area); | ED_area_tag_refresh(area); | ||||
| break; | break; | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void action_header_region_listener(wmWindow *UNUSED(win), | static void action_header_region_listener(const wmRegionListenerParams *params) | ||||
| ScrArea *area, | |||||
| ARegion *region, | |||||
| wmNotifier *wmn, | |||||
| const Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ScrArea *area = params->area; | |||||
| ARegion *region = params->region; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| SpaceAction *saction = (SpaceAction *)area->spacedata.first; | SpaceAction *saction = (SpaceAction *)area->spacedata.first; | ||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_SCREEN: | case NC_SCREEN: | ||||
| if (saction->mode == SACTCONT_TIMELINE) { | if (saction->mode == SACTCONT_TIMELINE) { | ||||
| if (wmn->data == ND_ANIMPLAY) { | if (wmn->data == ND_ANIMPLAY) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | static void action_buttons_area_init(wmWindowManager *wm, ARegion *region) | ||||
| WM_event_add_keymap_handler(®ion->handlers, keymap); | WM_event_add_keymap_handler(®ion->handlers, keymap); | ||||
| } | } | ||||
| static void action_buttons_area_draw(const bContext *C, ARegion *region) | static void action_buttons_area_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| ED_region_panels(C, region); | ED_region_panels(C, region); | ||||
| } | } | ||||
| static void action_region_listener(wmWindow *UNUSED(win), | static void action_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_ANIMATION: | case NC_ANIMATION: | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| break; | break; | ||||
| case NC_SCENE: | case NC_SCENE: | ||||
| switch (wmn->data) { | switch (wmn->data) { | ||||
| case ND_OB_ACTIVE: | case ND_OB_ACTIVE: | ||||
| ▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines | |||||