| DiaCanvas2 Reference Manual: Version 0.9.0 | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
enum DiaEventType; enum DiaEventMask; union DiaEvent; struct DiaEventButton; struct DiaEventMotion; struct DiaEventKey; |
DiaEvent contains a subset of GdkEvent that is tailored to the needs of the DiaCanvasItem. Some events have extra options (like DiaEventMotion, which has (dx, dy) attributes).
typedef enum {
DIA_EVENT_BUTTON_PRESS,
DIA_EVENT_2BUTTON_PRESS, /* double click */
DIA_EVENT_3BUTTON_PRESS, /* triple click */
DIA_EVENT_BUTTON_RELEASE,
DIA_EVENT_MOTION,
DIA_EVENT_KEY_PRESS,
DIA_EVENT_KEY_RELEASE,
} DiaEventType; |
The type of event.
| DIA_EVENT_BUTTON_PRESS | Mouse button press. |
| DIA_EVENT_2BUTTON_PRESS | Mouse button double click. |
| DIA_EVENT_3BUTTON_PRESS | Mouse button triple click. |
| DIA_EVENT_BUTTON_RELEASE | Mouse button release. |
| DIA_EVENT_MOTION | The mouse cursor has moved. |
| DIA_EVENT_KEY_PRESS | A key is pressed. |
| DIA_EVENT_KEY_RELEASE | A key is released. |
typedef enum {
DIA_EVENT_MASK_SHIFT = 1 << 0,
DIA_EVENT_MASK_LOCK = 1 << 1,
DIA_EVENT_MASK_CTRL = 1 << 2,
DIA_EVENT_MASK_MOD1 = 1 << 3,
DIA_EVENT_MASK_ALT = DIA_EVENT_MASK_MOD1,
DIA_EVENT_MASK_MOD2 = 1 << 4,
DIA_EVENT_MASK_MOD3 = 1 << 5,
DIA_EVENT_MASK_MOD4 = 1 << 6,
DIA_EVENT_MASK_MOD5 = 1 << 7,
DIA_EVENT_MASK_BUTTON1 = 1 << 8,
DIA_EVENT_MASK_BUTTON2 = 1 << 9,
DIA_EVENT_MASK_BUTTON3 = 1 << 10,
DIA_EVENT_MASK_BUTTON4 = 1 << 11,
DIA_EVENT_MASK_BUTTON5 = 1 << 12,
} DiaEventMask; |
union DiaEvent {
DiaEventType type;
DiaEventButton button;
DiaEventMotion motion;
DiaEventKey key;
}; |
struct DiaEventButton {
DiaEventType type;
gdouble x;
gdouble y;
DiaEventMask modifier;
guint button;
}; |
Event send on a DIA_EVENT_BUTTON_PRESS, DIA_EVENT_2BUTTON_PRESS, DIA_EVENT_3BUTTON_PRESS or DIA_EVENT_BUTTON_RELEASE.
struct DiaEventMotion {
DiaEventType type;
gdouble x;
gdouble y;
DiaEventMask modifier;
gdouble dx; /* in item relative coordinates */
gdouble dy;
}; |
Event emitted on a DIA_EVENT_MOTION.