[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: Filter effects for karbon
From:       Cyrille Berger <cberger () cberger ! net>
Date:       2009-04-06 8:45:41
Message-ID: 200904061045.41666.cberger () cberger ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Monday 06 April 2009, Thomas Zander wrote:
> On Sunday 5. April 2009 23:08:53 Cyrille Berger wrote:
> > * the patch to flake is just meant to make the plugin not depending on
> > any karbon code (not sure if it's useful, or if not giving access to
> > KoShapeControllerBase is done on purpose)
>
> Its done on purpose, indeed.
> I thought we did a good job documenting that :(
> http://www.koffice.org/developer/apidocs/libs-flake/classKoShapeController.
>html

The problem is that KoShapeCreateCommand takes a KoShapeControllerBase:
http://www.koffice.org/developer/apidocs/libs-
flake/classKoShapeCreateCommand.html

Or does that mean that commands shouldn't be used externally ?

> > * currently I abuse the "isClipped" feature of KoShapeContainer, not sure
> > if it was intended to be use like this
>
>   Each child can optionally be said to be 'clipped' by the container. This
>   feature will give the effect that if the child has a size and position
>   outside the container, parts outside the container will not be shown.
> This is especially useful for showing cutouts of content, like images,
> without changing the actual content.
>   For so called clipped children any modification made to the container is
>   propagated to the child. This includes rotation as well as scaling and
>   shearing.
> From;
> http://www.koffice.org/developer/apidocs/libs-flake/classKoShapeContainer.h
>tml

Yes but here, I just wanted to prevent shape to be drawn by the shape manager, 
since I need to draw them on a QImage on which I will then apply a filter. 
Before drawing the image back on the canvas.

> > * I would like the container to be
> > unselectable, or at least the click to be redirected to shape containing
> > the container
>
> Hmm, thats tricky; what usecases did you have in mind exactly?
> Clicks are done by the tool and they tend to do whats best for their
> purpose to find which shape a click should go to. So its different per
> tool.

Well I am not sure now... since you would still need to be able to select it 
to change the parameter of the filter... and since you can still edit the 
content. It's just that in inkscape, after adding a filter you can still edit 
the shapes as if there was no filter, and I think it's a rather convenient way 
of working.

> > So what's your opinion ? Is it a good start, should it be done
> > differently ?
>
> I'll try to apply the patch later.
> From reading the code the approach looks sane to me.
>
> [irrelevant comment about coding style being inconsistent]
Hehe, I hesitate to say that I would apply the magic command line from 
techbase before commiting ;)

-- 
Cyrille Berger

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; \
font-weight:400; font-style:normal;">On Monday 06 April 2009, Thomas Zander \
wrote:<br> &gt; On Sunday 5. April 2009 23:08:53 Cyrille Berger wrote:<br>
&gt; &gt; * the patch to flake is just meant to make the plugin not depending on<br>
&gt; &gt; any karbon code (not sure if it's useful, or if not giving access to<br>
&gt; &gt; KoShapeControllerBase is done on purpose)<br>
&gt;<br>
&gt; Its done on purpose, indeed.<br>
&gt; I thought we did a good job documenting that :(<br>
&gt; http://www.koffice.org/developer/apidocs/libs-flake/classKoShapeController.<br>
&gt;html<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>The problem is that KoShapeCreateCommand takes a \
KoShapeControllerBase:<br> \
http://www.koffice.org/developer/apidocs/libs-flake/classKoShapeCreateCommand.html<br>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Or does that mean that commands shouldn't be used \
externally ?<br> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br></p>&gt; &gt; * currently I abuse the \
"isClipped" feature of KoShapeContainer, not sure<br> &gt; &gt; if it was intended to \
be use like this<br> &gt;<br>
&gt;   Each child can optionally be said to be 'clipped' by the container. This<br>
&gt;   feature will give the effect that if the child has a size and position<br>
&gt;   outside the container, parts outside the container will not be shown.<br>
&gt; This is especially useful for showing cutouts of content, like images,<br>
&gt; without changing the actual content.<br>
&gt;   For so called clipped children any modification made to the container is<br>
&gt;   propagated to the child. This includes rotation as well as scaling and<br>
&gt;   shearing.<br>
&gt; From;<br>
&gt; http://www.koffice.org/developer/apidocs/libs-flake/classKoShapeContainer.h<br>
&gt;tml<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Yes but here, I just wanted to prevent shape to be drawn \
by the shape manager, since I need to draw them on a QImage on which I will then \
apply a filter. Before drawing the image back on the canvas.<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>&gt; &gt; * I would like the container to be<br> &gt; &gt; \
unselectable, or at least the click to be redirected to shape containing<br> &gt; \
&gt; the container<br> &gt;<br>
&gt; Hmm, thats tricky; what usecases did you have in mind exactly?<br>
&gt; Clicks are done by the tool and they tend to do whats best for their<br>
&gt; purpose to find which shape a click should go to. So its different per<br>
&gt; tool.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Well I am not sure now... since you would still need to be \
able to select it to change the parameter of the filter... and since you can still \
edit the content. It's just that in inkscape, after adding a filter you can still \
edit the shapes as if there was no filter, and I think it's a rather convenient way \
of working.<br> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br></p>&gt; &gt; So what's your opinion ? Is it \
a good start, should it be done<br> &gt; &gt; differently ?<br>
&gt;<br>
&gt; I'll try to apply the patch later.<br>
&gt; From reading the code the approach looks sane to me.<br>
&gt;<br>
&gt; [irrelevant comment about coding style being inconsistent]<br>
Hehe, I hesitate to say that I would apply the magic command line from techbase \
before commiting ;)<br> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br></p>-- <br> Cyrille Berger</p></body></html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic