Commit 40c7d81b authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Fix build errors when compiling against wxWidgets 2.8.x.

* Changed wxPenStyle which is not define in wxWidgets 2.8 to int and
  renamed GRRect to prevent duplicate function definition in gr_basic.
* Add missing wxT() macros to strings in rs274x.cpp.
parent 32138324
Loading
Loading
Loading
Loading
+19 −28
Original line number Original line Diff line number Diff line
@@ -62,14 +62,12 @@ void ClipAndDrawFilledPoly( EDA_Rect* ClipBox, wxDC * DC, wxPoint Points[], int
 * ( GRSCircle is called by GRCircle for instance) after mapping coordinates
 * ( GRSCircle is called by GRCircle for instance) after mapping coordinates
 * from user units to screen units(pixels coordinates)
 * from user units to screen units(pixels coordinates)
 */
 */
static void GRSCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r,
static void GRSCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int width, int Color );
                        int width, int Color );
static void GRSFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r,
static void GRSFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r,
                             int width, int Color, int BgColor );
                             int width, int Color, int BgColor );
static void GRSMixedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
static void GRSMixedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
                          int width, int Color );
                          int width, int Color );
static void GRSDashedLineTo( EDA_Rect* ClipBox, wxDC* DC, int x2, int y2, int width,
static void GRSDashedLineTo( EDA_Rect* ClipBox, wxDC* DC, int x2, int y2, int width, int Color );
                      int Color );
static void GRSDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2,
static void GRSDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2,
                           int y2, int width, int Color );
                           int y2, int width, int Color );
static void GRSLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
static void GRSLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
@@ -109,7 +107,7 @@ static wxDC* s_DC_lastDC = NULL;
/* Local functions: */
/* Local functions: */
static void GRSRect( EDA_Rect* aClipBox, wxDC* aDC, int x1, int y1,
static void GRSRect( EDA_Rect* aClipBox, wxDC* aDC, int x1, int y1,
                     int x2, int y2, int aWidth, int aColor,
                     int x2, int y2, int aWidth, int aColor,
                     wxPenStyle aStyle =  wxPENSTYLE_SOLID );
                     int aStyle = wxSOLID );


/*
/*
 * Macro clipping the trace of a line:
 * Macro clipping the trace of a line:
@@ -1351,7 +1349,8 @@ void GRFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r,
void GRFilledCircle( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPos, int aRadius, int aColor )
void GRFilledCircle( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPos, int aRadius, int aColor )
{
{
    aRadius     = ZoomValue( aRadius );
    aRadius     = ZoomValue( aRadius );
    GRSFilledCircle( aClipBox, aDC, GRMapX( aPos.x ), GRMapY( aPos.y ), aRadius, 0, aColor, aColor );
    GRSFilledCircle( aClipBox, aDC, GRMapX( aPos.x ), GRMapY( aPos.y ), aRadius, 0,
                     aColor, aColor );
}
}


/*
/*
@@ -1661,9 +1660,7 @@ void GRArc( EDA_Rect* ClipBox,
/*
/*
 * Draw a rectangle in drawing space.
 * Draw a rectangle in drawing space.
 */
 */
void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
void GRRect( EDA_Rect* aClipBox, wxDC* aDC, int x1, int y1, int x2, int y2, int aColor )
             int x1, int y1, int x2, int y2,
             int aColor )
{
{
    x1 = GRMapX( x1 );
    x1 = GRMapX( x1 );
    y1 = GRMapY( y1 );
    y1 = GRMapY( y1 );
@@ -1673,9 +1670,7 @@ void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
    GRSRect( aClipBox, aDC, x1, y1, x2, y2, 0, aColor );
    GRSRect( aClipBox, aDC, x1, y1, x2, y2, 0, aColor );
}
}


