From 58ffa5f38ca0f89947193c0f9d0ea807f7ccbaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 19 Sep 2015 10:29:05 +0200 Subject: [PATCH] Remove file/dialog.cpp,h --- CMakeLists.txt | 2 - ext/native/Android.mk | 1 - ext/native/file/dialog.cpp | 89 ------------------------------- ext/native/file/dialog.h | 10 ---- ext/native/native.vcxproj | 2 - ext/native/native.vcxproj.filters | 6 --- 6 files changed, 110 deletions(-) delete mode 100644 ext/native/file/dialog.cpp delete mode 100644 ext/native/file/dialog.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f24d2186b..3032849a9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -904,8 +904,6 @@ add_library(native STATIC ext/native/ext/vjson/block_allocator.h ext/native/file/chunk_file.cpp ext/native/file/chunk_file.h - ext/native/file/dialog.cpp - ext/native/file/dialog.h ext/native/file/easy_file.cpp ext/native/file/easy_file.h ext/native/file/fd_util.cpp diff --git a/ext/native/Android.mk b/ext/native/Android.mk index 55c97c026a..d5be3974a0 100644 --- a/ext/native/Android.mk +++ b/ext/native/Android.mk @@ -41,7 +41,6 @@ LOCAL_SRC_FILES :=\ ext/stb_vorbis/stb_vorbis.c.arm \ ext/vjson/json.cpp \ ext/vjson/block_allocator.cpp \ - file/dialog.cpp \ file/fd_util.cpp \ file/easy_file.cpp \ file/chunk_file.cpp \ diff --git a/ext/native/file/dialog.cpp b/ext/native/file/dialog.cpp deleted file mode 100644 index 7a8ab45111..0000000000 --- a/ext/native/file/dialog.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include - -#include - -#include "util/text/utf8.h" - -// For desktop operating systems only. Stubbed out on Android. -// Simplified as this will only be used in utilities / temp code. -// An false returned means cancel; -bool OpenFileDialog(const char *title, const char *extension, std::string *filename) -{ - std::wstring wtitle = ConvertUTF8ToWString(std::string(title)); - std::wstring wext = ConvertUTF8ToWString(std::string(extension)); - - OPENFILENAME of; - memset(&of, 0, sizeof(of)); - wchar_t buffer[512] = {0}; - of.lStructSize = sizeof(OPENFILENAME); - of.hInstance = 0; - of.hwndOwner = GetActiveWindow(); - - // These weird strings with zeroes in them can't be dealt with using normal string - // functions, so here we go - evil hackery. - wchar_t filter[256] = L"XXX files\0*.XXX\0\0"; - memcpy(filter, wext.c_str(), 3 * sizeof(wchar_t)); - memcpy(filter + 12, wext.c_str(), 3 * sizeof(wchar_t)); - of.lpstrFilter = filter; - - of.lpstrDefExt = wext.c_str(); - of.lpstrFile = buffer; - of.nMaxFile = 511; - - of.Flags = OFN_FILEMUSTEXIST; - if (!GetOpenFileName(&of)) return false; - *filename = ConvertWStringToUTF8(of.lpstrFile); - return true; -} - -bool SaveFileDialog(const char *title, const char *extension, std::string *filename) { - std::wstring wtitle = ConvertUTF8ToWString(std::string(title)); - std::wstring wext = ConvertUTF8ToWString(std::string(extension)); - - OPENFILENAME of; - memset(&of, 0, sizeof(of)); - wchar_t buffer[512] = {0}; - of.lStructSize = sizeof(OPENFILENAME); - of.hInstance = 0; - of.hwndOwner = GetActiveWindow(); - - // These weird strings with zeroes in them can't be dealt with using normal string - // functions, so here we go - evil hackery. - wchar_t filter[256] = L"XXX files\0*.XXX\0\0"; - memcpy(filter, wext.c_str(), 3 * sizeof(wchar_t)); - memcpy(filter + 12, wext.c_str(), 3 * sizeof(wchar_t)); - of.lpstrFilter = filter; - - of.lpstrDefExt = wext.c_str(); - of.lpstrFile = buffer; - of.nMaxFile = 511; - - of.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; - if (!GetSaveFileName(&of)) - return false; - *filename = ConvertWStringToUTF8(of.lpstrFile); - return true; -} - -#else - -#include -#include "base/basictypes.h" -#include "base/logging.h" - -bool OpenFileDialog(const char *title, const char *extension, std::string *filename) -{ - ELOG("Asked for OpenFileDialog, not present on this platform."); - return false; -} - -bool SaveFileDialog(const char *title, const char *extension, std::string *filename) -{ - ELOG("Asked for SaveFileDialog, not present on this platform."); - return false; -} - -#endif diff --git a/ext/native/file/dialog.h b/ext/native/file/dialog.h deleted file mode 100644 index 018b503e70..0000000000 --- a/ext/native/file/dialog.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#pragma once - -#include - -#include "file/dialog.h" - -bool OpenFileDialog(const char *title, const char *extension, std::string *filename); -bool SaveFileDialog(const char *title, const char *extension, std::string *filename); diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index 039cca16d1..fc9ecc50b3 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -224,7 +224,6 @@ - @@ -690,7 +689,6 @@ - diff --git a/ext/native/native.vcxproj.filters b/ext/native/native.vcxproj.filters index d98ff0441f..95e527f8b6 100644 --- a/ext/native/native.vcxproj.filters +++ b/ext/native/native.vcxproj.filters @@ -135,9 +135,6 @@ ui - - file - base @@ -428,9 +425,6 @@ ui - - file - util