#include <fv_VisualDragText.h>
FV_VisualDragText::FV_VisualDragText | ( | FV_View * | pView | ) |
References UT_ASSERT_HARMLESS.
FV_VisualDragText::~FV_VisualDragText | ( | ) | [virtual] |
References DELETEP, m_pAutoScrollTimer, m_pDragImage, and UT_Timer::stop().
void FV_VisualDragText::_actuallyScroll | ( | UT_Worker * | pTimer | ) | [static] |
References FV_View::_setPoint(), AV_SCROLLCMD_LINEDOWN, AV_SCROLLCMD_LINELEFT, AV_SCROLLCMD_LINERIGHT, AV_SCROLLCMD_LINEUP, bScrollRunning, FV_View::cmdScroll(), DELETEP, drawCursor(), drawImage(), FV_View::getGraphics(), getGraphics(), UT_Worker::getInstanceData(), getPosFromXY(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), iExtra, m_pAutoScrollTimer, m_pView, m_recCurFrame, m_xLastMouse, m_yLastMouse, GR_Graphics::setClipRect(), UT_Worker::stop(), UT_Timer::stop(), GR_Graphics::tlu(), FV_View::updateScreen(), and UT_return_if_fail.
Referenced by _autoScroll().
void FV_VisualDragText::_autoScroll | ( | UT_Worker * | pTimer | ) | [static] |
References _autoScroll(), FV_View::_setPoint(), AUTO_SCROLL_MSECS, PD_Document::beginUserAtomicGlob(), clearCursor(), XAP_Frame::dragText(), drawCursor(), drawImage(), FV_SelectionMode_NONE, FV_SelectionMode_TableRow, FV_VisualDrag_DRAGGING, FV_VisualDrag_NOT_ACTIVE, FV_VisualDrag_START_DRAGGING, FV_VisualDrag_WAIT_FOR_MOUSE_DRAG, FV_View::getDocument(), getGraphics(), AV_View::getParentData(), FV_View::getPoint(), getPosFromXY(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), UT_Rect::height, FV_View::isHdrFtrEdit(), FV_View::isSelectAll(), UT_Rect::left, m_bDoingCopy, m_bNotDraggingImage, m_bSelectedRow, m_bTextCut, m_iInitialOffX, m_iInitialOffY, m_iLastX, m_iLastY, m_iVisualDragMode, m_pAutoScrollTimer, m_pView, m_recCurFrame, m_recOrigLeft, m_recOrigRight, m_xLastMouse, m_yLastMouse, MIN_DRAG_PIXELS, mouseCut(), reposOffsets(), UT_Timer::set(), GR_Graphics::setClipRect(), setMode(), FV_View::setSelectionMode(), UT_Timer::start(), UT_Timer::static_constructor(), GR_Graphics::tlu(), UT_Rect::top, FV_View::updateScreen(), UT_DEBUGMSG, UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by mouseDrag(), and FV_UnixVisualDrag::mouseDrag().
void FV_VisualDragText::abortDrag | ( | void | ) |
This method oborts the current visual drag.
References clearCursor(), FV_View::cmdUndo(), DELETEP, FV_VisualDrag_DRAGGING, FV_VisualDrag_NOT_ACTIVE, getGraphics(), m_bDoingCopy, m_bNotDraggingImage, m_bSelectedRow, m_iVisualDragMode, m_pAutoScrollTimer, m_pView, m_recCurFrame, GR_Graphics::setClipRect(), setMode(), UT_Timer::stop(), FV_View::updateScreen(), and UT_DEBUGMSG.
void FV_VisualDragText::clearCursor | ( | void | ) |
References GR_Graphics::allCarets(), DELETEP, AllCarets::disable(), GR_Painter::drawImage(), getGraphics(), UT_Rect::left, m_bCursorDrawn, FV_View::m_countDisable, m_pDocUnderCursor, m_pView, m_recCursor, m_recDoc, and UT_Rect::top.
Referenced by _mouseDrag(), abortDrag(), and mouseRelease().
void FV_VisualDragText::drawCursor | ( | PT_DocPosition | newPos | ) |
References FV_View::_findPositionCoords(), GR_Graphics::allCarets(), AllCarets::disable(), GR_Painter::fillRect(), GR_Painter::genImageFromRectangle(), getGraphics(), UT_Rect::height, UT_Rect::left, m_bCursorDrawn, FV_View::m_countDisable, m_pDocUnderCursor, m_pView, m_recCursor, m_recDoc, GR_Graphics::tlu(), UT_Rect::top, UT_ASSERT, and UT_Rect::width.
Referenced by _actuallyScroll(), and _mouseDrag().
void FV_VisualDragText::drawImage | ( | void | ) |
References GR_Painter::drawImage(), GR_Painter::fillRect(), getGraphics(), UT_Rect::height, isDoingCopy(), UT_Rect::left, m_bNotDraggingImage, m_pDragImage, m_recCurFrame, m_recOrigLeft, m_recOrigRight, GR_Graphics::setCursor(), UT_Rect::top, UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and UT_Rect::width.
Referenced by _actuallyScroll(), _mouseDrag(), mouseCopy(), mouseCut(), and reposOffsets().
UT_Rect* FV_VisualDragText::getCurFrame | ( | void | ) | [inline] |
Referenced by FV_UnixVisualDrag::mouseDrag().
GR_Graphics * FV_VisualDragText::getGraphics | ( | void | ) | const |
References FV_View::getGraphics(), and m_pView.
Referenced by _actuallyScroll(), _autoScroll(), _mouseDrag(), abortDrag(), clearCursor(), drawCursor(), drawImage(), getImageFromSelection(), getPosFromXY(), FV_UnixVisualDrag::mouseDrag(), mouseRelease(), and reposOffsets().
This method creates an image from the current selection. It sets the drag rectangle, the initial offsets and the initial positions of the cursor.
References FV_View::_findPositionCoords(), GR_Painter::genImageFromRectangle(), fl_DocSectionLayout::getActualColumnWidth(), fp_Line::getBlock(), fp_Run::getBlock(), FV_View::getCellAtPos(), fp_Container::getContainer(), fl_ContainerLayout::getContainerType(), fl_BlockLayout::getDocSectionLayout(), FV_View::getDocument(), fl_ContainerLayout::getFirstContainer(), fp_Line::getFirstRun(), getGraphics(), fp_Line::getHeight(), fp_CellContainer::getLeftAttach(), fl_CellLayout::getLength(), fp_Run::getLine(), fp_Line::getMaxWidth(), fp_Container::getNext(), fl_ContainerLayout::getNextBlockInDocument(), FV_View::getNthSelection(), FV_View::getNumSelections(), fp_Line::getPage(), FV_View::getPoint(), fl_ContainerLayout::getPosition(), fp_CellContainer::getRightAttach(), fp_Line::getScreenOffsets(), fp_VerticalContainer::getScreenRect(), fp_ContainerObject::getSectionLayout(), FV_View::getSelectionAnchor(), FV_View::getSelectionMode(), FV_View::getTableAtPos(), fp_CellContainer::getTopAttach(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), fp_Line::getX(), fp_Run::getX(), UT_Rect::height, PD_Document::isBlockAtPos(), PD_Document::isCellAtPos(), isDoingCopy(), fl_BlockLayout::isEmbeddedType(), PD_Document::isEndTableAtPos(), PD_Document::isTableAtPos(), UT_Rect::left, m_bNotDraggingImage, m_bSelectedRow, m_iInitialOffX, m_iInitialOffY, m_iLastX, m_iLastY, m_pDragImage, PD_DocumentRange::m_pos1, m_pView, m_recCurFrame, m_recOrigLeft, m_recOrigRight, fl_ContainerLayout::myContainingLayout(), GR_Graphics::setCursor(), UT_Rect::top, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_Rect::width.
Referenced by mouseCopy(), and mouseCut().
PT_DocPosition FV_VisualDragText::getPosFromXY | ( | UT_sint32 | x, | |
UT_sint32 | y | |||
) |
References FV_View::getDocPositionFromXY(), getGraphics(), m_iInitialOffX, m_iInitialOffY, m_pView, m_recOrigLeft, GR_Graphics::tlu(), UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by _actuallyScroll(), _mouseDrag(), and mouseRelease().
FV_VisualDragMode FV_VisualDragText::getVisualDragMode | ( | void | ) | const [inline] |
bool FV_VisualDragText::isActive | ( | void | ) | const |
References FV_VisualDrag_NOT_ACTIVE, and m_iVisualDragMode.
Referenced by Defun1().
bool FV_VisualDragText::isDoingCopy | ( | void | ) | [inline] |
Referenced by Defun(), drawImage(), getImageFromSelection(), and sActualVisualDrag().
bool FV_VisualDragText::isNotdraggingImage | ( | void | ) | [inline] |
Referenced by Defun(), and sActualVisualDrag().
References FV_View::_resetSelection(), FV_View::cmdCopy(), FV_View::copyToLocal(), drawImage(), getImageFromSelection(), FV_View::getPoint(), FV_View::getPrevSelectionMode(), FV_View::getSelectionAnchor(), m_bDoingCopy, m_bTextCut, m_iVisualDragMode, m_pView, and FV_View::updateScreen().
Referenced by FV_View::copyVisualText().
References FV_ViewDoubleBuffering::beginDoubleBuffering(), FV_View::cmdCharDelete(), FV_View::cmdCut(), FV_View::cmdDeleteRow(), FV_View::copyToLocal(), drawImage(), FV_ViewDoubleBuffering::endDoubleBuffering(), FV_SelectionMode_TableRow, FV_View::getDocument(), getImageFromSelection(), FV_View::getPoint(), FV_View::getSelectionAnchor(), FV_View::getSelectionMode(), m_bSelectedRow, m_pView, FV_View::setSelectionMode(), PD_Document::setVDNDinProgress(), and FV_View::updateScreen().
Referenced by _mouseDrag().
Reimplemented in FV_UnixVisualDrag.
References _mouseDrag().
Referenced by FV_View::dragVisualText().
x and y is the location in the document windows of the mouse in logical units.
References FV_ViewDoubleBuffering::beginDoubleBuffering(), clearCursor(), FV_View::cmdPaste(), FV_View::cmdSelect(), FV_View::cmdSelectColumn(), DELETEP, FV_ViewDoubleBuffering::endDoubleBuffering(), PD_Document::endUserAtomicGlob(), FV_VisualDrag_DRAGGING, fl_ContainerLayout::getContainerType(), FV_View::getCurrentBlock(), FV_View::getDocument(), getGraphics(), FV_View::getMouseContext(), FV_View::getPoint(), getPosFromXY(), FV_View::getPrevSelectionMode(), PD_Document::isEndFootnoteAtPos(), PD_Document::isFrameAtPos(), FV_View::isInFrame(), m_bDoingCopy, m_bNotDraggingImage, m_bSelectedRow, m_bTextCut, m_iInitialOffX, m_iInitialOffY, m_iVisualDragMode, m_pAutoScrollTimer, m_pDragImage, m_pView, m_recCurFrame, fl_ContainerLayout::myContainingLayout(), FV_View::pasteFromLocalTo(), GR_Graphics::setClipRect(), FV_View::setHdrFtrEdit(), FV_View::setPoint(), UT_Timer::stop(), FV_View::updateScreen(), and FV_View::warpInsPtToXY().
Referenced by FV_View::pasteVisualText().
This method is called at the commencement of a visual drag. If the offsets to the caret are too big, this method will adjust them and shift the image of the dragged text to a comfortable distance fromthe caret. Returns true if the offsets are shifted. UT_sint32 x pos of the caret UT_sint32 y pos of the caret
References drawImage(), getGraphics(), UT_Rect::height, UT_Rect::left, m_iInitialOffX, m_iInitialOffY, m_pView, m_recCurFrame, m_recOrigLeft, m_recOrigRight, UT_Rect::set(), GR_Graphics::setClipRect(), GR_Graphics::tlu(), UT_Rect::top, FV_View::updateScreen(), UT_DEBUGMSG, and UT_Rect::width.
Referenced by _mouseDrag().
void FV_VisualDragText::setMode | ( | FV_VisualDragMode | iVisualDragMode | ) |
References FV_VisualDrag_NOT_ACTIVE, m_iInitialOffX, m_iInitialOffY, m_iLastX, m_iLastY, m_iVisualDragMode, m_xLastMouse, and m_yLastMouse.
Referenced by _mouseDrag(), abortDrag(), and FV_UnixVisualDrag::mouseDrag().
friend class fv_View [friend] |
bool FV_VisualDragText::m_bCursorDrawn [private] |
Referenced by clearCursor(), and drawCursor().
bool FV_VisualDragText::m_bDoingCopy [private] |
Referenced by _mouseDrag(), abortDrag(), mouseCopy(), and mouseRelease().
bool FV_VisualDragText::m_bNotDraggingImage [private] |
Referenced by _mouseDrag(), abortDrag(), drawImage(), getImageFromSelection(), and mouseRelease().
bool FV_VisualDragText::m_bSelectedRow [private] |
Referenced by _mouseDrag(), abortDrag(), getImageFromSelection(), mouseCut(), and mouseRelease().
bool FV_VisualDragText::m_bTextCut [private] |
Referenced by _mouseDrag(), mouseCopy(), and mouseRelease().
UT_sint32 FV_VisualDragText::m_iInitialOffX [private] |
Referenced by _mouseDrag(), getImageFromSelection(), getPosFromXY(), mouseRelease(), reposOffsets(), and setMode().
UT_sint32 FV_VisualDragText::m_iInitialOffY [private] |
Referenced by _mouseDrag(), getImageFromSelection(), getPosFromXY(), mouseRelease(), reposOffsets(), and setMode().
UT_sint32 FV_VisualDragText::m_iLastX [private] |
Referenced by _mouseDrag(), getImageFromSelection(), and setMode().
UT_sint32 FV_VisualDragText::m_iLastY [private] |
Referenced by _mouseDrag(), getImageFromSelection(), and setMode().
Referenced by _mouseDrag(), abortDrag(), isActive(), mouseCopy(), mouseRelease(), and setMode().
UT_Timer* FV_VisualDragText::m_pAutoScrollTimer [private] |
Referenced by _actuallyScroll(), _mouseDrag(), abortDrag(), mouseRelease(), and ~FV_VisualDragText().
GR_Image* FV_VisualDragText::m_pDocUnderCursor [private] |
Referenced by clearCursor(), and drawCursor().
GR_Image* FV_VisualDragText::m_pDragImage [private] |
Referenced by drawImage(), getImageFromSelection(), mouseRelease(), and ~FV_VisualDragText().
FV_View* FV_VisualDragText::m_pView [protected] |
UT_Rect FV_VisualDragText::m_recCurFrame [private] |
Referenced by _actuallyScroll(), _mouseDrag(), abortDrag(), drawImage(), getImageFromSelection(), mouseRelease(), and reposOffsets().
UT_Rect FV_VisualDragText::m_recCursor [private] |
Referenced by clearCursor(), and drawCursor().
UT_Rect FV_VisualDragText::m_recDoc [private] |
Referenced by clearCursor(), and drawCursor().
UT_Rect FV_VisualDragText::m_recOrigLeft [private] |
Referenced by _mouseDrag(), drawImage(), getImageFromSelection(), getPosFromXY(), and reposOffsets().
UT_Rect FV_VisualDragText::m_recOrigRight [private] |
Referenced by _mouseDrag(), drawImage(), getImageFromSelection(), and reposOffsets().
UT_sint32 FV_VisualDragText::m_xLastMouse [private] |
Referenced by _actuallyScroll(), _mouseDrag(), and setMode().
UT_sint32 FV_VisualDragText::m_yLastMouse [private] |
Referenced by _actuallyScroll(), _mouseDrag(), and setMode().