drawinglayer/README | 86 ++++++++++++++++- svx/README | 39 +++++-- xmlsecurity/source/dialogs/digitalsignaturesdialog.src | 2 3 files changed, 112 insertions(+), 15 deletions(-)
New commits: commit 6341628054019298ced4ed23dcf7962a47e594ea Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Sep 5 10:24:58 2014 +0200 svx: Update the README wrt. the SdrObject(s). Change-Id: I3803b46a999a0c796b5cbc3da9c39c67d608bc0c diff --git a/svx/README b/svx/README index e78bb84..a3574dd 100644 --- a/svx/README +++ b/svx/README @@ -6,18 +6,35 @@ this is where a lot of wht work would happen to move to the canvas. (what does t svdraw transparent gradient stuff. -Drawing Layer Object diagram: - -.------- Model ------------. .------- View -----------------------------------------. -| SdrObject - ViewContact | 1.* | ViewObjectContact 1.* | -| getChild() |-----| getPrimitiveList() -----> Object(s) ---> SdrView | -| getVOC() | | getRecPrimitiveList() Contact | -| getViewIn...| |___________|__________________________________________| -| dependentPrimitiveList() | | -|_________________________ | generates ______ - | / | +== Drawing Layer / SdrObject(s) == + +See drawinglayer/README for general information about drawinglayer. + +Below is the class diagram that comes from +http://www.openoffice.org/marketing/ooocon2006/presentations/wednesday_g11.odp, +slide number 6. + +.------- Model --------------. .------- View -----------------------------------------. +| SdrObject - ViewContact | 1..* | ViewObjectContact 1..* | +| getChild() |------| getPrimitiveList() -----> Object(s) ---> SdrView | +| getVOC() | | getRecPrimitiveList() Contact | +| getViewInd... | |________|_____________________________________________| +| ...ependentPrimitiveList() | | +|____________________________| generates + | ______ + V / | .----------------------. | | basePrimitive | | - | getRange() |----` + | getRange() |<---' | getDecomposition() | |______________________| + +For SdrObjects, there are own DrawingLayer primitives in +svx/source/sdr/primitive2d + +The ViewContact / ViewObject / ViewObjectContact are in svx/source/sdr/contact +Decomposes the SdrObjects, and does all sort of operations on them. + +[So far I haven't found a definition / concept what are supposed to be the +ViewContact / ViewObject / ViewObjectContact. If you find that out, please +fix this README :-)] commit 3e8cf5c409af7651e49079ce8b1c272f82c96aa5 Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Sep 5 10:06:58 2014 +0200 drawinglayer: Improve the README. Change-Id: I40ae115a03f1a289c940f9f96e3d496d1eba1a48 diff --git a/drawinglayer/README b/drawinglayer/README index 480c5b4..d950f29 100644 --- a/drawinglayer/README +++ b/drawinglayer/README @@ -1,5 +1,85 @@ -Somewhat of a middle layer between rendering subsystems and application cores. +Drawing API that can specify what to draw via a kind of display list. -(What are "rendering subsystems" and "application cores"?) +Example of the DrawingLayer use is eg. in svx/source/xoutdev/xtabhtch.cxx:121. +A stripped down version with extended comments: -It offers a nice and easy API to render complex shapes. (Pure "marketing".) + // Create a hatch primitive (here a rectangle that will be filled with + // the appropriate hatching, but has no border). + // This will not draw it yet; it's so far only constructed to add it to a + // display list later. + const drawinglayer::primitive2d::Primitive2DReference aHatchPrimitive( + new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(...)); + + // Create a rectangle around the hatch, to give it a border. + const drawinglayer::primitive2d::Primitive2DReference aBlackRectanglePrimitive( + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(...)); + + // Here we want to render to a virtual device (to later obtain the bitmap + // out of that), so prepare it. + VirtualDevice aVirtualDevice; + + // Create processor and draw primitives, to get it ready for rendering. + boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D( + drawinglayer::processor2d::createPixelProcessor2DFromOutputDevice(...)); + + if (pProcessor2D) + { + // Fill-in the display list. + drawinglayer::primitive2d::Primitive2DSequence aSequence(2); + + aSequence[0] = aHatchPrimitive; + aSequence[1] = aBlackRectanglePrimitive; + + // Render it to the virtual device. + pProcessor2D->process(aSequence); + pProcessor2D.reset(); + } + + // Obtain the bitmap that was rendered from the virtual device, to re-use + // it in the widget. + aRetval = aVirtualDevice.GetBitmap(Point(0, 0), aVirtualDevice.GetOutputSizePixel()); + +== DrawingLayer glossary == + +Primitives - classes that represent what should be drawn. It holds the data +what to draw, but does not contain any kind of the rendering. Some of the +primitives are 'Basic primitives', that are primitives that cannot be +decomposed. The rest of the primitives can be decomposed to the basic +primitives. + +Decomposition - a way how to break down the more complicated primitives into +the basic primitives, and represent them via them; this logically makes the +plain Primitive2DSequence display list a hierarchy. +Eg. PolygonMarkerPrimitive2D can be decomposed to 2 hairlines +PolyPolygonHairlinePrimitive2D's, each with different color. + +Processor - a class that goes through the hierarchy of the Primitives, and +renders it some way. Various processors, like VclPixelProcessor2D (renders to +the screen), VclMetafileProcessor2D (renders to the VCL metafile, eg. for +printing), etc. + +== How to Implement a new Primitive ("something new to draw") == + +* Create an ancestor of BasePrimitive2D + (or of its ancestor if it fits the purpose better) + + * Assign it an ID [in drawinglayer_primitivetypes2d.hxx] + + * Implement its decomposition + [virtual Primitive2DSequence create2DDecomposition(...)] + +* Extend the (various) processor(s) + If you need more than relying on just the decomposition + +== Where is DrawingLayer used == + +* SdrObject(s) (rectangles, Circles, predefined shapes etc.) + +* Selections + +* Various smaller cases to 'just draw something' + + * Draw to a virtual device, and use the resulting bitmap (like the example + above) + +* Custom widgets (like the Header / Footer indicator button) commit 9fb82a17b1d77b6c7310e0e38e1f914bf7906e89 Author: Jan Holesovsky <ke...@collabora.com> Date: Sun Aug 31 21:35:27 2014 +0200 Fix emacs modeline. Change-Id: I56aa8c6e5da4d682a932af4e57404a870c13c231 diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src index 69db6f0..3e872f7 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src @@ -1,4 +1,4 @@ -/* -*r Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits