mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Add proxy icon support
This commit is contained in:
committed by
Bjorn Winckler
parent
10cff2591d
commit
53f258bb6f
@@ -83,6 +83,7 @@
|
||||
- (void)showTabBar:(BOOL)enable;
|
||||
- (void)setRows:(int)rows columns:(int)cols;
|
||||
- (void)setWindowTitle:(char *)title;
|
||||
- (void)setDocumentFilename:(char *)filename;
|
||||
- (char *)browseForFileInDirectory:(char *)dir title:(char *)title
|
||||
saving:(int)saving;
|
||||
- (int)presentDialogWithType:(int)type title:(char *)title message:(char *)msg
|
||||
|
||||
@@ -641,6 +641,18 @@ static NSString *MMSymlinkWarningString =
|
||||
[self queueMessage:SetWindowTitleMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)setDocumentFilename:(char *)filename
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
int len = filename ? strlen(filename) : 0;
|
||||
|
||||
[data appendBytes:&len length:sizeof(int)];
|
||||
if (len > 0)
|
||||
[data appendBytes:filename length:len];
|
||||
|
||||
[self queueMessage:SetDocumentFilenameMsgID data:data];
|
||||
}
|
||||
|
||||
- (char *)browseForFileInDirectory:(char *)dir title:(char *)title
|
||||
saving:(int)saving
|
||||
{
|
||||
|
||||
@@ -685,6 +685,20 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
[windowController setTitle:string];
|
||||
|
||||
[string release];
|
||||
} else if (SetDocumentFilenameMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
int len = *((int*)bytes); bytes += sizeof(int);
|
||||
|
||||
if (len > 0) {
|
||||
NSString *filename = [[NSString alloc] initWithBytes:(void*)bytes
|
||||
length:len encoding:NSUTF8StringEncoding];
|
||||
|
||||
[windowController setDocumentFilename:filename];
|
||||
|
||||
[filename release];
|
||||
} else {
|
||||
[windowController setDocumentFilename:@""];
|
||||
}
|
||||
} else if (AddMenuMsgID == msgid) {
|
||||
NSDictionary *attrs = [NSDictionary dictionaryWithData:data];
|
||||
[self addMenuWithDescriptor:[attrs objectForKey:@"descriptor"]
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
- (void)selectTabWithIndex:(int)idx;
|
||||
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols live:(BOOL)live;
|
||||
- (void)setTitle:(NSString *)title;
|
||||
- (void)setDocumentFilename:(NSString *)filename;
|
||||
- (void)setToolbar:(NSToolbar *)toolbar;
|
||||
- (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
|
||||
- (BOOL)destroyScrollbarWithIdentifier:(long)ident;
|
||||
|
||||
@@ -314,6 +314,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDocumentFilename:(NSString *)filename
|
||||
{
|
||||
if (filename)
|
||||
[decoratedWindow setRepresentedFilename:filename];
|
||||
}
|
||||
|
||||
- (void)setToolbar:(NSToolbar *)toolbar
|
||||
{
|
||||
// The full-screen window has no toolbar.
|
||||
|
||||
@@ -168,6 +168,7 @@ enum {
|
||||
EnableAntialiasMsgID,
|
||||
DisableAntialiasMsgID,
|
||||
SetVimStateMsgID,
|
||||
SetDocumentFilenameMsgID,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ char *MessageStrings[] =
|
||||
"EnableAntialiasMsgID",
|
||||
"DisableAntialiasMsgID",
|
||||
"SetVimStateMsgID",
|
||||
"SetDocumentFilenameMsgID",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1532,7 +1532,12 @@ gui_mch_settitle(char_u *title, char_u *icon)
|
||||
title = CONVERT_TO_UTF8(title);
|
||||
#endif
|
||||
|
||||
[[MMBackend sharedInstance] setWindowTitle:(char*)title];
|
||||
MMBackend *backend = [MMBackend sharedInstance];
|
||||
[backend setWindowTitle:(char*)title];
|
||||
|
||||
// TODO: Convert filename to UTF-8?
|
||||
if (curbuf)
|
||||
[backend setDocumentFilename:(char*)curbuf->b_ffname];
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
CONVERT_TO_UTF8_FREE(title);
|
||||
@@ -1825,6 +1830,7 @@ odb_event(buf_T *buf, const AEEventID action)
|
||||
bytes:&buf->b_odb_server_id
|
||||
length:sizeof(OSType)];
|
||||
|
||||
// TODO: Convert b_ffname to UTF-8?
|
||||
NSString *path = [NSString stringWithUTF8String:(char*)buf->b_ffname];
|
||||
NSData *pathData = [[[NSURL fileURLWithPath:path] absoluteString]
|
||||
dataUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
Reference in New Issue
Block a user