Blender V5.3
UI_view2d.hh File Reference
#include "BLI_compiler_attrs.hh"
#include "BLI_rect.hh"

Go to the source code of this file.

Classes

struct  blender::ui::View2DEdgePanData

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ui

Macros

Defines for Scroll Bars
#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))
#define V2D_SCROLL_MIN_ALPHA   (0.4f)
#define V2D_SCROLL_MIN_WIDTH   ((5.0f * UI_SCALE_FAC) + (2.0f * U.pixelsize))
#define V2D_SCROLL_HIDE_WIDTH   (AREAMINX * UI_SCALE_FAC)
#define V2D_SCROLL_HIDE_HEIGHT   (HEADERY * UI_SCALE_FAC)
#define V2D_SCROLL_HANDLE_HEIGHT   (0.6f * U.widget_unit)
#define V2D_SCROLL_HANDLE_WIDTH   (0.6f * U.widget_unit)
#define V2D_SCROLL_HANDLE_SIZE_HOTSPOT   (0.6f * U.widget_unit)
#define V2D_SCROLL_THUMB_SIZE_MIN   (30.0 * UI_SCALE_FAC)
Define for #view2d_sync
#define V2D_LOCK_SET   0
#define V2D_LOCK_COPY   1
Macros
#define IN_2D_VERT_SCROLL(v2d, co)
#define IN_2D_HORIZ_SCROLL(v2d, co)
#define IN_2D_VERT_SCROLL_RECT(v2d, rct)
#define IN_2D_HORIZ_SCROLL_RECT(v2d, rct)

Functions

Prototypes
void blender::ui::view2d_region_reinit (View2D *v2d, short type, int winx, int winy)
void blender::ui::view2d_curRect_validate (View2D *v2d)
void blender::ui::view2d_curRect_reset (View2D *v2d)
bool blender::ui::view2d_area_supports_sync (ScrArea *area)
void blender::ui::view2d_sync (bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
void blender::ui::view2d_curRect_changed (const bContext *C, View2D *v2d)
void blender::ui::view2d_totRect_set (View2D *v2d, int width, int height)
void blender::ui::view2d_mask_from_win (const View2D *v2d, rcti *r_mask)
void blender::ui::view2d_zoom_cache_reset ()
void blender::ui::view2d_curRect_clamp_y (View2D *v2d)
View Matrix Operations
void blender::ui::view2d_view_ortho (const View2D *v2d)
void blender::ui::view2d_view_orthoSpecial (ARegion *region, View2D *v2d, bool xaxis)
void blender::ui::view2d_view_restore (const bContext *C)
Grid Drawing
void blender::ui::view2d_multi_grid_draw (const View2D *v2d, int colorid, float step, int level_size, int totlevels)
void blender::ui::view2d_dot_grid_draw (const View2D *v2d, int grid_color_id, float min_step, int grid_subdivisions)
void blender::ui::view2d_draw_lines_y (const View2D *v2d, bool show_fractions, int base)
void blender::ui::view2d_draw_lines_x (const View2D *v2d, const Scene *scene, bool display_seconds, bool show_fractions, bool draw_minor_lines, int base)
void blender::ui::view2d_draw_lines_x_frames (const View2D *v2d, const Scene *scene, bool display_seconds, bool show_fractions, bool draw_minor_lines)
float blender::ui::view2d_grid_resolution_x (const View2D *v2d, const Scene *scene, bool display_seconds)
float blender::ui::view2d_grid_resolution_y__values (const View2D *v2d, int base)
void blender::ui::view2d_draw_scale_y (const ARegion *region, const View2D *v2d, const rcti *rect, int colorid, int base)
void blender::ui::view2d_draw_scale_x (const ARegion *region, const View2D *v2d, const rcti *rect, const Scene *scene, bool display_seconds, bool show_fractions, int colorid, int base)
Scroll-bar Drawing
void blender::ui::view2d_scrollers_draw (View2D *v2d, const rcti *mask_custom)
List View Tools
void blender::ui::view2d_listview_view_to_cell (float columnwidth, float rowheight, float startx, float starty, float viewx, float viewy, int *r_column, int *r_row)
Coordinate Conversion
float blender::ui::view2d_region_to_view_x (const View2D *v2d, float x)
float blender::ui::view2d_region_to_view_y (const View2D *v2d, float y)
void blender::ui::view2d_region_to_view (const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void blender::ui::view2d_region_to_view_rctf (const View2D *v2d, const rctf *rect_src, rctf *rect_dst) ATTR_NONNULL()
float blender::ui::view2d_view_to_region_x (const View2D *v2d, float x)
float blender::ui::view2d_view_to_region_y (const View2D *v2d, float y)
bool blender::ui::view2d_view_to_region_clip (const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
bool blender::ui::view2d_view_to_region_segment_clip (const View2D *v2d, const float xy_a[2], const float xy_b[2], int r_region_a[2], int r_region_b[2]) ATTR_NONNULL()
void blender::ui::view2d_view_to_region (const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void blender::ui::view2d_view_to_region_fl (const View2D *v2d, float x, float y, float *r_region_x, float *r_region_y) ATTR_NONNULL()
void blender::ui::view2d_view_to_region_m4 (const View2D *v2d, float matrix[4][4]) ATTR_NONNULL()
void blender::ui::view2d_view_to_region_rcti (const View2D *v2d, const rctf *rect_src, rcti *rect_dst) ATTR_NONNULL()
bool blender::ui::view2d_view_to_region_rcti_clip (const View2D *v2d, const rctf *rect_src, rcti *rect_dst) ATTR_NONNULL()
Utilities
View2D * blender::ui::view2d_fromcontext (const bContext *C)
View2D * blender::ui::view2d_fromcontext_rwin (const bContext *C)
void blender::ui::view2d_scroller_size_get (const View2D *v2d, bool mapped, float *r_x, float *r_y)
void blender::ui::view2d_scale_get (const View2D *v2d, float *r_x, float *r_y)
float blender::ui::view2d_scale_get_x (const View2D *v2d)
float blender::ui::view2d_scale_get_y (const View2D *v2d)
void blender::ui::view2d_pixel_size_get (const View2D *v2d, float *r_x, float *r_y)
float blender::ui::view2d_pixel_size_get_x (const View2D *v2d)
float blender::ui::view2d_pixel_size_get_y (const View2D *v2d)
void blender::ui::view2d_center_get (const View2D *v2d, float *r_x, float *r_y)
void blender::ui::view2d_center_set (View2D *v2d, float x, float y)
void blender::ui::view2d_size_x_set (View2D *v2d, float size_x)
void blender::ui::view2d_offset (View2D *v2d, float xfac, float yfac)
void blender::ui::view2d_offset_y_snap_to_closest_page (View2D *v2d)
char blender::ui::view2d_mouse_in_scrollers_ex (const ARegion *region, const View2D *v2d, const int xy[2], int *r_scroll) ATTR_NONNULL(1
char char blender::ui::view2d_mouse_in_scrollers (const ARegion *region, const View2D *v2d, const int xy[2]) ATTR_NONNULL(1
char char char blender::ui::view2d_rect_in_scrollers_ex (const ARegion *region, const View2D *v2d, const rcti *rect, int *r_scroll) ATTR_NONNULL(1
char char char char blender::ui::view2d_rect_in_scrollers (const ARegion *region, const View2D *v2d, const rcti *rect) ATTR_NONNULL(1
char char char char void blender::ui::view2d_text_cache_add (View2D *v2d, float x, float y, const char *str, size_t str_len, const unsigned char col[4])
void blender::ui::view2d_text_cache_add_rectf (View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const unsigned char col[4])
void blender::ui::view2d_text_cache_draw (ARegion *region)
Gizmo Types
void blender::ui::VIEW2D_GGT_navigate_impl (wmGizmoGroupType *gzgt, const char *idname)
Edge Pan
bool blender::ui::view2d_edge_pan_poll (bContext *C)
void blender::ui::view2d_edge_pan_init (bContext *C, View2DEdgePanData *vpd, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void blender::ui::view2d_edge_pan_set_limits (View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax)
void blender::ui::view2d_edge_pan_reset (View2DEdgePanData *vpd)
void blender::ui::view2d_edge_pan_apply (bContext *C, View2DEdgePanData *vpd, const int xy[2]) ATTR_NONNULL(1
void void blender::ui::view2d_edge_pan_apply_event (bContext *C, View2DEdgePanData *vpd, const wmEvent *event)
void blender::ui::view2d_edge_pan_cancel (bContext *C, View2DEdgePanData *vpd)
void blender::ui::view2d_edge_pan_operator_properties (wmOperatorType *ot)
void blender::ui::view2d_edge_pan_operator_properties_ex (wmOperatorType *ot, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void blender::ui::view2d_edge_pan_operator_init (bContext *C, View2DEdgePanData *vpd, wmOperator *op)

General Defines

#define V2D_IS_CLIPPED   12000
enum  blender::ui::eView2D_CommonViewTypes {
  blender::ui::V2D_COMMONVIEW_CUSTOM = -1 , blender::ui::V2D_COMMONVIEW_STANDARD , blender::ui::V2D_COMMONVIEW_LIST , blender::ui::V2D_COMMONVIEW_STACK ,
  blender::ui::V2D_COMMONVIEW_HEADER , blender::ui::V2D_COMMONVIEW_PANELS_UI
}

Operators

#define UI_MARKER_MARGIN_Y   (34 * UI_SCALE_FAC)
#define UI_TIME_SCRUB_MARGIN_Y   (23 * UI_SCALE_FAC)
#define UI_TIME_CACHE_MARGIN_Y   (UI_TIME_SCRUB_MARGIN_Y / 6.0f)
#define UI_ANIM_MINY   (HEADERY * UI_SCALE_FAC * 1.1f)
#define UI_MARKERS_MINY   (HEADERY * UI_SCALE_FAC * 2.0f)
void blender::ui::ED_operatortypes_view2d ()
void blender::ui::ED_keymap_view2d (wmKeyConfig *keyconf)
void blender::ui::view2d_smooth_view (const bContext *C, ARegion *region, const rctf *cur, int smooth_viewtx)

Detailed Description

Generic 2D view with should allow drawing grids, panning, zooming, scrolling, .. etc.

Definition in file UI_view2d.hh.

Macro Definition Documentation

◆ IN_2D_HORIZ_SCROLL

#define IN_2D_HORIZ_SCROLL ( v2d,
co )
Value:
(BLI_rcti_isect_pt_v(&v2d->hor, co))

Definition at line 120 of file UI_view2d.hh.

Referenced by blender::ui::view2d_mouse_in_scrollers_ex().

◆ IN_2D_HORIZ_SCROLL_RECT

#define IN_2D_HORIZ_SCROLL_RECT ( v2d,
rct )
Value:
(BLI_rcti_isect(&v2d->hor, rct, NULL))

Definition at line 123 of file UI_view2d.hh.

Referenced by blender::ui::view2d_rect_in_scrollers_ex().

◆ IN_2D_VERT_SCROLL

#define IN_2D_VERT_SCROLL ( v2d,
co )
Value:
(BLI_rcti_isect_pt_v(&v2d->vert, co))

Definition at line 119 of file UI_view2d.hh.

Referenced by blender::ui::view2d_mouse_in_scrollers_ex().

◆ IN_2D_VERT_SCROLL_RECT

#define IN_2D_VERT_SCROLL_RECT ( v2d,
rct )
Value:
(BLI_rcti_isect(&v2d->vert, rct, NULL))

Definition at line 122 of file UI_view2d.hh.

Referenced by blender::ui::view2d_rect_in_scrollers_ex().

◆ UI_ANIM_MINY

◆ UI_MARKER_MARGIN_Y

◆ UI_MARKERS_MINY

#define UI_MARKERS_MINY   (HEADERY * UI_SCALE_FAC * 2.0f)

Definition at line 496 of file UI_view2d.hh.

Referenced by blender::ed_markers_poll_markers_exist_visible().

◆ UI_TIME_CACHE_MARGIN_Y

◆ UI_TIME_SCRUB_MARGIN_Y

◆ V2D_IS_CLIPPED

◆ V2D_LOCK_COPY

◆ V2D_LOCK_SET

#define V2D_LOCK_SET   0

Definition at line 108 of file UI_view2d.hh.

◆ V2D_SCROLL_HANDLE_HEIGHT

◆ V2D_SCROLL_HANDLE_SIZE_HOTSPOT

#define V2D_SCROLL_HANDLE_SIZE_HOTSPOT   (0.6f * U.widget_unit)

Scroll bar with 'handles' hot-spot radius for cursor proximity.

Definition at line 96 of file UI_view2d.hh.

Referenced by blender::ui::scrollbar_zone_get(), blender::ui::view2d_scrollers_calc(), and blender::ui::view2d_scrollers_draw().

◆ V2D_SCROLL_HANDLE_WIDTH

#define V2D_SCROLL_HANDLE_WIDTH   (0.6f * U.widget_unit)

Definition at line 93 of file UI_view2d.hh.

Referenced by blender::ui::view2d_scroller_size_get().

◆ V2D_SCROLL_HEIGHT

#define V2D_SCROLL_HEIGHT   ((0.45f * U.widget_unit) + (2.0f * U.pixelsize))

◆ V2D_SCROLL_HIDE_HEIGHT

#define V2D_SCROLL_HIDE_HEIGHT   (HEADERY * UI_SCALE_FAC)

◆ V2D_SCROLL_HIDE_WIDTH

#define V2D_SCROLL_HIDE_WIDTH   (AREAMINX * UI_SCALE_FAC)

◆ V2D_SCROLL_MIN_ALPHA

#define V2D_SCROLL_MIN_ALPHA   (0.4f)

Definition at line 82 of file UI_view2d.hh.

Referenced by blender::ui::view2d_scrollers_draw().

◆ V2D_SCROLL_MIN_WIDTH

#define V2D_SCROLL_MIN_WIDTH   ((5.0f * UI_SCALE_FAC) + (2.0f * U.pixelsize))

Definition at line 85 of file UI_view2d.hh.

Referenced by blender::ui::view2d_scroller_size_get().

◆ V2D_SCROLL_THUMB_SIZE_MIN

#define V2D_SCROLL_THUMB_SIZE_MIN   (30.0 * UI_SCALE_FAC)

Don't allow scroll thumb to show below this size (so it's never too small to click on).

Definition at line 99 of file UI_view2d.hh.

Referenced by blender::ui::view2d_scrollers_calc().

◆ V2D_SCROLL_WIDTH