r3202 - software/ui/src

Miriam Ruiz baby-guest at alioth.debian.org
Tue Jul 3 12:40:29 UTC 2007


Author: baby-guest
Date: 2007-07-03 12:40:28 +0000 (Tue, 03 Jul 2007)
New Revision: 3202

Modified:
   software/ui/src/pkgbrowser.cpp
Log:
Added support for bmp screenshots



Modified: software/ui/src/pkgbrowser.cpp
===================================================================
--- software/ui/src/pkgbrowser.cpp	2007-07-03 12:36:25 UTC (rev 3201)
+++ software/ui/src/pkgbrowser.cpp	2007-07-03 12:40:28 UTC (rev 3202)
@@ -31,6 +31,7 @@
 
 #include <FL/Fl_PNG_Image.H>
 #include <FL/Fl_JPEG_Image.H>
+#include <FL/Fl_BMP_Image.H>
 
 PackageBrowser::PackageBrowser(int x, int y, int w, int h, const char *l)
 	: VersatileBrowser(x, y, w, h, l)
@@ -56,13 +57,14 @@
 		Fl_Image *img = NULL;
 		if (snprintf(filename, PATH_MAX, "%s/%s.png", THUMBNAILSDIR, (const char *)data) &&
 			stat(filename, &fileinfo) == 0)
-		{ // We were able to get the file attributes so the file obviously exists.
+		{ // Portable Network Graphics (PNG) image files
+			// We were able to get the file attributes so the file obviously exists.
 			img = new Fl_PNG_Image(filename);
 			printf("  PNG Screenshot : \"%s\"\n", filename);
 		}
 		else if (snprintf(filename, PATH_MAX, "%s/%s.jpg", THUMBNAILSDIR, (const char *)data) &&
 			stat(filename, &fileinfo) == 0)
-		{
+		{ // Joint Photographic Experts Group (JPEG) File Interchange Format (JFIF) images.
 			img = new Fl_JPEG_Image(filename);
 			printf("  JPEG Screenshot : \"%s\"\n", filename);
 		}
@@ -72,8 +74,14 @@
 			img = new Fl_JPEG_Image(filename);
 			printf("  JPEG Screenshot : \"%s\"\n", filename);
 		}
+		else if (snprintf(filename, PATH_MAX, "%s/%s.bmp", THUMBNAILSDIR, (const char *)data) &&
+			stat(filename, &fileinfo) == 0)
+		{ // Windows Bitmap (BMP) image files
+			img = new Fl_BMP_Image(filename);
+			printf("  BMP Screenshot : \"%s\"\n", filename);
+		}
 		else
-		{
+		{ // TODO: Portable Anymap (PNM, PBM, PGM, PPM) image files
 			img = NULL;
 		}
 		if (img && !img->count())




More information about the Pkg-games-commits mailing list