visu_actionInterface

visu_actionInterface — Interface for defining actions and events.

Functions

Types and Values

Description

These definitions are used to give a library and plateform independent simplified event handlers.

Functions

tool_simplified_events_new_fromGdk ()

gboolean
tool_simplified_events_new_fromGdk (ToolSimplifiedEvents *ev,
                                    const GdkEvent *event);

Transfer the given event into the internal ev structure.

Parameters

ev

a ToolSimplifiedEvents structure.

 

event

an incoming GdkEvent structure.

 

Returns

if the event ev is captured or not.

Since: 3.7

Types and Values

enum ToolButtonActionId

Value that can be put into field buttonType of structure ToolSimplifiedEvents.

Members

TOOL_BUTTON_TYPE_NONE

not a button event

 

TOOL_BUTTON_TYPE_PRESS

a press button event

 

TOOL_BUTTON_TYPE_RELEASE

a release button event

 

enum ToolSpecialKeyStroke

Possible non ascii keys used in ToolSimplifiedEvents.

Members

Key_None

no key pressed ;

 

Key_Page_Up

key up ;

 

Key_Page_Down

key down ;

 

Key_Arrow_Left

key left ;

 

Key_Arrow_Right

key right ;

 

Key_Arrow_Up

key up ;

 

Key_Arrow_Down

key down ;

 

Key_Menu

key menu.

 

struct ToolSimplifiedEvents

struct ToolSimplifiedEvents {
  int x, y;
  int root_x, root_y;
  guint button;
  ToolButtonActionId buttonType;
  gboolean shiftMod, controlMod;
  gboolean motion;
  char letter;
  ToolSpecialKeyStroke specialKey;
};

This structure is a common interface for events (inspired from X). We don't use the one introduced by GDK because we don't want this dependency be a limitation.

Members

int x;

the position x (on parent) for the event ;

 

int y;

the position y (on parent) for the event ;

 

int root_x;

the position x (in root window) for the event ;

 

int root_y;

the position y (in root window) for the event ;

 

guint button;

the number of the button, 0 if not a button event ;

 

ToolButtonActionId buttonType;

TOOL_BUTTON_TYPE_PRESS or TOOL_BUTTON_TYPE_RELEASE ;

 

gboolean shiftMod;

TRUE if Shift key is pressed during the event ;

 

gboolean controlMod;

TRUE if Control key is pressed during the event ;

 

gboolean motion;

TRUE if the event is a motion ;

 

char letter;

The value of the letter if the event is a key stroke '\0' if not ;

 

ToolSpecialKeyStroke specialKey;

the value of a special key if the event is a key stroke but not with an ascii letter.