diff -r e9f7ba4718e1 -r af9b2b929b03 Source/QuartzUtils.h --- a/Source/QuartzUtils.h Fri Mar 07 11:43:02 2008 -0800 +++ b/Source/QuartzUtils.h Wed Mar 12 15:51:32 2008 -0700 @@ -20,7 +20,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import "GGBLayer.h" /** Constants for various commonly used colors. */ @@ -29,6 +29,15 @@ kAlmostInvisibleWhiteColor, kHighlightColor; +#if TARGET_OS_ASPEN +// These don't exist on iPhone, so I implement them: +CGColorRef CreateGray(CGFloat gray, CGFloat alpha); +CGColorRef CreateRGB(CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha); +#else +#define CreateGray CGColorCreateGenericGray +#define CreateRGB CGColorCreateGenericRGB +#endif + /** Moves a layer from one superlayer to another, without changing its position onscreen. */ void ChangeSuperlayer( CALayer *layer, CALayer *newSuperlayer, int index ); @@ -36,11 +45,6 @@ /** Removes a layer from its superlayer without any fade-out animation. */ void RemoveImmediately( CALayer *layer ); -/** Convenience for creating a CATextLayer. */ -CATextLayer* AddTextLayer( CALayer *superlayer, - NSString *text, NSFont* font, - enum CAAutoresizingMask align ); - /** Loads an image or pattern file into a CGImage or CGPattern. If the name begins with "/", it's interpreted as an absolute filesystem path. @@ -52,8 +56,10 @@ CGImageRef GetCGImageNamed( NSString *name ); CGColorRef GetCGPatternNamed( NSString *name ); +#if ! TARGET_OS_ASPEN /** Loads image data from the pasteboard into a CGImage. */ CGImageRef GetCGImageFromPasteboard( NSPasteboard *pb ); +#endif /** Creates a CGPattern from a CGImage. Caller must release it. */ CGPatternRef CreateImagePattern( CGImageRef image ); @@ -67,4 +73,6 @@ /** Returns the center point of a CGRect. */ static inline CGPoint GetCGRectCenter( CGRect rect ) { return CGPointMake(CGRectGetMidX(rect),CGRectGetMidY(rect)); -} \ No newline at end of file +} + +void AddRoundRect( CGContextRef ctx, CGRect rect, CGFloat radius );