author | harlekin <harlekin> | 2003-12-10 21:45:06 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-10 21:45:06 (UTC) |
commit | 7c21195c1dde6cc91c41e5b15ef5acce568a2f54 (patch) (side-by-side diff) | |
tree | 83914e1119fa662dc7a4d37e72624118c62aecaf | |
parent | c80a4d0e0b0ed83757d8494e7f32c8b4b0b6e8d0 (diff) | |
download | opie-7c21195c1dde6cc91c41e5b15ef5acce568a2f54.zip opie-7c21195c1dde6cc91c41e5b15ef5acce568a2f54.tar.gz opie-7c21195c1dde6cc91c41e5b15ef5acce568a2f54.tar.bz2 |
reduce includes
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/ellipsetool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/erasetool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/exportdialog.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/filledellipsetool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/filltool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/linetool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/main.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/newpagedialog.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/pointtool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/shapetool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/texttool.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/thumbnailview.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/tool.cpp | 2 |
16 files changed, 0 insertions, 18 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 86a10a5..71c9695 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -14,65 +14,64 @@ #include "drawpad.h" #include "drawpadcanvas.h" #include "ellipsetool.h" #include "erasetool.h" #include "exportdialog.h" #include "filledellipsetool.h" #include "filledrectangletool.h" #include "filltool.h" #include "importdialog.h" #include "linetool.h" #include "newpagedialog.h" #include "page.h" #include "pageinformationdialog.h" #include "pointtool.h" #include "rectangletool.h" #include "texttool.h" #include "thumbnailview.h" #include <opie/colordialog.h> #include <opie/colorpopupmenu.h> #include <qpe/applnk.h> #include <qpe/config.h> #include <qpe/global.h> #include <qmenubar.h> #include <qpe/qpetoolbar.h> #include <qpe/resource.h> #include <qaction.h> #include <qfile.h> #include <qmessagebox.h> -#include <qpainter.h> #include <qspinbox.h> #include <qtoolbutton.h> #include <qtooltip.h> #include <qwhatsthis.h> DrawPad::DrawPad(QWidget* parent, const char* name, WFlags fl ) : QMainWindow(parent, name, WStyle_ContextHelp) { // init members m_pDrawPadCanvas = new DrawPadCanvas(this, this); connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); setCentralWidget(m_pDrawPadCanvas); // init menu setToolBarsMovable(false); QToolBar* menuToolBar = new QToolBar(this); QMenuBar* menuBar = new QMenuBar(menuToolBar); QPopupMenu* toolsPopupMenu = new QPopupMenu(menuBar); QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); deleteAllAction->addTo(toolsPopupMenu); toolsPopupMenu->insertSeparator(); QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index dec498b..446096c 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -1,60 +1,58 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "drawpadcanvas.h" #include "drawpad.h" #include "page.h" #include "tool.h" #include <qpe/applnk.h> #include <qpe/filemanager.h> #include <qpe/mimetype.h> #include <qbuffer.h> #include <qimage.h> -#include <qpainter.h> #include <qtextcodec.h> -#include <qtextstream.h> #include <qxml.h> class DrawPadCanvasXmlHandler: public QXmlDefaultHandler { public: DrawPadCanvasXmlHandler(); ~DrawPadCanvasXmlHandler(); QList<Page> pages(); bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts); bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName); bool characters(const QString& ch); private: enum State { Unknown, InTitle, InDate, InData }; State m_state; QString m_title; QDateTime m_date; ulong m_dataLenght; QString m_dataFormat; QList<Page> m_pages; }; diff --git a/noncore/graphics/drawpad/ellipsetool.cpp b/noncore/graphics/drawpad/ellipsetool.cpp index 0cdb731..2173c97 100644 --- a/noncore/graphics/drawpad/ellipsetool.cpp +++ b/noncore/graphics/drawpad/ellipsetool.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "ellipsetool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include <qimage.h> -#include <qpixmap.h> EllipseTool::EllipseTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : ShapeTool(drawPad, drawPadCanvas) { } EllipseTool::~EllipseTool() { } void EllipseTool::drawFinalShape(QPainter& p) { p.setRasterOp(Qt::NotROP); p.drawRect(QRect(m_polyline[2], m_polyline[0])); p.setRasterOp(Qt::CopyROP); if (m_pDrawPad->antiAliasing()) { QRect r = m_polyline.boundingRect(); r = r.normalize(); r.setLeft(r.left() - m_pDrawPad->pen().width()); r.setTop(r.top() - m_pDrawPad->pen().width()); r.setRight(r.right() + m_pDrawPad->pen().width()); r.setBottom(r.bottom() + m_pDrawPad->pen().width()); QPixmap areaPixmap(r.width(), r.height()); bitBlt(&areaPixmap, QPoint(0, 0), p.device(), r); QImage areaImage = areaPixmap.convertToImage(); QImage bigAreaImage = areaImage.smoothScale(areaImage.width() * 3, areaImage.height() * 3); QPixmap bigAreaPixmap; bigAreaPixmap.convertFromImage(bigAreaImage); diff --git a/noncore/graphics/drawpad/erasetool.cpp b/noncore/graphics/drawpad/erasetool.cpp index 2326da5..5d123c4 100644 --- a/noncore/graphics/drawpad/erasetool.cpp +++ b/noncore/graphics/drawpad/erasetool.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "erasetool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include "page.h" -#include <qpainter.h> EraseTool::EraseTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : Tool(drawPad, drawPadCanvas) { m_mousePressed = false; m_polyline.resize(3); } EraseTool::~EraseTool() { } void EraseTool::mousePressEvent(QMouseEvent* e) { m_pDrawPadCanvas->backupPage(); m_mousePressed = true; m_polyline[2] = m_polyline[1] = m_polyline[0] = e->pos(); } void EraseTool::mouseReleaseEvent(QMouseEvent* e) { Q_UNUSED(e) m_mousePressed = false; } void EraseTool::mouseMoveEvent(QMouseEvent* e) { if (m_mousePressed) { QPainter painter; QPen pen(Qt::white, m_pDrawPad->pen().width()); diff --git a/noncore/graphics/drawpad/exportdialog.cpp b/noncore/graphics/drawpad/exportdialog.cpp index adbd612..d63f428 100644 --- a/noncore/graphics/drawpad/exportdialog.cpp +++ b/noncore/graphics/drawpad/exportdialog.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "exportdialog.h" #include <opie/ofileselector.h> #include <qbuttongroup.h> #include <qcombobox.h> -#include <qgroupbox.h> #include <qimage.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qradiobutton.h> #include <qspinbox.h> #include <stdlib.h> ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) : QDialog(parent, name, true) { setCaption(tr("DrawPad - Export")); m_pageAt = pageAt; m_pageCount = pageCount; QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); diff --git a/noncore/graphics/drawpad/filledellipsetool.cpp b/noncore/graphics/drawpad/filledellipsetool.cpp index 6b5bbc6..41b8571 100644 --- a/noncore/graphics/drawpad/filledellipsetool.cpp +++ b/noncore/graphics/drawpad/filledellipsetool.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "filledellipsetool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include <qimage.h> -#include <qpixmap.h> FilledEllipseTool::FilledEllipseTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : ShapeTool(drawPad, drawPadCanvas) { } FilledEllipseTool::~FilledEllipseTool() { } void FilledEllipseTool::drawFinalShape(QPainter& p) { p.setRasterOp(Qt::NotROP); p.drawRect(QRect(m_polyline[2], m_polyline[0])); p.setRasterOp(Qt::CopyROP); if (m_pDrawPad->antiAliasing()) { QRect r = m_polyline.boundingRect(); r = r.normalize(); r.setLeft(r.left() - m_pDrawPad->pen().width()); r.setTop(r.top() - m_pDrawPad->pen().width()); r.setRight(r.right() + m_pDrawPad->pen().width()); r.setBottom(r.bottom() + m_pDrawPad->pen().width()); QPixmap areaPixmap(r.width(), r.height()); bitBlt(&areaPixmap, QPoint(0, 0), p.device(), r); QImage areaImage = areaPixmap.convertToImage(); QImage bigAreaImage = areaImage.smoothScale(areaImage.width() * 3, areaImage.height() * 3); QPixmap bigAreaPixmap; bigAreaPixmap.convertFromImage(bigAreaImage); diff --git a/noncore/graphics/drawpad/filltool.cpp b/noncore/graphics/drawpad/filltool.cpp index b47aa60..fedf3a5 100644 --- a/noncore/graphics/drawpad/filltool.cpp +++ b/noncore/graphics/drawpad/filltool.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "filltool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include "page.h" -#include <qimage.h> const int FILL_THRESHOLD = 65536; FillTool::FillTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : Tool(drawPad, drawPadCanvas) { } FillTool::~FillTool() { } void FillTool::mousePressEvent(QMouseEvent* e) { int x = e->x(); int y = e->y(); m_image = m_pDrawPadCanvas->currentPage()->pixmap()->convertToImage(); if (m_image.depth() <= 8) { m_image = m_image.convertDepth(32); } m_fillRgb = m_pDrawPad->brush().color().rgb(); m_oldRgb = m_image.pixel(x, y); if (m_oldRgb != m_fillRgb) { m_pDrawPadCanvas->backupPage(); if (m_pDrawPad->antiAliasing()) { m_mask.create(m_image.width(), m_image.height(), 8, 2); m_mask.fill(0); diff --git a/noncore/graphics/drawpad/importdialog.cpp b/noncore/graphics/drawpad/importdialog.cpp index 9a59a20..ce2e7ee 100644 --- a/noncore/graphics/drawpad/importdialog.cpp +++ b/noncore/graphics/drawpad/importdialog.cpp @@ -1,48 +1,47 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "importdialog.h" -#include <qpe/applnk.h> #include <opie/ofileselector.h> #include <qcheckbox.h> #include <qimage.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> ImportDialog::ImportDialog(QWidget* parent, const char* name) : QDialog(parent, name, true) { setCaption(tr("DrawPad - Import")); MimeTypes types; types.insert( tr("All images"),"image/*" ); m_pFileSelector = new OFileSelector(this, OFileSelector::FileSelector, OFileSelector::Normal, QString::null, QString::null, types ); m_pFileSelector->setNameVisible( false ); connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); m_pPreviewLabel = new QLabel(this); m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_pPreviewLabel->setFixedSize(114, 114); m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); m_pAutomaticPreviewCheckBox->setChecked(true); QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); diff --git a/noncore/graphics/drawpad/linetool.cpp b/noncore/graphics/drawpad/linetool.cpp index b6baa2a..5ea068c 100644 --- a/noncore/graphics/drawpad/linetool.cpp +++ b/noncore/graphics/drawpad/linetool.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "linetool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include <qimage.h> -#include <qpixmap.h> LineTool::LineTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : ShapeTool(drawPad, drawPadCanvas) { } LineTool::~LineTool() { } void LineTool::drawFinalShape(QPainter& p) { p.setRasterOp(Qt::NotROP); p.drawLine(m_polyline[2], m_polyline[0]); p.setRasterOp(Qt::CopyROP); if (m_pDrawPad->antiAliasing()) { QRect r = m_polyline.boundingRect(); r = r.normalize(); r.setLeft(r.left() - m_pDrawPad->pen().width()); r.setTop(r.top() - m_pDrawPad->pen().width()); r.setRight(r.right() + m_pDrawPad->pen().width()); r.setBottom(r.bottom() + m_pDrawPad->pen().width()); QPixmap areaPixmap(r.width(), r.height()); bitBlt(&areaPixmap, QPoint(0, 0), p.device(), r); QImage areaImage = areaPixmap.convertToImage(); QImage bigAreaImage = areaImage.smoothScale(areaImage.width() * 3, areaImage.height() * 3); QPixmap bigAreaPixmap; bigAreaPixmap.convertFromImage(bigAreaImage); diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index 87bc621..c87cc0f 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp @@ -1,19 +1,18 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "drawpad.h" -#include <qpe/qpeapplication.h> #include <opie/oapplicationfactory.h> OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) diff --git a/noncore/graphics/drawpad/newpagedialog.cpp b/noncore/graphics/drawpad/newpagedialog.cpp index e6e7fcb..dc8999a 100644 --- a/noncore/graphics/drawpad/newpagedialog.cpp +++ b/noncore/graphics/drawpad/newpagedialog.cpp @@ -1,49 +1,48 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "newpagedialog.h" #include <qbuttongroup.h> -#include <qgroupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qradiobutton.h> #include <qspinbox.h> NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, const QColor& brushColor, QWidget* parent, const char* name) : QDialog(parent, name, true) { setCaption(tr("New Page")); m_penColor = penColor; m_brushColor = brushColor; QGroupBox* generalGroupBox = new QGroupBox(0, Qt::Vertical, tr("General"), this); QLabel* titleLabel = new QLabel(tr("Title:"), generalGroupBox); m_pTitleLineEdit = new QLineEdit(generalGroupBox); QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Size"), this); QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox); QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox); m_pWidthSpinBox = new QSpinBox(1, 1024, 1, sizeGroupBox); m_pHeightSpinBox = new QSpinBox(1, 1024, 1, sizeGroupBox); m_pWidthSpinBox->setValue(width); m_pHeightSpinBox->setValue(height); m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Background"), this); diff --git a/noncore/graphics/drawpad/pointtool.cpp b/noncore/graphics/drawpad/pointtool.cpp index b9b52bc..4fb7ad1 100644 --- a/noncore/graphics/drawpad/pointtool.cpp +++ b/noncore/graphics/drawpad/pointtool.cpp @@ -1,53 +1,52 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "pointtool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include "page.h" #include <qimage.h> -#include <qpainter.h> PointTool::PointTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : Tool(drawPad, drawPadCanvas) { m_mousePressed = false; m_polyline.resize(3); } PointTool::~PointTool() { } void PointTool::mousePressEvent(QMouseEvent* e) { m_pDrawPadCanvas->backupPage(); m_mousePressed = true; m_polyline[2] = m_polyline[1] = m_polyline[0] = e->pos(); } void PointTool::mouseReleaseEvent(QMouseEvent* e) { Q_UNUSED(e) m_mousePressed = false; } void PointTool::mouseMoveEvent(QMouseEvent* e) { if (m_mousePressed) { m_polyline[2] = m_polyline[1]; m_polyline[1] = m_polyline[0]; diff --git a/noncore/graphics/drawpad/shapetool.cpp b/noncore/graphics/drawpad/shapetool.cpp index 22e3dd6..6e4276d 100644 --- a/noncore/graphics/drawpad/shapetool.cpp +++ b/noncore/graphics/drawpad/shapetool.cpp @@ -1,52 +1,51 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "shapetool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include "page.h" -#include <qpainter.h> ShapeTool::ShapeTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : Tool(drawPad, drawPadCanvas) { m_mousePressed = false; m_polyline.resize(3); } ShapeTool::~ShapeTool() { } void ShapeTool::mousePressEvent(QMouseEvent* e) { m_pDrawPadCanvas->backupPage(); m_mousePressed = true; m_polyline[2] = m_polyline[1] = m_polyline[0] = e->pos(); } void ShapeTool::mouseReleaseEvent(QMouseEvent* e) { Q_UNUSED(e) QPainter painter; painter.begin(m_pDrawPadCanvas->currentPage()->pixmap()); drawFinalShape(painter); painter.end(); QRect r = m_polyline.boundingRect(); r = r.normalize(); r.setLeft(r.left() - m_pDrawPad->pen().width()); diff --git a/noncore/graphics/drawpad/texttool.cpp b/noncore/graphics/drawpad/texttool.cpp index 9037abd..3a89e80 100644 --- a/noncore/graphics/drawpad/texttool.cpp +++ b/noncore/graphics/drawpad/texttool.cpp @@ -1,54 +1,53 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "texttool.h" #include "drawpad.h" #include "drawpadcanvas.h" #include "page.h" #include <qlayout.h> #include <qlineedit.h> -#include <qpainter.h> TextToolDialog::TextToolDialog(QWidget* parent, const char* name) : QDialog(parent, name, true) { setCaption(tr("Insert Text")); m_pLineEdit = new QLineEdit(this); QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); mainLayout->addWidget(m_pLineEdit); } TextToolDialog::~TextToolDialog() { } QString TextToolDialog::text() { return m_pLineEdit->text(); } TextTool::TextTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : Tool(drawPad, drawPadCanvas) { } TextTool::~TextTool() { } void TextTool::mousePressEvent(QMouseEvent* e) diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp index 90ba39c..1ccf484 100644 --- a/noncore/graphics/drawpad/thumbnailview.cpp +++ b/noncore/graphics/drawpad/thumbnailview.cpp @@ -1,58 +1,57 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "thumbnailview.h" #include "drawpad.h" #include "drawpadcanvas.h" #include "newpagedialog.h" #include "page.h" #include <qpe/config.h> #include <qpe/resource.h> #include <qpe/timestring.h> #include <qapplication.h> -#include <qimage.h> #include <qlayout.h> #include <qmessagebox.h> #include <qtoolbutton.h> #include <qwhatsthis.h> #define THUMBNAIL_SIZE 48 PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) : QListBoxItem(parent) { m_pPage = page; QImage image = m_pPage->pixmap()->convertToImage(); int previewWidth = THUMBNAIL_SIZE; int previewHeight = THUMBNAIL_SIZE; float widthScale = 1.0; float heightScale = 1.0; if (previewWidth < image.width()) { widthScale = (float)previewWidth / float(image.width()); } if (previewHeight < image.height()) { heightScale = (float)previewHeight / float(image.height()); } float scale = (widthScale < heightScale ? widthScale : heightScale); QImage thumbnailImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); m_thumbnail.convertFromImage(thumbnailImage); diff --git a/noncore/graphics/drawpad/tool.cpp b/noncore/graphics/drawpad/tool.cpp index 0d36912..656078e 100644 --- a/noncore/graphics/drawpad/tool.cpp +++ b/noncore/graphics/drawpad/tool.cpp @@ -1,28 +1,26 @@ /*************************************************************************** * * * DrawPad - a drawing program for Opie Environment * * * * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "tool.h" -#include "drawpad.h" -#include "drawpadcanvas.h" Tool::Tool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : QObject() { m_pDrawPad = drawPad; m_pDrawPadCanvas = drawPadCanvas; } Tool::~Tool() { } |