From 082d901d60b699858b2021b2527f8efa9e4b89ca Mon Sep 17 00:00:00 2001
From: Lorenzo Marcantonio
Date: Sat, 1 Sep 2012 15:38:27 +0200
Subject: [PATCH] Encapsulated drawmode as an enum for type checking
---
common/block_commande.cpp | 2 +-
common/class_marker_base.cpp | 2 +-
common/drawpanel.cpp | 4 +-
common/eda_text.cpp | 4 +-
common/gr_basic.cpp | 4 +-
cvpcb/setvisu.cpp | 3 +-
eeschema/class_libentry.cpp | 2 +-
eeschema/class_libentry.h | 2 +-
eeschema/dialogs/dialog_lib_edit_pin.cpp | 2 +-
eeschema/lib_arc.cpp | 2 +-
eeschema/lib_arc.h | 3 +-
eeschema/lib_bezier.cpp | 2 +-
eeschema/lib_bezier.h | 3 +-
eeschema/lib_circle.cpp | 2 +-
eeschema/lib_circle.h | 3 +-
eeschema/lib_draw_item.cpp | 2 +-
eeschema/lib_draw_item.h | 8 ++--
eeschema/lib_field.cpp | 2 +-
eeschema/lib_field.h | 3 +-
eeschema/lib_pin.cpp | 6 +--
eeschema/lib_pin.h | 8 ++--
eeschema/lib_polyline.cpp | 2 +-
eeschema/lib_polyline.h | 3 +-
eeschema/lib_rectangle.cpp | 2 +-
eeschema/lib_rectangle.h | 3 +-
eeschema/lib_text.cpp | 2 +-
eeschema/lib_text.h | 3 +-
eeschema/pinedit.cpp | 2 +-
eeschema/sch_bitmap.cpp | 2 +-
eeschema/sch_bitmap.h | 2 +-
eeschema/sch_bus_entry.cpp | 2 +-
eeschema/sch_bus_entry.h | 2 +-
eeschema/sch_component.cpp | 2 +-
eeschema/sch_component.h | 4 +-
eeschema/sch_field.cpp | 2 +-
eeschema/sch_field.h | 2 +-
eeschema/sch_junction.cpp | 2 +-
eeschema/sch_junction.h | 2 +-
eeschema/sch_line.cpp | 2 +-
eeschema/sch_line.h | 2 +-
eeschema/sch_marker.cpp | 2 +-
eeschema/sch_marker.h | 2 +-
eeschema/sch_no_connect.cpp | 2 +-
eeschema/sch_no_connect.h | 2 +-
eeschema/sch_polyline.cpp | 2 +-
eeschema/sch_polyline.h | 2 +-
eeschema/sch_screen.cpp | 2 +-
eeschema/sch_sheet.cpp | 2 +-
eeschema/sch_sheet.h | 4 +-
eeschema/sch_sheet_pin.cpp | 2 +-
eeschema/sch_text.cpp | 8 ++--
eeschema/sch_text.h | 8 ++--
gerbview/class_gbr_layout.h | 2 +-
gerbview/class_gerber_draw_item.cpp | 2 +-
gerbview/class_gerber_draw_item.h | 4 +-
gerbview/draw_gerber_screen.cpp | 16 ++++----
gerbview/gerbview_frame.h | 2 +-
include/block_commande.h | 4 +-
include/class_board_item.h | 4 +-
include/class_drawpanel.h | 5 ++-
include/class_marker_base.h | 4 +-
include/class_sch_screen.h | 3 +-
include/eda_text.h | 4 +-
include/gr_basic.h | 52 +++++++++++++++++++-----
include/sch_item_struct.h | 2 +-
pcbnew/class_board.cpp | 4 +-
pcbnew/class_board.h | 7 ++--
pcbnew/class_board_connected_item.h | 2 +-
pcbnew/class_dimension.cpp | 3 +-
pcbnew/class_dimension.h | 2 +-
pcbnew/class_drawsegment.cpp | 3 +-
pcbnew/class_drawsegment.h | 2 +-
pcbnew/class_edge_mod.cpp | 3 +-
pcbnew/class_edge_mod.h | 2 +-
pcbnew/class_marker_pcb.h | 4 +-
pcbnew/class_mire.cpp | 3 +-
pcbnew/class_mire.h | 4 +-
pcbnew/class_module.cpp | 7 ++--
pcbnew/class_module.h | 7 ++--
pcbnew/class_netinfo.h | 8 ++--
pcbnew/class_netinfo_item.cpp | 4 +-
pcbnew/class_pad.h | 4 +-
pcbnew/class_pad_draw_functions.cpp | 5 ++-
pcbnew/class_pcb_text.cpp | 2 +-
pcbnew/class_pcb_text.h | 4 +-
pcbnew/class_text_mod.cpp | 5 ++-
pcbnew/class_text_mod.h | 4 +-
pcbnew/class_track.cpp | 6 ++-
pcbnew/class_track.h | 8 ++--
pcbnew/class_zone.cpp | 9 ++--
pcbnew/class_zone.h | 7 ++--
pcbnew/move_or_drag_track.cpp | 6 +--
pcbnew/print_board_functions.cpp | 8 ++--
pcbnew/protos.h | 4 +-
pcbnew/tracepcb.cpp | 10 ++---
pcbnew/trpiste.cpp | 3 +-
96 files changed, 234 insertions(+), 170 deletions(-)
diff --git a/common/block_commande.cpp b/common/block_commande.cpp
index fd6746fbcf..2ecb289d5f 100644
--- a/common/block_commande.cpp
+++ b/common/block_commande.cpp
@@ -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();
diff --git a/common/class_marker_base.cpp b/common/class_marker_base.cpp
index c15a7f1beb..82188b8cac 100644
--- a/common/class_marker_base.cpp
+++ b/common/class_marker_base.cpp
@@ -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];
diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp
index 938d72185c..16c2f7b6f6 100644
--- a/common/drawpanel.cpp
+++ b/common/drawpanel.cpp
@@ -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();
diff --git a/common/eda_text.cpp b/common/eda_text.cpp
index df83ecb477..3b301bc608 100644
--- a/common/eda_text.cpp
+++ b/common/eda_text.cpp
@@ -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 )
{
diff --git a/common/gr_basic.cpp b/common/gr_basic.cpp
index d5886ae113..9c6f368b5f 100644
--- a/common/gr_basic.cpp
+++ b/common/gr_basic.cpp
@@ -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 ) )
diff --git a/cvpcb/setvisu.cpp b/cvpcb/setvisu.cpp
index 6a37058c09..d16dad48b4 100644
--- a/cvpcb/setvisu.cpp
+++ b/cvpcb/setvisu.cpp
@@ -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 )
{
diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp
index 27d014277e..8054496e52 100644
--- a/eeschema/class_libentry.cpp
+++ b/eeschema/class_libentry.cpp
@@ -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();
diff --git a/eeschema/class_libentry.h b/eeschema/class_libentry.h
index 0eab6c88a9..127c52acd6 100644
--- a/eeschema/class_libentry.h
+++ b/eeschema/class_libentry.h
@@ -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 );
diff --git a/eeschema/dialogs/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp
index 03a200498e..9c65992709 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin.cpp
@@ -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);
diff --git a/eeschema/lib_arc.cpp b/eeschema/lib_arc.cpp
index 489b7a07eb..75f0715dd4 100644
--- a/eeschema/lib_arc.cpp
+++ b/eeschema/lib_arc.cpp
@@ -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.
diff --git a/eeschema/lib_arc.h b/eeschema/lib_arc.h
index 139c55335a..b3dc3b0ba7 100644
--- a/eeschema/lib_arc.h
+++ b/eeschema/lib_arc.h
@@ -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.
diff --git a/eeschema/lib_bezier.cpp b/eeschema/lib_bezier.cpp
index 66c1a05ad2..89466cb4d5 100644
--- a/eeschema/lib_bezier.cpp
+++ b/eeschema/lib_bezier.cpp
@@ -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 PolyPointsTraslated;
diff --git a/eeschema/lib_bezier.h b/eeschema/lib_bezier.h
index e5d49cbfd1..878a482a0a 100644
--- a/eeschema/lib_bezier.h
+++ b/eeschema/lib_bezier.h
@@ -43,7 +43,8 @@ class LIB_BEZIER : public LIB_ITEM
std::vector 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 );
diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp
index 8b05d3eaf1..63dbeede20 100644
--- a/eeschema/lib_circle.cpp
+++ b/eeschema/lib_circle.cpp
@@ -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;
diff --git a/eeschema/lib_circle.h b/eeschema/lib_circle.h
index 673651485e..49e01549b6 100644
--- a/eeschema/lib_circle.h
+++ b/eeschema/lib_circle.h
@@ -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 );
diff --git a/eeschema/lib_draw_item.cpp b/eeschema/lib_draw_item.cpp
index 9a57dab18a..2ef77b0f2e 100644
--- a/eeschema/lib_draw_item.cpp
+++ b/eeschema/lib_draw_item.cpp
@@ -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() )
{
diff --git a/eeschema/lib_draw_item.h b/eeschema/lib_draw_item.h
index 39969d89e9..d743cb4dcd 100644
--- a/eeschema/lib_draw_item.h
+++ b/eeschema/lib_draw_item.h
@@ -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
diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp
index c3786e685a..9a3c9ee08c 100644
--- a/eeschema/lib_field.cpp
+++ b/eeschema/lib_field.cpp
@@ -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;
diff --git a/eeschema/lib_field.h b/eeschema/lib_field.h
index da47f2639b..e46610692c 100644
--- a/eeschema/lib_field.h
+++ b/eeschema/lib_field.h
@@ -71,7 +71,8 @@ class LIB_FIELD : public LIB_ITEM, public EDA_TEXT
*
*/
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.
diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp
index 81435e9e84..9dc2161bda 100644
--- a/eeschema/lib_pin.cpp
+++ b/eeschema/lib_pin.cpp
@@ -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;
diff --git a/eeschema/lib_pin.h b/eeschema/lib_pin.h
index 7025ff7d5b..64c01e4036 100644
--- a/eeschema/lib_pin.h
+++ b/eeschema/lib_pin.h
@@ -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
diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp
index 626edef4ef..8d26694e1b 100644
--- a/eeschema/lib_polyline.cpp
+++ b/eeschema/lib_polyline.cpp
@@ -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;
diff --git a/eeschema/lib_polyline.h b/eeschema/lib_polyline.h
index 5c0aff33c5..3332998cf9 100644
--- a/eeschema/lib_polyline.h
+++ b/eeschema/lib_polyline.h
@@ -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 );
diff --git a/eeschema/lib_rectangle.cpp b/eeschema/lib_rectangle.cpp
index 016a93ffe5..e0675fb28a 100644
--- a/eeschema/lib_rectangle.cpp
+++ b/eeschema/lib_rectangle.cpp
@@ -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;
diff --git a/eeschema/lib_rectangle.h b/eeschema/lib_rectangle.h
index 4a44757ad5..4743406c73 100644
--- a/eeschema/lib_rectangle.h
+++ b/eeschema/lib_rectangle.h
@@ -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 );
diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp
index b2367ba3eb..565fad24d7 100644
--- a/eeschema/lib_text.cpp
+++ b/eeschema/lib_text.cpp
@@ -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();
diff --git a/eeschema/lib_text.h b/eeschema/lib_text.h
index 391385211c..4d9fb9e859 100644
--- a/eeschema/lib_text.h
+++ b/eeschema/lib_text.h
@@ -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 );
diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp
index 2bd61ae96e..232660af34 100644
--- a/eeschema/pinedit.cpp
+++ b/eeschema/pinedit.cpp
@@ -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 );
}
diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp
index c42476e7f3..5534e788d0 100644
--- a/eeschema/sch_bitmap.cpp
+++ b/eeschema/sch_bitmap.cpp
@@ -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;
diff --git a/eeschema/sch_bitmap.h b/eeschema/sch_bitmap.h
index d778354451..4267394a68 100644
--- a/eeschema/sch_bitmap.h
+++ b/eeschema/sch_bitmap.h
@@ -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
diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp
index ab24569a8d..4e8605910d 100644
--- a/eeschema/sch_bus_entry.cpp
+++ b/eeschema/sch_bus_entry.cpp
@@ -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;
diff --git a/eeschema/sch_bus_entry.h b/eeschema/sch_bus_entry.h
index 3c7fa5ae63..e4bb2fa641 100644
--- a/eeschema/sch_bus_entry.h
+++ b/eeschema/sch_bus_entry.h
@@ -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;
diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp
index 212fdd59a2..675ed10673 100644
--- a/eeschema/sch_component.cpp
+++ b/eeschema/sch_component.cpp
@@ -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;
diff --git a/eeschema/sch_component.h b/eeschema/sch_component.h
index 5087154371..88fbeec360 100644
--- a/eeschema/sch_component.h
+++ b/eeschema/sch_component.h
@@ -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 );
diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp
index 37ec64a63f..a354f4ad14 100644
--- a/eeschema/sch_field.cpp
+++ b/eeschema/sch_field.cpp
@@ -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;
diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h
index 8d0ff02564..c10760d33f 100644
--- a/eeschema/sch_field.h
+++ b/eeschema/sch_field.h
@@ -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;
diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp
index b9e80e253f..542c59207b 100644
--- a/eeschema/sch_junction.cpp
+++ b/eeschema/sch_junction.cpp
@@ -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;
diff --git a/eeschema/sch_junction.h b/eeschema/sch_junction.h
index d68082b6c8..0a0ad2b05c 100644
--- a/eeschema/sch_junction.h
+++ b/eeschema/sch_junction.h
@@ -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;
diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp
index b5354ab6e2..0f127f41f8 100644
--- a/eeschema/sch_line.cpp
+++ b/eeschema/sch_line.cpp
@@ -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();
diff --git a/eeschema/sch_line.h b/eeschema/sch_line.h
index 7f5cacf724..10bc87e597 100644
--- a/eeschema/sch_line.h
+++ b/eeschema/sch_line.h
@@ -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;
diff --git a/eeschema/sch_marker.cpp b/eeschema/sch_marker.cpp
index 650f4a1d19..96ea330e57 100644
--- a/eeschema/sch_marker.cpp
+++ b/eeschema/sch_marker.cpp
@@ -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;
diff --git a/eeschema/sch_marker.h b/eeschema/sch_marker.h
index 1fd9e748ae..08b1dfef4a 100644
--- a/eeschema/sch_marker.h
+++ b/eeschema/sch_marker.h
@@ -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;
diff --git a/eeschema/sch_no_connect.cpp b/eeschema/sch_no_connect.cpp
index 47302ec251..d08c1e23a5 100644
--- a/eeschema/sch_no_connect.cpp
+++ b/eeschema/sch_no_connect.cpp
@@ -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;
diff --git a/eeschema/sch_no_connect.h b/eeschema/sch_no_connect.h
index 22ab5009e9..5da5ef132b 100644
--- a/eeschema/sch_no_connect.h
+++ b/eeschema/sch_no_connect.h
@@ -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;
diff --git a/eeschema/sch_polyline.cpp b/eeschema/sch_polyline.cpp
index 25e571b83c..fe5bc895f2 100644
--- a/eeschema/sch_polyline.cpp
+++ b/eeschema/sch_polyline.cpp
@@ -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();
diff --git a/eeschema/sch_polyline.h b/eeschema/sch_polyline.h
index 1d696376ed..4cdde356f0 100644
--- a/eeschema/sch_polyline.h
+++ b/eeschema/sch_polyline.h
@@ -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;
diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp
index 4426612cfb..71e871015d 100644
--- a/eeschema/sch_screen.cpp
+++ b/eeschema/sch_screen.cpp
@@ -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() )
{
diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp
index ab923065ab..f1c09ff675 100644
--- a/eeschema/sch_sheet.cpp
+++ b/eeschema/sch_sheet.cpp
@@ -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;
diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h
index c3fd25f3f2..8cd29a75a4 100644
--- a/eeschema/sch_sheet.h
+++ b/eeschema/sch_sheet.h
@@ -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;
diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp
index 096fd7718c..373fa23f6d 100644
--- a/eeschema/sch_sheet_pin.cpp
+++ b/eeschema/sch_sheet_pin.cpp
@@ -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
diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp
index 157e58df67..b6e386d5a5 100644
--- a/eeschema/sch_text.cpp
+++ b/eeschema/sch_text.cpp
@@ -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 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 Poly;
diff --git a/eeschema/sch_text.h b/eeschema/sch_text.h
index 7cae617369..cbea95b59a 100644
--- a/eeschema/sch_text.h
+++ b/eeschema/sch_text.h
@@ -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
diff --git a/gerbview/class_gbr_layout.h b/gerbview/class_gbr_layout.h
index 3e6a2b55bb..3dd34641ea 100644
--- a/gerbview/class_gbr_layout.h
+++ b/gerbview/class_gbr_layout.h
@@ -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
diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp
index f571360064..86199f6cbc 100644
--- a/gerbview/class_gerber_draw_item.cpp
+++ b/gerbview/class_gerber_draw_item.cpp
@@ -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
diff --git a/gerbview/class_gerber_draw_item.h b/gerbview/class_gerber_draw_item.h
index 48d07a99d2..8735ec8211 100644
--- a/gerbview/class_gerber_draw_item.h
+++ b/gerbview/class_gerber_draw_item.h
@@ -31,7 +31,7 @@
#include
#include
-
+#include
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 );
/**
diff --git a/gerbview/draw_gerber_screen.cpp b/gerbview/draw_gerber_screen.cpp
index d6b39f7bf5..bbb56fd631 100644
--- a/gerbview/draw_gerber_screen.cpp
+++ b/gerbview/draw_gerber_screen.cpp
@@ -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;
diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h
index 1c257b9b09..41fc77506f 100644
--- a/gerbview/gerbview_frame.h
+++ b/gerbview/gerbview_frame.h
@@ -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()
};
diff --git a/include/block_commande.h b/include/block_commande.h
index 1f24e1d170..26bc974635 100644
--- a/include/block_commande.h
+++ b/include/block_commande.h
@@ -34,7 +34,7 @@
#include
#include
-
+#include
/* 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 );
/**
diff --git a/include/class_board_item.h b/include/class_board_item.h
index 511760c2b3..2c64957d48 100644
--- a/include/class_board_item.h
+++ b/include/class_board_item.h
@@ -32,7 +32,7 @@
#include
-
+#include
#include
@@ -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
diff --git a/include/class_drawpanel.h b/include/class_drawpanel.h
index 1911313e3c..0b88a30ac3 100644
--- a/include/class_drawpanel.h
+++ b/include/class_drawpanel.h
@@ -33,6 +33,7 @@
#include
#include
+#include
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 ) { }
diff --git a/include/class_marker_base.h b/include/class_marker_base.h
index 7753fdbea4..bcc1d66337 100644
--- a/include/class_marker_base.h
+++ b/include/class_marker_base.h
@@ -6,6 +6,7 @@
#define _CLASS_MARKER_BASE_H
#include
+#include
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
diff --git a/include/class_sch_screen.h b/include/class_sch_screen.h
index 5dc5ccbc27..40bfb5c317 100644
--- a/include/class_sch_screen.h
+++ b/include/class_sch_screen.h
@@ -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
diff --git a/include/eda_text.h b/include/eda_text.h
index 26ad50f095..8dd0540f34 100644
--- a/include/eda_text.h
+++ b/include/eda_text.h
@@ -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 );
diff --git a/include/gr_basic.h b/include/gr_basic.h
index a666a467ac..06cbdc977c 100644
--- a/include/gr_basic.h
+++ b/include/gr_basic.h
@@ -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( int( *mode ) | GR_HIGHLIGHT );
+}
+
+inline void DrawModeAllowHighContrast(GR_DRAWMODE *mode)
+{
+ *mode = static_cast( int( *mode ) | GR_ALLOW_HIGHCONTRAST );
+}
+
+inline GR_DRAWMODE operator ~(const GR_DRAWMODE& a)
+{
+ return static_cast( ~int( a ) );
+}
+
+inline GR_DRAWMODE operator |(const GR_DRAWMODE& a, const GR_DRAWMODE& b)
+{
+ return static_cast( int( a ) | int( b ) );
+}
+
+inline GR_DRAWMODE operator &(const GR_DRAWMODE& a, const GR_DRAWMODE& b)
+{
+ return static_cast( 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 );
diff --git a/include/sch_item_struct.h b/include/sch_item_struct.h
index fd8000c17c..2d156484c3 100644
--- a/include/sch_item_struct.h
+++ b/include/sch_item_struct.h
@@ -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;
/**
diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp
index 34e0fb02ee..962fc08386 100644
--- a/pcbnew/class_board.cpp
+++ b/pcbnew/class_board.cpp
@@ -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;
diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h
index b87402aa67..08dee42524 100644
--- a/pcbnew/class_board.h
+++ b/pcbnew/class_board.h
@@ -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
diff --git a/pcbnew/class_board_connected_item.h b/pcbnew/class_board_connected_item.h
index b2355ba249..dddbe6f705 100644
--- a/pcbnew/class_board_connected_item.h
+++ b/pcbnew/class_board_connected_item.h
@@ -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 )
{
}
diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp
index 02e7ecdd13..26847def3e 100644
--- a/pcbnew/class_dimension.cpp
+++ b/pcbnew/class_dimension.cpp
@@ -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;
diff --git a/pcbnew/class_dimension.h b/pcbnew/class_dimension.h
index ef449c32cf..1b0b33edf5 100644
--- a/pcbnew/class_dimension.h
+++ b/pcbnew/class_dimension.h
@@ -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
diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp
index 157f52907e..d0de057b87 100644
--- a/pcbnew/class_drawsegment.cpp
+++ b/pcbnew/class_drawsegment.cpp
@@ -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;
diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h
index dc2b745919..c36b5b9806 100644
--- a/pcbnew/class_drawsegment.h
+++ b/pcbnew/class_drawsegment.h
@@ -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 );
diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp
index dde127d5e3..8816cc435f 100644
--- a/pcbnew/class_edge_mod.cpp
+++ b/pcbnew/class_edge_mod.cpp
@@ -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;
diff --git a/pcbnew/class_edge_mod.h b/pcbnew/class_edge_mod.h
index 609ee2cb49..67fb247697 100644
--- a/pcbnew/class_edge_mod.h
+++ b/pcbnew/class_edge_mod.h
@@ -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 );
diff --git a/pcbnew/class_marker_pcb.h b/pcbnew/class_marker_pcb.h
index 05cd95e434..6c27f9b448 100644
--- a/pcbnew/class_marker_pcb.h
+++ b/pcbnew/class_marker_pcb.h
@@ -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 );
}
diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp
index 459458ae39..bd44948c34 100644
--- a/pcbnew/class_mire.cpp
+++ b/pcbnew/class_mire.cpp
@@ -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;
diff --git a/pcbnew/class_mire.h b/pcbnew/class_mire.h
index a874ed7e2d..e454c3431c 100644
--- a/pcbnew/class_mire.h
+++ b/pcbnew/class_mire.h
@@ -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 );
diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp
index d8beb467ff..2a73c0e820 100644
--- a/pcbnew/class_module.cpp
+++ b/pcbnew/class_module.cpp
@@ -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() )
{
diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h
index 5ca97a8cf5..d5f7c2442a 100644
--- a/pcbnew/class_module.h
+++ b/pcbnew/class_module.h
@@ -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 );
diff --git a/pcbnew/class_netinfo.h b/pcbnew/class_netinfo.h
index eba5307a7f..d1b6e6e5da 100644
--- a/pcbnew/class_netinfo.h
+++ b/pcbnew/class_netinfo.h
@@ -11,7 +11,7 @@
#include
-
+#include
#include
@@ -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
diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp
index c6498fc51b..5099f0779e 100644
--- a/pcbnew/class_netinfo_item.cpp
+++ b/pcbnew/class_netinfo_item.cpp
@@ -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 );
diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h
index 719cfd9ccf..7c5043bc01 100644
--- a/pcbnew/class_pad.h
+++ b/pcbnew/class_pad.h
@@ -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 );
diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp
index d5aee5a3cf..d2c7aa07cd 100644
--- a/pcbnew/class_pad_draw_functions.cpp
+++ b/pcbnew/class_pad_draw_functions.cpp
@@ -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
diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp
index b365cf2a12..189f1dcc8b 100644
--- a/pcbnew/class_pcb_text.cpp
+++ b/pcbnew/class_pcb_text.cpp
@@ -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();
diff --git a/pcbnew/class_pcb_text.h b/pcbnew/class_pcb_text.h
index 6b6191c1ef..0fd8d1d988 100644
--- a/pcbnew/class_pcb_text.h
+++ b/pcbnew/class_pcb_text.h
@@ -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 );
diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp
index 08eba81dd3..599cc25a6c 100644
--- a/pcbnew/class_text_mod.cpp
+++ b/pcbnew/class_text_mod.cpp
@@ -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();
diff --git a/pcbnew/class_text_mod.h b/pcbnew/class_text_mod.h
index 55fcbc9c18..590a0a965b 100644
--- a/pcbnew/class_text_mod.h
+++ b/pcbnew/class_text_mod.h
@@ -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 );
diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp
index 120a64e398..4b70775747 100644
--- a/pcbnew/class_track.cpp
+++ b/pcbnew/class_track.cpp
@@ -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;
diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h
index 14a22a651e..211573e5b6 100644
--- a/pcbnew/class_track.h
+++ b/pcbnew/class_track.h
@@ -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;
diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp
index 09c18e6574..bd6fbb1f8f 100644
--- a/pcbnew/class_zone.cpp
+++ b/pcbnew/class_zone.cpp
@@ -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 CornersTypeBuffer;
static std::vector 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;
diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h
index 4ee595f9a2..40597b1c96 100644
--- a/pcbnew/class_zone.h
+++ b/pcbnew/class_zone.h
@@ -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
diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp
index c58c4fdbc4..48d6a6cc18 100644
--- a/pcbnew/move_or_drag_track.cpp
+++ b/pcbnew/move_or_drag_track.cpp
@@ -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();
diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp
index 9fb303d487..116a1cddb8 100644
--- a/pcbnew/print_board_functions.cpp
+++ b/pcbnew/print_board_functions.cpp
@@ -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
diff --git a/pcbnew/protos.h b/pcbnew/protos.h
index 611f26cdba..7a76739260 100644
--- a/pcbnew/protos.h
+++ b/pcbnew/protos.h
@@ -4,7 +4,7 @@
#ifndef PROTO_H
#define PROTO_H
-
+#include
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 */
diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp
index 76f4bca84c..78b2016288 100644
--- a/pcbnew/tracepcb.cpp
+++ b/pcbnew/tracepcb.cpp
@@ -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();
diff --git a/pcbnew/trpiste.cpp b/pcbnew/trpiste.cpp
index f5501a48af..0cc96c1bb1 100644
--- a/pcbnew/trpiste.cpp
+++ b/pcbnew/trpiste.cpp
@@ -14,7 +14,8 @@
#include
-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() )