Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/space_graph.c
| Show First 20 Lines • Show All 397 Lines • ▼ Show 20 Lines | static void graph_buttons_region_init(wmWindowManager *wm, ARegion *region) | ||||
| WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap); | WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap); | ||||
| } | } | ||||
| static void graph_buttons_region_draw(const bContext *C, ARegion *region) | static void graph_buttons_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| ED_region_panels(C, region); | ED_region_panels(C, region); | ||||
| } | } | ||||
| static void graph_region_listener(wmWindow *UNUSED(win), | static void graph_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 20 Lines • Show All 45 Lines • ▼ Show 20 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 graph_region_message_subscribe(const struct bContext *UNUSED(C), | static void graph_region_message_subscribe(const wmRegionMessageSubscribeParams *params) | ||||
| struct WorkSpace *UNUSED(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_SpaceGraphEditor, area->spacedata.first, &ptr); | RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, 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 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | 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__); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* editor level listener */ | /* editor level listener */ | ||||
| static void graph_listener(wmWindow *UNUSED(win), | static void graph_listener(const wmSpaceTypeListenerParams *params) | ||||
| ScrArea *area, | |||||
| wmNotifier *wmn, | |||||
| Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ScrArea *area = params->area; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| SpaceGraph *sipo = (SpaceGraph *)area->spacedata.first; | SpaceGraph *sipo = (SpaceGraph *)area->spacedata.first; | ||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_ANIMATION: | case NC_ANIMATION: | ||||
| /* for selection changes of animation data, we can just redraw... | /* for selection changes of animation data, we can just redraw... | ||||
| * otherwise autocolor might need to be done again */ | * otherwise autocolor might need to be done again */ | ||||
| if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED)) { | if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED)) { | ||||
| ▲ Show 20 Lines • Show All 343 Lines • Show Last 20 Lines | |||||