void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
void GRRectPs( EDA_Rect* aClipBox, wxDC* aDC, const EDA_Rect& aRect, int aColor, int aStyle )
             const EDA_Rect& aRect,
             int aColor, wxPenStyle aStyle )
{
{
    int x1 = GRMapX( aRect.GetX() );
    int x1 = GRMapX( aRect.GetX() );
    int y1 = GRMapY( aRect.GetY() );
    int y1 = GRMapY( aRect.GetY() );
@@ -1689,9 +1684,7 @@ void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
/*
/*
 * Draw a rectangle (thick lines) in drawing space.
 * Draw a rectangle (thick lines) in drawing space.
 */
 */
void GRRect( EDA_Rect* ClipBox, wxDC* DC,
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width, int Color )
             int x1, int y1, int x2, int y2,
             int width, int Color )
{
{
    x1    = GRMapX( x1 );
    x1    = GRMapX( x1 );
    y1    = GRMapY( y1 );
    y1    = GRMapY( y1 );
@@ -1702,9 +1695,7 @@ void GRRect( EDA_Rect* ClipBox, wxDC* DC,
    GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color );
    GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color );
}
}


void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
void GRRect( EDA_Rect* aClipBox, wxDC* aDC, const EDA_Rect& aRect, int aWidth, int aColor )
             const EDA_Rect& aRect,
             int aWidth, int aColor )
{
{
    int x1 = GRMapX( aRect.GetX() );
    int x1 = GRMapX( aRect.GetX() );
    int y1 = GRMapY( aRect.GetY() );
    int y1 = GRMapY( aRect.GetY() );
@@ -1753,7 +1744,7 @@ void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
 */
 */


void GRSRect( EDA_Rect* aClipBox, wxDC* aDC, int x1, int y1, int x2, int y2,
void GRSRect( EDA_Rect* aClipBox, wxDC* aDC, int x1, int y1, int x2, int y2,
              int aWidth, int aColor, wxPenStyle aStyle )
              int aWidth, int aColor, int aStyle )
{
{
    if( x1 > x2 )
    if( x1 > x2 )
        EXCHG( x1, x2 );
        EXCHG( x1, x2 );
+5 −5
Original line number Original line Diff line number Diff line
@@ -531,7 +531,7 @@ bool GERBER::ExecuteRS274XCommand( int command,
            APERTURE_MACRO* pam = FindApertureMacro( am_lookup );
            APERTURE_MACRO* pam = FindApertureMacro( am_lookup );
            if( !pam )
            if( !pam )
            {
            {
                msg.Printf( "aperture macro %s not found\n",
                msg.Printf( wxT( "aperture macro %s not found\n" ),
                            CONV_TO_UTF8( am_lookup.name ) );
                            CONV_TO_UTF8( am_lookup.name ) );
                ReportMessage( msg );
                ReportMessage( msg );
                ok = false;
                ok = false;
@@ -676,7 +676,7 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],


        default:
        default:
            // @todo, there needs to be a way of reporting the line number
            // @todo, there needs to be a way of reporting the line number
            msg.Printf( "Invalid primitive id code %d\n", prim.primitive_id );
            msg.Printf( wxT( "Invalid primitive id code %d\n" ), prim.primitive_id );
            ReportMessage( msg );
            ReportMessage( msg );
            return false;
            return false;
        }
        }
@@ -702,7 +702,7 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],


        if( i < paramCount )
        if( i < paramCount )
        {   // maybe some day we can throw an exception and track a line number
        {   // maybe some day we can throw an exception and track a line number
            msg.Printf( "read macro descr type %d: read %d parameters, insufficient parameters\n",
            msg.Printf( wxT( "read macro descr type %d: read %d parameters, insufficient parameters\n" ),
                        prim.primitive_id, i );
                        prim.primitive_id, i );
            ReportMessage( msg );
            ReportMessage( msg );
        }
        }
+16 −26
Original line number Original line Diff line number Diff line
@@ -60,22 +60,17 @@ bool GetGRForceBlackPenState( void );


void GRSPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );
void GRSPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );


void GRLine( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aStart, wxPoint aEnd,
void GRLine( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aStart, wxPoint aEnd, int aWidth, int aColor );
             int aWidth, int aColor );
void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width, int Color );
void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2,
             int y2, int width, int Color );
void GRMixedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRMixedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
                  int width, int Color );
                  int width, int Color );
void GRDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int  y2,
void GRDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int  y2,
                   int width, int Color );
                   int width, int Color );
void GRDashedLineTo( EDA_Rect* ClipBox, wxDC* DC, int x2, int y2, int width,
void GRDashedLineTo( EDA_Rect* ClipBox, wxDC* DC, int x2, int y2, int width, int Color );
                     int Color );
void GRMoveTo( int x, int y );
void GRMoveTo( int x, int y );
void GRLineTo( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width,
void GRLineTo( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width, int Color );
               int Color );
void GRMoveRel( int x, int y );
void GRMoveRel( int x, int y );
void GRLineRel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width,
void GRLineRel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width, int Color );
                int Color );


void GRPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool Fill,
void GRPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool Fill,
             int width, int Color, int BgColor );
             int width, int Color, int BgColor );
@@ -150,12 +145,10 @@ void GRClosedPoly( EDA_Rect* ClipBox,
 * @param aColor is an index into our color table of RGB colors.
 * @param aColor is an index into our color table of RGB colors.
 * @see EDA_Colors and colors.h
 * @see EDA_Colors and colors.h
 */
 */
void GRCircle( EDA_Rect* ClipBox, wxDC* aDC, int x, int y, int aRadius,
void GRCircle( EDA_Rect* ClipBox, wxDC* aDC, int x, int y, int aRadius, int aColor );
               int aColor );
void GRCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int  width, int Color );

void GRFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int width,
void GRCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int  width,
                     int Color, int BgColor );
               int Color );
void GRFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int width, int Color, int BgColor );
void GRFilledCircle( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPos, int aRadius, int aColor );
void GRFilledCircle( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPos, int aRadius, int aColor );
void GRCircle( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPos, int aRadius, int aWidth, int aColor );
void GRCircle( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPos, int aRadius, int aWidth, int aColor );


@@ -171,8 +164,7 @@ void GRFilledArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y,
                  int StAngle, int EndAngle, int r, int Color, int BgColor );
                  int StAngle, int EndAngle, int r, int Color, int BgColor );
void GRFilledArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
void GRFilledArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
                  int EndAngle, int r, int width, int Color, int BgColor );
                  int EndAngle, int r, int width, int Color, int BgColor );
void GRCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width, int Color );
              int width, int Color );
void GRCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
              int width, int aPenSize, int Color );
              int width, int aPenSize, int Color );
void GRFillCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRFillCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
@@ -188,14 +180,12 @@ void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
                   int x2, int y2, int Color, int BgColor );
                   int x2, int y2, int Color, int BgColor );
void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
                   int x2, int y2, int width, int Color, int BgColor );
                   int x2, int y2, int width, int Color, int BgColor );
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int Color );
             int x2, int y2, int Color );
void GRRect( EDA_Rect* ClipBox, wxDC* DC,const EDA_Rect& aRect, int Color );
void GRRect( EDA_Rect* ClipBox, wxDC* DC,const EDA_Rect& aRect,
             int Color );
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
             int x2, int y2, int width, int Color );
             int x2, int y2, int width, int Color );
void GRRect( EDA_Rect* aClipBox, wxDC* aDC,const EDA_Rect& aRect,
void GRRectPs( EDA_Rect* aClipBox, wxDC* aDC,const EDA_Rect& aRect,
             int aWidth, int aColor, wxPenStyle aStyle =  wxPENSTYLE_SOLID );
               int aWidth, int aColor, int aStyle = wxSOLID );


void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
                    int x2, int y2, int width, int Color, int BgColor );
                    int x2, int y2, int width, int Color, int BgColor );