diff options
Diffstat (limited to 'src/platform/gui/osx')
-rw-r--r-- | src/platform/gui/osx/Clipboard.mm | 2 | ||||
-rw-r--r-- | src/platform/gui/osx/Menu.mm | 2 | ||||
-rw-r--r-- | src/platform/gui/osx/UiApplication.mm | 16 | ||||
-rw-r--r-- | src/platform/gui/osx/Window.mm | 6 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/platform/gui/osx/Clipboard.mm b/src/platform/gui/osx/Clipboard.mm index b3469795..f15232e2 100644 --- a/src/platform/gui/osx/Clipboard.mm +++ b/src/platform/gui/osx/Clipboard.mm @@ -37,7 +37,7 @@ String OsxClipboardPrivate::GetText() { } void OsxClipboardPrivate::SetText(String text) { - auto cf_string = ToCFStringRef(text); + auto cf_string = ToCFString(text); [pasteboard_ clearContents]; [pasteboard_ writeObjects:@[ (NSString*)cf_string.ref ]]; } diff --git a/src/platform/gui/osx/Menu.mm b/src/platform/gui/osx/Menu.mm index 648bc392..45beddee 100644 --- a/src/platform/gui/osx/Menu.mm +++ b/src/platform/gui/osx/Menu.mm @@ -63,7 +63,7 @@ OsxMenuItem::~OsxMenuItem() { delete p_; } String OsxMenuItem::GetTitle() { return FromCFStringRef((CFStringRef)[p_->menu_item_ title]); } void OsxMenuItem::SetTitle(String title) { - auto cf_title = ToCFStringRef(title); + auto cf_title = ToCFString(title); [p_->menu_item_ setTitle:(NSString*)(cf_title.ref)]; } diff --git a/src/platform/gui/osx/UiApplication.mm b/src/platform/gui/osx/UiApplication.mm index 2733e8af..7e744928 100644 --- a/src/platform/gui/osx/UiApplication.mm +++ b/src/platform/gui/osx/UiApplication.mm @@ -179,15 +179,15 @@ graphics::IGraphicsFactory* OsxUiApplication::GetGraphicsFactory() { std::optional<String> OsxUiApplication::ShowSaveDialog(SaveDialogOptions options) { NSSavePanel* panel = [NSSavePanel savePanel]; - [panel setTitle:(NSString*)ToCFStringRef(options.title).ref]; - [panel setPrompt:(NSString*)ToCFStringRef(options.prompt).ref]; - [panel setMessage:(NSString*)ToCFStringRef(options.message).ref]; + [panel setTitle:(NSString*)ToCFString(options.title).ref]; + [panel setPrompt:(NSString*)ToCFString(options.prompt).ref]; + [panel setMessage:(NSString*)ToCFString(options.message).ref]; NSMutableArray* allowed_content_types = [NSMutableArray array]; for (const auto& file_type : options.allowed_file_types) { [allowed_content_types - addObject:[UTType typeWithFilenameExtension:(NSString*)ToCFStringRef(file_type).ref]]; + addObject:[UTType typeWithFilenameExtension:(NSString*)ToCFString(file_type).ref]]; } [panel setAllowedContentTypes:allowed_content_types]; @@ -203,15 +203,15 @@ std::optional<String> OsxUiApplication::ShowSaveDialog(SaveDialogOptions options std::optional<std::vector<String>> OsxUiApplication::ShowOpenDialog(OpenDialogOptions options) { NSOpenPanel* panel = [NSOpenPanel openPanel]; - [panel setTitle:(NSString*)ToCFStringRef(options.title).ref]; - [panel setPrompt:(NSString*)ToCFStringRef(options.prompt).ref]; - [panel setMessage:(NSString*)ToCFStringRef(options.message).ref]; + [panel setTitle:(NSString*)ToCFString(options.title).ref]; + [panel setPrompt:(NSString*)ToCFString(options.prompt).ref]; + [panel setMessage:(NSString*)ToCFString(options.message).ref]; NSMutableArray* allowed_content_types = [NSMutableArray array]; for (const auto& file_type : options.allowed_file_types) { [allowed_content_types - addObject:[UTType typeWithFilenameExtension:(NSString*)ToCFStringRef(file_type).ref]]; + addObject:[UTType typeWithFilenameExtension:(NSString*)ToCFString(file_type).ref]]; } [panel setAllowedContentTypes:allowed_content_types]; diff --git a/src/platform/gui/osx/Window.mm b/src/platform/gui/osx/Window.mm index 4279e73e..f3a95fad 100644 --- a/src/platform/gui/osx/Window.mm +++ b/src/platform/gui/osx/Window.mm @@ -29,7 +29,7 @@ constexpr int key_down_debug = 0; } using ::cru::FromCFStringRef; -using ::cru::ToCFStringRef; +using ::cru::ToCFString; using cru::platform::graphics::quartz::Convert; namespace cru::platform::gui::osx { namespace { @@ -188,7 +188,7 @@ void OsxWindowPrivate::CreateWindow() { frame:Rect(Point{}, content_rect_.GetSize())]; [window_ setContentView:content_view]; - [window_ setTitle:(NSString*)ToCFStringRef(title_).ref]; + [window_ setTitle:(NSString*)ToCFString(title_).ref]; draw_layer_ = CreateLayer(Convert(content_rect_.GetSize())); @@ -256,7 +256,7 @@ void OsxWindow::SetTitle(String title) { p_->title_ = title; if (p_->window_) { - [p_->window_ setTitle:(NSString*)ToCFStringRef(title).ref]; + [p_->window_ setTitle:(NSString*)ToCFString(title).ref]; } } |