Commit ed4b9015 authored by raburton's avatar raburton

set eol-style native on new files

parent 62a28440
/* XPM */ /* XPM */
#ifndef XPMMAIN #ifndef XPMMAIN
extern const char *add_zone_xpm[]; extern const char *add_zone_xpm[];
#else #else
const char * add_zone_xpm[] = { const char * add_zone_xpm[] = {
"16 16 3 1", "16 16 3 1",
" c None", " c None",
". c #007D00", ". c #007D00",
"+ c #007E00", "+ c #007E00",
"................", "................",
".... ........", ".... ........",
"... .......", "... .......",
".. ++ .....", ".. ++ .....",
". .... ...", ". .... ...",
". +. ..... ..", ". +. ..... ..",
". +. ...... ..", ". +. ...... ..",
". .... .. .", ". .... .. .",
".. ++ .. ", ".. ++ .. ",
"... .. ... ", "... .. ... ",
".... .... ...", ".... .... ...",
"............ ..", "............ ..",
"............. .", "............. .",
".............. .", ".............. .",
"............... ", "............... ",
"............... "}; "............... "};
#endif #endif
/* XPM */ /* XPM */
#ifndef XPMMAIN #ifndef XPMMAIN
extern const char *add_zone_cutout[]; extern const char *add_zone_cutout[];
#else #else
const char * add_zone_cutout[] = { const char * add_zone_cutout[] = {
"16 16 3 1", "16 16 3 1",
" c None", " c None",
". c #007D00", ". c #007D00",
"+ c #900000", "+ c #900000",
" ..............", " ..............",
".... ........", ".... ........",
"... ++++ .......", "... ++++ .......",
".. + + .....", ".. + + .....",
". + + ...", ". + + ...",
". + + ..", ". + + ..",
". + + ..", ". + + ..",
". + + .", ". + + .",
".. + + ..", ".. + + ..",
"... +++++++ ... ", "... +++++++ ... ",
".... .... ", ".... .... ",
"............ ", "............ ",
"............. ", "............. ",
".............. ", ".............. ",
" ............. ", " ............. ",
" ............ "}; " ............ "};
#endif #endif
/***********************************************************/ /***********************************************************/
/* wxstruct.h: */ /* wxstruct.h: */
/* descriptions des principales classes derivees utilisees */ /* descriptions des principales classes derivees utilisees */
/***********************************************************/ /***********************************************************/
#ifndef WXPCB_STRUCT_H #ifndef WXPCB_STRUCT_H
#define WXPCB_STRUCT_H #define WXPCB_STRUCT_H
#include <vector> #include <vector>
#ifndef PCB_INTERNAL_UNIT #ifndef PCB_INTERNAL_UNIT
#define PCB_INTERNAL_UNIT 10000 #define PCB_INTERNAL_UNIT 10000
#endif #endif
// Option for dialog boxes // Option for dialog boxes
// #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP // #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxWANTS_CHARS #define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxWANTS_CHARS
#define EDA_DRAW_PANEL wxScrolledWindow #define EDA_DRAW_PANEL wxScrolledWindow
class wxMyDialogModalData; class wxMyDialogModalData;
/* Forward declarations of classes. */ /* Forward declarations of classes. */
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
class WinEDA_DrawFrame; class WinEDA_DrawFrame;
#include "base_struct.h" #include "base_struct.h"
class WinEDA_App; class WinEDA_App;
class WinEDA_MsgPanel; class WinEDA_MsgPanel;
class COMMAND; class COMMAND;
class WinEDA_MainFrame; class WinEDA_MainFrame;
class BASE_SCREEN; class BASE_SCREEN;
class SCH_SCREEN; class SCH_SCREEN;
class PCB_SCREEN; class PCB_SCREEN;
class WinEDA_SchematicFrame; // Schematic main frame class WinEDA_SchematicFrame; // Schematic main frame
class WinEDA_LibeditFrame; // Component creation and edition main frame class WinEDA_LibeditFrame; // Component creation and edition main frame
class WinEDA_ViewlibFrame; // Component viewer main frame class WinEDA_ViewlibFrame; // Component viewer main frame
class WinEDA_GerberFrame; // GERBER viewer main frame class WinEDA_GerberFrame; // GERBER viewer main frame
class WinEDA_Toolbar; class WinEDA_Toolbar;
class WinEDA_CvpcbFrame; class WinEDA_CvpcbFrame;
class WinEDA_PcbFrame; class WinEDA_PcbFrame;
class WinEDA_ModuleEditFrame; class WinEDA_ModuleEditFrame;
class WinEDAChoiceBox; class WinEDAChoiceBox;
#define WinEDA_MenuBar wxMenuBar #define WinEDA_MenuBar wxMenuBar
#define WinEDA_Menu wxMenu #define WinEDA_Menu wxMenu
#define WinEDA_MenuItem wxMenuItem #define WinEDA_MenuItem wxMenuItem
// Used but not defined here: // Used but not defined here:
class BOARD; class BOARD;
class TEXTE_PCB; class TEXTE_PCB;
class MODULE; class MODULE;
class TRACK; class TRACK;
class SEGZONE; class SEGZONE;
class SEGVIA; class SEGVIA;
class EDGE_ZONE; class EDGE_ZONE;
class D_PAD; class D_PAD;
class TEXTE_MODULE; class TEXTE_MODULE;
class MIREPCB; class MIREPCB;
class COTATION; class COTATION;
class EDGE_MODULE; class EDGE_MODULE;
class WinEDA3D_DrawFrame; class WinEDA3D_DrawFrame;
class DRC; class DRC;
class ZONE_CONTAINER; class ZONE_CONTAINER;
/******************************************************************/ /******************************************************************/
/* class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview */ /* class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview */
/******************************************************************/ /******************************************************************/
class WinEDA_BasePcbFrame : public WinEDA_DrawFrame class WinEDA_BasePcbFrame : public WinEDA_DrawFrame
{ {
public: public:
BOARD* m_Pcb; BOARD* m_Pcb;
bool m_DisplayPadFill; // How show pads bool m_DisplayPadFill; // How show pads
bool m_DisplayPadNum; // show pads numbers bool m_DisplayPadNum; // show pads numbers
int m_DisplayModEdge; // How show module drawings int m_DisplayModEdge; // How show module drawings
int m_DisplayModText; // How show module texts int m_DisplayModText; // How show module texts
bool m_DisplayPcbTrackFill; /* FALSE : tracks are show in sketch mode, TRUE = filled */ bool m_DisplayPcbTrackFill; /* FALSE : tracks are show in sketch mode, TRUE = filled */
WinEDA3D_DrawFrame* m_Draw3DFrame; WinEDA3D_DrawFrame* m_Draw3DFrame;
protected: protected:
GENERAL_COLLECTOR* m_Collector; GENERAL_COLLECTOR* m_Collector;
public: public:
WinEDA_BasePcbFrame( wxWindow* father, WinEDA_App* parent, int idtype, WinEDA_BasePcbFrame( wxWindow* father, WinEDA_App* parent, int idtype,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_BasePcbFrame(); ~WinEDA_BasePcbFrame();
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
PCB_SCREEN* GetScreen() { return (PCB_SCREEN*) m_CurrentScreen; } PCB_SCREEN* GetScreen() { return (PCB_SCREEN*) m_CurrentScreen; }
int BestZoom(); int BestZoom();
void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event );
virtual void GeneralControle( wxDC* DC, wxPoint Mouse ); virtual void GeneralControle( wxDC* DC, wxPoint Mouse );
// Undo and redo functions // Undo and redo functions
public: public:
virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
int flag_type_command = 0 ); int flag_type_command = 0 );
private: private:
virtual void GetComponentFromUndoList(); virtual void GetComponentFromUndoList();
virtual void GetComponentFromRedoList(); virtual void GetComponentFromRedoList();
public: public:
// Read/write fonctions: // Read/write fonctions:
EDA_BaseStruct* ReadDrawSegmentDescr( FILE* File, int* LineNum ); EDA_BaseStruct* ReadDrawSegmentDescr( FILE* File, int* LineNum );
int ReadListeSegmentDescr( FILE* File, int ReadListeSegmentDescr( FILE* File,
TRACK* PtSegm, int StructType, TRACK* PtSegm, int StructType,
int* LineNum, int NumSegm ); int* LineNum, int NumSegm );
int ReadSetup( FILE* File, int* LineNum ); int ReadSetup( FILE* File, int* LineNum );
int ReadGeneralDescrPcb( FILE* File, int* LineNum ); int ReadGeneralDescrPcb( FILE* File, int* LineNum );
// PCB handling // PCB handling
bool Clear_Pcb( bool query ); bool Clear_Pcb( bool query );
/** /**
* Function PcbGeneralLocateAndDisplay * Function PcbGeneralLocateAndDisplay
* searches for an item under the mouse cursor. * searches for an item under the mouse cursor.
* Items are searched first on the current working layer. * Items are searched first on the current working layer.
* If nothing found, an item will be searched without layer restriction. If * If nothing found, an item will be searched without layer restriction. If
* more than one item is found meeting the current working layer criterion, then * more than one item is found meeting the current working layer criterion, then
* a popup menu is shown which allows the user to pick which item he/she is * a popup menu is shown which allows the user to pick which item he/she is
* interested in. Once an item is chosen, then it is make the "current item" * interested in. Once an item is chosen, then it is make the "current item"
* and the status window is updated to reflect this. * and the status window is updated to reflect this.
* *
* @param aHotKeyCode The hotkey which relates to the caller and determines the * @param aHotKeyCode The hotkey which relates to the caller and determines the
* type of search to be performed. If zero, then the mouse tools will be * type of search to be performed. If zero, then the mouse tools will be
* tested instead. * tested instead.
*/ */
BOARD_ITEM* PcbGeneralLocateAndDisplay( int aHotKeyCode = 0 ); BOARD_ITEM* PcbGeneralLocateAndDisplay( int aHotKeyCode = 0 );
BOARD_ITEM* Locate( int typeloc, int LayerSearch ); BOARD_ITEM* Locate( int typeloc, int LayerSearch );
void ProcessItemSelection( wxCommandEvent& event ); void ProcessItemSelection( wxCommandEvent& event );
/** /**
* Function SetCurItem * Function SetCurItem
* sets the currently selected item and displays it in the MsgPanel. * sets the currently selected item and displays it in the MsgPanel.
* If the given item is NULL then the MsgPanel is erased and there is no * If the given item is NULL then the MsgPanel is erased and there is no
* currently selected item. This function is intended to make the process * currently selected item. This function is intended to make the process
* of "selecting" an item more formal, and to indivisibly tie the operation * of "selecting" an item more formal, and to indivisibly tie the operation
* of selecting an item to displaying it using BOARD_ITEM::Display_Infos(). * of selecting an item to displaying it using BOARD_ITEM::Display_Infos().
* @param aItem The BOARD_ITEM to make the selected item or NULL if none. * @param aItem The BOARD_ITEM to make the selected item or NULL if none.
*/ */
void SetCurItem( BOARD_ITEM* aItem ); void SetCurItem( BOARD_ITEM* aItem );
BOARD_ITEM* GetCurItem(); BOARD_ITEM* GetCurItem();
/** /**
* Function GetCollectorsGuide * Function GetCollectorsGuide
* @return GENERAL_COLLECTORS_GUIDE - that considers the global configuration options. * @return GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.
*/ */
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE GetCollectorsGuide();
/** /**
* Function CursorGoto * Function CursorGoto
* positions the cursor at a given coordinate and reframes the drawing if the * positions the cursor at a given coordinate and reframes the drawing if the
* requested point is out of view. * requested point is out of view.
* @param aPos The point to go to. * @param aPos The point to go to.
*/ */
void CursorGoto( const wxPoint& aPos ); void CursorGoto( const wxPoint& aPos );
/* Place un repere sur l'ecran au point de coordonnees PCB pos */ /* Place un repere sur l'ecran au point de coordonnees PCB pos */
void place_marqueur( wxDC* DC, const wxPoint& pos, char* pt_bitmap, void place_marqueur( wxDC* DC, const wxPoint& pos, char* pt_bitmap,
int DrawMode, int color, int type ); int DrawMode, int color, int type );
// Gestion des modules // Gestion des modules
void InstallModuleOptionsFrame( MODULE* Module, void InstallModuleOptionsFrame( MODULE* Module,
wxDC* DC, const wxPoint& pos ); wxDC* DC, const wxPoint& pos );
MODULE* Copie_Module( MODULE* module ); MODULE* Copie_Module( MODULE* module );
MODULE* Exchange_Module( wxWindow* winaff, MODULE* old_module, MODULE* new_module ); MODULE* Exchange_Module( wxWindow* winaff, MODULE* old_module, MODULE* new_module );
int Save_1_Module( const wxString& LibName, MODULE* Module, int Save_1_Module( const wxString& LibName, MODULE* Module,
bool Overwrite, bool DisplayDialog ); bool Overwrite, bool DisplayDialog );
void Archive_Modules( const wxString& LibName, bool NewModulesOnly ); void Archive_Modules( const wxString& LibName, bool NewModulesOnly );
MODULE* Select_1_Module_From_BOARD( BOARD* Pcb ); MODULE* Select_1_Module_From_BOARD( BOARD* Pcb );
MODULE* GetModuleByName(); MODULE* GetModuleByName();
// Modules (footprints) // Modules (footprints)
MODULE* Create_1_Module( wxDC* DC, const wxString& module_name ); MODULE* Create_1_Module( wxDC* DC, const wxString& module_name );
void Edit_Module( MODULE* module, wxDC* DC ); void Edit_Module( MODULE* module, wxDC* DC );
void Rotate_Module( wxDC* DC, MODULE* module, int angle, bool incremental ); void Rotate_Module( wxDC* DC, MODULE* module, int angle, bool incremental );
void Change_Side_Module( MODULE* Module, wxDC* DC ); void Change_Side_Module( MODULE* Module, wxDC* DC );
void Place_Module( MODULE* module, wxDC* DC ); void Place_Module( MODULE* module, wxDC* DC );
void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule, void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule,
wxDC* DC, const wxPoint& pos ); wxDC* DC, const wxPoint& pos );
// module texts // module texts
void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ); void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC );
void DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC ); void DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC );
void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ); void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC );
void StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ); void StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC );
TEXTE_MODULE* CreateTextModule( MODULE* Module, wxDC* DC ); TEXTE_MODULE* CreateTextModule( MODULE* Module, wxDC* DC );
void InstallPadOptionsFrame( D_PAD* pad, wxDC* DC, const wxPoint& pos ); void InstallPadOptionsFrame( D_PAD* pad, wxDC* DC, const wxPoint& pos );
void InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, void InstallTextModOptionsFrame( TEXTE_MODULE* TextMod,
wxDC* DC, const wxPoint& pos ); wxDC* DC, const wxPoint& pos );
// Pads sur modules // Pads sur modules
void AddPad( MODULE* Module, wxDC* DC ); void AddPad( MODULE* Module, wxDC* DC );
void DeletePad( D_PAD* Pad, wxDC* DC ); void DeletePad( D_PAD* Pad, wxDC* DC );
void StartMovePad( D_PAD* Pad, wxDC* DC ); void StartMovePad( D_PAD* Pad, wxDC* DC );
void RotatePad( D_PAD* Pad, wxDC* DC ); void RotatePad( D_PAD* Pad, wxDC* DC );
void PlacePad( D_PAD* Pad, wxDC* DC ); void PlacePad( D_PAD* Pad, wxDC* DC );
void Export_Pad_Settings( D_PAD* pt_pad ); void Export_Pad_Settings( D_PAD* pt_pad );
void Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC ); void Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC );
void Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC ); void Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC );
// loading footprints // loading footprints
MODULE* Get_Librairie_Module( wxWindow* winaff, const wxString& library, MODULE* Get_Librairie_Module( wxWindow* winaff, const wxString& library,
const wxString& ModuleName, bool show_msg_err ); const wxString& ModuleName, bool show_msg_err );
wxString Select_1_Module_From_List( wxString Select_1_Module_From_List(
WinEDA_DrawFrame* active_window, const wxString& Library, WinEDA_DrawFrame* active_window, const wxString& Library,
const wxString& Mask, const wxString& KeyWord ); const wxString& Mask, const wxString& KeyWord );
MODULE* Load_Module_From_Library( const wxString& library, wxDC* DC ); MODULE* Load_Module_From_Library( const wxString& library, wxDC* DC );
// ratsnest functions // ratsnest functions
void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */ void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */
void ReCompile_Ratsnest_After_Changes( wxDC* DC ); void ReCompile_Ratsnest_After_Changes( wxDC* DC );
int Test_1_Net_Ratsnest( wxDC* DC, int net_code ); int Test_1_Net_Ratsnest( wxDC* DC, int net_code );
char* build_ratsnest_module( wxDC* DC, MODULE* Module ); char* build_ratsnest_module( wxDC* DC, MODULE* Module );
void trace_ratsnest_module( wxDC* DC ); void trace_ratsnest_module( wxDC* DC );
void Build_Board_Ratsnest( wxDC* DC ); void Build_Board_Ratsnest( wxDC* DC );
void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 ); void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 );
void trace_ratsnest_pad( wxDC* DC ); void trace_ratsnest_pad( wxDC* DC );
void recalcule_pad_net_code(); /* compute and update the PAD net codes */ void recalcule_pad_net_code(); /* compute and update the PAD net codes */
void build_liste_pads(); void build_liste_pads();
int* build_ratsnest_pad( EDA_BaseStruct* ref, const wxPoint& refpos, bool init ); int* build_ratsnest_pad( EDA_BaseStruct* ref, const wxPoint& refpos, bool init );
void Tst_Ratsnest( wxDC* DC, int ref_netcode ); void Tst_Ratsnest( wxDC* DC, int ref_netcode );
void test_connexions( wxDC* DC ); void test_connexions( wxDC* DC );
void test_1_net_connexion( wxDC* DC, int net_code ); void test_1_net_connexion( wxDC* DC, int net_code );
void reattribution_reference_piste( int affiche ); void reattribution_reference_piste( int affiche );
// Plotting // Plotting
void ToPlotter( wxCommandEvent& event ); void ToPlotter( wxCommandEvent& event );
void Plot_Serigraphie( int format_plot, FILE* File, int masque_layer ); void Plot_Serigraphie( int format_plot, FILE* File, int masque_layer );
void Genere_GERBER( const wxString& FullFileName, int Layer, void Genere_GERBER( const wxString& FullFileName, int Layer,
bool PlotOriginIsAuxAxis ); bool PlotOriginIsAuxAxis );
void Genere_HPGL( const wxString& FullFileName, int Layer ); void Genere_HPGL( const wxString& FullFileName, int Layer );
void Genere_PS( const wxString& FullFileName, int Layer ); void Genere_PS( const wxString& FullFileName, int Layer );
void Plot_Layer_HPGL( FILE* File, int masque_layer, void Plot_Layer_HPGL( FILE* File, int masque_layer,
int garde, int tracevia, int modetrace ); int garde, int tracevia, int modetrace );
void Plot_Layer_GERBER( FILE* File, int masque_layer, void Plot_Layer_GERBER( FILE* File, int masque_layer,
int garde, int tracevia ); int garde, int tracevia );
int Gen_D_CODE_File( FILE* file ); int Gen_D_CODE_File( FILE* file );
void Plot_Layer_PS( FILE* File, int masque_layer, void Plot_Layer_PS( FILE* File, int masque_layer,
int garde, int tracevia, int modetrace ); int garde, int tracevia, int modetrace );
/* Block operations: */ /* Block operations: */
void Block_Delete( wxDC* DC ); void Block_Delete( wxDC* DC );
void Block_Rotate( wxDC* DC ); void Block_Rotate( wxDC* DC );
void Block_Invert( wxDC* DC ); void Block_Invert( wxDC* DC );
void Block_Move( wxDC* DC ); void Block_Move( wxDC* DC );
void Block_Duplicate( wxDC* DC ); void Block_Duplicate( wxDC* DC );
/** /**
* Function DelLimitesZone * Function DelLimitesZone
* deletes the limits of a zone. * deletes the limits of a zone.
* @param DC A wxDC to draw onto. * @param DC A wxDC to draw onto.
* @param Redraw If true, means redraw the pcb without the zone limits * @param Redraw If true, means redraw the pcb without the zone limits
*/ */
void DelLimitesZone( wxDC* DC, bool Redraw ); void DelLimitesZone( wxDC* DC, bool Redraw );
// layerhandling: // layerhandling:
// (See pcbnew/sel_layer.cpp for description of why null_layer parameter is provided) // (See pcbnew/sel_layer.cpp for description of why null_layer parameter is provided)
int SelectLayer( int default_layer, int min_layer, int max_layer, int SelectLayer( int default_layer, int min_layer, int max_layer,
bool null_layer = false ); bool null_layer = false );
void SelectLayerPair(); void SelectLayerPair();
virtual void SwitchLayer( wxDC* DC, int layer ); virtual void SwitchLayer( wxDC* DC, int layer );
// divers // divers
void AddHistory( int value, KICAD_T type ); // Add value in data list history void AddHistory( int value, KICAD_T type ); // Add value in data list history
void InstallGridFrame( const wxPoint& pos ); void InstallGridFrame( const wxPoint& pos );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/*****************************************************/ /*****************************************************/
/* class WinEDA_PcbFrame: public WinEDA_BasePcbFrame */ /* class WinEDA_PcbFrame: public WinEDA_BasePcbFrame */
/*****************************************************/ /*****************************************************/
class WinEDA_PcbFrame : public WinEDA_BasePcbFrame class WinEDA_PcbFrame : public WinEDA_BasePcbFrame
{ {
public: public:
WinEDAChoiceBox* m_SelLayerBox; WinEDAChoiceBox* m_SelLayerBox;
WinEDAChoiceBox* m_SelTrackWidthBox; WinEDAChoiceBox* m_SelTrackWidthBox;
WinEDAChoiceBox* m_SelViaSizeBox; WinEDAChoiceBox* m_SelViaSizeBox;
private: private:
bool m_SelTrackWidthBox_Changed; bool m_SelTrackWidthBox_Changed;
bool m_SelViaSizeBox_Changed; bool m_SelViaSizeBox_Changed;
wxMenu* m_FilesMenu; wxMenu* m_FilesMenu;
DRC* m_drc; ///< the DRC controller, see drc.cpp DRC* m_drc; ///< the DRC controller, see drc.cpp
// we'll use lower case function names for private member functions. // we'll use lower case function names for private member functions.
void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ); void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu ); void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu );
void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu ); void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu );
void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu ); void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu );
void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu ); void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu );
void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ); void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu );
void createPopUpBlockMenu( wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu );
public: public:
WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent, const wxString& title, WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_PcbFrame(); ~WinEDA_PcbFrame();
// Configurations: // Configurations:
void InstallConfigFrame( const wxPoint& pos ); void InstallConfigFrame( const wxPoint& pos );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
void Update_config( wxWindow* displayframe ); void Update_config( wxWindow* displayframe );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
bool OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct ); bool OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct );
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void ProcessMuWaveFunctions( wxCommandEvent& event ); void ProcessMuWaveFunctions( wxCommandEvent& event );
void MuWaveCommand( wxDC* DC, const wxPoint& MousePos ); void MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateAuxiliaryToolbar(); void ReCreateAuxiliaryToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();
void ReCreateAuxVToolbar(); void ReCreateAuxVToolbar();
void ReCreateOptToolbar(); void ReCreateOptToolbar();
void ReCreateMenuBar(); void ReCreateMenuBar();
WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent ); WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent );
void PrepareLayerIndicator(); void PrepareLayerIndicator();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
/** /**
* Function OnRightClick * Function OnRightClick
* populates a popup menu with the choices appropriate for the current context. * populates a popup menu with the choices appropriate for the current context.
* The caller will add the ZOOM menu choices afterwards. * The caller will add the ZOOM menu choices afterwards.
* @param aMousePos The current mouse position * @param aMousePos The current mouse position
* @param aPopMenu The menu to add to. * @param aPopMenu The menu to add to.
*/ */
bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ); bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
/* Gestion generale des operations sur block */ /* Gestion generale des operations sur block */
int ReturnBlockCommand( int key ); int ReturnBlockCommand( int key );
void HandleBlockPlace( wxDC* DC ); void HandleBlockPlace( wxDC* DC );
int HandleBlockEnd( wxDC* DC ); int HandleBlockEnd( wxDC* DC );
void SetToolbars(); void SetToolbars();
void Process_Settings( wxCommandEvent& event ); void Process_Settings( wxCommandEvent& event );
void InstallPcbOptionsFrame( const wxPoint& pos, wxDC* DC, int id ); void InstallPcbOptionsFrame( const wxPoint& pos, wxDC* DC, int id );
void InstallPcbGlobalDeleteFrame( const wxPoint& pos ); void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
void GenModulesPosition( wxCommandEvent& event ); void GenModulesPosition( wxCommandEvent& event );
void GenModuleReport( wxCommandEvent& event ); void GenModuleReport( wxCommandEvent& event );
void InstallDrillFrame( wxCommandEvent& event ); void InstallDrillFrame( wxCommandEvent& event );
void ToPostProcess( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event );
void Files_io( wxCommandEvent& event ); void Files_io( wxCommandEvent& event );
int LoadOnePcbFile( const wxString& FileName, wxDC* DC, bool Append ); int LoadOnePcbFile( const wxString& FileName, wxDC* DC, bool Append );
int ReadPcbFile( wxDC* DC, FILE* File, bool Append ); int ReadPcbFile( wxDC* DC, FILE* File, bool Append );
bool SavePcbFile( const wxString& FileName ); bool SavePcbFile( const wxString& FileName );
int SavePcbFormatAscii( FILE* File ); int SavePcbFormatAscii( FILE* File );
bool WriteGeneralDescrPcb( FILE* File ); bool WriteGeneralDescrPcb( FILE* File );
bool RecreateCmpFileFromBoard(); bool RecreateCmpFileFromBoard();
void ExportToGenCAD( wxCommandEvent& event ); void ExportToGenCAD( wxCommandEvent& event );
/* Fonctions specifiques */ /* Fonctions specifiques */
MODULE* ListAndSelectModuleName(); MODULE* ListAndSelectModuleName();
void Liste_Equipot( wxCommandEvent& event ); void Liste_Equipot( wxCommandEvent& event );
void Swap_Layers( wxCommandEvent& event ); void Swap_Layers( wxCommandEvent& event );
void Install_Test_DRC_Frame( wxDC* DC ); void Install_Test_DRC_Frame( wxDC* DC );
void Trace_Pcb( wxDC* DC, int mode ); void Trace_Pcb( wxDC* DC, int mode );
// Handling texts on the board // Handling texts on the board
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
TEXTE_PCB* Create_Texte_Pcb( wxDC* DC ); TEXTE_PCB* Create_Texte_Pcb( wxDC* DC );
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ); void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC );
void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB,
wxDC* DC, const wxPoint& pos ); wxDC* DC, const wxPoint& pos );
// Graphic Segments type DRAWSEGMENT // Graphic Segments type DRAWSEGMENT
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
// Footprint edition (see also WinEDA_BasePcbFrame) // Footprint edition (see also WinEDA_BasePcbFrame)
void StartMove_Module( MODULE* module, wxDC* DC ); void StartMove_Module( MODULE* module, wxDC* DC );
bool Delete_Module( MODULE* module, wxDC* DC ); bool Delete_Module( MODULE* module, wxDC* DC );
// loading modules: see WinEDA_BasePcbFrame // loading modules: see WinEDA_BasePcbFrame
// Board handling // Board handling
void Erase_Zones( bool query ); void Erase_Zones( bool query );
void Erase_Segments_Pcb( bool is_edges, bool query ); void Erase_Segments_Pcb( bool is_edges, bool query );
void Erase_Pistes( wxDC* DC, int masque_type, bool query ); void Erase_Pistes( wxDC* DC, int masque_type, bool query );
void Erase_Modules( bool query ); void Erase_Modules( bool query );
void Erase_Textes_Pcb( bool query ); void Erase_Textes_Pcb( bool query );
void Erase_Marqueurs(); void Erase_Marqueurs();
void UnDeleteItem( wxDC* DC ); void UnDeleteItem( wxDC* DC );
void RemoveStruct( BOARD_ITEM* Item, wxDC* DC ); void RemoveStruct( BOARD_ITEM* Item, wxDC* DC );
void Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via ); void Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via );
// Hightlight functions: // Hightlight functions:
int Select_High_Light( wxDC* DC ); int Select_High_Light( wxDC* DC );
void Hight_Light( wxDC* DC ); void Hight_Light( wxDC* DC );
void DrawHightLight( wxDC* DC, int NetCode ); void DrawHightLight( wxDC* DC, int NetCode );
// Track and via edition: // Track and via edition:
void DisplayTrackSettings(); void DisplayTrackSettings();
/** /**
* Function Other_Layer_Route * Function Other_Layer_Route
* operates in one of two ways. If argument track is NULL, then swap the active * operates in one of two ways. If argument track is NULL, then swap the active
* layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a track is * layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a track is
* in progress (track is not NULL), and if DRC allows it, place a via on the end * in progress (track is not NULL), and if DRC allows it, place a via on the end
* of the current track, and then swap the current active layer and start a new * of the current track, and then swap the current active layer and start a new
* segment on the new layer. * segment on the new layer.
* @param track A TRACK* to append the via to or NULL. * @param track A TRACK* to append the via to or NULL.
* @param DC A device context to draw on. * @param DC A device context to draw on.
* @return bool - true if the operation was successful, else false such as * @return bool - true if the operation was successful, else false such as
* the case where DRC would not allow a via. * the case where DRC would not allow a via.
*/ */
bool Other_Layer_Route( TRACK* track, wxDC* DC ); bool Other_Layer_Route( TRACK* track, wxDC* DC );
void Affiche_PadsNoConnect( wxDC* DC ); void Affiche_PadsNoConnect( wxDC* DC );
void Affiche_Status_Net( wxDC* DC ); void Affiche_Status_Net( wxDC* DC );
TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
void Delete_Track( wxDC* DC, TRACK* Track ); void Delete_Track( wxDC* DC, TRACK* Track );
void Delete_net( wxDC* DC, TRACK* Track ); void Delete_net( wxDC* DC, TRACK* Track );
void Supprime_Une_Piste( wxDC* DC, TRACK* pt_segm ); void Supprime_Une_Piste( wxDC* DC, TRACK* pt_segm );
bool Resize_Pistes_Vias( wxDC* DC, bool Track, bool Via ); bool Resize_Pistes_Vias( wxDC* DC, bool Track, bool Via );
void Edit_Net_Width( wxDC* DC, int Netcode ); void Edit_Net_Width( wxDC* DC, int Netcode );
void Edit_Track_Width( wxDC* DC, TRACK* Track ); void Edit_Track_Width( wxDC* DC, TRACK* Track );
int Edit_TrackSegm_Width( wxDC* DC, TRACK* segm ); int Edit_TrackSegm_Width( wxDC* DC, TRACK* segm );
TRACK* Begin_Route( TRACK* track, wxDC* DC ); TRACK* Begin_Route( TRACK* track, wxDC* DC );
void End_Route( TRACK* track, wxDC* DC ); void End_Route( TRACK* track, wxDC* DC );
void ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC ); void ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC );
void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ); void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On );
void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ); void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On );
void Attribut_net( wxDC* DC, int net_code, bool Flag_On ); void Attribut_net( wxDC* DC, int net_code, bool Flag_On );
void Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int command ); void Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int command );
bool PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC ); bool PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC );
void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ); void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
void SwitchLayer( wxDC* DC, int layer ); void SwitchLayer( wxDC* DC, int layer );
int Add_45_degrees_Segment( wxDC* DC, TRACK* pt_segm ); int Add_45_degrees_Segment( wxDC* DC, TRACK* pt_segm );
bool Genere_Pad_Connexion( wxDC* DC, int layer ); bool Genere_Pad_Connexion( wxDC* DC, int layer );
// zone handling // zone handling
/** Function Delete_Zone /** Function Delete_Zone
* Remove the zone which include the segment aZone, or the zone which have the given time stamp. * Remove the zone which include the segment aZone, or the zone which have the given time stamp.
* A zone is a group of segments which have the same TimeStamp * A zone is a group of segments which have the same TimeStamp
* @param DC = current Device Context (can be NULL) * @param DC = current Device Context (can be NULL)
* @param aZone = zone segment within the zone to delete. Can be NULL * @param aZone = zone segment within the zone to delete. Can be NULL
* @param aTimestamp = Timestamp for the zone to delete, used if aZone == NULL * @param aTimestamp = Timestamp for the zone to delete, used if aZone == NULL
*/ */
void Delete_Zone( wxDC* DC, SEGZONE* Track, long aTimestamp = 0 ); void Delete_Zone( wxDC* DC, SEGZONE* Track, long aTimestamp = 0 );
EDGE_ZONE* Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone ); EDGE_ZONE* Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone );
/** /**
* Function Begin_Zone * Function Begin_Zone
* initiates a zone edge creation process, * initiates a zone edge creation process,
* or terminates the current zone edge and creates a new zone edge stub * or terminates the current zone edge and creates a new zone edge stub
*/ */
EDGE_ZONE* Begin_Zone( wxDC* DC ); EDGE_ZONE* Begin_Zone( wxDC* DC );
/** /**
* Function End_Zone * Function End_Zone
* terminates the zone edge creation process * terminates the zone edge creation process
* @param DC = current Device Context * @param DC = current Device Context
*/ */
void End_Zone( wxDC* DC ); void End_Zone( wxDC* DC );
/** Function Fill_Zone() /** Function Fill_Zone()
* Calculate the zone filling for the outline zone_container * Calculate the zone filling for the outline zone_container
* The zone outline is a frontier, and can be complex (with holes) * The zone outline is a frontier, and can be complex (with holes)
* The filling starts from starting points like pads, tracks. * The filling starts from starting points like pads, tracks.
* If exists the old filling is removed * If exists the old filling is removed
* @param DC = current Device Context * @param DC = current Device Context
* @param zone_container = zone to fill * @param zone_container = zone to fill
* @param verbose = true to show error messages * @param verbose = true to show error messages
* @return error level (0 = no error) * @return error level (0 = no error)
*/ */
int Fill_Zone( wxDC* DC, ZONE_CONTAINER * zone_container, bool verbose = TRUE ); int Fill_Zone( wxDC* DC, ZONE_CONTAINER * zone_container, bool verbose = TRUE );
/** Function Fill_All_Zones() /** Function Fill_All_Zones()
* Fill all zones on the board * Fill all zones on the board
* The old fillings are removed * The old fillings are removed
* @param frame = reference to the main frame * @param frame = reference to the main frame
* @param DC = current Device Context * @param DC = current Device Context
* @param verbose = true to show error messages * @param verbose = true to show error messages
* @return error level (0 = no error) * @return error level (0 = no error)
*/ */
int Fill_All_Zones( wxDC* DC, bool verbose = TRUE ); int Fill_All_Zones( wxDC* DC, bool verbose = TRUE );
/** /**
* Function Edit_Zone_Params * Function Edit_Zone_Params
* Edit params (layer, clearance, ...) for a zone outline * Edit params (layer, clearance, ...) for a zone outline
*/ */
void Edit_Zone_Params( wxDC* DC , ZONE_CONTAINER * zone_container ); void Edit_Zone_Params( wxDC* DC , ZONE_CONTAINER * zone_container );
/** /**
* Function Start_Move_Zone_Corner * Function Start_Move_Zone_Corner
* Prepares a move corner in a zone outline, * Prepares a move corner in a zone outline,
* called from a move corner command (IsNewCorner = false), * called from a move corner command (IsNewCorner = false),
* or a create new cornet command (IsNewCorner = true ) * or a create new cornet command (IsNewCorner = true )
*/ */
void Start_Move_Zone_Corner( wxDC* DC , ZONE_CONTAINER * zone_container, int corner_id, bool IsNewCorner ); void Start_Move_Zone_Corner( wxDC* DC , ZONE_CONTAINER * zone_container, int corner_id, bool IsNewCorner );
/** /**
* Function End_Move_Zone_Corner * Function End_Move_Zone_Corner
* Terminates a move corner in a zone outline * Terminates a move corner in a zone outline
*/ */
void End_Move_Zone_Corner( wxDC* DC , ZONE_CONTAINER * zone_container ); void End_Move_Zone_Corner( wxDC* DC , ZONE_CONTAINER * zone_container );
// Target handling // Target handling
MIREPCB* Create_Mire( wxDC* DC ); MIREPCB* Create_Mire( wxDC* DC );
void Delete_Mire( MIREPCB* MirePcb, wxDC* DC ); void Delete_Mire( MIREPCB* MirePcb, wxDC* DC );
void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ); void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC );
void Place_Mire( MIREPCB* MirePcb, wxDC* DC ); void Place_Mire( MIREPCB* MirePcb, wxDC* DC );
void InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC, const wxPoint& pos ); void InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC, const wxPoint& pos );
// Graphic segments type DRAWSEGMENT handling: // Graphic segments type DRAWSEGMENT handling:
DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC ); DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC );
void End_Edge( DRAWSEGMENT* Segment, wxDC* DC ); void End_Edge( DRAWSEGMENT* Segment, wxDC* DC );
void Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC ); void Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC );
void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ); void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC );
void Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC ); void Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC );
// Dimension handling: // Dimension handling:
void Install_Edit_Cotation( COTATION* Cotation, wxDC* DC, const wxPoint& pos ); void Install_Edit_Cotation( COTATION* Cotation, wxDC* DC, const wxPoint& pos );
COTATION* Begin_Cotation( COTATION* Cotation, wxDC* DC ); COTATION* Begin_Cotation( COTATION* Cotation, wxDC* DC );
void Delete_Cotation( COTATION* Cotation, wxDC* DC ); void Delete_Cotation( COTATION* Cotation, wxDC* DC );
// netlist handling: // netlist handling:
void InstallNetlistFrame( wxDC* DC, const wxPoint& pos ); void InstallNetlistFrame( wxDC* DC, const wxPoint& pos );
// Autoplacement: // Autoplacement:
void AutoPlace( wxCommandEvent& event ); void AutoPlace( wxCommandEvent& event );
void ReOrientModules( const wxString& ModuleMask, int Orient, void ReOrientModules( const wxString& ModuleMask, int Orient,
bool include_fixe, wxDC* DC ); bool include_fixe, wxDC* DC );
void FixeModule( MODULE* Module, bool Fixe ); void FixeModule( MODULE* Module, bool Fixe );
void AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ); void AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb );
bool SetBoardBoundaryBoxFromEdgesOnly(); bool SetBoardBoundaryBoxFromEdgesOnly();
void AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ); void AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC );
int RecherchePlacementModule( MODULE* Module, wxDC* DC ); int RecherchePlacementModule( MODULE* Module, wxDC* DC );
void GenModuleOnBoard( MODULE* Module ); void GenModuleOnBoard( MODULE* Module );
float Compute_Ratsnest_PlaceModule( wxDC* DC ); float Compute_Ratsnest_PlaceModule( wxDC* DC );
int GenPlaceBoard(); int GenPlaceBoard();
void DrawInfoPlace( wxDC* DC ); void DrawInfoPlace( wxDC* DC );
// Autorouting: // Autorouting:
int Solve( wxDC* DC, int two_sides ); int Solve( wxDC* DC, int two_sides );
void Reset_Noroutable( wxDC* DC ); void Reset_Noroutable( wxDC* DC );
void Autoroute( wxDC* DC, int mode ); void Autoroute( wxDC* DC, int mode );
void ReadAutoroutedTracks( wxDC* DC ); void ReadAutoroutedTracks( wxDC* DC );
void GlobalRoute( wxDC* DC ); void GlobalRoute( wxDC* DC );
// divers // divers
void Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC ); void Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC );
void Ratsnest_On_Off( wxDC* DC ); void Ratsnest_On_Off( wxDC* DC );
void Clean_Pcb( wxDC* DC ); void Clean_Pcb( wxDC* DC );
BOARD_ITEM* SaveItemEfface( BOARD_ITEM* PtItem, int nbitems ); BOARD_ITEM* SaveItemEfface( BOARD_ITEM* PtItem, int nbitems );
void InstallFindFrame( const wxPoint& pos, wxDC* DC ); void InstallFindFrame( const wxPoint& pos, wxDC* DC );
/** /**
* Function SendMessageToEESCHEMA * Function SendMessageToEESCHEMA
* sends a message to the schematic editor so that it may move its cursor * sends a message to the schematic editor so that it may move its cursor
* to a part with the same reference as the objectToSync * to a part with the same reference as the objectToSync
* @param objectToSync The object whose reference is used to syncronize eeschema. * @param objectToSync The object whose reference is used to syncronize eeschema.
*/ */
void SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ); void SendMessageToEESCHEMA( BOARD_ITEM* objectToSync );
/* Micro waves functions */ /* Micro waves functions */
void Edit_Gap( wxDC* DC, MODULE* Module ); void Edit_Gap( wxDC* DC, MODULE* Module );
MODULE* Create_MuWaveBasicShape( wxDC* DC, const wxString& name, int pad_count ); MODULE* Create_MuWaveBasicShape( wxDC* DC, const wxString& name, int pad_count );
MODULE* Create_MuWaveComponent( wxDC* DC, int shape_type ); MODULE* Create_MuWaveComponent( wxDC* DC, int shape_type );
MODULE* Create_MuWavePolygonShape( wxDC* DC ); MODULE* Create_MuWavePolygonShape( wxDC* DC );
void Begin_Self( wxDC* DC ); void Begin_Self( wxDC* DC );
MODULE* Genere_Self( wxDC* DC ); MODULE* Genere_Self( wxDC* DC );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/****************************************************/ /****************************************************/
/* class WinEDA_GerberFrame: public WinEDA_PcbFrame */ /* class WinEDA_GerberFrame: public WinEDA_PcbFrame */
/****************************************************/ /****************************************************/
class WinEDA_GerberFrame : public WinEDA_BasePcbFrame class WinEDA_GerberFrame : public WinEDA_BasePcbFrame
{ {
public: public:
WinEDAChoiceBox* m_SelLayerBox; WinEDAChoiceBox* m_SelLayerBox;
WinEDAChoiceBox* m_SelLayerTool; WinEDAChoiceBox* m_SelLayerTool;
private: private:
wxMenu* m_FilesMenu; wxMenu* m_FilesMenu;
public: public:
WinEDA_GerberFrame( wxWindow* father, WinEDA_App* parent, const wxString& title, WinEDA_GerberFrame( wxWindow* father, WinEDA_App* parent, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_GerberFrame(); ~WinEDA_GerberFrame();
void Update_config(); void Update_config();
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();
void ReCreateOptToolbar(); void ReCreateOptToolbar();
void ReCreateMenuBar(); void ReCreateMenuBar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
EDA_BaseStruct* GerberGeneralLocateAndDisplay(); EDA_BaseStruct* GerberGeneralLocateAndDisplay();
EDA_BaseStruct* Locate( int typeloc ); EDA_BaseStruct* Locate( int typeloc );
void SetToolbars(); void SetToolbars();
void Process_Settings( wxCommandEvent& event ); void Process_Settings( wxCommandEvent& event );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
void InstallConfigFrame( const wxPoint& pos ); void InstallConfigFrame( const wxPoint& pos );
void InstallPcbOptionsFrame( const wxPoint& pos, int id ); void InstallPcbOptionsFrame( const wxPoint& pos, int id );
void InstallPcbGlobalDeleteFrame( const wxPoint& pos ); void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
/* handlers for block commands */ /* handlers for block commands */
int ReturnBlockCommand( int key ); int ReturnBlockCommand( int key );
virtual void HandleBlockPlace( wxDC* DC ); virtual void HandleBlockPlace( wxDC* DC );
virtual int HandleBlockEnd( wxDC* DC ); virtual int HandleBlockEnd( wxDC* DC );
void InstallDrillFrame( wxCommandEvent& event ); void InstallDrillFrame( wxCommandEvent& event );
void ToPostProcess( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event );
void Genere_HPGL( const wxString& FullFileName, int Layers ); void Genere_HPGL( const wxString& FullFileName, int Layers );
void Genere_GERBER( const wxString& FullFileName, int Layers ); void Genere_GERBER( const wxString& FullFileName, int Layers );
void Genere_PS( const wxString& FullFileName, int Layers ); void Genere_PS( const wxString& FullFileName, int Layers );
void Plot_Layer_HPGL( FILE* File, int masque_layer, void Plot_Layer_HPGL( FILE* File, int masque_layer,
int garde, int tracevia, int modetrace ); int garde, int tracevia, int modetrace );
void Plot_Layer_GERBER( FILE* File, int masque_layer, void Plot_Layer_GERBER( FILE* File, int masque_layer,
int garde, int tracevia ); int garde, int tracevia );
int Gen_D_CODE_File( const wxString& Name_File ); int Gen_D_CODE_File( const wxString& Name_File );
void Plot_Layer_PS( FILE* File, int masque_layer, void Plot_Layer_PS( FILE* File, int masque_layer,
int garde, int tracevia, int modetrace ); int garde, int tracevia, int modetrace );
void Files_io( wxCommandEvent& event ); void Files_io( wxCommandEvent& event );
int LoadOneGerberFile( const wxString& FileName, wxDC* DC, int mode ); int LoadOneGerberFile( const wxString& FileName, wxDC* DC, int mode );
int ReadGerberFile( wxDC* DC, FILE* File, bool Append ); int ReadGerberFile( wxDC* DC, FILE* File, bool Append );
bool Read_GERBER_File( wxDC* DC, bool Read_GERBER_File( wxDC* DC,
const wxString& GERBER_FullFileName, const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName ); const wxString& D_Code_FullFileName );
bool SaveGerberFile( const wxString& FileName, wxDC* DC ); bool SaveGerberFile( const wxString& FileName, wxDC* DC );
int Read_D_Code_File( const wxString& D_Code_FullFileName ); int Read_D_Code_File( const wxString& D_Code_FullFileName );
void CopyDCodesSizeToItems(); void CopyDCodesSizeToItems();
void Liste_D_Codes( wxDC* DC ); void Liste_D_Codes( wxDC* DC );
/* Fonctions specifiques */ /* Fonctions specifiques */
void Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer ); void Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer );
// Copper texts // Copper texts
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
TEXTE_PCB* Create_Texte_Pcb( wxDC* DC ); TEXTE_PCB* Create_Texte_Pcb( wxDC* DC );
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ); void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC );
void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
// PCB handling // PCB handling
bool Clear_Pcb( bool query ); bool Clear_Pcb( bool query );
void Erase_Current_Layer( bool query ); void Erase_Current_Layer( bool query );
void Erase_Zones( bool query ); void Erase_Zones( bool query );
void Erase_Segments_Pcb( bool is_edges, bool query ); void Erase_Segments_Pcb( bool is_edges, bool query );
void Erase_Pistes( int masque_type, bool query ); void Erase_Pistes( int masque_type, bool query );
void Erase_Textes_Pcb( bool query ); void Erase_Textes_Pcb( bool query );
void UnDeleteItem( wxDC* DC ); void UnDeleteItem( wxDC* DC );
void Delete_DCode_Items( wxDC* DC, int dcode_value, int layer_number ); void Delete_DCode_Items( wxDC* DC, int dcode_value, int layer_number );
TRACK* Begin_Route( TRACK* track, wxDC* DC ); TRACK* Begin_Route( TRACK* track, wxDC* DC );
void End_Route( TRACK* track, wxDC* DC ); void End_Route( TRACK* track, wxDC* DC );
TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
int Edit_TrackSegm_Width( wxDC* DC, TRACK* segm ); int Edit_TrackSegm_Width( wxDC* DC, TRACK* segm );
// Conversion function // Conversion function
void ExportDataInPcbnewFormat( wxCommandEvent& event ); void ExportDataInPcbnewFormat( wxCommandEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/*********************************************************/ /*********************************************************/
/* class WinEDA_ModuleEditFrame: public WinEDA_DrawFrame */ /* class WinEDA_ModuleEditFrame: public WinEDA_DrawFrame */
/* Class for the footprint editor */ /* Class for the footprint editor */
/*********************************************************/ /*********************************************************/
class WinEDA_ModuleEditFrame : public WinEDA_BasePcbFrame class WinEDA_ModuleEditFrame : public WinEDA_BasePcbFrame
{ {
public: public:
MODULE* CurrentModule; MODULE* CurrentModule;
wxString m_CurrentLib; wxString m_CurrentLib;
public: public:
WinEDA_ModuleEditFrame( wxWindow* father, WinEDA_App* parent, WinEDA_ModuleEditFrame( wxWindow* father, WinEDA_App* parent,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_ModuleEditFrame(); ~WinEDA_ModuleEditFrame();
void InstallOptionsFrame( const wxPoint& pos ); void InstallOptionsFrame( const wxPoint& pos );
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();
void ReCreateOptToolbar(); void ReCreateOptToolbar();
void ReCreateAuxiliaryToolbar(); void ReCreateAuxiliaryToolbar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void SetToolbars(); void SetToolbars();
void ReCreateMenuBar(); void ReCreateMenuBar();
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
/* handlers for block commands */ /* handlers for block commands */
int ReturnBlockCommand( int key ); int ReturnBlockCommand( int key );
virtual void HandleBlockPlace( wxDC* DC ); virtual void HandleBlockPlace( wxDC* DC );
virtual int HandleBlockEnd( wxDC* DC ); virtual int HandleBlockEnd( wxDC* DC );
BOARD_ITEM* ModeditLocateAndDisplay( int aHotKeyCode = 0 ); BOARD_ITEM* ModeditLocateAndDisplay( int aHotKeyCode = 0 );
/* Undo and redo functions */ /* Undo and redo functions */
public: public:
void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int flag_type_command = 0 ); void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int flag_type_command = 0 );
private: private:
void GetComponentFromUndoList(); void GetComponentFromUndoList();
void GetComponentFromRedoList(); void GetComponentFromRedoList();
public: public:
// Footprint edition // Footprint edition
void Place_Ancre( MODULE* module, wxDC* DC ); void Place_Ancre( MODULE* module, wxDC* DC );
void RemoveStruct( EDA_BaseStruct* Item, wxDC* DC ); void RemoveStruct( EDA_BaseStruct* Item, wxDC* DC );
void Transform( MODULE* module, wxDC* DC, int transform ); void Transform( MODULE* module, wxDC* DC, int transform );
// loading Footprint // loading Footprint
MODULE* Import_Module( wxDC* DC ); MODULE* Import_Module( wxDC* DC );
void Export_Module( MODULE* ptmod, bool createlib ); void Export_Module( MODULE* ptmod, bool createlib );
void Load_Module_Module_From_BOARD( MODULE* Module ); void Load_Module_Module_From_BOARD( MODULE* Module );
// functions to edit footprint edges // functions to edit footprint edges
void Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC ); void Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC );
void Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC ); void Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC );
void Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC ); void Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC );
EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge ); EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge );
void End_Edge_Module( EDGE_MODULE* Edge, wxDC* DC ); void End_Edge_Module( EDGE_MODULE* Edge, wxDC* DC );
void Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC ); void Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC );
void Start_Move_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC ); void Start_Move_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC );
void Place_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC ); void Place_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC );
// handlers for libraries: // handlers for libraries:
void Delete_Module_In_Library( const wxString& libname ); void Delete_Module_In_Library( const wxString& libname );
int Create_Librairie( const wxString& LibName ); int Create_Librairie( const wxString& LibName );
void Select_Active_Library(); void Select_Active_Library();
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif /* WXPCB_STRUCT_H */ #endif /* WXPCB_STRUCT_H */
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