[PATCH libinput v2 5/5] libinput: add orientation and size of touch point and pressure to the API

Andreas Pokorny andreas.pokorny at canonical.com
Mon Jun 22 03:37:43 PDT 2015


Hi,


On Mon, Jun 22, 2015 at 3:37 AM, Peter Hutterer <peter.hutterer at who-t.net>
wrote:

> On Fri, Jun 19, 2015 at 03:24:38PM +0200, Andreas Pokorny wrote:
> > +      * */
> > +     if (orientation_info) {
> > +             if (orientation_info->maximum == 1 &&
> > +                 orientation_info->maximum == 0)
> > +                     return orientation == 0?90.0:0.0;
>
> spaces around ? and :
>
> > +     }
> > +     else
> > +             return DEFAULT_TOUCH_ORIENTATION;
>
> { } for if + else when either of them requires it, please check the
> CODING_STYLE document.
>

That info is not yet in the CODING_STYLE.



> > +}
> > +
> > +double
> > +evdev_device_transform_pressure(struct evdev_device *device,
> > +                             int32_t pressure)
> > +{
> > +     const struct input_absinfo *pressure_info =
> device->abs.absinfo_pressure;
> > +
> > +     if (pressure_info)
> > +             return (double)(pressure - pressure_info->minimum) /
> > +                     (pressure_info->maximum - pressure_info->minimum);
>
> tmp variable for min/max here too please
>
> > +                                       slot_data->pressure);
> >               break;
> >       case EVDEV_ABSOLUTE_MT_UP:
> >               if (!(device->seat_caps & EVDEV_DEVICE_TOUCH))
> > @@ -371,7 +447,9 @@ evdev_flush_pending_event(struct evdev_device
> *device, uint64_t time)
> >               point = device->abs.point;
> >               transform_absolute(device, &point);
> >
> > -             touch_notify_touch_down(base, time, -1, seat_slot, &point);
> > +             touch_notify_touch_down(base, time, -1, seat_slot, &point,
> > +                                     DEFAULT_TOUCH_MAJOR,l
> DEFAULT_TOUCH_MINOR,
>
> does this even compile?
>

ouch how embarrassing. I added that error while reiterating and cleaning
out (most) expanded tabs..


>
> > +                                     DEFAULT_TOUCH_ORIENTATION,
> DEFAULT_TOUCH_PRESSURE);
>
> one arg per line.
>

Ok - on that one I was about to do it, but hesitated as the existing code
wrapped in the middle of the parameter set.


> [...]
>
ok, I'm going to skip the rest. Please go through this patchset again and
> make sure you adhere to the coding style before resubmitting. The odd issue
> here and there is one thing, but having that many, including a compilation
> errors should not happen.
>

Fine, found some further violations - resending another version now. Thanks
for the review.

regards
Andreas Pokorny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150622/658b51f7/attachment.html>


More information about the wayland-devel mailing list