ContentWindowPtr makeDummyWindow() { ContentPtr content( new DummyContent ); content->setDimensions( CONTENT_SIZE ); ContentWindowPtr window = boost::make_shared<ContentWindow>( content ); window->setCoordinates( QRectF( 610, 220, 30, 40 )); const QRectF& coords = window->getCoordinates(); BOOST_REQUIRE_EQUAL( coords.topLeft(), QPointF( 610, 220 )); BOOST_REQUIRE_EQUAL( coords.center(), QPointF( 625, 240 )); return window; }
void PDF::preRenderUpdate( ContentWindowPtr window, const QRect& /*wallArea*/ ) { if( window->isResizing( )) return; PDFContent& content = static_cast<PDFContent&>( *window->getContent( )); const bool pageHasChanged = (pageNumber_ != content.getPage( )); setPage( content.getPage( )); const QSize& windowSize = window->getCoordinates().size().toSize(); if( pageHasChanged || texture_.getSize() != windowSize || textureRect_ != window->getZoomRect( ) ) { updateTexture( windowSize, window->getZoomRect( )); } }
void WebbrowserCommandHandler::handle( const deflect::Command& command, const QString& senderUri ) { QString url = command.getArguments(); if( url.isEmpty( )) url = _defaultURL; QPointF position; // Center the new content where the dock is // TODO: DISCL-230 ContentWindowPtr parentWindow = _windowManager.getContentWindow(senderUri); if( parentWindow ) position = parentWindow->getCoordinates().center(); emit openWebBrowser( position, QSize(), url ); }