| 1 | /* |
|---|
| 2 | * BackRowUtils.h |
|---|
| 3 | * AwkwardTV |
|---|
| 4 | * |
|---|
| 5 | * Created by Alan Quatermain on 02/04/07. |
|---|
| 6 | * Copyright 2007 AwkwardTV. All rights reserved. |
|---|
| 7 | * |
|---|
| 8 | */ |
|---|
| 9 | |
|---|
| 10 | #import <syslog.h> |
|---|
| 11 | #import <Foundation/Foundation.h> |
|---|
| 12 | #import <BackRow/BRLocalizedStringManager.h> |
|---|
| 13 | |
|---|
| 14 | // BackRow-supplied logging routines, these go to syslog |
|---|
| 15 | void BRLog( NSString * format, ... ); |
|---|
| 16 | void BRDebugLog( NSString * format, ... ); |
|---|
| 17 | void BRSystemLog( int level, NSString * format, ... ); |
|---|
| 18 | void BRSystemLogv( int level, NSString * format, va_list args ); |
|---|
| 19 | |
|---|
| 20 | // other BackRow public functions |
|---|
| 21 | CGImageRef CreateImageForURL( NSURL * imageURL ); |
|---|
| 22 | CGImageRef CreatePNGForURL( NSURL * imageURL ); |
|---|
| 23 | CGImageRef CreateJPEGForURL( NSURL * imageURL ); |
|---|
| 24 | |
|---|
| 25 | NSData * CreateBitmapDataFromAttributedString( CFAttributedStringRef string, |
|---|
| 26 | UInt32 width, UInt32 height ); |
|---|
| 27 | NSSize GetBoundsFromAttributedStringWithConstraint( NSAttributedString * string, |
|---|
| 28 | float width, float height, /*CTFramesetterRef*/CFTypeRef framesetter, |
|---|
| 29 | /*CTTypesetterRef*/CFTypeRef typesetter, |
|---|
| 30 | BOOL *typesetterRequestsMoreLinesThanFramesetter ); |
|---|
| 31 | |
|---|
| 32 | // plugin-based NSLocalizedString macros |
|---|
| 33 | // use genstrings -s BRLocalizedString -o <Language>.lproj to generate Localized.strings |
|---|
| 34 | #define BRLocalizedString(key, comment) \ |
|---|
| 35 | [BRLocalizedStringManager appliance:self localizedStringForKey:(key) inFile:nil] |
|---|
| 36 | #define BRLocalizedStringFromTable(key, tbl, comment) \ |
|---|
| 37 | [BRLocalizedStringManager appliance:self localizedStringForKey:(key) inFile:(tbl)] |
|---|
| 38 | #define BRLocalizedStringFromTableInBundle(key, tbl, obj, comment) \ |
|---|
| 39 | [BRLocalizedStringManager appliance:(obj) localizedStringForKey:(key) inFile:(tbl)] |
|---|