1------------------------------------------------------------------------------
2--                                                                          --
3--      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       --
4--                     Copyright (C) 2000-2015, AdaCore                     --
5--                                                                          --
6-- This library is free software;  you can redistribute it and/or modify it --
7-- under terms of the  GNU General Public License  as published by the Free --
8-- Software  Foundation;  either version 3,  or (at your  option) any later --
9-- version. This library is distributed in the hope that it will be useful, --
10-- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- --
11-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            --
12--                                                                          --
13-- As a special exception under Section 7 of GPL version 3, you are granted --
14-- additional permissions described in the GCC Runtime Library Exception,   --
15-- version 3.1, as published by the Free Software Foundation.               --
16--                                                                          --
17-- You should have received a copy of the GNU General Public License and    --
18-- a copy of the GCC Runtime Library Exception along with this program;     --
19-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
20-- <http://www.gnu.org/licenses/>.                                          --
21--                                                                          --
22------------------------------------------------------------------------------
23
24--  <description>
25--  Gtk.Gesture_Long_Press.Gtk_Gesture_Long_Press is a Gtk.Gesture.Gtk_Gesture
26--  implementation able to recognize long presses, triggering the
27--  Gtk.Gesture_Long_Press.Gtk_Gesture_Long_Press::pressed after the timeout is
28--  exceeded.
29--
30--  If the touchpoint is lifted before the timeout passes, or if it drifts too
31--  far of the initial press point, the
32--  Gtk.Gesture_Long_Press.Gtk_Gesture_Long_Press::cancelled signal will be
33--  emitted.
34--
35--  </description>
36pragma Ada_2005;
37
38pragma Warnings (Off, "*is already use-visible*");
39with Glib;               use Glib;
40with Glib.Object;        use Glib.Object;
41with Gtk.Gesture_Single; use Gtk.Gesture_Single;
42with Gtk.Widget;         use Gtk.Widget;
43
44package Gtk.Gesture_Long_Press is
45
46   type Gtk_Gesture_Long_Press_Record is new Gtk_Gesture_Single_Record with null record;
47   type Gtk_Gesture_Long_Press is access all Gtk_Gesture_Long_Press_Record'Class;
48
49   ------------------
50   -- Constructors --
51   ------------------
52
53   procedure Gtk_New
54      (Self   : out Gtk_Gesture_Long_Press;
55       Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class);
56   procedure Initialize
57      (Self   : not null access Gtk_Gesture_Long_Press_Record'Class;
58       Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class);
59   --  Returns a newly created Gtk.Gesture.Gtk_Gesture that recognizes long
60   --  presses.
61   --  Since: gtk+ 3.14
62   --  "widget": a Gtk.Widget.Gtk_Widget
63
64   function Gtk_Gesture_Long_Press_New
65      (Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class)
66       return Gtk_Gesture_Long_Press;
67   --  Returns a newly created Gtk.Gesture.Gtk_Gesture that recognizes long
68   --  presses.
69   --  Since: gtk+ 3.14
70   --  "widget": a Gtk.Widget.Gtk_Widget
71
72   function Get_Type return Glib.GType;
73   pragma Import (C, Get_Type, "gtk_gesture_long_press_get_type");
74
75   -------------
76   -- Signals --
77   -------------
78
79   type Cb_Gtk_Gesture_Long_Press_Void is not null access procedure
80     (Self : access Gtk_Gesture_Long_Press_Record'Class);
81
82   type Cb_GObject_Void is not null access procedure
83     (Self : access Glib.Object.GObject_Record'Class);
84
85   Signal_Cancelled : constant Glib.Signal_Name := "cancelled";
86   procedure On_Cancelled
87      (Self  : not null access Gtk_Gesture_Long_Press_Record;
88       Call  : Cb_Gtk_Gesture_Long_Press_Void;
89       After : Boolean := False);
90   procedure On_Cancelled
91      (Self  : not null access Gtk_Gesture_Long_Press_Record;
92       Call  : Cb_GObject_Void;
93       Slot  : not null access Glib.Object.GObject_Record'Class;
94       After : Boolean := False);
95   --  This signal is emitted whenever a press moved too far, or was released
96   --  before Gtk.Gesture_Long_Press.Gtk_Gesture_Long_Press:pressed happened.
97
98   type Cb_Gtk_Gesture_Long_Press_Gdouble_Gdouble_Void is not null access procedure
99     (Self : access Gtk_Gesture_Long_Press_Record'Class;
100      X    : Gdouble;
101      Y    : Gdouble);
102
103   type Cb_GObject_Gdouble_Gdouble_Void is not null access procedure
104     (Self : access Glib.Object.GObject_Record'Class;
105      X    : Gdouble;
106      Y    : Gdouble);
107
108   Signal_Pressed : constant Glib.Signal_Name := "pressed";
109   procedure On_Pressed
110      (Self  : not null access Gtk_Gesture_Long_Press_Record;
111       Call  : Cb_Gtk_Gesture_Long_Press_Gdouble_Gdouble_Void;
112       After : Boolean := False);
113   procedure On_Pressed
114      (Self  : not null access Gtk_Gesture_Long_Press_Record;
115       Call  : Cb_GObject_Gdouble_Gdouble_Void;
116       Slot  : not null access Glib.Object.GObject_Record'Class;
117       After : Boolean := False);
118   --  This signal is emitted whenever a press goes unmoved/unreleased longer
119   --  than what the GTK+ defaults tell.
120   --
121   --  Callback parameters:
122   --    --  "x": the X coordinate where the press happened, relative to the widget
123   --    --  allocation
124   --    --  "y": the Y coordinate where the press happened, relative to the widget
125   --    --  allocation
126
127end Gtk.Gesture_Long_Press;
128