-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 58192d3..db6288f 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -188,256 +188,261 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
188 | m_pages.current()->fill(Qt::white); | 188 | m_pages.current()->fill(Qt::white); |
189 | } | 189 | } |
190 | 190 | ||
191 | m_pageBackups.clear(); | 191 | m_pageBackups.clear(); |
192 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 192 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
193 | 193 | ||
194 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 194 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
195 | viewport()->update(); | 195 | viewport()->update(); |
196 | 196 | ||
197 | emit pagesChanged(); | 197 | emit pagesChanged(); |
198 | emit pageBackupsChanged(); | 198 | emit pageBackupsChanged(); |
199 | } | 199 | } |
200 | 200 | ||
201 | void DrawPadCanvas::initialPage() | 201 | void DrawPadCanvas::initialPage() |
202 | { | 202 | { |
203 | m_pages.append(new QPixmap(236, 232)); | 203 | m_pages.append(new QPixmap(236, 232)); |
204 | m_pages.current()->fill(Qt::white); | 204 | m_pages.current()->fill(Qt::white); |
205 | 205 | ||
206 | m_pageBackups.clear(); | 206 | m_pageBackups.clear(); |
207 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 207 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
208 | 208 | ||
209 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 209 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
210 | viewport()->update(); | 210 | viewport()->update(); |
211 | 211 | ||
212 | emit pagesChanged(); | 212 | emit pagesChanged(); |
213 | emit pageBackupsChanged(); | 213 | emit pageBackupsChanged(); |
214 | } | 214 | } |
215 | 215 | ||
216 | void DrawPadCanvas::save(QIODevice* ioDevice) | 216 | void DrawPadCanvas::save(QIODevice* ioDevice) |
217 | { | 217 | { |
218 | QTextStream textStream(ioDevice); | 218 | QTextStream textStream(ioDevice); |
219 | textStream.setCodec(QTextCodec::codecForName("UTF-8")); | 219 | textStream.setCodec(QTextCodec::codecForName("UTF-8")); |
220 | 220 | ||
221 | textStream << "<drawpad>" << endl; | 221 | textStream << "<drawpad>" << endl; |
222 | textStream << " <images>" << endl; | 222 | textStream << " <images>" << endl; |
223 | 223 | ||
224 | QListIterator<QPixmap> bufferIterator(m_pages); | 224 | QListIterator<QPixmap> bufferIterator(m_pages); |
225 | 225 | ||
226 | for (bufferIterator.toFirst(); bufferIterator.current() != 0; ++bufferIterator) { | 226 | for (bufferIterator.toFirst(); bufferIterator.current() != 0; ++bufferIterator) { |
227 | textStream << " <image>" << endl; | 227 | textStream << " <image>" << endl; |
228 | 228 | ||
229 | QImage image = bufferIterator.current()->convertToImage(); | 229 | QImage image = bufferIterator.current()->convertToImage(); |
230 | QByteArray byteArray; | 230 | QByteArray byteArray; |
231 | QBuffer buffer(byteArray); | 231 | QBuffer buffer(byteArray); |
232 | QImageIO imageIO(&buffer, "PNG"); | 232 | QImageIO imageIO(&buffer, "PNG"); |
233 | 233 | ||
234 | buffer.open(IO_WriteOnly); | 234 | buffer.open(IO_WriteOnly); |
235 | imageIO.setImage(image); | 235 | imageIO.setImage(image); |
236 | imageIO.write(); | 236 | imageIO.write(); |
237 | buffer.close(); | 237 | buffer.close(); |
238 | 238 | ||
239 | textStream << " <data length=\"" << byteArray.size() << "\" format=\"PNG\">"; | 239 | textStream << " <data length=\"" << byteArray.size() << "\" format=\"PNG\">"; |
240 | 240 | ||
241 | static const char hexchars[] = "0123456789abcdef"; | 241 | static const char hexchars[] = "0123456789abcdef"; |
242 | 242 | ||
243 | for (int i = 0; i < (int)byteArray.size(); i++ ) { | 243 | for (int i = 0; i < (int)byteArray.size(); i++ ) { |
244 | uchar s = (uchar)byteArray[i]; | 244 | uchar s = (uchar)byteArray[i]; |
245 | textStream << hexchars[s >> 4]; | 245 | textStream << hexchars[s >> 4]; |
246 | textStream << hexchars[s & 0x0f]; | 246 | textStream << hexchars[s & 0x0f]; |
247 | } | 247 | } |
248 | 248 | ||
249 | textStream << "</data>" << endl; | 249 | textStream << "</data>" << endl; |
250 | textStream << " </image>" << endl; | 250 | textStream << " </image>" << endl; |
251 | } | 251 | } |
252 | 252 | ||
253 | textStream << " </images>" << endl; | 253 | textStream << " </images>" << endl; |
254 | textStream << "</drawpad>"; | 254 | textStream << "</drawpad>"; |
255 | } | 255 | } |
256 | 256 | ||
257 | void DrawPadCanvas::importPage(const QString& fileName) | 257 | void DrawPadCanvas::importPage(const QString& fileName) |
258 | { | 258 | { |
259 | QPixmap* importedPixmap = new QPixmap(); | 259 | QPixmap* importedPixmap = new QPixmap(); |
260 | 260 | ||
261 | importedPixmap->load(fileName); | 261 | importedPixmap->load(fileName); |
262 | m_pages.insert(m_pages.at() + 1, importedPixmap); | 262 | m_pages.insert(m_pages.at() + 1, importedPixmap); |
263 | 263 | ||
264 | m_pageBackups.clear(); | 264 | m_pageBackups.clear(); |
265 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 265 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
266 | 266 | ||
267 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 267 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
268 | viewport()->update(); | 268 | viewport()->update(); |
269 | 269 | ||
270 | emit pagesChanged(); | 270 | emit pagesChanged(); |
271 | emit pageBackupsChanged(); | 271 | emit pageBackupsChanged(); |
272 | } | 272 | } |
273 | 273 | ||
274 | void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,const QString& format) | 274 | void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,const QString& format) |
275 | { | 275 | { |
276 | if (fromPage == toPage) { | 276 | if (fromPage == toPage) { |
277 | DocLnk docLnk; | 277 | DocLnk docLnk; |
278 | MimeType mimeType(format); | 278 | MimeType mimeType(format); |
279 | 279 | ||
280 | docLnk.setName(name); | 280 | docLnk.setName(name); |
281 | docLnk.setType(mimeType.id()); | 281 | docLnk.setType(mimeType.id()); |
282 | 282 | ||
283 | FileManager fileManager; | 283 | FileManager fileManager; |
284 | QIODevice* ioDevice = fileManager.saveFile(docLnk); | 284 | QIODevice* ioDevice = fileManager.saveFile(docLnk); |
285 | QImageIO imageIO(ioDevice, format); | 285 | QImageIO imageIO(ioDevice, format); |
286 | 286 | ||
287 | QImage image = m_pages.current()->convertToImage(); | 287 | QImage image = m_pages.current()->convertToImage(); |
288 | imageIO.setImage(image); | 288 | imageIO.setImage(image); |
289 | imageIO.write(); | 289 | imageIO.write(); |
290 | delete ioDevice; | 290 | delete ioDevice; |
291 | } else { | 291 | } else { |
292 | for (uint i = fromPage; i <= toPage; i++) { | 292 | for (uint i = fromPage; i <= toPage; i++) { |
293 | DocLnk docLnk; | 293 | DocLnk docLnk; |
294 | MimeType mimeType(format); | 294 | MimeType mimeType(format); |
295 | 295 | ||
296 | docLnk.setName(name + QString::number(i)); | 296 | docLnk.setName(name + QString::number(i)); |
297 | docLnk.setType(mimeType.id()); | 297 | docLnk.setType(mimeType.id()); |
298 | 298 | ||
299 | FileManager fileManager; | 299 | FileManager fileManager; |
300 | QIODevice* ioDevice = fileManager.saveFile(docLnk); | 300 | QIODevice* ioDevice = fileManager.saveFile(docLnk); |
301 | QImageIO imageIO(ioDevice, format); | 301 | QImageIO imageIO(ioDevice, format); |
302 | 302 | ||
303 | QImage image = m_pages.at(i - 1)->convertToImage(); | 303 | QImage image = m_pages.at(i - 1)->convertToImage(); |
304 | imageIO.setImage(image); | 304 | imageIO.setImage(image); |
305 | imageIO.write(); | 305 | imageIO.write(); |
306 | delete ioDevice; | 306 | delete ioDevice; |
307 | } | 307 | } |
308 | } | 308 | } |
309 | } | 309 | } |
310 | 310 | ||
311 | QPixmap* DrawPadCanvas::currentPage() | 311 | QPixmap* DrawPadCanvas::currentPage() |
312 | { | 312 | { |
313 | return m_pages.current(); | 313 | return m_pages.current(); |
314 | } | 314 | } |
315 | 315 | ||
316 | QList<QPixmap> DrawPadCanvas::pages() | ||
317 | { | ||
318 | return m_pages; | ||
319 | } | ||
320 | |||
316 | uint DrawPadCanvas::pagePosition() | 321 | uint DrawPadCanvas::pagePosition() |
317 | { | 322 | { |
318 | return (m_pages.at() + 1); | 323 | return (m_pages.at() + 1); |
319 | } | 324 | } |
320 | 325 | ||
321 | uint DrawPadCanvas::pageCount() | 326 | uint DrawPadCanvas::pageCount() |
322 | { | 327 | { |
323 | return m_pages.count(); | 328 | return m_pages.count(); |
324 | } | 329 | } |
325 | 330 | ||
326 | void DrawPadCanvas::deleteAll() | 331 | void DrawPadCanvas::deleteAll() |
327 | { | 332 | { |
328 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), | 333 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), |
329 | QMessageBox::Information, QMessageBox::Yes, | 334 | QMessageBox::Information, QMessageBox::Yes, |
330 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 335 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
331 | QMessageBox::NoButton, this); | 336 | QMessageBox::NoButton, this); |
332 | 337 | ||
333 | if (messageBox.exec() == QMessageBox::Yes) { | 338 | if (messageBox.exec() == QMessageBox::Yes) { |
334 | m_pages.clear(); | 339 | m_pages.clear(); |
335 | 340 | ||
336 | m_pages.append(new QPixmap(contentsRect().size())); | 341 | m_pages.append(new QPixmap(contentsRect().size())); |
337 | m_pages.current()->fill(Qt::white); | 342 | m_pages.current()->fill(Qt::white); |
338 | 343 | ||
339 | m_pageBackups.clear(); | 344 | m_pageBackups.clear(); |
340 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 345 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
341 | 346 | ||
342 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 347 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
343 | viewport()->update(); | 348 | viewport()->update(); |
344 | 349 | ||
345 | emit pagesChanged(); | 350 | emit pagesChanged(); |
346 | emit pageBackupsChanged(); | 351 | emit pageBackupsChanged(); |
347 | } | 352 | } |
348 | } | 353 | } |
349 | 354 | ||
350 | void DrawPadCanvas::newPage() | 355 | void DrawPadCanvas::newPage() |
351 | { | 356 | { |
352 | QRect rect = contentsRect(); | 357 | QRect rect = contentsRect(); |
353 | 358 | ||
354 | NewPageDialog newPageDialog(rect.width(), rect.height(), m_pDrawPad->pen().color(), | 359 | NewPageDialog newPageDialog(rect.width(), rect.height(), m_pDrawPad->pen().color(), |
355 | m_pDrawPad->brush().color(), this); | 360 | m_pDrawPad->brush().color(), this); |
356 | 361 | ||
357 | if (newPageDialog.exec() == QDialog::Accepted) { | 362 | if (newPageDialog.exec() == QDialog::Accepted) { |
358 | m_pages.insert(m_pages.at() + 1, new QPixmap(newPageDialog.selectedWidth(), | 363 | m_pages.insert(m_pages.at() + 1, new QPixmap(newPageDialog.selectedWidth(), |
359 | newPageDialog.selectedHeight())); | 364 | newPageDialog.selectedHeight())); |
360 | m_pages.current()->fill(newPageDialog.selectedColor()); | 365 | m_pages.current()->fill(newPageDialog.selectedColor()); |
361 | 366 | ||
362 | m_pageBackups.clear(); | 367 | m_pageBackups.clear(); |
363 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 368 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
364 | 369 | ||
365 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 370 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
366 | viewport()->update(); | 371 | viewport()->update(); |
367 | 372 | ||
368 | emit pagesChanged(); | 373 | emit pagesChanged(); |
369 | emit pageBackupsChanged(); | 374 | emit pageBackupsChanged(); |
370 | } | 375 | } |
371 | } | 376 | } |
372 | 377 | ||
373 | void DrawPadCanvas::clearPage() | 378 | void DrawPadCanvas::clearPage() |
374 | { | 379 | { |
375 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | 380 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), |
376 | QMessageBox::Information, QMessageBox::Yes, | 381 | QMessageBox::Information, QMessageBox::Yes, |
377 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 382 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
378 | QMessageBox::NoButton, this); | 383 | QMessageBox::NoButton, this); |
379 | 384 | ||
380 | if (messageBox.exec() == QMessageBox::Yes) { | 385 | if (messageBox.exec() == QMessageBox::Yes) { |
381 | m_pages.current()->fill(Qt::white); | 386 | m_pages.current()->fill(Qt::white); |
382 | 387 | ||
383 | viewport()->update(); | 388 | viewport()->update(); |
384 | } | 389 | } |
385 | } | 390 | } |
386 | 391 | ||
387 | void DrawPadCanvas::deletePage() | 392 | void DrawPadCanvas::deletePage() |
388 | { | 393 | { |
389 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), | 394 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), |
390 | QMessageBox::Information, QMessageBox::Yes, | 395 | QMessageBox::Information, QMessageBox::Yes, |
391 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 396 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
392 | QMessageBox::NoButton, this); | 397 | QMessageBox::NoButton, this); |
393 | 398 | ||
394 | if (messageBox.exec() == QMessageBox::Yes) { | 399 | if (messageBox.exec() == QMessageBox::Yes) { |
395 | m_pages.remove(m_pages.current()); | 400 | m_pages.remove(m_pages.current()); |
396 | 401 | ||
397 | if (m_pages.isEmpty()) { | 402 | if (m_pages.isEmpty()) { |
398 | m_pages.append(new QPixmap(contentsRect().size())); | 403 | m_pages.append(new QPixmap(contentsRect().size())); |
399 | m_pages.current()->fill(Qt::white); | 404 | m_pages.current()->fill(Qt::white); |
400 | } | 405 | } |
401 | 406 | ||
402 | m_pageBackups.clear(); | 407 | m_pageBackups.clear(); |
403 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 408 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
404 | 409 | ||
405 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 410 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
406 | viewport()->update(); | 411 | viewport()->update(); |
407 | 412 | ||
408 | emit pagesChanged(); | 413 | emit pagesChanged(); |
409 | emit pageBackupsChanged(); | 414 | emit pageBackupsChanged(); |
410 | } | 415 | } |
411 | } | 416 | } |
412 | 417 | ||
413 | bool DrawPadCanvas::undoEnabled() | 418 | bool DrawPadCanvas::undoEnabled() |
414 | { | 419 | { |
415 | return (m_pageBackups.current() != m_pageBackups.getFirst()); | 420 | return (m_pageBackups.current() != m_pageBackups.getFirst()); |
416 | } | 421 | } |
417 | 422 | ||
418 | bool DrawPadCanvas::redoEnabled() | 423 | bool DrawPadCanvas::redoEnabled() |
419 | { | 424 | { |
420 | return (m_pageBackups.current() != m_pageBackups.getLast()); | 425 | return (m_pageBackups.current() != m_pageBackups.getLast()); |
421 | } | 426 | } |
422 | 427 | ||
423 | bool DrawPadCanvas::goPreviousPageEnabled() | 428 | bool DrawPadCanvas::goPreviousPageEnabled() |
424 | { | 429 | { |
425 | return (m_pages.current() != m_pages.getFirst()); | 430 | return (m_pages.current() != m_pages.getFirst()); |
426 | } | 431 | } |
427 | 432 | ||
428 | bool DrawPadCanvas::goNextPageEnabled() | 433 | bool DrawPadCanvas::goNextPageEnabled() |
429 | { | 434 | { |
430 | return (m_pages.current() != m_pages.getLast()); | 435 | return (m_pages.current() != m_pages.getLast()); |
431 | } | 436 | } |
432 | 437 | ||
433 | void DrawPadCanvas::undo() | 438 | void DrawPadCanvas::undo() |
434 | { | 439 | { |
435 | *(m_pages.current()) = *(m_pageBackups.prev()); | 440 | *(m_pages.current()) = *(m_pageBackups.prev()); |
436 | 441 | ||
437 | viewport()->update(); | 442 | viewport()->update(); |
438 | 443 | ||
439 | emit pageBackupsChanged(); | 444 | emit pageBackupsChanged(); |
440 | } | 445 | } |
441 | 446 | ||
442 | void DrawPadCanvas::redo() | 447 | void DrawPadCanvas::redo() |
443 | { | 448 | { |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.h b/noncore/graphics/drawpad/drawpadcanvas.h index 90dd951..a1a9466 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.h +++ b/noncore/graphics/drawpad/drawpadcanvas.h | |||
@@ -1,80 +1,81 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #ifndef DRAWPADCANVAS_H | 14 | #ifndef DRAWPADCANVAS_H |
15 | #define DRAWPADCANVAS_H | 15 | #define DRAWPADCANVAS_H |
16 | 16 | ||
17 | #include <qscrollview.h> | 17 | #include <qscrollview.h> |
18 | 18 | ||
19 | #include <qlist.h> | 19 | #include <qlist.h> |
20 | #include <qpointarray.h> | 20 | #include <qpointarray.h> |
21 | 21 | ||
22 | class DrawPad; | 22 | class DrawPad; |
23 | 23 | ||
24 | class QPixmap; | 24 | class QPixmap; |
25 | 25 | ||
26 | class DrawPadCanvas : public QScrollView | 26 | class DrawPadCanvas : public QScrollView |
27 | { | 27 | { |
28 | Q_OBJECT | 28 | Q_OBJECT |
29 | 29 | ||
30 | public: | 30 | public: |
31 | DrawPadCanvas(DrawPad* drawPad, QWidget* parent = 0, const char* name = 0); | 31 | DrawPadCanvas(DrawPad* drawPad, QWidget* parent = 0, const char* name = 0); |
32 | ~DrawPadCanvas(); | 32 | ~DrawPadCanvas(); |
33 | 33 | ||
34 | void load(QIODevice* ioDevice); | 34 | void load(QIODevice* ioDevice); |
35 | void initialPage(); | 35 | void initialPage(); |
36 | void save(QIODevice* ioDevice); | 36 | void save(QIODevice* ioDevice); |
37 | 37 | ||
38 | void importPage(const QString& fileName); | 38 | void importPage(const QString& fileName); |
39 | void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); | 39 | void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); |
40 | 40 | ||
41 | bool undoEnabled(); | 41 | bool undoEnabled(); |
42 | bool redoEnabled(); | 42 | bool redoEnabled(); |
43 | bool goPreviousPageEnabled(); | 43 | bool goPreviousPageEnabled(); |
44 | bool goNextPageEnabled(); | 44 | bool goNextPageEnabled(); |
45 | 45 | ||
46 | QPixmap* currentPage(); | 46 | QPixmap* currentPage(); |
47 | QList<QPixmap> pages(); | ||
47 | uint pagePosition(); | 48 | uint pagePosition(); |
48 | uint pageCount(); | 49 | uint pageCount(); |
49 | 50 | ||
50 | public slots: | 51 | public slots: |
51 | void deleteAll(); | 52 | void deleteAll(); |
52 | void newPage(); | 53 | void newPage(); |
53 | void clearPage(); | 54 | void clearPage(); |
54 | void deletePage(); | 55 | void deletePage(); |
55 | 56 | ||
56 | void undo(); | 57 | void undo(); |
57 | void redo(); | 58 | void redo(); |
58 | 59 | ||
59 | void goFirstPage(); | 60 | void goFirstPage(); |
60 | void goPreviousPage(); | 61 | void goPreviousPage(); |
61 | void goNextPage(); | 62 | void goNextPage(); |
62 | void goLastPage(); | 63 | void goLastPage(); |
63 | 64 | ||
64 | signals: | 65 | signals: |
65 | void pagesChanged(); | 66 | void pagesChanged(); |
66 | void pageBackupsChanged(); | 67 | void pageBackupsChanged(); |
67 | 68 | ||
68 | protected: | 69 | protected: |
69 | void contentsMousePressEvent(QMouseEvent* e); | 70 | void contentsMousePressEvent(QMouseEvent* e); |
70 | void contentsMouseReleaseEvent(QMouseEvent* e); | 71 | void contentsMouseReleaseEvent(QMouseEvent* e); |
71 | void contentsMouseMoveEvent(QMouseEvent* e); | 72 | void contentsMouseMoveEvent(QMouseEvent* e); |
72 | void drawContents(QPainter* p, int cx, int cy, int cw, int ch); | 73 | void drawContents(QPainter* p, int cx, int cy, int cw, int ch); |
73 | 74 | ||
74 | private: | 75 | private: |
75 | DrawPad* m_pDrawPad; | 76 | DrawPad* m_pDrawPad; |
76 | QList<QPixmap> m_pages; | 77 | QList<QPixmap> m_pages; |
77 | QList<QPixmap> m_pageBackups; | 78 | QList<QPixmap> m_pageBackups; |
78 | }; | 79 | }; |
79 | 80 | ||
80 | #endif // DRAWPADCANVAS_H | 81 | #endif // DRAWPADCANVAS_H |