Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/space_graph.c
| Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | |||||
| static void graph_main_region_draw(const bContext *C, ARegion *region) | static void graph_main_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| /* draw entirely, view changes should be handled here */ | /* draw entirely, view changes should be handled here */ | ||||
| SpaceGraph *sipo = CTX_wm_space_graph(C); | SpaceGraph *sipo = CTX_wm_space_graph(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| bAnimContext ac; | bAnimContext ac; | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| View2DScrollers *scrollers; | |||||
| float col[3]; | float col[3]; | ||||
| short cfra_flag = 0; | short cfra_flag = 0; | ||||
| /* clear and setup matrix */ | /* clear and setup matrix */ | ||||
| UI_GetThemeColor3fv(TH_BACK, col); | UI_GetThemeColor3fv(TH_BACK, col); | ||||
| GPU_clear_color(col[0], col[1], col[2], 0.0); | GPU_clear_color(col[0], col[1], col[2], 0.0); | ||||
| GPU_clear(GPU_COLOR_BIT); | GPU_clear(GPU_COLOR_BIT); | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | static void graph_main_region_draw(const bContext *C, ARegion *region) | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| /* time-scrubbing */ | /* time-scrubbing */ | ||||
| ED_time_scrub_draw(region, scene, display_seconds, false); | ED_time_scrub_draw(region, scene, display_seconds, false); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| // FIXME: args for scrollers depend on the type of data being shown... | // FIXME: args for scrollers depend on the type of data being shown... | ||||
| scrollers = UI_view2d_scrollers_calc(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| UI_view2d_scrollers_draw(v2d, scrollers); | |||||
| UI_view2d_scrollers_free(scrollers); | |||||
| /* scale numbers */ | /* scale numbers */ | ||||
| { | { | ||||
| rcti rect; | rcti rect; | ||||
| BLI_rcti_init( | BLI_rcti_init( | ||||
| &rect, 0, 15 * UI_DPI_FAC, 15 * UI_DPI_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y); | &rect, 0, 15 * UI_DPI_FAC, 15 * UI_DPI_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y); | ||||
| UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_SCROLL_TEXT); | UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_SCROLL_TEXT); | ||||
| } | } | ||||
| Show All 20 Lines | static void graph_channel_region_init(wmWindowManager *wm, ARegion *region) | ||||
| keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_GRAPH, 0); | keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_GRAPH, 0); | ||||
| WM_event_add_keymap_handler(®ion->handlers, keymap); | WM_event_add_keymap_handler(®ion->handlers, keymap); | ||||
| } | } | ||||
| static void graph_channel_region_draw(const bContext *C, ARegion *region) | static void graph_channel_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| bAnimContext ac; | bAnimContext ac; | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| View2DScrollers *scrollers; | |||||
| float col[3]; | float col[3]; | ||||
| /* clear and setup matrix */ | /* clear and setup matrix */ | ||||
| UI_GetThemeColor3fv(TH_BACK, col); | UI_GetThemeColor3fv(TH_BACK, col); | ||||
| GPU_clear_color(col[0], col[1], col[2], 0.0); | GPU_clear_color(col[0], col[1], col[2], 0.0); | ||||
| GPU_clear(GPU_COLOR_BIT); | GPU_clear(GPU_COLOR_BIT); | ||||
| UI_view2d_view_ortho(v2d); | UI_view2d_view_ortho(v2d); | ||||
| /* draw channels */ | /* draw channels */ | ||||
| if (ANIM_animdata_get_context(C, &ac)) { | if (ANIM_animdata_get_context(C, &ac)) { | ||||
| graph_draw_channel_names((bContext *)C, &ac, region); | graph_draw_channel_names((bContext *)C, &ac, region); | ||||
| } | } | ||||
| /* channel filter next to scrubbing area */ | /* channel filter next to scrubbing area */ | ||||
| ED_time_scrub_channel_search_draw(C, region, ac.ads); | ED_time_scrub_channel_search_draw(C, region, ac.ads); | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| scrollers = UI_view2d_scrollers_calc(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| UI_view2d_scrollers_draw(v2d, scrollers); | |||||
| UI_view2d_scrollers_free(scrollers); | |||||
| } | } | ||||
| /* add handlers, stuff you only do once or on area/region changes */ | /* add handlers, stuff you only do once or on area/region changes */ | ||||
| static void graph_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region) | static void graph_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region) | ||||
| { | { | ||||
| ED_region_header_init(region); | ED_region_header_init(region); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 516 Lines • Show Last 20 Lines | |||||