Commit 082d901d authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio

Encapsulated drawmode as an enum for type checking

parent f301b196
......@@ -117,7 +117,7 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor )
GR_DRAWMODE aDrawMode, int aColor )
{
int w = GetWidth();
......
......@@ -147,7 +147,7 @@ EDA_RECT MARKER_BASE::GetBoundingBoxMarker() const
return EDA_RECT( m_Pos, realsize );
}
void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
wxPoint corners[CORNERS_COUNT];
......
......@@ -714,7 +714,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
}
void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, int aDrawMode )
void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, GR_DRAWMODE aDrawMode )
{
wxPoint origin = GetParent()->GetOriginAxisPosition();
......@@ -744,7 +744,7 @@ void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, int aDrawMode )
}
void EDA_DRAW_PANEL::DrawGridAxis( wxDC* aDC, int aDrawMode )
void EDA_DRAW_PANEL::DrawGridAxis( wxDC* aDC, GR_DRAWMODE aDrawMode )
{
BASE_SCREEN* screen = GetScreen();
......
......@@ -215,7 +215,7 @@ bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy
void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
EDA_COLOR_T aColor, int aDrawMode,
EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode,
EDA_DRAW_MODE_T aFillMode, EDA_COLOR_T aAnchor_color )
{
if( m_MultilineAllowed )
......@@ -260,7 +260,7 @@ void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_COLOR_T aColor,
int aDrawMode, EDA_DRAW_MODE_T aFillMode,
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
EDA_COLOR_T aAnchor_color,
wxString& aText, wxPoint aPos )
{
......
......@@ -47,7 +47,7 @@
// For draw mode = XOR GR_XOR or GR_NXOR by background color
int g_XorMode = GR_NXOR;
GR_DRAWMODE g_XorMode = GR_NXOR;
// Background color of the design frame
int g_DrawBgColor = WHITE;
......@@ -440,7 +440,7 @@ bool GetGRForceBlackPenState( void )
/*************************************/
/* Set the device context draw mode. */
/*************************************/
void GRSetDrawMode( wxDC* DC, int draw_mode )
void GRSetDrawMode( wxDC* DC, GR_DRAWMODE draw_mode )
{
if( draw_mode & GR_OR )
#if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
......
......@@ -128,7 +128,8 @@ void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/*
* Redraw the BOARD items but not cursors, axis or grid.
*/
void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset )
void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
GR_DRAWMODE aDrawMode, const wxPoint& aOffset )
{
if( m_Modules )
{
......
......@@ -273,7 +273,7 @@ void LIB_COMPONENT::SetName( const wxString& aName )
void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset, int aMulti,
int aConvert, int aDrawMode, int aColor, const TRANSFORM& aTransform,
int aConvert, GR_DRAWMODE aDrawMode, int aColor, const TRANSFORM& aTransform,
bool aShowPinText, bool aDrawFields, bool aOnlySelected )
{
BASE_SCREEN* screen = aPanel->GetScreen();
......
......@@ -397,7 +397,7 @@ public:
* Used for block move redraws.
*/
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset,
int aMulti, int aConvert, int aDrawMode, int aColor = -1,
int aMulti, int aConvert, GR_DRAWMODE aDrawMode, int aColor = -1,
const TRANSFORM& aTransform = DefaultTransform,
bool aShowPinText = true, bool aDrawFields = true,
bool aOnlySelected = false );
......
......@@ -65,7 +65,7 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
NEGATE( offset.y );
GRResetPenAndBrush( &dc );
m_dummyPin->Draw( NULL, &dc, offset, -1, wxCOPY,
m_dummyPin->Draw( NULL, &dc, offset, -1, GR_COPY,
NULL, DefaultTransform );
m_dummyPin->SetParent(NULL);
......
......@@ -362,7 +362,7 @@ void LIB_ARC::drawEditGraphics( EDA_RECT* aClipBox, wxDC* aDC, int aColor )
void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
int aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
{
// Don't draw the arc until the end point is selected. Only the edit indicators
// get drawn at this time.
......
......@@ -61,7 +61,8 @@ class LIB_ARC : public LIB_ITEM
* Draws the arc.
*/
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
/**
* Draw the graphics when the arc is being edited.
......
......@@ -287,7 +287,7 @@ int LIB_BEZIER::GetPenSize() const
void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
int aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1;
std::vector<wxPoint> PolyPointsTraslated;
......
......@@ -43,7 +43,8 @@ class LIB_BEZIER : public LIB_ITEM
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
public:
LIB_BEZIER( LIB_COMPONENT * aParent );
......
......@@ -210,7 +210,7 @@ int LIB_CIRCLE::GetPenSize() const
void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
int aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1;
......
......@@ -39,7 +39,8 @@ class LIB_CIRCLE : public LIB_ITEM
int m_Width; // Line width.
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
void calcEdit( const wxPoint& aPosition );
......
......@@ -115,7 +115,7 @@ bool LIB_ITEM::operator<( const LIB_ITEM& aOther ) const
void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
int aDrawMode, void* aData, const TRANSFORM& aTransform )
GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
{
if( InEditMode() )
{
......
......@@ -89,7 +89,8 @@ class LIB_ITEM : public EDA_ITEM
*/
virtual void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aColor,
int aDrawMode, void* aData, const TRANSFORM& aTransform ) = 0;
GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform ) = 0;
/**
* Draw any editing specific graphics when the item is being edited.
......@@ -211,8 +212,9 @@ public:
* pass reference to the lib component for pins.
* @param aTransform Transform Matrix (rotation, mirror ..)
*/
virtual void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void* aData, const TRANSFORM& aTransform );
virtual void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint &aOffset,
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
/**
* Function GetPenSize
......
......@@ -260,7 +260,7 @@ int LIB_FIELD::GetPenSize() const
void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
int aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
{
wxPoint text_pos;
int color;
......
......@@ -71,7 +71,8 @@ class LIB_FIELD : public LIB_ITEM, public EDA_TEXT
* </p>
*/
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
/**
* Calculate the new circle at \a aPosition when editing.
......
......@@ -790,7 +790,7 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aColor,
int aDrawMode,
GR_DRAWMODE aDrawMode,
void* aData,
const TRANSFORM& aTransform )
{
......@@ -853,7 +853,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aPinPos,
int aOrient,
int aDrawMode,
GR_DRAWMODE aDrawMode,
int aColor )
{
int MapX1, MapY1, x1, y1;
......@@ -1070,7 +1070,7 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
bool DrawPinNum,
bool DrawPinName,
int Color,
int DrawMode )
GR_DRAWMODE DrawMode )
{
int x, y, x1, y1;
wxString StringPinNum;
......
......@@ -117,7 +117,8 @@ class LIB_PIN : public LIB_ITEM
int m_nameTextSize; /* Pin num and Pin name sizes */
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
public:
LIB_PIN( LIB_COMPONENT* aParent );
......@@ -361,7 +362,8 @@ public:
* If \a aColor != 0, draw with \a aColor, else with the normal pin color.
*/
void DrawPinSymbol( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
int aOrientation, int aDrawMode, int aColor = -1 );
int aOrientation, GR_DRAWMODE aDrawMode,
int aColor = -1 );
/**
* Function DrawPinTexts
......@@ -374,7 +376,7 @@ public:
*/
void DrawPinTexts( EDA_DRAW_PANEL* aPanel, wxDC* aDC, wxPoint& aPosition,
int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName,
int aColor, int aDrawMode );
int aColor, GR_DRAWMODE aDrawMode );
/**
* Function PlotPinTexts
......
......@@ -265,7 +265,7 @@ int LIB_POLYLINE::GetPenSize() const
void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData,
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform )
{
wxPoint pos1;
......
......@@ -40,7 +40,8 @@ class LIB_POLYLINE : public LIB_ITEM
int m_ModifyIndex; // Index of the polyline point to modify
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
void calcEdit( const wxPoint& aPosition );
......
......@@ -195,7 +195,7 @@ int LIB_RECTANGLE::GetPenSize() const
void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aColor, int aDrawMode,
const wxPoint& aOffset, int aColor, GR_DRAWMODE aDrawMode,
void* aData, const TRANSFORM& aTransform )
{
wxPoint pos1, pos2;
......
......@@ -42,7 +42,8 @@ class LIB_RECTANGLE : public LIB_ITEM
bool m_isStartPointSelected; // Flag: is the upper left edge selected?
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
void calcEdit( const wxPoint& aPosition );
......
......@@ -344,7 +344,7 @@ int LIB_TEXT::GetPenSize() const
void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
int aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
{
int color = GetDefaultColor();
......
......@@ -48,7 +48,8 @@ class LIB_TEXT : public LIB_ITEM, public EDA_TEXT
bool m_updateText; ///< Flag to indicate text change occurred while editing.
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform );
int aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform );
void calcEdit( const wxPoint& aPosition );
......
......@@ -412,7 +412,7 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
if( DC )
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText,
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_COPY, &showPinText,
DefaultTransform );
}
......
......@@ -195,7 +195,7 @@ EDA_RECT SCH_BITMAP::GetBoundingBox() const
void SCH_BITMAP::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor )
GR_DRAWMODE aDrawMode, int aColor )
{
wxPoint pos = m_Pos + aOffset;
......
......@@ -95,7 +95,7 @@ public:
void SwapData( SCH_ITEM* aItem );
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor = -1 );
GR_DRAWMODE aDrawMode, int aColor = -1 );
/**
* Function ReadImageFile
......
......@@ -178,7 +178,7 @@ int SCH_BUS_ENTRY::GetPenSize() const
void SCH_BUS_ENTRY::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor )
GR_DRAWMODE aDrawMode, int aColor )
{
int color;
......
......@@ -86,7 +86,7 @@ public:
void SwapData( SCH_ITEM* aItem );
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor = -1 );
GR_DRAWMODE aDrawMode, int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -290,7 +290,7 @@ int SCH_COMPONENT::GetPartCount() const
void SCH_COMPONENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color, bool DrawPinText )
GR_DRAWMODE DrawMode, int Color, bool DrawPinText )
{
bool dummy = false;
......
......@@ -249,7 +249,7 @@ public:
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
GR_DRAWMODE draw_mode,
int Color = -1 )
{
Draw( panel, DC, offset, draw_mode, Color, true );
......@@ -258,7 +258,7 @@ public:
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
GR_DRAWMODE draw_mode,
int Color,
bool DrawPinText );
......
......@@ -130,7 +130,7 @@ int SCH_FIELD::GetPenSize() const
void SCH_FIELD::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color )
const wxPoint& offset, GR_DRAWMODE DrawMode, int Color )
{
int orient;
EDA_COLOR_T color;
......
......@@ -137,7 +137,7 @@ public:
void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aDrawMode,
GR_DRAWMODE aDrawMode,
int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -114,7 +114,7 @@ EDA_RECT SCH_JUNCTION::GetBoundingBox() const
void SCH_JUNCTION::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor )
GR_DRAWMODE aDrawMode, int aColor )
{
int color;
......
......@@ -55,7 +55,7 @@ public:
EDA_RECT GetBoundingBox() const;
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor = -1 );
GR_DRAWMODE aDrawMode, int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -222,7 +222,7 @@ int SCH_LINE::GetPenSize() const
void SCH_LINE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
GR_DRAWMODE DrawMode, int Color )
{
int color;
int width = GetPenSize();
......
......@@ -85,7 +85,7 @@ public:
double GetLength() const;
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor = -1 );
GR_DRAWMODE aDrawMode, int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -103,7 +103,7 @@ bool SCH_MARKER::Save( FILE* aFile ) const
void SCH_MARKER::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aDrawMode, int aColor )
const wxPoint& aOffset, GR_DRAWMODE aDrawMode, int aColor )
{
EDA_COLOR_T color = (EDA_COLOR_T) m_Color;
EDA_COLOR_T tmp = color;
......
......@@ -67,7 +67,7 @@ public:
}
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDraw_mode, int aColor = -1 );
GR_DRAWMODE aDraw_mode, int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -123,7 +123,7 @@ int SCH_NO_CONNECT::GetPenSize() const
void SCH_NO_CONNECT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor )
GR_DRAWMODE aDrawMode, int aColor )
{
int pX, pY, color;
int delta = m_size.x / 2;
......
......@@ -55,7 +55,7 @@ public:
void SwapData( SCH_ITEM* aItem );
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor = -1 );
GR_DRAWMODE aDrawMode, int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -156,7 +156,7 @@ int SCH_POLYLINE::GetPenSize() const
void SCH_POLYLINE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor )
GR_DRAWMODE aDrawMode, int aColor )
{
int color;
int width = GetPenSize();
......
......@@ -52,7 +52,7 @@ public:
}
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aColor = -1 );
GR_DRAWMODE aDrawMode, int aColor = -1 );
bool Save( FILE* aFile ) const;
......
......@@ -549,7 +549,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
// note: SCH_SCREEN::Draw is useful only for schematic.
// library editor and library viewer do not use a draw list, and therefore
// SCH_SCREEN::Draw draws nothing
void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aColor )
void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, GR_DRAWMODE aDrawMode, int aColor )
{
for( SCH_ITEM* item = m_drawList.begin(); item != NULL; item = item->Next() )
{
......
......@@ -566,7 +566,7 @@ wxPoint SCH_SHEET::GetFileNamePosition()
void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aDrawMode, int aColor )
const wxPoint& aOffset, GR_DRAWMODE aDrawMode, int aColor )
{
int txtcolor;
wxString Text;
......
......@@ -97,7 +97,7 @@ public:
void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aDraw_mode,
GR_DRAWMODE aDraw_mode,
int aColor = -1 );
/**
......@@ -394,7 +394,7 @@ public:
void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aDrawMode,
GR_DRAWMODE aDrawMode,
int aColor = -1 );
EDA_RECT GetBoundingBox() const;
......
......@@ -70,7 +70,7 @@ EDA_ITEM* SCH_SHEET_PIN::Clone() const
void SCH_SHEET_PIN::Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aDraw_mode,
GR_DRAWMODE aDraw_mode,
int aColor )
{
// The icon selection is handle by the virtual method CreateGraphicShape
......
......@@ -370,7 +370,7 @@ int SCH_TEXT::GetPenSize() const
void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,
int DrawMode, int Color )
GR_DRAWMODE DrawMode, int Color )
{
EDA_COLOR_T color;
int linewidth = ( m_Thickness == 0 ) ? g_DrawDefaultLineThickness : m_Thickness;
......@@ -880,7 +880,7 @@ bool SCH_LABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
void SCH_LABEL::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
GR_DRAWMODE DrawMode, int Color )
{
SCH_TEXT::Draw( panel, DC, offset, DrawMode, Color );
}
......@@ -1191,7 +1191,7 @@ void SCH_GLOBALLABEL::SetOrientation( int aOrientation )
void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& aOffset,
int DrawMode,
GR_DRAWMODE DrawMode,
int Color )
{
static std::vector <wxPoint> Poly;
......@@ -1521,7 +1521,7 @@ void SCH_HIERLABEL::SetOrientation( int aOrientation )
void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int DrawMode,
GR_DRAWMODE DrawMode,
int Color )
{
static std::vector <wxPoint> Poly;
......
......@@ -133,7 +133,7 @@ public:
virtual void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
GR_DRAWMODE draw_mode,
int Color = -1 );
/**
......@@ -230,7 +230,7 @@ public:
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
GR_DRAWMODE draw_mode,
int Color = -1 );
wxString GetClass() const
......@@ -281,7 +281,7 @@ public:
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
GR_DRAWMODE draw_mode,
int Color = -1 );
wxString GetClass() const
......@@ -336,7 +336,7 @@ public:
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
GR_DRAWMODE draw_mode,
int Color = -1 );
wxString GetClass() const
......
......@@ -83,7 +83,7 @@ public:
* @param aOffset = an draw offset value
*/
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
int aDrawMode, const wxPoint& aOffset );
GR_DRAWMODE aDrawMode, const wxPoint& aOffset );
/**
* Function SetVisibleLayers
......
......@@ -303,7 +303,7 @@ bool GERBER_DRAW_ITEM::HasNegativeItems()
}
void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
// used when a D_CODE is not found. default D_CODE to draw a flashed item
......
......@@ -31,7 +31,7 @@
#include <base_struct.h>
#include <dlist.h>
#include <gr_basic.h>
class GERBER_IMAGE;
class GBR_LAYOUT;
......@@ -221,7 +221,7 @@ public:
/* Display on screen: */
void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint&aOffset );
/**
......
......@@ -58,7 +58,8 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer,
m_canvas->SetPrintMirrored( aPrintMirrorMode );
GetLayout()->Draw( m_canvas, aDC, -1, wxPoint( 0, 0 ) );
// XXX -1 as drawmode?
GetLayout()->Draw( m_canvas, aDC, UNSPECIFIED_DRAWMODE, wxPoint( 0, 0 ) );
m_canvas->SetPrintMirrored( false );
......@@ -77,7 +78,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
wxBusyCursor dummy;
int drawMode = -1;
GR_DRAWMODE drawMode = UNSPECIFIED_DRAWMODE;
switch( GetDisplayMode() )
{
......@@ -121,7 +122,8 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/*
* Redraw All GerbView layers, using a buffered mode or not
*/
void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset )
void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
// Because Images can be negative (i.e with background filled in color) items are drawn
// graphic layer per graphic layer, after the background is filled
......@@ -273,7 +275,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const w
if( layer == gerbFrame->getActiveLayer() )
dcode_highlight = gerber->m_Selected_Tool;
int layerdrawMode = GR_COPY;
GR_DRAWMODE layerdrawMode = GR_COPY;
if( aDrawMode == GR_OR && !gerber->HasNegativeItems() )
layerdrawMode = GR_OR;
......@@ -285,10 +287,10 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const w
if( item->GetLayer() != layer )
continue;
int drawMode = layerdrawMode;
GR_DRAWMODE drawMode = layerdrawMode;
if( dcode_highlight && dcode_highlight == item->m_DCode )
drawMode |= GR_HIGHLIGHT;
DrawModeAddHighlight( &drawMode);
item->Draw( aPanel, plotDC, drawMode, wxPoint(0,0) );
doBlit = true;
......@@ -344,7 +346,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const w
}
void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode )
void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, GR_DRAWMODE aDrawMode )
{
wxPoint pos;
int width, orient;
......
......@@ -686,7 +686,7 @@ public:
* @param aDC = the current device context
* @param aDrawMode = GR_COPY, GR_OR ...
*/
void DrawItemsDCodeID( wxDC* aDC, int aDrawMode );
void DrawItemsDCodeID( wxDC* aDC, GR_DRAWMODE aDrawMode );
DECLARE_EVENT_TABLE()
};
......
......@@ -34,7 +34,7 @@
#include <base_struct.h>
#include <class_undoredo_container.h>
#include <gr_basic.h>
/* Block state codes. */
typedef enum {
......@@ -123,7 +123,7 @@ public:
void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aDrawMode,
GR_DRAWMODE aDrawMode,
int aColor );
/**
......
......@@ -32,7 +32,7 @@
#include <base_struct.h>
#include <gr_basic.h>
#include <boost/ptr_container/ptr_vector.hpp>
......@@ -118,7 +118,7 @@ public:
* BOARD_ITEMs have their own color information.
*/
virtual void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset ) = 0;
GR_DRAWMODE aDrawMode, const wxPoint& offset = ZeroOffset ) = 0;
/**
* Function IsOnLayer
......
......@@ -33,6 +33,7 @@
#include <colors.h>
#include <base_struct.h>
#include <gr_basic.h>
class EDA_DRAW_FRAME;
class BASE_SCREEN;
......@@ -168,7 +169,7 @@ public:
* @param aDC = current Device Context
* @param aDrawMode = draw mode (GR_COPY, GR_OR ..)
*/
void DrawAuxiliaryAxis( wxDC* aDC, int aDrawMode );
void DrawAuxiliaryAxis( wxDC* aDC, GR_DRAWMODE aDrawMode );
/**
* Function DrawGridAxis
......@@ -177,7 +178,7 @@ public:
* @param aDC = current Device Context
* @param aDrawMode = draw mode (GR_COPY, GR_OR ..)
*/
void DrawGridAxis( wxDC* aDC, int aDrawMode );
void DrawGridAxis( wxDC* aDC, GR_DRAWMODE aDrawMode );
void OnEraseBackground( wxEraseEvent& event ) { }
......
......@@ -6,6 +6,7 @@
#define _CLASS_MARKER_BASE_H
#include <class_drc_item.h>
#include <gr_basic.h>
class MARKER_BASE
{
......@@ -65,7 +66,8 @@ public:
* Function DrawMarker
* draws the shape is the polygon defined in m_Corners (array of wxPoints).
*/
void DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset );
void DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset );
/**
* Function GetPos
......
......@@ -189,7 +189,8 @@ public:
* @param aDrawMode The drawing mode.
* @param aColor The drawing color.
*/
void Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aColor = -1 );
void Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, GR_DRAWMODE aDrawMode,
int aColor = -1 );
/**
* Function Plot
......
......@@ -165,7 +165,7 @@ public:
*/
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_COLOR_T aColor,
int aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = LINE,
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = LINE,
EDA_COLOR_T aAnchor_color = UNSPECIFIED );
private:
......@@ -186,7 +186,7 @@ private:
*/
void DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_COLOR_T aColor,
int aDrawMode, EDA_DRAW_MODE_T aFillMode,
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
EDA_COLOR_T aAnchor_color, wxString& aText,
wxPoint aPos );
......
......@@ -35,15 +35,45 @@
class EDA_RECT;
#define GR_COPY 0
#define GR_OR 0x01000000
#define GR_XOR 0x02000000
#define GR_AND 0x04000000
#define GR_NXOR 0x08000000
#define GR_INVERT 0x10000000
#define GR_ALLOW_HIGHCONTRAST 0x20000000
/// Drawmode. Compositing mode plus a flag or two
enum GR_DRAWMODE {
GR_COPY = 0,
GR_OR = 0x01000000,
GR_XOR = 0x02000000,
GR_AND = 0x04000000,
GR_NXOR = 0x08000000,
GR_INVERT = 0x10000000,
GR_ALLOW_HIGHCONTRAST = 0x20000000,
GR_HIGHLIGHT = 0x80000000,
UNSPECIFIED_DRAWMODE = -1
};
inline void DrawModeAddHighlight(GR_DRAWMODE *mode)
{
*mode = static_cast<GR_DRAWMODE>( int( *mode ) | GR_HIGHLIGHT );
}
inline void DrawModeAllowHighContrast(GR_DRAWMODE *mode)
{
*mode = static_cast<GR_DRAWMODE>( int( *mode ) | GR_ALLOW_HIGHCONTRAST );
}
inline GR_DRAWMODE operator ~(const GR_DRAWMODE& a)
{
return static_cast<GR_DRAWMODE>( ~int( a ) );
}
inline GR_DRAWMODE operator |(const GR_DRAWMODE& a, const GR_DRAWMODE& b)
{
return static_cast<GR_DRAWMODE>( int( a ) | int( b ) );
}
inline GR_DRAWMODE operator &(const GR_DRAWMODE& a, const GR_DRAWMODE& b)
{
return static_cast<GR_DRAWMODE>( int( a ) & int( b ) );
}
#define GR_HIGHLIGHT 0x80000000
#define GR_M_LEFT_DOWN 0x10000000
#define GR_M_RIGHT_DOWN 0x20000000
......@@ -59,7 +89,7 @@ typedef int wxPenStyle;
#endif
extern int g_XorMode;
extern GR_DRAWMODE g_XorMode;
extern int g_DrawBgColor;
......@@ -73,8 +103,8 @@ typedef enum {
class EDA_DRAW_PANEL;
void GRSetDrawMode( wxDC* DC, int mode );
int GRGetDrawMode( wxDC* DC );
void GRSetDrawMode( wxDC* DC, GR_DRAWMODE mode );
GR_DRAWMODE GRGetDrawMode( wxDC* DC );
void GRResetPenAndBrush( wxDC* DC );
void GRSetColorPen( wxDC* DC, int Color, int width = 1, wxPenStyle stype = wxPENSTYLE_SOLID );
void GRSetBrush( wxDC* DC, int Color, int fill = 0 );
......
......@@ -167,7 +167,7 @@ public:
virtual void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
const wxPoint& aOffset,
int aDrawMode,
GR_DRAWMODE aDrawMode,
int aColor = -1 ) = 0;
/**
......
......@@ -1538,7 +1538,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCoun
}
void BOARD::RedrawAreasOutlines( EDA_DRAW_PANEL* panel, wxDC* aDC, int aDrawMode, int aLayer )
void BOARD::RedrawAreasOutlines( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, int aLayer )
{
if( !aDC )
return;
......@@ -1553,7 +1553,7 @@ void BOARD::RedrawAreasOutlines( EDA_DRAW_PANEL* panel, wxDC* aDC, int aDrawMode
}
void BOARD::RedrawFilledAreas( EDA_DRAW_PANEL* panel, wxDC* aDC, int aDrawMode, int aLayer )
void BOARD::RedrawFilledAreas( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, int aLayer )
{
if( !aDC )
return;
......
......@@ -807,7 +807,7 @@ public:
* @param aOffset = an draw offset value (default = 0,0)
*/
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
int aDrawMode, const wxPoint& aOffset = ZeroOffset );
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset );
/**
* Function DrawHighLight
......@@ -976,14 +976,15 @@ public:
*/
void RedrawAreasOutlines( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
int aLayer );
/**
* Function RedrawFilledAreas
* Redraw all filled areas on layer aLayer ( redraw all if aLayer < 0 )
*/
void RedrawFilledAreas( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, int aLayer );
void RedrawFilledAreas( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
int aLayer );
/**
* Function SetAreasNetCodesFromNetNames
......
......@@ -120,7 +120,7 @@ public:
}
void Draw( EDA_DRAW_PANEL* DrawPanel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset )
GR_DRAWMODE aDrawMode, const wxPoint& offset = ZeroOffset )
{
}
......
......@@ -351,7 +351,8 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
}
void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxPoint& offset )
void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
const wxPoint& offset )
{
int ox, oy, typeaff, width, gcolor;
......
......@@ -95,7 +95,7 @@ public:
void Copy( DIMENSION* source );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
int aColorMode, const wxPoint& offset = ZeroOffset );
GR_DRAWMODE aColorMode, const wxPoint& offset = ZeroOffset );
/**
* Function Move
......
......@@ -167,7 +167,8 @@ MODULE* DRAWSEGMENT::GetParentModule() const
}
void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& aOffset )
void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
const wxPoint& aOffset )
{
int ux0, uy0, dx, dy;
int l_trace;
......
......@@ -161,7 +161,7 @@ public:
void Copy( DRAWSEGMENT* source );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
int aDrawMode, const wxPoint& aOffset = ZeroOffset );
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset );
virtual void DisplayInfo( EDA_DRAW_FRAME* frame );
......
......@@ -95,7 +95,8 @@ void EDGE_MODULE::SetDrawCoord()
}
void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
const wxPoint& offset )
{
int ux0, uy0, dx, dy, radius, StAngle, EndAngle;
int color, type_trace;
......
......@@ -65,7 +65,7 @@ public:
/* drawing functions */
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset );
GR_DRAWMODE aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw3D( EDA_3D_CANVAS* glcanvas );
......
......@@ -52,8 +52,8 @@ public:
void Flip( const wxPoint& aCentre );
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
const wxPoint& aOffset = ZeroOffset )
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset )
{
DrawMarker( aPanel, aDC, aDrawMode, aOffset );
}
......
......@@ -94,7 +94,8 @@ void PCB_TARGET::Copy( PCB_TARGET* source )
* The circle radius is half the radius of the target
* 2 lines have length the diameter of the target
*/
void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxPoint& offset )
void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
const wxPoint& offset )
{
int radius, ox, oy, gcolor, width;
int dx1, dx2, dy1, dy2;
......
......@@ -88,8 +88,8 @@ public:
void Copy( PCB_TARGET* source );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& offset = ZeroOffset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
GR_DRAWMODE aDrawMode, const wxPoint& offset = ZeroOffset );
bool HitTest( const wxPoint& aPosition );
......
......@@ -182,7 +182,7 @@ MODULE::~MODULE()
* every thing already drawn.
*/
void MODULE::DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
int dim_ancre, int draw_mode )
int dim_ancre, GR_DRAWMODE draw_mode )
{
int anchor_size = DC->DeviceToLogicalXRel( dim_ancre );
......@@ -307,7 +307,7 @@ void MODULE::Copy( MODULE* aModule )
* @param aDrawMode = GR_OR, GR_XOR..
* @param aOffset = draw offset (usually wxPoint(0,0)
*/
void MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset )
void MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode, const wxPoint& aOffset )
{
if( (m_Flags & DO_NOT_DRAW) || (IsMoving()) )
return;
......@@ -371,7 +371,8 @@ void MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoi
* @param offset = draw offset (usually wxPoint(0,0)
* @param draw_mode = GR_OR, GR_XOR, GR_AND
*/
void MODULE::DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset, int draw_mode )
void MODULE::DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
GR_DRAWMODE draw_mode )
{
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
......
......@@ -239,15 +239,16 @@ public:
void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& aOffset = ZeroOffset );
void Draw3D( EDA_3D_CANVAS* glcanvas );
void DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset, int draw_mode );
void DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
GR_DRAWMODE draw_mode );
void DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC,
const wxPoint& offset, int dim_ancre, int draw_mode );
const wxPoint& offset, int dim_ancre, GR_DRAWMODE draw_mode );
void DisplayInfo( EDA_DRAW_FRAME* frame );
......
......@@ -11,7 +11,7 @@
#include <vector>
#include <gr_basic.h>
#include <class_netclass.h>
......@@ -86,7 +86,8 @@ public:
/**
* Function Draw
*/
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE aDrawMode,
const wxPoint& offset );
};
......@@ -347,7 +348,8 @@ public:
* @todo we actually could show a NET, simply show all the tracks and
* a pads or net name on pad and vias
*/
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE aDrawMode,
const wxPoint& offset );
/**
* Function GetNet
......
......@@ -90,7 +90,7 @@ void NETINFO_ITEM::SetNetname( const wxString& aNetname )
*/
void NETINFO_ITEM::Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
}
......@@ -194,7 +194,7 @@ RATSNEST_ITEM::RATSNEST_ITEM()
*/
void RATSNEST_ITEM::Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
GRSetDrawMode( DC, aDrawMode );
......
......@@ -69,7 +69,7 @@ class PAD_DRAWINFO
{
public:
EDA_DRAW_PANEL* m_DrawPanel; // the EDA_DRAW_PANEL used to draw a PAD ; can be null
int m_DrawMode; // the draw mode
GR_DRAWMODE m_DrawMode; // the draw mode
int m_Color; // color used to draw the pad shape , from pad layers and
// visible layers
int m_HoleColor; // color used to draw the pad hole
......@@ -270,7 +270,7 @@ public:
/* drawing functions */
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
int aDrawMode, const wxPoint& aOffset = ZeroOffset );
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset );
void Draw3D( EDA_3D_CANVAS* glcanvas );
......
......@@ -61,7 +61,7 @@
PAD_DRAWINFO::PAD_DRAWINFO()
{
m_DrawPanel = NULL;
m_DrawMode = 0;
m_DrawMode = GR_COPY;
m_Color = BLACK;
m_HoleColor = BLACK; // could be DARKGRAY;
m_NPHoleColor = YELLOW;
......@@ -75,7 +75,8 @@ PAD_DRAWINFO::PAD_DRAWINFO()
}
void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoint& aOffset )
void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
const wxPoint& aOffset )
{
int color = 0;
wxSize mask_margin; // margin (clearance) used for some non copper layers
......
......@@ -82,7 +82,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
int DrawMode, const wxPoint& offset )
GR_DRAWMODE DrawMode, const wxPoint& offset )
{
BOARD* brd = GetBoard();
......
......@@ -70,8 +70,8 @@ public:
/* duplicate structure */
void Copy( TEXTE_PCB* source );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& offset = ZeroOffset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
GR_DRAWMODE aDrawMode, const wxPoint& offset = ZeroOffset );
void DisplayInfo( EDA_DRAW_FRAME* frame );
......
......@@ -235,7 +235,8 @@ EDA_RECT TEXTE_MODULE::GetBoundingBox() const
* @param offset = draw offset (usually wxPoint(0,0)
* @param draw_mode = GR_OR, GR_XOR..
*/
void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
const wxPoint& offset )
{
int width, color, orient;
wxSize size;
......@@ -316,7 +317,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
*/
void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
MODULE* parent = (MODULE*) GetParent();
......
......@@ -119,7 +119,7 @@ public:
/* drawing functions */
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& offset = ZeroOffset );
/**
......@@ -133,7 +133,7 @@ public:
*/
void DrawUmbilical( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& aOffset = ZeroOffset );
void DisplayInfo( EDA_DRAW_FRAME* frame );
......
......@@ -582,7 +582,8 @@ TRACK* TRACK::GetEndNetCode( int NetCode )
}
void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& aOffset )
void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
const wxPoint& aOffset )
{
int l_trace;
int color;
......@@ -756,7 +757,8 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint&
}
void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& aOffset )
void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
const wxPoint& aOffset )
{
int color;
int radius;
......
......@@ -159,8 +159,8 @@ public:
}
/* Display on screen: */
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& aOffset = ZeroOffset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset );
/* divers */
int GetShape() const { return m_Shape & 0xFF; }
......@@ -378,8 +378,8 @@ public:
// Do not create a copy constructor. The one generated by the compiler is adequate.
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& aOffset = ZeroOffset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset );
bool IsOnLayer( int aLayer ) const;
......
......@@ -163,7 +163,7 @@ void ZONE_CONTAINER::SetNet( int aNetCode )
}
void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset )
void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE aDrawMode, const wxPoint& offset )
{
if( DC == NULL )
return;
......@@ -243,7 +243,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const
void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
wxDC* DC, int aDrawMode, const wxPoint& offset )
wxDC* DC, GR_DRAWMODE aDrawMode, const wxPoint& offset )
{
static std::vector <char> CornersTypeBuffer;
static std::vector <wxPoint> CornersBuffer;
......@@ -400,9 +400,10 @@ EDA_RECT ZONE_CONTAINER::GetBoundingBox() const
}
void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode )
void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
GR_DRAWMODE draw_mode )
{
int current_gr_mode = draw_mode;
GR_DRAWMODE current_gr_mode = draw_mode;
bool is_close_segment = false;
wxPoint seg_start, seg_end;
......
......@@ -121,7 +121,7 @@ public:
*/
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& offset = ZeroOffset );
/**
......@@ -134,7 +134,7 @@ public:
*/
void DrawFilledArea( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
GR_DRAWMODE aDrawMode,
const wxPoint& offset = ZeroOffset );
/**
......@@ -146,7 +146,8 @@ public:
* @param DC = current Device Context
* @param draw_mode = draw mode: OR, XOR ..
*/
void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode = GR_OR );
void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
GR_DRAWMODE draw_mode = GR_OR );
/* Function GetBoundingBox
* @return an EDA_RECT that is the bounding box of the zone outline
......
......@@ -169,7 +169,7 @@ static void Show_MoveNode( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo
TRACK* Track;
BASE_SCREEN* screen = aPanel->GetScreen();
int track_fill_copy = DisplayOpt.DisplayPcbTrackFill;
int draw_mode = GR_XOR | GR_HIGHLIGHT;
GR_DRAWMODE draw_mode = GR_XOR | GR_HIGHLIGHT;
DisplayOpt.DisplayPcbTrackFill = false;
......@@ -322,7 +322,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC
}
}
int draw_mode = GR_XOR | GR_HIGHLIGHT;
GR_DRAWMODE draw_mode = GR_XOR | GR_HIGHLIGHT;
/* Undraw the current moved track segments before modification*/
......@@ -1026,7 +1026,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
}
}
int draw_mode = GR_OR | GR_HIGHLIGHT;
GR_DRAWMODE draw_mode = GR_OR | GR_HIGHLIGHT;
// DRC Ok: place track segments
Track->ClearFlags();
......
......@@ -23,7 +23,7 @@
static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
int aDraw_mode, int aMasklayer,
GR_DRAWMODE aDraw_mode, int aMasklayer,
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt );
void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
......@@ -31,7 +31,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
bool aPrintMirrorMode,
void * aData)
{
int drawmode = GR_COPY;
GR_DRAWMODE drawmode = GR_COPY;
int defaultPenSize = 50;
DISPLAY_OPTIONS save_opt;
......@@ -114,7 +114,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
void* aData)
{
MODULE* Module;
int drawmode = GR_COPY;
GR_DRAWMODE drawmode = GR_COPY;
DISPLAY_OPTIONS save_opt;
TRACK* pt_trace;
BOARD* Pcb = GetBoard();
......@@ -329,7 +329,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
int aDraw_mode, int aMasklayer,
GR_DRAWMODE aDraw_mode, int aMasklayer,
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt )
{
// Print pads
......
......@@ -4,7 +4,7 @@
#ifndef PROTO_H
#define PROTO_H
#include <gr_basic.h>
class wxDC;
class wxPoint;
......@@ -45,7 +45,7 @@ void DrawTraces( EDA_DRAW_PANEL* panel,
wxDC* DC,
TRACK* aStartTrace,
int nbsegment,
int mode_color );
GR_DRAWMODE mode_color );
/*************/
/* MODULES.C */
......
......@@ -55,7 +55,7 @@
* The pads must appear on the layers selected in LayerMask
*/
static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module,
int ox, int oy, int LayerMask, int draw_mode );
int ox, int oy, int LayerMask, GR_DRAWMODE draw_mode );
void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
......@@ -131,7 +131,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
// Redraw the BOARD items but not cursors, axis or grid
void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC, int aDrawMode, const wxPoint& offset )
void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC, GR_DRAWMODE aDrawMode, const wxPoint& offset )
{
/* The order of drawing is flexible on some systems and not on others. For
* OSes which use OR to draw, the order is not important except for the
......@@ -234,7 +234,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC, int aDrawMode, const wxPoint
void BOARD::DrawHighLight( EDA_DRAW_PANEL* am_canvas, wxDC* DC, int aNetCode )
{
int draw_mode;
GR_DRAWMODE draw_mode;
if( IsHighLightNetON() )
draw_mode = GR_HIGHLIGHT | GR_OR;
......@@ -280,8 +280,8 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* am_canvas, wxDC* DC, int aNetCode )
* and we want to see pad through.
* The pads must appear on the layers selected in LayerMask
*/
void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* aModule,
int ox, int oy, int aLayerMask, int draw_mode )
static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* aModule,
int ox, int oy, int aLayerMask, GR_DRAWMODE draw_mode )
{
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) panel->GetParent();
......
......@@ -14,7 +14,8 @@
#include <protos.h>
void DrawTraces( EDA_DRAW_PANEL* panel, wxDC* DC, TRACK* aTrackList, int nbsegment, int draw_mode )
void DrawTraces( EDA_DRAW_PANEL* panel, wxDC* DC, TRACK* aTrackList, int nbsegment,
GR_DRAWMODE draw_mode )
{
// preserve the start of the list for debugging.
for( TRACK* track = aTrackList; nbsegment > 0 && track; nbsegment--, track = track->Next() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment