DiaEvent

DiaEvent — Events that can be send to a DiaCanvasItem.

Synopsis




enum        DiaEventType;
enum        DiaEventMask;
union       DiaEvent;
struct      DiaEventButton;
struct      DiaEventMotion;
struct      DiaEventKey;

Description

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).

Details

enum DiaEventType

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,
	DIA_EVENT_FOCUS_IN,
	DIA_EVENT_FOCUS_OUT
} DiaEventType;

The type of event.

DIA_EVENT_BUTTON_PRESSMouse button press.
DIA_EVENT_2BUTTON_PRESSMouse button double click.
DIA_EVENT_3BUTTON_PRESSMouse button triple click.
DIA_EVENT_BUTTON_RELEASEMouse button release.
DIA_EVENT_MOTIONThe mouse cursor has moved.
DIA_EVENT_KEY_PRESSA key is pressed.
DIA_EVENT_KEY_RELEASEA key is released.
DIA_EVENT_FOCUS_IN
DIA_EVENT_FOCUS_OUT

enum DiaEventMask

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

union DiaEvent {
	DiaEventType	type;
	DiaEventButton	button;
	DiaEventMotion	motion;
	DiaEventKey	key;
	DiaEventFocus	focus;
};


struct DiaEventButton

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

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.


struct DiaEventKey

struct DiaEventKey {

	DiaEventType	type;
	guint		keyval;	/* Use values from gdk/gdkkeysyms.h. */
	gint		length;
	gchar*		string;
	DiaEventMask	modifier;
};

Event emitted on a DIA_EVENT_KEY_PRESS or DIA_EVENT_KEY_RELEASE.

See Also

DiaCanvasItem