#include <fv_InlineImage.h>
FV_VisualInlineImage::FV_VisualInlineImage | ( | FV_View * | pView | ) |
References UT_ASSERT_HARMLESS.
FV_VisualInlineImage::~FV_VisualInlineImage | ( | ) |
References DELETEP, m_pAutoScrollTimer, m_pDocUnderCursor, m_pDragImage, m_screenCache, and UT_Timer::stop().
void FV_VisualInlineImage::_actuallyScroll | ( | UT_Worker * | pTimer | ) | [static] |
References AV_SCROLLCMD_LINEDOWN, AV_SCROLLCMD_LINELEFT, AV_SCROLLCMD_LINERIGHT, AV_SCROLLCMD_LINEUP, bScrollRunning, FV_View::cmdScroll(), DELETEP, drawImage(), FV_View::getGraphics(), FV_Base::getGraphics(), UT_Worker::getInstanceData(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), iExtra, m_bSelectionDrawn, m_pAutoScrollTimer, m_pDragImage, FV_Base::m_pView, FV_Base::m_recCurFrame, FV_Base::m_xLastMouse, FV_Base::m_yLastMouse, GR_Graphics::setClipRect(), UT_Worker::stop(), UT_Timer::stop(), FV_View::updateScreen(), and UT_return_if_fail.
Referenced by _autoScroll().
void FV_VisualInlineImage::_autoScroll | ( | UT_Worker * | pTimer | ) | [static] |
References _actuallyScroll(), bScrollRunning, FV_Base::getGraphics(), UT_Worker::getInstanceData(), UT_WorkerFactory::IDLE, iExtra, UT_Worker::start(), UT_WorkerFactory::static_constructor(), UT_WorkerFactory::TIMER, GR_Graphics::tlu(), UT_DEBUGMSG, and UT_return_if_fail.
Referenced by _mouseDrag().
Implements FV_Base.
References _autoScroll(), FV_Base::_beginGlob(), FV_Base::_checkDimensions(), FV_Base::_doMouseDrag(), FV_View::_setPoint(), AUTO_SCROLL_MSECS, cleanUP(), clearCursor(), DELETEP, drawCursor(), GR_Painter::drawImage(), drawImage(), FV_View::drawSelectionBox(), FV_DragWhole, FV_InlineDrag_DRAGGING, FV_InlineDrag_NOT_ACTIVE, FV_InlineDrag_WAIT_FOR_MOUSE_DRAG, GR_Painter::genImageFromRectangle(), FV_Base::getDragWhat(), FV_Base::getGraphics(), getPosFromXY(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), UT_Rect::height, UT_Rect::left, m_bDoingCopy, FV_Base::m_bFirstDragDone, m_bSelectionDrawn, m_bTextCut, FV_Base::m_iFirstEverX, FV_Base::m_iFirstEverY, m_iInlineDragMode, m_iLastX, m_iLastY, m_pAutoScrollTimer, FV_Base::m_pView, FV_Base::m_recCurFrame, m_screenCache, FV_Base::m_xLastMouse, FV_Base::m_yLastMouse, MIN_DRAG_PIXELS, mouseCut(), UT_Timer::set(), GR_Graphics::setClipRect(), UT_Timer::start(), UT_Timer::static_constructor(), GR_Graphics::tlu(), UT_Rect::top, FV_View::updateScreen(), UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by FV_UnixVisualInlineImage::mouseDrag().
void FV_VisualInlineImage::abortDrag | ( | void | ) |
References cleanUP(), FV_View::cmdUndo(), and FV_Base::m_pView.
Referenced by FV_UnixVisualInlineImage::mouseDrag().
void FV_VisualInlineImage::cleanUP | ( | void | ) |
References FV_Base::_endGlob(), EV_Mouse::clearMouseContext(), DELETEP, FV_DragNothing, XAP_Frame::getMouse(), AV_View::getParentData(), UT_Rect::height, UT_Rect::left, m_bDoingCopy, FV_Base::m_bFirstDragDone, m_bSelectionDrawn, FV_Base::m_iFirstEverX, FV_Base::m_iFirstEverY, FV_Base::m_iGlobCount, m_iInitialOffX, m_iInitialOffY, m_iInlineDragMode, m_iLastX, m_iLastY, m_pDocUnderCursor, m_pDragImage, m_pImageAP, FV_View::m_prevMouseContext, FV_Base::m_pView, FV_Base::m_recCurFrame, m_screenCache, FV_View::setCursorToContext(), FV_Base::setDragWhat(), UT_Rect::top, FV_View::updateScreen(), and UT_Rect::width.
Referenced by _mouseDrag(), abortDrag(), mouseCopy(), mouseLeftPress(), and mouseRelease().
void FV_VisualInlineImage::clearCursor | ( | void | ) |
References DELETEP, GR_Painter::drawImage(), FV_Base::getGraphics(), UT_Rect::left, m_bCursorDrawn, m_pDocUnderCursor, m_recCursor, UT_Rect::top, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.
Referenced by _mouseDrag(), and mouseRelease().
void FV_VisualInlineImage::drawCursor | ( | PT_DocPosition | newPos | ) |
References FV_View::_findPositionCoords(), GR_Painter::fillRect(), GR_Painter::genImageFromRectangle(), FV_Base::getGraphics(), UT_Rect::height, UT_Rect::left, m_bCursorDrawn, m_pDocUnderCursor, FV_Base::m_pView, m_recCursor, GR_Graphics::tlu(), UT_Rect::top, UT_ASSERT, and UT_Rect::width.
Referenced by _mouseDrag().
bool FV_VisualInlineImage::drawImage | ( | void | ) |
References GR_Painter::drawImage(), FV_Base::getGraphics(), UT_Rect::left, m_pDragImage, FV_Base::m_recCurFrame, UT_Rect::top, UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and xxx_UT_DEBUGMSG.
Referenced by _actuallyScroll(), _mouseDrag(), mouseCopy(), mouseCut(), mouseLeftPress(), and setDragType().
PP_AttrProp * FV_VisualInlineImage::getImageAPFromXY | ( | UT_sint32 | x, | |
UT_sint32 | y | |||
) |
This method returns the Attributes/Properties pointer of the image at location (X,y). It return NULL if there is no image at (x,y)
References getImageFromSelection().
Referenced by mouseLeftPress().
void FV_VisualInlineImage::getImageFromSelection | ( | UT_sint32 | x, | |
UT_sint32 | y, | |||
PP_AttrProp ** | pAP = NULL | |||
) |
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(), DELETEP, FV_InlineDrag_WAIT_FOR_MOUSE_DRAG, GR_Painter::genImageFromRectangle(), fp_Run::getAscent(), fp_Line::getAscent(), FV_View::getDocPositionFromXY(), FV_Base::getGraphics(), fp_Run::getHeight(), fp_Run::getLength(), fp_Run::getLine(), fp_Run::getNextRun(), fp_Line::getScreenOffsets(), fp_Run::getSpanAP(), fp_Run::getType(), fp_Run::getWidth(), UT_Rect::left, m_bEmbedCanResize, m_bIsEmbedded, m_iInitialOffX, m_iInitialOffY, m_iInlineDragMode, m_iLastX, m_iLastY, m_pDragImage, m_pImageAP, FV_Base::m_pView, FV_Base::m_recCurFrame, GR_Graphics::tlu(), UT_Rect::top, and xxx_UT_DEBUGMSG.
Referenced by getImageAPFromXY(), mouseCopy(), mouseCut(), and setDragType().
UT_sint32 FV_VisualInlineImage::getImageSelBoxSize | ( | ) | const |
Referenced by FV_View::getImageSelInfo().
FV_InlineDragMode FV_VisualInlineImage::getInlineDragMode | ( | void | ) | const [inline] |
Referenced by FV_View::btn0InlineImage(), and FV_UnixVisualInlineImage::mouseDrag().
const char * FV_VisualInlineImage::getPNGImage | ( | UT_ConstByteBufPtr & | pBuf | ) | const |
References PD_Document::getDataItemDataByName(), FV_View::getDocument(), FV_Base::m_pView, and m_sDataId.
Referenced by FV_UnixVisualInlineImage::mouseDrag().
PT_DocPosition FV_VisualInlineImage::getPosFromXY | ( | UT_sint32 | x, | |
UT_sint32 | y | |||
) | const |
References FV_View::getDocPositionFromXY(), FV_Base::getGraphics(), m_iInitialOffX, m_iInitialOffY, FV_Base::m_pView, and GR_Graphics::tlu().
Referenced by _mouseDrag(), and mouseRelease().
bool FV_VisualInlineImage::isActive | ( | void | ) | const |
References FV_InlineDrag_NOT_ACTIVE, and m_iInlineDragMode.
Referenced by FV_View::_getMouseContext(), mouseLeftPress(), and FV_View::setCursorToContext().
References FV_Base::_beginGlob(), FV_View::_resetSelection(), cleanUP(), FV_View::cmdSelect(), PD_Document::createDataItem(), drawImage(), fl_BlockLayout::findPointCoords(), FV_DragWhole, FV_View::getBlockAtPosition(), PD_Document::getDataItemDataByName(), FV_Base::getDoc(), FV_View::getDocPositionFromXY(), getImageFromSelection(), FV_View::getMouseContext(), fp_Run::getNextRun(), FV_View::getSelectedImage(), fp_Run::getType(), PD_Document::getUID(), UT_UniqueId::Image, FV_View::isSelectionEmpty(), m_bDoingCopy, m_bIsEmbedded, m_bSelectionDrawn, m_bTextCut, m_iInlineDragMode, FV_View::m_prevMouseContext, FV_Base::m_pView, m_sCopyName, FV_View::setCursorToContext(), FV_Base::setDragWhat(), FV_View::updateScreen(), UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and UT_std_string_sprintf().
Referenced by FV_View::btn1CopyImage().
References FV_Base::_beginGlob(), FV_View::_clearSelection(), FV_View::_setSelectionAnchor(), FV_View::cmdCharDelete(), FV_View::cmdSelect(), drawImage(), fl_BlockLayout::findPointCoords(), FV_View::getBlockAtPosition(), fp_Run::getBlockOffset(), FV_View::getDocPositionFromXY(), getImageFromSelection(), fp_Run::getNextRun(), FV_View::getPoint(), fl_BlockLayout::getPosition(), FV_View::getSelectionAnchor(), fp_Run::getType(), m_bDoingCopy, m_bSelectionDrawn, FV_Base::m_pView, m_sDataId, FV_View::setPoint(), FV_View::updateScreen(), and UT_DEBUGMSG.
Referenced by _mouseDrag().
References GR_Graphics::allCarets(), cleanUP(), FV_View::cmdSelect(), AllCarets::disable(), drawImage(), fl_BlockLayout::findPointCoords(), FV_DragNothing, FV_DragWhole, FV_InlineDrag_WAIT_FOR_MOUSE_CLICK, FV_InlineDrag_WAIT_FOR_MOUSE_DRAG, FV_View::getBlockAtPosition(), FV_View::getDocPositionFromXY(), FV_Base::getDragWhat(), FV_Base::getGraphics(), getImageAPFromXY(), FV_View::getMouseContext(), fp_Run::getNextRun(), fp_Run::getType(), isActive(), FV_View::m_countDisable, m_iInlineDragMode, m_iLastX, m_iLastY, m_pImageAP, FV_Base::m_pView, setDragType(), and FV_View::warpInsPtToXY().
Referenced by FV_View::btn1InlineImage().
FV_DragWhat FV_VisualInlineImage::mouseMotion | ( | UT_sint32 | x, | |
UT_sint32 | y | |||
) |
x and y is the location in the document windows of the mouse in logical units.
References FV_Base::_endGlob(), FV_View::_generalUpdate(), FV_View::_restorePieceTableState(), FV_View::_saveAndNotifyPieceTableChange(), FV_View::_updateInsertionPoint(), GR_Graphics::CAP_PROJECTING, cleanUP(), clearCursor(), FV_View::cmdSelect(), DELETEP, DIM_IN, GR_Painter::drawImage(), FV_DragWhole, FV_InlineDrag_DRAGGING, FV_InlineDrag_RESIZE, gchar, PP_AttrProp::getAttribute(), FV_Base::getDoc(), FV_Base::getDragWhat(), FV_Base::getGraphics(), FV_View::getMouseContext(), FV_View::getPageSize(), FV_View::getPoint(), getPosFromXY(), PP_AttrProp::getProperty(), UT_Rect::height, fp_PageSize::Height(), PD_Document::insertObject(), GR_Graphics::JOIN_MITER, UT_Rect::left, GR_Graphics::LINE_SOLID, m_bDoingCopy, FV_Base::m_bFirstDragDone, m_bIsEmbedded, m_bSelectionDrawn, m_bTextCut, FV_Base::m_iFirstEverX, FV_Base::m_iFirstEverY, FV_Base::m_iGlobCount, m_iInitialOffX, m_iInitialOffY, m_iInlineDragMode, m_pAutoScrollTimer, m_pDragImage, m_pImageAP, FV_Base::m_pView, FV_Base::m_recCurFrame, m_sCopyName, m_screenCache, PT_IMAGE_DESCRIPTION, PT_IMAGE_TITLE, PT_PROPS_ATTRIBUTE_NAME, FV_View::setCharFormat(), GR_Graphics::setClipRect(), GR_Graphics::setLineProperties(), FV_View::setPoint(), UT_Timer::stop(), GR_Graphics::tlu(), UT_Rect::top, FV_View::updateScreen(), UT_DEBUGMSG, UT_LAYOUT_RESOLUTION, UT_std_string_setProperty(), UT_std_string_sprintf(), FV_View::warpInsPtToXY(), UT_Rect::width, and fp_PageSize::Width().
Referenced by FV_View::releaseInlineImage().
This method finds the correct image on the screen associated with the (x,y) point. It sets the FV_ImageDragMode and the FV_InlineDragWhat mode depending on which control is selected at the (x,y) position.
top left top edge top right X----------X----------X | | | | left edge X X right edge | | | | X----------X----------X Bot left Bot edge Bot right
An (x,y) point that does not fall in a specified control sets drag whole frame mode.
Also sets the image attributes/property list variables m_sAttributes, m_sProperties
References drawImage(), FRAME_HANDLE_SIZE, FV_DragBotEdge, FV_DragBotLeftCorner, FV_DragBotRightCorner, FV_DragLeftEdge, FV_DragNothing, FV_DragRightEdge, FV_DragTopEdge, FV_DragTopLeftCorner, FV_DragTopRightCorner, FV_DragWhole, FV_InlineDrag_NOT_ACTIVE, FV_Base::getDragWhat(), FV_Base::getGraphics(), getImageFromSelection(), UT_Rect::height, UT_Rect::left, m_bEmbedCanResize, m_bIsEmbedded, m_iInlineDragMode, m_iLastX, m_iLastY, FV_Base::m_pView, FV_Base::m_recCurFrame, FV_View::setCursorToContext(), FV_Base::setDragWhat(), GR_Graphics::tlu(), UT_Rect::top, UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by FV_View::btn0InlineImage(), and mouseLeftPress().
void FV_VisualInlineImage::setMode | ( | FV_InlineDragMode | iInlineDragMode | ) |
References FV_InlineDrag_NOT_ACTIVE, m_bSelectionDrawn, m_iInlineDragMode, FV_Base::m_pView, and FV_View::updateScreen().
Referenced by FV_View::warpInsPtToXY().
void FV_VisualInlineImage::setSelectionDrawn | ( | bool | bSelectionDrawn | ) |
References m_bSelectionDrawn.
Referenced by FV_View::drawSelectionBox().
friend class fv_View [friend] |
bool FV_VisualInlineImage::m_bCursorDrawn [private] |
Referenced by clearCursor(), and drawCursor().
bool FV_VisualInlineImage::m_bDoingCopy [private] |
Referenced by _mouseDrag(), cleanUP(), mouseCopy(), mouseCut(), and mouseRelease().
bool FV_VisualInlineImage::m_bEmbedCanResize [private] |
Referenced by getImageFromSelection(), and setDragType().
bool FV_VisualInlineImage::m_bIsEmbedded [private] |
Referenced by getImageFromSelection(), mouseCopy(), mouseRelease(), and setDragType().
bool FV_VisualInlineImage::m_bSelectionDrawn [private] |
Referenced by _actuallyScroll(), _mouseDrag(), cleanUP(), mouseCopy(), mouseCut(), mouseRelease(), setMode(), and setSelectionDrawn().
bool FV_VisualInlineImage::m_bTextCut [private] |
Referenced by _mouseDrag(), mouseCopy(), and mouseRelease().
Referenced by cleanUP(), getImageFromSelection(), getPosFromXY(), and mouseRelease().
Referenced by cleanUP(), getImageFromSelection(), getPosFromXY(), and mouseRelease().
Referenced by _mouseDrag(), cleanUP(), getImageFromSelection(), isActive(), mouseCopy(), mouseLeftPress(), mouseRelease(), setDragType(), and setMode().
UT_sint32 FV_VisualInlineImage::m_iLastX [private] |
Referenced by _mouseDrag(), cleanUP(), getImageFromSelection(), mouseLeftPress(), and setDragType().
UT_sint32 FV_VisualInlineImage::m_iLastY [private] |
Referenced by _mouseDrag(), cleanUP(), getImageFromSelection(), mouseLeftPress(), and setDragType().
UT_Timer* FV_VisualInlineImage::m_pAutoScrollTimer [private] |
Referenced by _actuallyScroll(), _mouseDrag(), mouseRelease(), and ~FV_VisualInlineImage().
GR_Image* FV_VisualInlineImage::m_pDocUnderCursor [private] |
Referenced by cleanUP(), clearCursor(), drawCursor(), and ~FV_VisualInlineImage().
GR_Image* FV_VisualInlineImage::m_pDragImage [private] |
Referenced by _actuallyScroll(), cleanUP(), drawImage(), getImageFromSelection(), mouseRelease(), and ~FV_VisualInlineImage().
PP_AttrProp* FV_VisualInlineImage::m_pImageAP [private] |
Referenced by cleanUP(), getImageFromSelection(), mouseLeftPress(), and mouseRelease().
UT_Rect FV_VisualInlineImage::m_recCursor [private] |
Referenced by clearCursor(), and drawCursor().
std::string FV_VisualInlineImage::m_sCopyName [private] |
Referenced by mouseCopy(), and mouseRelease().
GR_Image* FV_VisualInlineImage::m_screenCache [private] |
Referenced by _mouseDrag(), cleanUP(), mouseRelease(), and ~FV_VisualInlineImage().
std::string FV_VisualInlineImage::m_sDataId [private] |
Referenced by getPNGImage(), and mouseCut().