2009-10-23 07:41:29 +00:00
|
|
|
/**************************/
|
|
|
|
/* printout_controler.h */
|
|
|
|
/**************************/
|
|
|
|
|
|
|
|
#ifndef PRINTOUT_CONTROLER_H
|
|
|
|
#define PRINTOUT_CONTROLER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <wx/dcps.h>
|
|
|
|
|
|
|
|
#define DEFAULT_ORIENTATION_PAPER wxLANDSCAPE // other option is wxPORTRAIT
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class handle parameters used to draw (print) a board
|
|
|
|
* layers, scale and others options
|
|
|
|
*/
|
|
|
|
|
|
|
|
class PRINT_PARAMETERS
|
|
|
|
{
|
|
|
|
public:
|
2010-02-22 19:56:32 +00:00
|
|
|
int m_PenDefaultSize; // The defAUlt value pen size to plot/print items
|
|
|
|
// that have no defined pen size
|
2009-10-23 07:41:29 +00:00
|
|
|
double m_PrintScale; // general scale when printing
|
|
|
|
double m_XScaleAdjust, m_YScaleAdjust; // fine scale adjust for X and Y axis
|
|
|
|
bool m_Print_Sheet_Ref; // Option: pring page references
|
|
|
|
long m_PrintMaskLayer; // Layers to print
|
|
|
|
bool m_PrintMirror; // Option: Print mirroed
|
|
|
|
bool m_Print_Black_and_White; // Option: Print in B&W ou Color
|
2010-03-29 16:42:03 +00:00
|
|
|
int m_OptionPrintPage; // Option: 0 = a layer per page, 1 = all layers at once
|
|
|
|
int m_PageCount; // Number of page to print
|
2009-10-23 07:41:29 +00:00
|
|
|
bool m_ForceCentered; // Forge plot origin to page centre (used in modedit)
|
|
|
|
int m_Flags; // auxiliary variable: can be used to pass some other info
|
2010-04-21 18:57:34 +00:00
|
|
|
wxPageSetupDialogData* m_PageSetupData; // A wxPageSetupDialogData to know page options (margins)
|
2009-10-23 07:41:29 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
enum DrillShapeOptT {
|
|
|
|
NO_DRILL_SHAPE = 0,
|
|
|
|
SMALL_DRILL_SHAPE = 1,
|
|
|
|
FULL_DRILL_SHAPE = 2
|
|
|
|
};
|
|
|
|
DrillShapeOptT m_DrillShapeOpt; // Options to print pads and vias holes
|
|
|
|
|
2009-10-23 07:41:29 +00:00
|
|
|
public:
|
|
|
|
PRINT_PARAMETERS();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class derived from wxPrintout handle the necessary info
|
|
|
|
* to control a printer when printing a board
|
|
|
|
*/
|
|
|
|
|
|
|
|
class BOARD_PRINTOUT_CONTROLER : public wxPrintout
|
|
|
|
{
|
|
|
|
private:
|
2011-12-22 21:57:50 +00:00
|
|
|
EDA_DRAW_FRAME* m_Parent;
|
|
|
|
PRINT_PARAMETERS m_PrintParams;
|
2009-10-23 07:41:29 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
BOARD_PRINTOUT_CONTROLER( const PRINT_PARAMETERS& print_params,
|
2011-01-21 19:30:59 +00:00
|
|
|
EDA_DRAW_FRAME* parent,
|
2009-10-23 07:41:29 +00:00
|
|
|
const wxString& title );
|
|
|
|
|
|
|
|
bool OnPrintPage( int page );
|
|
|
|
|
2010-01-24 16:27:36 +00:00
|
|
|
bool HasPage( int page ) // do not test page num
|
|
|
|
{
|
|
|
|
if (page <= m_PrintParams.m_PageCount)
|
|
|
|
return true;
|
2011-01-21 19:30:59 +00:00
|
|
|
else
|
|
|
|
return false;
|
2010-01-24 16:27:36 +00:00
|
|
|
}
|
|
|
|
|
2009-10-23 07:41:29 +00:00
|
|
|
void GetPageInfo( int* minPage, int* maxPage, int* selPageFrom, int* selPageTo );
|
|
|
|
|
|
|
|
void DrawPage();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ifndef PRINTOUT_CONTROLER_H
|