~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to krita/ui/canvas/kis_canvas2.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of the KDE project
2
 
 * Copyright (C) Boudewijn Rempt <boud@valdyas.org>, (C) 2006
 
2
 * Copyright (C) 2006, 2010 Boudewijn Rempt <boud@valdyas.org>
3
3
 *
4
4
 *  This program is free software; you can redistribute it and/or modify
5
5
 *  it under the terms of the GNU General Public License as published by
29
29
#include <kis_types.h>
30
30
#include <KoPointerEvent.h>
31
31
 
 
32
#include "kis_ui_types.h"
 
33
 
32
34
class KoToolProxy;
33
35
class KoColorProfile;
34
36
 
42
44
    OPENGL
43
45
};
44
46
 
 
47
class KisCoordinatesConverter;
45
48
class KoViewConverter;
46
49
 
47
50
/**
69
72
 
70
73
    void setCanvasWidget(QWidget * widget);
71
74
 
 
75
    void notifyZoomChanged();
 
76
 
72
77
public: // KoCanvasBase implementation
73
78
 
 
79
    bool canvasIsOpenGL();
 
80
 
74
81
    void gridSize(qreal *horizontal, qreal *vertical) const;
75
82
 
76
83
    bool snapToGrid() const;
100
107
 
101
108
    virtual void updateInputMethodInfo();
102
109
 
 
110
    const KisCoordinatesConverter* coordinatesConverter() const;
103
111
    virtual const KoViewConverter *viewConverter() const;
104
112
 
105
113
    virtual QWidget* canvasWidget();
118
126
     */
119
127
    void preScale();
120
128
 
121
 
    void connectCurrentImage();
122
 
 
123
 
    void disconnectCurrentImage();
124
 
 
 
129
    // FIXME:
125
130
    // Temporary! Either get the current layer and image from the
126
131
    // resource provider, or use this, which gets them from the
127
132
    // current shape selection.
133
138
    KisView2* view();
134
139
 
135
140
    bool usingHDRExposureProgram();
 
141
    /// @return true if the canvas image should be displayed in vertically mirrored mode
136
142
    void addDecoration(KisCanvasDecoration* deco);
137
143
    KisCanvasDecoration* decoration(const QString& id);
138
144
 
139
145
signals:
140
146
 
141
147
    void documentOriginChanged();
 
148
    void scrollAreaSizeChanged();
142
149
 
143
150
    void imageChanged(KisImageWSP image);
144
151
 
146
153
 
147
154
    void favoritePaletteCalled(const QPoint&);
148
155
 
 
156
    void sigCanvasCacheUpdated(KisUpdateInfoSP);
 
157
 
149
158
public slots:
150
159
 
151
160
    /// Update the entire canvas area
152
161
    void updateCanvas();
153
162
 
154
 
    /// The image projection has changed, now update the canvas
155
 
    /// representation of it.
156
 
    void updateCanvasProjection(const QRect & rc);
 
163
    /// The image projection has changed, now start an update
 
164
    /// of the canvas representation.
 
165
    void startUpdateCanvasProjection(const QRect & rc);
 
166
 
 
167
    void updateCanvasProjection(KisUpdateInfoSP info);
157
168
 
158
169
    void setImageSize(qint32 w, qint32 h);
159
170
 
160
171
    /// adjust the origin of the document
161
172
    void adjustOrigin();
162
173
 
163
 
    /// documentOffset changed, now update the rulers in zoom manager
164
 
    void updateRulers();
 
174
    /// slot for setting the mirroring
 
175
    void mirrorCanvas(bool mirror);
 
176
    void rotateCanvas(qreal angle);
 
177
    void rotateCanvasRight15();
 
178
    void rotateCanvasLeft15();
 
179
    void resetCanvasTransformations();
165
180
 
166
181
private slots:
167
182
 
185
200
 
186
201
    void slotCanvasDestroyed(QWidget* w);
187
202
 
 
203
    void setCursor(const QCursor &cursor);
 
204
 
188
205
public:
189
 
 
190
 
    friend class KisView2;
191
 
 
 
206
//    friend class KisView2;
 
207
 
 
208
    // interface for KisView2 only
 
209
    void connectCurrentImage();
 
210
    void disconnectCurrentImage();
192
211
    void resetCanvas(bool useOpenGL);
193
212
 
194
 
    KisCanvas2(const KisCanvas2&);
195
 
 
196
 
    void createCanvas();
 
213
    void createFavoriteResourceManager(KisPaintopBox*);
 
214
    KoFavoriteResourceManager* favoriteResourceManager();
 
215
    bool handlePopupPaletteIsVisible();
 
216
 
 
217
private:
 
218
    Q_DISABLE_COPY(KisCanvas2);
 
219
 
 
220
    void pan(QPoint shift);
 
221
    void createCanvas(bool useOpenGL);
197
222
    void createQPainterCanvas();
198
223
    void createOpenGLCanvas();
199
 
    void createFavoriteResourceManager(KisPaintopBox*);
200
 
 
201
 
    KoFavoriteResourceManager* favoriteResourceManager();
202
 
    bool handlePopupPaletteIsVisible(KoPointerEvent *);
203
 
 
204
 
    /**
205
 
     * Returns a rect in widget pixels that is translated for document
206
 
     * offset, resolution and zoom and that is guaranteed to be inside
207
 
     * the widget.
208
 
     */
209
 
    QRect viewRectFromDoc(const QRectF & docRect);
210
224
 
211
225
private:
212
226