/** Wrapper around a shared canvas that forwards most of its methods to the sharedcanvas.Mostnotabledifferencesare: 1.ThetransformationoftheViewStateofforwardedcallsismodifiedbyadding anoffset. 2.TheclippolygonoftheViewStateofforwardedcallsisintersected withacliprectanglethatcanbesetviaSetClip(). 3.CallstoupdateScreen()arecollected.OnecalltotheupdateScreen() methodofthesharedcanvasismadeasynchronously.
Thecanvascanusedifferentcanvasesforsharingandforsprite construction.Thisallowsthesharedcanvastobeacanvasofspriteitself.
*/ class PresenterCanvas
: public PresenterCanvasInterfaceBase
{ public: /** This constructor is used when a PresenterCanvas object is created directly,typicallybythePresenterCanvasFactory. @paramrxUpdateCanvas ThiscanvasisusedtocallupdateScreen()atandtocreate sprites.Inthetypicalcasethiscanvasisidenticaltothe rxSharedCanvasargument. @paramrxUpdateWindow Thewindowthatbelongstothecanvasgivenbythe rxUpdateCanvasargument. @paramrxSharedCanvas Thecanvasthatiswrappedbythenewinstanceofthisclass. TypicallythisisaregularXSpriteCanvasandthenisidentical totheonegivenbytherxUpdateCanvasargument.Itmaybethe canvasofaspritewhichdoesnotsupporttheXSpriteCanvas interface.Inthatcasethecanvasthatcreatedthespritecan begivenasrxUpdateCanvasargumenttoallowtocreatefurther spritesandtohavepropercallstoupdateScreen(). @paramrxSharedWindow Thewindowthatbelongstothecanvasgivenbythe rxSharedCanvasargument. @paramrxWindow ThewindowthatisrepresentedbythenewPresenterCanvas object.Itisexpectedtobeadirectdescendantof rxSharedWindow.ItspositioninsiderxSharedWindowdefinesthe offsetofthecanvasimplementedbythenewPresenterCanvas objectandrxSharedCanvas.
*/
PresenterCanvas ( const css::uno::Reference<css::rendering::XSpriteCanvas>& rxUpdateCanvas, const css::uno::Reference<css::awt::XWindow>& rxUpdateWindow, const css::uno::Reference<css::rendering::XCanvas>& rxSharedCanvas, const css::uno::Reference<css::awt::XWindow>& rxSharedWindow, const css::uno::Reference<css::awt::XWindow>& rxWindow); virtual ~PresenterCanvas() override;
PresenterCanvas(const PresenterCanvas&) = delete;
PresenterCanvas& operator=(const PresenterCanvas&) = delete;
/** Merge the given view state with the view state that translates the (virtual)childcanvastothesharedcanvas.
*/
css::rendering::ViewState MergeViewState ( const css::rendering::ViewState& rViewState, const css::awt::Point& raOffset);
/** Called by custom sprites to update their clip polygon so that they areclippedatthebordersofthecanvas.Thismethodhastobe calledaftereachchangeofthespritelocationsothatthebounds ofthecanvascanbetransformedintothecoordinatesystemofthe sprite.
*/
css::uno::Reference<css::rendering::XPolyPolygon2D> UpdateSpriteClip ( const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxOriginalClip, const css::geometry::RealPoint2D& rLocation);
/** The window for which a canvas is emulated.
*/
css::uno::Reference<css::awt::XWindow> mxWindow;
/** Offset of the emulated canvas with respect to the shared canvas.
*/
css::awt::Point maOffset;
/** The UpdateRequester is used by updateScreen() to schedule updateScreen()callsatthesharedcanvas.
*/
std::shared_ptr<CanvasUpdateRequester> m_pUpdateRequester;
/** When this flag is true (it is set to true after every call to updateScreen())thenthenextcalltoMergeViewStateupdatesthe maOffsetmember.Apossibleoptimizationwouldsetthisflagonly totruewhenoneofthewindowsbetweenmxWindowandmxSharedWindow changesitsposition.
*/ bool mbOffsetUpdatePending;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.