[Kde-games-devel] KGameSvgDocument

Mark A. Taff marktaff at comcast.net
Mon Mar 26 21:04:58 CEST 2007


Hi all,

I have KGameSvgDocument as done as I can make it with my current skills.

For archiving purposes, the class allows you to read in an svg file, 
manipulate its style properties and transform matrix, and then output the 
modified DOM (either an single id or the whole document) so it can then be 
loaded via KSvgRenderer::load().

I am using this in my replacement for KGameLCD.  It will also be useful for 
setting the colors of game pieces, getting a pen color from a svg file for 
laser rays (Nicolas), etc.

Still todo is to put some code samples into the apidox, and to d-pointer the 
class.  I tried to d-pointer the class yesterday, and failed for some unknown 
reason.  I understand the reasons for the d-pointer, and the basic howto, but 
I am obviously missing a full understanding of the details :-(

I tried both the tutorials on techbase, and neither worked for me.  
http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++#Using_a_d-Pointer
http://techbase.kde.org/Policies/Library_Code_Policy#D-Pointers

As an aside to the tutorial writers: I would very mush appreciate just a bit 
more detail in examples; I think the writers assume the reader/newb coder 
knows too much.  But I digress.

The working non-d-pointered class is at:
http://marktaff.com/tmp/kgamelcd/kapp4/kgamesvgdocument.cpp
http://marktaff.com/tmp/kgamelcd/kapp4/kgamesvgdocument.h

A non-working d-pointered version is at:
http://marktaff.com/tmp/kgamesvgdocument.cpp
http://marktaff.com/tmp/kgamesvgdocument.h

I asked on #kde4-devel yesterday for some help from a mentor, but I think I 
had bad timing, as nobody responded.

I would very much appreciate any critiques on the class, from my coding style, 
to the api, to help with the d-pointer issue, to anything else obvious to an 
experienced c++ coder, yet oblivious to me. ;-)

Thanks,

Mark A. Taff



More information about the kde-games-devel mailing list