class dependencies

Michael Thaler michael.thaler at ph.tum.de
Wed Oct 15 14:29:59 CEST 2003


Hi,

Yesterday I tried to make a small project using KDevelop3. I intend to
write a very simple program that uses the krita rendering classes. I
just want something that allows me to load/save an image and to draw
single points etc.

The main purpose of this is to have something simple to play with,
e.g. find out how the rendering stuff really works, find out how quick
the screen is updated for different tile sizes etc.

It was easy to import KisTile, KisTileMediator, KisTileMgr,
KisPixelData and other basic classes. It is not easy at all to import
KisPainter and KisPaintDevice because these classes depend on
KisLayer, KisImage and KisDoc. KisImage depends on KisLayer,
KisPaintDevice, KisPainter and many other things. KisDoc depends on
KisImage, KisLayer, etc. while KisLayer depends on KisImage and
others.

This makes it really hard to reuse any part of Krita and it also makes
the code very hard to understand. Why are there all these circular
dependencies? IHMO this is not a good design at all.

I think there really should be a hirachy:

- KisPaintDevice is what KisPainter uses for rendering.
- KisLayer inherrits KisPainter and offers some additional methods.
- KisImage contains several layers and has methods to manage these
layers.
- KisDoc contains one (or more KisImages)

KisPainter and KisPaint device should know nothing about KisDoc and
KisImage etc. 

Ciao,
Michael
-- 
We shall not cease from exploration, and the end of all our exploring 
will be to arrive where we started and know the place for the first time.



More information about the kimageshop mailing list