Blender
V3.3
|
#include <cmath>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_math_base.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_view2d.h"
#include "PIL_time.h"
Go to the source code of this file.
Classes | |
struct | v2dViewPanData |
struct | v2dViewZoomData |
struct | SmoothView2DStore |
struct | v2dScrollerMove |
struct | View2DScrollers |
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 1749 of file view2d_ops.cc.
void ED_keymap_view2d | ( | wmKeyConfig * | keyconf | ) |
Definition at line 2277 of file view2d_ops.cc.
References WM_keymap_ensure().
Referenced by ED_spacetypes_keymap().
Definition at line 2250 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 1764 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 2177 of file view2d_ops.cc.
References View2D::align, blender::compositor::area(), BLI_rcti_size_x(), BLI_rcti_size_y(), C, 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(), ARegion::v2d, 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 VIEW2D_OT_reset().
|
static |
Definition at line 1933 of file view2d_ops.cc.
References C, 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 1927 of file view2d_ops.cc.
References C, and scroller_activate_exit().
Referenced by VIEW2D_OT_scroller_activate().
|
static |
Definition at line 1912 of file view2d_ops.cc.
References C, CTX_wm_region(), wmOperator::customdata, ED_region_tag_redraw_no_rebuild(), View2D::flag, MEM_freeN, View2D::scroll_ui, v2dScrollerMove::v2d, V2D_IS_NAVIGATING, 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 1829 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(), C, 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, UI_view2d_scrollers_calc(), v2dScrollerMove::v2d, ARegion::v2d, V2D_IS_NAVIGATING, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, View2D::vert, View2DScrollers::vert_max, View2DScrollers::vert_min, ARegion::winrct, rcti::xmax, rcti::xmin, rcti::ymax, rcti::ymin, and v2dScrollerMove::zone.
Referenced by scroller_activate_invoke().
|
static |
Definition at line 2068 of file view2d_ops.cc.
References C, CTX_wm_region(), wmOperator::customdata, v2dScrollerMove::delta, ELEM, float(), if(), 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(), ARegion::v2d, 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 1995 of file view2d_ops.cc.
References C, wmOperator::customdata, v2dScrollerMove::delta, ELEM, float(), 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, wmEvent::val, wmEvent::xy, and v2dScrollerMove::zone.
Referenced by VIEW2D_OT_scroller_activate().
Definition at line 1813 of file view2d_ops.cc.
References C, CTX_wm_region(), CTX_wm_window(), wmWindow::eventstate, UI_view2d_mouse_in_scrollers(), ARegion::v2d, 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 1522 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, | ||
const int | smooth_viewtx | ||
) |
Definition at line 1549 of file view2d_ops.cc.
References BLI_rctf_compare(), C, 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(), ARegion::v2d, V2D_LOCK_COPY, WM_event_add_timer(), and WM_event_remove_timer().
Referenced by view_borderzoom_exec().
|
static |
Definition at line 368 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(), UI_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 301 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 2232 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 502 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 456 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 416 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 549 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 2153 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 1668 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 1299 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, 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 1407 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 842 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, 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 906 of file view2d_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, 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().
Definition at line 39 of file view2d_ops.cc.
References C, CTX_wm_region(), View2D::flag, ARegion::v2d, and V2D_IS_INIT.
Referenced by scroller_activate_poll(), VIEW2D_OT_reset(), and VIEW2D_OT_smoothview().
|
static |
Definition at line 1617 of file view2d_ops.cc.
References BLI_rctf_interp(), C, CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_screen(), CTX_wm_window(), View2D::cur, wmEvent::customdata, wmTimer::duration, ED_region_tag_redraw_no_rebuild(), float(), MEM_freeN, SmoothView2DStore::new_cur, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, SmoothView2DStore::orig_cur, View2D::smooth_timer, View2D::sms, SmoothView2DStore::time_allowed, UI_view2d_curRect_changed(), UI_view2d_sync(), UI_view2d_zoom_cache_reset(), ARegion::v2d, V2D_LOCK_COPY, WM_event_add_mousemove(), and WM_event_remove_timer().
Referenced by VIEW2D_OT_smoothview().
|
static |
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...
Definition at line 1344 of file view2d_ops.cc.
References BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_size_x(), BLI_rctf_size_y(), C, center, 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(), ARegion::v2d, 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 361 of file view2d_ops.cc.
References wmOperator::customdata, View2D::flag, MEM_SAFE_FREE, v2dViewPanData::v2d, and V2D_IS_NAVIGATING.
Referenced by VIEW2D_OT_edge_pan().
|
static |
Definition at line 333 of file view2d_ops.cc.
References C, 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 344 of file view2d_ops.cc.
References C, 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, V2D_IS_NAVIGATING, and wmEvent::val.
Referenced by VIEW2D_OT_edge_pan().
|
static |
Definition at line 169 of file view2d_ops.cc.
References C, 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 139 of file view2d_ops.cc.
References v2dViewPanData::area, C, CTX_wm_window(), View2D::cur, 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 296 of file view2d_ops.cc.
References view_pan_exit().
Referenced by VIEW2D_OT_pan().
|
static |
Definition at line 191 of file view2d_ops.cc.
References C, OPERATOR_FINISHED, view_pan_apply(), view_pan_exit(), and view_pan_init().
Referenced by VIEW2D_OT_pan().
|
static |
Definition at line 177 of file view2d_ops.cc.
References wmOperator::customdata, View2D::flag, MEM_SAFE_FREE, v2dViewPanData::v2d, and V2D_IS_NAVIGATING.
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 114 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(), C, CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), View2D::cur, wmOperator::customdata, v2dViewPanData::facx, v2dViewPanData::facy, View2D::flag, float(), v2dViewPanData::region, v2dViewPanData::screen, v2dViewPanData::v2d, ARegion::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 200 of file view2d_ops.cc.
References C, CTX_wm_window(), wmOperator::customdata, v2dViewPanData::invoke_event, View2D::keepofs, v2dViewPanData::lastx, v2dViewPanData::lasty, MOUSEPAN, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmEvent::prev_xy, wmOperator::ptr, 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 245 of file view2d_ops.cc.
References C, CTX_wm_window(), wmOperator::customdata, ELEM, EVT_ESCKEY, 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, wmEvent::val, view_pan_apply(), view_pan_exit(), WM_cursor_modal_restore(), WM_OP_INVOKE_DEFAULT, WM_operator_name_call(), and wmEvent::xy.
Referenced by VIEW2D_OT_pan().
Definition at line 93 of file view2d_ops.cc.
References C, CTX_wm_region(), View2D::keepofs, ARegion::v2d, 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 473 of file view2d_ops.cc.
References C, CTX_wm_region(), wmOperator::customdata, View2D::keepofs, View2D::mask, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_int_set(), RNA_property_boolean_get(), RNA_property_is_set(), RNA_struct_find_property(), v2dViewPanData::v2d, ARegion::v2d, V2D_LOCKOFS_Y, view_pan_apply(), view_pan_exit(), view_pan_init(), rcti::ymax, and rcti::ymin.
Referenced by VIEW2D_OT_scroll_down().
|
static |
Definition at line 433 of file view2d_ops.cc.
References C, wmOperator::customdata, View2D::keepofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_int_set(), 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 393 of file view2d_ops.cc.
References C, wmOperator::customdata, View2D::keepofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_int_set(), 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 520 of file view2d_ops.cc.
References BLI_rcti_size_y(), C, CTX_wm_region(), wmOperator::customdata, View2D::keepofs, View2D::mask, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_int_set(), RNA_property_boolean_get(), RNA_property_is_set(), RNA_struct_find_property(), v2dViewPanData::v2d, ARegion::v2d, V2D_LOCKOFS_Y, view_pan_apply(), view_pan_exit(), and view_pan_init().
Referenced by VIEW2D_OT_scroll_up().
Clamp by convention rather than locking flags, for ndof and +/- keys
Definition at line 608 of file view2d_ops.cc.
References blender::compositor::area(), C, CTX_wm_area(), CTX_wm_region(), ARegion::regiontype, RGN_TYPE_WINDOW, and SPACE_SEQ.
Referenced by view_zoomin_exec(), and view_zoomout_exec().
Definition at line 626 of file view2d_ops.cc.
References C, CTX_wm_region(), CTX_wm_region_view3d(), View2D::keepzoom, ARegion::v2d, 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 944 of file view2d_ops.cc.
References blender::compositor::area(), BLI_rctf_size_x(), BLI_rctf_size_y(), C, 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, PIL_check_seconds_timer(), wmOperator::ptr, v2dViewZoomData::region, RNA_boolean_get(), RNA_float_get(), time, v2dViewZoomData::timer, v2dViewZoomData::timer_lastdraw, 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 1041 of file view2d_ops.cc.
References C, and view_zoomdrag_exit().
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 1047 of file view2d_ops.cc.
References C, OPERATOR_FINISHED, view_zoomdrag_apply(), view_zoomdrag_exit(), and view_zoomdrag_init().
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 1024 of file view2d_ops.cc.
References C, CTX_wm_manager(), CTX_wm_window(), wmOperator::customdata, View2D::flag, MEM_freeN, v2dViewZoomData::timer, UI_view2d_zoom_cache_reset(), v2dViewZoomData::v2d, V2D_IS_NAVIGATING, and WM_event_remove_timer().
Referenced by view_zoomdrag_cancel(), view_zoomdrag_exec(), view_zoomdrag_invoke(), and view_zoomdrag_modal().
|
static |
Definition at line 652 of file view2d_ops.cc.
References BLI_assert, C, CTX_wm_region(), wmOperator::customdata, View2D::flag, v2dViewZoomData::region, v2dViewZoomData::v2d, ARegion::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 1056 of file view2d_ops.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), C, clamp_f(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_window(), View2D::cur, wmOperator::customdata, ELEM, fabsf, 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, PIL_check_seconds_timer(), wmOperator::ptr, RNA_float_set(), v2dViewZoomData::timer, 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, ARegion::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_add_timer(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by VIEW2D_OT_zoom().
|
static |
Definition at line 1167 of file view2d_ops.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), C, clamp_f(), CTX_wm_window(), View2D::cur, wmOperator::customdata, wmEvent::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(), v2dViewZoomData::timer, 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 803 of file view2d_ops.cc.
References C, 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 824 of file view2d_ops.cc.
References C, CTX_wm_region(), wmOperator::customdata, wmEvent::mval, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, UI_view2d_region_to_view(), USER_ZOOM_TO_MOUSEPOS, ARegion::v2d, view_zoomdrag_init(), view_zoomin_exec(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by VIEW2D_OT_zoom_in().
|
static |
Definition at line 866 of file view2d_ops.cc.
References C, 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 888 of file view2d_ops.cc.
References C, CTX_wm_region(), wmOperator::customdata, wmEvent::mval, v2dViewZoomData::mx_2d, v2dViewZoomData::my_2d, UI_view2d_region_to_view(), USER_ZOOM_TO_MOUSEPOS, ARegion::v2d, view_zoomdrag_init(), view_zoomout_exec(), and v2dViewZoomData::zoom_to_mouse_pos.
Referenced by VIEW2D_OT_zoom_out().
|
static |
Definition at line 780 of file view2d_ops.cc.
References C, 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 671 of file view2d_ops.cc.
References View2D::align, blender::compositor::area(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), C, 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(), ARegion::v2d, 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 794 of file view2d_ops.cc.
References wmOperator::customdata, View2D::flag, MEM_SAFE_FREE, UI_view2d_zoom_cache_reset(), v2dViewZoomData::v2d, and V2D_IS_NAVIGATING.
Referenced by view_zoomin_exec(), and view_zoomout_exec().