File oldwx.diff of Package dng4ps2

diff -uNrp dng4ps2-r62/src/CamCalibrFrame.cpp dng4ps2-r62.new/src/CamCalibrFrame.cpp
--- dng4ps2-r62/src/CamCalibrFrame.cpp	2009-03-24 14:50:27.000000000 +0000
+++ dng4ps2-r62.new/src/CamCalibrFrame.cpp	2009-03-26 11:07:35.525458844 +0000
@@ -335,7 +335,7 @@ CamCalibrFrame::CamCalibrFrame(const Cam
 	tmrStart.Start(40, false);
 	tmrPaintTimer.SetOwner(this, ID_TIMER2);
 	tmrPaintTimer.Start(30, true);
-	FileDialog = new wxFileDialog(this, _("Select file"), wxEmptyString, wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_DEFAULT_STYLE|wxFD_OPEN, wxDefaultPosition, wxDefaultSize, _T("wxFileDialog"));
+	FileDialog = new wxFileDialog(this, _("Select file"), wxEmptyString, wxEmptyString, wxFileSelectorDefaultWildcardStr, /*wxFD_DEFAULT_STYLE|wxFD_OPEN*/0L, wxDefaultPosition/*, wxDefaultSize, _T("wxFileDialog")*/);
 	szMain->SetSizeHints(this);
 	
 	Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CamCalibrFrame::OnSelectRawClick);
@@ -396,13 +396,23 @@ void CamCalibrFrame::load_jpeg_file()
 	if (chImageType->GetSelection() == 0) sbmpImage->SetBitmap(jpeg_image);
 }
 
