Mon, 08 Jul 2013 01:36:12 +0300
Renamed the color class to LDColor for clarity
src/addObjectDialog.cpp | file | annotate | diff | comparison | revisions | |
src/colorSelectDialog.cpp | file | annotate | diff | comparison | revisions | |
src/colorSelectDialog.h | file | annotate | diff | comparison | revisions | |
src/colors.cpp | file | annotate | diff | comparison | revisions | |
src/colors.h | file | annotate | diff | comparison | revisions | |
src/configDialog.cpp | file | annotate | diff | comparison | revisions | |
src/gldraw.cpp | file | annotate | diff | comparison | revisions | |
src/gui.cpp | file | annotate | diff | comparison | revisions | |
src/gui.h | file | annotate | diff | comparison | revisions |
--- a/src/addObjectDialog.cpp Mon Jul 08 01:29:28 2013 +0300 +++ b/src/addObjectDialog.cpp Mon Jul 08 01:36:12 2013 +0300 @@ -243,7 +243,7 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= void AddObjectDialog::setButtonBackground (QPushButton* button, short colnum) { - color* col = getColor ( colnum ); + LDColor* col = getColor ( colnum ); button->setIcon (getIcon ("palette")); button->setAutoFillBackground (true);
--- a/src/colorSelectDialog.cpp Mon Jul 08 01:29:28 2013 +0300 +++ b/src/colorSelectDialog.cpp Mon Jul 08 01:36:12 2013 +0300 @@ -93,7 +93,7 @@ for( short i = 0; i < MAX_COLORS; ++i ) { - color* info = ::getColor( i ); + LDColor* info = ::getColor( i ); if( !info ) continue; @@ -189,7 +189,7 @@ ulong y = (( ulong ) scenepos.y() - ( g_squareSize / 2 )) / g_squareSize; ulong idx = ( y * g_numColumns ) + x; - color* col = ::getColor( idx ); + LDColor* col = ::getColor( idx ); if( !col ) return;
--- a/src/colorSelectDialog.h Mon Jul 08 01:29:28 2013 +0300 +++ b/src/colorSelectDialog.h Mon Jul 08 01:36:12 2013 +0300 @@ -22,14 +22,14 @@ #include <QDialog> #include "common.h" -class color; +class LDColor; class Ui_ColorSelUI; class QGraphicsScene; class ColorSelector : public QDialog { Q_OBJECT - READ_PROPERTY( color*, sel, setSelection ) + READ_PROPERTY( LDColor*, sel, setSelection ) public: explicit ColorSelector( short defval = -1, QWidget* parent = null );
--- a/src/colors.cpp Mon Jul 08 01:29:28 2013 +0300 +++ b/src/colors.cpp Mon Jul 08 01:36:12 2013 +0300 @@ -23,22 +23,22 @@ #include "gui.h" #include <qcolor.h> -static color* g_LDColors[MAX_COLORS]; +static LDColor* g_LDColors[MAX_COLORS]; void initColors() { print( "%1: initializing color information.\n", __func__ ); - color* col; + LDColor* col; // Always make sure there's 16 and 24 available. They're special like that. - col = new color; + col = new LDColor; col->hexcode = "#AAAAAA"; col->faceColor = col->hexcode; col->edgeColor = Qt::black; g_LDColors[maincolor] = col; - col = new color; + col = new LDColor; col->hexcode = "#000000"; col->edgeColor = col->faceColor = Qt::black; g_LDColors[edgecolor] = col; @@ -49,7 +49,7 @@ // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -color* getColor( short colnum ) +LDColor* getColor( short colnum ) { // Check bounds if( colnum < 0 || colnum >= MAX_COLORS ) @@ -143,7 +143,7 @@ if( parseLDConfigTag( pars, "ALPHA", valuestr )) alpha = clamp<short> ( valuestr.toShort(), 0, 255 ); - color* col = new color; + LDColor* col = new LDColor; col->name = name; col->faceColor = faceColor; col->edgeColor = edgeColor;
--- a/src/colors.h Mon Jul 08 01:29:28 2013 +0300 +++ b/src/colors.h Mon Jul 08 01:36:12 2013 +0300 @@ -24,7 +24,7 @@ #define MAX_COLORS 512 -class color +class LDColor { public: str name, hexcode; @@ -37,6 +37,6 @@ uchar luma( QColor& col ); // Safely gets a color with the given number or null if no such color. -color* getColor( short colnum ); +LDColor* getColor( short colnum ); #endif // COLORS_H
--- a/src/configDialog.cpp Mon Jul 08 01:29:28 2013 +0300 +++ b/src/configDialog.cpp Mon Jul 08 01:36:12 2013 +0300 @@ -297,7 +297,7 @@ } else { - color* col = entry.col; + LDColor* col = entry.col; if( col == null ) {
--- a/src/gldraw.cpp Mon Jul 08 01:29:28 2013 +0300 +++ b/src/gldraw.cpp Mon Jul 08 01:36:12 2013 +0300 @@ -260,7 +260,7 @@ if (obj->color () == maincolor) qcol = getMainColor (); else { - color* col = getColor (obj->color ()); + LDColor* col = getColor (obj->color ()); if( col ) qcol = col->faceColor; @@ -268,7 +268,7 @@ if (obj->color () == edgecolor) { qcol = luma (m_bgcolor) < 40 ? QColor (64, 64, 64) : Qt::black; - color* col; + LDColor* col; if (!gl_blackedges && obj->parent () && (col = getColor (obj->parent ()->color ()))) qcol = col->edgeColor;
--- a/src/gui.cpp Mon Jul 08 01:29:28 2013 +0300 +++ b/src/gui.cpp Mon Jul 08 01:36:12 2013 +0300 @@ -425,7 +425,7 @@ if (colorname == "|") { meta << quickColor ({null, null, true}); } else { - color* col = getColor (colorname.toLong ()); + LDColor* col = getColor (colorname.toLong ()); assert (col != null); meta << quickColor ({col, null, false}); } @@ -672,7 +672,7 @@ { // If the object isn't in the main or edge color, draw this // list entry in said color. - color* col = getColor (obj->color ()); + LDColor* col = getColor (obj->color ()); if (col) item->setForeground (col->faceColor); } @@ -758,7 +758,7 @@ void ForgeWindow::slot_quickColor () { g_curfile->openHistory (); QToolButton* button = static_cast<QToolButton*> (sender ()); - color* col = null; + LDColor* col = null; for (quickColor entry : m_colorMeta) { if (entry.btn == button) { @@ -1102,7 +1102,7 @@ } // ============================================================================= -QIcon makeColorIcon (color* colinfo, const ushort size) { +QIcon makeColorIcon (LDColor* colinfo, const ushort size) { // Create an image object and link a painter to it. QImage img (size, size, QImage::Format_ARGB32); QPainter paint (&img); @@ -1138,7 +1138,7 @@ box->clear (); ulong row = 0; for (const auto& pair : counts) { - color* col = getColor (pair.first); + LDColor* col = getColor (pair.first); assert (col != null); QIcon ico = makeColorIcon (col, 16);
--- a/src/gui.h Mon Jul 08 01:29:28 2013 +0300 +++ b/src/gui.h Mon Jul 08 01:36:12 2013 +0300 @@ -28,7 +28,7 @@ class MessageManager; class ForgeWindow; -class color; +class LDColor; class QSplitter; class QToolButton; class QDialogButtonBox; @@ -77,7 +77,7 @@ // ============================================================================= typedef struct { - color* col; + LDColor* col; QToolButton* btn; bool isSeparator; } quickColor; @@ -188,7 +188,7 @@ bool confirm (str msg); void critical (str msg); QAction* findAction (str name); -QIcon makeColorIcon (color* colinfo, const ushort size); +QIcon makeColorIcon (LDColor* colinfo, const ushort size); void makeColorSelector (QComboBox* box); QDialogButtonBox* makeButtonBox (QDialog& dlg); CheckBoxGroup* makeAxesBox ();