mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-14 12:49:34 +00:00
Changed COLOR4D defines to static consts
This commit is contained in:
parent
3ec8941ffc
commit
0dc88bb4cf
3d-viewer/3d_canvas
common
class_colors_design_settings.cppcommon_plotDXF_functions.cppcommon_plotPS_functions.cppcommon_plot_functions.cppconfig_params.cppeda_text.cpp
gal
gr_basic.cpppage_layout
selcolor.cppeeschema
class_libentry.cppclass_sch_screen.h
dialogs
eeschema.cpplib_arc.cpplib_bezier.cpplib_circle.cpplib_draw_item.hlib_field.cpplib_pin.cpplib_pin.hlib_polyline.cpplib_rectangle.cpplib_text.cpplibeditframe.cpppinedit.cppsch_bitmap.cppsch_bitmap.hsch_bus_entry.cppsch_bus_entry.hsch_component.hsch_field.hsch_item_struct.hsch_junction.cppsch_junction.hsch_line.cppsch_line.hsch_marker.cppsch_marker.hsch_no_connect.cppsch_no_connect.hsch_sheet.cppsch_sheet.hsch_text.cppsch_text.hschedit.cppsymbdraw.cppwidgets
gerbview
include
pcbnew
@ -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();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user