From d868d7b0d463ede80b761f87f10d4e25f52989c3 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 15 Jun 2025 01:02:30 +0800 Subject: Remove some files of OSX. Symbol Point is conflict and needs to be fixed. --- src/platform/gui/osx/UiApplication.mm | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/platform/gui/osx/UiApplication.mm') diff --git a/src/platform/gui/osx/UiApplication.mm b/src/platform/gui/osx/UiApplication.mm index fd6e8ef0..32e825e0 100644 --- a/src/platform/gui/osx/UiApplication.mm +++ b/src/platform/gui/osx/UiApplication.mm @@ -2,7 +2,6 @@ #include "ClipboardPrivate.h" #include "cru/base/log/Logger.h" -#include "cru/base/platform/osx/Convert.h" #include "cru/platform/graphics/quartz/Factory.h" #include "cru/platform/gui/osx/Clipboard.h" #include "cru/platform/gui/osx/Cursor.h" @@ -30,9 +29,6 @@ @end namespace cru::platform::gui::osx { - -using cru::platform::osx::Convert; - namespace details { class OsxUiApplicationPrivate { friend OsxUiApplication; @@ -182,15 +178,15 @@ graphics::IGraphicsFactory* OsxUiApplication::GetGraphicsFactory() { std::optional OsxUiApplication::ShowSaveDialog(SaveDialogOptions options) { NSSavePanel* panel = [NSSavePanel savePanel]; - [panel setTitle:(NSString*)Convert(options.title)]; - [panel setPrompt:(NSString*)Convert(options.prompt)]; - [panel setMessage:(NSString*)Convert(options.message)]; + [panel setTitle:(NSString*)options.title.ToCFStringRef().ref]; + [panel setPrompt:(NSString*)options.prompt.ToCFStringRef().ref]; + [panel setMessage:(NSString*)options.message.ToCFStringRef().ref]; NSMutableArray* allowed_content_types = [NSMutableArray array]; for (const auto& file_type : options.allowed_file_types) { [allowed_content_types - addObject:[UTType typeWithFilenameExtension:(NSString*)Convert(file_type)]]; + addObject:[UTType typeWithFilenameExtension:(NSString*)file_type.ToCFStringRef().ref]]; } [panel setAllowedContentTypes:allowed_content_types]; @@ -198,7 +194,7 @@ std::optional OsxUiApplication::ShowSaveDialog(SaveDialogOptions options auto model_result = [panel runModal]; if (model_result == NSModalResponseOK) { - return Convert((CFStringRef)[[panel URL] path]); + return ::cru::String::FromCFStringRef((CFStringRef)[[panel URL] path]); } else { return std::nullopt; } @@ -206,15 +202,15 @@ std::optional OsxUiApplication::ShowSaveDialog(SaveDialogOptions options std::optional> OsxUiApplication::ShowOpenDialog(OpenDialogOptions options) { NSOpenPanel* panel = [NSOpenPanel openPanel]; - [panel setTitle:(NSString*)Convert(options.title)]; - [panel setPrompt:(NSString*)Convert(options.prompt)]; - [panel setMessage:(NSString*)Convert(options.message)]; + [panel setTitle:(NSString*)options.title.ToCFStringRef().ref]; + [panel setPrompt:(NSString*)options.prompt.ToCFStringRef().ref]; + [panel setMessage:(NSString*)options.message.ToCFStringRef().ref]; NSMutableArray* allowed_content_types = [NSMutableArray array]; for (const auto& file_type : options.allowed_file_types) { [allowed_content_types - addObject:[UTType typeWithFilenameExtension:(NSString*)Convert(file_type)]]; + addObject:[UTType typeWithFilenameExtension:(NSString*)file_type.ToCFStringRef().ref]]; } [panel setAllowedContentTypes:allowed_content_types]; @@ -228,7 +224,7 @@ std::optional> OsxUiApplication::ShowOpenDialog(OpenDialogOp if (model_result == NSModalResponseOK) { std::vector result; for (NSURL* url in [panel URLs]) { - result.push_back(Convert((CFStringRef)[url path])); + result.push_back(::cru::String::FromCFStringRef((CFStringRef)[url path])); } return result; } else { -- cgit v1.2.3