Event Structures: CDK 3 Reference Manual

## Event Structures Event Structures — Data structures specific to each type of event |

## Types and Values

union | CdkEvent
struct | CdkEventAny
struct | CdkEventKey
struct | CdkEventButton
struct | CdkEventTouch
struct | CdkEventScroll
struct | CdkEventMotion
struct | CdkEventExpose
struct | CdkEventVisibility
struct | CdkEventCrossing
struct | CdkEventFocus
struct | CdkEventConfigure
struct | CdkEventProperty
struct | CdkEventSelection
struct | CdkEventDND
struct | CdkEventProximity
struct | CdkEventWindowState
struct | CdkEventSetting
struct | CdkEventOwnerChange
struct | CdkEventGrabBroken
struct | CdkEventTouchpadSwipe
struct | CdkEventTouchpadPinch
struct | CdkEventPadButton
struct | CdkEventPadAxis
struct | CdkEventPadGroupMode
enum | CdkScrollDirection
enum | CdkVisibilityState
enum | CdkCrossingMode
enum | CdkNotifyType
enum | CdkPropertyState
enum | CdkWindowState
enum | CdkSettingAction
enum | CdkOwnerChange

## Includes

    #include <cdk/cdk.h>

## Description

The event structures contain data specific to each type of event in CDK.

> A common mistake is to forget to set the event mask of a widget so that the required events are received. See `ctk_widget_set_events()`.

## Functions

## Types and Values

### union CdkEvent

A CdkEvent contains a union of all of the event types, and allows access to the data fields in a number of ways.

The event type is always the first field in all of the event types, and can always be accessed with the following code, no matter what type of event it is:

    1
    2
    3
    4
    CdkEvent *event;
    CdkEventType type;

    type = event->type;

To access other fields of the event, the pointer to the event can be cast to the appropriate event type, or the union member name can be used. For example if the event type is `CDK_BUTTON_PRESS` then the x coordinate of the button press can be accessed with:

    1
    2
    3
    4
    CdkEvent *event;
    gdouble x;

    x = ((CdkEventButton*)event)->x;

or:

    1
    2
    3
    4
    CdkEvent *event;
    gdouble x;

    x = event->button.x;

#### Members

CdkEventType `type`; | the CdkEventType |
CdkEventAny `any`; | a CdkEventAny |
CdkEventExpose `expose`; | a CdkEventExpose |
CdkEventVisibility `visibility`; | a CdkEventVisibility |
CdkEventMotion `motion`; | a CdkEventMotion |
CdkEventButton `button`; | a CdkEventButton |
CdkEventTouch `touch`; | a CdkEventTouch |
CdkEventScroll `scroll`; | a CdkEventScroll |
CdkEventKey `key`; | a CdkEventKey |
CdkEventCrossing `crossing`; | a CdkEventCrossing |
CdkEventFocus `focus_change`; | a CdkEventFocus |
CdkEventConfigure `configure`; | a CdkEventConfigure |
CdkEventProperty `property`; | a CdkEventProperty |
CdkEventSelection `selection`; | a CdkEventSelection |
CdkEventOwnerChange `owner_change`; | a CdkEventOwnerChange |
CdkEventProximity `proximity`; | a CdkEventProximity |
CdkEventDND `dnd`; | a CdkEventDND |
CdkEventWindowState `window_state`; | a CdkEventWindowState |
CdkEventSetting `setting`; | a CdkEventSetting |
CdkEventGrabBroken `grab_broken`; | a CdkEventGrabBroken |
CdkEventTouchpadSwipe `touchpad_swipe`; | a CdkEventTouchpadSwipe |
CdkEventTouchpadPinch `touchpad_pinch`; | a CdkEventTouchpadPinch |
CdkEventPadButton `pad_button`; | a CdkEventPadButton |
CdkEventPadAxis `pad_axis`; | a CdkEventPadAxis |
CdkEventPadGroupMode `pad_group_mode`; | a CdkEventPadGroupMode |

### struct CdkEventAny

    struct CdkEventAny {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
    };

Contains the fields which are common to all event structs. Any event pointer can safely be cast to a pointer to a CdkEventAny to access these fields.

