[PyObjC-svn] r2347 - trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest

[email protected] Thu, 15 Oct 2009 15:27:47 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Thu Oct 15 15:27:47 2009
New Revision: 2347

Log:
Progress on getting the Quartz testsuite to run on Tiger.


Modified:
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caanimation.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cacifilteradditions.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caconstraintlayoutmanager.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_calayer.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_camediatiming.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caopengllayer.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_carenderer.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcolorspace.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcontext.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgdataconsumer.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgevent.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfont.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfunction.py
   trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cggradient.py

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caanimation.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caanimation.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caanimation.py	Thu Oct 15 15:27:47 2009
@@ -6,6 +6,7 @@
     def animationDidStop_finished_(self, a, f): pass
 
 class TestCAAnimation (TestCase):
+    @min_os_level('10.5')
     def testMethods(self):
         self.failUnlessResultIsBOOL(CAAnimation.shouldArchiveValueForKey_)
         self.failUnlessResultIsBOOL(CAAnimation.isRemovedOnCompletion)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cacifilteradditions.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cacifilteradditions.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cacifilteradditions.py	Thu Oct 15 15:27:47 2009
@@ -3,6 +3,8 @@
 from Quartz.QuartzCore import *
 
 class TestCACIFilterAdditions (TestCase):
+
+    @min_os_level('10.5')
     def testMethods(self):
         self.failUnlessResultIsBOOL(CIFilter.isEnabled)
         self.failUnlessArgIsBOOL(CIFilter.setEnabled_, 0)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caconstraintlayoutmanager.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caconstraintlayoutmanager.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caconstraintlayoutmanager.py	Thu Oct 15 15:27:47 2009
@@ -3,6 +3,7 @@
 from Quartz.QuartzCore import *
 
 class TestCAConstraintLayoutManager (TestCase):
+    @min_os_level('10.5')
     def testConstants(self):
         self.failUnlessEqual(kCAConstraintMinX, 0)
         self.failUnlessEqual(kCAConstraintMidX, 1)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_calayer.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_calayer.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_calayer.py	Thu Oct 15 15:27:47 2009
@@ -40,6 +40,7 @@
         self.failUnlessIsInstance(kCATransition, unicode)
 
 
+    @min_os_level('10.5')
     def testMethods(self):
         self.failUnlessResultIsBOOL(CALayer.needsDisplayForKey_)
         self.failUnlessResultIsBOOL(CALayer.shouldArchiveValueForKey_)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_camediatiming.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_camediatiming.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_camediatiming.py	Thu Oct 15 15:27:47 2009
@@ -22,12 +22,14 @@
         def setFillMode_(self, v): pass
 
 class TestCAMediaTiming (TestCase):
+    @min_os_level('10.5')
     def testConstants(self):
         self.failUnlessIsInstance(kCAFillModeForwards, unicode)
         self.failUnlessIsInstance(kCAFillModeBackwards, unicode)
         self.failUnlessIsInstance(kCAFillModeBoth, unicode)
         self.failUnlessIsInstance(kCAFillModeRemoved, unicode)
 
+    @min_os_level('10.5')
     def testMethods(self):
         self.failUnlessResultHasType(TestCAMediaTimingHelper.beginTime, objc._C_DBL)
         self.failUnlessArgHasType(TestCAMediaTimingHelper.setBeginTime_, 0, objc._C_DBL)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caopengllayer.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caopengllayer.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_caopengllayer.py	Thu Oct 15 15:27:47 2009
@@ -3,6 +3,7 @@
 from Quartz.QuartzCore import *
 
 class TestCAOpenGLLayer (TestCase):
+    @min_os_level('10.5')
     def testMethods(self):
         self.failUnlessResultIsBOOL(CAOpenGLLayer.isAsynchronous)
         self.failUnlessArgIsBOOL(CAOpenGLLayer.setAsynchronous_, 0)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_carenderer.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_carenderer.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_carenderer.py	Thu Oct 15 15:27:47 2009
@@ -3,6 +3,7 @@
 from Quartz.QuartzCore import *
 
 class TestCARenderer (TestCase):
+    @min_os_level('10.5')
     def testMethods(self):
         self.failUnlessArgHasType(CARenderer.rendererWithCGLContext_options_, 0, '^{_CGLContextObject=}')
         self.failUnlessArgIsIn(CARenderer.beginFrameAtTime_timeStamp_, 1)

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcolorspace.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcolorspace.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcolorspace.py	Thu Oct 15 15:27:47 2009
@@ -76,6 +76,10 @@
 
         self.failUnlessIsInstance(CGColorSpaceGetTypeID(), (int, long))
         self.failUnlessIsInstance(CGColorSpaceGetNumberOfComponents(csp), (int, long))
+
+    @min_os_level('10.5')
+    def testFunctions10_5(self):
+        csp = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB)
         self.failUnlessIsInstance(CGColorSpaceGetModel(csp), (int, long))
 
         v = CGColorSpaceGetBaseColorSpace(csp)
@@ -91,7 +95,6 @@
         v = CGColorSpaceCopyICCProfile(csp)
         self.failUnlessIsInstance(v, CFDataRef)
 
-
         data = open('/Library/ColorSync/Profiles/WebSafeColors.icc', 'rb').read()
         provider = CGDataProviderCreateWithCFData(buffer(data))
         spc = CGColorSpaceCreateICCBased(3, [0.0, 255.0, 0.0, 255.0, 0.0, 255.0],
@@ -120,8 +123,6 @@
         self.failUnless(buf[4] == 1)
         self.failUnless(buf[5] == 2)
 
-    @min_os_level('10.5')
-    def testFunctions10_5(self):
         spc = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB)
         self.failUnlessIsInstance(spc, CGColorSpaceRef)
 

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcontext.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcontext.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgcontext.py	Thu Oct 15 15:27:47 2009
@@ -1,7 +1,8 @@
 from __future__ import with_statement
 
 from PyObjCTools.TestSupport import *
-from Quartz.CoreGraphics import *
+from Quartz import *
+import Quartz
 import os
 
 
@@ -81,6 +82,29 @@
         self.failUnlessIsInstance(context, CGContextRef)
         CGContextBeginPage(context, objc.NULL)
         try:
+            fn = '/System/Library/CoreServices/DefaultDesktop.jpg'
+            if not os.path.exists(fn):
+                fn = '/System/Library/Automator/Apply ColorSync Profile to Images.action/Contents/Resources/A-1075-normal.jpg'
+
+            provider = CGDataProviderCreateWithCFData(buffer(open(fn, 'rb').read()))
+            image = CGImageCreateWithJPEGDataProvider(provider, None, True, kCGRenderingIntentDefault)
+            self.failUnlessIsInstance(image, CGImageRef)
+
+            CGContextDrawTiledImage(context, ((0, 0), (10, 10)), image)
+
+            font =  CGFontCreateWithFontName("Helvetica")
+            self.failUnlessIsInstance(font, CGFontRef)
+            CGContextSetFont(context, font)
+
+            CGContextBeginTransparencyLayerWithRect(context,
+                    ((10, 10), (500, 100)), None)
+            CGContextEndTransparencyLayer(context)
+
+            color = CGColorCreateGenericRGB(1.0, 0.5, 0.5, 1.0)
+            self.failUnlessIsInstance(color, CGColorRef)
+            CGContextSetFillColorWithColor(context, color)
+            CGContextSetStrokeColorWithColor(context, color)
+
             gradient = CGGradientCreateWithColorComponents(
                 CGColorSpaceCreateDeviceGray(),
                 (0.25, 0.8), (0.95, 0.99), 2)
@@ -103,9 +127,17 @@
             self.failUnlessArgHasType(CGContextSetAllowsFontSubpixelPositioning, 1, objc._C_BOOL)
             self.failUnlessArgHasType(CGContextSetShouldSubpixelQuantizeFonts, 1, objc._C_BOOL)
 
+            gradient = CGGradientCreateWithColorComponents(
+                    CGColorSpaceCreateDeviceGray(),
+                    (0.25, 0.8), (0.95, 0.99), 2)
+            self.failUnlessIsInstance(gradient, CGGradientRef)
+
+            CGContextDrawLinearGradient(context, gradient, (0, 10), (50, 60),
+                    kCGGradientDrawsAfterEndLocation)
+
         finally:
             CGContextEndPage(context)
-            CGPDFContextClose(context)
+            if hasattr(Quartz, 'CGPDFContextClose'): CGPDFContextClose(context)
             if os.path.exists("/tmp/pyobjc.test.pdf"):
                 os.unlink("/tmp/pyobjc.test.pdf")
 
@@ -244,10 +276,6 @@
             self.assertRaises(ValueError, CGContextClipToRects, context,
                     [ ((0, 0), (40, 50)), ((60, 50), (90, 100))], 3)
 
-            color = CGColorCreateGenericRGB(1.0, 0.5, 0.5, 1.0)
-            self.failUnlessIsInstance(color, CGColorRef)
-            CGContextSetFillColorWithColor(context, color)
-            CGContextSetStrokeColorWithColor(context, color)
 
             CGContextSetFillColorSpace(context, CGColorSpaceCreateDeviceGray())
             CGContextSetStrokeColorSpace(context, CGColorSpaceCreateDeviceGray())
@@ -273,16 +301,11 @@
 
             CGContextSetInterpolationQuality(context, kCGInterpolationHigh)
 
+            color = CGColorCreate(CGColorSpaceCreateDeviceRGB(), (1,1,1,1))
+
             CGContextSetShadowWithColor(context, (2, 3), 0.5, color)
             CGContextSetShadow(context, (5, 6), 0.6)
 
-            gradient = CGGradientCreateWithColorComponents(
-                    CGColorSpaceCreateDeviceGray(),
-                    (0.25, 0.8), (0.95, 0.99), 2)
-            self.failUnlessIsInstance(gradient, CGGradientRef)
-
-            CGContextDrawLinearGradient(context, gradient, (0, 10), (50, 60),
-                    kCGGradientDrawsAfterEndLocation)
 
             CGContextSetCharacterSpacing(context, 0.1)
             CGContextSetTextPosition(context, 10, 50)
@@ -296,9 +319,6 @@
 
             CGContextSetTextDrawingMode(context, kCGTextStroke)
 
-            font =  CGFontCreateWithFontName("Helvetica")
-            self.failUnlessIsInstance(font, CGFontRef)
-            CGContextSetFont(context, font)
 
             CGContextSetFontSize(context, 11.5)
 
@@ -328,9 +348,6 @@
             CGContextBeginTransparencyLayer(context, None)
             CGContextEndTransparencyLayer(context)
 
-            CGContextBeginTransparencyLayerWithRect(context,
-                    ((10, 10), (500, 100)), None)
-            CGContextEndTransparencyLayer(context)
 
             tf = CGContextGetUserSpaceToDeviceSpaceTransform(context)
             self.failUnlessIsInstance(tf, CGAffineTransform)
@@ -367,13 +384,15 @@
             CGContextSetFillPattern(context, pattern, (1.0,1.0,1.0,1.0))
             CGContextSetStrokePattern(context, pattern, (1.0,1.0,1.0,1.0))
 
-            provider = CGDataProviderCreateWithCFData(buffer(
-                            open('/System/Library/CoreServices/DefaultDesktop.jpg', 'rb').read()))
+            fn = '/System/Library/CoreServices/DefaultDesktop.jpg'
+            if not os.path.exists(fn):
+                fn = '/System/Library/Automator/Apply ColorSync Profile to Images.action/Contents/Resources/A-1075-normal.jpg'
+
+            provider = CGDataProviderCreateWithCFData(buffer(open(fn, 'rb').read()))
             image = CGImageCreateWithJPEGDataProvider(provider, None, True, kCGRenderingIntentDefault)
             self.failUnlessIsInstance(image, CGImageRef)
 
             CGContextDrawImage(context, ((0, 0), (70, 50)), image)