+#include <sys/stat.h>
+static off_t GetSize(const wxString& fname)
+{
+	struct stat statbuf;
+	int err = stat((const char*)fname.c_str(), &statbuf);
+	if (err)
+		return err;
+	return statbuf.st_size;
+}
+
 /*  CamCalibrFrame::load_raw_file */
 void CamCalibrFrame::load_raw_file(bool update_scroll_bars)
 {
 	wxString raw_file = txtRawFile->GetValue();
 	if (raw_file.IsEmpty()) return;
 
-	unsigned long file_size = wxFileName::GetSize(raw_file).GetLo();
+	unsigned long file_size = ::GetSize(raw_file);
 	if (file_size != CameraOpts::get_file_size(camera_))
 		throw Exception(wxString::Format(_("wrong_camera"), camera_.model_name.c_str()));
 
diff -uNrp dng4ps2-r62/src/FileList.cpp dng4ps2-r62.new/src/FileList.cpp
--- dng4ps2-r62/src/FileList.cpp	2009-03-26 11:14:37.042353871 +0000
+++ dng4ps2-r62.new/src/FileList.cpp	2009-03-26 10:59:16.725288938 +0000
@@ -31,6 +31,16 @@
 #include "FileList.h"
 #include "Utils.h"
 
+#include <sys/stat.h>
+static off_t GetSize(const wxString& fname)
+{
+	struct stat statbuf;
+	int err = stat((const char*)fname.c_str(), &statbuf);
+	if (err)
+		return err;
+	return statbuf.st_size;
+}
+
 // FileList::scan
 void FileList::scan(const wxString & dir, bool recursive, const boost::function<void(int)> & on_progress)
 {
@@ -54,7 +64,8 @@ void FileList::scan(const wxString & dir
 
 		if (on_progress && (i % 16 == 0)) on_progress(100*i/count);
 
-		size_t file_size = name.GetSize().ToULong();
+		//size_t file_size = name.GetSize().ToULong();
+		size_t file_size = GetSize(name.GetFullPath());
 
 		if ( !std::binary_search(sizes.begin(), sizes.end(), file_size) ) continue;
 
@@ -99,8 +110,9 @@ void FileList::clear()
 void FileList::addOneFile(wxString full_path)
 {
 	wxFileName name(full_path);
-	size_t file_size = name.GetSize().ToULong();
-    FileListItem item;
+	//size_t file_size = name.GetSize().ToULong();
+	size_t file_size = GetSize(name.GetFullPath());
+	FileListItem item;
 	std::vector<size_t> sizes;
 
 	wxString ext = name.GetExt().Lower();
diff -uNrp dng4ps2-r62/src/Utils.cpp dng4ps2-r62.new/src/Utils.cpp
--- dng4ps2-r62/src/Utils.cpp	2009-03-26 11:14:18.156673650 +0000
+++ dng4ps2-r62.new/src/Utils.cpp	2009-03-26 11:13:09.456664310 +0000
@@ -80,6 +80,16 @@ const int medium_preview_size = 1280;
 extern wxString exe_dir, path_sep;
 extern ProcessDialog * process_dialog;
 
+#include <sys/stat.h>
+static off_t GetSize(const wxString& fname)
+{
+	struct stat statbuf;
+	int err = stat((const char*)fname.c_str(), &statbuf);
+	if (err)
+		return err;
+	return statbuf.st_size;
+}
+
 struct ExifDataAgr
 {
 	ExifData *ed;
@@ -464,7 +474,7 @@ void Utils::create_dng_file
 	AutoPtr<dng_image> image(new dng_simple_image(dng_rect(camera_data->height, camera_data->width), 1, ttShort, 1<<10, memalloc));
 
 	AutoPtr<dng_camera_profile> camprofile(new dng_camera_profile);
-	camprofile->SetName(camera_data->model_name.char_str());
+	camprofile->SetName((const char*)camera_data->model_name.c_str());
 
 	dng_matrix m1(3, 3);
 	dng_matrix m2(3, 3);
@@ -590,8 +600,8 @@ void Utils::create_dng_file
 	negative->SetDefaultCropSize(ifd.fDefaultCropSizeH, ifd.fDefaultCropSizeV);
 	negative->SetActiveArea(ifd.fActiveArea);
 
-	negative->SetModelName(camera_data->model_name.char_str());
-	negative->SetLocalName(camera_data->model_name.char_str());
+	negative->SetModelName((const char*)camera_data->model_name.c_str());
+	negative->SetLocalName((const char*)camera_data->model_name.c_str());
 
 	negative->SetColorChannels(3);
 	negative->SetColorKeys(colorKeyRed, colorKeyGreen, colorKeyBlue);
@@ -617,7 +627,7 @@ void Utils::create_dng_file
 	if (sys().options->add_metadata && jpeg_exists) add_metadata_from_jpeg(host, negative.Get(), jpeg);
 	else
 	{
-		negative->GetExif()->fModel.Set_ASCII(camera_data->model_name.char_str());
+		negative->GetExif()->fModel.Set_ASCII((const char*)camera_data->model_name.c_str());
 		negative->GetExif()->fMake.Set_ASCII("Canon");
 
 		// Time from original shot
@@ -637,7 +647,7 @@ void Utils::create_dng_file
 	}
 
 	// Artist
-	if (sys().options->use_artist) negative->GetExif()->fArtist.Set_SystemEncoding(sys().options->artist.char_str());
+	if (sys().options->use_artist) negative->GetExif()->fArtist.Set_SystemEncoding((const char*)sys().options->artist.c_str());
 
 	// Clear "Camera WhiteXY"
 	negative->SetCameraWhiteXY(dng_xy_coord());
@@ -706,7 +716,7 @@ void Utils::create_dng_file
 					width = medium_preview_size*width/height;
 					height = medium_preview_size;
 				}
-				pre_image.Rescale(width, height, wxIMAGE_QUALITY_HIGH);
+				pre_image.Rescale(width, height/*, wxIMAGE_QUALITY_HIGH*/);
 			}
 		}
 
@@ -736,7 +746,7 @@ void Utils::create_dng_file
 	dip.fImage.Reset(thumbnail_render.Render());
 
 	dng_image_writer writer;
-	dng_file_stream filestream(new_file.char_str(), true);
+	dng_file_stream filestream((const char*)new_file.c_str(), true);
 	// FIXME
 	//AutoPtr<dng_preview> dpv(reinterpret_cast<dng_preview*>(jpeg_preview.Get()));
 	//AutoPtr<dng_preview> dpv((dng_preview*)jpeg_preview.Get());
@@ -763,7 +773,7 @@ void Utils::load_raw_file(const wxString
 
 	raw_data.resize(file_size);
 
-	std::ifstream fstream((const char*)raw_file_name.char_str(), std::ios::binary);
+	std::ifstream fstream((const char*)raw_file_name.c_str(), std::ios::binary);
 	if (!fstream) throw Exception(wxString() << _("cant_open_file") << L" \"" << raw_file_name << L"\"");
 	fstream.read((char*)&raw_data.front(), raw_data.size());
 	fstream.close();
@@ -896,13 +906,13 @@ void Utils::process_file
 	else jpeg_exists = false;
 
 	// Which camera type?
-	unsigned long file_size = wxFileName::GetSize(raw_file).GetLo();
+	unsigned long file_size = GetSize(raw_file);
 	ExifDataAgr jpeg_exif;
 	const CameraData * camera = NULL;
 	if (jpeg_exists)
 	{
 		ExifLoader *l = exif_loader_new();
-		exif_loader_write_file(l, jpg_file_name.char_str());
+		exif_loader_write_file(l, (const char*)jpg_file_name.c_str());
 		jpeg_exif.ed = exif_loader_get_data(l);
 		jpeg_exif.n = exif_data_get_mnote_data(jpeg_exif.ed);
 		exif_loader_unref(l);