summaryrefslogtreecommitdiff
path: root/gdk/gdkeventsprivate.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-17 23:08:44 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-21 00:51:03 -0500
commit6fd913b36188ea1c8666472583f10c0c7c638f0f (patch)
tree1da838e44918ffbd9cf5605131c7a3ef7a7f3fe1 /gdk/gdkeventsprivate.h
parent84edce37324090a18e195b1648d6e12b7e2f27d7 (diff)
downloadgtk+-6fd913b36188ea1c8666472583f10c0c7c638f0f.tar.gz
Some event struct packing improvements
Rearrange a few things, and move some booleans into the Any struct, by using a bitfield there. Some more cleanup could be done - the flags field with its PENDING and FLUSHED members appears entirely unused. Nobody is setting those flags.
Diffstat (limited to 'gdk/gdkeventsprivate.h')
-rw-r--r--gdk/gdkeventsprivate.h40
1 files changed, 15 insertions, 25 deletions
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index b3b389319f..7f7d7ffe73 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -45,7 +45,13 @@ struct _GdkEventAny
int ref_count;
GdkEventType type;
GdkSurface *surface;
+ guint32 time;
guint16 flags;
+ guint pointer_emulated : 1;
+ guint touch_emulating : 1;
+ guint scroll_is_stop : 1;
+ guint key_is_modifier : 1;
+ guint focus_in : 1;
GdkDevice *device;
GdkDevice *source_device;
};
@@ -72,11 +78,10 @@ struct _GdkEventAny
struct _GdkEventMotion
{
GdkEventAny any;
- guint32 time;
+ GdkModifierType state;
double x;
double y;
double *axes;
- GdkModifierType state;
GdkDeviceTool *tool;
GList *history;
};
@@ -108,12 +113,11 @@ struct _GdkEventMotion
struct _GdkEventButton
{
GdkEventAny any;
- guint32 time;
+ GdkModifierType state;
+ guint button;
double x;
double y;
double *axes;
- GdkModifierType state;
- guint button;
GdkDeviceTool *tool;
};
@@ -152,13 +156,11 @@ struct _GdkEventButton
struct _GdkEventTouch
{
GdkEventAny any;
- guint32 time;
+ GdkModifierType state;
double x;
double y;
double *axes;
- GdkModifierType state;
GdkEventSequence *sequence;
- gboolean emulating_pointer;
};
/*
@@ -192,14 +194,12 @@ struct _GdkEventTouch
struct _GdkEventScroll
{
GdkEventAny any;
- guint32 time;
double x;
double y;
GdkModifierType state;
GdkScrollDirection direction;
double delta_x;
double delta_y;
- guint is_stop : 1;
GdkDeviceTool *tool;
};
@@ -225,13 +225,11 @@ struct _GdkEventScroll
struct _GdkEventKey
{
GdkEventAny any;
- guint32 time;
GdkModifierType state;
guint keyval;
guint16 hardware_keycode;
guint16 key_scancode;
guint8 group;
- guint is_modifier : 1;
};
/*
@@ -261,14 +259,13 @@ struct _GdkEventKey
struct _GdkEventCrossing
{
GdkEventAny any;
- GdkSurface *child_surface;
- guint32 time;
+ GdkModifierType state;
+ GdkCrossingMode mode;
double x;
double y;
- GdkCrossingMode mode;
GdkNotifyType detail;
gboolean focus;
- GdkModifierType state;
+ GdkSurface *child_surface;
};
/*
@@ -334,7 +331,6 @@ struct _GdkEventConfigure
struct _GdkEventProximity
{
GdkEventAny any;
- guint32 time;
GdkDeviceTool *tool;
};
@@ -378,7 +374,6 @@ struct _GdkEventGrabBroken {
struct _GdkEventDND {
GdkEventAny any;
GdkDrop *drop;
- guint32 time;
double x;
double y;
};
@@ -403,14 +398,13 @@ struct _GdkEventDND {
*/
struct _GdkEventTouchpadSwipe {
GdkEventAny any;
+ GdkModifierType state;
gint8 phase;
gint8 n_fingers;
- guint32 time;
double x;
double y;
double dx;
double dy;
- GdkModifierType state;
};
/*
@@ -437,16 +431,15 @@ struct _GdkEventTouchpadSwipe {
*/
struct _GdkEventTouchpadPinch {
GdkEventAny any;
+ GdkModifierType state;
gint8 phase;
gint8 n_fingers;
- guint32 time;
double x;
double y;
double dx;
double dy;
double angle_delta;
double scale;
- GdkModifierType state;
};
/*
@@ -465,7 +458,6 @@ struct _GdkEventTouchpadPinch {
*/
struct _GdkEventPadButton {
GdkEventAny any;
- guint32 time;
guint group;
guint button;
guint mode;
@@ -489,7 +481,6 @@ struct _GdkEventPadButton {
*/
struct _GdkEventPadAxis {
GdkEventAny any;
- guint32 time;
guint group;
guint index;
guint mode;
@@ -512,7 +503,6 @@ struct _GdkEventPadAxis {
*/
struct _GdkEventPadGroupMode {
GdkEventAny any;
- guint32 time;
guint group;
guint mode;
};