| 1 |
/* Copyright (C) 2014 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtkmm/gesture.h> |
| 18 |
|
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/gesture_p.h) |
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
/** Zoom gesture. |
| 25 |
* |
| 26 |
* This is a Gesture implementation able to recognize |
| 27 |
* pinch/zoom gestures. Whenever the distance between both tracked |
| 28 |
* sequences changes, signal_scale_changed() is emitted to report the scale factor. |
| 29 |
* |
| 30 |
* @newin{3,14} |
| 31 |
* |
| 32 |
* @ingroup Gestures |
| 33 |
*/ |
| 34 |
class GTKMM_API GestureZoom : public Gesture |
| 35 |
{ |
| 36 |
_CLASS_GOBJECT(GestureZoom, GtkGestureZoom, GTK_GESTURE_ZOOM, Gesture, GtkGesture, , , GTKMM_API) |
| 37 |
|
| 38 |
protected: |
| 39 |
/** There is no create() method that corresponds to this constructor, |
| 40 |
* because this constructor shall only be used by derived classes. |
| 41 |
*/ |
| 42 |
_CTOR_DEFAULT |
| 43 |
|
| 44 |
/** Constructs a Gesture that recognizes zoom in/out gestures |
| 45 |
* (usually known as pinch/zoom). |
| 46 |
*/ |
| 47 |
_WRAP_CTOR(GestureZoom(Widget& widget), gtk_gesture_zoom_new) |
| 48 |
|
| 49 |
public: |
| 50 |
/** Creates a Gesture that recognizes zoom in/out gestures |
| 51 |
* (usually known as pinch/zoom). |
| 52 |
* |
| 53 |
* @newin{3,14} |
| 54 |
* |
| 55 |
* @param widget Widget the gesture relates to. |
| 56 |
* @return A RefPtr to a new GestureZoom. |
| 57 |
*/ |
| 58 |
_WRAP_CREATE(Widget& widget) |
| 59 |
|
| 60 |
_WRAP_METHOD(double get_scale_delta() const, gtk_gesture_zoom_get_scale_delta) |
| 61 |
|
| 62 |
// no_default_handler because GtkGestureZoomClass is private. |
| 63 |
_WRAP_SIGNAL(void scale_changed(double scale), "scale-changed", no_default_handler) |
| 64 |
|
| 65 |
// GestureZoom has no properties |
| 66 |
}; |
| 67 |
|
| 68 |
} // namespace Gtk |