#### Members

CdkEventType `type`; | the type of the event. |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |

### struct CdkEventKey

    struct CdkEventKey {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      guint state;
      guint keyval;
      gint length;
      gchar *string;
      guint16 hardware_keycode;
      guint8 group;
      guint is_modifier : 1;
    };

Describes a key press or key release event.

#### Members

CdkEventType `type`; | the type of the event (`CDK_KEY_PRESS` or `CDK_KEY_RELEASE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]
guint `keyval`; | the key that was pressed or released. See the `cdk/cdkkeysyms.h` header file for a complete list of CDK key codes. |
gint `length`; | the length of `string` . |
gchar *`string`; | a string containing an approximation of the text that would result from this keypress. The only correct way to handle text input of text is using input methods (see CtkIMContext), so this field is deprecated and should never be used. (`cdk_unicode_to_keyval()` provides a non-deprecated way of getting an approximate translation for a key.) The string is encoded in the encoding of the current locale (Note: this for backwards compatibility: strings in CTK+ and CDK are typically in UTF-8.) and NUL-terminated. In some cases, the translation of the key code will be a single NUL byte, in which case looking at `length` is necessary to distinguish it from the an empty translation. |
guint16 `hardware_keycode`; | the raw code of the key that was pressed or released. |
guint8 `group`; | the keyboard group. |
guint `is_modifier` : 1; | a flag that indicates if `hardware_keycode` is mapped to a modifier. Since 2.10 |

### struct CdkEventButton

    struct CdkEventButton {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      gdouble x;
      gdouble y;
      gdouble *axes;
      guint state;
      guint button;
      CdkDevice *device;
      gdouble x_root, y_root;
    };

Used for button press and button release events. The `type` field will be one of `CDK_BUTTON_PRESS`, `CDK_2BUTTON_PRESS`, `CDK_3BUTTON_PRESS` or `CDK_BUTTON_RELEASE`,

Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:

- `CDK_BUTTON_PRESS`

- `CDK_BUTTON_RELEASE`

- `CDK_BUTTON_PRESS`

- `CDK_2BUTTON_PRESS`

- `CDK_BUTTON_RELEASE`

Note that the first click is received just like a normal button press, while the second click results in a `CDK_2BUTTON_PRESS` being received just after the `CDK_BUTTON_PRESS`.

Triple-clicks are very similar to double-clicks, except that `CDK_3BUTTON_PRESS` is inserted after the third click. The order of the events is:

- `CDK_BUTTON_PRESS`

- `CDK_BUTTON_RELEASE`

- `CDK_BUTTON_PRESS`

- `CDK_2BUTTON_PRESS`

- `CDK_BUTTON_RELEASE`

- `CDK_BUTTON_PRESS`

- `CDK_3BUTTON_PRESS`

- `CDK_BUTTON_RELEASE`

For a double click to occur, the second button press must occur within 1/4 of a second of the first. For a triple click to occur, the third button press must also occur within 1/2 second of the first button press.

#### Members

CdkEventType `type`; | the type of the event (`CDK_BUTTON_PRESS`, `CDK_2BUTTON_PRESS`, `CDK_3BUTTON_PRESS` or `CDK_BUTTON_RELEASE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
gdouble `x`; | the x coordinate of the pointer relative to the window. |
gdouble `y`; | the y coordinate of the pointer relative to the window. |
gdouble *`axes`; | `x` , `y` translated to the axes of `device` , or `NULL` if `device` is the mouse. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]
guint `button`; | the button which was pressed or released, numbered from 1 to 5. Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button. On 2-button mice, the middle button can often be simulated by pressing both mouse buttons together. |
CdkDevice *`device`; | the master device that the event originated from. Use `cdk_event_get_source_device()` to get the slave device. |
gdouble `x_root`; | the x coordinate of the pointer relative to the root of the screen. |
gdouble `y_root`; | the y coordinate of the pointer relative to the root of the screen. |

### struct CdkEventTouch

    struct CdkEventTouch {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      gdouble x;
      gdouble y;
      gdouble *axes;
      guint state;
      CdkEventSequence *sequence;
      gboolean emulating_pointer;
      CdkDevice *device;
      gdouble x_root, y_root;
    };

