Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#[allow(deprecated)]
|
||||
use cocoa::base::id;
|
||||
use warpui::platform::mac::make_nsstring;
|
||||
|
||||
use crate::channel::ChannelState;
|
||||
|
||||
extern "C" {
|
||||
/// ObjC function to create and register the NSServices provider for the
|
||||
/// application.
|
||||
fn warp_register_services_provider();
|
||||
}
|
||||
|
||||
/// Initializes application services.
|
||||
pub fn init() {
|
||||
unsafe {
|
||||
warp_register_services_provider();
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns an NSString containing the custom URL scheme that this build of the
|
||||
/// application will respond to.
|
||||
///
|
||||
/// Called synchronously from the NSServices dispatch path in
|
||||
/// `services.m::forFilesFromPasteboard:performAction:`, which wraps the body in
|
||||
/// an `@autoreleasepool` block. That ambient pool owns the returned NSString.
|
||||
#[allow(deprecated)]
|
||||
#[no_mangle]
|
||||
extern "C-unwind" fn warp_services_provider_custom_url_scheme() -> id {
|
||||
make_nsstring(ChannelState::url_scheme())
|
||||
}
|
||||
Reference in New Issue
Block a user