1.1 --- a/Source/QuartzUtils.h Fri Mar 07 11:43:02 2008 -0800
1.2 +++ b/Source/QuartzUtils.h Wed Mar 12 15:51:32 2008 -0700
1.3 @@ -20,7 +20,7 @@
1.4 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
1.5 THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.6 */
1.7 -#import <Quartz/Quartz.h>
1.8 +#import "GGBLayer.h"
1.9
1.10
1.11 /** Constants for various commonly used colors. */
1.12 @@ -29,6 +29,15 @@
1.13 kAlmostInvisibleWhiteColor,
1.14 kHighlightColor;
1.15
1.16 +#if TARGET_OS_ASPEN
1.17 +// These don't exist on iPhone, so I implement them:
1.18 +CGColorRef CreateGray(CGFloat gray, CGFloat alpha);
1.19 +CGColorRef CreateRGB(CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha);
1.20 +#else
1.21 +#define CreateGray CGColorCreateGenericGray
1.22 +#define CreateRGB CGColorCreateGenericRGB
1.23 +#endif
1.24 +
1.25
1.26 /** Moves a layer from one superlayer to another, without changing its position onscreen. */
1.27 void ChangeSuperlayer( CALayer *layer, CALayer *newSuperlayer, int index );
1.28 @@ -36,11 +45,6 @@
1.29 /** Removes a layer from its superlayer without any fade-out animation. */
1.30 void RemoveImmediately( CALayer *layer );
1.31
1.32 -/** Convenience for creating a CATextLayer. */
1.33 -CATextLayer* AddTextLayer( CALayer *superlayer,
1.34 - NSString *text, NSFont* font,
1.35 - enum CAAutoresizingMask align );
1.36 -
1.37
1.38 /** Loads an image or pattern file into a CGImage or CGPattern.
1.39 If the name begins with "/", it's interpreted as an absolute filesystem path.
1.40 @@ -52,8 +56,10 @@
1.41 CGImageRef GetCGImageNamed( NSString *name );
1.42 CGColorRef GetCGPatternNamed( NSString *name );
1.43
1.44 +#if ! TARGET_OS_ASPEN
1.45 /** Loads image data from the pasteboard into a CGImage. */
1.46 CGImageRef GetCGImageFromPasteboard( NSPasteboard *pb );
1.47 +#endif
1.48
1.49 /** Creates a CGPattern from a CGImage. Caller must release it. */
1.50 CGPatternRef CreateImagePattern( CGImageRef image );
1.51 @@ -67,4 +73,6 @@
1.52 /** Returns the center point of a CGRect. */
1.53 static inline CGPoint GetCGRectCenter( CGRect rect ) {
1.54 return CGPointMake(CGRectGetMidX(rect),CGRectGetMidY(rect));
1.55 -}
1.56 \ No newline at end of file
1.57 +}
1.58 +
1.59 +void AddRoundRect( CGContextRef ctx, CGRect rect, CGFloat radius );