Used for touch events. `type` field will be one of `CDK_TOUCH_BEGIN`, `CDK_TOUCH_UPDATE`, `CDK_TOUCH_END` or `CDK_TOUCH_CANCEL`.

Touch events are grouped into sequences by means of the `sequence` field, which can also be obtained with `cdk_event_get_event_sequence()`. Each sequence begins with a `CDK_TOUCH_BEGIN` event, followed by any number of `CDK_TOUCH_UPDATE` events, and ends with a `CDK_TOUCH_END` (or `CDK_TOUCH_CANCEL`) event. With multitouch devices, there may be several active sequences at the same time.

#### Members

CdkEventType `type`; | the type of the event (`CDK_TOUCH_BEGIN`, `CDK_TOUCH_UPDATE`, `CDK_TOUCH_END`, `CDK_TOUCH_CANCEL`) |
CdkWindow *`window`; | the window which received the event |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
gdouble `x`; | the x coordinate of the pointer relative to the window |
gdouble `y`; | the y coordinate of the pointer relative to the window |
gdouble *`axes`; | `x` , `y` translated to the axes of `device` , or `NULL` if `device` is the mouse |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]
CdkEventSequence *`sequence`; | the event sequence that the event belongs to |
gboolean `emulating_pointer`; | whether the event should be used for emulating pointer event |
CdkDevice *`device`; | the master device that the event originated from. Use `cdk_event_get_source_device()` to get the slave device. |
gdouble `x_root`; | the x coordinate of the pointer relative to the root of the screen |
gdouble `y_root`; | the y coordinate of the pointer relative to the root of the screen |

### struct CdkEventScroll

    struct CdkEventScroll {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      gdouble x;
      gdouble y;
      guint state;
      CdkScrollDirection direction;
      CdkDevice *device;
      gdouble x_root, y_root;
      gdouble delta_x;
      gdouble delta_y;
      guint is_stop : 1;
    };

Generated from button presses for the buttons 4 to 7. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.

Some CDK backends can also generate “smooth” scroll events, which can be recognized by the `CDK_SCROLL_SMOOTH` scroll direction. For these, the scroll deltas can be obtained with `cdk_event_get_scroll_deltas()`.

#### Members

CdkEventType `type`; | the type of the event (`CDK_SCROLL`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
gdouble `x`; | the x coordinate of the pointer relative to the window. |
gdouble `y`; | the y coordinate of the pointer relative to the window. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]
CdkScrollDirection `direction`; | the direction to scroll to (one of `CDK_SCROLL_UP`, `CDK_SCROLL_DOWN`, `CDK_SCROLL_LEFT`, `CDK_SCROLL_RIGHT` or `CDK_SCROLL_SMOOTH`). |
CdkDevice *`device`; | the master device that the event originated from. Use `cdk_event_get_source_device()` to get the slave device. |
gdouble `x_root`; | the x coordinate of the pointer relative to the root of the screen. |
gdouble `y_root`; | the y coordinate of the pointer relative to the root of the screen. |
gdouble `delta_x`; | the x coordinate of the scroll delta |
gdouble `delta_y`; | the y coordinate of the scroll delta |
guint `is_stop` : 1; | `TRUE` if the event is a scroll stop event |

### struct CdkEventMotion

    struct CdkEventMotion {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      gdouble x;
      gdouble y;
      gdouble *axes;
      guint state;
      gint16 is_hint;
      CdkDevice *device;
      gdouble x_root, y_root;
    };

Generated when the pointer moves.

#### Members

CdkEventType `type`; | the type of the event. |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
gdouble `x`; | the x coordinate of the pointer relative to the window. |
gdouble `y`; | the y coordinate of the pointer relative to the window. |
gdouble *`axes`; | `x` , `y` translated to the axes of `device` , or `NULL` if `device` is the mouse. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]
gint16 `is_hint`; | set to 1 if this event is just a hint, see the `CDK_POINTER_MOTION_HINT_MASK` value of CdkEventMask. |
CdkDevice *`device`; | the master device that the event originated from. Use `cdk_event_get_source_device()` to get the slave device. |
gdouble `x_root`; | the x coordinate of the pointer relative to the root of the screen. |
gdouble `y_root`; | the y coordinate of the pointer relative to the root of the screen. |

