Thanks for all of your work on this!

On Tue, Sep 13, 2011 at 8:59 AM, david jeannot <djeannot24@gmail.com> wrote:
> So I will send my code in the next few days,
> unless there is a need.

I'm 9 days late, but here it is: the Cocoa version
of Devdraw.  I just submitted it to Codereview:

       http://codereview.appspot.com/5015042

I removed live resizing, because I found no way to
make it perfect: the window now becomes gray while
resizing.


About gestures now.

A swipe gesture needs 3 fingers (with trackpads at
least).  If you want to use them, you must
reconfigure OS X Lion to use 4 fingers instead of
3 (to swipe between spaces, or to swipe to
"Mission Control" for example).

As previously discussed, OS X Lion doesn't send
swipe events anymore for vertical swipes.  So I
reimplemented swipe gestures with lower-level
touch events.  All that I can say is that it works
well with a late 2010 MacBook Air's trackpad.
Unfortunately, it seems only for trackpads: not
for "Magic Mouse".  The higher-level gesture
events seem compatible with "Magic Mouse" (though
I don't know to how many fingers a swipe gesture
corresponds), but the lower-level touch events
seem incompatible (I may be mistaken).

If you want to use the reimplemented swipes, you
have to set the "reimplementswipe" variable at the
beginning of cocoa-screen.m (the file's name may
change soon).

One advantage of this reimplementation is that we
can now detect 3-finger taps.  If you set the
"usecopygesture" variable as well, you have now
the following gestures:

       3-finger swipe-left to cut (cmd+x),
       3-finger swipe-right to paste (cmd+v),
       3-finger swipe-up to copy (cmd+c),
       3-finger swipe-down to execute with arguments (2-1 chord),
       3-finger tap to execute (button 2),
       pinch to toggle fullscreen.

Else you have:

      swipe-left to cut (cmd+x),
      swipe-right to paste (cmd+v),
      swipe-up to execute (button 2),
      swipe-down to execute with arguments (2-1 chord),
      pinch to toggle fullscreen.

In both cases, horizontal swipes cancel each
other if your fingers remain on the device in
between.  That is to say, the second swipe sends
undo (cmd+z): a command only recognized by Acme
currently.  An annoyance is the behavior of Acme's
Undo when we are in the window's tag.  Acme only
seems to undo filename change, else it undoes the
last change in the window's body.  For example, if
you want to copy from the tag, (unless you use the
copy gesture) you will have to lift the fingers
between the left and the right swipe, else it will
undo the window's body, and you will be completely
puzzled.

I wish this announcement will not cause too much
disappointment among "Magic Mouse" users.  I knew
nothing of Mac programming before to begin this
project one month ago, and I certainly generalize
too much.  (I didn't understood what was the
mysterious "multitouch" code in Carbon's Devdraw,
until some days ago, where I fell upon a similar
code to communicate with the "Magic Mouse" here:
http://www.iphonesmartapps.org/aladino/?a=multitouch)


If OS X Lion's users prefer the old fullscreen
mode, they can set the "useoldfullscreen"
variable.

(Currently, Devdraw can't accept arguments, and as
it is so hard to compile anything with current
Xcode 4.1, I didn't try to modify Libdraw.  This
is why you have to set variables instead of using
optional arguments.)


Be sure to read the description on Codereview for
the remaining bugs, to avoid further
disappointment.


If you need binaries running on Lion (Cocoa's
Devdraw, Acme supporting "cmd+z", etc.), I will be
happy to provide them.