Review Request: Pass KoCanvasBase in shape paint methods (just like for paintDecoration)

C. Boemann cbr at boemann.dk
Sun Oct 9 13:00:04 BST 2011



> On Oct. 9, 2011, 2:58 a.m., Thorsten Zachmann wrote:
> > I think we should pass a PaintingContext to the paint method instead of adding new parameters. That has the benefit of making it future prove. There are some things I would like to pass to painting for e.g. animations in stage.
> 
> Boudewijn Rempt wrote:
>     If all that's needed is the KoCanvasResourceManager, I think we should pass that, not the canvas, not a context wrapper that contains the canvas. We're referring to the canvas itself in way too many places already, which makes it possible to make documents actually work without a ready canvas present. And that's something I see as very desirable.

Well the context could contain a pointer to the KoCanvasResourceManager. I can see a reason why we may want more than the resource manager. 

Also the canvas resource manager conveys information about the settings of the canvas, but if we want to print or paint a thumbail would we then change the settings in the resouce manager.


I'm starting to think a dedicated KoShapePaintingContext is indeed the right thing


- C.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102809/#review7186
-----------------------------------------------------------


On Oct. 9, 2011, 2:50 a.m., C. Boemann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102809/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2011, 2:50 a.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Description
> -------
> 
> This patch passes the canvas to the paint and paintComponent methods of KoShape and decendents.
> 
> The reason is that some shapes (notably the text shape) will like to query the canvasResourceManager for info about such things as if it should paint:
>  - borders around tables
>  - decoration of spellchecking
>  - formatting chars (line break, spaces, tabs)
> 
> The alternative is to pass some form of a paint context, but since we already pass the canvas to the paintDecorations method and it gives access to the resourcemanager I thought this might be as good a solution as any other.
> 
> 
> Diffs
> -----
> 
>   braindump/plugins/stateshape/StateShape.h b8f79d6 
>   braindump/plugins/stateshape/StateShape.cpp 3fae42e 
>   braindump/plugins/webshape/WebShape.h bdc6583 
>   braindump/plugins/webshape/WebShape.cpp b4abf0b 
>   braindump/src/Layout.cpp 2cad88a 
>   karbon/plugins/tools/CalligraphyTool/KarbonCalligraphyTool.cpp e137387 
>   karbon/plugins/tools/KarbonPencilTool.cpp 5d9533d 
>   krita/ui/flake/kis_layer_container_shape.h ae603ff 
>   krita/ui/flake/kis_layer_container_shape.cc a9c50d3 
>   krita/ui/flake/kis_node_shape.h 5567c7d 
>   krita/ui/flake/kis_node_shape.cpp 6e695a6 
>   krita/ui/flake/kis_shape_selection.h c932aa3 
>   krita/ui/flake/kis_shape_selection.cpp 0b72764 
>   libs/flake/KoCanvasControllerWidgetViewport_p.cpp 345f51a 
>   libs/flake/KoPathShape.h 8b54f26 
>   libs/flake/KoPathShape.cpp 4c5ffb6 
>   libs/flake/KoSelection.h a8d14bf 
>   libs/flake/KoSelection.cpp 0c4f7ed 
>   libs/flake/KoShape.h 6ca2ede 
>   libs/flake/KoShapeContainer.h 483d893 
>   libs/flake/KoShapeContainer.cpp d9b466a 
>   libs/flake/KoShapeGroup.h 12ca7b4 
>   libs/flake/KoShapeGroup.cpp 0515dce 
>   libs/flake/KoShapeLayer.h c098b9a 
>   libs/flake/KoShapeLayer.cpp a17f44b 
>   libs/flake/KoShapeManager.cpp c3b3484 
>   libs/flake/KoTosContainer.h 98c0f55 
>   libs/flake/KoTosContainer.cpp 3a0aa51 
>   libs/flake/KoUnavailShape.h e8f1cf4 
>   libs/flake/KoUnavailShape.cpp e06a8b0 
>   libs/flake/tests/MockShapes.h 5de9cd2 
>   libs/flake/tests/TestShapePainting.cpp 871fe1c 
>   libs/flake/tools/KoCreatePathTool.cpp fb4a4ea 
>   libs/kopageapp/KoPAPageBase.h de22a80 
>   libs/kopageapp/KoPAPageBase.cpp 09e2ae3 
>   plugins/artistictextshape/ArtisticTextShape.h 04cc365 
>   plugins/artistictextshape/ArtisticTextShape.cpp a7835e3 
>   plugins/chartshape/ChartShape.h a65d6fa 
>   plugins/chartshape/ChartShape.cpp 34db6ee 
>   plugins/chartshape/Legend.h ac4a419 
>   plugins/chartshape/Legend.cpp 141ecf0 
>   plugins/chartshape/PlotArea.h 85ce07b 
>   plugins/chartshape/PlotArea.cpp 63e425b 
>   plugins/chartshape/TextLabelDummy.h 85bfed2 
>   plugins/chartshape/TextLabelDummy.cpp 4ca0792 
>   plugins/commentshape/CommentShape.h 5b8e231 
>   plugins/commentshape/CommentShape.cpp 0fd7d30 
>   plugins/commentshape/InitialsCommentShape.h 1c49b72 
>   plugins/commentshape/InitialsCommentShape.cpp 9c04211 
>   plugins/dockers/shapecollection/ShapeCollectionDocker.cpp 719d569 
>   plugins/formulashape/KoFormulaShape.h 0afc761 
>   plugins/formulashape/KoFormulaShape.cpp 2aef65d 
>   plugins/musicshape/MusicShape.h 6374d36 
>   plugins/musicshape/MusicShape.cpp d410360 
>   plugins/pictureshape/PictureShape.h f8bbc3e 
>   plugins/pictureshape/PictureShape.cpp 66b3c83 
>   plugins/pluginshape/PluginShape.h e5a50cb 
>   plugins/pluginshape/PluginShape.cpp 5840931 
>   plugins/textshape/ShrinkToFitShapeContainer.h 39d2117 
>   plugins/textshape/ShrinkToFitShapeContainer.cpp 7253479 
>   plugins/textshape/TextShape.h 4ae4941 
>   plugins/textshape/TextShape.cpp 5ee4bba 
>   plugins/textshape/dialogs/SimpleParagraphWidget.cpp 5dbb238 
>   plugins/textshape/dialogs/TableOfContentsPreview.cpp 7b0feaf 
>   plugins/treeshape/TreeShape.h 6370621 
>   plugins/treeshape/TreeShape.cpp 756e2d6 
>   plugins/treeshape/TreeShapeMoveStrategy.cpp 4184f32 
>   plugins/vectorshape/VectorShape.h cb5ab8e 
>   plugins/vectorshape/VectorShape.cpp c14e6a7 
>   plugins/videoshape/VideoShape.h d6bd829 
>   plugins/videoshape/VideoShape.cpp 08e653e 
>   stage/part/KPrNotes.cpp 598a1a0 
>   stage/part/KPrPlaceholderShape.h 184a361 
>   stage/part/KPrPlaceholderShape.cpp 03a9eba 
>   stage/part/KPrPlaceholderStrategy.h 873eaa3 
>   stage/part/KPrPlaceholderStrategy.cpp 6d0761f 
>   stage/part/KPrPlaceholderTextStrategy.h 4202bc6 
>   stage/part/KPrPlaceholderTextStrategy.cpp 9e99f9f 
>   tables/shape/TableShape.h 03b7e9b 
>   tables/shape/TableShape.cpp d53b069 
>   words/part/commands/KWClipFrameCommand.cpp b55aafe 
>   words/part/frames/KWCopyShape.h 1ad91ac 
>   words/part/frames/KWCopyShape.cpp 5a77481 
>   words/part/frames/KWFrameLayout.cpp 9790f73 
>   words/part/frames/KWOutlineShape.h 300bfef 
> 
> Diff: http://git.reviewboard.kde.org/r/102809/diff/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> C. Boemann
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20111009/638259f8/attachment.htm>


More information about the calligra-devel mailing list