mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 10:37:33 -07:00
Pass authtoken in from user, and add a wrapper for web UI on Mac.
This commit is contained in:
parent
e58047eaa0
commit
5b54612d91
68 changed files with 7537 additions and 1 deletions
48
ext/mac-ui-macgap1-wrapper/MacGap/Classes/Commands/fonts.m
Normal file
48
ext/mac-ui-macgap1-wrapper/MacGap/Classes/Commands/fonts.m
Normal file
|
@ -0,0 +1,48 @@
|
|||
#import "fonts.h"
|
||||
|
||||
@implementation Fonts
|
||||
|
||||
|
||||
- (NSArray*) availableFonts {
|
||||
return [[NSFontManager sharedFontManager] availableFonts];
|
||||
}
|
||||
|
||||
- (NSArray*) availableFontFamilies {
|
||||
return [[NSFontManager sharedFontManager] availableFontFamilies];
|
||||
}
|
||||
|
||||
- (NSArray*) availableMembersOfFontFamily:(NSString *)fontFamily {
|
||||
return [[NSFontManager sharedFontManager] availableMembersOfFontFamily:fontFamily];
|
||||
}
|
||||
|
||||
- (CGFloat) defaultLineHeightForFont:(NSString*)theFontName ofSize:(CGFloat)theFontSize {
|
||||
NSFont *theFont = [NSFont fontWithName:theFontName size:theFontSize];
|
||||
NSLayoutManager *lm = [[NSLayoutManager alloc] init];
|
||||
|
||||
return [lm defaultLineHeightForFont:theFont];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark WebScripting Protocol
|
||||
|
||||
+ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector {
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (NSString*) webScriptNameForSelector:(SEL)selector {
|
||||
id result = nil;
|
||||
|
||||
if (selector == @selector(availableMembersOfFontFamily:)) {
|
||||
result = @"availableMembersOfFontFamily";
|
||||
} else if (selector == @selector(defaultLineHeightForFont:ofSize:)) {
|
||||
result = @"defaultLineHeightForFont";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+ (BOOL) isKeyExcludedFromWebScript:(const char*)name {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue