1. 29 Nov, 2016 1 commit
    • Dmitry Kazakov's avatar
      Implement KoShape::cloneShape() · 7699443c
      Dmitry Kazakov authored
      This is a mandatory function to be able to load shapes from SVG,
      because the same shape may be instantiated from different places.
      We still need to discuss whether we need to really "share" the
      shape template, but for now I just deep-copy them (which is the
      easiest because of shape normalization problem we have).
      
      There are the following drawbacks/hacks in this patch:
      
      1) Not all the shapes have KoShape::cloneShape() implemented! Basically,
         it is defined only for group shape and all the descendants of a path
         shape (which are the only shapes used in SVG). Other shapes use the
         default implementation which simply returns null.
      
         Ideally, there should be no default implementation and all the shapes
         should define it. But, given that we are going to deprecate quite a lot
         of stuff, I'll keep them just unimplemented for now.
      
      2) The following shape properties are not yet copied during cloning:
      
         * toolDelegates
         * dependees
         * shadow
         * border
         * filterEffectStack
      
         All the properties, except of tool delegates will probably be
         deprecated soon. And for the tool delegates we need to invent
         something ingenious to handle the pointers to recover pointers
         to the *cloned* shapes.
      
      3) I cannot guarantee TextShape's work anymore. I just blindly
         refactored it to use QScopedPointer to QTextDocument instead of
         the previous raw pointers trickery and never tested it. Hope it
         still works...
      7699443c
  2. 17 Nov, 2016 1 commit
    • Dmitry Kazakov's avatar
      Implement loading of <image> objects · 6872d721
      Dmitry Kazakov authored
      This patch implements a separate ImageShape shape class for this
      kind of objects. Calligra's PictureShape is too overloaded with
      functions of ODF to be useful for us :(
      6872d721
  3. 16 Nov, 2016 1 commit
    • Dmitry Kazakov's avatar
      Implemented clipping mask feature of SVG · deb9431b
      Dmitry Kazakov authored
      Still not implemented:
      1) Blending using linear RGB
      2) Doesn't work if a shape has a filter stack
      3) Shapes are leaking... but it should be fixed on the later
         stages of implementing SVG support. Right now shape ownership
         rules are not quite clear to me.
      4) Clip mask will not be found if placed into <def> category. *But*
         at the moment the <def> feature is implemented incorrectly. The
         inheritance of the 'def' elements should come from 'def', but not
         from the place of instantiation. So this part should be refactored
         anyway.
      deb9431b