root/trunk/BackRowUtils.h @ 1

Revision 1, 1.6 KB (checked in by pmerrill, 3 years ago)

Initial import

Line 
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
15void BRLog( NSString * format, ... );
16void BRDebugLog( NSString * format, ... );
17void BRSystemLog( int level, NSString * format, ... );
18void BRSystemLogv( int level, NSString * format, va_list args );
19
20// other BackRow public functions
21CGImageRef CreateImageForURL( NSURL * imageURL );
22CGImageRef CreatePNGForURL( NSURL * imageURL );
23CGImageRef CreateJPEGForURL( NSURL * imageURL );
24
25NSData * CreateBitmapDataFromAttributedString( CFAttributedStringRef string,
26                                               UInt32 width, UInt32 height );
27NSSize 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)]
Note: See TracBrowser for help on using the browser.