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