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 <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.

Classes

struct  PCB::IFACE
 

Namespaces

 PCB
 

Functions

bool IsWxPythonLoaded ()
 
PCB::IFACE KIFACE_I PCB::kiface ("pcbnew", KIWAY::FACE_PCB)
 
 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...
 
 MY_API (KIFACE *) KIFACE_GETTER(int *aKIFACEversion
 
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...
 

Variables

PCB_LAYER_ID g_Route_Layer_TOP
 
PCB_LAYER_ID g_Route_Layer_BOTTOM
 
bool g_Alternate_Track_Posture = false
 
bool g_Raccord_45_Auto = true
 
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 
)
override

Definition at line 378 of file pcbnew.cpp.

kiface::IFACE ( const char *  aName,
KIWAY::FACE_T  aType 
)

Definition at line 370 of file pcbnew.cpp.

void* kiface::IfaceOrAddress ( int  aDataId)
override

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.

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

Definition at line 437 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 189 of file pcbnew.cpp.

References PCB::kiface().

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

189 { return kiface; }
return & kiface
Definition: pcbnew.cpp:197
MY_API ( KIFACE )
void kiface::OnKifaceEnd ( )
override
bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 
)
override
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 289 of file pcbnew.cpp.

References PyScriptingPath(), and TO_UTF8.

Referenced by PCB_EDIT_FRAME::PythonPluginsReload().

290 {
291 #if defined(KICAD_SCRIPTING)
292  //Reload plugin list: reload Python plugins if they are newer than
293  // the already loaded, and load new plugins
294  char cmd[1024];
295 
296  snprintf( cmd, sizeof(cmd),
297  "pcbnew.LoadPlugins(\"%s\")", TO_UTF8( PyScriptingPath() ) );
298 
299  PyLOCK lock;
300 
301  // ReRun the Python method pcbnew.LoadPlugins
302  // (already called when starting Pcbnew)
303  PyRun_SimpleString( cmd );
304 #endif
305 }
#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 194 of file pcbnew.cpp.

int PGM_BASE* aProgram
Initial value:
{
static PGM_BASE * process
Definition: pcbnew.cpp:186
int PGM_BASE * aProgram
Definition: pcbnew.cpp:195

Definition at line 195 of file pcbnew.cpp.

bool g_Alternate_Track_Posture = false

Definition at line 70 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 80 of file pcbnew.cpp.

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

bool g_Raccord_45_Auto = true

Definition at line 71 of file pcbnew.cpp.

Referenced by PCB_EDIT_FRAME::Begin_Route().

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 311 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
static

Definition at line 186 of file pcbnew.cpp.