KiCad PCB EDA Suite
pcbnew.cpp File Reference

Pcbnew main program. More...

#include <fctsys.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <kiface_ids.h>
#include <confirm.h>
#include <macros.h>
#include <make_unique.h>
#include <class_drawpanel.h>
#include <wxPcbStruct.h>
#include <eda_dde.h>
#include <colors_selection.h>
#include <wx/stdpaths.h>
#include <wx/file.h>
#include <wx/snglinst.h>
#include <wx/dir.h>
#include <gestfich.h>
#include <pcbnew.h>
#include <hotkeys.h>
#include <wildcards_and_files_ext.h>
#include <class_board.h>
#include <class_draw_panel_gal.h>
#include <fp_lib_table.h>
#include <module_editor_frame.h>
#include <modview_frame.h>
#include <footprint_wizard_frame.h>
#include <footprint_preview_panel.h>
#include <footprint_info_impl.h>
#include <gl_context_mgr.h>

Go to the source code of this file.


struct  PCB::IFACE




bool IsWxPythonLoaded ()
 IFACE (const char *aName, KIWAY::FACE_T aType)
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits) override
void OnKifaceEnd () override
wxWindow * CreateWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
void * IfaceOrAddress (int aDataId) override
 Function IfaceOrAddress return a pointer to the requested object. More...
KIFACE_IKiface ()
 Global KIFACE_I "get" accessor. More...
void PythonPluginsReloadBase ()
 Helper function PythonPluginsReloadBase Reload Python plugins if they are newer than the already loaded, and load new plugins if any It calls the LoadPlugins(bundlepath) Python method see kicadplugins.i. More...


bool g_Drc_On = true
bool g_AutoDeleteOldTrack = true
bool g_Raccord_45_Auto = true
bool g_Alternate_Track_Posture = false
bool g_Track_45_Only_Allowed = true
bool g_Segments_45_Only
bool g_TwoSegmentTrackBuild = true
PCB_LAYER_ID g_Route_Layer_TOP
int g_MagneticPadOption = CAPTURE_CURSOR_IN_TRACK_TOOL
int g_MagneticTrackOption = CAPTURE_CURSOR_IN_TRACK_TOOL
wxPoint g_Offset_Module
wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" )
DLIST< TRACKg_CurrentTrackList
static PGM_BASEprocess
int aKiwayVersion
int PGM_BASEaProgram
return & kiface
FP_LIB_TABLE GFootprintTable
 The global footprint library table. More...

Detailed Description

Pcbnew main program.

Definition in file pcbnew.cpp.

Function Documentation

wxWindow* kiface::CreateWindow ( wxWindow *  aParent,
int  aClassId,
KIWAY aKiway,
int  aCtlBits = 0 

Definition at line 388 of file pcbnew.cpp.

kiface::IFACE ( const char *  aName,

Definition at line 380 of file pcbnew.cpp.

void* kiface::IfaceOrAddress ( int  aDataId)

Function IfaceOrAddress return a pointer to the requested object.

The safest way to use this is to retrieve a pointer to a static instance of an interface, similar to how the KIFACE interface is exported. But if you know what you are doing use it to retrieve anything you want.

aDataIdidentifies which object you want the address of.
void* - and must be cast into the know type.

Definition at line 447 of file pcbnew.cpp.

bool IsWxPythonLoaded ( )

Definition at line 62 of file python_scripting.cpp.

63 {
64  return wxPythonLoaded;
65 }
static bool wxPythonLoaded
KIFACE_I& Kiface ( )

Global KIFACE_I "get" accessor.

Definition at line 199 of file pcbnew.cpp.

References PCB::kiface().

Referenced by PCB::IFACE::CreateWindow().

199 { return kiface; }
return & kiface
Definition: pcbnew.cpp:207
void kiface::OnKifaceEnd ( )
bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 
void PythonPluginsReloadBase ( )

Helper function PythonPluginsReloadBase Reload Python plugins if they are newer than the already loaded, and load new plugins if any It calls the LoadPlugins(bundlepath) Python method see kicadplugins.i.

Definition at line 299 of file pcbnew.cpp.

References PyScriptingPath(), and TO_UTF8.

Referenced by PCB_EDIT_FRAME::PythonPluginsReload().

300 {
301 #if defined(KICAD_SCRIPTING)
302  //Reload plugin list: reload Python plugins if they are newer than
303  // the already loaded, and load new plugins
304  char cmd[1024];
306  snprintf( cmd, sizeof(cmd),
307  "pcbnew.LoadPlugins(\"%s\")", TO_UTF8( PyScriptingPath() ) );
309  PyLOCK lock;
311  // ReRun the Python method pcbnew.LoadPlugins
312  // (already called when starting Pcbnew)
313  PyRun_SimpleString( cmd );
314 #endif
315 }
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
wxString PyScriptingPath()
Find the Python scripting path.

Variable Documentation

int aKiwayVersion

Definition at line 204 of file pcbnew.cpp.

int PGM_BASE* aProgram
Initial value:
static PGM_BASE * process
Definition: pcbnew.cpp:196
int PGM_BASE * aProgram
Definition: pcbnew.cpp:205

Definition at line 205 of file pcbnew.cpp.

bool g_Alternate_Track_Posture = false

Definition at line 73 of file pcbnew.cpp.

Referenced by ComputeBreakPoint(), and PCB_EDIT_FRAME::Process_Special_Functions().

wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" )

Definition at line 90 of file pcbnew.cpp.

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

bool g_Raccord_45_Auto = true

Definition at line 72 of file pcbnew.cpp.

Referenced by PCB_EDIT_FRAME::Begin_Route().

bool g_Track_45_Only_Allowed = true
FP_LIB_TABLE GFootprintTable

The global footprint library table.

This is not dynamically allocated because in a multiple project environment we must keep its address constant (since it is the fallback table for multiple projects).

Definition at line 321 of file pcbnew.cpp.

Referenced by PCB::IFACE::IfaceOrAddress(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), PROJECT::PcbFootprintLibs(), PCB_EDIT_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

PGM_BASE* process

Definition at line 196 of file pcbnew.cpp.