From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 14 Sep 2011 10:17:12 -0700 Message-ID: From: John Floren To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] plan9port: cocoa programmer needed Topicbox-Message-UUID: 1d7e636c-ead7-11e9-9d60-3106f5b1d025 On Tue, Sep 13, 2011 at 8:59 AM, david jeannot 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. =A0I just submitted it to Codereview: > > =A0 =A0 =A0 =A0http://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). =A0If 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. =A0So I > reimplemented swipe gestures with lower-level > touch events. =A0All 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". =A0The 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. =A0If you set the > "usecopygesture" variable as well, you have now > the following gestures: > > =A0 =A0 =A0 =A03-finger swipe-left to cut (cmd+x), > =A0 =A0 =A0 =A03-finger swipe-right to paste (cmd+v), > =A0 =A0 =A0 =A03-finger swipe-up to copy (cmd+c), > =A0 =A0 =A0 =A03-finger swipe-down to execute with arguments (2-1 chord), > =A0 =A0 =A0 =A03-finger tap to execute (button 2), > =A0 =A0 =A0 =A0pinch to toggle fullscreen. > > Else you have: > > =A0 =A0 =A0 swipe-left to cut (cmd+x), > =A0 =A0 =A0 swipe-right to paste (cmd+v), > =A0 =A0 =A0 swipe-up to execute (button 2), > =A0 =A0 =A0 swipe-down to execute with arguments (2-1 chord), > =A0 =A0 =A0 pinch to toggle fullscreen. > > In both cases, horizontal swipes cancel each > other if your fingers remain on the device in > between. =A0That is to say, the second swipe sends > undo (cmd+z): a command only recognized by Acme > currently. =A0An annoyance is the behavior of Acme's > Undo when we are in the window's tag. =A0Acme only > seems to undo filename change, else it undoes the > last change in the window's body. =A0For 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. =A0I knew > nothing of Mac programming before to begin this > project one month ago, and I certainly generalize > too much. =A0(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=3Dmultitouch) > > > 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. =A0This > 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. > > I just inherited a Macbook running Lion, so this is suddenly relevant to my interests. I'm very new to the world of OS X; could somebody put together a step-by-step on how to build for Lion? I've downloaded the plan9ports tarball, extracted it to /usr/local/plan9, and done an hg pull -u, but INSTALL dies with complaints from ld about a malformed TOC entry in libbio.a. Also, further up, when it tries to build devdraw I see it failing because it still tries to make the Carbon version. John