Re: Touchpad gesture support (e.g. for zooming via touchpad pinch gestures)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomaž,

On 2022-08-25 20:23, Tomaž Vajngerl wrote:
> Hi,
> 
> On Thu, Aug 25, 2022 at 12:16 PM Povilas Kanapickas <povilas@xxxxxxxx
> <mailto:povilas@xxxxxxxx>> wrote:
> 
>     Hello,
> 
>     I would like to implement support for touchpad gesture handling to
>     LibreOffice. This is useful e.g. for zooming views using two-finger
>     pinch touchpad gesture or rotating objects using two-finger rotate
>     gesture.
> 
>     I have implemented this functionality in GIMP and would like to do the
>     same for LibreOffice. In LibreOffice case the implementation will be
>     more complex, as there are more backends than just GTK, but this will
>     just require more work.
> 
>     There is a proof of concept implementation that wires touchpad gestures
>     on GTK to the ViewShell widget. As a result it's possible to use
>     touchpad pinch gesture to zoom in-out the main slide in Impress.
> 
>     https://gerrit.libreoffice.org/c/core/+/138791/1
>     <https://gerrit.libreoffice.org/c/core/+/138791/1> (note that
>     implementation is split across 5 changes in the chain).
> 
>     Please let me know what do you think about this problem and the proof of
>     concept solution.
> 
> 
> Looks great.
> 
> The reason why GestureEvent is called so generally is that there should
> only be one common gesture event for all types of gestures - even if
> that would also mean it would have all the member variables of all the
> gestures - for simplicity. But I guess that approach is also ok...

Thanks a lot for very fast reply.

I can do either approach as you please. The reason why I created
separate event types for each gesture type was the experience when
implementing touchpad gestures for the X server. Putting all data into a
single struct becomes hard to manage in the end, because it's not
obvious what data each logical event carries and as consequence code
becomes error prone and harder to refactor.

Please let me know if I should just put everything into the Gesture
class though. You know better which approach will be easier to maintain
in the specific case of LibreOffice project.

Thanks a lot,
Povilas



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux