Tools

Patrick Julien freak at codepimps.org
Wed Nov 5 01:54:23 CET 2003


> In this scenario, why would the view even need to know which is the current
> tool?

The view is the state controller in this case, it's job is just to forward 
events to the current tool.  However, there are 2 main ways to do this also, 
the canvas (KisCanvas) becomes the controller or a separate class is only the 
state controller.

However, I don't advocate neither of these since they don't buy us anything, 
at least, nothing obvious that I'm seeing except more code.

>
> > ii) Tools that have dialogs, and all tool dialogs should be modeless, can
> > change to reflect the current state.
> >
> > So basically, if every view is a subject and every tool an observer,
> > everytime the view changes state, we can adapt all the tools to reflect
> > this.
>
> But is this how an app should work? If I'm painting, I don't want to have
> the color of the pencil tool change when I select a new color for the
> bucket tool.

Hmm, well, when you select a color, you're actually selecting one for the 
entire application, not just a tool.  I think the alternative could really 
get confusing.  You would get presented with a dialog for each tool (probably 
different instances of the same dialog) to actually select a color.  Add to 
that the dialogs should be modeless, you could be plowing tru you windows 
just to find the right color selector.

I'm not agaisn't this idea, at this point in time, I just don't know how 
pratical it would be.

>
> > However, this leaves one question unanswered:  If tools are single
> > instances and koffice applications can have multiple views and frames,
> > how do we actually have tools that play well with this?
>
> That depends a lot on how people working with a paint app thing the app
> should work. If you see every document as a sheet of paper, then it's
> natural to keep the tool settings no matter which document you have active;
> after all, just because I shuffle a sheet of paper, doesn't mean I also
> magically have a new pencil in my fingers.

No, but your shuffled paper probably has different content.  I think your 
analogy holds if you have multiple instances of the same application open.  
However, this is really multiple views of the same document, I just think 
it's limiting to have all your views be identical.  What's the point of 
multiple views otherwise?

>
> So I'd associate a set of settings with every device -- core pointer,
> stylus, eraser (don't confuse that with the eraser tool -- it's just the
> chewing end of the wacom pen, and one that I've always got associated with
> smear in the gimp), and don't change those settings because I change
> documents.

Right, I don't think settings like that should be changed, however, you might 
be zooming on one area of the image in one frame for example.  In fact, you 
might have multiple monitors and seing different parts of the same document 
on each monitor with different properties of the view set.



More information about the kimageshop mailing list