From: Shamus Hammons Date: Wed, 4 Aug 2010 04:42:12 +0000 (+0000) Subject: Sanity check step 1: Renaming files... X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5a77a32dbe17d9534d3099f1fd3fdacba199516;p=architektonas Sanity check step 1: Renaming files... --- diff --git a/architektonas.pro b/architektonas.pro index ede199f..2e54521 100644 --- a/architektonas.pro +++ b/architektonas.pro @@ -157,6 +157,7 @@ SOURCES = \ 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 \ @@ -469,23 +470,23 @@ HEADERS += \ 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 \ @@ -558,22 +559,22 @@ SOURCES += \ 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 \ diff --git a/src/base/rs_pen.h b/src/base/rs_pen.h index 21b3729..4d6c9c0 100644 --- a/src/base/rs_pen.h +++ b/src/base/rs_pen.h @@ -9,114 +9,36 @@ * 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.: - *
-     *   RS_Pen p(RS2::FlagInvalid);
-     * 
- */ - 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 diff --git a/src/base/rs_scriptlist.h b/src/base/rs_scriptlist.h index c3de735..ca45ec3 100644 --- a/src/base/rs_scriptlist.h +++ b/src/base/rs_scriptlist.h @@ -37,7 +37,6 @@ class RS_ScriptList private: //! all scripts available -// Q3PtrList scripts; QList scripts; QListIterator scriptIterator; }; diff --git a/src/base/rs_selection.cpp b/src/base/rs_selection.cpp index fef5080..60863ca 100644 --- a/src/base/rs_selection.cpp +++ b/src/base/rs_selection.cpp @@ -16,10 +16,11 @@ #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. @@ -40,7 +41,7 @@ RS_Selection::RS_Selection(RS_EntityContainer & container, GraphicView * graphic */ 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 !!!" diff --git a/src/base/rs_selection.h b/src/base/rs_selection.h index e0dfea6..2e6ffb3 100644 --- a/src/base/rs_selection.h +++ b/src/base/rs_selection.h @@ -2,7 +2,9 @@ #define RS_SELECTION_H #include "rs_entitycontainer.h" -#include "graphicview.h" + +class Drawing; +class GraphicView; /** * API Class for selecting entities. diff --git a/src/mainapp/commands.h b/src/mainapp/commands.h index 12c713c..abe6c44 100644 --- a/src/mainapp/commands.h +++ b/src/mainapp/commands.h @@ -1,5 +1,5 @@ -#ifndef RS_COMMANDS_H -#define RS_COMMANDS_H +#ifndef __COMMANDS_H__ +#define __COMMANDS_H__ #include #include "rs.h" @@ -41,4 +41,4 @@ class Commands: public QObject QMultiHash shortCommands; }; -#endif +#endif // __COMMANDS_H__ diff --git a/src/widgets/qg_actionhandler.cpp b/src/widgets/actionhandler.cpp similarity index 99% rename from src/widgets/qg_actionhandler.cpp rename to src/widgets/actionhandler.cpp index f4a7b55..e65a520 100644 --- a/src/widgets/qg_actionhandler.cpp +++ b/src/widgets/actionhandler.cpp @@ -1,4 +1,4 @@ -// qg_actionhandler.cpp +// actionhandler.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,7 +14,7 @@ // JLH 05/10/2010 Added this text. :-) // -#include "qg_actionhandler.h" +#include "actionhandler.h" #include "rs_commandevent.h" #include "commands.h" diff --git a/src/widgets/qg_actionhandler.h b/src/widgets/actionhandler.h similarity index 98% rename from src/widgets/qg_actionhandler.h rename to src/widgets/actionhandler.h index ba86f02..5d3792e 100644 --- a/src/widgets/qg_actionhandler.h +++ b/src/widgets/actionhandler.h @@ -1,5 +1,5 @@ -#ifndef QG_ACTIONHANDLER_H -#define QG_ACTIONHANDLER_H +#ifndef __ACTIONHANDLER_H__ +#define __ACTIONHANDLER_H__ #include #include "rs.h" @@ -229,4 +229,4 @@ class QG_ActionHandler: public QObject QAction * lockRelativeZero; }; -#endif +#endif // __ACTIONHANDLER_H__ diff --git a/src/widgets/qg_blockwidget.cpp b/src/widgets/blockwidget.cpp similarity index 99% rename from src/widgets/qg_blockwidget.cpp rename to src/widgets/blockwidget.cpp index 4be0f71..ff518bd 100644 --- a/src/widgets/qg_blockwidget.cpp +++ b/src/widgets/blockwidget.cpp @@ -1,4 +1,4 @@ -// qg_blockwidget.cpp +// blockwidget.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,9 +14,9 @@ // 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" diff --git a/src/widgets/qg_blockwidget.h b/src/widgets/blockwidget.h similarity index 86% rename from src/widgets/qg_blockwidget.h rename to src/widgets/blockwidget.h index 701f583..784df4b 100644 --- a/src/widgets/qg_blockwidget.h +++ b/src/widgets/blockwidget.h @@ -1,10 +1,7 @@ -#ifndef QG_BLOCKWIDGET_H -#define QG_BLOCKWIDGET_H +#ifndef __BLOCKWIDGET_H__ +#define __BLOCKWIDGET_H__ #include -//#include "rs_blocklist.h" -//#include "rs_blocklistlistener.h" -//#include "qg_actionhandler.h" class RS_Block; class RS_BlockList; @@ -14,7 +11,7 @@ class QG_ActionHandler; * 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 @@ -64,4 +61,4 @@ class QG_BlockWidget: public QWidget//, public RS_BlockListListener QG_ActionHandler * actionHandler; }; -#endif +#endif // __BLOCKWIDGET_H__ diff --git a/src/widgets/qg_colorbox.cpp b/src/widgets/colorbox.cpp similarity index 99% rename from src/widgets/qg_colorbox.cpp rename to src/widgets/colorbox.cpp index 2a703ae..38a7780 100644 --- a/src/widgets/qg_colorbox.cpp +++ b/src/widgets/colorbox.cpp @@ -1,4 +1,4 @@ -// qg_colorbox.cpp +// colorbox.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,7 +14,9 @@ // 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 diff --git a/src/widgets/qg_colorbox.h b/src/widgets/colorbox.h similarity index 91% rename from src/widgets/qg_colorbox.h rename to src/widgets/colorbox.h index be9d9f6..a5e58b7 100644 --- a/src/widgets/qg_colorbox.h +++ b/src/widgets/colorbox.h @@ -1,5 +1,5 @@ -#ifndef QG_COLORBOX_H -#define QG_COLORBOX_H +#ifndef __COLORBOX_H__ +#define __COLORBOX_H__ #include #include "rs_color.h" @@ -36,4 +36,4 @@ class QG_ColorBox: public QComboBox bool unchanged; }; -#endif +#endif // __COLORBOX_H__ diff --git a/src/widgets/qg_commandedit.cpp b/src/widgets/commandedit.cpp similarity index 74% rename from src/widgets/qg_commandedit.cpp rename to src/widgets/commandedit.cpp index f345f0f..95627ba 100644 --- a/src/widgets/qg_commandedit.cpp +++ b/src/widgets/commandedit.cpp @@ -1,5 +1,20 @@ - -#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 +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 05/22/2010 Added this text. :-) +// + +#include "commandedit.h" #include "rs_debug.h" diff --git a/src/widgets/qg_commandedit.h b/src/widgets/commandedit.h similarity index 88% rename from src/widgets/qg_commandedit.h rename to src/widgets/commandedit.h index 5cc6287..b72369d 100644 --- a/src/widgets/qg_commandedit.h +++ b/src/widgets/commandedit.h @@ -1,5 +1,5 @@ -#ifndef QG_COMMANDEDIT_H -#define QG_COMMANDEDIT_H +#ifndef __COMMANDEDIT_H__ +#define __COMMANDEDIT_H__ #include @@ -33,4 +33,4 @@ class QG_CommandEdit: public QLineEdit bool acceptCoordinates; }; -#endif +#endif // __COMMANDEDIT_H__ diff --git a/src/widgets/qg_filedialog.cpp b/src/widgets/filedialog.cpp similarity index 99% rename from src/widgets/qg_filedialog.cpp rename to src/widgets/filedialog.cpp index 7410e43..0ee35dd 100644 --- a/src/widgets/qg_filedialog.cpp +++ b/src/widgets/filedialog.cpp @@ -1,4 +1,4 @@ -// qg_filedialog.cpp +// filedialog.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,12 +14,12 @@ // 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 diff --git a/src/widgets/qg_filedialog.h b/src/widgets/filedialog.h similarity index 82% rename from src/widgets/qg_filedialog.h rename to src/widgets/filedialog.h index c885341..33f3b18 100644 --- a/src/widgets/qg_filedialog.h +++ b/src/widgets/filedialog.h @@ -1,5 +1,5 @@ -#ifndef QG_FILEDIALOG_H -#define QG_FILEDIALOG_H +#ifndef __FILEDIALOG_H__ +#define __FILEDIALOG_H__ #include #include "rs.h" @@ -17,4 +17,4 @@ class QG_FileDialog static QString getSaveFileName(QWidget * parent, RS2::FormatType * type = NULL); }; -#endif +#endif // __FILEDIALOG_H__ diff --git a/src/widgets/qg_fontbox.cpp b/src/widgets/fontbox.cpp similarity index 98% rename from src/widgets/qg_fontbox.cpp rename to src/widgets/fontbox.cpp index cea6551..8ea742b 100644 --- a/src/widgets/qg_fontbox.cpp +++ b/src/widgets/fontbox.cpp @@ -1,4 +1,4 @@ -// qg_fontbox.cpp +// fontbox.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,7 +14,7 @@ // JLH 05/10/2010 Added this text. :-) // -#include "qg_fontbox.h" +#include "fontbox.h" #include "rs_debug.h" #include "rs_font.h" diff --git a/src/widgets/qg_fontbox.h b/src/widgets/fontbox.h similarity index 86% rename from src/widgets/qg_fontbox.h rename to src/widgets/fontbox.h index 6841f79..e5eb61a 100644 --- a/src/widgets/qg_fontbox.h +++ b/src/widgets/fontbox.h @@ -1,5 +1,5 @@ -#ifndef QG_FONTBOX_H -#define QG_FONTBOX_H +#ifndef __FONTBOX_H__ +#define __FONTBOX_H__ #include @@ -30,4 +30,4 @@ class QG_FontBox: public QComboBox RS_Font * currentFont; }; -#endif +#endif // __FONTBOX_H__ diff --git a/src/widgets/qg_layerbox.cpp b/src/widgets/layerbox.cpp similarity index 98% rename from src/widgets/qg_layerbox.cpp rename to src/widgets/layerbox.cpp index 2da7e32..d8a8797 100644 --- a/src/widgets/qg_layerbox.cpp +++ b/src/widgets/layerbox.cpp @@ -1,4 +1,4 @@ -// qg_layerbox.cpp +// layerbox.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,7 +14,7 @@ // JLH 05/11/2010 Added this text. :-) // -#include "qg_layerbox.h" +#include "layerbox.h" #include "rs_layer.h" #include "rs_layerlist.h" diff --git a/src/widgets/qg_layerbox.h b/src/widgets/layerbox.h similarity index 90% rename from src/widgets/qg_layerbox.h rename to src/widgets/layerbox.h index f266288..f4ebb86 100644 --- a/src/widgets/qg_layerbox.h +++ b/src/widgets/layerbox.h @@ -1,5 +1,5 @@ -#ifndef QG_LAYERBOX_H -#define QG_LAYERBOX_H +#ifndef __LAYERBOX_H__ +#define __LAYERBOX_H__ #include @@ -37,4 +37,4 @@ class QG_LayerBox: public QComboBox bool unchanged; }; -#endif +#endif // __LAYERBOX_H__ diff --git a/src/widgets/qg_layerwidget.cpp b/src/widgets/layerwidget.cpp similarity index 99% rename from src/widgets/qg_layerwidget.cpp rename to src/widgets/layerwidget.cpp index bb422c0..28e5f6f 100644 --- a/src/widgets/qg_layerwidget.cpp +++ b/src/widgets/layerwidget.cpp @@ -1,4 +1,4 @@ -// qg_layerwdget.cpp +// layerwdget.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,9 +14,9 @@ // 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" diff --git a/src/widgets/qg_layerwidget.h b/src/widgets/layerwidget.h similarity index 86% rename from src/widgets/qg_layerwidget.h rename to src/widgets/layerwidget.h index bddf87e..b9e4e5a 100644 --- a/src/widgets/qg_layerwidget.h +++ b/src/widgets/layerwidget.h @@ -1,10 +1,7 @@ -#ifndef QG_LAYERWIDGET_H -#define QG_LAYERWIDGET_H +#ifndef __LAYERWIDGET_H__ +#define __LAYERWIDGET_H__ #include -//#include "rs_layerlist.h" -//#include "rs_layerlistlistener.h" -//#include "qg_actionhandler.h" class QG_ActionHandler; class RS_Layer; @@ -14,7 +11,7 @@ class RS_LayerList; * 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 @@ -66,4 +63,4 @@ class QG_LayerWidget: public QWidget//, public RS_LayerListListener QG_ActionHandler * actionHandler; }; -#endif +#endif // __LAYERWIDGET_H__ diff --git a/src/widgets/qg_linetypebox.cpp b/src/widgets/linetypebox.cpp similarity index 99% rename from src/widgets/qg_linetypebox.cpp rename to src/widgets/linetypebox.cpp index b180acf..7240616 100644 --- a/src/widgets/qg_linetypebox.cpp +++ b/src/widgets/linetypebox.cpp @@ -1,4 +1,4 @@ -// qg_linetypebox.cpp +// linetypebox.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,7 +14,7 @@ // JLH 05/11/2010 Added this text. :-) // -#include "qg_linetypebox.h" +#include "linetypebox.h" #include "rs_debug.h" diff --git a/src/widgets/qg_linetypebox.h b/src/widgets/linetypebox.h similarity index 90% rename from src/widgets/qg_linetypebox.h rename to src/widgets/linetypebox.h index 287a9f3..e00ce0c 100644 --- a/src/widgets/qg_linetypebox.h +++ b/src/widgets/linetypebox.h @@ -1,5 +1,5 @@ -#ifndef QG_LINETYPEBOX_H -#define QG_LINETYPEBOX_H +#ifndef __LINETYPEBOX_H__ +#define __LINETYPEBOX_H__ #include #include "rs.h" @@ -35,4 +35,4 @@ class QG_LineTypeBox: public QComboBox bool unchanged; }; -#endif +#endif // __LINETYPEBOX_H__ diff --git a/src/widgets/qg_listviewitem.cpp b/src/widgets/listviewitem.cpp similarity index 77% rename from src/widgets/qg_listviewitem.cpp rename to src/widgets/listviewitem.cpp index 4d01feb..c9baaa2 100644 --- a/src/widgets/qg_listviewitem.cpp +++ b/src/widgets/listviewitem.cpp @@ -1,5 +1,20 @@ - -#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 +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 08/03/2010 Added this text. :-) +// + +#include "listviewitem.h" #include @@ -14,7 +29,6 @@ QG_ListViewItem::QG_ListViewItem(QListWidget * par, const QString & label, this->id = id; setIcon(QIcon((open ? ":/res/folderopen.xpm" : ":/res/folderclosed.xpm"))); - setOpen(open); } diff --git a/src/widgets/qg_listviewitem.h b/src/widgets/listviewitem.h similarity index 89% rename from src/widgets/qg_listviewitem.h rename to src/widgets/listviewitem.h index 334390d..87f6d6b 100644 --- a/src/widgets/qg_listviewitem.h +++ b/src/widgets/listviewitem.h @@ -1,5 +1,5 @@ -#ifndef QG_LISTVIEWITEM_H -#define QG_LISTVIEWITEM_H +#ifndef __LISTVIEWITEM_H__ +#define __LISTVIEWITEM_H__ #include @@ -31,4 +31,4 @@ class QG_ListViewItem : public QListWidgetItem int id; }; -#endif +#endif // __LISTVIEWITEM_H__ diff --git a/src/widgets/qg_patternbox.cpp b/src/widgets/patternbox.cpp similarity index 97% rename from src/widgets/qg_patternbox.cpp rename to src/widgets/patternbox.cpp index 8ee3242..0ce3a9e 100644 --- a/src/widgets/qg_patternbox.cpp +++ b/src/widgets/patternbox.cpp @@ -1,4 +1,4 @@ -// qg_patternbox.cpp +// patternbox.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,7 +14,7 @@ // JLH 05/11/2010 Added this text. :-) // -#include "qg_patternbox.h" +#include "patternbox.h" #include "rs_pattern.h" #include "rs_patternlist.h" diff --git a/src/widgets/qg_patternbox.h b/src/widgets/patternbox.h similarity index 86% rename from src/widgets/qg_patternbox.h rename to src/widgets/patternbox.h index 88fa461..aeaf819 100644 --- a/src/widgets/qg_patternbox.h +++ b/src/widgets/patternbox.h @@ -1,5 +1,5 @@ -#ifndef QG_PATTERNBOX_H -#define QG_PATTERNBOX_H +#ifndef __PATTERNBOX_H__ +#define __PATTERNBOX_H__ #include @@ -30,4 +30,4 @@ class QG_PatternBox: public QComboBox RS_Pattern * currentPattern; }; -#endif +#endif // __PATTERNBOX_H__ diff --git a/src/widgets/qg_pentoolbar.cpp b/src/widgets/pentoolbar.cpp similarity index 96% rename from src/widgets/qg_pentoolbar.cpp rename to src/widgets/pentoolbar.cpp index 426d915..87bfbe4 100644 --- a/src/widgets/qg_pentoolbar.cpp +++ b/src/widgets/pentoolbar.cpp @@ -1,4 +1,4 @@ -// qg_pentoolbar.cpp +// pentoolbar.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -16,11 +16,11 @@ // 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" /** diff --git a/src/widgets/qg_pentoolbar.h b/src/widgets/pentoolbar.h similarity index 91% rename from src/widgets/qg_pentoolbar.h rename to src/widgets/pentoolbar.h index 2b976e8..0a0fd5a 100644 --- a/src/widgets/qg_pentoolbar.h +++ b/src/widgets/pentoolbar.h @@ -1,5 +1,5 @@ -#ifndef QG_PENTOOLBAR_H -#define QG_PENTOOLBAR_H +#ifndef __PENTOOLBAR_H__ +#define __PENTOOLBAR_H__ #include //#include "rs_layerlistlistener.h" @@ -42,4 +42,4 @@ class QG_PenToolBar: public QToolBar//, public RS_LayerListListener QG_LineTypeBox * lineTypeBox; }; -#endif +#endif // __PENTOOLBAR_H__ diff --git a/src/widgets/qg_graphicview.h b/src/widgets/qg_graphicview.h index 9d4cf8c..6990d92 100644 --- a/src/widgets/qg_graphicview.h +++ b/src/widgets/qg_graphicview.h @@ -3,8 +3,6 @@ #include #include "graphicview.h" -//#include "rs_layerlistlistener.h" -//#include "rs_blocklistlistener.h" class RS_Document; class PaintInterface; @@ -17,8 +15,7 @@ class RS_Preview; * 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 diff --git a/src/widgets/qg_widthbox.cpp b/src/widgets/widthbox.cpp similarity index 83% rename from src/widgets/qg_widthbox.cpp rename to src/widgets/widthbox.cpp index 43afbfb..da3336d 100644 --- a/src/widgets/qg_widthbox.cpp +++ b/src/widgets/widthbox.cpp @@ -1,4 +1,4 @@ -// qg_widthbox.cpp +// widthbox.cpp // // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons @@ -13,7 +13,7 @@ // JLH 05/11/2010 Added this text. :-) // -#include "qg_widthbox.h" +#include "widthbox.h" #include "rs_debug.h" @@ -59,40 +59,12 @@ void QG_WidthBox::init(bool showByLayer, bool showUnchanged) 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")); @@ -247,72 +219,58 @@ void QG_WidthBox::setLayerWidth(RS2::LineWidth w) { 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")); diff --git a/src/widgets/qg_widthbox.h b/src/widgets/widthbox.h similarity index 90% rename from src/widgets/qg_widthbox.h rename to src/widgets/widthbox.h index b1c1444..f7a9210 100644 --- a/src/widgets/qg_widthbox.h +++ b/src/widgets/widthbox.h @@ -1,5 +1,5 @@ -#ifndef QG_WIDTHBOX_H -#define QG_WIDTHBOX_H +#ifndef __WIDTHBOX_H__ +#define __WIDTHBOX_H__ #include #include "rs.h" @@ -35,4 +35,4 @@ class QG_WidthBox: public QComboBox bool unchanged; }; -#endif +#endif // __WIDTHBOX_H__