From kde-kimageshop Thu Nov 17 15:18:10 2016 From: Dmitry Kazakov Date: Thu, 17 Nov 2016 15:18:10 +0000 To: kde-kimageshop Subject: Question about ownership of KoShape Message-Id: X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=147939591913095 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--001a113eae0c96af4d054180b211" --001a113eae0c96af4d054180b211 Content-Type: text/plain; charset=UTF-8 Hi, all! As some of you may already know, at the moment I'm working on adding support of SVG to Krita. Obviously enough I use Flake as a internal representation/rendering engine. And, yes, I base my work on SvgParser class started by Jan Hambrecht in 2011. Right now my main question is: who owns all the shapes in the document? As far as I could understand, group shapes do not own them. So the question seems to be a bit tough for me... My guess is that the shapes are owned by KoShapeManager... If so, how KoShapePainter should work? It has in internal shape manager that will delete all the shapes after each painting. How can it be solved? And the most interesting part: SVG standard supports / paradigm [1]. Which allows one shape to have multiple instances in different parts of the document. How can it be solved within KoFlake? Copy-constructors are not allowed in KoShape, the management is not reference counted. How can I solve the thing? [1] - https://www.w3.org/TR/SVG/struct.html#UseElement -- Dmitry Kazakov --001a113eae0c96af4d054180b211 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, all!

As some of you may al= ready know, at the moment I'm working on adding support of SVG to Krita= . Obviously enough I use Flake as a internal representation/rendering engin= e. And, yes, I base my work on SvgParser class started by Jan Hambrecht in = 2011.

Right now my main question is: who owns all the shapes i= n the document? As far as I could understand, group shapes do not own them.= So the question seems to be a bit tough for me...

My guess is= that the shapes are owned by KoShapeManager... If so, how KoShapePainter s= hould work? It has in internal shape manager that will delete all the shape= s after each painting. How can it be solved?

And the = most interesting part:

SVG standard supports <defs>= /<use> paradigm [1]. Which allows one shape to have multiple instance= s in different parts of the document. How can it be solved within KoFlake? = Copy-constructors are not allowed in KoShape, the management is not referen= ce counted. How can I solve the thing?

[1] - https://www.w3.org/TR/SVG/struct.html= #UseElement

--
Dmitry Kazakov
--001a113eae0c96af4d054180b211--