-/* ****************** cursor near edge operator ********************************* */
-
-static int scredge_is_horizontal(ScrEdge *se)
-{
- return (se->v1->vec.y == se->v2->vec.y);
-}
-
-static ScrEdge *screen_find_active_scredge(bScreen *sc, int mx, int my)
-{
- ScrEdge *se;
-
- for (se= sc->edgebase.first; se; se= se->next) {
- if (scredge_is_horizontal(se)) {
- short min, max;
- min= MIN2(se->v1->vec.x, se->v2->vec.x);
- max= MAX2(se->v1->vec.x, se->v2->vec.x);
-
- if (abs(my-se->v1->vec.y)<=2 && mx>=min && mx<=max)
- return se;
- }
- else {
- short min, max;
- min= MIN2(se->v1->vec.y, se->v2->vec.y);
- max= MAX2(se->v1->vec.y, se->v2->vec.y);
-
- if (abs(mx-se->v1->vec.x)<=2 && my>=min && my<=max)
- return se;
- }
- }
-
- return NULL;
-}
-
-
-/* operator cb */
-static int screen_cursor_test(bContext *C, wmOperator *op, wmEvent *event)
-{
- if (C->screen->subwinactive==C->screen->mainwin) {
- ScrEdge *actedge= screen_find_active_scredge(C->screen, event->x, event->y);
-
- if (actedge && scredge_is_horizontal(actedge)) {
- WM_set_cursor(C, CURSOR_Y_MOVE);
- } else {
- WM_set_cursor(C, CURSOR_X_MOVE);
- }
- }
- else {
- ScrArea *sa= NULL;
- AZone *az= NULL;
-
- for(sa= C->screen->areabase.first; sa; sa= sa->next) {
- az= is_in_area_actionzone(sa, event->x, event->y);
- if(az!=NULL) break;
- }
-
- if(az!=NULL) WM_set_cursor(C, CURSOR_EDIT);
- else WM_set_cursor(C, CURSOR_STD);
- }
-
- return OPERATOR_PASS_THROUGH;
-}
-
-static void ED_SCR_OT_cursor_type(wmOperatorType *ot)
-{
- ot->name= "Cursor type";
- ot->idname= "ED_SCR_OT_cursor_type";
-
- ot->invoke= screen_cursor_test;
- ot->poll= ED_operator_screenactive;
-}
-
-