CtkGesturePan

CtkGesturePan — Pan gesture

Functions

Properties

Signals

void pan Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── CtkEventController
        ╰── CtkGesture
            ╰── CtkGestureSingle
                ╰── CtkGestureDrag
                    ╰── CtkGesturePan

Includes

#include <ctk/ctk.h>

Description

CtkGesturePan is a CtkGesture implementation able to recognize pan gestures, those are drags that are locked to happen along one axis. The axis that a CtkGesturePan handles is defined at construct time, and can be changed through ctk_gesture_pan_set_orientation().

When the gesture starts to be recognized, CtkGesturePan will attempt to determine as early as possible whether the sequence is moving in the expected direction, and denying the sequence if this does not happen.

Once a panning gesture along the expected axis is recognized, the “pan” signal will be emitted as input events are received, containing the offset in the given axis.

Functions

ctk_gesture_pan_new ()

CtkGesture *
ctk_gesture_pan_new (CtkWidget *widget,
                     CtkOrientation orientation);

Returns a newly created CtkGesture that recognizes pan gestures.

Parameters

widget

a CtkWidget

 

orientation

expected orientation

 

Returns

a newly created CtkGesturePan

Since: 3.14


ctk_gesture_pan_get_orientation ()

CtkOrientation
ctk_gesture_pan_get_orientation (CtkGesturePan *gesture);

Returns the orientation of the pan gestures that this gesture expects.

Parameters

gesture

A CtkGesturePan

 

Returns

the expected orientation for pan gestures

Since: 3.14


ctk_gesture_pan_set_orientation ()

void
ctk_gesture_pan_set_orientation (CtkGesturePan *gesture,
                                 CtkOrientation orientation);

Sets the orientation to be expected on pan gestures.

Parameters

gesture

A CtkGesturePan

 

orientation

expected orientation

 

Since: 3.14

Types and Values

CtkGesturePan

typedef struct _CtkGesturePan CtkGesturePan;

enum CtkPanDirection

Describes the panning direction of a CtkGesturePan

Members

CTK_PAN_DIRECTION_LEFT

panned towards the left

 

CTK_PAN_DIRECTION_RIGHT

panned towards the right

 

CTK_PAN_DIRECTION_UP

panned upwards

 

CTK_PAN_DIRECTION_DOWN

panned downwards

 

Since: 3.14

Property Details

The “orientation” property

  “orientation”              CtkOrientation

The expected orientation of pan gestures.

Owner: CtkGesturePan

Flags: Read / Write

Default value: CTK_ORIENTATION_HORIZONTAL

Since: 3.14

Signal Details

The “pan” signal

void
user_function (CtkGesturePan  *gesture,
               CtkPanDirection direction,
               double          offset,
               gpointer        user_data)

This signal is emitted once a panning gesture along the expected axis is detected.

Parameters

gesture

The object which received the signal

 

direction

current direction of the pan gesture

 

offset

Offset along the gesture orientation

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.14