src/base/paintinterface.cpp \
src/base/rs_pattern.cpp \
src/base/rs_patternlist.cpp \
+ src/base/rs_pen.cpp \
src/base/rs_point.cpp \
src/base/rs_polyline.cpp \
src/base/rs_preview.cpp \
src/forms/textoptions.h \
src/forms/trimamountoptions.h \
src/forms/widgetpen.h \
- src/widgets/qg_actionhandler.h \
- src/widgets/qg_blockwidget.h \
- src/widgets/qg_colorbox.h \
- src/widgets/qg_commandedit.h \
+ src/widgets/actionhandler.h \
+ src/widgets/blockwidget.h \
+ src/widgets/colorbox.h \
+ src/widgets/commandedit.h \
src/widgets/qg_dialogfactory.h \
- src/widgets/qg_filedialog.h \
- src/widgets/qg_fontbox.h \
+ src/widgets/filedialog.h \
+ src/widgets/fontbox.h \
src/widgets/qg_graphicview.h \
- src/widgets/qg_layerbox.h \
- src/widgets/qg_layerwidget.h \
- src/widgets/qg_linetypebox.h \
- src/widgets/qg_listviewitem.h \
+ src/widgets/layerbox.h \
+ src/widgets/layerwidget.h \
+ src/widgets/linetypebox.h \
+ src/widgets/listviewitem.h \
src/widgets/qg_mainwindowinterface.h \
- src/widgets/qg_patternbox.h \
- src/widgets/qg_pentoolbar.h \
+ src/widgets/patternbox.h \
+ src/widgets/pentoolbar.h \
src/widgets/recentfiles.h \
- src/widgets/qg_widthbox.h
+ src/widgets/widthbox.h
SOURCES += \
src/forms/arcoptions.cpp \
src/forms/textoptions.cpp \
src/forms/trimamountoptions.cpp \
src/forms/widgetpen.cpp \
- src/widgets/qg_actionhandler.cpp \
- src/widgets/qg_blockwidget.cpp \
- src/widgets/qg_colorbox.cpp \
- src/widgets/qg_commandedit.cpp \
+ src/widgets/actionhandler.cpp \
+ src/widgets/blockwidget.cpp \
+ src/widgets/colorbox.cpp \
+ src/widgets/commandedit.cpp \
src/widgets/qg_dialogfactory.cpp \
- src/widgets/qg_filedialog.cpp \
- src/widgets/qg_fontbox.cpp \
+ src/widgets/filedialog.cpp \
+ src/widgets/fontbox.cpp \
src/widgets/qg_graphicview.cpp \
- src/widgets/qg_layerbox.cpp \
- src/widgets/qg_layerwidget.cpp \
- src/widgets/qg_linetypebox.cpp \
- src/widgets/qg_listviewitem.cpp \
- src/widgets/qg_patternbox.cpp \
- src/widgets/qg_pentoolbar.cpp \
+ src/widgets/layerbox.cpp \
+ src/widgets/layerwidget.cpp \
+ src/widgets/linetypebox.cpp \
+ src/widgets/listviewitem.cpp \
+ src/widgets/patternbox.cpp \
+ src/widgets/pentoolbar.cpp \
src/widgets/recentfiles.cpp \
- src/widgets/qg_widthbox.cpp
+ src/widgets/widthbox.cpp
FORMS = \
src/forms/blockdialog.ui \
* A pen stores attributes for painting such as line width,
* linetype, color, ...
*
+ * @author James Hammons
* @author Andrew Mustun
*/
class RS_Pen: public RS_Flags
{
-public:
- /**
- * Creates a default pen (black, solid, width 0).
- */
- RS_Pen() : RS_Flags() {
- setColor(RS_Color(0,0,0));
- setWidth(RS2::Width00);
- setLineType(RS2::SolidLine);
- setScreenWidth(0);
- }
- /**
- * Creates a pen with the given attributes.
- */
- RS_Pen(const RS_Color& c,
- RS2::LineWidth w,
- RS2::LineType t) : RS_Flags() {
- setColor(c);
- setWidth(w);
- setLineType(t);
- setScreenWidth(0);
- }
- /**
- * Creates a default pen with the given flags. This is
- * usually used to create invalid pens.
- *
- * e.g.:
- * <pre>
- * RS_Pen p(RS2::FlagInvalid);
- * </pre>
- */
- RS_Pen(unsigned int f) : RS_Flags(f) {
- setColor(RS_Color(0,0,0));
- setWidth(RS2::Width00);
- setLineType(RS2::SolidLine);
- setScreenWidth(0);
- }
- //RS_Pen(const RS_Pen& pen) : RS_Flags(pen.getFlags()) {
- // lineType = pen.lineType;
- // width = pen.width;
- // color = pen.color;
- //}
- virtual ~RS_Pen() {}
-
- RS2::LineType getLineType() const {
- return lineType;
- }
- void setLineType(RS2::LineType t) {
- lineType = t;
- }
- RS2::LineWidth getWidth() const {
- return width;
- }
- void setWidth(RS2::LineWidth w) {
- width = w;
- }
- double getScreenWidth() const {
- return screenWidth;
- }
- void setScreenWidth(double w) {
- screenWidth = w;
- }
- const RS_Color& getColor() const {
- return color;
- }
- void setColor(const RS_Color& c) {
- color = c;
- }
- bool isValid() {
- return !getFlag(RS2::FlagInvalid);
- }
-
- //RS_Pen& operator = (const RS_Pen& p) {
- // lineType = p.lineType;
- // width = p.width;
- // color = p.color;
- // setFlags(p.getFlags());
-
- // return *this;
- //}
-
- bool operator == (const RS_Pen& p) const {
- return (lineType==p.lineType && width==p.width && color==p.color);
- }
-
- bool operator != (const RS_Pen& p) const {
- return !(*this==p);
- }
-
- friend std::ostream& operator << (std::ostream& os, const RS_Pen& p) {
- //os << "style: " << p.style << std::endl;
- os << " pen color: " << p.getColor()
- << " pen width: " << p.getWidth()
- << " pen screen width: " << p.getScreenWidth()
- << " pen line type: " << p.getLineType()
- << " flags: " << (p.getFlag(RS2::FlagInvalid) ? "INVALID" : "")
- << std::endl;
- return os;
- }
-
-protected:
- RS2::LineType lineType;
- RS2::LineWidth width;
- double screenWidth;
- RS_Color color;
+ public:
+ RS_Pen();
+ RS_Pen(const RS_Color & c, RS2::LineWidth w, RS2::LineType t);
+ RS_Pen(unsigned int f);
+ virtual ~RS_Pen();
+
+ RS2::LineType getLineType() const;
+ void setLineType(RS2::LineType t);
+ RS2::LineWidth getWidth() const;
+ void setWidth(RS2::LineWidth w);
+ double getScreenWidth() const;
+ void setScreenWidth(double w);
+ const RS_Color & getColor() const;
+ void setColor(const RS_Color & c);
+ bool isValid();
+ bool operator==(const RS_Pen & p) const;
+ bool operator!=(const RS_Pen & p) const;
+
+ friend std::ostream & operator<<(std::ostream & os, const RS_Pen & p);
+
+ protected:
+ RS2::LineType lineType;
+ RS2::LineWidth width;
+ double screenWidth;
+ RS_Color color;
};
#endif
private:
//! all scripts available
-// Q3PtrList<RS_Script> scripts;
QList<RS_Script *> scripts;
QListIterator<RS_Script *> scriptIterator;
};
#include "rs_selection.h"
+#include "drawing.h"
+#include "rs_entity.h"
+#include "graphicview.h"
#include "rs_information.h"
#include "rs_polyline.h"
-#include "rs_entity.h"
-#include "drawing.h"
/**
* Default constructor.
*/
void RS_Selection::selectSingle(RS_Entity * e)
{
- if (e != NULL && (e->getLayer() == NULL || e->getLayer()->isLocked() == false))
+ if (e && (e->getLayer() == NULL || e->getLayer()->isLocked() == false))
{
// Same problem as below...
//[WAS]#warning "!!! This is causing a segfault in the draw code !!!"
#define RS_SELECTION_H
#include "rs_entitycontainer.h"
-#include "graphicview.h"
+
+class Drawing;
+class GraphicView;
/**
* API Class for selecting entities.
-#ifndef RS_COMMANDS_H
-#define RS_COMMANDS_H
+#ifndef __COMMANDS_H__
+#define __COMMANDS_H__
#include <QtCore>
#include "rs.h"
QMultiHash<QString, RS2::ActionType *> shortCommands;
};
-#endif
+#endif // __COMMANDS_H__
-// qg_actionhandler.cpp
+// actionhandler.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/10/2010 Added this text. :-)
//
-#include "qg_actionhandler.h"
+#include "actionhandler.h"
#include "rs_commandevent.h"
#include "commands.h"
-#ifndef QG_ACTIONHANDLER_H
-#define QG_ACTIONHANDLER_H
+#ifndef __ACTIONHANDLER_H__
+#define __ACTIONHANDLER_H__
#include <QtGui>
#include "rs.h"
QAction * lockRelativeZero;
};
-#endif
+#endif // __ACTIONHANDLER_H__
-// qg_blockwidget.cpp
+// blockwidget.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/10/2010 Added this text. :-)
//
-#include "qg_blockwidget.h"
+#include "blockwidget.h"
-#include "qg_actionhandler.h"
+#include "actionhandler.h"
#include "rs_block.h"
#include "rs_blocklist.h"
#include "rs_debug.h"
-#ifndef QG_BLOCKWIDGET_H
-#define QG_BLOCKWIDGET_H
+#ifndef __BLOCKWIDGET_H__
+#define __BLOCKWIDGET_H__
#include <QtGui>
-//#include "rs_blocklist.h"
-//#include "rs_blocklistlistener.h"
-//#include "qg_actionhandler.h"
class RS_Block;
class RS_BlockList;
* This is the Qt implementation of a widget which can view a
* block list.
*/
-class QG_BlockWidget: public QWidget//, public RS_BlockListListener
+class QG_BlockWidget: public QWidget
{
Q_OBJECT
QG_ActionHandler * actionHandler;
};
-#endif
+#endif // __BLOCKWIDGET_H__
-// qg_colorbox.cpp
+// colorbox.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "qg_colorbox.h"
+#include "colorbox.h"
+
+#include "rs.h"
/**
* Default Constructor. You must call init manually if you choose
-#ifndef QG_COLORBOX_H
-#define QG_COLORBOX_H
+#ifndef __COLORBOX_H__
+#define __COLORBOX_H__
#include <QtGui>
#include "rs_color.h"
bool unchanged;
};
-#endif
+#endif // __COLORBOX_H__
-
-#include "qg_commandedit.h"
+// commandedit.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -----------------------------------------------------------
+// JLH 05/22/2010 Added this text. :-)
+//
+
+#include "commandedit.h"
#include "rs_debug.h"
-#ifndef QG_COMMANDEDIT_H
-#define QG_COMMANDEDIT_H
+#ifndef __COMMANDEDIT_H__
+#define __COMMANDEDIT_H__
#include <QtGui>
bool acceptCoordinates;
};
-#endif
+#endif // __COMMANDEDIT_H__
-// qg_filedialog.cpp
+// filedialog.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/10/2010 Added this text. :-)
//
-#include "qg_filedialog.h"
+#include "filedialog.h"
+#include "drawing.h"
#include "qg_graphicview.h"
#include "settings.h"
#include "rs_system.h"
-#include "drawing.h"
/**
* Shows a dialog for choosing a file name. Saving the file is up to
-#ifndef QG_FILEDIALOG_H
-#define QG_FILEDIALOG_H
+#ifndef __FILEDIALOG_H__
+#define __FILEDIALOG_H__
#include <QtGui>
#include "rs.h"
static QString getSaveFileName(QWidget * parent, RS2::FormatType * type = NULL);
};
-#endif
+#endif // __FILEDIALOG_H__
-// qg_fontbox.cpp
+// fontbox.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/10/2010 Added this text. :-)
//
-#include "qg_fontbox.h"
+#include "fontbox.h"
#include "rs_debug.h"
#include "rs_font.h"
-#ifndef QG_FONTBOX_H
-#define QG_FONTBOX_H
+#ifndef __FONTBOX_H__
+#define __FONTBOX_H__
#include <QtGui>
RS_Font * currentFont;
};
-#endif
+#endif // __FONTBOX_H__
-// qg_layerbox.cpp
+// layerbox.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/11/2010 Added this text. :-)
//
-#include "qg_layerbox.h"
+#include "layerbox.h"
#include "rs_layer.h"
#include "rs_layerlist.h"
-#ifndef QG_LAYERBOX_H
-#define QG_LAYERBOX_H
+#ifndef __LAYERBOX_H__
+#define __LAYERBOX_H__
#include <QtGui>
bool unchanged;
};
-#endif
+#endif // __LAYERBOX_H__
-// qg_layerwdget.cpp
+// layerwdget.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/11/2010 Added this text. :-)
//
-#include "qg_layerwidget.h"
+#include "layerwidget.h"
-#include "qg_actionhandler.h"
+#include "actionhandler.h"
#include "rs_debug.h"
#include "rs_layer.h"
#include "rs_layerlist.h"
-#ifndef QG_LAYERWIDGET_H
-#define QG_LAYERWIDGET_H
+#ifndef __LAYERWIDGET_H__
+#define __LAYERWIDGET_H__
#include <QtGui>
-//#include "rs_layerlist.h"
-//#include "rs_layerlistlistener.h"
-//#include "qg_actionhandler.h"
class QG_ActionHandler;
class RS_Layer;
* This is the Qt implementation of a widget which can view a
* layer list and provides a user interface for basic layer actions.
*/
-class QG_LayerWidget: public QWidget//, public RS_LayerListListener
+class QG_LayerWidget: public QWidget
{
Q_OBJECT
QG_ActionHandler * actionHandler;
};
-#endif
+#endif // __LAYERWIDGET_H__
-// qg_linetypebox.cpp
+// linetypebox.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/11/2010 Added this text. :-)
//
-#include "qg_linetypebox.h"
+#include "linetypebox.h"
#include "rs_debug.h"
-#ifndef QG_LINETYPEBOX_H
-#define QG_LINETYPEBOX_H
+#ifndef __LINETYPEBOX_H__
+#define __LINETYPEBOX_H__
#include <QtGui>
#include "rs.h"
bool unchanged;
};
-#endif
+#endif // __LINETYPEBOX_H__
-
-#include "qg_listviewitem.h"
+// listviewitem.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -----------------------------------------------------------
+// JLH 08/03/2010 Added this text. :-)
+//
+
+#include "listviewitem.h"
#include <qpixmap.h>
this->id = id;
setIcon(QIcon((open ? ":/res/folderopen.xpm" : ":/res/folderclosed.xpm")));
-
setOpen(open);
}
-#ifndef QG_LISTVIEWITEM_H
-#define QG_LISTVIEWITEM_H
+#ifndef __LISTVIEWITEM_H__
+#define __LISTVIEWITEM_H__
#include <QtGui>
int id;
};
-#endif
+#endif // __LISTVIEWITEM_H__
-// qg_patternbox.cpp
+// patternbox.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/11/2010 Added this text. :-)
//
-#include "qg_patternbox.h"
+#include "patternbox.h"
#include "rs_pattern.h"
#include "rs_patternlist.h"
-#ifndef QG_PATTERNBOX_H
-#define QG_PATTERNBOX_H
+#ifndef __PATTERNBOX_H__
+#define __PATTERNBOX_H__
#include <QtGui>
RS_Pattern * currentPattern;
};
-#endif
+#endif // __PATTERNBOX_H__
-// qg_pentoolbar.cpp
+// pentoolbar.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// delete created objects in destructor to prevent memory leak
//
-#include "qg_pentoolbar.h"
+#include "pentoolbar.h"
-#include "qg_colorbox.h"
-#include "qg_widthbox.h"
-#include "qg_linetypebox.h"
+#include "colorbox.h"
+#include "widthbox.h"
+#include "linetypebox.h"
#include "rs_layer.h"
/**
-#ifndef QG_PENTOOLBAR_H
-#define QG_PENTOOLBAR_H
+#ifndef __PENTOOLBAR_H__
+#define __PENTOOLBAR_H__
#include <QtGui>
//#include "rs_layerlistlistener.h"
QG_LineTypeBox * lineTypeBox;
};
-#endif
+#endif // __PENTOOLBAR_H__
#include <QtGui>
#include "graphicview.h"
-//#include "rs_layerlistlistener.h"
-//#include "rs_blocklistlistener.h"
class RS_Document;
class PaintInterface;
* Instances of this class can be linked to layer lists using
* addLayerListListener().
*/
-class QG_GraphicView: public QWidget, public GraphicView//, //public Q3FilePreview,
-// public RS_LayerListListener, public RS_BlockListListener
+class QG_GraphicView: public QWidget, public GraphicView//, public Q3FilePreview
{
Q_OBJECT
-// qg_widthbox.cpp
+// widthbox.cpp
//
// Originally part of QCad Community Edition by Andrew Mustun
// Extensively rewritten and refactored by James L. Hammons
// JLH 05/11/2010 Added this text. :-)
//
-#include "qg_widthbox.h"
+#include "widthbox.h"
#include "rs_debug.h"
this->showUnchanged = showUnchanged;
if (showUnchanged)
-// addItem(QIcon(width00_xpm), tr("- Unchanged -"));
addItem(QIcon(":/res/width00.xpm"), tr("- Unchanged -"));
if (showByLayer)
-// addItem(QIcon(width00_xpm), tr("By Layer"));
-// addItem(QIcon(width00_xpm), tr("By Block"));
addItem(QIcon(":/res/width00.xpm"), tr("By Layer"));
addItem(QIcon(":/res/width00.xpm"), tr("By Block"));
-/* addItem(QIcon(width01_xpm), tr("Default"));
- addItem(QIcon(width01_xpm), tr("0.00mm"));
- addItem(QIcon(width01_xpm), tr("0.05mm"));
- addItem(QIcon(width01_xpm), tr("0.09mm"));
- addItem(QIcon(width01_xpm), tr("0.13mm (ISO)"));
- addItem(QIcon(width01_xpm), tr("0.15mm"));
- addItem(QIcon(width01_xpm), tr("0.18mm (ISO)"));
- addItem(QIcon(width01_xpm), tr("0.20mm"));
- addItem(QIcon(width01_xpm), tr("0.25mm (ISO)"));
- addItem(QIcon(width01_xpm), tr("0.30mm"));
- addItem(QIcon(width03_xpm), tr("0.35mm (ISO)"));
- addItem(QIcon(width03_xpm), tr("0.40mm"));
- addItem(QIcon(width04_xpm), tr("0.50mm (ISO)"));
- addItem(QIcon(width05_xpm), tr("0.53mm"));
- addItem(QIcon(width05_xpm), tr("0.60mm"));
- addItem(QIcon(width06_xpm), tr("0.70mm (ISO)"));
- addItem(QIcon(width07_xpm), tr("0.80mm"));
- addItem(QIcon(width08_xpm), tr("0.90mm"));
- addItem(QIcon(width09_xpm), tr("1.00mm (ISO)"));
- addItem(QIcon(width10_xpm), tr("1.06mm"));
- addItem(QIcon(width10_xpm), tr("1.20mm"));
- addItem(QIcon(width12_xpm), tr("1.40mm (ISO)"));
- addItem(QIcon(width12_xpm), tr("1.58mm"));
- addItem(QIcon(width12_xpm), tr("2.00mm (ISO)"));
- addItem(QIcon(width12_xpm), tr("2.11mm"));*/
addItem(QIcon(":/res/width01.xpm"), tr("Default"));
addItem(QIcon(":/res/width01.xpm"), tr("0.00mm"));
addItem(QIcon(":/res/width01.xpm"), tr("0.05mm"));
{
default:
case RS2::Width00:
-// pixmap = QPixmap(width00_xpm);
pixmap = QPixmap(":/res/width00.xpm");
break;
case RS2::Width01:
case RS2::Width02:
-// pixmap = QPixmap(width01_xpm);
pixmap = QPixmap(":/res/width01.xpm");
break;
case RS2::Width03:
case RS2::Width04:
-// pixmap = QPixmap(width02_xpm);
pixmap = QPixmap(":/res/width02.xpm");
break;
case RS2::Width05:
case RS2::Width06:
-// pixmap = QPixmap(width03_xpm);
pixmap = QPixmap(":/res/width03.xpm");
break;
case RS2::Width07:
case RS2::Width08:
-// pixmap = QPixmap(width04_xpm);
pixmap = QPixmap(":/res/width04.xpm");
break;
case RS2::Width09:
case RS2::Width10:
-// pixmap = QPixmap(width05_xpm);
pixmap = QPixmap(":/res/width05.xpm");
break;
case RS2::Width11:
case RS2::Width12:
-// pixmap = QPixmap(width06_xpm);
pixmap = QPixmap(":/res/width06.xpm");
break;
case RS2::Width13:
case RS2::Width14:
-// pixmap = QPixmap(width07_xpm);
pixmap = QPixmap(":/res/width07.xpm");
break;
case RS2::Width15:
case RS2::Width16:
-// pixmap = QPixmap(width08_xpm);
pixmap = QPixmap(":/res/width08.xpm");
break;
case RS2::Width17:
case RS2::Width18:
-// pixmap = QPixmap(width09_xpm);
pixmap = QPixmap(":/res/width09.xpm");
break;
case RS2::Width19:
case RS2::Width20:
-// pixmap = QPixmap(width10_xpm);
pixmap = QPixmap(":/res/width10.xpm");
break;
case RS2::Width21:
case RS2::Width22:
-// pixmap = QPixmap(width11_xpm);
pixmap = QPixmap(":/res/width11.xpm");
break;
case RS2::Width23:
//case RS2::Width24:
-// pixmap = QPixmap(width12_xpm);
pixmap = QPixmap(":/res/width12.xpm");
break;
}
-// changeItem(pixmap, tr("By Layer"), 0);
setItemIcon(0, QIcon(pixmap));
setItemText(0, tr("By Layer"));
-#ifndef QG_WIDTHBOX_H
-#define QG_WIDTHBOX_H
+#ifndef __WIDTHBOX_H__
+#define __WIDTHBOX_H__
#include <QtGui>
#include "rs.h"
bool unchanged;
};
-#endif
+#endif // __WIDTHBOX_H__