Commit 94db5118 authored by Bernhard Link's avatar Bernhard Link

add new FRACTION16_16 type to better display fractions

parent c66eedaa
......@@ -856,6 +856,16 @@ static size_t print_parameters(struct connection *c,const unsigned char *buffer,
case ft_LISTofFIXED:
lastofs = printLISTofFIXED(c,buffer,len,p,stored,ofs);
continue;
case ft_FRACTION16_16:
if( ofs + 4 > len )
continue;
if( print_offsets )
fprintf(out,"[%d]",(int)ofs);
fputs(p->name,out);putc('=',out);
i16 = getCARD32(ofs);
u16 = getCARD32(ofs + 2);
fprintf(out,"%hd/%hu", i16, u16);
continue;
case ft_EVENT:
if( len >= ofs + 32 )
print_event(c,buffer+ofs);
......@@ -1012,6 +1022,7 @@ static size_t print_parameters(struct connection *c,const unsigned char *buffer,
case ft_GET:
case ft_SET:
case ft_EVENT:
case ft_FRACTION16_16:
case ft_FIXED:
case ft_LISTofFIXED:
assert(0);
......
......@@ -97,6 +97,8 @@ struct parameter {
ft_FIXED,
/* a list of those */
ft_LISTofFIXED,
/* fraction with nominator and denominator 16 bit */
ft_FRACTION16_16,
/* set stored value to specific value */
ft_SET
} type;
......
......@@ -1684,8 +1684,7 @@ REQUEST Bell
END
REQUEST ChangePointerControl
4 acceleration-numerator INT16
6 acceleration-denominator INT16
4 acceleration FRACTION16_16
8 threshold INT16
10 do-acceleration BOOL
11 do-threshold BOOL
......@@ -1694,8 +1693,7 @@ END
REQUEST GetPointerControl ALIASES Empty
RESPONSE GetPointerControl
8 acceleration-numerator CARD16
10 acceleration-denominator CARD16
8 acceleration FRACTION16_16
12 threshold CARD16
END
......
......@@ -89,6 +89,7 @@ static const struct base_type {
{ "FORMAT8", ft_FORMAT8, SETS_FORMAT, 1},
{ "BE32", ft_BE32, ALLOWS_CONSTANTS, 4},
{ "FIXED", ft_FIXED, 0, 4},
{ "FRACTION16_16", ft_FRACTION16_16, 0, 4},
{ "LISTofFIXED", ft_LISTofFIXED, USES_STORE|SETS_NEXT, 0},
{ "PUSH8", ft_PUSH8, PUSHES, 1},
{ "PUSH16", ft_PUSH16, PUSHES, 2},
......
......@@ -451,12 +451,6 @@ REQUEST SetDeviceFocus
13 device CARD8
END
# TODO: make that a built-in! (it can also be used in core)
STRUCT FRACTION length 4
0 numerator UINT16
2 denominator UINT16
END
LIST FEEDBACKSTATE variable min-length 4
# XIproto.ps has strange values here, XI.h looks more reasonable:
0 "feedback class" ENUM8 feedback_class
......@@ -474,7 +468,7 @@ SET_COUNTER 32
20 auto-repeats LISTofCARD8
ELSEIF 0 CARD8 1
# PTR
6 acceleration FRACTION
6 acceleration FRACTION16_16
10 treshold UINT16
NEXT 12
ELSEIF 0 CARD8 2
......@@ -530,7 +524,7 @@ IF 12 CARD8 0
ELSEIF 12 CARD8 1
# PTR
4 mask BITMASK32 dv_pointer
18 acceleration FRACTION
18 acceleration FRACTION16_16
22 treshold UINT16
ELSEIF 12 CARD8 2
# STRING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment