Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/space_graph.c
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| #include "WM_message.h" | #include "WM_message.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #include "UI_interface.h" | |||||
| #include "graph_intern.h" // own include | #include "graph_intern.h" // own include | ||||
| /* ******************** default callbacks for ipo space ***************** */ | /* ******************** default callbacks for ipo space ***************** */ | ||||
| static SpaceLink *graph_new(const ScrArea *UNUSED(sa), const Scene *scene) | static SpaceLink *graph_new(const ScrArea *UNUSED(sa), const Scene *scene) | ||||
| { | { | ||||
| ARegion *ar; | ARegion *ar; | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | static SpaceLink *graph_new(const ScrArea *UNUSED(sa), const Scene *scene) | ||||
| ar->v2d.cur = ar->v2d.tot; | ar->v2d.cur = ar->v2d.tot; | ||||
| ar->v2d.min[0] = FLT_MIN; | ar->v2d.min[0] = FLT_MIN; | ||||
| ar->v2d.min[1] = FLT_MIN; | ar->v2d.min[1] = FLT_MIN; | ||||
| ar->v2d.max[0] = MAXFRAMEF; | ar->v2d.max[0] = MAXFRAMEF; | ||||
| ar->v2d.max[1] = FLT_MAX; | ar->v2d.max[1] = FLT_MAX; | ||||
| ar->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL); | ar->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES); | ||||
| ar->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_SCALE_VERTICAL); | ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HANDLES); | ||||
| ar->v2d.keeptot = 0; | ar->v2d.keeptot = 0; | ||||
| return (SpaceLink *)sipo; | return (SpaceLink *)sipo; | ||||
| } | } | ||||
| /* not spacelink itself */ | /* not spacelink itself */ | ||||
| static void graph_free(SpaceLink *sl) | static void graph_free(SpaceLink *sl) | ||||
| ▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | static void graph_main_region_draw(const bContext *C, ARegion *ar) | ||||
| /* 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); | scrollers = UI_view2d_scrollers_calc(v2d, NULL); | ||||
| UI_view2d_scrollers_draw(v2d, scrollers); | UI_view2d_scrollers_draw(v2d, scrollers); | ||||
| UI_view2d_scrollers_free(scrollers); | UI_view2d_scrollers_free(scrollers); | ||||
| /* scale numbers */ | /* scale numbers */ | ||||
| UI_view2d_draw_scale_y__values(ar, v2d, &v2d->vert, TH_SCROLL_TEXT); | { | ||||
| rcti rect; | |||||
| BLI_rcti_init(&rect, | |||||
| 0, | |||||
| 15 * UI_DPI_FAC, | |||||
| 15 * UI_DPI_FAC, | |||||
| UI_DPI_FAC * ar->sizey - UI_SCRUBBING_MARGIN_Y); | |||||
| UI_view2d_draw_scale_y__values(ar, v2d, &rect, TH_SCROLL_TEXT); | |||||
| } | |||||
| } | } | ||||
| static void graph_channel_region_init(wmWindowManager *wm, ARegion *ar) | static void graph_channel_region_init(wmWindowManager *wm, ARegion *ar) | ||||
| { | { | ||||
| wmKeyMap *keymap; | wmKeyMap *keymap; | ||||
| /* make sure we keep the hide flags */ | /* make sure we keep the hide flags */ | ||||
| ar->v2d.scroll |= V2D_SCROLL_RIGHT; | ar->v2d.scroll |= V2D_SCROLL_RIGHT; | ||||
| ▲ Show 20 Lines • Show All 563 Lines • Show Last 20 Lines | |||||