--- enthought/kiva/backend_wx.py.orig	2010-11-10 09:15:18.000000000 +0100
+++ enthought/kiva/backend_wx.py	2010-11-10 10:48:24.000000000 +0100
@@ -141,156 +141,35 @@
         return
         
 
-
-# Define a different base class depending on the platform.
-
-if sys.platform == 'darwin':
-    from mac import get_macport, ABCGI
-    from mac.ABCGI import CGBitmapContext, CGImage, CGImageFile, \
-        CGLayerContext, CGMutablePath
-
-    # The Mac backend only supports numpy.
-    import numpy as np
-
-    if wx.VERSION[:2] == (2, 6):
-        def gc_for_dc(dc):
-            """ Return the CGContext corresponding to the given wx.DC.
-            """
-            port = get_macport(dc)
-            return ABCGI.CGContextForPort(port)
-
-    elif wx.VERSION[:2] == (2, 8):
-        class UnflippingCGContext(ABCGI.CGContextInABox):
-            """ Vertically flip the context to undo wx's flipping.
-            """
-
-            def __init__(self, *args, **kwds):
-                ABCGI.CGContextInABox.__init__(self, *args, **kwds)
-                self._begun = False
-
-            def begin(self):
-                if self._begun:
-                    return
-                self.save_state()
-                self.translate_ctm(0, self.height())
-                self.scale_ctm(1.0, -1.0)
-                self._begun = True
-
-            def end(self):
-                if self._begun:
-                    self.restore_state()
-                    self._begun = False
-
-        def gc_for_dc(dc):
-            """ Return the CGContext corresponding to the given wx.DC.
-            """
-            pointer = get_macport(dc)
-            gc = UnflippingCGContext(pointer, dc.GetSizeTuple())
-            return gc
-
-
-    CompiledPath = CGMutablePath
-    Image = CGImageFile
-
-    class GraphicsContext(CGLayerContext):
-        def __init__(self, size_or_array, window_gc=None, *args, **kwds):
-            gc = window_gc 
-            if not gc:
-                # Create a tiny base context to spawn the CGLayerContext from.
-                # We are better off making our Layer from the window gc since
-                # the data formats will match and so it will be faster to draw the
-                # layer.
-                gc = CGBitmapContext((1,1))
-            if isinstance(size_or_array, np.ndarray):
-                # Initialize the layer with an image.
-                image = CGImage(size_or_array)
-                width = image.width
-                height = image.height
-            else:
-                # No initialization.
-                image = None
-                width, height = size_or_array
-            CGLayerContext.__init__(self, gc,
-                (width, height))
-            if image is not None:
-                self.draw_image(image)
-
-        @classmethod
-        def create_from_gc(klass, gc, size_or_array, *args, **kwds):
-            return klass(size_or_array, gc, *args, **kwds)
-
-    class Canvas(BaseWxCanvas, WidgetClass):
-        """ Mac wx Kiva canvas.
-        """
-        def __init__(self, parent, id = 01, size = wx.DefaultSize):
-            # need to init self.memDC before calling BaseWxCanvas.__init__ 
-            self.memDC = wx.MemoryDC()
-            self._size = (size.GetWidth(), size.GetHeight())
-            WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, 
-                                 wx.SUNKEN_BORDER | wx.WANTS_CHARS | \
-                                 wx.FULL_REPAINT_ON_RESIZE )
-            BaseWxCanvas.__init__(self)
-            return
-        
-        def _create_kiva_gc(self, size):
-            self._size = size
-            self.bitmap = wx.EmptyBitmap(size[0], size[1])
-            self.memDC.SelectObject(self.bitmap)
-            gc = gc_for_dc(self.memDC)
-            #gc.begin()
-            #print " **** gc is:", gc
-            return gc
-        
-        def blit(self, event):
-            t1 = now()
-            paintdc = wx.PaintDC(self)
-            paintdc.Blit(0, 0, self._size[0], self._size[1],
-                         self.memDC, 0, 0)
-            t2 = now()
-            self.blit_time = t2 - t1
-            self.dirty = 0
-            return
-            
-        def draw(self):
-            t1 = now()
-            self.gc.begin()
-            self.do_draw(self.gc)
-            self.gc.end()
-            t2 = now()
-            self.draw_time = t2-t1
-            return
-        
-
-else:
-    # the GraphicsContextSystem stuff should eventually be moved out of the
-    # image backend.
-    from backend_image import GraphicsContextSystem as GraphicsContext
-    from agg import CompiledPath
-
-    class Canvas(BaseWxCanvas, WidgetClass):
-        "The basic wx Kiva canvas."
-        def __init__(self, parent, id = -1, size = wx.DefaultSize):
-            WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, 
-                                 wx.SUNKEN_BORDER | wx.WANTS_CHARS | \
-                                 wx.FULL_REPAINT_ON_RESIZE )
-            BaseWxCanvas.__init__(self)
-            return
+# the GraphicsContextSystem stuff should eventually be moved out of the
+# image backend.
+from backend_image import GraphicsContextSystem as GraphicsContext
+from agg import CompiledPath
+
+class Canvas(BaseWxCanvas, WidgetClass):
+    "The basic wx Kiva canvas."
+    def __init__(self, parent, id = -1, size = wx.DefaultSize):
+        WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, 
+                             wx.SUNKEN_BORDER | wx.WANTS_CHARS |
+                             wx.FULL_REPAINT_ON_RESIZE )
+        BaseWxCanvas.__init__(self)
+        return
     
-        def _create_kiva_gc(self, size):
-            return GraphicsContext(size)
+    def _create_kiva_gc(self, size):
+        return GraphicsContext(size)
     
-        def blit(self, event):
-            t1 = now()
+    def blit(self, event):
+        t1 = now()
     
-            if self._dc is None:
-                self._dc = wx.PaintDC(self)
-            self.gc.pixel_map.draw_to_wxwindow(self, 0, 0)
-            self._dc = None
+        if self._dc is None:
+            self._dc = wx.PaintDC(self)
+        self.gc.pixel_map.draw_to_wxwindow(self, 0, 0)
+        self._dc = None
     
-            t2 = now()
-            self.blit_time = t2-t1
-            self.dirty = 0
-            return
+        t2 = now()
+        self.blit_time = t2-t1
+        self.dirty = 0
+        return
 
 def font_metrics_provider():
     gc = GraphicsContext((1, 1))