### struct CdkEventExpose

    struct CdkEventExpose {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkRectangle area;
      cairo_region_t *region;
      gint count; /* If non-zero, how many more events follow. */
    };

Generated when all or part of a window becomes visible and needs to be redrawn.

#### Members

CdkEventType `type`; | the type of the event (`CDK_EXPOSE` or `CDK_DAMAGE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkRectangle `area`; | bounding box of `region` . |
cairo_region_t *`region`; | the region that needs to be redrawn. |
gint `count`; | the number of contiguous `CDK_EXPOSE` events following this one. The only use for this is “exposure compression”, i.e. handling all contiguous `CDK_EXPOSE` events in one go, though CDK performs some exposure compression so this is not normally needed. |

### struct CdkEventVisibility

    struct CdkEventVisibility {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkVisibilityState state;
    };

Generated when the window visibility status has changed.

#### Members

CdkEventType `type`; | the type of the event (`CDK_VISIBILITY_NOTIFY`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkVisibilityState `state`; | the new visibility state (`CDK_VISIBILITY_FULLY_OBSCURED`, `CDK_VISIBILITY_PARTIAL` or `CDK_VISIBILITY_UNOBSCURED`). |

### struct CdkEventCrossing

    struct CdkEventCrossing {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkWindow *subwindow;
      guint32 time;
      gdouble x;
      gdouble y;
      gdouble x_root;
      gdouble y_root;
      CdkCrossingMode mode;
      CdkNotifyType detail;
      gboolean focus;
      guint state;
    };

Generated when the pointer enters or leaves a window.

#### Members

CdkEventType `type`; | the type of the event (`CDK_ENTER_NOTIFY` or `CDK_LEAVE_NOTIFY`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkWindow *`subwindow`; | the window that was entered or left. |
guint32 `time`; | the time of the event in milliseconds. |
gdouble `x`; | the x coordinate of the pointer relative to the window. |
gdouble `y`; | the y coordinate of the pointer relative to the window. |
gdouble `x_root`; | the x coordinate of the pointer relative to the root of the screen. |
gdouble `y_root`; | the y coordinate of the pointer relative to the root of the screen. |
CdkCrossingMode `mode`; | the crossing mode (`CDK_CROSSING_NORMAL`, `CDK_CROSSING_GRAB`, `CDK_CROSSING_UNGRAB`, `CDK_CROSSING_CTK_GRAB`, `CDK_CROSSING_CTK_UNGRAB` or `CDK_CROSSING_STATE_CHANGED`). `CDK_CROSSING_CTK_GRAB`, `CDK_CROSSING_CTK_UNGRAB`, and `CDK_CROSSING_STATE_CHANGED` were added in 2.14 and are always synthesized, never native. |
CdkNotifyType `detail`; | the kind of crossing that happened (`CDK_NOTIFY_INFERIOR`, `CDK_NOTIFY_ANCESTOR`, `CDK_NOTIFY_VIRTUAL`, `CDK_NOTIFY_NONLINEAR` or `CDK_NOTIFY_NONLINEAR_VIRTUAL`). |
gboolean `focus`; | `TRUE` if `window` is the focus window or an inferior. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]

### struct CdkEventFocus

    struct CdkEventFocus {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      gint16 in;
    };

Describes a change of keyboard focus.

#### Members

CdkEventType `type`; | the type of the event (`CDK_FOCUS_CHANGE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
gint16 `in`; | `TRUE` if the window has gained the keyboard focus, `FALSE` if it has lost the focus. |

### struct CdkEventConfigure

    struct CdkEventConfigure {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      gint x, y;
      gint width;
      gint height;
    };

Generated when a window size or position has changed.

#### Members

CdkEventType `type`; | the type of the event (`CDK_CONFIGURE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
gint `x`; | the new x coordinate of the window, relative to its parent. |
gint `y`; | the new y coordinate of the window, relative to its parent. |
gint `width`; | the new width of the window. |
gint `height`; | the new height of the window. |

### struct CdkEventProperty

    struct CdkEventProperty {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkAtom atom;
      guint32 time;
      guint state;
    };

Describes a property change on a window.

#### Members

CdkEventType `type`; | the type of the event (`CDK_PROPERTY_NOTIFY`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkAtom `atom`; | the property that was changed. |
guint32 `time`; | the time of the event in milliseconds. |
guint `state`; | whether the property was changed (`CDK_PROPERTY_NEW_VALUE`) or deleted (`CDK_PROPERTY_DELETE`). | [type CdkPropertyState]

### struct CdkEventSelection

    struct CdkEventSelection {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkAtom selection;
      CdkAtom target;
      CdkAtom property;
      guint32 time;
      CdkWindow *requestor;
    };

Generated when a selection is requested or ownership of a selection is taken over by another client application.

#### Members

CdkEventType `type`; | the type of the event (`CDK_SELECTION_CLEAR`, `CDK_SELECTION_NOTIFY` or `CDK_SELECTION_REQUEST`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkAtom `selection`; | the selection. |
CdkAtom `target`; | the target to which the selection should be converted. |
CdkAtom `property`; | the property in which to place the result of the conversion. |
guint32 `time`; | the time of the event in milliseconds. |
CdkWindow *`requestor`; | the window on which to place `property` or `NULL` if none. |

### struct CdkEventDND

    struct CdkEventDND {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkDragContext *context;

      guint32 time;
      gshort x_root, y_root;
    };

Generated during DND operations.

#### Members

CdkEventType `type`; | the type of the event (`CDK_DRAG_ENTER`, `CDK_DRAG_LEAVE`, `CDK_DRAG_MOTION`, `CDK_DRAG_STATUS`, `CDK_DROP_START` or `CDK_DROP_FINISHED`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkDragContext *`context`; | the CdkDragContext for the current DND operation. |
guint32 `time`; | the time of the event in milliseconds. |
gshort `x_root`; | the x coordinate of the pointer relative to the root of the screen, only set for `CDK_DRAG_MOTION` and `CDK_DROP_START`. |
gshort `y_root`; | the y coordinate of the pointer relative to the root of the screen, only set for `CDK_DRAG_MOTION` and `CDK_DROP_START`. |

### struct CdkEventProximity

    struct CdkEventProximity {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      CdkDevice *device;
    };

Proximity events are generated when using CDK’s wrapper for the XInput extension. The XInput extension is an add-on for standard X that allows you to use nonstandard devices such as graphics tablets. A proximity event indicates that the stylus has moved in or out of contact with the tablet, or perhaps that the user’s finger has moved in or out of contact with a touch screen.

This event type will be used pretty rarely. It only is important for XInput aware programs that are drawing their own cursor.

#### Members

CdkEventType `type`; | the type of the event (`CDK_PROXIMITY_IN` or `CDK_PROXIMITY_OUT`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
CdkDevice *`device`; | the master device that the event originated from. Use `cdk_event_get_source_device()` to get the slave device. |

### struct CdkEventWindowState

    struct CdkEventWindowState {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkWindowState changed_mask;
      CdkWindowState new_window_state;
    };

Generated when the state of a toplevel window changes.

#### Members

CdkEventType `type`; | the type of the event (`CDK_WINDOW_STATE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkWindowState `changed_mask`; | mask specifying what flags have changed. |
CdkWindowState `new_window_state`; | the new window state, a combination of CdkWindowState bits. |

### struct CdkEventSetting

    struct CdkEventSetting {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkSettingAction action;
      char *name;
    };

Generated when a setting is modified.

#### Members

CdkEventType `type`; | the type of the event (`CDK_SETTING`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkSettingAction `action`; | what happened to the setting (`CDK_SETTING_ACTION_NEW`, `CDK_SETTING_ACTION_CHANGED` or `CDK_SETTING_ACTION_DELETED`). |
char *`name`; | the name of the setting. |

### struct CdkEventOwnerChange

    struct CdkEventOwnerChange {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      CdkWindow *owner;
      CdkOwnerChange reason;
      CdkAtom selection;
      guint32 time;
      guint32 selection_time;
    };

Generated when the owner of a selection changes. On X11, this information is only available if the X server supports the XFIXES extension.

#### Members

CdkEventType `type`; | the type of the event (`CDK_OWNER_CHANGE`). |
CdkWindow *`window`; | the window which received the event |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
CdkWindow *`owner`; | the new owner of the selection, or `NULL` if there is none |
CdkOwnerChange `reason`; | the reason for the ownership change as a CdkOwnerChange value |
CdkAtom `selection`; | the atom identifying the selection |
guint32 `time`; | the timestamp of the event |
guint32 `selection_time`; | the time at which the selection ownership was taken over |

Since: 2.6

### struct CdkEventGrabBroken

    struct CdkEventGrabBroken {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      gboolean keyboard;
      gboolean implicit;
      CdkWindow *grab_window;
    };

Generated when a pointer or keyboard grab is broken. On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again. Note that implicit grabs (which are initiated by button presses) can also cause CdkEventGrabBroken events.

#### Members

CdkEventType `type`; | the type of the event (`CDK_GRAB_BROKEN`) |
CdkWindow *`window`; | the window which received the event, i.e. the window that previously owned the grab |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
gboolean `keyboard`; | `TRUE` if a keyboard grab was broken, `FALSE` if a pointer grab was broken |
gboolean `implicit`; | `TRUE` if the broken grab was implicit |
CdkWindow *`grab_window`; | If this event is caused by another grab in the same application, `grab_window` contains the new grab window. Otherwise `grab_window` is `NULL`. |

Since: 2.8

### struct CdkEventTouchpadSwipe

    struct CdkEventTouchpadSwipe {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      gint8 phase;
      gint8 n_fingers;
      guint32 time;
      gdouble x;
      gdouble y;
      gdouble dx;
      gdouble dy;
      gdouble x_root, y_root;
      guint state;
    };

Generated during touchpad swipe gestures.

#### Members

CdkEventType `type`; | the type of the event (`CDK_TOUCHPAD_SWIPE`) |
CdkWindow *`window`; | the window which received the event |
gint8 `send_event`; | `TRUE` if the event was sent explicitly |
gint8 `phase`; | the current phase of the gesture |
gint8 `n_fingers`; | The number of fingers triggering the swipe |
guint32 `time`; | the time of the event in milliseconds |
gdouble `x`; | The X coordinate of the pointer |
gdouble `y`; | The Y coordinate of the pointer |
gdouble `dx`; | Movement delta in the X axis of the swipe focal point |
gdouble `dy`; | Movement delta in the Y axis of the swipe focal point |
gdouble `x_root`; | The X coordinate of the pointer, relative to the root of the screen. |
gdouble `y_root`; | The Y coordinate of the pointer, relative to the root of the screen. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]

### struct CdkEventTouchpadPinch

    struct CdkEventTouchpadPinch {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      gint8 phase;
      gint8 n_fingers;
      guint32 time;
      gdouble x;
      gdouble y;
      gdouble dx;
      gdouble dy;
      gdouble angle_delta;
      gdouble scale;
      gdouble x_root, y_root;
      guint state;
    };

Generated during touchpad swipe gestures.

#### Members

CdkEventType `type`; | the type of the event (`CDK_TOUCHPAD_PINCH`) |
CdkWindow *`window`; | the window which received the event |
gint8 `send_event`; | `TRUE` if the event was sent explicitly |
gint8 `phase`; | the current phase of the gesture |
gint8 `n_fingers`; | The number of fingers triggering the pinch |
guint32 `time`; | the time of the event in milliseconds |
gdouble `x`; | The X coordinate of the pointer |
gdouble `y`; | The Y coordinate of the pointer |
gdouble `dx`; | Movement delta in the X axis of the swipe focal point |
gdouble `dy`; | Movement delta in the Y axis of the swipe focal point |
gdouble `angle_delta`; | The angle change in radians, negative angles denote counter-clockwise movements |
gdouble `scale`; | The current scale, relative to that at the time of the corresponding `CDK_TOUCHPAD_GESTURE_PHASE_BEGIN` event |
gdouble `x_root`; | The X coordinate of the pointer, relative to the root of the screen. |
gdouble `y_root`; | The Y coordinate of the pointer, relative to the root of the screen. |
guint `state`; | a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See CdkModifierType. | [type CdkModifierType]

### struct CdkEventPadButton

    struct CdkEventPadButton {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      guint group;
      guint button;
      guint mode;
    };

Generated during `CDK_SOURCE_TABLET_PAD` button presses and releases.

#### Members

CdkEventType `type`; | the type of the event (`CDK_PAD_BUTTON_PRESS` or `CDK_PAD_BUTTON_RELEASE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
guint `group`; | the pad group the button belongs to. A `CDK_SOURCE_TABLET_PAD` device may have one or more groups containing a set of buttons/rings/strips each. |
guint `button`; | The pad button that was pressed. |
guint `mode`; | The current mode of `group` . Different groups in a `CDK_SOURCE_TABLET_PAD` device may have different current modes. |

Since: 3.22

### struct CdkEventPadAxis

    struct CdkEventPadAxis {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      guint group;
      guint index;
      guint mode;
      gdouble value;
    };

Generated during `CDK_SOURCE_TABLET_PAD` interaction with tactile sensors.

#### Members

CdkEventType `type`; | the type of the event (`CDK_PAD_RING` or `CDK_PAD_STRIP`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
guint `group`; | the pad group the ring/strip belongs to. A `CDK_SOURCE_TABLET_PAD` device may have one or more groups containing a set of buttons/rings/strips each. |
guint `index`; | number of strip/ring that was interacted. This number is 0-indexed. |
guint `mode`; | The current mode of `group` . Different groups in a `CDK_SOURCE_TABLET_PAD` device may have different current modes. |
gdouble `value`; | The current value for the given axis. |

Since: 3.22

### struct CdkEventPadGroupMode

    struct CdkEventPadGroupMode {
      CdkEventType type;
      CdkWindow *window;
      gint8 send_event;
      guint32 time;
      guint group;
      guint mode;
    };

Generated during `CDK_SOURCE_TABLET_PAD` mode switches in a group.

#### Members

CdkEventType `type`; | the type of the event (`CDK_PAD_GROUP_MODE`). |
CdkWindow *`window`; | the window which received the event. |
gint8 `send_event`; | `TRUE` if the event was sent explicitly. |
guint32 `time`; | the time of the event in milliseconds. |
guint `group`; | the pad group that is switching mode. A `CDK_SOURCE_TABLET_PAD` device may have one or more groups containing a set of buttons/rings/strips each. |
guint `mode`; | The new mode of `group` . Different groups in a `CDK_SOURCE_TABLET_PAD` device may have different current modes. |

Since: 3.22

### enum CdkScrollDirection

Specifies the direction for CdkEventScroll.

#### Members

CDK_SCROLL_UP | the window is scrolled up. |
CDK_SCROLL_DOWN | the window is scrolled down. |
CDK_SCROLL_LEFT | the window is scrolled to the left. |
CDK_SCROLL_RIGHT | the window is scrolled to the right. |
CDK_SCROLL_SMOOTH | the scrolling is determined by the delta values in CdkEventScroll. See `cdk_event_get_scroll_deltas()`. Since: 3.4 |

### enum CdkVisibilityState

Specifies the visiblity status of a window for a CdkEventVisibility.

#### Members

CDK_VISIBILITY_UNOBSCURED | the window is completely visible. |
CDK_VISIBILITY_PARTIAL | the window is partially visible. |
CDK_VISIBILITY_FULLY_OBSCURED | the window is not visible at all. |

### enum CdkCrossingMode

Specifies the crossing mode for CdkEventCrossing.

#### Members

CDK_CROSSING_NORMAL | crossing because of pointer motion. |
CDK_CROSSING_GRAB | crossing because a grab is activated. |
CDK_CROSSING_UNGRAB | crossing because a grab is deactivated. |
CDK_CROSSING_CTK_GRAB | crossing because a CTK+ grab is activated. |
CDK_CROSSING_CTK_UNGRAB | crossing because a CTK+ grab is deactivated. |
CDK_CROSSING_STATE_CHANGED | crossing because a CTK+ widget changed state (e.g. sensitivity). |
CDK_CROSSING_TOUCH_BEGIN | crossing because a touch sequence has begun, this event is synthetic as the pointer might have not left the window. |
CDK_CROSSING_TOUCH_END | crossing because a touch sequence has ended, this event is synthetic as the pointer might have not left the window. |
CDK_CROSSING_DEVICE_SWITCH | crossing because of a device switch (i.e. a mouse taking control of the pointer after a touch device), this event is synthetic as the pointer didn’t leave the window. |

### enum CdkNotifyType

Specifies the kind of crossing for CdkEventCrossing.

See the X11 protocol specification of LeaveNotify for full details of crossing event generation.

#### Members

CDK_NOTIFY_ANCESTOR | the window is entered from an ancestor or left towards an ancestor. |
CDK_NOTIFY_VIRTUAL | the pointer moves between an ancestor and an inferior of the window. |
CDK_NOTIFY_INFERIOR | the window is entered from an inferior or left towards an inferior. |
CDK_NOTIFY_NONLINEAR | the window is entered from or left towards a window which is neither an ancestor nor an inferior. |
CDK_NOTIFY_NONLINEAR_VIRTUAL | the pointer moves between two windows which are not ancestors of each other and the window is part of the ancestor chain between one of these windows and their least common ancestor. |
CDK_NOTIFY_UNKNOWN | an unknown type of enter/leave event occurred. |

### enum CdkPropertyState

Specifies the type of a property change for a CdkEventProperty.

#### Members

CDK_PROPERTY_NEW_VALUE | the property value was changed. |
CDK_PROPERTY_DELETE | the property was deleted. |

### enum CdkWindowState

Specifies the state of a toplevel window.

#### Members

CDK_WINDOW_STATE_WITHDRAWN | the window is not shown. |
CDK_WINDOW_STATE_ICONIFIED | the window is minimized. |
CDK_WINDOW_STATE_MAXIMIZED | the window is maximized. |
CDK_WINDOW_STATE_STICKY | the window is sticky. |
CDK_WINDOW_STATE_FULLSCREEN | the window is maximized without decorations. |
CDK_WINDOW_STATE_ABOVE | the window is kept above other windows. |
CDK_WINDOW_STATE_BELOW | the window is kept below other windows. |
CDK_WINDOW_STATE_FOCUSED | the window is presented as focused (with active decorations). |
CDK_WINDOW_STATE_TILED | the window is in a tiled state, Since 3.10. Since 3.22.23, this is deprecated in favor of per-edge information. |
CDK_WINDOW_STATE_TOP_TILED | whether the top edge is tiled, Since 3.22.23 |
CDK_WINDOW_STATE_TOP_RESIZABLE | whether the top edge is resizable, Since 3.22.23 |
CDK_WINDOW_STATE_RIGHT_TILED | whether the right edge is tiled, Since 3.22.23 |
CDK_WINDOW_STATE_RIGHT_RESIZABLE | whether the right edge is resizable, Since 3.22.23 |
CDK_WINDOW_STATE_BOTTOM_TILED | whether the bottom edge is tiled, Since 3.22.23 |
CDK_WINDOW_STATE_BOTTOM_RESIZABLE | whether the bottom edge is resizable, Since 3.22.23 |
CDK_WINDOW_STATE_LEFT_TILED | whether the left edge is tiled, Since 3.22.23 |
CDK_WINDOW_STATE_LEFT_RESIZABLE | whether the left edge is resizable, Since 3.22.23 |

### enum CdkSettingAction

Specifies the kind of modification applied to a setting in a CdkEventSetting.

#### Members

CDK_SETTING_ACTION_NEW | a setting was added. |
CDK_SETTING_ACTION_CHANGED | a setting was changed. |
CDK_SETTING_ACTION_DELETED | a setting was deleted. |

### enum CdkOwnerChange

Specifies why a selection ownership was changed.

#### Members

CDK_OWNER_CHANGE_NEW_OWNER | some other app claimed the ownership |
CDK_OWNER_CHANGE_DESTROY | the window was destroyed |
CDK_OWNER_CHANGE_CLOSE | the client was closed |