[PATCH 1/6] dix: add ScrollInfo to DeviceChangedEvents

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 20 16:57:11 PDT 2011


On Thu, Oct 20, 2011 at 02:03:25PM +0100, Daniel Stone wrote:
> Hi,
> 
> On Thu, Oct 20, 2011 at 04:25:41PM +1000, Peter Hutterer wrote:
> > @@ -482,6 +483,41 @@ appendValuatorInfo(DeviceChangedEvent *dce, xXIValuatorInfo *info, int axisnumbe
> >  }
> >  
> >  static int
> > +appendScrollInfo(DeviceChangedEvent *dce, xXIScrollInfo *info, int axisnumber)
> > +{
> > +    if (dce->valuators[axisnumber].scroll.type == SCROLL_TYPE_NONE)
> > +        return 0;
> > +
> > +    info->type = XIScrollClass;
> > +    info->length = sizeof(xXIScrollInfo)/4;
> > +    info->number = axisnumber;
> > +    switch(dce->valuators[axisnumber].scroll.type)
>              ^
>              space
> 
> > +    {
> > +        case SCROLL_TYPE_VERTICAL:
> > +            info->scroll_type = XIScrollTypeVertical;
> > +            break;
> > +        case SCROLL_TYPE_HORIZONTAL:
> > +            info->scroll_type = XIScrollTypeHorizontal;
> > +            break;
> > +        default:
> > +            ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n", dce->valuators[axisnumber].scroll.type);
> > +            break;
> > +    }
> > +    info->increment.integral = (int)dce->valuators[axisnumber].scroll.increment;
> > +    info->increment.frac = (unsigned int)dce->valuators[axisnumber].scroll.increment * (1UL << 16) * (1UL << 16);
> 
> This should be using double_to_fp3232, no?

yes, amended locally. this was obviously developed on a different branch that
didn't have the functions yet.

> Other than that:
> Reviewed-by: Daniel Stone <daniel at fooishbar.org>

thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list