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

Daniel Stone daniel at fooishbar.org
Thu Oct 20 06:03:25 PDT 2011


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?

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

Cheers,
Daniel


More information about the xorg-devel mailing list