|
Blender V4.3
|
#include <cmath>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "DNA_windowmanager_types.h"#include "BLI_math_base.h"#include "BLI_math_vector.h"#include "BLI_time.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_screen.hh"#include "UI_interface.hh"#include "UI_view2d.hh"#include "view2d_intern.hh"Go to the source code of this file.
Classes | |
| struct | v2dViewPanData |
| struct | v2dViewZoomData |
| struct | SmoothView2DStore |
| struct | v2dScrollerMove |
Functions | |
Internal Utilities | |
| static bool | view2d_poll (bContext *C) |
| static float | view2d_scroll_delta_y_snap_page_size (const View2D &v2d, const float delta_y) |
View Pan Shared Utilities | |
| static bool | view_pan_poll (bContext *C) |
| static void | view_pan_init (bContext *C, wmOperator *op) |
| static void | view_pan_apply_ex (bContext *C, v2dViewPanData *vpd, float dx, float dy) |
| static void | view_pan_apply (bContext *C, wmOperator *op) |
| static void | view_pan_exit (wmOperator *op) |
View Pan Operator (modal drag-pan) | |
| static int | view_pan_exec (bContext *C, wmOperator *op) |
| static int | view_pan_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | view_pan_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | view_pan_cancel (bContext *, wmOperator *op) |
| static void | VIEW2D_OT_pan (wmOperatorType *ot) |
View Edge Pan Operator (modal) | |
Scroll the region if the mouse is dragged to an edge. "Invisible" operator that always passes through. | |
| static int | view_edge_pan_invoke (bContext *C, wmOperator *op, const wmEvent *) |
| static int | view_edge_pan_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | view_edge_pan_cancel (bContext *, wmOperator *op) |
| static void | VIEW2D_OT_edge_pan (wmOperatorType *ot) |
View Pan Operator (single step) | |
| static int | view_scrollright_exec (bContext *C, wmOperator *op) |
| static void | VIEW2D_OT_scroll_right (wmOperatorType *ot) |
| static int | view_scrollleft_exec (bContext *C, wmOperator *op) |
| static void | VIEW2D_OT_scroll_left (wmOperatorType *ot) |
| static int | view_scrolldown_exec (bContext *C, wmOperator *op) |
| static void | VIEW2D_OT_scroll_down (wmOperatorType *ot) |
| static int | view_scrollup_exec (bContext *C, wmOperator *op) |
| static void | VIEW2D_OT_scroll_up (wmOperatorType *ot) |
View Zoom Shared Utilities | |
| static void | view_zoom_axis_lock_defaults (bContext *C, bool r_do_zoom_xy[2]) |
| static bool | view_zoom_poll (bContext *C) |
| static void | view_zoomdrag_init (bContext *C, wmOperator *op) |
| static void | view_zoomstep_apply_ex (bContext *C, v2dViewZoomData *vzd, const float facx, const float facy) |
| static void | view_zoomstep_apply (bContext *C, wmOperator *op) |
View Zoom Operator (single step) | |
| static void | view_zoomstep_exit (bContext *C, wmOperator *op) |
| static int | view_zoomin_exec (bContext *C, wmOperator *op) |
| static int | view_zoomin_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | VIEW2D_OT_zoom_in (wmOperatorType *ot) |
| static int | view_zoomout_exec (bContext *C, wmOperator *op) |
| static int | view_zoomout_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | VIEW2D_OT_zoom_out (wmOperatorType *ot) |
View Zoom Operator (modal drag-zoom) | |
| static void | view_zoomdrag_apply (bContext *C, wmOperator *op) |
| static void | view_zoomdrag_exit (bContext *C, wmOperator *op) |
| static void | view_zoomdrag_cancel (bContext *C, wmOperator *op) |
| static int | view_zoomdrag_exec (bContext *C, wmOperator *op) |
| static int | view_zoomdrag_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | view_zoomdrag_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | VIEW2D_OT_zoom (wmOperatorType *ot) |
Border Zoom Operator | |
The user defines a rect using standard box select tools, and we use this rect to define the new zoom-level of the view in the following ways:
Currently, these key mappings are hardcoded, but it shouldn't be too important to have custom keymappings for this. | |
| static int | view_borderzoom_exec (bContext *C, wmOperator *op) |
| static void | VIEW2D_OT_zoom_border (wmOperatorType *ot) |
Smooth View Operator | |
| static float | smooth_view_rect_to_fac (const rctf *rect_a, const rctf *rect_b) |
| void | UI_view2d_smooth_view (const bContext *C, ARegion *region, const rctf *cur, const int smooth_viewtx) |
| static int | view2d_smoothview_invoke (bContext *C, wmOperator *, const wmEvent *event) |
| static void | VIEW2D_OT_smoothview (wmOperatorType *ot) |
View Reset Operator | |
| static int | reset_exec (bContext *C, wmOperator *) |
| static void | VIEW2D_OT_reset (wmOperatorType *ot) |
Registration | |
| void | ED_operatortypes_view2d () |
| void | ED_keymap_view2d (wmKeyConfig *keyconf) |
Scroll Bar Move Operator | |
| enum | { SCROLLHANDLE_MIN = -1 , SCROLLHANDLE_BAR , SCROLLHANDLE_MAX , SCROLLHANDLE_MIN_OUTSIDE , SCROLLHANDLE_MAX_OUTSIDE } |
| static short | mouse_in_scroller_handle (int mouse, int sc_min, int sc_max, int sh_min, int sh_max) |
| static bool | scroller_activate_poll (bContext *C) |
| static void | scroller_activate_init (bContext *C, wmOperator *op, const wmEvent *event, const char in_scroller) |
| static void | scroller_activate_exit (bContext *C, wmOperator *op) |
| static void | scroller_activate_cancel (bContext *C, wmOperator *op) |
| static void | scroller_activate_apply (bContext *C, wmOperator *op) |
| static int | scroller_activate_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | scroller_activate_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | VIEW2D_OT_scroller_activate (wmOperatorType *ot) |
| anonymous enum |
| Enumerator | |
|---|---|
| SCROLLHANDLE_MIN | |
| SCROLLHANDLE_BAR | |
| SCROLLHANDLE_MAX | |
| SCROLLHANDLE_MIN_OUTSIDE | |
| SCROLLHANDLE_MAX_OUTSIDE | |
Definition at line 1810 of file view2d_ops.cc.
| void ED_keymap_view2d | ( | wmKeyConfig * | keyconf | ) |
Definition at line 2361 of file view2d_ops.cc.
References RGN_TYPE_WINDOW, SPACE_EMPTY, and WM_keymap_ensure().
Referenced by ED_spacetypes_keymap().
| void ED_operatortypes_view2d | ( | ) |
Definition at line 2334 of file view2d_ops.cc.
References VIEW2D_OT_edge_pan(), VIEW2D_OT_pan(), VIEW2D_OT_reset(), VIEW2D_OT_scroll_down(), VIEW2D_OT_scroll_left(), VIEW2D_OT_scroll_right(), VIEW2D_OT_scroll_up(), VIEW2D_OT_scroller_activate(), VIEW2D_OT_smoothview(), VIEW2D_OT_zoom(), VIEW2D_OT_zoom_border(), VIEW2D_OT_zoom_in(), VIEW2D_OT_zoom_out(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
|
static |
Check if mouse is within scroller handle.
| mouse | relevant mouse coordinate in region space. |
| sc_min,sc_max | extents of scroller 'groove' (potential available space for scroller). |
| sh_min,sh_max | positions of scrollbar handles. |
Definition at line 1825 of file view2d_ops.cc.
References SCROLLHANDLE_BAR, SCROLLHANDLE_MAX, SCROLLHANDLE_MAX_OUTSIDE, SCROLLHANDLE_MIN, SCROLLHANDLE_MIN_OUTSIDE, and V2D_SCROLL_HANDLE_SIZE_HOTSPOT.
Referenced by scroller_activate_init().
|
static |
Definition at line 2259 of file view2d_ops.cc.
References View2D::align, BLI_rcti_size_x(), BLI_rcti_size_y(), CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), View2D::cur, ED_area_tag_redraw(), ED_region_snap_size_apply(), ED_region_snap_size_test(), ED_region_tag_redraw(), float, View2D::mask, NA_EDITED, NC_SCREEN, OPERATOR_FINISHED, uiStyle::panelzoom, UI_style_get(), UI_view2d_curRect_changed(), UI_view2d_sync(), UI_view2d_zoom_cache_reset(), V2D_ALIGN_NO_NEG_X, V2D_ALIGN_NO_NEG_Y, V2D_ALIGN_NO_POS_X, V2D_ALIGN_NO_POS_Y, V2D_LOCK_COPY, WM_event_add_notifier(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by UV_OT_reset(), and VIEW2D_OT_reset().
|
static |
Definition at line 2000 of file view2d_ops.cc.
References CTX_wm_area(), CTX_wm_screen(), View2D::cur, wmOperator::customdata, v2dScrollerMove::delta, ED_region_tag_redraw_no_rebuild(), v2dScrollerMove::fac, v2dScrollerMove::fac_round, View2D::keepofs, View2D::keepzoom, v2dScrollerMove::region, v2dScrollerMove::scroller, SCROLLHANDLE_BAR, SCROLLHANDLE_MAX, SCROLLHANDLE_MAX_OUTSIDE, SCROLLHANDLE_MIN, SCROLLHANDLE_MIN_OUTSIDE, UI_view2d_curRect_changed(), UI_view2d_sync(), v2dScrollerMove::v2d, V2D_LOCK_COPY, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, rctf::xmax, rctf::xmin, rctf::ymax, rctf::ymin, and v2dScrollerMove::zone.
Referenced by scroller_activate_invoke(), and scroller_activate_modal().
|
static |
Definition at line 1994 of file view2d_ops.cc.
References scroller_activate_exit().
Referenced by VIEW2D_OT_scroller_activate().
|
static |
Definition at line 1979 of file view2d_ops.cc.
References CTX_wm_region(), wmOperator::customdata, ED_region_tag_redraw_no_rebuild(), View2D::flag, MEM_freeN(), View2D::scroll_ui, v2dScrollerMove::v2d, V2D_SCROLL_H_ACTIVE, and V2D_SCROLL_V_ACTIVE.
Referenced by scroller_activate_cancel(), scroller_activate_invoke(), and scroller_activate_modal().
|
static |
Definition at line 1890 of file view2d_ops.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rctf_union(), BLI_rcti_size_x(), BLI_rcti_size_y(), BLI_rcti_union(), CTX_wm_region(), View2D::cur, wmOperator::customdata, ED_region_tag_redraw_no_rebuild(), ELEM, v2dScrollerMove::fac, v2dScrollerMove::fac_round, View2D::flag, float, View2D::hor, View2DScrollers::hor_max, View2DScrollers::hor_min, View2D::keepzoom, v2dScrollerMove::lastx, v2dScrollerMove::lasty, mouse_in_scroller_handle(), wmEvent::mval, v2dScrollerMove::region, v2dScrollerMove::scrollbar_orig, v2dScrollerMove::scrollbarwidth, v2dScrollerMove::scroller, SCROLLHANDLE_BAR, SCROLLHANDLE_MAX, SCROLLHANDLE_MIN, View2D::tot, v2dScrollerMove::v2d, V2D_IS_NAVIGATING, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, View2D::vert, View2DScrollers::vert_max, View2DScrollers::vert_min, view2d_scrollers_calc(), rcti::xmax, rcti::xmin, rcti::ymax, rcti::ymin, and v2dScrollerMove::zone.
Referenced by scroller_activate_invoke().
|
static |
Definition at line 2148 of file view2d_ops.cc.
References CTX_wm_region(), wmOperator::customdata, v2dScrollerMove::delta, ELEM, float, View2D::keepofs, MIDDLEMOUSE, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, View2D::scroll, View2D::scroll_ui, v2dScrollerMove::scrollbar_orig, v2dScrollerMove::scroller, scroller_activate_apply(), scroller_activate_exit(), scroller_activate_init(), SCROLLHANDLE_BAR, SCROLLHANDLE_MAX, SCROLLHANDLE_MIN, wmEvent::type, UI_view2d_mouse_in_scrollers(), V2D_LOCKOFS_X, V2D_LOCKOFS_Y, V2D_SCROLL_H_ACTIVE, V2D_SCROLL_HORIZONTAL_FULLR, V2D_SCROLL_HORIZONTAL_HANDLES, V2D_SCROLL_V_ACTIVE, V2D_SCROLL_VERTICAL_FULLR, V2D_SCROLL_VERTICAL_HANDLES, WM_event_add_modal_handler(), wmEvent::xy, and v2dScrollerMove::zone.
Referenced by VIEW2D_OT_scroller_activate().
|
static |
Handle user input for scrollers - calculations of mouse-movement need to be done here, not in the apply callback!
Definition at line 2062 of file view2d_ops.cc.
References wmOperator::customdata, v2dScrollerMove::delta, ELEM, v2dScrollerMove::fac, View2D::flag, float, IS_EQF, KM_RELEASE, v2dScrollerMove::lastx, v2dScrollerMove::lasty, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, v2dScrollerMove::scrollbarwidth, v2dScrollerMove::scroller, scroller_activate_apply(), scroller_activate_exit(), SCROLLHANDLE_BAR, SCROLLHANDLE_MAX, SCROLLHANDLE_MAX_OUTSIDE, SCROLLHANDLE_MIN, SCROLLHANDLE_MIN_OUTSIDE, wmEvent::type, v2dScrollerMove::v2d, V2D_SNAP_TO_PAGESIZE_Y, wmEvent::val, view2d_scroll_delta_y_snap_page_size(), wmEvent::xy, and v2dScrollerMove::zone.
Referenced by VIEW2D_OT_scroller_activate().
|
static |
Definition at line 1874 of file view2d_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmWindow::eventstate, UI_view2d_mouse_in_scrollers(), view2d_poll(), and wmEvent::xy.
Referenced by VIEW2D_OT_scroller_activate().
function to get a factor out of a rectangle
NOTE: this doesn't always work as well as it might because the target size may not be reached because of clamping the desired rect, we could attempt to clamp the rect before working out the zoom factor but its not really worthwhile for the few cases this happens.
Definition at line 1600 of file view2d_ops.cc.
References BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_size_x(), BLI_rctf_size_y(), fabsf, max_ff(), and min_ff().
Referenced by UI_view2d_smooth_view().
| void UI_view2d_smooth_view | ( | const bContext * | C, |
| ARegion * | region, | ||
| const rctf * | cur, | ||
| int | smooth_viewtx ) |
Will start timer if appropriate. the arguments are the desired situation.
Definition at line 1627 of file view2d_ops.cc.
References BLI_rctf_compare(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_screen(), CTX_wm_window(), View2D::cur, double(), ED_region_tag_redraw_no_rebuild(), SmoothView2DStore::new_cur, SmoothView2DStore::orig_cur, View2D::smooth_timer, smooth_view_rect_to_fac(), View2D::sms, SmoothView2DStore::time_allowed, TIMER1, UI_view2d_curRect_changed(), UI_view2d_sync(), V2D_LOCK_COPY, WM_event_timer_add(), and WM_event_timer_remove().
Referenced by ANIM_center_frame(), graphkeys_channel_view_pick_invoke(), graphkeys_view_selected_channels_exec(), graphkeys_viewall(), sequencer_view_all_exec(), sequencer_view_selected_exec(), blender::ed::space_node::space_node_view_flag(), view_borderzoom_exec(), and view_curve_in_graph_editor_exec().
|
static |
Definition at line 421 of file view2d_ops.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_INTERNAL, ot, wmOperatorType::poll, UI_view2d_edge_pan_operator_properties(), view2d_edge_pan_poll(), view_edge_pan_cancel(), view_edge_pan_invoke(), and view_edge_pan_modal().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 349 of file view2d_ops.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_GRAB_CURSOR_XY, ot, wmOperatorType::poll, RNA_def_int(), wmOperatorType::srna, view_pan_cancel(), view_pan_exec(), view_pan_invoke(), view_pan_modal(), and view_pan_poll().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 2316 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, reset_exec(), and view2d_poll().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 563 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_boolean(), RNA_def_int(), wmOperatorType::srna, view_pan_poll(), and view_scrolldown_exec().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 509 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_int(), wmOperatorType::srna, view_pan_poll(), and view_scrollleft_exec().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 469 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_int(), wmOperatorType::srna, view_pan_poll(), and view_scrollright_exec().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 618 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_boolean(), RNA_def_int(), wmOperatorType::srna, view_pan_poll(), and view_scrollup_exec().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 2235 of file view2d_ops.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, ot, wmOperatorType::poll, scroller_activate_cancel(), scroller_activate_invoke(), scroller_activate_modal(), and scroller_activate_poll().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 1746 of file view2d_ops.cc.
References wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, ot, wmOperatorType::poll, view2d_poll(), view2d_smoothview_invoke(), and WM_operator_properties_gesture_box().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 1379 of file view2d_ops.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, FLT_MAX, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_GRAB_CURSOR_XY, ot, wmOperatorType::poll, PROP_HIDDEN, RNA_def_float(), RNA_def_property_flag(), wmOperatorType::srna, view_zoom_poll(), view_zoomdrag_cancel(), view_zoomdrag_exec(), view_zoomdrag_invoke(), view_zoomdrag_modal(), and WM_operator_properties_use_cursor_init().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 1485 of file view2d_ops.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, ot, wmOperatorType::poll, view_borderzoom_exec(), view_zoom_poll(), WM_gesture_box_cancel(), WM_gesture_box_invoke(), WM_gesture_box_modal(), and WM_operator_properties_gesture_box_zoom().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 918 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, FLT_MAX, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, ot, wmOperatorType::poll, PROP_HIDDEN, RNA_def_float(), RNA_def_property_flag(), wmOperatorType::srna, view_zoom_poll(), view_zoomin_exec(), and view_zoomin_invoke().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 982 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, FLT_MAX, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, ot, wmOperatorType::poll, PROP_HIDDEN, RNA_def_float(), RNA_def_property_flag(), wmOperatorType::srna, view_zoom_poll(), view_zoomout_exec(), and view_zoomout_invoke().
Referenced by ED_operatortypes_view2d().
|
static |
Definition at line 40 of file view2d_ops.cc.
References CTX_wm_region(), and V2D_IS_INIT.
Referenced by scroller_activate_poll(), VIEW2D_OT_reset(), and VIEW2D_OT_smoothview().
|
static |
Calculate a scrolling delta that is the closest to a multiple of the page size (as returned by view2d_page_size_y). So when scrolling for more than half a page size, a delta to the next page is returned. No scrolling change should be applied when this returns 0.
Definition at line 52 of file view2d_ops.cc.
References abs(), int, and view2d_page_size_y().
Referenced by scroller_activate_modal(), and view_pan_modal().
|
static |
Definition at line 1695 of file view2d_ops.cc.
References BLI_rctf_interp(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_screen(), CTX_wm_window(), View2D::cur, wmEvent::customdata, ED_region_tag_redraw_no_rebuild(), float, SmoothView2DStore::new_cur, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, SmoothView2DStore::orig_cur, View2D::smooth_timer, View2D::sms, SmoothView2DStore::time_allowed, wmTimer::time_duration, UI_view2d_curRect_changed(), UI_view2d_sync(), UI_view2d_zoom_cache_reset(), V2D_LOCK_COPY, WM_event_add_mousemove(), and WM_event_timer_remove().
Referenced by VIEW2D_OT_smoothview().
|
static |
Definition at line 1422 of file view2d_ops.cc.
References BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_size_x(), BLI_rctf_size_y(), CTX_wm_region(), View2D::cur, View2D::keepzoom, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), size(), UI_view2d_region_to_view_rctf(), UI_view2d_smooth_view(), V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, WM_operator_properties_border_to_rctf(), WM_operator_smooth_viewtx_get(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by VIEW2D_OT_zoom_border().
|
static |
Definition at line 414 of file view2d_ops.cc.
References wmOperator::customdata, View2D::flag, MEM_SAFE_FREE, and v2dViewPanData::v2d.
Referenced by VIEW2D_OT_edge_pan().
|
static |
Definition at line 381 of file view2d_ops.cc.
References wmOperator::customdata, MEM_callocN, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, UI_view2d_edge_pan_operator_init(), and WM_event_add_modal_handler().
Referenced by VIEW2D_OT_edge_pan().
|
static |
Definition at line 392 of file view2d_ops.cc.
References CTX_wm_window(), wmOperator::customdata, EVT_ESCKEY, View2D::flag, KM_RELEASE, MEM_SAFE_FREE, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmEvent::type, UI_view2d_edge_pan_apply_event(), View2DEdgePanData::v2d, wmEvent::val, WM_window_find_under_cursor(), and wmEvent::xy.
Referenced by VIEW2D_OT_edge_pan().
|
static |
Definition at line 199 of file view2d_ops.cc.
References wmOperator::customdata, wmOperator::ptr, RNA_int_get(), and view_pan_apply_ex().
Referenced by view_pan_exec(), view_pan_invoke(), view_pan_modal(), view_scrolldown_exec(), view_scrollleft_exec(), view_scrollright_exec(), and view_scrollup_exec().
|
static |
Definition at line 164 of file view2d_ops.cc.
References v2dViewPanData::area, ARegion::category_scroll, CTX_wm_window(), View2D::cur, v2dViewPanData::do_category_scroll, ED_region_tag_redraw_no_rebuild(), v2dViewPanData::facx, v2dViewPanData::facy, View2D::keepofs, v2dViewPanData::region, v2dViewPanData::screen, UI_view2d_curRect_changed(), UI_view2d_sync(), v2dViewPanData::v2d, V2D_LOCK_COPY, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, WM_event_add_mousemove(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by view_pan_apply().
|
static |
Definition at line 344 of file view2d_ops.cc.
References view_pan_exit().
Referenced by VIEW2D_OT_pan().
|
static |
Definition at line 221 of file view2d_ops.cc.
References OPERATOR_FINISHED, view_pan_apply(), view_pan_exit(), and view_pan_init().
Referenced by VIEW2D_OT_pan().
|
static |
Definition at line 207 of file view2d_ops.cc.
References wmOperator::customdata, View2D::flag, MEM_SAFE_FREE, and v2dViewPanData::v2d.
Referenced by view_pan_cancel(), view_pan_exec(), view_pan_invoke(), view_pan_modal(), view_scrolldown_exec(), view_scrollleft_exec(), view_scrollright_exec(), and view_scrollup_exec().
|
static |
Definition at line 137 of file view2d_ops.cc.
References v2dViewPanData::area, BLI_assert, BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), View2D::cur, wmOperator::customdata, v2dViewPanData::do_category_scroll, v2dViewPanData::facx, v2dViewPanData::facy, View2D::flag, float, v2dViewPanData::region, v2dViewPanData::screen, ARegion::v2d, v2dViewPanData::v2d, V2D_IS_NAVIGATING, view_pan_poll(), and ARegion::winrct.
Referenced by view_pan_exec(), view_pan_invoke(), view_scrolldown_exec(), view_scrollleft_exec(), view_scrollright_exec(), and view_scrollup_exec().
|
static |
Definition at line 230 of file view2d_ops.cc.
References CTX_wm_window(), wmOperator::customdata, v2dViewPanData::do_category_scroll, ED_region_panel_category_gutter_isect_xy(), wmWindow::grabcursor, v2dViewPanData::invoke_event, View2D::keepofs, v2dViewPanData::lastx, v2dViewPanData::lasty, MOUSEPAN, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmEvent::prev_xy, wmOperator::ptr, v2dViewPanData::region, RNA_int_set(), v2dViewPanData::startx, v2dViewPanData::starty, wmEvent::type, v2dViewPanData::v2d, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, view_pan_apply(), view_pan_exit(), view_pan_init(), WM_CURSOR_EW_SCROLL, WM_cursor_modal_set(), WM_CURSOR_NS_SCROLL, WM_CURSOR_NSEW_SCROLL, WM_event_add_modal_handler(), and wmEvent::xy.
Referenced by VIEW2D_OT_pan().
|
static |
Definition at line 279 of file view2d_ops.cc.
References CTX_wm_window(), wmOperator::customdata, ELEM, EVT_ESCKEY, View2D::flag, v2dViewPanData::invoke_event, KM_PRESS, KM_RELEASE, v2dViewPanData::lastx, v2dViewPanData::lasty, LEFTMOUSE, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_int_set(), v2dViewPanData::startx, v2dViewPanData::starty, wmEvent::type, v2dViewPanData::v2d, V2D_SNAP_TO_PAGESIZE_Y, wmEvent::val, view2d_scroll_delta_y_snap_page_size(), view_pan_apply(), view_pan_exit(), WM_cursor_modal_restore(), WM_OP_INVOKE_DEFAULT, and WM_operator_name_call().
Referenced by VIEW2D_OT_pan().
|
static |
Definition at line 116 of file view2d_ops.cc.
References CTX_wm_region(), View2D::keepofs, V2D_LOCKOFS_X, and V2D_LOCKOFS_Y.
Referenced by VIEW2D_OT_pan(), VIEW2D_OT_scroll_down(), VIEW2D_OT_scroll_left(), VIEW2D_OT_scroll_right(), VIEW2D_OT_scroll_up(), and view_pan_init().
|
static |
Definition at line 526 of file view2d_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, v2dViewPanData::do_category_scroll, ED_region_panel_category_gutter_isect_xy(), wmWindow::eventstate, View2D::flag, View2D::keepofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, v2dViewPanData::region, RNA_int_set(), RNA_property_boolean_get(), RNA_property_is_set(), RNA_struct_find_property(), UI_SCALE_FAC, v2dViewPanData::v2d, V2D_LOCKOFS_Y, V2D_SNAP_TO_PAGESIZE_Y, view2d_page_size_y(), view_pan_apply(), view_pan_exit(), view_pan_init(), and wmEvent::xy.
Referenced by VIEW2D_OT_scroll_down().
|
static |
Definition at line 486 of file view2d_ops.cc.
References wmOperator::customdata, View2D::keepofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_int_set(), UI_SCALE_FAC, v2dViewPanData::v2d, V2D_LOCKOFS_X, view_pan_apply(), view_pan_exit(), and view_pan_init().
Referenced by VIEW2D_OT_scroll_left().
|
static |
Definition at line 446 of file view2d_ops.cc.
References wmOperator::customdata, View2D::keepofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_int_set(), UI_SCALE_FAC, v2dViewPanData::v2d, V2D_LOCKOFS_X, view_pan_apply(), view_pan_exit(), and view_pan_init().
Referenced by VIEW2D_OT_scroll_right().
|
static |
Definition at line 581 of file view2d_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, v2dViewPanData::do_category_scroll, ED_region_panel_category_gutter_isect_xy(), wmWindow::eventstate, View2D::flag, View2D::keepofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, v2dViewPanData::region, RNA_int_set(), RNA_property_boolean_get(), RNA_property_is_set(), RNA_struct_find_property(), UI_SCALE_FAC, v2dViewPanData::v2d, V2D_LOCKOFS_Y, V2D_SNAP_TO_PAGESIZE_Y, view2d_page_size_y(), view_pan_apply(), view_pan_exit(), view_pan_init(), and wmEvent::xy.
Referenced by VIEW2D_OT_scroll_up().
|
static |
Clamp by convention rather than locking flags, for ndof and +/- keys
Definition at line 677 of file view2d_ops.cc.
References CTX_wm_area(), CTX_wm_region(), RGN_TYPE_WINDOW, and SPACE_SEQ.
Referenced by view_zoomin_exec(), and view_zoomout_exec().
|
static |
Definition at line 695 of file view2d_ops.cc.
References CTX_wm_region(), CTX_wm_region_view3d(), View2D::keepzoom, V2D_LOCKZOOM_X, and V2D_LOCKZOOM_Y.
Referenced by VIEW2D_OT_zoom(), VIEW2D_OT_zoom_border(), VIEW2D_OT_zoom_in(), VIEW2D_OT_zoom_out(), and view_zoomdrag_init().
|
static |
MMB Drag - allows non-uniform scaling by dragging mouse
In order to make sure this works, each operator must define the following RNA-Operator Props:
deltax, deltay - amounts to add to each side of the 'cur' rect Definition at line 1020 of file view2d_ops.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_time_now_seconds(), CTX_wm_area(), CTX_wm_screen(), View2D::cur, wmOperator::customdata, ED_area_tag_redraw(), ED_region_snap_size_apply(), ED_region_snap_size_test(), ED_region_tag_redraw_no_rebuild(), float, View2D::keepofs, View2D::keepzoom, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, NA_EDITED, NC_SCREEN, wmOperator::ptr, v2dViewZoomData::region, RNA_boolean_get(), RNA_float_get(), time, v2dViewZoomData::timer, v2dViewZoomData::timer_lastdraw, UI_SCALE_FAC, UI_view2d_curRect_changed(), UI_view2d_sync(), USER_ZOOM_CONTINUE, v2dViewZoomData::v2d, V2D_LOCK_COPY, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, WM_event_add_notifier(), rctf::xmax, rctf::xmin, rctf::ymax, rctf::ymin, and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by view_zoomdrag_exec(), view_zoomdrag_invoke(), and view_zoomdrag_modal().
|
static |
Definition at line 1117 of file view2d_ops.cc.
References view_zoomdrag_exit().
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 1123 of file view2d_ops.cc.
References OPERATOR_FINISHED, view_zoomdrag_apply(), view_zoomdrag_exit(), and view_zoomdrag_init().
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 1100 of file view2d_ops.cc.
References CTX_wm_manager(), CTX_wm_window(), wmOperator::customdata, View2D::flag, MEM_freeN(), v2dViewZoomData::timer, UI_view2d_zoom_cache_reset(), v2dViewZoomData::v2d, and WM_event_timer_remove().
Referenced by view_zoomdrag_cancel(), view_zoomdrag_exec(), view_zoomdrag_invoke(), and view_zoomdrag_modal().
|
static |
Definition at line 721 of file view2d_ops.cc.
References BLI_assert, CTX_wm_region(), wmOperator::customdata, View2D::flag, v2dViewZoomData::region, ARegion::v2d, v2dViewZoomData::v2d, V2D_IS_NAVIGATING, view_zoom_poll(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by view_zoomdrag_exec(), view_zoomdrag_invoke(), view_zoomin_exec(), view_zoomin_invoke(), view_zoomout_exec(), and view_zoomout_invoke().
|
static |
Definition at line 1132 of file view2d_ops.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_time_now_seconds(), clamp_f(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_window(), View2D::cur, wmOperator::customdata, ELEM, fabsf, wmWindow::grabcursor, v2dViewZoomData::invoke_event, View2D::keepofs, View2D::keepzoom, v2dViewZoomData::lastx, v2dViewZoomData::lasty, View2D::maxzoom, MOUSEPAN, MOUSEZOOM, wmEvent::mval, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_float_set(), TIMER, v2dViewZoomData::timer, v2dViewZoomData::timer_lastdraw, wmEvent::type, UI_view2d_region_to_view(), USER_ZOOM_CONTINUE, USER_ZOOM_HORIZ, USER_ZOOM_INVERT, USER_ZOOM_TO_MOUSEPOS, v2dViewZoomData::v2d, V2D_KEEPASPECT, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, view_zoomdrag_apply(), view_zoomdrag_exit(), view_zoomdrag_init(), WM_CURSOR_EW_SCROLL, WM_cursor_modal_set(), WM_CURSOR_NS_SCROLL, WM_CURSOR_NSEW_SCROLL, WM_event_absolute_delta_x(), WM_event_absolute_delta_y(), WM_event_add_modal_handler(), WM_event_timer_add(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 1246 of file view2d_ops.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), clamp_f(), CTX_wm_window(), View2D::cur, wmEvent::customdata, wmOperator::customdata, v2dViewZoomData::dx, v2dViewZoomData::dy, ELEM, EVT_ESCKEY, fabsf, v2dViewZoomData::invoke_event, View2D::keepzoom, KM_RELEASE, v2dViewZoomData::lastx, v2dViewZoomData::lasty, len_v2(), View2D::mask, View2D::maxzoom, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, v2dViewZoomData::region, RNA_float_set(), TIMER, v2dViewZoomData::timer, wmEvent::type, USER_ZOOM_CONTINUE, USER_ZOOM_HORIZ, USER_ZOOM_INVERT, USER_ZOOM_SCALE, v2dViewZoomData::v2d, V2D_KEEPASPECT, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, wmEvent::val, view_zoomdrag_apply(), view_zoomdrag_exit(), ARegion::winrct, WM_cursor_modal_restore(), rcti::xmin, wmEvent::xy, and rcti::ymin.
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 879 of file view2d_ops.cc.
References wmOperator::customdata, OPERATOR_FINISHED, wmOperator::ptr, RNA_float_set(), view_zoom_axis_lock_defaults(), view_zoomdrag_init(), view_zoomstep_apply(), and view_zoomstep_exit().
Referenced by VIEW2D_OT_zoom_in(), and view_zoomin_invoke().
|
static |
Definition at line 900 of file view2d_ops.cc.
References CTX_wm_region(), wmOperator::customdata, wmEvent::mval, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, UI_view2d_region_to_view(), USER_ZOOM_TO_MOUSEPOS, view_zoomdrag_init(), view_zoomin_exec(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by VIEW2D_OT_zoom_in().
|
static |
Definition at line 942 of file view2d_ops.cc.
References wmOperator::customdata, OPERATOR_FINISHED, wmOperator::ptr, RNA_float_set(), view_zoom_axis_lock_defaults(), view_zoomdrag_init(), view_zoomstep_apply(), and view_zoomstep_exit().
Referenced by VIEW2D_OT_zoom_out(), and view_zoomout_invoke().
|
static |
Definition at line 964 of file view2d_ops.cc.
References CTX_wm_region(), wmOperator::customdata, wmEvent::mval, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, UI_view2d_region_to_view(), USER_ZOOM_TO_MOUSEPOS, view_zoomdrag_init(), view_zoomout_exec(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by VIEW2D_OT_zoom_out().
|
static |
Definition at line 851 of file view2d_ops.cc.
References wmOperator::customdata, wmOperator::ptr, RNA_float_get(), and view_zoomstep_apply_ex().
Referenced by view_zoomin_exec(), and view_zoomout_exec().
|
static |
Definition at line 740 of file view2d_ops.cc.
References View2D::align, BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), View2D::cur, ED_area_tag_redraw(), ED_region_snap_size_apply(), ED_region_snap_size_test(), ED_region_tag_redraw_no_rebuild(), float, IN_RANGE_INCL, View2D::keepofs, View2D::keepzoom, View2D::mask, View2D::maxzoom, View2D::minzoom, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, NA_EDITED, NC_SCREEN, v2dViewZoomData::region, UI_view2d_curRect_changed(), UI_view2d_sync(), V2D_ALIGN_NO_POS_X, V2D_ALIGN_NO_POS_Y, V2D_KEEPOFS_X, V2D_KEEPOFS_Y, V2D_LIMITZOOM, V2D_LOCK_COPY, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, WM_event_add_notifier(), rctf::xmax, rctf::xmin, rctf::ymax, rctf::ymin, and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by view_zoomstep_apply().
|
static |
Definition at line 865 of file view2d_ops.cc.
References CTX_wm_area(), wmOperator::customdata, ELEM, View2D::flag, MEM_SAFE_FREE, SPACE_ACTION, SPACE_GRAPH, UI_view2d_zoom_cache_reset(), and v2dViewZoomData::v2d.
Referenced by view_zoomin_exec(), and view_zoomout_exec().