--===============15432227873272053== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_JFzf/5JSEkWG9dN"; charset="us-ascii" Content-Transfer-Encoding: 7bit --Boundary-02=_JFzf/5JSEkWG9dN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline While trying to figure out how to make my test tool put squares of the sele= ct=20 colour down on the canvas, I made some notes on what how I think krita sticks together. I'm still not sure what makes it tick, though, and there's= a=20 couple of head-scratchers near the end.=20 Anyway, to preserve this bit of work (might save the next man or woman some= =20 time) for posterity, I post it here: A Perspective on Krita's Design Krita's codebase has been through as many changes as the app's name itself. It started with KImageShop (hence the 'kis' prefix one finds everwhere, and which would have been unnessary had Krita used namespaces, one fancies), then became Krayon to end up as Krita. The stated design goal was to create a application geared towards the more artistic user; the kind of user who settles down with his tablet to create a spot of Art. It now is partway to becoming a kimplet. =20 Design Patterns These are what I recognize as Design patterns in Krita. This is by-and-lar= ge=20 Patrick Julien's work: * Change brushes handling to a generic Mediator pattern (kis_resource_mediator). Resources are brush shapes, patterns (and colours, too?) * Change colourspace handling to a Strategy pattern (strategy/kis_strategy_color) * Change moving chunks of painting to a Strategy pattern (strategy/kis_strategy_move) * kis_factory points towards a Factory pattern, but I don't know what it's for yet. (Creates the pluginserver and resourceserver) * Tools are created by a Factory pattern (but it isn't dynamic yet): kis_tool_factory. * There's the start of a Memento pattern for tools, but it doesn't seem to be used (kis_tool_memento) * The Builder pattern is used to do conversion to and/or from ImageMagick. I guess this is used for importing images in other file-formats than .krita. * Flyweight pattern used for background tiles. kis_background. * Nameserver. Perhaps not a pattern -- at least not one with an obvious GOF name. Appears to be computing a number for new layers and new documents. * kis_render. Interface implemented by kis_paint_device and kis_image. * Rename kisTool to kisToolInterface -- but the file is still called kis_tool. * Addition of kis_types. Defines shared pointer pointers to core krita objects: image, paintdevice, channel, mask, layer etc. =20 * Tile architecture. There's Mediator and a Singleton pattern here at least. This stuff seems to work, doesn't need hacking at the moment. =20 * Visitor pattern used to flatten an image or merge=20 layers. Merging exposes a funny bug where the tiles are re-arranged in an interesting mosaic pattern. User interface Krita uses a fairly ugly side-panel to collect what are palettes in other applications. I would prefer dockable, attachable palettes myself. Doesn't KDE have a lib for that already? ui/labels These classes are used in the statusbar. ui The dialogs appear to be created by hand, not with Qt Designer. Besides, many are inoperational. =20 other The canvas, rules and sidebar panels are defined here, too, nicely separated. Tools Working: select_rectangular, test, zoom, colorpicker, paste, move Not working: airbrush, brush, colorchanger (no idea what it should do), ellipse, eraser, fill, line, pen, polygon, polyline,=20 rectangle, select_contiguous, select_elliptical, select_freehand, select_polygonal, stamp Missing tools: convolve, smear, smudge, whirl, charcoal, chalk, oils, clone, select_by_colour Plugins The single plugin example has been present in krita since about day one, as far as I can see. It doesn't show anything about what one can do with plugins. To judge from the code in kis_plugin_server, it never got beyond an idea. (kdDebug() << "hallo\n"...) ImageMagick There still appear to be some dependencies upon ImageMagick (builder subdir). What are these for, and should they stay? Is it for importing/exporting foreign file formats? Undo/Redo Undo and Redo make use of the standard KDE mechanism, which I don't really understand either. Obsolete files The following files appear to be unused: core/helper/kis_timer core/helper/kis_scopedlock core/kis_krayon (was predecessor of kis_resource) core/kis_mask core/kis_util ui/kis_krayon_widget Random head-scratchings - Why the QUANTUM redefinition? - is_mask unimplemented? What was it meant to do, or is it an interface? - nameserver presents unique numbers for new layers? - what does 'upscale' do? - Is KisVector only used in obsolete tools? - I take it that the two tests that are present in krita/test are obsolete? - what with the dummmmmy.cc? - which bits of the krita/ui files are still relevant? - kis_selection.h needs to be included to compile code that uses kis_paint_device, and I wonder why. - what is paint-offset? =2D-=20 Boudewijn Rempt | http://www.valdyas.org/index2.html --Boundary-02=_JFzf/5JSEkWG9dN Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQA/fzFJdaCcgCmN5d8RAtuMAKD1eYnx6B7oxXR4UkNHluw9PlBs7ACgzGAX n4QSi7KaGe435cd1pq9Y0OE= =xfZj -----END PGP SIGNATURE----- --Boundary-02=_JFzf/5JSEkWG9dN-- --===============15432227873272053== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kimageshop mailing list kimageshop@mail.kde.org http://mail.kde.org/mailman/listinfo/kimageshop --===============15432227873272053==--