--===============88968170938674551== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_SBTh/ImNx9rdPY0"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit --Boundary-02=_SBTh/ImNx9rdPY0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline On Thursday 09 October 2003 01:12, Patrick Julien wrote: > ok, there are several issues with this code, Told you so... > > 1) invalidate will not do anything here. > 2) updateCanvas is indeed needed to force the image update > 3) You have absolutely no reason to put KisPainter on the heap... > And the device->anchor()? > just > KisPainter gc(device); > > gc.fillRect(x, y, 10, 10, KoColor::red); > > and you are done. End() is called by the destructor. Okay. > You get the right behavior and you don't leak that memory either. Look at > the documentation for boost::shared_ptr, boost::scoped_ptr and KSharedPtr= =2E=20 > I work on a massive application, bigger than all of koffice, for my day j= ob > and we use smart pointers everywhere, guess what? We don't use delete, y= et > tools like purify can't find leaks in our code proper and the performance > difference is benign. I've taken a look at it already, but I am truly very much just beginning wi= th=20 C++. The last time I had anything to do with a language with explicit memor= y=20 management was fifteen years ago, with Turbo Pascal. And all that means tha= t=20 I'm not even sure what problem these shared and scoped pointers are solving= =2E=20 But I don't doubt that I'll get it in the fullness of time.=20 > > Actually, there is more than that, you need to be able to support undo/re= do > too, right? So you need to start and end a transaction to get back a > KCommand that you can enqueue. > I had rather pushed that issue back for solving when I had solved how to us= e=20 and extend the painter. But would it be something like: gc.beginTransaction(QString("test")); gc.fill|Rect(...); m_doc.addCommand(gc.endTransaction()); Does the painter provide all undo/redo information? If so, what's the=20 KnamedCommand subclass for that's present in every tool? > This is actually a remote KImageIO issue isn't it? If you run krita on a > remote display even on a X86, you need an up too date KImageIO otherwise > the display is broken. Ah, that means I don't have to worry about that. I'm working against 3.1.4. =2D-=20 Boudewijn Rempt | http://www.valdyas.org/index2.html --Boundary-02=_SBTh/ImNx9rdPY0 Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQA/hTBSdaCcgCmN5d8RApxvAJ95jBvibQHbL18SaNsWtdGJAIbsPgCg4K9B UfcUmjVP36x75gSjXYcMR0E= =CKLb -----END PGP SIGNATURE----- --Boundary-02=_SBTh/ImNx9rdPY0-- --===============88968170938674551== 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 --===============88968170938674551==--