1 /* vi:set ts=8 sts=4 sw=4 ft=objc:
3 * VIM - Vi IMproved by Bram Moolenaar
4 * MacVim GUI port by Bjorn Winckler
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
14 @implementation NSPortMessage (MacVim)
16 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
17 receivePort:(NSPort *)receivePort components:(NSArray *)components
20 NSPortMessage *msg = [[NSPortMessage alloc]
21 initWithSendPort:sendPort
22 receivePort:receivePort
23 components:components];
26 // HACK! How long should this wait before time out?
27 NSDate *date = wait ? [NSDate dateWithTimeIntervalSinceNow:1]
29 BOOL ok = [msg sendBeforeDate:date];
36 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
37 receivePort:(NSPort *)receivePort data:(NSData *)data wait:(BOOL)wait
39 return [NSPortMessage sendMessage:msgid
41 receivePort:receivePort
42 components:[NSArray arrayWithObject:data]
46 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
47 receivePort:(NSPort *)receivePort wait:(BOOL)wait
49 return [NSPortMessage sendMessage:msgid
51 receivePort:receivePort
56 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
57 components:(NSArray *)components wait:(BOOL)wait
59 return [NSPortMessage sendMessage:msgid
66 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
67 data:(NSData *)data wait:(BOOL)wait
69 return [NSPortMessage sendMessage:msgid
72 components:[NSArray arrayWithObject:data]
76 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort wait:(BOOL)wait
78 return [NSPortMessage sendMessage:msgid