From kde-games-devel Fri Apr 27 15:30:36 2007 From: Martin Heni Date: Fri, 27 Apr 2007 15:30:36 +0000 To: kde-games-devel Subject: [Kde-games-devel] SVG Card backs Message-Id: <200704271730.36803.kde () heni-online ! de> X-MARC-Message: https://marc.info/?l=kde-games-devel&m=117768761120594 I copied some (3) card backs from the SVG cardsets into the card back "decks" directory so that programs now can also access the card backs via KCardDialog as SVG. Analogously, to the card sets, I added the (optional) config entry "SVG" which points to the SVG file. The image itself needs to have the SVG id "back" like the SVG cardecks already introduced. The SVG cardset still has to have a PNG preview picture, e.g. "deck25.png". The preview PNG is used for display in the carddialog but can also be used by non SVG games as game image. In this way the change is fully compatible for old games. Games can but need not access the SVG image. "deck25.desktop" looks like: [KDE Cards] Name=Dondorf (SVG) SVG=deck25_dondorf.svgz Comment=SVG Dondorf and the card back has following files decks/deck25.desktop decks/deck25_dondorf.svgz decks/deck25.png Lskat utilizes these carddecks now. It can be tested by selecting one of the last three decks in the KCardDialog, e.g. above mentioned "Dondorf (SVG)". Usage from the program is failry easy. The KCardDialog is not changed and provides a path to the PNG image, e.g. "/home/kde/.../decks/deck25.png". From this path the other files can be deduced. Whether it is necessary to provide access functions for desktop file and SVG file in KCardDialog can be discussed. Having them would make accessing the files easier. btw. on Question: I could not find a Qt function to get the directory part of above filename , that is one needs "/home/kde/.../decks/" when having "/home/kde/.../decks/deck25.png" to append then the SVG filename. I manually search the last "/" (Actually QDir::separator()) but I would prefer to use a Qt "dirname" function. Any ideas? _______________________________________________ kde-games-devel mailing list kde-games-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-games-devel