Changed COLOR4D defines to static consts
This commit is contained in:
parent
3ec8941ffc
commit
0dc88bb4cf
|
@ -106,7 +106,7 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const TEXTE_PCB* aTextPCB,
|
|||
s_boardBBox3DU = &m_board2dBBox3DU;
|
||||
|
||||
// not actually used, but needed by DrawGraphicText
|
||||
const COLOR4D dummy_color = COLOR4D_BLACK;
|
||||
const COLOR4D dummy_color = COLOR4D::BLACK;
|
||||
|
||||
if( aTextPCB->IsMultilineAllowed() )
|
||||
{
|
||||
|
|
|
@ -112,7 +112,7 @@ COLOR4D COLORS_DESIGN_SETTINGS::GetLayerColor( LAYER_NUM aLayer ) const
|
|||
{
|
||||
return m_LayersColors[aLayer];
|
||||
}
|
||||
return UNSPECIFIED_COLOR4D;
|
||||
return COLOR4D::UNSPECIFIED;
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,7 +132,7 @@ COLOR4D COLORS_DESIGN_SETTINGS::GetItemColor( int aItemIdx ) const
|
|||
return m_ItemsColors[aItemIdx];
|
||||
}
|
||||
|
||||
return UNSPECIFIED_COLOR4D;
|
||||
return COLOR4D::UNSPECIFIED;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
|||
|
||||
SetDefaultLineWidth( 0 ); // No line width on DXF
|
||||
m_plotMirror = false; // No mirroring on DXF
|
||||
m_currentColor = COLOR4D_BLACK;
|
||||
m_currentColor = COLOR4D::BLACK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,13 +280,13 @@ void DXF_PLOTTER::SetColor( COLOR4D color )
|
|||
{
|
||||
wxASSERT( outputFile );
|
||||
if( ( colorMode )
|
||||
|| ( color == COLOR4D_BLACK )
|
||||
|| ( color == COLOR4D_WHITE ) )
|
||||
|| ( color == COLOR4D::BLACK )
|
||||
|| ( color == COLOR4D::WHITE ) )
|
||||
{
|
||||
m_currentColor = color;
|
||||
}
|
||||
else
|
||||
m_currentColor = COLOR4D_BLACK;
|
||||
m_currentColor = COLOR4D::BLACK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,7 +72,7 @@ void PSLIKE_PLOTTER::SetColor( COLOR4D color )
|
|||
* holes in white on pads in black
|
||||
*/
|
||||
double k = 1; // White
|
||||
if( color != COLOR4D_WHITE )
|
||||
if( color != COLOR4D::WHITE )
|
||||
k = 0;
|
||||
if( negativeMode )
|
||||
emitSetRGBColor( 1 - k, 1 - k, 1 - k );
|
||||
|
|
|
@ -79,7 +79,7 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
|||
*/
|
||||
double iusPerMil = plotter->GetIUsPerDecimil() * 10.0;
|
||||
|
||||
COLOR4D plotColor = plotter->GetColorMode() ? COLOR4D( RED ) : COLOR4D_BLACK;
|
||||
COLOR4D plotColor = plotter->GetColorMode() ? COLOR4D( RED ) : COLOR4D::BLACK;
|
||||
plotter->SetColor( plotColor );
|
||||
WS_DRAW_ITEM_LIST drawList;
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ void PARAM_CFG_SETCOLOR::ReadParam( wxConfigBase* aConfig ) const
|
|||
|
||||
// First try reading old format
|
||||
EDA_COLOR_T itmp = ColorByName( aConfig->Read( m_Ident, wxT( "NONE" ) ) );
|
||||
COLOR4D wtmp = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D wtmp = COLOR4D::UNSPECIFIED;
|
||||
|
||||
if( itmp == UNSPECIFIED_COLOR )
|
||||
{
|
||||
|
|
|
@ -314,7 +314,7 @@ void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
|||
aDrawMode, aFillMode, GetShownText(), GetTextPos() );
|
||||
|
||||
// Draw text anchor, if requested
|
||||
if( aAnchor_color != UNSPECIFIED_COLOR4D )
|
||||
if( aAnchor_color != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
GRDrawAnchor( aClipBox, aDC,
|
||||
GetTextPos().x + aOffset.x, GetTextPos().y + aOffset.y,
|
||||
|
@ -511,7 +511,7 @@ void EDA_TEXT::TransformTextShapeToSegmentList( std::vector<wxPoint>& aCornerBuf
|
|||
size.x = -size.x;
|
||||
|
||||
s_cornerBuffer = &aCornerBuffer;
|
||||
COLOR4D color = COLOR4D_BLACK; // not actually used, but needed by DrawGraphicText
|
||||
COLOR4D color = COLOR4D::BLACK; // not actually used, but needed by DrawGraphicText
|
||||
|
||||
if( IsMultilineAllowed() )
|
||||
{
|
||||
|
|
|
@ -81,10 +81,10 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
|
|||
static std::map< std::pair< uint32_t, uint32_t >, uint32_t > mix_cache;
|
||||
|
||||
// First easy thing: a black gives always the other colour
|
||||
if( *this == COLOR4D_BLACK )
|
||||
if( *this == COLOR4D::BLACK )
|
||||
return aColor;
|
||||
|
||||
if( aColor == COLOR4D_BLACK )
|
||||
if( aColor == COLOR4D::BLACK )
|
||||
return *this;
|
||||
|
||||
uint32_t myPackedColor = ToU32();
|
||||
|
@ -95,11 +95,11 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
|
|||
* an answer */
|
||||
auto search = mix_cache.find( std::pair< uint32_t, uint32_t >( myPackedColor,
|
||||
aPackedColor ) );
|
||||
COLOR4D candidate = COLOR4D_BLACK;
|
||||
COLOR4D candidate = COLOR4D::BLACK;
|
||||
if( search != mix_cache.end() )
|
||||
candidate.FromU32( search->second );
|
||||
|
||||
if( candidate != COLOR4D_BLACK )
|
||||
if( candidate != COLOR4D::BLACK )
|
||||
return candidate;
|
||||
|
||||
// Blend the two colors (i.e. OR the RGB values)
|
||||
|
@ -112,7 +112,7 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
|
|||
/* Here, BLACK is *not* a good answer, since it would recompute the next time.
|
||||
* Even theorically its not possible (with the current rules), but
|
||||
* maybe the metric will change in the future */
|
||||
if( candidate == COLOR4D_BLACK )
|
||||
if( candidate == COLOR4D::BLACK )
|
||||
candidate = COLOR4D( DARKDARKGRAY );
|
||||
|
||||
// Store the result in the cache. The operation is commutative, too
|
||||
|
@ -214,7 +214,8 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
|
|||
}
|
||||
else
|
||||
{
|
||||
for( EDA_COLOR_T candidate = BLACK; candidate < NBCOLORS; candidate = NextColor(candidate) )
|
||||
for( EDA_COLOR_T candidate = ::BLACK;
|
||||
candidate < NBCOLORS; candidate = NextColor( candidate ) )
|
||||
{
|
||||
double ch, cs, cv;
|
||||
|
||||
|
@ -245,7 +246,8 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
|
|||
|
||||
// Now we have the desired hue; let's find the nearest value
|
||||
minDist = 1.0;
|
||||
for( EDA_COLOR_T candidate = BLACK; candidate < NBCOLORS; candidate = NextColor(candidate) )
|
||||
for( EDA_COLOR_T candidate = ::BLACK;
|
||||
candidate < NBCOLORS; candidate = NextColor( candidate ) )
|
||||
{
|
||||
// If the target hue is NAN, we didn't extract the value for any colors above
|
||||
if( std::isnan( legacyHue ) )
|
||||
|
@ -407,3 +409,7 @@ COLOR4D& COLOR4D::Saturate( double aFactor )
|
|||
|
||||
return *this;
|
||||
}
|
||||
|
||||
const COLOR4D COLOR4D::UNSPECIFIED( 0, 0, 0, 0 );
|
||||
const COLOR4D COLOR4D::WHITE( 1, 1, 1, 1 );
|
||||
const COLOR4D COLOR4D::BLACK( 0, 0, 0, 1 );
|
||||
|
|
|
@ -196,8 +196,8 @@ static void WinClipAndDrawLine( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int
|
|||
void GRResetPenAndBrush( wxDC* DC )
|
||||
{
|
||||
GRSetBrush( DC, BLACK ); // Force no fill
|
||||
s_DC_lastbrushcolor = UNSPECIFIED_COLOR4D;
|
||||
s_DC_lastcolor = UNSPECIFIED_COLOR4D;
|
||||
s_DC_lastbrushcolor = COLOR4D::UNSPECIFIED;
|
||||
s_DC_lastcolor = COLOR4D::UNSPECIFIED;
|
||||
s_DC_lastDC = NULL;
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ void GRSetColorPen( wxDC* DC, COLOR4D Color, int width, wxPenStyle style )
|
|||
width = DC->DeviceToLogicalXRel( 1 );
|
||||
|
||||
if( s_ForceBlackPen )
|
||||
Color = COLOR4D_BLACK;
|
||||
Color = COLOR4D::BLACK;
|
||||
|
||||
const wxPen& curr_pen = DC->GetPen();
|
||||
|
||||
|
@ -240,7 +240,7 @@ void GRSetColorPen( wxDC* DC, COLOR4D Color, int width, wxPenStyle style )
|
|||
void GRSetBrush( wxDC* DC, COLOR4D Color, bool fill )
|
||||
{
|
||||
if( s_ForceBlackPen )
|
||||
Color = COLOR4D_BLACK;
|
||||
Color = COLOR4D::BLACK;
|
||||
|
||||
if( s_DC_lastbrushcolor != Color
|
||||
|| s_DC_lastbrushfill != fill
|
||||
|
@ -377,10 +377,10 @@ void GRDashedLine( EDA_RECT* ClipBox, wxDC* DC,
|
|||
{
|
||||
GRLastMoveToX = x2;
|
||||
GRLastMoveToY = y2;
|
||||
s_DC_lastcolor = UNSPECIFIED_COLOR4D;
|
||||
s_DC_lastcolor = COLOR4D::UNSPECIFIED;
|
||||
GRSetColorPen( DC, Color, width, wxPENSTYLE_SHORT_DASH );
|
||||
WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
|
||||
s_DC_lastcolor = UNSPECIFIED_COLOR4D;
|
||||
s_DC_lastcolor = COLOR4D::UNSPECIFIED;
|
||||
GRSetColorPen( DC, Color, width );
|
||||
}
|
||||
|
||||
|
|
|
@ -191,9 +191,9 @@ void WS_DRAW_ITEM_TEXT::DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint
|
|||
GR_DRAWMODE aDrawMode, COLOR4D aColor )
|
||||
{
|
||||
Draw( aClipBox, aDC, aOffset,
|
||||
aColor == UNSPECIFIED_COLOR4D ? GetColor() : aColor,
|
||||
aColor == COLOR4D::UNSPECIFIED ? GetColor() : aColor,
|
||||
aDrawMode == UNSPECIFIED_DRAWMODE ? GR_COPY : aDrawMode,
|
||||
FILLED, UNSPECIFIED_COLOR4D );
|
||||
FILLED, COLOR4D::UNSPECIFIED );
|
||||
}
|
||||
|
||||
|
||||
|
@ -238,7 +238,7 @@ void WS_DRAW_ITEM_POLYGON::DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPo
|
|||
points = &m_Corners[0];
|
||||
}
|
||||
|
||||
auto color = ( aColor == UNSPECIFIED_COLOR4D ) ? GetColor() : aColor;
|
||||
auto color = ( aColor == COLOR4D::UNSPECIFIED ) ? GetColor() : aColor;
|
||||
|
||||
GRSetDrawMode( aDC, ( aDrawMode == UNSPECIFIED_DRAWMODE ? GR_COPY : aDrawMode ) );
|
||||
GRPoly( aClipBox, aDC,
|
||||
|
@ -295,7 +295,7 @@ void WS_DRAW_ITEM_RECT::DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint
|
|||
GetStart().x + aOffset.x, GetStart().y + aOffset.y,
|
||||
GetEnd().x + aOffset.x, GetEnd().y + aOffset.y,
|
||||
GetPenWidth(),
|
||||
( aColor == UNSPECIFIED_COLOR4D ) ? GetColor() : aColor );
|
||||
( aColor == COLOR4D::UNSPECIFIED ) ? GetColor() : aColor );
|
||||
GRSetDrawMode( aDC, GR_COPY );
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ void WS_DRAW_ITEM_LINE::DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint
|
|||
GRSetDrawMode( aDC, ( aDrawMode == UNSPECIFIED_DRAWMODE ) ? GR_COPY : aDrawMode );
|
||||
GRLine( aClipBox, aDC, GetStart() + aOffset, GetEnd() + aOffset,
|
||||
GetPenWidth(),
|
||||
( aColor == UNSPECIFIED_COLOR4D ) ? GetColor() : aColor );
|
||||
( aColor == COLOR4D::UNSPECIFIED ) ? GetColor() : aColor );
|
||||
GRSetDrawMode( aDC, GR_COPY );
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ COLOR4D DisplayColorFrame( wxWindow* aParent, COLOR4D aOldColor )
|
|||
return dlg.GetSelectedColor();
|
||||
}
|
||||
|
||||
return UNSPECIFIED_COLOR4D;
|
||||
return COLOR4D::UNSPECIFIED;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset,
|
|||
* If the color is not the default color (aColor != -1 )
|
||||
*/
|
||||
if( ! ( screen && screen->m_IsPrinting && GetGRForceBlackPenState() )
|
||||
&& ( aOpts.color == UNSPECIFIED_COLOR4D ) )
|
||||
&& ( aOpts.color == COLOR4D::UNSPECIFIED ) )
|
||||
{
|
||||
for( LIB_ITEM& drawItem : drawings )
|
||||
{
|
||||
|
@ -560,7 +560,7 @@ void LIB_PART::RemoveDrawItem( LIB_ITEM* aItem, EDA_DRAW_PANEL* aPanel, wxDC* aD
|
|||
if( *i == aItem )
|
||||
{
|
||||
if( aDc != NULL )
|
||||
aItem->Draw( aPanel, aDc, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D,
|
||||
aItem->Draw( aPanel, aDc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED,
|
||||
g_XorMode, NULL, DefaultTransform );
|
||||
|
||||
drawings.erase( i );
|
||||
|
|
|
@ -218,7 +218,7 @@ public:
|
|||
* @param aColor The drawing color.
|
||||
*/
|
||||
void Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, GR_DRAWMODE aDrawMode,
|
||||
COLOR4D aColor = UNSPECIFIED_COLOR4D );
|
||||
COLOR4D aColor = COLOR4D::UNSPECIFIED );
|
||||
|
||||
/**
|
||||
* Function Plot
|
||||
|
|
|
@ -104,7 +104,7 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
|
|||
// This is a flag for m_dummyPin->Draw
|
||||
uintptr_t flags = uintptr_t( PIN_DRAW_TEXTS | PIN_DRAW_DANGLING );
|
||||
|
||||
m_dummyPin->Draw( NULL, &dc, offset, UNSPECIFIED_COLOR4D, GR_COPY,
|
||||
m_dummyPin->Draw( NULL, &dc, offset, COLOR4D::UNSPECIFIED, GR_COPY,
|
||||
(void*)flags, DefaultTransform );
|
||||
|
||||
m_dummyPin->SetParent(NULL);
|
||||
|
|
|
@ -233,7 +233,7 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
|
|||
for( LAYERSCH_ID ii = LAYER_FIRST; ii < LAYERSCH_ID_COUNT; ++ii )
|
||||
SetLayerColor( COLOR4D( DARKGRAY ), ii );
|
||||
|
||||
SetLayerColor( COLOR4D_WHITE, LAYER_BACKGROUND );
|
||||
SetLayerColor( COLOR4D::WHITE, LAYER_BACKGROUND );
|
||||
|
||||
// Must be called before creating the main frame in order to
|
||||
// display the real hotkeys in menus or tool tips
|
||||
|
|
|
@ -421,7 +421,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
|
|||
wxPoint pos1, pos2, posc;
|
||||
COLOR4D color = GetLayerColor( LAYER_DEVICE );
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
@ -448,7 +448,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
|
|||
|
||||
FILL_T fill = aData ? NO_FILL : m_Fill;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
fill = NO_FILL;
|
||||
|
||||
EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL;
|
||||
|
|
|
@ -303,7 +303,7 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
PolyPointsTraslated.push_back( aTransform.TransformCoordinate( m_PolyPoints[i] ) +
|
||||
aOffset );
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
@ -315,7 +315,7 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
|
||||
FILL_T fill = aData ? NO_FILL : m_Fill;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
fill = NO_FILL;
|
||||
|
||||
GRSetDrawMode( aDC, aDrawMode );
|
||||
|
|
|
@ -215,7 +215,7 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
|
||||
COLOR4D color = GetLayerColor( LAYER_DEVICE );
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
@ -229,7 +229,7 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
GRSetDrawMode( aDC, aDrawMode );
|
||||
|
||||
FILL_T fill = aData ? NO_FILL : m_Fill;
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
fill = NO_FILL;
|
||||
|
||||
EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL;
|
||||
|
|
|
@ -84,7 +84,7 @@ class LIB_ITEM : public EDA_ITEM
|
|||
* @param aDC A pointer to the device context used to draw the object.
|
||||
* @param aOffset A reference to a wxPoint object containing the offset where to draw
|
||||
* from the object's current position.
|
||||
* @param aColor A COLOR4D to draw the object or UNSPECIFIED_COLOR4D to draw
|
||||
* @param aColor A COLOR4D to draw the object or COLOR4D::UNSPECIFIED to draw
|
||||
* the object in it's default color.
|
||||
* @param aDrawMode The mode used to perform the draw (#GR_OR, #GR_COPY, etc.).
|
||||
* @param aData A pointer to any object specific data required to perform the draw.
|
||||
|
@ -207,7 +207,7 @@ public:
|
|||
* @param aPanel DrawPanel to use (can be null) mainly used for clipping purposes.
|
||||
* @param aDC Device Context (can be null)
|
||||
* @param aOffset Offset to draw
|
||||
* @param aColor Draw color, or UNSPECIFIED_COLOR4D to use the normal body item color
|
||||
* @param aColor Draw color, or COLOR4D::UNSPECIFIED to use the normal body item color
|
||||
* @param aDrawMode GR_OR, GR_XOR, ...
|
||||
* @param aData Value or pointer used to pass others parameters, depending on body items.
|
||||
* Used for some items to force to force no fill mode ( has meaning only for
|
||||
|
|
|
@ -291,7 +291,7 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
|
|||
const TRANSFORM& aTransform )
|
||||
{
|
||||
wxPoint text_pos;
|
||||
COLOR4D color = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D color = COLOR4D::UNSPECIFIED;
|
||||
int linewidth = GetPenSize();
|
||||
|
||||
if( IsBold() )
|
||||
|
@ -299,11 +299,11 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
|
|||
else
|
||||
linewidth = Clamp_Text_PenSize( linewidth, GetTextSize(), IsBold() );
|
||||
|
||||
if( !IsVisible() && ( aColor == UNSPECIFIED_COLOR4D ) )
|
||||
if( !IsVisible() && ( aColor == COLOR4D::UNSPECIFIED ) )
|
||||
{
|
||||
color = GetInvisibleItemColor();
|
||||
}
|
||||
else if( IsSelected() && ( aColor == UNSPECIFIED_COLOR4D ) )
|
||||
else if( IsSelected() && ( aColor == COLOR4D::UNSPECIFIED ) )
|
||||
{
|
||||
color = GetItemSelectedColor();
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
|
|||
color = aColor;
|
||||
}
|
||||
|
||||
if( color == UNSPECIFIED_COLOR4D )
|
||||
if( color == COLOR4D::UNSPECIFIED )
|
||||
color = GetDefaultColor();
|
||||
|
||||
text_pos = aTransform.TransformCoordinate( GetTextPos() ) + aOffset;
|
||||
|
|
|
@ -993,7 +993,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
|
||||
COLOR4D color = GetLayerColor( LAYER_PIN );
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
@ -1210,12 +1210,12 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
|
|||
EDA_RECT* clipbox = panel? panel->GetClipBox() : NULL;
|
||||
|
||||
/* Get the num and name colors */
|
||||
if( ( Color == UNSPECIFIED_COLOR4D ) && IsSelected() )
|
||||
if( ( Color == COLOR4D::UNSPECIFIED ) && IsSelected() )
|
||||
Color = GetItemSelectedColor();
|
||||
|
||||
COLOR4D NameColor = Color == UNSPECIFIED_COLOR4D ?
|
||||
COLOR4D NameColor = Color == COLOR4D::UNSPECIFIED ?
|
||||
GetLayerColor( LAYER_PINNAM ) : Color;
|
||||
COLOR4D NumColor = Color == UNSPECIFIED_COLOR4D ?
|
||||
COLOR4D NumColor = Color == COLOR4D::UNSPECIFIED ?
|
||||
GetLayerColor( LAYER_PINNUM ) : Color;
|
||||
|
||||
/* Create the pin num string */
|
||||
|
@ -1411,7 +1411,7 @@ void LIB_PIN::DrawPinElectricalTypeName( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
int pensize = etextSize/6;
|
||||
|
||||
// Get a suitable color
|
||||
if( ( aColor == UNSPECIFIED_COLOR4D ) && IsSelected() )
|
||||
if( ( aColor == COLOR4D::UNSPECIFIED ) && IsSelected() )
|
||||
aColor = GetItemSelectedColor();
|
||||
else if( !IsVisible() )
|
||||
aColor = GetInvisibleItemColor();
|
||||
|
|
|
@ -85,7 +85,7 @@ class LIB_PIN : public LIB_ITEM
|
|||
* @param aPanel DrawPanel to use (can be null) mainly used for clipping purposes.
|
||||
* @param aDC Device Context (can be null)
|
||||
* @param aOffset Offset to draw
|
||||
* @param aColor UNSPECIFIED_COLOR4D to use the normal body item color, or else use this color
|
||||
* @param aColor COLOR4D::UNSPECIFIED to use the normal body item color, or else use this color
|
||||
* @param aDrawMode GR_OR, GR_XOR, ...
|
||||
* @param aData = used here as uintptr_t containing bitwise OR'd flags:
|
||||
* PIN_DRAW_TEXTS, -- false to draw only pin shape, useful for fast mode
|
||||
|
@ -385,7 +385,7 @@ public:
|
|||
*/
|
||||
void DrawPinSymbol( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
||||
int aOrientation, GR_DRAWMODE aDrawMode,
|
||||
COLOR4D aColor = UNSPECIFIED_COLOR4D,
|
||||
COLOR4D aColor = COLOR4D::UNSPECIFIED,
|
||||
bool aDrawDangling = true,
|
||||
bool aOnlyTarget = false );
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
|
|||
COLOR4D color = GetLayerColor( LAYER_DEVICE );
|
||||
wxPoint* buffer = NULL;
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
@ -289,7 +289,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
|
|||
|
||||
FILL_T fill = aData ? NO_FILL : m_Fill;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
fill = NO_FILL;
|
||||
|
||||
GRSetDrawMode( aDC, aDrawMode );
|
||||
|
|
|
@ -203,7 +203,7 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
|
||||
COLOR4D color = GetLayerColor( LAYER_DEVICE );
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
@ -218,7 +218,7 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
|
||||
FILL_T fill = aData ? NO_FILL : m_Fill;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
fill = NO_FILL;
|
||||
|
||||
GRSetDrawMode( aDC, aDrawMode );
|
||||
|
|
|
@ -339,7 +339,7 @@ void LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
|
|||
if( plotter->GetColorMode() ) // Used normal color or selected color
|
||||
color = IsSelected() ? GetItemSelectedColor() : GetDefaultColor();
|
||||
else
|
||||
color = COLOR4D_BLACK;
|
||||
color = COLOR4D::BLACK;
|
||||
|
||||
plotter->Text( pos, color, GetShownText(),
|
||||
t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT,
|
||||
|
@ -372,7 +372,7 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO
|
|||
{
|
||||
COLOR4D color = GetDefaultColor();
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Used normal color or selected color
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
|
||||
{
|
||||
if( IsSelected() )
|
||||
color = GetItemSelectedColor();
|
||||
|
|
|
@ -801,10 +801,10 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
m_canvas->MoveCursorToCrossHair();
|
||||
STATUS_FLAGS oldFlags = m_drawItem->GetFlags();
|
||||
m_drawItem->ClearFlags();
|
||||
m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, g_XorMode, NULL,
|
||||
m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
|
||||
DefaultTransform );
|
||||
( (LIB_POLYLINE*) m_drawItem )->DeleteSegment( GetCrossHairPosition( true ) );
|
||||
m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, g_XorMode, NULL,
|
||||
m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
|
||||
DefaultTransform );
|
||||
m_drawItem->SetFlags( oldFlags );
|
||||
m_lastDrawItem = NULL;
|
||||
|
@ -1048,7 +1048,7 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
|
|||
|
||||
// Deleting old text
|
||||
if( DC && !DrawItem->InEditMode() )
|
||||
DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, g_XorMode, NULL,
|
||||
DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
|
||||
DefaultTransform );
|
||||
|
||||
DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem );
|
||||
|
@ -1058,7 +1058,7 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
|
|||
|
||||
// Display new text
|
||||
if( DC && !DrawItem->InEditMode() )
|
||||
DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, GR_DEFAULT_DRAWMODE, NULL,
|
||||
DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, GR_DEFAULT_DRAWMODE, NULL,
|
||||
DefaultTransform );
|
||||
}
|
||||
|
||||
|
|
|
@ -400,13 +400,13 @@ static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
|
|||
if( aErase )
|
||||
{
|
||||
cur_pin->Move( PinPreviousPos );
|
||||
cur_pin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, g_XorMode,
|
||||
cur_pin->Draw( aPanel, aDC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode,
|
||||
showOptions, DefaultTransform );
|
||||
}
|
||||
|
||||
// Redraw pin in new position
|
||||
cur_pin->Move( aPanel->GetParent()->GetCrossHairPosition( true ) );
|
||||
cur_pin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, g_XorMode,
|
||||
cur_pin->Draw( aPanel, aDC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode,
|
||||
showOptions, DefaultTransform );
|
||||
|
||||
PinPreviousPos = cur_pin->GetPosition();
|
||||
|
@ -480,7 +480,7 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
|
|||
// Build it:
|
||||
void* showOptions = reinterpret_cast<void*>( show_opts );
|
||||
|
||||
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR4D, GR_COPY,
|
||||
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, GR_COPY,
|
||||
showOptions, DefaultTransform );
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ void SCH_BITMAP::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset
|
|||
{
|
||||
wxPoint pos = m_pos + aOffset;
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D ) // Use normal drawing function
|
||||
if( aColor == COLOR4D::UNSPECIFIED ) // Use normal drawing function
|
||||
{
|
||||
// https://bugs.launchpad.net/kicad/+bug/1529163
|
||||
// "Moving images in eeschema on OS X uses
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Function ReadImageFile
|
||||
|
|
|
@ -187,7 +187,7 @@ void SCH_BUS_ENTRY_BASE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
COLOR4D color;
|
||||
EDA_RECT* clipbox = aPanel->GetClipBox();
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
color = aColor;
|
||||
else
|
||||
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
static bool Load( LINE_READER& aLine, wxString& aErrorMsg, SCH_ITEM **out );
|
||||
|
||||
|
|
|
@ -379,7 +379,7 @@ public:
|
|||
* Virtual function, from the base class SCH_ITEM::Draw
|
||||
*/
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override
|
||||
{
|
||||
Draw( aPanel, aDC, aOffset, aDrawMode, aColor, true );
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ public:
|
|||
* @param aOffset drawing Offset (usually wxPoint(0,0),
|
||||
* but can be different when moving an object)
|
||||
* @param aDrawMode GR_OR, GR_XOR, ...
|
||||
* @param aColor UNSPECIFIED_COLOR4D to use the normal body item color, or use this color if >= 0
|
||||
* @param aColor COLOR4D::UNSPECIFIED to use the normal body item color, or use this color if >= 0
|
||||
* @param aDrawPinText = true to draw pin texts, false to draw only the pin shape
|
||||
* usually false to draw a component when moving it, and true otherwise.
|
||||
*/
|
||||
|
|
|
@ -141,7 +141,7 @@ public:
|
|||
int GetPenSize() const override;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
bool Save( FILE* aFile ) const override;
|
||||
|
||||
|
|
|
@ -184,11 +184,11 @@ public:
|
|||
* @param aOffset drawing Offset (usually wxPoint(0,0),
|
||||
* but can be different when moving an object)
|
||||
* @param aDrawMode GR_OR, GR_XOR, ...
|
||||
* @param aColor UNSPECIFIED_COLOR4D to use the normal body item color,
|
||||
* @param aColor COLOR4D::UNSPECIFIED to use the normal body item color,
|
||||
* or force this color if it is a valid color
|
||||
*/
|
||||
virtual void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) = 0;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) = 0;
|
||||
|
||||
/**
|
||||
* Function Move
|
||||
|
|
|
@ -115,7 +115,7 @@ void SCH_JUNCTION::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs
|
|||
{
|
||||
COLOR4D color;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
color = aColor;
|
||||
else
|
||||
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
bool Save( FILE* aFile ) const override;
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ void SCH_LINE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
|||
COLOR4D color;
|
||||
int width = GetPenSize();
|
||||
|
||||
if( Color != UNSPECIFIED_COLOR4D )
|
||||
if( Color != COLOR4D::UNSPECIFIED )
|
||||
color = Color;
|
||||
else
|
||||
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
double GetLength() const;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
bool Save( FILE* aFile ) const override;
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void SCH_MARKER::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
GetLayerColor( LAYER_ERC_ERR ) : GetLayerColor( LAYER_ERC_WARN );
|
||||
}
|
||||
|
||||
if( aColor == UNSPECIFIED_COLOR4D )
|
||||
if( aColor == COLOR4D::UNSPECIFIED )
|
||||
m_Color = color;
|
||||
else
|
||||
m_Color = aColor;
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
}
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDraw_mode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDraw_mode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter ) override
|
||||
{
|
||||
|
|
|
@ -139,7 +139,7 @@ void SCH_NO_CONNECT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
|
|||
|
||||
COLOR4D color;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
color = aColor;
|
||||
else
|
||||
color = GetLayerColor( LAYER_NOCONNECT );
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
bool Save( FILE* aFile ) const override;
|
||||
|
||||
|
|
|
@ -592,7 +592,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
int lineWidth = GetPenSize();
|
||||
EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL;
|
||||
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
color = aColor;
|
||||
else
|
||||
color = GetLayerColor( m_Layer );
|
||||
|
@ -611,7 +611,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
name_orientation = TEXT_ANGLE_HORIZ;
|
||||
|
||||
/* Draw text : SheetName */
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
txtcolor = aColor;
|
||||
else
|
||||
txtcolor = GetLayerColor( LAYER_SHEETNAME );
|
||||
|
@ -624,7 +624,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
false, false );
|
||||
|
||||
/* Draw text : FileName */
|
||||
if( aColor != UNSPECIFIED_COLOR4D )
|
||||
if( aColor != COLOR4D::UNSPECIFIED )
|
||||
txtcolor = aColor;
|
||||
else
|
||||
txtcolor = GetLayerColor( LAYER_SHEETFILENAME );
|
||||
|
@ -1138,7 +1138,7 @@ void SCH_SHEET::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
|||
|
||||
void SCH_SHEET::Plot( PLOTTER* aPlotter )
|
||||
{
|
||||
COLOR4D txtcolor = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D txtcolor = COLOR4D::UNSPECIFIED;
|
||||
wxSize size;
|
||||
wxString Text;
|
||||
int name_orientation;
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
bool IsMovableFromAnchorPoint() override { return true; }
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Function CreateGraphicShape (virtual)
|
||||
|
@ -429,7 +429,7 @@ public:
|
|||
int GetPenSize() const override;
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
EDA_RECT const GetBoundingBox() const override;
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,
|
|||
|
||||
linewidth = Clamp_Text_PenSize( linewidth, GetTextSize(), IsBold() );
|
||||
|
||||
if( Color != UNSPECIFIED_COLOR4D )
|
||||
if( Color != COLOR4D::UNSPECIFIED )
|
||||
color = Color;
|
||||
else
|
||||
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
|
||||
|
@ -362,7 +362,7 @@ void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,
|
|||
int savedWidth = GetThickness();
|
||||
SetThickness( linewidth ); // Set the minimum width
|
||||
|
||||
EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR4D );
|
||||
EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, COLOR4D::UNSPECIFIED );
|
||||
|
||||
SetThickness( savedWidth );
|
||||
|
||||
|
@ -1275,7 +1275,7 @@ void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel,
|
|||
COLOR4D color;
|
||||
wxPoint text_offset = aOffset + GetSchematicTextOffset();
|
||||
|
||||
if( Color != UNSPECIFIED_COLOR4D )
|
||||
if( Color != COLOR4D::UNSPECIFIED )
|
||||
color = Color;
|
||||
else
|
||||
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
|
||||
|
@ -1290,7 +1290,7 @@ void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel,
|
|||
SetThickness( linewidth );
|
||||
|
||||
EDA_RECT* clipbox = panel? panel->GetClipBox() : NULL;
|
||||
EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR4D );
|
||||
EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, COLOR4D::UNSPECIFIED );
|
||||
|
||||
SetThickness( save_width ); // restore initial value
|
||||
|
||||
|
@ -1645,7 +1645,7 @@ void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel,
|
|||
|
||||
linewidth = Clamp_Text_PenSize( linewidth, GetTextSize(), IsBold() );
|
||||
|
||||
if( Color != UNSPECIFIED_COLOR4D )
|
||||
if( Color != COLOR4D::UNSPECIFIED )
|
||||
color = Color;
|
||||
else
|
||||
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
|
||||
|
@ -1656,7 +1656,7 @@ void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel,
|
|||
SetThickness( linewidth );
|
||||
|
||||
wxPoint text_offset = offset + GetSchematicTextOffset();
|
||||
EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR4D );
|
||||
EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, COLOR4D::UNSPECIFIED );
|
||||
|
||||
SetThickness( save_width ); // restore initial value
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
virtual wxPoint GetSchematicTextOffset() const;
|
||||
|
||||
virtual void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Function CreateGraphicShape
|
||||
|
@ -228,7 +228,7 @@ public:
|
|||
~SCH_LABEL() { }
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
wxString GetClass() const override
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ public:
|
|||
~SCH_GLOBALLABEL() { }
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
wxString GetClass() const override
|
||||
{
|
||||
|
@ -324,7 +324,7 @@ public:
|
|||
~SCH_HIERLABEL() { }
|
||||
|
||||
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE draw_mode, COLOR4D Color = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
wxString GetClass() const override
|
||||
{
|
||||
|
|
|
@ -708,7 +708,7 @@ static void moveItemWithMouseCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
if( aErase )
|
||||
{
|
||||
if( cmp ) // Use fast mode (do not draw pin texts)
|
||||
cmp->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, UNSPECIFIED_COLOR4D, false );
|
||||
cmp->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, COLOR4D::UNSPECIFIED, false );
|
||||
else
|
||||
item->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
}
|
||||
|
@ -723,7 +723,7 @@ static void moveItemWithMouseCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
item->SetWireImage(); // While moving, the item may choose to render differently
|
||||
|
||||
if( cmp ) // Use fast mode (do not draw pin texts)
|
||||
cmp->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, UNSPECIFIED_COLOR4D, false );
|
||||
cmp->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, COLOR4D::UNSPECIFIED, false );
|
||||
else
|
||||
item->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC )
|
|||
|
||||
if( m_drawItem->ContinueEdit( pos ) )
|
||||
{
|
||||
m_drawItem->Draw( m_canvas, DC, pos, UNSPECIFIED_COLOR4D, g_XorMode, NULL, DefaultTransform );
|
||||
m_drawItem->Draw( m_canvas, DC, pos, COLOR4D::UNSPECIFIED, g_XorMode, NULL, DefaultTransform );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -270,12 +270,12 @@ static void RedrawWhileMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
|||
wxString text = ((LIB_FIELD*)item)->GetFullText( unit );
|
||||
|
||||
item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ),
|
||||
UNSPECIFIED_COLOR4D, g_XorMode, &text,
|
||||
COLOR4D::UNSPECIFIED, g_XorMode, &text,
|
||||
DefaultTransform );
|
||||
}
|
||||
else
|
||||
item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ),
|
||||
UNSPECIFIED_COLOR4D, g_XorMode, NULL,
|
||||
COLOR4D::UNSPECIFIED, g_XorMode, NULL,
|
||||
DefaultTransform );
|
||||
}
|
||||
|
||||
|
@ -323,7 +323,7 @@ static void SymbolDisplayDraw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
return;
|
||||
|
||||
item->SetEraseLastDrawItem( aErase );
|
||||
item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ), UNSPECIFIED_COLOR4D, g_XorMode, NULL,
|
||||
item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
|
||||
DefaultTransform );
|
||||
}
|
||||
|
||||
|
|
|
@ -237,14 +237,14 @@ void WIDGET_EESCHEMA_COLOR_CONFIG::SetColor( wxCommandEvent& event )
|
|||
colourData.SetColour( currentColors[ colorButton->m_Layer ].ToColour() );
|
||||
wxColourDialog *dialog = new wxColourDialog( this, &colourData );
|
||||
|
||||
COLOR4D newColor = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D newColor = COLOR4D::UNSPECIFIED;
|
||||
|
||||
if( dialog->ShowModal() == wxID_OK )
|
||||
{
|
||||
newColor = COLOR4D( dialog->GetColourData().GetColour() );
|
||||
}
|
||||
|
||||
if( newColor == UNSPECIFIED_COLOR4D || currentColors[ colorButton->m_Layer ] == newColor )
|
||||
if( newColor == COLOR4D::UNSPECIFIED || currentColors[ colorButton->m_Layer ] == newColor )
|
||||
return;
|
||||
|
||||
currentColors[ colorButton->m_Layer ] = newColor;
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
m_DisplayNegativeObjects = false;
|
||||
m_ForceBlackAndWhite = false;
|
||||
m_NegativeDrawColor = COLOR4D( DARKGRAY );
|
||||
m_BgDrawColor = COLOR4D_BLACK;
|
||||
m_BgDrawColor = COLOR4D::BLACK;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ void GERBER_LAYER_WIDGET::ReFillRender()
|
|||
|
||||
for( unsigned row=0; row<DIM(renderRows); ++row )
|
||||
{
|
||||
if( renderRows[row].color != UNSPECIFIED_COLOR4D ) // does this row show a color?
|
||||
if( renderRows[row].color != COLOR4D::UNSPECIFIED ) // does this row show a color?
|
||||
{
|
||||
renderRows[row].color = myframe->GetVisibleElementColor(
|
||||
(GERBER_VISIBLE_ID)renderRows[row].id );
|
||||
|
|
|
@ -609,7 +609,7 @@ bool GERBVIEW_FRAME::IsLayerVisible( int aLayer ) const
|
|||
|
||||
COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( GERBER_VISIBLE_ID aItemIdVisible ) const
|
||||
{
|
||||
COLOR4D color = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D color = COLOR4D::UNSPECIFIED;
|
||||
|
||||
switch( aItemIdVisible )
|
||||
{
|
||||
|
|
|
@ -367,7 +367,7 @@ public:
|
|||
* @param aDC - the device context to draw the cursor
|
||||
* @param aColor - the color to draw the cursor
|
||||
*/
|
||||
void DrawCrossHair( wxDC* aDC, COLOR4D aColor = COLOR4D_WHITE );
|
||||
void DrawCrossHair( wxDC* aDC, COLOR4D aColor = COLOR4D::WHITE );
|
||||
|
||||
// Hide the cross hair.
|
||||
void CrossHairOff( wxDC* DC );
|
||||
|
|
|
@ -238,12 +238,12 @@ public:
|
|||
* @param aColor = text color
|
||||
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
|
||||
* @param aDisplay_mode = FILLED or SKETCH
|
||||
* @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR4D = do not draw anchor ).
|
||||
* @param aAnchor_color = anchor color ( COLOR4D::UNSPECIFIED = do not draw anchor ).
|
||||
*/
|
||||
void Draw( EDA_RECT* aClipBox, wxDC* aDC,
|
||||
const wxPoint& aOffset, COLOR4D aColor,
|
||||
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = FILLED,
|
||||
COLOR4D aAnchor_color = UNSPECIFIED_COLOR4D );
|
||||
COLOR4D aAnchor_color = COLOR4D::UNSPECIFIED );
|
||||
|
||||
/**
|
||||
* Convert the text shape to a list of segment
|
||||
|
|
|
@ -41,7 +41,7 @@ class COLOR4D
|
|||
public:
|
||||
// Constructor (creates the Color 0,0,0,0)
|
||||
COLOR4D() :
|
||||
r( 0 ), g( 0 ), b( 0 ), a( 1 )
|
||||
r( 0 ), g( 0 ), b( 0 ), a( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -269,6 +269,13 @@ public:
|
|||
double g; ///< Green component
|
||||
double b; ///< Blue component
|
||||
double a; ///< Alpha component
|
||||
|
||||
/// For legacy support; used as a value to indicate color hasn't been set yet
|
||||
static const COLOR4D UNSPECIFIED;
|
||||
|
||||
// Declare a few color shortcuts that are used for comparisons frequently
|
||||
static const COLOR4D WHITE;
|
||||
static const COLOR4D BLACK;
|
||||
};
|
||||
|
||||
/// @brief Equality operator, are two colors equal
|
||||
|
@ -279,12 +286,4 @@ const bool operator!=( const COLOR4D& lhs, const COLOR4D& rhs );
|
|||
|
||||
} // namespace KIGFX
|
||||
|
||||
/// For legacy support; used as a value to indicate color hasn't been set yet
|
||||
#define UNSPECIFIED_COLOR4D ( KIGFX::COLOR4D( 0, 0, 0, 0 ) )
|
||||
|
||||
/// Declare a few color shortcuts that are used for comparisons frequently
|
||||
#define COLOR4D_WHITE ( KIGFX::COLOR4D( 1, 1, 1, 1 ) )
|
||||
#define COLOR4D_BLACK ( KIGFX::COLOR4D( 0, 0, 0, 1 ) )
|
||||
|
||||
|
||||
#endif /* COLOR4D_H_ */
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
m_X = 0;
|
||||
m_UpperY = 0;
|
||||
m_LowerY = 0;
|
||||
m_Color = UNSPECIFIED_COLOR4D;
|
||||
m_Color = COLOR4D::UNSPECIFIED;
|
||||
}
|
||||
|
||||
void SetUpperText( const wxString& aUpperText ) { m_UpperText = aUpperText; }
|
||||
|
|
|
@ -1209,7 +1209,7 @@ public:
|
|||
DXF_PLOTTER() : textAsLines( false )
|
||||
{
|
||||
textAsLines = true;
|
||||
m_currentColor = COLOR4D_BLACK;
|
||||
m_currentColor = COLOR4D::BLACK;
|
||||
}
|
||||
|
||||
virtual PlotFormat GetPlotterType() const override
|
||||
|
|
|
@ -91,13 +91,13 @@ public:
|
|||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC)
|
||||
{
|
||||
wxPoint offset( 0, 0 );
|
||||
DrawWsItem( aClipBox, aDC, offset, UNSPECIFIED_DRAWMODE, UNSPECIFIED_COLOR4D );
|
||||
DrawWsItem( aClipBox, aDC, offset, UNSPECIFIED_DRAWMODE, COLOR4D::UNSPECIFIED );
|
||||
}
|
||||
|
||||
/// More advanced version of DrawWsItem. This is what must be
|
||||
/// defined in the derived type.
|
||||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) = 0;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) = 0;
|
||||
|
||||
/**
|
||||
* Abstract function: should exist for derived items
|
||||
|
@ -159,7 +159,7 @@ public:
|
|||
/** The function to draw a WS_DRAW_ITEM_LINE
|
||||
*/
|
||||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Virtual function
|
||||
|
@ -216,7 +216,7 @@ public:
|
|||
/** The function to draw a WS_DRAW_ITEM_POLYGON
|
||||
*/
|
||||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Virtual function
|
||||
|
@ -251,7 +251,7 @@ public:
|
|||
/** The function to draw a WS_DRAW_ITEM_RECT
|
||||
*/
|
||||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Virtual function
|
||||
|
@ -292,7 +292,7 @@ public:
|
|||
/** The function to draw a WS_DRAW_ITEM_TEXT
|
||||
*/
|
||||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
// Accessors:
|
||||
int GetPenWidth() { return GetThickness(); }
|
||||
|
@ -327,13 +327,13 @@ class WS_DRAW_ITEM_BITMAP : public WS_DRAW_ITEM_BASE
|
|||
|
||||
public:
|
||||
WS_DRAW_ITEM_BITMAP( WORKSHEET_DATAITEM* aParent, wxPoint aPos )
|
||||
:WS_DRAW_ITEM_BASE( aParent, wsg_bitmap, UNSPECIFIED_COLOR4D )
|
||||
:WS_DRAW_ITEM_BASE( aParent, wsg_bitmap, COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
m_pos = aPos;
|
||||
}
|
||||
|
||||
WS_DRAW_ITEM_BITMAP()
|
||||
:WS_DRAW_ITEM_BASE( NULL, wsg_bitmap, UNSPECIFIED_COLOR4D )
|
||||
:WS_DRAW_ITEM_BASE( NULL, wsg_bitmap, COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ public:
|
|||
/** The function to draw a WS_DRAW_ITEM_BITMAP
|
||||
*/
|
||||
virtual void DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = UNSPECIFIED_COLOR4D ) override;
|
||||
GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
|
||||
|
||||
/**
|
||||
* Virtual function
|
||||
|
|
|
@ -425,7 +425,7 @@ void drawPlacementRoutingMatrix( BOARD* aBrd, wxDC* DC )
|
|||
for( jj = 0; jj < RoutingMatrix.m_Ncols; jj++ )
|
||||
{
|
||||
ox = RoutingMatrix.m_BrdBox.GetX() + (jj * RoutingMatrix.m_GridRouting);
|
||||
color = COLOR4D_BLACK;
|
||||
color = COLOR4D::BLACK;
|
||||
|
||||
top_state = RoutingMatrix.GetCell( ii, jj, TOP );
|
||||
bottom_state = RoutingMatrix.GetCell( ii, jj, BOTTOM );
|
||||
|
@ -435,7 +435,7 @@ void drawPlacementRoutingMatrix( BOARD* aBrd, wxDC* DC )
|
|||
|
||||
// obstacles
|
||||
if( ( top_state & CELL_is_EDGE ) || ( bottom_state & CELL_is_EDGE ) )
|
||||
color = COLOR4D_WHITE;
|
||||
color = COLOR4D::WHITE;
|
||||
else if( top_state & ( HOLE | CELL_is_MODULE ) )
|
||||
color = COLOR4D( LIGHTRED );
|
||||
else if( bottom_state & (HOLE | CELL_is_MODULE) )
|
||||
|
|
|
@ -236,7 +236,7 @@ void DisplayRoutingMatrix( EDA_DRAW_PANEL* panel, wxDC* DC )
|
|||
{
|
||||
for( int row = 0; row < RoutingMatrix.m_Nrows; row++ )
|
||||
{
|
||||
color = COLOR4D_BLACK;
|
||||
color = COLOR4D::BLACK;
|
||||
dcell0 = RoutingMatrix.GetCell( row, col, BOTTOM );
|
||||
|
||||
if( dcell0 & HOLE )
|
||||
|
@ -253,7 +253,7 @@ void DisplayRoutingMatrix( EDA_DRAW_PANEL* panel, wxDC* DC )
|
|||
|
||||
dcell0 |= dcell1;
|
||||
#endif
|
||||
if( ( color == COLOR4D_BLACK ) && ( dcell0 & VIA_IMPOSSIBLE ) )
|
||||
if( ( color == COLOR4D::BLACK ) && ( dcell0 & VIA_IMPOSSIBLE ) )
|
||||
color = COLOR4D( BLUE );
|
||||
|
||||
if( dcell0 & CELL_is_EDGE )
|
||||
|
|
|
@ -445,7 +445,7 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet(
|
|||
s_cornerBuffer = &aCornerBuffer;
|
||||
s_textWidth = GetThickness() + ( 2 * aClearanceValue );
|
||||
s_textCircle2SegmentCount = aCircleToSegmentsCount;
|
||||
COLOR4D color = COLOR4D_BLACK; // not actually used, but needed by DrawGraphicText
|
||||
COLOR4D color = COLOR4D::BLACK; // not actually used, but needed by DrawGraphicText
|
||||
|
||||
if( IsMultilineAllowed() )
|
||||
{
|
||||
|
|
|
@ -779,7 +779,7 @@ void BOARD::SetElementVisibility( int aPCB_VISIBLE, bool isEnabled )
|
|||
|
||||
COLOR4D BOARD::GetVisibleElementColor( int aPCB_VISIBLE )
|
||||
{
|
||||
COLOR4D color = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D color = COLOR4D::UNSPECIFIED;
|
||||
|
||||
switch( aPCB_VISIBLE )
|
||||
{
|
||||
|
|
|
@ -130,7 +130,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
else
|
||||
drawInfo.m_ShowPadFilled = true;
|
||||
|
||||
COLOR4D color = COLOR4D_BLACK;
|
||||
COLOR4D color = COLOR4D::BLACK;
|
||||
|
||||
if( m_layerMask[F_Cu] )
|
||||
{
|
||||
|
|
|
@ -67,17 +67,17 @@ const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = {
|
|||
RR( _( "Pads Front" ), PAD_FR_VISIBLE, WHITE, _( "Show footprint pads on board's front" ) ),
|
||||
RR( _( "Pads Back" ), PAD_BK_VISIBLE, WHITE, _( "Show footprint pads on board's back" ) ),
|
||||
|
||||
RR( _( "Text Front" ), MOD_TEXT_FR_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show footprint text on board's front" ) ),
|
||||
RR( _( "Text Back" ), MOD_TEXT_BK_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show footprint text on board's back" ) ),
|
||||
RR( _( "Text Front" ), MOD_TEXT_FR_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show footprint text on board's front" ) ),
|
||||
RR( _( "Text Back" ), MOD_TEXT_BK_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show footprint text on board's back" ) ),
|
||||
RR( _( "Hidden Text" ), MOD_TEXT_INVISIBLE, WHITE, _( "Show footprint text marked as invisible" ) ),
|
||||
|
||||
RR( _( "Anchors" ), ANCHOR_VISIBLE, WHITE, _( "Show footprint and text origins as a cross" ) ),
|
||||
RR( _( "Grid" ), GRID_VISIBLE, WHITE, _( "Show the (x,y) grid dots" ) ),
|
||||
RR( _( "No-Connects" ), NO_CONNECTS_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show a marker on pads which have no net connected" ) ),
|
||||
RR( _( "Footprints Front" ), MOD_FR_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show footprints that are on board's front") ),
|
||||
RR( _( "Footprints Back" ), MOD_BK_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show footprints that are on board's back") ),
|
||||
RR( _( "Values" ), MOD_VALUES_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show footprint's values") ),
|
||||
RR( _( "References" ), MOD_REFERENCES_VISIBLE, UNSPECIFIED_COLOR4D, _( "Show footprint's references") ),
|
||||
RR( _( "No-Connects" ), NO_CONNECTS_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show a marker on pads which have no net connected" ) ),
|
||||
RR( _( "Footprints Front" ), MOD_FR_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show footprints that are on board's front") ),
|
||||
RR( _( "Footprints Back" ), MOD_BK_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show footprints that are on board's back") ),
|
||||
RR( _( "Values" ), MOD_VALUES_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show footprint's values") ),
|
||||
RR( _( "References" ), MOD_REFERENCES_VISIBLE, COLOR4D::UNSPECIFIED, _( "Show footprint's references") ),
|
||||
};
|
||||
|
||||
static int s_allowed_in_FpEditor[] =
|
||||
|
@ -299,7 +299,7 @@ void PCB_LAYER_WIDGET::ReFillRender()
|
|||
renderRow.tooltip = wxGetTranslation( s_render_rows[row].tooltip );
|
||||
renderRow.rowName = wxGetTranslation( s_render_rows[row].rowName );
|
||||
|
||||
if( renderRow.color != UNSPECIFIED_COLOR4D ) // does this row show a color?
|
||||
if( renderRow.color != COLOR4D::UNSPECIFIED ) // does this row show a color?
|
||||
{
|
||||
// this window frame must have an established BOARD, i.e. after SetBoard()
|
||||
renderRow.color = board->GetVisibleElementColor( renderRow.id );
|
||||
|
|
|
@ -93,7 +93,7 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
|
|||
color = COLOR4D( DARKDARKGRAY );
|
||||
}
|
||||
|
||||
COLOR4D anchor_color = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D anchor_color = COLOR4D::UNSPECIFIED;
|
||||
|
||||
if( brd->IsElementVisible( ANCHOR_VISIBLE ) )
|
||||
anchor_color = brd->GetVisibleElementColor( ANCHOR_VISIBLE );
|
||||
|
|
|
@ -336,7 +336,7 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName, bool aOnlyO
|
|||
plot_opts.SetMirror( m_printMirror );
|
||||
plot_opts.SetFormat( PLOT_FORMAT_SVG );
|
||||
|
||||
COLOR4D color = UNSPECIFIED_COLOR4D; // Used layer color to plot ref and value
|
||||
COLOR4D color = COLOR4D::UNSPECIFIED; // Used layer color to plot ref and value
|
||||
|
||||
plot_opts.SetReferenceColor( color );
|
||||
plot_opts.SetValueColor( color );
|
||||
|
|
|
@ -167,7 +167,7 @@ void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event )
|
|||
wxPaintDC dc( m_panelShowPad );
|
||||
PAD_DRAWINFO drawInfo;
|
||||
|
||||
COLOR4D color = COLOR4D_BLACK;
|
||||
COLOR4D color = COLOR4D::BLACK;
|
||||
|
||||
if( m_dummyPad->GetLayerSet()[F_Cu] )
|
||||
{
|
||||
|
|
|
@ -734,7 +734,7 @@ static void export_vrml_pcbtext( MODEL_VRML& aModel, TEXTE_PCB* text )
|
|||
if( text->IsMirrored() )
|
||||
size.x = -size.x;
|
||||
|
||||
COLOR4D color = COLOR4D_BLACK; // not actually used, but needed by DrawGraphicText
|
||||
COLOR4D color = COLOR4D::BLACK; // not actually used, but needed by DrawGraphicText
|
||||
|
||||
if( text->IsMultilineAllowed() )
|
||||
{
|
||||
|
|
|
@ -219,7 +219,7 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
|
|||
|
||||
// Plot title "Info"
|
||||
wxString Text = wxT( "Drill Map:" );
|
||||
plotter->Text( wxPoint( plotX, plotY ), UNSPECIFIED_COLOR4D, Text, 0,
|
||||
plotter->Text( wxPoint( plotX, plotY ), COLOR4D::UNSPECIFIED, Text, 0,
|
||||
wxSize( KiROUND( charSize * charScale ),
|
||||
KiROUND( charSize * charScale ) ),
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
|
@ -266,7 +266,7 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
|
|||
if( tool.m_Hole_NotPlated )
|
||||
msg += wxT( " (not plated)" );
|
||||
|
||||
plotter->Text( wxPoint( plotX, y ), UNSPECIFIED_COLOR4D, msg, 0,
|
||||
plotter->Text( wxPoint( plotX, y ), COLOR4D::UNSPECIFIED, msg, 0,
|
||||
wxSize( KiROUND( charSize * charScale ),
|
||||
KiROUND( charSize * charScale ) ),
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
|
|
|
@ -283,7 +283,7 @@ void LAYER_WIDGET::OnMiddleDownLayerColor( wxMouseEvent& aEvent )
|
|||
|
||||
COLOR4D oldColor;
|
||||
wxASSERT( oldColor.SetFromWxString( colorTxt ) );
|
||||
COLOR4D newColor = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D newColor = COLOR4D::UNSPECIFIED;
|
||||
|
||||
if( AreArbitraryColorsAllowed() )
|
||||
{
|
||||
|
@ -301,7 +301,7 @@ void LAYER_WIDGET::OnMiddleDownLayerColor( wxMouseEvent& aEvent )
|
|||
newColor = DisplayColorFrame( this, oldColor );
|
||||
}
|
||||
|
||||
if( newColor != UNSPECIFIED_COLOR4D )
|
||||
if( newColor != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
eventSource->SetName( makeColorTxt( newColor ) );
|
||||
|
||||
|
@ -339,7 +339,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
|
|||
|
||||
COLOR4D oldColor;
|
||||
wxASSERT( oldColor.SetFromWxString( colorTxt ) );
|
||||
COLOR4D newColor = UNSPECIFIED_COLOR4D;
|
||||
COLOR4D newColor = COLOR4D::UNSPECIFIED;
|
||||
|
||||
if( AreArbitraryColorsAllowed() )
|
||||
{
|
||||
|
@ -357,7 +357,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
|
|||
newColor = DisplayColorFrame( this, oldColor );
|
||||
}
|
||||
|
||||
if( newColor != UNSPECIFIED_COLOR4D )
|
||||
if( newColor != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
eventSource->SetName( makeColorTxt( newColor ) );
|
||||
|
||||
|
@ -495,7 +495,7 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
|
|||
|
||||
// column 0
|
||||
col = 0;
|
||||
if( aSpec.color != UNSPECIFIED_COLOR4D )
|
||||
if( aSpec.color != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
wxBitmapButton* bmb = makeColorButton( m_RenderScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) );
|
||||
bmb->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownRenderColor ), NULL, this );
|
||||
|
@ -827,7 +827,7 @@ COLOR4D LAYER_WIDGET::GetLayerColor( LAYER_NUM aLayer ) const
|
|||
return ColorFromInt( strtoul( TO_UTF8(colorTxt), NULL, 0 ) );
|
||||
}
|
||||
|
||||
return UNSPECIFIED_COLOR4D; // it's caller fault, gave me a bad layer
|
||||
return COLOR4D::UNSPECIFIED; // it's caller fault, gave me a bad layer
|
||||
}
|
||||
|
||||
|
||||
|
@ -951,7 +951,7 @@ public:
|
|||
|
||||
// add some render rows
|
||||
static const LAYER_WIDGET::ROW renderRows[] = {
|
||||
LAYER_WIDGET::ROW( wxT("With Very Large Ears"), 0, UNSPECIFIED_COLOR4D, wxT("Spock here") ),
|
||||
LAYER_WIDGET::ROW( wxT("With Very Large Ears"), 0, COLOR4D::UNSPECIFIED, wxT("Spock here") ),
|
||||
LAYER_WIDGET::ROW( wxT("With Legs"), 1, YELLOW ),
|
||||
LAYER_WIDGET::ROW( wxT("With Oval Eyes"), 1, BROWN, wxT("My eyes are upon you") ),
|
||||
};
|
||||
|
|
|
@ -85,11 +85,11 @@ public:
|
|||
{
|
||||
wxString rowName; ///< the prompt or layername
|
||||
int id; ///< either a layer or "visible element" id
|
||||
COLOR4D color; ///< UNSPECIFIED_COLOR4D if none.
|
||||
COLOR4D color; ///< COLOR4D::UNSPECIFIED if none.
|
||||
bool state; ///< initial wxCheckBox state
|
||||
wxString tooltip; ///< if not empty, use this tooltip on row
|
||||
|
||||
ROW( const wxString& aRowName, int aId, COLOR4D aColor = UNSPECIFIED_COLOR4D,
|
||||
ROW( const wxString& aRowName, int aId, COLOR4D aColor = COLOR4D::UNSPECIFIED,
|
||||
const wxString& aTooltip = wxEmptyString, bool aState = true )
|
||||
{
|
||||
rowName = aRowName;
|
||||
|
|
|
@ -98,13 +98,13 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
if( !( masklayer & layersmask_plotpads ).any() )
|
||||
continue;
|
||||
|
||||
COLOR4D color = COLOR4D_BLACK;
|
||||
COLOR4D color = COLOR4D::BLACK;
|
||||
|
||||
if( layersmask_plotpads[B_SilkS] )
|
||||
color = aBoard->GetLayerColor( B_SilkS );
|
||||
|
||||
if( layersmask_plotpads[F_SilkS] )
|
||||
color = ( color == COLOR4D_BLACK) ? aBoard->GetLayerColor( F_SilkS ) : color;
|
||||
color = ( color == COLOR4D::BLACK) ? aBoard->GetLayerColor( F_SilkS ) : color;
|
||||
|
||||
itemplotter.PlotPad( pad, color, SKETCH );
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
|||
if( padPlotsSize.x <= 0 || padPlotsSize.y <= 0 )
|
||||
continue;
|
||||
|
||||
COLOR4D color = COLOR4D_BLACK;
|
||||
COLOR4D color = COLOR4D::BLACK;
|
||||
|
||||
if( pad->GetLayerSet()[B_Cu] )
|
||||
color = aBoard->GetVisibleElementColor( PAD_BK_VISIBLE );
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
COLOR4D BRDITEMS_PLOTTER::getColor( LAYER_NUM aLayer )
|
||||
{
|
||||
COLOR4D color = m_board->GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
if( color == COLOR4D_WHITE )
|
||||
if( color == COLOR4D::WHITE )
|
||||
color = COLOR4D( LIGHTGRAY );
|
||||
return color;
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule )
|
|||
// Plot text fields, if allowed
|
||||
if( trace_ref )
|
||||
{
|
||||
if( GetReferenceColor() == UNSPECIFIED_COLOR4D )
|
||||
if( GetReferenceColor() == COLOR4D::UNSPECIFIED )
|
||||
PlotTextModule( &aModule->Reference(), getColor( textLayer ) );
|
||||
else
|
||||
PlotTextModule( &aModule->Reference(), GetReferenceColor() );
|
||||
|
@ -231,7 +231,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule )
|
|||
|
||||
if( trace_val )
|
||||
{
|
||||
if( GetValueColor() == UNSPECIFIED_COLOR4D )
|
||||
if( GetValueColor() == COLOR4D::UNSPECIFIED )
|
||||
PlotTextModule( &aModule->Value(), getColor( textLayer ) );
|
||||
else
|
||||
PlotTextModule( &aModule->Value(), GetValueColor() );
|
||||
|
@ -299,7 +299,7 @@ void BRDITEMS_PLOTTER::PlotTextModule( TEXTE_MODULE* pt_texte, COLOR4D aColor )
|
|||
double orient;
|
||||
int thickness;
|
||||
|
||||
if( aColor == COLOR4D_WHITE )
|
||||
if( aColor == COLOR4D::WHITE )
|
||||
aColor = COLOR4D( LIGHTGRAY );
|
||||
|
||||
m_plotter->SetColor( aColor );
|
||||
|
@ -591,14 +591,14 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
|
|||
for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
|
||||
{
|
||||
wxString& txt = strings_list.Item( ii );
|
||||
m_plotter->Text( positions[ii], UNSPECIFIED_COLOR4D, txt, orient, size,
|
||||
m_plotter->Text( positions[ii], COLOR4D::UNSPECIFIED, txt, orient, size,
|
||||
pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
|
||||
thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotter->Text( pos, UNSPECIFIED_COLOR4D, shownText, orient, size,
|
||||
m_plotter->Text( pos, COLOR4D::UNSPECIFIED, shownText, orient, size,
|
||||
pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
|
||||
thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
|||
if( drillShapeOpt != PRINT_PARAMETERS::NO_DRILL_SHAPE )
|
||||
{
|
||||
TRACK* track = Pcb->m_Track;
|
||||
COLOR4D color = COLOR4D_WHITE;
|
||||
COLOR4D color = COLOR4D::WHITE;
|
||||
|
||||
bool blackpenstate = GetGRForceBlackPenState();
|
||||
|
||||
|
|
Loading…
Reference in New Issue