1 // -*- c-basic-offset: 4 -*- 2 3 /** @file hugin1/base_wx/platform.h 4 * 5 * @brief implementation of huginApp Class 6 * 7 * @author Pablo d'Angelo <pablo.dangelo@web.de> 8 * 9 * $Id: huginApp.cpp 2510 2007-10-28 22:24:11Z dangelo $ 10 * 11 * This program is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU General Public 13 * License as published by the Free Software Foundation; either 14 * version 2 of the License, or (at your option) any later version. 15 * 16 * This software is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public 22 * License along with this software. If not, see 23 * <http://www.gnu.org/licenses/>. 24 * 25 */ 26 27 #ifndef HUGIN1_BASE_PLATFORM_H 28 #define HUGIN1_BASE_PLATFORM_H 29 30 #include <hugin_shared.h> 31 #include "panoinc_WX.h" 32 #include "hugin_config.h" 33 #if wxUSE_ON_FATAL_EXCEPTION 34 #include <wx/debugrpt.h> 35 #endif 36 37 #ifdef __WXMSW__ 38 #define HUGIN_CONV_FILENAME (*wxConvCurrent) 39 #else 40 #define HUGIN_CONV_FILENAME (*wxConvFileName) 41 #endif 42 43 /** return filter for image files, needed by file open dialog 44 it contains all image format vigra can read and some other format */ 45 WXIMPEX wxString GetFileDialogImageFilters(); 46 /** return filter for image and raw files, needed by file open dialog */ 47 WXIMPEX wxString GetFileDialogImageAndRawFilters(); 48 /** return true, if given extension is in list of known raw extension (comparision is case insensitive */ 49 WXIMPEX bool IsRawExtension(const wxString& testExt); 50 51 #if defined __WXMAC__ || defined __WXOSX_COCOA__ 52 53 #include <wx/osx/core/cfstring.h> 54 #include <wx/osx/private.h> 55 56 CFStringRef MacCreateCFStringWithWxString(const wxString& string); 57 58 wxString MacGetPathToMainExecutableFileOfBundle(CFStringRef bundlePath); 59 wxString MacGetPathToMainExecutableFileOfRegisteredBundle(CFStringRef BundleIdentifier); 60 61 #if defined MAC_SELF_CONTAINED_BUNDLE 62 63 wxString MacGetPathToBundledResourceFile(CFStringRef filename); 64 wxString MacGetPathToBundledFrameworksDirectory(); 65 wxString MacGetPathToBundledExecutableFile(CFStringRef filename); 66 wxString MacGetPathToBundledAppMainExecutableFile(CFStringRef appname); 67 wxString MacGetPathToUserDomainTempDir(); 68 wxString MacGetPathToUserAppSupportAutoPanoFolder(); 69 70 #endif // MAC_SELF_CONTAINED_BUNDLE 71 72 #endif //__WXMAC__ 73 74 /** returns all invalid characters for the filename (mainly characters, which does not work with gnu make) */ 75 WXIMPEX const wxString getInvalidCharacters(); 76 /** returns true, if the given strings contains invalid characters */ 77 WXIMPEX bool containsInvalidCharacters(const wxString stringToTest); 78 /** shows a dialog about filename with invalid characters, all names in filelist will be show in list */ 79 WXIMPEX void ShowFilenameWarning(wxWindow* parent, const wxArrayString filelist); 80 81 #if wxUSE_ON_FATAL_EXCEPTION 82 /** shows debug report dialog box from wxWidgets */ 83 WXIMPEX void GenerateReport(wxDebugReport::Context ctx); 84 #endif 85 86 #endif 87