Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/include/UI_view2d.h
| Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | enum eView2D_CommonViewTypes { | ||||
| /* stackview (this is basically a list where new items are added at the top) */ | /* stackview (this is basically a list where new items are added at the top) */ | ||||
| V2D_COMMONVIEW_STACK, | V2D_COMMONVIEW_STACK, | ||||
| /* headers (this is basically the same as listview, but no y-panning) */ | /* headers (this is basically the same as listview, but no y-panning) */ | ||||
| V2D_COMMONVIEW_HEADER, | V2D_COMMONVIEW_HEADER, | ||||
| /* ui region containing panels */ | /* ui region containing panels */ | ||||
| V2D_COMMONVIEW_PANELS_UI, | V2D_COMMONVIEW_PANELS_UI, | ||||
| }; | }; | ||||
| /* ---- Defines for Scroller/Grid Arguments ----- */ | /* ---- Defines for Scroller Arguments ----- */ | ||||
| /* 'dummy' argument to pass when argument is irrelevant */ | |||||
| #define V2D_ARG_DUMMY -1 | |||||
| /* Grid units */ | |||||
| enum eView2D_Units { | |||||
| /* for drawing time */ | |||||
| V2D_UNIT_SECONDS = 0, | |||||
| V2D_UNIT_FRAMES, | |||||
| V2D_UNIT_FRAMESCALE, | |||||
| /* for drawing values */ | |||||
| V2D_UNIT_VALUES, | |||||
| }; | |||||
| /* clamping of grid values to whole numbers */ | |||||
| enum eView2D_Clamp { | |||||
| V2D_GRID_NOCLAMP = 0, | |||||
| V2D_GRID_CLAMP, | |||||
| }; | |||||
| /* flags for grid-lines to draw */ | |||||
| enum eView2D_Gridlines { | |||||
| V2D_HORIZONTAL_LINES = (1 << 0), | |||||
| V2D_VERTICAL_LINES = (1 << 1), | |||||
| V2D_HORIZONTAL_AXIS = (1 << 2), | |||||
| V2D_VERTICAL_AXIS = (1 << 3), | |||||
| V2D_HORIZONTAL_FINELINES = (1 << 4), | |||||
| V2D_GRIDLINES_MAJOR = (V2D_VERTICAL_LINES | V2D_VERTICAL_AXIS | V2D_HORIZONTAL_LINES | | |||||
| V2D_HORIZONTAL_AXIS), | |||||
| V2D_GRIDLINES_ALL = (V2D_GRIDLINES_MAJOR | V2D_HORIZONTAL_FINELINES), | |||||
| }; | |||||
| /* ------ Defines for Scrollers ----- */ | /* ------ Defines for Scrollers ----- */ | ||||
| /* scroller area */ | /* scroller area */ | ||||
| #define V2D_SCROLL_HEIGHT (0.45f * U.widget_unit) | #define V2D_SCROLL_HEIGHT (0.45f * U.widget_unit) | ||||
| #define V2D_SCROLL_WIDTH (0.45f * U.widget_unit) | #define V2D_SCROLL_WIDTH (0.45f * U.widget_unit) | ||||
| /* For scrollers with scale markings (text written onto them) */ | /* For scrollers with scale markings (text written onto them) */ | ||||
| #define V2D_SCROLL_HEIGHT_TEXT (0.79f * U.widget_unit) | #define V2D_SCROLL_HEIGHT_TEXT (0.79f * U.widget_unit) | ||||
| Show All 18 Lines | |||||
| #define IN_2D_VERT_SCROLL_RECT(v2d, rct) (BLI_rcti_isect(&v2d->vert, rct, NULL)) | #define IN_2D_VERT_SCROLL_RECT(v2d, rct) (BLI_rcti_isect(&v2d->vert, rct, NULL)) | ||||
| #define IN_2D_HORIZ_SCROLL_RECT(v2d, rct) (BLI_rcti_isect(&v2d->hor, rct, NULL)) | #define IN_2D_HORIZ_SCROLL_RECT(v2d, rct) (BLI_rcti_isect(&v2d->hor, rct, NULL)) | ||||
| /* ------------------------------------------ */ | /* ------------------------------------------ */ | ||||
| /* Type definitions: */ | /* Type definitions: */ | ||||
| struct View2D; | struct View2D; | ||||
| struct View2DGrid; | |||||
| struct View2DScrollers; | struct View2DScrollers; | ||||
| struct ARegion; | struct ARegion; | ||||
| struct Scene; | struct Scene; | ||||
| struct ScrArea; | struct ScrArea; | ||||
| struct bContext; | struct bContext; | ||||
| struct bScreen; | struct bScreen; | ||||
| struct rctf; | struct rctf; | ||||
| struct wmKeyConfig; | struct wmKeyConfig; | ||||
| typedef struct View2DGrid View2DGrid; | |||||
| typedef struct View2DScrollers View2DScrollers; | typedef struct View2DScrollers View2DScrollers; | ||||
| /* ----------------------------------------- */ | /* ----------------------------------------- */ | ||||
| /* Prototypes: */ | /* Prototypes: */ | ||||
| /* refresh and validation (of view rects) */ | /* refresh and validation (of view rects) */ | ||||
| void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy); | void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy); | ||||
| void UI_view2d_curRect_validate(struct View2D *v2d); | void UI_view2d_curRect_validate(struct View2D *v2d); | ||||
| void UI_view2d_curRect_reset(struct View2D *v2d); | void UI_view2d_curRect_reset(struct View2D *v2d); | ||||
| void UI_view2d_sync(struct bScreen *screen, struct ScrArea *sa, struct View2D *v2dcur, int flag); | void UI_view2d_sync(struct bScreen *screen, struct ScrArea *sa, struct View2D *v2dcur, int flag); | ||||
| void UI_view2d_totRect_set(struct View2D *v2d, int width, int height); | void UI_view2d_totRect_set(struct View2D *v2d, int width, int height); | ||||
| void UI_view2d_totRect_set_resize(struct View2D *v2d, int width, int height, bool resize); | void UI_view2d_totRect_set_resize(struct View2D *v2d, int width, int height, bool resize); | ||||
| void UI_view2d_mask_from_win(const struct View2D *v2d, struct rcti *r_mask); | void UI_view2d_mask_from_win(const struct View2D *v2d, struct rcti *r_mask); | ||||
| /* per tab offsets, returns 1 if tab changed */ | /* per tab offsets, returns 1 if tab changed */ | ||||
| bool UI_view2d_tab_set(struct View2D *v2d, int tab); | bool UI_view2d_tab_set(struct View2D *v2d, int tab); | ||||
| void UI_view2d_zoom_cache_reset(void); | void UI_view2d_zoom_cache_reset(void); | ||||
| /* view matrix operations */ | /* view matrix operations */ | ||||
| void UI_view2d_view_ortho(struct View2D *v2d); | void UI_view2d_view_ortho(const struct View2D *v2d); | ||||
| void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, const bool xaxis); | void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, const bool xaxis); | ||||
| void UI_view2d_view_restore(const struct bContext *C); | void UI_view2d_view_restore(const struct bContext *C); | ||||
| /* grid drawing */ | /* grid drawing */ | ||||
| View2DGrid *UI_view2d_grid_calc(struct Scene *scene, | |||||
| struct View2D *v2d, | |||||
| short xunits, | |||||
| short xclamp, | |||||
| short yunits, | |||||
| short yclamp, | |||||
| int winx, | |||||
| int winy); | |||||
| void UI_view2d_grid_draw(struct View2D *v2d, View2DGrid *grid, int flag); | |||||
| void UI_view2d_constant_grid_draw(struct View2D *v2d, float step); | void UI_view2d_constant_grid_draw(struct View2D *v2d, float step); | ||||
| void UI_view2d_multi_grid_draw( | void UI_view2d_multi_grid_draw( | ||||
| struct View2D *v2d, int colorid, float step, int level_size, int totlevels); | struct View2D *v2d, int colorid, float step, int level_size, int totlevels); | ||||
| void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy); | |||||
| void UI_view2d_grid_draw_numbers_horizontal(const struct Scene *scene, | void UI_view2d_draw_lines_y__values(const struct View2D *v2d); | ||||
| void UI_view2d_draw_lines_x__values(const struct View2D *v2d); | |||||
| void UI_view2d_draw_lines_x__discrete_values(const struct View2D *v2d); | |||||
| void UI_view2d_draw_lines_x__discrete_time(const struct View2D *v2d, const struct Scene *scene); | |||||
| void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const struct View2D *v2d, | |||||
| const struct Scene *scene, | |||||
| bool display_seconds); | |||||
| void UI_view2d_draw_lines_x__frames_or_seconds(const struct View2D *v2d, | |||||
| const struct Scene *scene, | |||||
| bool display_seconds); | |||||
| float UI_view2d_grid_resolution_x__frames_or_seconds(const struct View2D *v2d, | |||||
| const struct Scene *scene, | |||||
| bool display_seconds); | |||||
| float UI_view2d_grid_resolution_y__values(const struct View2D *v2d); | |||||
| /* scale indicator text drawing */ | |||||
| void UI_view2d_draw_scale_y__values(const struct ARegion *ar, | |||||
| const struct View2D *v2d, | |||||
| const struct rcti *rect); | |||||
| void UI_view2d_draw_scale_y__block(const struct ARegion *ar, | |||||
| const struct View2D *v2d, | |||||
| const struct rcti *rect); | |||||
| void UI_view2d_draw_scale_x__values(const struct ARegion *ar, | |||||
| const struct View2D *v2d, | |||||
| const struct rcti *rect); | |||||
| void UI_view2d_draw_scale_x__discrete_values(const struct ARegion *ar, | |||||
| const struct View2D *v2d, | |||||
| const struct rcti *rect); | |||||
| void UI_view2d_draw_scale_x__discrete_time(const struct ARegion *ar, | |||||
| const struct View2D *v2d, | |||||
| const struct rcti *rect, | |||||
| const struct Scene *scene); | |||||
| void UI_view2d_draw_scale_x__discrete_frames_or_seconds(const struct ARegion *ar, | |||||
| const struct View2D *v2d, | const struct View2D *v2d, | ||||
| const View2DGrid *grid, | |||||
| const struct rcti *rect, | const struct rcti *rect, | ||||
| int unit, | const struct Scene *scene, | ||||
| bool whole_numbers_only); | bool display_seconds); | ||||
| void UI_view2d_grid_draw_numbers_vertical(const struct Scene *scene, | void UI_view2d_draw_scale_x__frames_or_seconds(const struct ARegion *ar, | ||||
| const struct View2D *v2d, | const struct View2D *v2d, | ||||
| const View2DGrid *grid, | |||||
| const struct rcti *rect, | const struct rcti *rect, | ||||
| int unit, | const struct Scene *scene, | ||||
| float text_offset); | bool display_seconds); | ||||
| void UI_view2d_grid_free(View2DGrid *grid); | |||||
| /* scrollbar drawing */ | /* scrollbar drawing */ | ||||
| View2DScrollers *UI_view2d_scrollers_calc(struct View2D *v2d, const struct rcti *mask_custom); | View2DScrollers *UI_view2d_scrollers_calc(struct View2D *v2d, const struct rcti *mask_custom); | ||||
| void UI_view2d_scrollers_draw(struct View2D *v2d, View2DScrollers *scrollers); | void UI_view2d_scrollers_draw(struct View2D *v2d, View2DScrollers *scrollers); | ||||
| void UI_view2d_scrollers_free(View2DScrollers *scrollers); | void UI_view2d_scrollers_free(View2DScrollers *scrollers); | ||||
| /* list view tools */ | /* list view tools */ | ||||
| void UI_view2d_listview_cell_to_view(struct View2D *v2d, | void UI_view2d_listview_cell_to_view(struct View2D *v2d, | ||||
| ▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines | |||||