-            CGContextDrawTiledImage(context, ((0, 0), (10, 10)), image)
 
             provider = CGDataProviderCreateWithCFData(buffer("1" * 4 * 20 * 10))
             mask = CGImageMaskCreate(20, 10, 8, 32, 80, provider, None, True)
@@ -383,7 +402,7 @@
 
         finally:
             CGContextEndPage(context)
-            CGPDFContextClose(context)
+            if hasattr(Quartz, 'CGPDFContextClose'): CGPDFContextClose(context)
             if os.path.exists("/tmp/pyobjc.test.pdf"):
                 os.unlink("/tmp/pyobjc.test.pdf")
 
@@ -396,6 +415,31 @@
         self.fail("CGContextDrawPDFDocument")
 
 
+    @min_os_level('10.5')
+    def testContextManager10_5(self):
+        url = CFURLCreateWithFileSystemPath(None,
+                "/tmp/pyobjc.test.pdf", kCFURLPOSIXPathStyle, False)
+        self.failUnlessIsInstance(url, CFURLRef)
+        context = CGPDFContextCreateWithURL(url,
+                ((0, 0), (1000, 1000)), None)
+        self.failUnlessIsInstance(context, CGContextRef)
+        try:
+            CGContextBeginPage(context, objc.NULL)
+
+            # XXX: This need actual tests, this at least tests that
+            # the contextmanagers can be used
+            with CGTransparencyLayer(context, None):
+                pass
+
+            with CGTransparencyLayer(context, None, ((10, 10), (200, 200))):
+                pass
+
+        finally:
+            CGContextEndPage(context)
+            if hasattr(Quartz, 'CGPDFContextClose'): CGPDFContextClose(context)
+            if os.path.exists("/tmp/pyobjc.test.pdf"):
+                os.unlink("/tmp/pyobjc.test.pdf")
+
     def testContextManager(self):
         """
         Tests for some additional functionality
@@ -421,13 +465,6 @@
             self.failUnlessEqual(tf, transform)
 
            
-            # XXX: This need actual tests, this at least tests that
-            # the contextmanagers can be used
-            with CGTransparencyLayer(context, None):
-                pass
-
-            with CGTransparencyLayer(context, None, ((10, 10), (200, 200))):
-                pass
 
 
             CGContextEndPage(context)
@@ -443,7 +480,7 @@
 
         finally:
             CGContextEndPage(context)
-            CGPDFContextClose(context)
+            if hasattr(Quartz, 'CGPDFContextClose'): CGPDFContextClose(context)
             if os.path.exists("/tmp/pyobjc.test.pdf"):
                 os.unlink("/tmp/pyobjc.test.pdf")
 

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgdataconsumer.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgdataconsumer.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgdataconsumer.py	Thu Oct 15 15:27:47 2009
@@ -1,6 +1,7 @@
 
 from PyObjCTools.TestSupport import *
-from Quartz.CoreGraphics import *
+from Quartz import *
+import Quartz
 from Foundation import NSMutableData
 import os
 
@@ -54,7 +55,7 @@
         CGContextFillRect(ctx, ((10, 10), (50, 30)))
         CGContextEndPage(ctx)
         CGContextFlush(ctx)
-        CGPDFContextClose(ctx)
+        if hasattr(Quartz, 'CGPDFContextClose'): CGPDFContextClose(ctx)
 
         del ctx
         del consumer

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgevent.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgevent.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgevent.py	Thu Oct 15 15:27:47 2009
@@ -8,13 +8,9 @@
         self.failUnlessIsCFType(CGEventSourceRef)
 
     def testMissing(self):
-        evt = CGEventCreateMouseEvent(None, kCGEventOtherMouseDown, (10, 20), 2)
+        evt = CGEventCreateMouseEvent(None, kCGEventLeftMouseDown, (80, 90), kCGMouseButtonLeft)
         self.failUnlessIsInstance(evt, CGEventRef)
 
-
-        v = CGEventGetUnflippedLocation(evt)
-        self.failUnlessIsInstance(v, CGPoint)
-
         self.failUnlessResultIsCFRetained(CGEventCreateSourceFromEvent)
         v = CGEventCreateSourceFromEvent(evt)
         self.failUnlessIsInstance(v, CGEventSourceRef)
@@ -26,7 +22,7 @@
 
         t = CGEventGetType(evt)
         self.failUnlessIsInstance(t, (int, long))
-        self.failUnlessEqual(t, kCGEventOtherMouseDown)
+        self.failUnlessEqual(t, kCGEventLeftMouseDown)
 
         CGEventSetType(evt, kCGEventOtherMouseUp)
         t = CGEventGetType(evt)
@@ -98,15 +94,20 @@
         evt = CGEventCreateKeyboardEvent(None, 45, False)
         self.failUnlessIsInstance(evt, CGEventRef)
 
+
+        v = CGEventCreateCopy(evt)
+        self.failUnlessIsInstance(v, CGEventRef)
+
+    @min_os_level('10.5')
+    def testFunctions10_5(self):
         self.failUnlessResultIsCFRetained(CGEventCreateScrollWheelEvent)
         evt = CGEventCreateScrollWheelEvent(None, kCGScrollEventUnitPixel, 2, 99, 44)
         self.failUnlessIsInstance(evt, CGEventRef)
         self.assertRaises(ValueError, CGEventCreateScrollWheelEvent, kCGScrollEventUnitPixel, 40, 2, 99)
         self.assertRaises(ValueError, CGEventCreateScrollWheelEvent, kCGScrollEventUnitPixel, 40, 2, 99, 100, 101)
-
-        v = CGEventCreateCopy(evt)
-        self.failUnlessIsInstance(v, CGEventRef)
         
+        v = CGEventGetUnflippedLocation(evt)
+        self.failUnlessIsInstance(v, CGPoint)
 
 if __name__ == "__main__":
     main()

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfont.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfont.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfont.py	Thu Oct 15 15:27:47 2009
@@ -27,6 +27,9 @@
 
 
 
+    @min_os_level('10.5')
+    # Most functions should work on 10.4 as well, except for the convenient 
+    # contruction functions
     def testFunctions(self):
         self.failUnlessIsInstance(CGFontGetTypeID(), (int, long))
 

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfunction.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfunction.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cgfunction.py	Thu Oct 15 15:27:47 2009
@@ -1,6 +1,7 @@
 
 from PyObjCTools.TestSupport import *
-from Quartz.CoreGraphics import *
+from Quartz import *
+import Quartz
 import os
 
 class TestCGFunction (TestCase):
@@ -39,7 +40,7 @@
             CGContextDrawShading(context, shading)
         finally:
             CGContextEndPage(context)
-            CGPDFContextClose(context)
+            if hasattr(Quartz, 'CGPDFContextClose'): CGPDFContextClose(context)
             if os.path.exists("/tmp/pyobjc.test.pdf"):
                 os.unlink("/tmp/pyobjc.test.pdf")
 

Modified: trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cggradient.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cggradient.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Quartz/PyObjCTest/test_cggradient.py	Thu Oct 15 15:27:47 2009
@@ -3,13 +3,16 @@
 from Quartz.CoreGraphics import *
 
 class TestCGGradient (TestCase):
+    @min_os_level('10.5')
     def testTypes(self):
         self.failUnlessIsCFType(CGGradientRef)
 
+    @min_os_level('10.5')
     def testConstants(self):
         self.failUnlessEqual(kCGGradientDrawsBeforeStartLocation, 1)
         self.failUnlessEqual(kCGGradientDrawsAfterEndLocation, 2)
 
+    @min_os_level('10.5')
     def testFunctions(self):
         self.failUnlessIsInstance(CGGradientGetTypeID(), (int, long))
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference