Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_dragdrop.c
| Context not available. | |||||
| #include "BIF_glutil.h" | #include "BIF_glutil.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_screen.h" | |||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| Context not available. | |||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "wm_event_system.h" | #include "wm_event_system.h" | ||||
| #include "ED_screen.h" | |||||
| /* ****************************************************** */ | /* ****************************************************** */ | ||||
| static ListBase dropboxes = {NULL, NULL}; | static ListBase dropboxes = {NULL, NULL}; | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| /* called in inner handler loop, region context */ | |||||
| void wm_drags_check_scroll(bContext *C, wmEvent *event, ARegion *ar, ScrArea *sa) | |||||
| { | |||||
| if (ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_NODE, SPACE_BUTS)) { | |||||
| if (ar->regiontype == RGN_TYPE_WINDOW) { | |||||
| // not sure if the timer is mandatory (calling the op seems just fine?)... | |||||
| if ((ar->v2d.winy - event->mval[1]) < 10) { | |||||
| //ar->v2d.cur.ymin += 3.0; | |||||
| //ar->v2d.cur.ymax += 3.0; | |||||
| wmOperatorType *ot = WM_operatortype_find("VIEW2D_OT_scroll_up", false); | |||||
| PointerRNA ptr; | |||||
| WM_operator_properties_create_ptr(&ptr, ot); | |||||
| RNA_int_set(&ptr, "deltay", 3); | |||||
| WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr); | |||||
| WM_operator_properties_free(&ptr); | |||||
| } | |||||
| else if (event->mval[1] < 10) { | |||||
| //ar->v2d.cur.ymin -= 3.0; | |||||
| //ar->v2d.cur.ymax -= 3.0; | |||||
| wmOperatorType *ot = WM_operatortype_find("VIEW2D_OT_scroll_down", false); | |||||
| PointerRNA ptr; | |||||
| WM_operator_properties_create_ptr(&ptr, ot); | |||||
| RNA_int_set(&ptr, "deltay", -3); | |||||
| WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr); | |||||
| WM_operator_properties_free(&ptr); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| /* ************** draw ***************** */ | /* ************** draw ***************** */ | ||||
| static void wm_drop_operator_draw(const char *name, int x, int y) | static void wm_drop_operator_draw(const char *name, int x, int y) | ||||
| Context not available. | |||||