Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/include/UI_view2d.h
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | enum eView2D_CommonViewTypes { | ||||
| V2D_COMMONVIEW_PANELS_UI, | V2D_COMMONVIEW_PANELS_UI, | ||||
| }; | }; | ||||
| /* ---- Defines for Scroller Arguments ----- */ | /* ---- Defines for Scroller Arguments ----- */ | ||||
| /* ------ Defines for Scrollers ----- */ | /* ------ Defines for Scrollers ----- */ | ||||
| /** Scroll bar area. */ | /** Scroll bar area. */ | ||||
| #define V2D_SCROLL_HEIGHT (0.45f * U.widget_unit) | |||||
| #define V2D_SCROLL_WIDTH (0.45f * U.widget_unit) | /* Maximum has to include outline which varies with line width. */ | ||||
| #define V2D_SCROLL_HEIGHT ((0.45f * U.widget_unit) + (2.0f * U.pixelsize)) | |||||
| #define V2D_SCROLL_WIDTH ((0.45f * U.widget_unit) + (2.0f * U.pixelsize)) | |||||
| /* Alpha of scrollbar when at minimum size. */ | |||||
| #define V2D_SCROLL_MIN_ALPHA (0.4f) | |||||
| /* Minimum size needs to include outline which varies with line width. */ | |||||
| #define V2D_SCROLL_MIN_WIDTH ((5.0f * U.dpi_fac) + (2.0f * U.pixelsize)) | |||||
| /* When to start showing the full-width scroller. */ | |||||
| #define V2D_SCROLL_HIDE_WIDTH (AREAMINX * U.dpi_fac) | |||||
| #define V2D_SCROLL_HIDE_HEIGHT (HEADERY * U.dpi_fac) | |||||
| /** Scroll bars with 'handles' used for scale (zoom). */ | /** Scroll bars with 'handles' used for scale (zoom). */ | ||||
| #define V2D_SCROLL_HANDLE_HEIGHT (0.6f * U.widget_unit) | #define V2D_SCROLL_HANDLE_HEIGHT (0.6f * U.widget_unit) | ||||
| #define V2D_SCROLL_HANDLE_WIDTH (0.6f * U.widget_unit) | #define V2D_SCROLL_HANDLE_WIDTH (0.6f * U.widget_unit) | ||||
| /** Scroll bar with 'handles' hot-spot radius for cursor proximity. */ | /** Scroll bar with 'handles' hot-spot radius for cursor proximity. */ | ||||
| #define V2D_SCROLL_HANDLE_SIZE_HOTSPOT (0.6f * U.widget_unit) | #define V2D_SCROLL_HANDLE_SIZE_HOTSPOT (0.6f * U.widget_unit) | ||||
| /** Don't allow scroll thumb to show below this size (so it's never too small to click on). */ | /** Don't allow scroll thumb to show below this size (so it's never too small to click on). */ | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | |||||
| /* Scroll-bar drawing. */ | /* Scroll-bar drawing. */ | ||||
| /** | /** | ||||
| * Calculate relevant scroller properties. | * Calculate relevant scroller properties. | ||||
| */ | */ | ||||
| void UI_view2d_scrollers_calc(struct View2D *v2d, | void UI_view2d_scrollers_calc(struct View2D *v2d, | ||||
| const struct rcti *mask_custom, | const struct rcti *mask_custom, | ||||
| struct View2DScrollers *r_scrollers); | struct View2DScrollers *r_scrollers); | ||||
| /** | /** | ||||
| * Draw scroll-bars in the given 2D-region. | * Draw scroll-bars in the given 2D-region. | ||||
| */ | */ | ||||
| void UI_view2d_scrollers_draw_ex(struct View2D *v2d, | |||||
| const struct rcti *mask_custom, | |||||
| bool use_full_hide); | |||||
| void UI_view2d_scrollers_draw(struct View2D *v2d, const struct rcti *mask_custom); | void UI_view2d_scrollers_draw(struct View2D *v2d, const struct rcti *mask_custom); | ||||
| /* List view tools. */ | /* List view tools. */ | ||||
| /** | /** | ||||
| * Get the 'cell' (row, column) that the given 2D-view coordinates | * Get the 'cell' (row, column) that the given 2D-view coordinates | ||||
| * (i.e. in 'tot' rect space) lie in. | * (i.e. in 'tot' rect space) lie in. | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| * View2D data by default resides in region, so get from region stored in context. | * View2D data by default resides in region, so get from region stored in context. | ||||
| */ | */ | ||||
| struct View2D *UI_view2d_fromcontext(const struct bContext *C); | struct View2D *UI_view2d_fromcontext(const struct bContext *C); | ||||
| /** | /** | ||||
| * Same as above, but it returns region-window. Utility for pull-downs or buttons. | * Same as above, but it returns region-window. Utility for pull-downs or buttons. | ||||
| */ | */ | ||||
| struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C); | struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C); | ||||
| /** | /** | ||||
campbellbarton: Keep the return arguments last, also add a doc-string for `mapped`. | |||||
| * Get scrollbar sizes of the current 2D view. | * Get scrollbar sizes of the current 2D view. | ||||
| * The size will be zero if the view has its scrollbars disabled. | * The size will be zero if the view has its scrollbars disabled. | ||||
| * | |||||
| * \param mapped: whether to use view2d_scroll_mapped which changes flags | |||||
| */ | */ | ||||
| void UI_view2d_scroller_size_get(const struct View2D *v2d, float *r_x, float *r_y); | void UI_view2d_scroller_size_get(const struct View2D *v2d, bool mapped, float *r_x, float *r_y); | ||||
| /** | /** | ||||
| * Calculate the scale per-axis of the drawing-area | * Calculate the scale per-axis of the drawing-area | ||||
| * | * | ||||
| * Is used to inverse correct drawing of icons, etc. that need to follow view | * Is used to inverse correct drawing of icons, etc. that need to follow view | ||||
| * but not be affected by scale | * but not be affected by scale | ||||
| * | * | ||||
| * \param r_x, r_y: scale on each axis | * \param r_x, r_y: scale on each axis | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines | |||||
Keep the return arguments last, also add a doc-string for mapped.