OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SKCANVASWIDGET_H_ | 10 #ifndef SKCANVASWIDGET_H_ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 /** Zooms the canvas by scale with the transformation centered at the widget
point (px, py). */ | 43 /** Zooms the canvas by scale with the transformation centered at the widget
point (px, py). */ |
44 void zoom(float scale, int px, int py); | 44 void zoom(float scale, int px, int py); |
45 | 45 |
46 void resetWidgetTransform(); | 46 void resetWidgetTransform(); |
47 | 47 |
48 enum ZoomCommandTypes { | 48 enum ZoomCommandTypes { |
49 kIn_ZoomCommand, | 49 kIn_ZoomCommand, |
50 kOut_ZoomCommand, | 50 kOut_ZoomCommand, |
51 }; | 51 }; |
52 public slots: | 52 public Q_SLOTS: |
53 /** | 53 /** |
54 * Zooms in or out (see ZoomCommandTypes) by the standard zoom factor | 54 * Zooms in or out (see ZoomCommandTypes) by the standard zoom factor |
55 * with the transformation centered in the middle of the widget. | 55 * with the transformation centered in the middle of the widget. |
56 */ | 56 */ |
57 void zoom(int zoomCommand); | 57 void zoom(int zoomCommand); |
58 | 58 |
59 signals: | 59 Q_SIGNALS: |
60 void scaleFactorChanged(float newScaleFactor); | 60 void scaleFactorChanged(float newScaleFactor); |
61 void commandChanged(int newCommand); | 61 void commandChanged(int newCommand); |
62 void hitChanged(int hit); | 62 void hitChanged(int hit); |
63 | 63 |
64 private: | 64 private: |
65 QHBoxLayout fHorizontalLayout; | 65 QHBoxLayout fHorizontalLayout; |
66 SkRasterWidget fRasterWidget; | 66 SkRasterWidget fRasterWidget; |
67 #if SK_SUPPORT_GPU | 67 #if SK_SUPPORT_GPU |
68 SkGLWidget fGLWidget; | 68 SkGLWidget fGLWidget; |
69 #endif | 69 #endif |
70 SkDebugger* fDebugger; | 70 SkDebugger* fDebugger; |
71 SkIPoint fPreviousPoint; | 71 SkIPoint fPreviousPoint; |
72 SkMatrix fUserMatrix; | 72 SkMatrix fUserMatrix; |
73 | 73 |
74 void mouseMoveEvent(QMouseEvent* event); | 74 void mouseMoveEvent(QMouseEvent* event); |
75 | 75 |
76 void mousePressEvent(QMouseEvent* event); | 76 void mousePressEvent(QMouseEvent* event); |
77 | 77 |
78 void mouseDoubleClickEvent(QMouseEvent* event); | 78 void mouseDoubleClickEvent(QMouseEvent* event); |
79 | 79 |
80 void wheelEvent(QWheelEvent* event); | 80 void wheelEvent(QWheelEvent* event); |
81 | 81 |
82 void snapWidgetTransform(); | 82 void snapWidgetTransform(); |
83 }; | 83 }; |
84 | 84 |
85 | 85 |
86 #endif /* SKCANVASWIDGET_H_ */ | 86 #endif /* SKCANVASWIDGET_H_ */ |
OLD | NEW |