#include <fv_FrameEdit.h>
FV_FrameEdit::FV_FrameEdit | ( | FV_View * | pView | ) |
References UT_ASSERT_HARMLESS.
FV_FrameEdit::~FV_FrameEdit | ( | ) |
References DELETEP, m_pAutoScrollTimer, m_pFrameImage, and UT_Timer::stop().
void FV_FrameEdit::_actuallyScroll | ( | UT_Worker * | pTimer | ) | [static] |
References AV_SCROLLCMD_LINEDOWN, AV_SCROLLCMD_LINELEFT, AV_SCROLLCMD_LINERIGHT, AV_SCROLLCMD_LINEUP, bScrollRunning, FV_View::cmdScroll(), DELETEP, drawFrame(), getFrameEditMode(), FV_Base::getGraphics(), FL_DocLayout::getHeight(), UT_Worker::getInstanceData(), FV_View::getLayout(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), AV_View::getYScrollOffset(), iExtra, m_pAutoScrollTimer, FV_Base::m_pView, FV_Base::m_recCurFrame, FV_Base::m_xLastMouse, FV_Base::m_yLastMouse, GR_Graphics::setClipRect(), FV_View::setYScrollOffset(), UT_Worker::stop(), UT_Timer::stop(), GR_Graphics::tlu(), FV_View::updateScreen(), UT_DEBUGMSG, and UT_return_if_fail.
Referenced by _autoScroll().
void FV_FrameEdit::_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::_checkDimensions(), FV_Base::_doMouseDrag(), fp_VerticalContainer::_setHeight(), fp_VerticalContainer::_setWidth(), fp_VerticalContainer::_setX(), fp_VerticalContainer::_setY(), AUTO_SCROLL_MSECS, FV_ViewDoubleBuffering::beginDoubleBuffering(), DELETEP, drawFrame(), FV_DragWhole, FV_FrameEdit_DRAG_EXISTING, FV_FrameEdit_RESIZE_EXISTING, FV_FrameEdit_RESIZE_INSERT, fl_ContainerLayout::getDocSectionLayout(), FV_Base::getDragWhat(), fp_FrameContainer::getFullX(), fp_FrameContainer::getFullY(), FV_Base::getGraphics(), FL_DocLayout::getHeight(), FV_View::getLayout(), AV_View::getWindowHeight(), AV_View::getWindowWidth(), AV_View::getYScrollOffset(), UT_Rect::height, UT_Rect::left, fl_FrameLayout::localCollapse(), m_iFrameEditMode, m_iLastX, m_iLastY, m_pAutoScrollTimer, m_pFrameContainer, m_pFrameLayout, FV_Base::m_pView, FV_Base::m_recCurFrame, fl_FrameLayout::miniFormat(), UT_Timer::set(), GR_Graphics::setClipRect(), fl_FrameLayout::setFrameHeight(), fl_FrameLayout::setFrameWidth(), fl_DocSectionLayout::setNeedsSectionBreak(), FV_View::setYScrollOffset(), UT_Timer::start(), UT_Timer::static_constructor(), UT_Timer::stop(), GR_Graphics::tlu(), UT_Rect::top, FV_View::updateScreen(), UT_DEBUGMSG, UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by FV_UnixFrameEdit::mouseDrag().
void FV_FrameEdit::abortDrag | ( | void | ) |
References FV_ViewDoubleBuffering::beginDoubleBuffering(), FV_Base::getView(), FV_Base::m_iFirstEverX, FV_Base::m_iFirstEverY, m_iInitialDragX, m_iInitialDragY, FV_Base::m_pView, FV_Base::m_xLastMouse, FV_Base::m_yLastMouse, mouseRelease(), FV_View::updateScreen(), and UT_DEBUGMSG.
Referenced by FV_UnixFrameEdit::mouseDrag().
void FV_FrameEdit::deleteFrame | ( | fl_FrameLayout * | pFL = NULL |
) |
This method deletes the current selected frame
References FV_Base::_beginGlob(), FV_View::_charMotion(), FV_Base::_endGlob(), FV_View::_ensureInsertionPointOnScreen(), FV_View::_fixInsertionPointCoords(), FV_View::_generalUpdate(), FV_View::_restorePieceTableState(), FV_View::_saveAndNotifyPieceTableChange(), FV_View::_setPoint(), AV_CHG_HDRFTR, FV_ViewDoubleBuffering::beginDoubleBuffering(), DELETEP, PD_Document::deleteSpan(), PD_Document::disableListUpdates(), PD_Document::enableListUpdates(), FV_DragNothing, FV_Base::getDoc(), PD_Document::getNextStruxOfType(), FV_View::getPoint(), fl_Layout::getStruxDocHandle(), PD_Document::getStruxPosition(), UT_Rect::height, FV_View::isMarkRevisions(), FV_Base::m_bFirstDragDone, m_iFrameEditMode, FV_Base::m_iGlobCount, m_iLastX, m_iLastY, m_pFrameContainer, m_pFrameImage, m_pFrameLayout, FV_Base::m_pView, FV_Base::m_recCurFrame, FV_View::notifyListeners(), PTX_EndFrame, FV_Base::setDragWhat(), PD_Document::updateDirtyLists(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and UT_Rect::width.
Referenced by FV_View::convertPositionedToInLine(), FV_View::copyFrame(), and FV_View::deleteFrame().
void FV_FrameEdit::drawFrame | ( | bool | bWithHandles | ) |
References dg_DrawArgs::bDirtyRunsOnly, GR_Image::createImageSegment(), FV_View::draw(), fp_FrameContainer::draw(), fp_FrameContainer::drawHandles(), GR_Painter::drawImage(), FV_DragWhole, GR_Painter::genImageFromRectangle(), fl_SectionLayout::getBackgroundImage(), FV_Base::getDragWhat(), fl_FrameLayout::getFrameType(), FV_Base::getGraphics(), fp_FrameContainer::getPage(), FV_View::getPageScreenOffsets(), fp_FrameContainer::getX(), fp_FrameContainer::getY(), UT_Rect::left, m_pFrameContainer, m_pFrameImage, m_pFrameLayout, FV_Base::m_pView, FV_Base::m_recCurFrame, dg_DrawArgs::pG, UT_Rect::top, UT_ASSERT_HARMLESS, UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, dg_DrawArgs::xoff, and dg_DrawArgs::yoff.
Referenced by _actuallyScroll(), _mouseDrag(), mouseLeftPress(), mouseRelease(), and setDragType().
fp_FrameContainer* FV_FrameEdit::getFrameContainer | ( | void | ) | [inline] |
Referenced by fp_FrameContainer::draw().
FV_FrameEditMode FV_FrameEdit::getFrameEditMode | ( | void | ) | const [inline] |
fl_FrameLayout* FV_FrameEdit::getFrameLayout | ( | void | ) | const [inline] |
bool FV_FrameEdit::getFrameStrings | ( | UT_sint32 | x, | |
UT_sint32 | y, | |||
fv_FrameStrings & | FS, | |||
fl_BlockLayout ** | pCloseBL, | |||
fp_Page ** | pPage | |||
) |
References FV_View::_findPositionCoords(), DIM_IN, FL_DocLayout::findPage(), fp_Line::getColumn(), fp_Column::getColumnIndex(), fp_Container::getContainer(), fl_ContainerLayout::getContainerType(), FV_View::getDocPositionFromXY(), fl_ContainerLayout::getFirstContainer(), fp_Line::getFirstRun(), fl_BlockLayout::getFirstRun(), fp_Page::getHeight(), FV_View::getLayout(), fp_Run::getLine(), fp_VerticalContainer::getOffsets(), fp_Container::getPage(), FV_View::getPageScreenOffsets(), FV_View::getPageSize(), fl_BlockLayout::getPosition(), fl_ContainerLayout::getPrevBlockInDocument(), fp_Line::getScreenOffsets(), fp_Page::getScreenOffsets(), FV_Base::getView(), fp_Page::getWidth(), fp_Line::getX(), fl_BlockLayout::getXYOffsetToLine(), fp_PageSize::Height(), UT_Rect::height, FV_Base::m_pView, FV_Base::m_recCurFrame, fl_ContainerLayout::myContainingLayout(), fv_FrameStrings::sColXpos, fv_FrameStrings::sColYpos, fv_FrameStrings::sHeight, fv_FrameStrings::sPageXpos, fv_FrameStrings::sPageYpos, fv_FrameStrings::sPrefColumn, fv_FrameStrings::sPrefPage, fv_FrameStrings::sWidth, fv_FrameStrings::sXpos, fv_FrameStrings::sYpos, UT_ASSERT, UT_DEBUGMSG, UT_formatDimensionedValue(), UT_LAYOUT_RESOLUTION, UT_return_val_if_fail, UT_String_sprintf(), fp_PageSize::Width(), UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by FV_View::getFrameStrings_view(), and mouseRelease().
const char * FV_FrameEdit::getPNGImage | ( | UT_ConstByteBufPtr & | ppByteBuf | ) |
UT_sint32 FV_FrameEdit::haveDragged | ( | void | ) | const |
Returns 0 if the frame has never been dragged at all. Returns 1 if the frame has been dragged a little bit Return 10 if the frame has been dragged a lot.
References FV_Base::getGraphics(), FV_Base::m_bFirstDragDone, FV_Base::m_iFirstEverX, FV_Base::m_iFirstEverY, FV_Base::m_xLastMouse, FV_Base::m_yLastMouse, and UT_DEBUGMSG.
Referenced by mouseRelease().
bool FV_FrameEdit::isActive | ( | void | ) | const |
References FV_FrameEdit_NOT_ACTIVE, and m_iFrameEditMode.
Referenced by FV_View::_charInsert(), FV_View::_charMotion(), FV_View::_deleteSelection(), FV_View::_doPaste(), FV_View::_findReplace(), FV_View::_findReplaceReverse(), FV_View::_getMouseContext(), FV_View::_insertField(), FV_View::activateFrame(), FV_View::btn0Frame(), FV_View::cmdCharDelete(), FV_View::cmdDeleteCell(), FV_View::cmdDeleteCol(), FV_View::cmdDeleteRow(), FV_View::cmdInsertGraphic(), FV_View::cmdInsertTable(), FV_View::copyFrame(), Defun(), FV_View::deleteFrame(), FV_View::getFrameLayout(), FV_View::insertAnnotation(), FV_View::insertFootnote(), FV_View::insertParagraphBreak(), FV_View::insertSymbol(), FV_View::isFrameSelected(), FV_View::isSelectionEmpty(), mouseLeftPress(), mouseRelease(), FV_View::selectFrame(), FV_View::setCursorToContext(), and setDragType().
bool FV_FrameEdit::isImageWrapper | ( | void | ) | const |
References fl_FrameLayout::getFrameType(), and m_pFrameLayout.
Referenced by FV_View::isSelectionEmpty(), and FV_UnixFrameEdit::mouseDrag().
This method responds to a mouse click and decides what to do with it.
References FV_Base::_beginGlob(), FV_View::_clearSelection(), FV_Base::_endGlob(), GR_Graphics::allCarets(), EV_Mouse::clearMouseContext(), DELETEP, AllCarets::disable(), drawFrame(), FV_DragBotRightCorner, FV_DragNothing, FV_DragWhole, FV_FrameEdit_EXISTING_SELECTED, FV_FrameEdit_WAIT_FOR_FIRST_CLICK_INSERT, FV_Base::getDragWhat(), getFrameEditMode(), getFrameLayout(), fl_FrameLayout::getFrameType(), fp_FrameContainer::getFullX(), fp_FrameContainer::getFullY(), FV_Base::getGraphics(), XAP_Frame::getMouse(), AV_View::getParentData(), GR_Graphics::GR_CURSOR_IMAGESIZE_SE, UT_Rect::height, isActive(), fp_FrameContainer::isTightWrapped(), UT_Rect::left, FV_Base::m_bFirstDragDone, m_bInitialClick, FV_View::m_countDisable, m_iFrameEditMode, FV_Base::m_iGlobCount, m_iInitialDragX, m_iInitialDragY, m_iInitialFrameX, m_iInitialFrameY, m_iLastX, m_iLastY, m_pFrameContainer, m_pFrameImage, m_pFrameLayout, FV_View::m_prevMouseContext, FV_Base::m_pView, FV_Base::m_recCurFrame, mouseRelease(), GR_Graphics::setCursor(), FV_View::setCursorToContext(), setDragType(), FV_Base::setDragWhat(), GR_Graphics::tlu(), UT_Rect::top, FV_View::updateScreen(), UT_DEBUGMSG, FV_View::warpInsPtToXY(), and UT_Rect::width.
Referenced by FV_View::activateFrame(), FV_View::btn1Frame(), FV_View::copyFrame(), FV_View::deleteFrame(), and FV_View::selectFrame().
FV_DragWhat FV_FrameEdit::mouseMotion | ( | UT_sint32 | x, | |
UT_sint32 | y | |||
) |
Method to deal with mouse coordinates.
References FV_Base::getDragWhat().
References FV_Base::_beginGlob(), FV_View::_charMotion(), FV_View::_clearSelection(), FV_Base::_endGlob(), FV_View::_ensureInsertionPointOnScreen(), FV_View::_findBlockAtPosition(), FV_View::_fixInsertionPointCoords(), FV_View::_generalUpdate(), FV_View::_restorePieceTableState(), FV_View::_saveAndNotifyPieceTableChange(), fp_VerticalContainer::_setX(), fp_VerticalContainer::_setY(), GR_Graphics::allCarets(), AV_CHG_HDRFTR, FV_ViewDoubleBuffering::beginDoubleBuffering(), UT_String::c_str(), PD_Document::changeStruxFmt(), EV_Mouse::clearMouseContext(), DELETEP, AllCarets::disable(), PD_Document::disableListUpdates(), drawFrame(), PD_Document::enableListUpdates(), FV_DragNothing, FV_FrameEdit_DRAG_EXISTING, FV_FrameEdit_EXISTING_SELECTED, FV_FrameEdit_RESIZE_EXISTING, FV_FrameEdit_RESIZE_INSERT, fl_ContainerLayout::getAP(), fl_ContainerLayout::getContainerType(), FV_Base::getDoc(), FV_View::getEditableBounds(), fl_ContainerLayout::getFirstContainer(), getFrameEditMode(), getFrameStrings(), FV_Base::getGraphics(), FV_Base::getLayout(), XAP_Frame::getMouse(), fl_FrameLayout::getParentContainer(), AV_View::getParentData(), pf_Frag::getPos(), fl_ContainerLayout::getPosition(), fl_BlockLayout::getPosition(), PP_AttrProp::getProperties(), fl_Layout::getStruxDocHandle(), PD_Document::getStruxPosition(), haveDragged(), UT_Rect::height, FV_View::insertParaBreakIfNeededAtPos(), PD_Document::insertStrux(), isActive(), FV_View::isPointLegal(), UT_Rect::left, FV_Base::m_bFirstDragDone, m_bInitialClick, FV_View::m_countDisable, m_iFrameEditMode, FV_Base::m_iGlobCount, m_iInitialFrameX, m_iInitialFrameY, m_iLastX, m_iLastY, m_pAutoScrollTimer, m_pFrameContainer, m_pFrameImage, m_pFrameLayout, FV_View::m_prevMouseContext, FV_Base::m_pView, FV_Base::m_recCurFrame, m_sExpandHeight, m_sMinHeight, m_sRelWidth, fl_ContainerLayout::myContainingLayout(), FV_View::notifyListeners(), PTC_AddFmt, PTX_Block, PTX_EndFrame, PTX_SectionFrame, FL_DocLayout::relocateFrame(), fv_FrameStrings::sColXpos, fv_FrameStrings::sColYpos, FV_View::setCursorToContext(), FV_Base::setDragWhat(), setMode(), FV_View::setPoint(), fv_FrameStrings::sHeight, fv_FrameStrings::sPageXpos, fv_FrameStrings::sPageYpos, fv_FrameStrings::sPrefColumn, fv_FrameStrings::sPrefPage, UT_Timer::stop(), fv_FrameStrings::sWidth, fv_FrameStrings::sXpos, fv_FrameStrings::sYpos, UT_Rect::top, PD_Document::updateDirtyLists(), FV_View::updateScreen(), UT_ASSERT, UT_DEBUGMSG, UT_return_if_fail, FV_View::warpInsPtToXY(), and UT_Rect::width.
Referenced by abortDrag(), mouseLeftPress(), and FV_View::releaseFrame().
This method finds the correct frame on the screen associated with the (x,y) point. It sets the FV_FrameEditMode and the FV_FrameEditDragWhat 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.
The method also sets the fl_FrameLayout and FP_FrameContainer pointers.
References FV_View::_findBlockAtPosition(), FV_View::_getPageForXY(), GR_Graphics::allCarets(), AllCarets::disable(), drawFrame(), FRAME_HANDLE_SIZE, FV_DragBotEdge, FV_DragBotLeftCorner, FV_DragBotRightCorner, FV_DragLeftEdge, FV_DragNothing, FV_DragRightEdge, FV_DragTopEdge, FV_DragTopLeftCorner, FV_DragTopRightCorner, FV_DragWhole, FV_FrameEdit_EXISTING_SELECTED, fl_ContainerLayout::getAP(), fl_ContainerLayout::getContainerType(), FV_Base::getDoc(), FV_View::getDocPositionFromXY(), FV_Base::getDragWhat(), fl_ContainerLayout::getFirstContainer(), fp_FrameContainer::getFullHeight(), fp_FrameContainer::getFullWidth(), fp_FrameContainer::getFullX(), fp_FrameContainer::getFullY(), FV_Base::getGraphics(), FV_View::getLayout(), FL_DocLayout::getLID(), FV_View::getPageScreenOffsets(), PP_AttrProp::getProperty(), PD_Document::getStruxOfTypeFromPosition(), UT_Rect::height, isActive(), UT_Rect::left, FV_View::m_countDisable, m_iFrameEditMode, m_iInitialDragX, m_iInitialDragY, m_iLastX, m_iLastY, m_pFrameContainer, m_pFrameLayout, FV_Base::m_pView, FV_Base::m_recCurFrame, m_sExpandHeight, m_sMinHeight, m_sRelWidth, fl_ContainerLayout::myContainingLayout(), FV_View::setCursorToContext(), FV_Base::setDragWhat(), GR_Graphics::tlu(), UT_Rect::top, UT_ASSERT, UT_return_if_fail, UT_Rect::width, and xxx_UT_DEBUGMSG.
Referenced by FV_View::btn0Frame(), and mouseLeftPress().
void FV_FrameEdit::setMode | ( | FV_FrameEditMode | iEditMode | ) |
References GR_Graphics::allCarets(), DELETEP, AllCarets::disable(), FV_DragNothing, FV_FrameEdit_NOT_ACTIVE, FV_Base::getGraphics(), UT_Rect::height, FV_View::m_countDisable, m_iFrameEditMode, m_iLastX, m_iLastY, m_pFrameContainer, m_pFrameImage, m_pFrameLayout, FV_Base::m_pView, FV_Base::m_recCurFrame, FV_Base::setDragWhat(), UT_DEBUGMSG, and UT_Rect::width.
Referenced by FV_View::_charInsert(), FV_View::_charMotion(), FV_View::cmdInsertGraphic(), fl_FrameLayout::collapse(), FV_View::copyFrame(), mouseRelease(), FV_View::selectFrame(), setPointInside(), FV_View::warpInsPtToXY(), and fl_FrameLayout::~fl_FrameLayout().
void FV_FrameEdit::setPointInside | ( | void | ) |
References FV_View::_setPoint(), FV_FrameEdit_NOT_ACTIVE, getFrameLayout(), fl_FrameLayout::getLength(), fl_ContainerLayout::getPosition(), FV_Base::m_pView, and setMode().
Referenced by FV_View::_charInsert(), FV_View::_doPaste(), FV_View::_findReplace(), FV_View::_findReplaceReverse(), FV_View::_insertField(), FV_View::cmdDeleteCell(), FV_View::cmdDeleteCol(), FV_View::cmdDeleteRow(), FV_View::cmdInsertGraphic(), FV_View::cmdInsertTable(), FV_View::insertFootnote(), FV_View::insertParagraphBreak(), and FV_View::insertSymbol().
friend class fv_View [friend] |
bool FV_FrameEdit::m_bInitialClick [private] |
Referenced by mouseLeftPress(), and mouseRelease().
Referenced by _mouseDrag(), deleteFrame(), isActive(), mouseLeftPress(), mouseRelease(), setDragType(), and setMode().
UT_sint32 FV_FrameEdit::m_iInitialDragX [private] |
Referenced by abortDrag(), mouseLeftPress(), and setDragType().
UT_sint32 FV_FrameEdit::m_iInitialDragY [private] |
Referenced by abortDrag(), mouseLeftPress(), and setDragType().
UT_sint32 FV_FrameEdit::m_iInitialFrameX [private] |
Referenced by mouseLeftPress(), and mouseRelease().
UT_sint32 FV_FrameEdit::m_iInitialFrameY [private] |
Referenced by mouseLeftPress(), and mouseRelease().
UT_sint32 FV_FrameEdit::m_iLastX [private] |
Referenced by _mouseDrag(), deleteFrame(), mouseLeftPress(), mouseRelease(), setDragType(), and setMode().
UT_sint32 FV_FrameEdit::m_iLastY [private] |
Referenced by _mouseDrag(), deleteFrame(), mouseLeftPress(), mouseRelease(), setDragType(), and setMode().
UT_Timer* FV_FrameEdit::m_pAutoScrollTimer [private] |
Referenced by _actuallyScroll(), _mouseDrag(), mouseRelease(), and ~FV_FrameEdit().
fp_FrameContainer* FV_FrameEdit::m_pFrameContainer [private] |
Referenced by _mouseDrag(), deleteFrame(), drawFrame(), mouseLeftPress(), mouseRelease(), setDragType(), and setMode().
GR_Image* FV_FrameEdit::m_pFrameImage [private] |
Referenced by deleteFrame(), drawFrame(), mouseLeftPress(), mouseRelease(), setMode(), and ~FV_FrameEdit().
fl_FrameLayout* FV_FrameEdit::m_pFrameLayout [private] |
Referenced by _mouseDrag(), deleteFrame(), drawFrame(), getPNGImage(), isImageWrapper(), mouseLeftPress(), mouseRelease(), setDragType(), and setMode().
UT_String FV_FrameEdit::m_sExpandHeight [private] |
Referenced by mouseRelease(), and setDragType().
UT_String FV_FrameEdit::m_sMinHeight [private] |
Referenced by mouseRelease(), and setDragType().
UT_String FV_FrameEdit::m_sRelWidth [private] |
Referenced by mouseRelease(), and setDragType().