Gtk.Gesture_Swipe

Entities

Tagged Types

Access Types

Constants

Subprograms

Description

Gtk.Gesture_Swipe.Gtk_Gesture_Swipe is a Gtk.Gesture.Gtk_Gesture implementation able to recognize swipes, after a press/move/.../move/release sequence happens, the Gtk.Gesture_Swipe.Gtk_Gesture_Swipe::swipe signal will be emitted, providing the velocity and directionality of the sequence at the time it was lifted.

If the velocity is desired in intermediate points, Gtk.Gesture_Swipe.Get_Velocity can be called on eg. a Gtk.Gesture.Gtk_Gesture::update handler.

All velocities are reported in pixels/sec units.

Cb_GObject_Gdouble_Gdouble_Void

type Cb_GObject_Gdouble_Gdouble_Void is not null access procedure
  (Self       : access Glib.Object.GObject_Record'Class;
   Velocity_X : Gdouble;
   Velocity_Y : Gdouble);
Parameters
Self
Velocity_X
Velocity_Y

Cb_Gtk_Gesture_Swipe_Gdouble_Gdouble_Void

type Cb_Gtk_Gesture_Swipe_Gdouble_Gdouble_Void is not null access procedure
  (Self       : access Gtk_Gesture_Swipe_Record'Class;
   Velocity_X : Gdouble;
   Velocity_Y : Gdouble);
Parameters
Self
Velocity_X
Velocity_Y

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Velocity

function Get_Velocity
   (Self       : not null access Gtk_Gesture_Swipe_Record;
    Velocity_X : access Gdouble;
    Velocity_Y : access Gdouble) return Boolean

If the gesture is recognized, this function returns True and fill in Velocity_X and Velocity_Y with the recorded velocity, as per the last event(s) processed. Since: gtk+ 3.14

Parameters
Self
Velocity_X

return value for the velocity in the X axis, in pixels/sec

Velocity_Y

return value for the velocity in the Y axis, in pixels/sec

Return Value

whether velocity could be calculated

Gtk_Gesture_Swipe

type Gtk_Gesture_Swipe is access all Gtk_Gesture_Swipe_Record'Class;

Gtk_Gesture_Swipe_New

function Gtk_Gesture_Swipe_New
   (Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Gtk_Gesture_Swipe

Returns a newly created Gtk.Gesture.Gtk_Gesture that recognizes swipes. Since: gtk+ 3.14

Parameters
Widget

a Gtk.Widget.Gtk_Widget

Return Value

Gtk_Gesture_Swipe_Record

type Gtk_Gesture_Swipe_Record is new Gtk_Gesture_Single_Record with null record;

Gtk_New

procedure Gtk_New
   (Self   : out Gtk_Gesture_Swipe;
    Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class)

Returns a newly created Gtk.Gesture.Gtk_Gesture that recognizes swipes. Since: gtk+ 3.14 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self
Widget

a Gtk.Widget.Gtk_Widget

Initialize

procedure Initialize
   (Self   : not null access Gtk_Gesture_Swipe_Record'Class;
    Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class)

Returns a newly created Gtk.Gesture.Gtk_Gesture that recognizes swipes. Since: gtk+ 3.14 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self
Widget

a Gtk.Widget.Gtk_Widget

On_Swipe

procedure On_Swipe
   (Self  : not null access Gtk_Gesture_Swipe_Record;
    Call  : Cb_GObject_Gdouble_Gdouble_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

This signal is emitted when the recognized gesture is finished, velocity and direction are a product of previously recorded events.

Callback parameters: -- @param Velocity_X velocity in the X axis, in pixels/sec -- @param Velocity_Y velocity in the Y axis, in pixels/sec

Parameters
Self
Call
Slot
After

On_Swipe

procedure On_Swipe
   (Self  : not null access Gtk_Gesture_Swipe_Record;
    Call  : Cb_Gtk_Gesture_Swipe_Gdouble_Gdouble_Void;
    After : Boolean := False)

This signal is emitted when the recognized gesture is finished, velocity and direction are a product of previously recorded events.

Callback parameters: -- @param Velocity_X velocity in the X axis, in pixels/sec -- @param Velocity_Y velocity in the Y axis, in pixels/sec

Parameters
Self
Call
After

Signal_Swipe

Signal_Swipe : constant Glib.Signal_Name := "swipe";

This signal is emitted when the recognized gesture is finished, velocity and direction are a product of previously recorded events.

Callback parameters: -- @param Velocity_X velocity in the X axis, in pixels/sec -- @param Velocity_Y velocity in the Y axis, in pixels/sec