Don't wait on ScrollbarEventMsgID.
[MacVim/jjgod.git] / MacVim.m
blob3727ea60bcaaa72e6a30abfe765162e68dd8adf8
1 /* vi:set ts=8 sts=4 sw=4 ft=objc:
2  *
3  * VIM - Vi IMproved            by Bram Moolenaar
4  *                              MacVim GUI port by Bjorn Winckler
5  *
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.
9  */
11 #import "MacVim.h"
14 @implementation NSPortMessage (MacVim)
16 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
17         receivePort:(NSPort *)receivePort components:(NSArray *)components
18                wait:(BOOL)wait
20     NSPortMessage *msg = [[NSPortMessage alloc]
21             initWithSendPort:sendPort
22                  receivePort:receivePort
23                   components:components];
24     [msg setMsgid:msgid];
26     // HACK!  How long should this wait before time out?
27     NSDate *date = wait ? [NSDate dateWithTimeIntervalSinceNow:1]
28                         : [NSDate date];
29     BOOL ok = [msg sendBeforeDate:date];
31     [msg release];
33     return ok;
36 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
37         receivePort:(NSPort *)receivePort data:(NSData *)data wait:(BOOL)wait
39     return [NSPortMessage sendMessage:msgid
40                          withSendPort:sendPort
41                           receivePort:receivePort
42                            components:[NSArray arrayWithObject:data]
43                                  wait:wait];
46 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
47         receivePort:(NSPort *)receivePort wait:(BOOL)wait
49     return [NSPortMessage sendMessage:msgid
50                          withSendPort:sendPort
51                           receivePort:receivePort
52                            components:nil
53                                  wait:wait];
56 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
57         components:(NSArray *)components wait:(BOOL)wait
59     return [NSPortMessage sendMessage:msgid
60                          withSendPort:sendPort
61                           receivePort:nil
62                            components:components
63                                  wait:wait];
66 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort
67         data:(NSData *)data wait:(BOOL)wait
69     return [NSPortMessage sendMessage:msgid
70                          withSendPort:sendPort
71                           receivePort:nil
72                            components:[NSArray arrayWithObject:data]
73                                  wait:wait];
76 + (BOOL)sendMessage:(int)msgid withSendPort:(NSPort *)sendPort wait:(BOOL)wait
78     return [NSPortMessage sendMessage:msgid
79                          withSendPort:sendPort
80                           receivePort:nil
81                            components:nil
82                                  wait:wait];
86 @end