Commit 61acac28 authored by jean-pierre charras's avatar jean-pierre charras

Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue...

Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue under Windows (zlib sources added)
parent ebcb6d3b
...@@ -257,6 +257,7 @@ set(INC_AFTER ...@@ -257,6 +257,7 @@ set(INC_AFTER
add_subdirectory(bitmaps_png) add_subdirectory(bitmaps_png)
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(zlib)
add_subdirectory(3d-viewer) add_subdirectory(3d-viewer)
add_subdirectory(cvpcb) add_subdirectory(cvpcb)
add_subdirectory(eeschema) add_subdirectory(eeschema)
......
...@@ -7,6 +7,7 @@ include_directories( ...@@ -7,6 +7,7 @@ include_directories(
../3d-viewer ../3d-viewer
../pcbnew ../pcbnew
../polygon ../polygon
../zlib
${INC_AFTER} ${INC_AFTER}
) )
...@@ -42,6 +43,7 @@ set(COMMON_SRCS ...@@ -42,6 +43,7 @@ set(COMMON_SRCS
common_plot_functions.cpp common_plot_functions.cpp
common_plotHPGL_functions.cpp common_plotHPGL_functions.cpp
common_plotPS_functions.cpp common_plotPS_functions.cpp
common_plotPDF_functions.cpp
common_plotGERBER_functions.cpp common_plotGERBER_functions.cpp
common_plotDXF_functions.cpp common_plotDXF_functions.cpp
confirm.cpp confirm.cpp
......
...@@ -252,8 +252,8 @@ void BITMAP_BASE::Rotate( bool aRotateCCW ) ...@@ -252,8 +252,8 @@ void BITMAP_BASE::Rotate( bool aRotateCCW )
void BITMAP_BASE::PlotImage( PLOTTER* aPlotter, void BITMAP_BASE::PlotImage( PLOTTER* aPlotter,
wxPoint aPos, const wxPoint& aPos,
int aDefaultColor, EDA_COLOR_T aDefaultColor,
int aDefaultPensize ) int aDefaultPensize )
{ {
if( m_image == NULL ) if( m_image == NULL )
...@@ -261,8 +261,8 @@ void BITMAP_BASE::PlotImage( PLOTTER* aPlotter, ...@@ -261,8 +261,8 @@ void BITMAP_BASE::PlotImage( PLOTTER* aPlotter,
// These 2 lines are useful only fot plotters that cannot plot a bitmap // These 2 lines are useful only fot plotters that cannot plot a bitmap
// and plot arectangle instead of. // and plot arectangle instead of.
aPlotter->set_color( aDefaultColor ); aPlotter->SetColor( aDefaultColor );
aPlotter->set_current_line_width( aDefaultPensize ); aPlotter->SetCurrentLineWidth( aDefaultPensize );
aPlotter->PlotImage( *m_image, aPos, GetScalingFactor() ); aPlotter->PlotImage( *m_image, aPos, GetScalingFactor() );
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -164,13 +164,13 @@ static void DrawGraphicTextPline( ...@@ -164,13 +164,13 @@ static void DrawGraphicTextPline(
{ {
if( aPlotter ) if( aPlotter )
{ {
aPlotter->move_to( coord[0] ); aPlotter->MoveTo( coord[0] );
for( int ik = 1; ik < point_count; ik++ ) for( int ik = 1; ik < point_count; ik++ )
{ {
aPlotter->line_to( coord[ik] ); aPlotter->LineTo( coord[ik] );
} }
aPlotter->pen_finish(); aPlotter->PenFinish();
} }
else if( aCallback ) else if( aCallback )
{ {
...@@ -357,8 +357,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -357,8 +357,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
if( aPlotter ) if( aPlotter )
{ {
aPlotter->move_to( current_char_pos ); aPlotter->MoveTo( current_char_pos );
aPlotter->finish_to( end ); aPlotter->FinishTo( end );
} }
else if( aCallback ) else if( aCallback )
{ {
...@@ -515,7 +515,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -515,7 +515,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0) * @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
*/ */
void PLOTTER::text( const wxPoint& aPos, void PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor, enum EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, int aOrient,
...@@ -534,11 +534,11 @@ void PLOTTER::text( const wxPoint& aPos, ...@@ -534,11 +534,11 @@ void PLOTTER::text( const wxPoint& aPos,
else else
aWidth = -Clamp_Text_PenSize( -aWidth, aSize, aBold ); aWidth = -Clamp_Text_PenSize( -aWidth, aSize, aBold );
set_current_line_width( aWidth ); SetCurrentLineWidth( aWidth );
if( aColor >= 0 ) if( aColor >= 0 )
set_color( aColor ); SetColor( aColor );
DrawGraphicText( NULL, NULL, aPos, aColor, aText, DrawGraphicText( NULL, NULL, aPos, aColor, aText,
aOrient, aSize, aOrient, aSize,
......
...@@ -36,6 +36,8 @@ set(EESCHEMA_SRCS ...@@ -36,6 +36,8 @@ set(EESCHEMA_SRCS
dialogs/dialog_plot_schematic_HPGL_base.cpp dialogs/dialog_plot_schematic_HPGL_base.cpp
dialogs/dialog_plot_schematic_PS.cpp dialogs/dialog_plot_schematic_PS.cpp
dialogs/dialog_plot_schematic_PS_base.cpp dialogs/dialog_plot_schematic_PS_base.cpp
dialogs/dialog_plot_schematic_PDF.cpp
dialogs/dialog_plot_schematic_PDF_base.cpp
dialogs/annotate_dialog.cpp dialogs/annotate_dialog.cpp
dialogs/dialog_annotate_base.cpp dialogs/dialog_annotate_base.cpp
dialogs/dialog_lib_edit_text.cpp dialogs/dialog_lib_edit_text.cpp
...@@ -218,6 +220,7 @@ target_link_libraries(eeschema ...@@ -218,6 +220,7 @@ target_link_libraries(eeschema
kbool kbool
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
${GDI_PLUS_LIBRARIES} ${GDI_PLUS_LIBRARIES}
zlib
) )
install(TARGETS eeschema install(TARGETS eeschema
......
...@@ -391,8 +391,8 @@ void LIB_COMPONENT::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, ...@@ -391,8 +391,8 @@ void LIB_COMPONENT::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) ) if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
continue; continue;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) ); aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
bool fill = aPlotter->get_color_mode(); bool fill = aPlotter->GetColorMode();
item.Plot( aPlotter, aOffset, fill, aTransform ); item.Plot( aPlotter, aOffset, fill, aTransform );
} }
......
...@@ -185,14 +185,12 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( ) ...@@ -185,14 +185,12 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
sheetpath = SheetList.GetNext(); sheetpath = SheetList.GetNext();
} }
double scale = 10;
plot_offset.x = 0; plot_offset.x = 0;
plot_offset.y = 0; plot_offset.y = 0;
plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".dxf" ); plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".dxf" );
PlotOneSheetDXF( plotFileName, screen, plot_offset, scale ); PlotOneSheetDXF( plotFileName, screen, plot_offset, 1 );
if( !m_select_PlotAll ) if( !m_select_PlotAll )
break; break;
...@@ -232,24 +230,24 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName, ...@@ -232,24 +230,24 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
const PAGE_INFO& pageInfo = screen->GetPageSettings(); const PAGE_INFO& pageInfo = screen->GetPageSettings();
plotter->SetPageSettings( pageInfo ); plotter->SetPageSettings( pageInfo );
plotter->set_viewport( plot_offset, scale, 0 ); plotter->SetViewport( plot_offset, IU_PER_DECIMILS, scale, 0 );
plotter->set_color_mode( m_plotColorOpt ); plotter->SetColorMode( m_plotColorOpt );
// Init : // Init :
plotter->set_creator( wxT( "Eeschema-DXF" ) ); plotter->SetCreator( wxT( "Eeschema-DXF" ) );
plotter->set_filename( FileName ); plotter->SetFilename( FileName );
plotter->start_plot( output_file ); plotter->StartPlot( output_file );
if( m_plot_Sheet_Ref ) if( m_plot_Sheet_Ref )
{ {
plotter->set_color( BLACK ); plotter->SetColor( BLACK );
m_Parent->PlotWorkSheet( plotter, screen ); m_Parent->PlotWorkSheet( plotter, screen );
} }
screen->Plot( plotter ); screen->Plot( plotter );
// finish // finish
plotter->end_plot(); plotter->EndPlot();
delete plotter; delete plotter;
m_MsgBox->AppendText( wxT( "Ok\n" ) ); m_MsgBox->AppendText( wxT( "Ok\n" ) );
......
...@@ -330,7 +330,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll ) ...@@ -330,7 +330,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll )
// Calculation of conversion scales. // Calculation of conversion scales.
// 10x because Eeschema works in mils, not deci-mils // 10x because Eeschema works in mils, not deci-mils
double plot_scale = 10 * (double) plotPage.GetWidthMils() / curPage.GetWidthMils(); double plot_scale = (double) plotPage.GetWidthMils() / curPage.GetWidthMils();
// Calculate offsets // Calculate offsets
plotOffset.x = -s_Offset.x; plotOffset.x = -s_Offset.x;
...@@ -380,26 +380,26 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName, ...@@ -380,26 +380,26 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName,
plotter->SetPageSettings( pageInfo ); plotter->SetPageSettings( pageInfo );
plotter->set_viewport( offset, plot_scale, 0 ); plotter->SetViewport( offset, IU_PER_DECIMILS, plot_scale, 0 );
plotter->set_default_line_width( g_DrawDefaultLineThickness ); plotter->SetDefaultLineWidth( g_DrawDefaultLineThickness );
// Init : // Init :
plotter->set_creator( wxT( "Eeschema-HPGL" ) ); plotter->SetCreator( wxT( "Eeschema-HPGL" ) );
plotter->set_filename( FileName ); plotter->SetFilename( FileName );
plotter->set_pen_speed( g_HPGL_Pen_Descr.m_Pen_Speed ); plotter->SetPenSpeed( g_HPGL_Pen_Descr.m_Pen_Speed );
plotter->set_pen_number( g_HPGL_Pen_Descr.m_Pen_Num ); plotter->SetPenNumber( g_HPGL_Pen_Descr.m_Pen_Num );
plotter->set_pen_diameter( g_HPGL_Pen_Descr.m_Pen_Diam ); plotter->SetPenDiameter( g_HPGL_Pen_Descr.m_Pen_Diam );
plotter->set_pen_overlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 ); plotter->SetPenOverlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 );
plotter->start_plot( output_file ); plotter->StartPlot( output_file );
plotter->set_color( BLACK ); plotter->SetColor( BLACK );
if( s_plot_Sheet_Ref ) if( s_plot_Sheet_Ref )
m_Parent->PlotWorkSheet( plotter, screen ); m_Parent->PlotWorkSheet( plotter, screen );
screen->Plot( plotter ); screen->Plot( plotter );
plotter->end_plot(); plotter->EndPlot();
delete plotter; delete plotter;
m_MsgBox->AppendText( wxT( "Ok\n" ) ); m_MsgBox->AppendText( wxT( "Ok\n" ) );
......
...@@ -237,7 +237,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile() ...@@ -237,7 +237,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils(); double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils(); double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
double scale = 10 * MIN( scalex, scaley ); double scale = MIN( scalex, scaley );
plot_offset.x = 0; plot_offset.x = 0;
plot_offset.y = 0; plot_offset.y = 0;
...@@ -281,24 +281,25 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName, ...@@ -281,24 +281,25 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
PS_PLOTTER* plotter = new PS_PLOTTER(); PS_PLOTTER* plotter = new PS_PLOTTER();
plotter->SetPageSettings( pageInfo ); plotter->SetPageSettings( pageInfo );
plotter->set_viewport( plot_offset, scale, 0 ); plotter->SetViewport( plot_offset, IU_PER_DECIMILS, scale, 0 );
plotter->set_default_line_width( g_DrawDefaultLineThickness ); plotter->SetDefaultLineWidth( g_DrawDefaultLineThickness );
plotter->set_color_mode( m_plotColorOpt ); plotter->SetColorMode( m_plotColorOpt );
plotter->SetPsTextMode( PSTEXTMODE_STROKE );
// Init : // Init :
plotter->set_creator( wxT( "Eeschema-PS" ) ); plotter->SetCreator( wxT( "Eeschema-PS" ) );
plotter->set_filename( FileName ); plotter->SetFilename( FileName );
plotter->start_plot( output_file ); plotter->StartPlot( output_file );
if( m_plot_Sheet_Ref ) if( m_plot_Sheet_Ref )
{ {
plotter->set_color( BLACK ); plotter->SetColor( BLACK );
m_Parent->PlotWorkSheet( plotter, screen ); m_Parent->PlotWorkSheet( plotter, screen );
} }
screen->Plot( plotter ); screen->Plot( plotter );
plotter->end_plot(); plotter->EndPlot();
delete plotter; delete plotter;
SetLocaleTo_Default(); SetLocaleTo_Default();
......
...@@ -325,13 +325,13 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, ...@@ -325,13 +325,13 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
{ {
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
aPlotter->arc( pos, -t2, -t1, m_Radius, FILLED_SHAPE, 0 ); aPlotter->Arc( pos, -t2, -t1, m_Radius, FILLED_SHAPE, 0 );
} }
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) ); aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
aPlotter->arc( pos, -t2, -t1, m_Radius, already_filled ? NO_FILL : m_Fill, GetPenSize() ); aPlotter->Arc( pos, -t2, -t1, m_Radius, already_filled ? NO_FILL : m_Fill, GetPenSize() );
} }
......
...@@ -270,12 +270,12 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, ...@@ -270,12 +270,12 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
{ {
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 ); aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 );
} }
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) ); aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() ); aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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