|
From: Mojca M. <moj...@gm...> - 2012-06-25 16:26:28
|
On Mon, Jun 25, 2012 at 3:25 PM, <pl...@pi...> wrote:
> On 06/25/12 10:21, Mojca Miklavec wrote:
>> And related to your change: on Mac it is natural to use scrolling for
>> actually scrolling, since there are other events on trackpad which
>> allow zooming in (they work the same as maps on smart phones, using
>> two fingers and sliding them closer together or further apart).
>
> Does this work on gnuplot ?
Not yet. If I haven't lost it yet, I have a working code for Qt which
intercepts & interprets events (by printing out "this is zoom for W%
around point (X,Y), direction Z"), but I would need (for example your)
code to actually resize the plot/redraw contents. That is: I would
need a function in gnuplot which I could call to do the resizing.
> Do you know what event stream this two finger gesture sends to the
> program with the input focus?
It depends a bit. Here is one example program written in Qt:
http://qt-project.org/doc/qt-4.8/touch-pinchzoom.html
And here is some Cocoa documentation:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html
I don't believe that it would be possible to implement this in X11 (I
might be wrong), in Qt it would be easiest since Qt has up-to-date
support for all Mac OS X sugars, while in wxt it might be only
conditionally doable. Aqua needs mouse support in the first place.
> What point does it scroll on? Finger one; mid pt between fingers; screen
> centre ?
Are we talking about zooming in or moving contents around. If it is
about zooming in, Cocoa returns the middle point between fingers as
the center point, at least I think so. I never did any extensive
experiments, but I could try to play with your code and Qt a bit.
Mojca
PS: There is one minor "problem" though for which I don't think that
gnuplot could be tweaked easily. A smart application would move or
scale current picture during mouse movement without recalculating and
redrawing everything, and only redraw the final image once the mouse
movement is complete. I'm a bit afraid of big speed penalties if
smooth mouse movements are implemented without some intermediate
optimizations.
|