[Drawkit] Is it "Touch" time?
Brad Larson
larson at sonoplot.com
Mon Jul 27 16:35:42 PDT 2009
What Graham was referring to is the fact that DrawKit is built on
AppKit, with the base drawing elements and the like being descendants
of NSView. NSView and UIView (the iPhone UIKit's base UI element) are
completely different in terms of design, so porting the framework
across to the iPhone would require almost a complete rewrite. It
would also effectively split the framework into two incompatible
versions, one AppKit-based, and one UIKit-based.
A first step towards a cross-platform framework might be to
restructure it in terms of Core Animation layers. CALayer and
supporting Core Animation classes are pretty much identical between
Leopard and iPhone, so it gives an ideal opportunity for cross-
platform UI code. The layers also are very lightweight, and things
that currently bog down DrawKit (selection and editing of hundreds of
items) would no longer be a problem.
This is the approach we've taken with the Core Plot framework, an open
source data plotting / charting library:
http://code.google.com/p/core-plot/
We've abstracted away any platform-dependent drawing code so that Mac
and iPhone developers can use the exact same API for placing charts,
feeding them data, interacting with them, and customizing their
layout. These same abstractions could be applied here (even by
copying the BSD-licensed code we've created to do this).
Again, reshaping DrawKit in this form would be a massive undertaking.
It might be worth it, though, in terms of improved drawing performance
and the ability to work on iPhone OS devices. You also would gain the
ability to do slick animations for drawing, selection, or editing.
Of course, it would also require abandoning Tiger as a compatibility
target, but I don't think that will be that big of a problem going
forward.
On Jul 27, 2009, at 5:47 PM, Dick Applebaum wrote:
> Hi,
>
> I joined this list a while back, experimented with the package and
> really liked it. In fact, I used it to prototype several screens
> for an iPhone app I was thinking about writing.
>
> At that time, I posted a question asking, how difficult it would to
> port DrawKit to the iPhone.
>
> I was most interested in using the iPhone for manipulating drawings
> created elsewhere (on a Mac). On the iPhone I wanted to do things
> such as show/hide layers, zoom/scroll/pan, identify points, and
> calculate lengths between points.
>
> AIR, the response I got from Graham was that the iPhone OS did not
> contain the necessary APIs/Frameworks to facilitate porting-- making
> the port effort a major rewrite (and distraction).
>
> In the interim several things have happened:
>
> -- The iPhone Hardware has been improved, specifically CPU, GPU,
> Compass and Camera
> -- The iPhone OS has been enriched, incorporating more APIs from Mac
> OSX and new iPhone APIs and OpenGL ES 2.0
> -- Apple claims that much of SnowLeopard has been re-implemented in
> Cocoa
> -- Evidence is that Snow Leopard is incorporating some APIs and
> frameworks from the iPhone (they share some amount of a common code
> base)
>
>
> Now, there are lots of rumors that Apple will soon announce a
> MultiTouch 10" Tablet device for delivery this year (lots of
> supplier rumors support this).
>
> So, given this:
>
> Is it practical, and is it time to port DrawKit to the Touch
> interface?
>
> TIA
>
> Dick
>
______________________
Brad Larson, Ph.D.
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562
More information about the Drawkit
mailing list