mirror of
https://github.com/libretro/RetroArch
synced 2024-12-28 00:24:15 +00:00
01cb10d8b3
* Fetch translations from Crowdin * Support for showing and hiding indicator and navigation bar * Refactored to use a view model * Support defining helper bar items and support showing/hiding keyboard * reorganized source files into separate logical files * Moved mouse support to swift (except for delegate implementation), added support for enabling touch mouse in helper bar; reorganized swift source files * Reorganized keyboard files; added the touch mouse messages to the RA localization files; use the RA notification system * change keyboard letters to uppercase for clarity Co-authored-by: github-actions <github-actions@github.com>
29 lines
886 B
Swift
29 lines
886 B
Swift
//
|
|
// CocoaView+Utilities.swift
|
|
// RetroArchiOS
|
|
//
|
|
// Created by Yoshi Sugawara on 3/2/22.
|
|
// Copyright © 2022 RetroArch. All rights reserved.
|
|
//
|
|
|
|
extension CocoaView {
|
|
|
|
// A native swift wrapper around displaying notifications
|
|
@objc func showRetroArchNotification(
|
|
title: String? = nil,
|
|
message: String,
|
|
icon: message_queue_icon = MESSAGE_QUEUE_ICON_DEFAULT,
|
|
category: message_queue_category = MESSAGE_QUEUE_CATEGORY_INFO
|
|
) {
|
|
guard let messageCString = message.cString(using: .utf8) else { return }
|
|
let titleCString: UnsafeMutablePointer<CChar>? = {
|
|
if let title = title {
|
|
let str = title as NSString
|
|
return UnsafeMutablePointer<CChar>(mutating: str.utf8String)
|
|
}
|
|
return nil
|
|
}()
|
|
runloop_msg_queue_push(messageCString, 1, 100, true, titleCString, icon, category)
|
|
}
|
|
}
|