gdk: Shrink GdkTimeCoord

There is really no need to store 128 doubles as axes,
ever. We can do just fine with 10. At the same time,
add a GdkAxisFlags member, so we can interpret the
values without having to go chasing the right device
for this information.
This commit is contained in:
Matthias Clasen 2020-06-09 13:38:48 -04:00
parent 5f087a9dff
commit 693200f1eb

View File

@ -85,22 +85,20 @@ typedef enum {
GDK_DEVICE_TYPE_FLOATING
} GdkDeviceType;
/* We don't allocate each coordinate this big, but we use it to
* be ANSI compliant and avoid accessing past the defined limits.
*/
#define GDK_MAX_TIMECOORD_AXES 128
/**
* GdkTimeCoord:
* @time: The timestamp for this event.
* @axes: the values of the devices axes.
* @flags: Flags indicating what axes are present
* @axes: axis values
*
* A #GdkTimeCoord stores a single event in a motion history.
*/
struct _GdkTimeCoord
{
guint32 time;
gdouble axes[GDK_MAX_TIMECOORD_AXES];
GdkAxisFlags flags;
double axes[GDK_AXIS_LAST];
};
GDK_AVAILABLE_IN_ALL