KiCad PCB EDA Suite
pl_editor.cpp File Reference

page layout editor main file. More...

#include <fctsys.h>
#include <kiface_i.h>
#include <confirm.h>
#include <gestfich.h>
#include <ws_draw_item.h>
#include <pl_editor_frame.h>
#include <build_version.h>
#include <wx/file.h>
#include <wx/snglinst.h>

Go to the source code of this file.

Classes

struct  PGE::IFACE
 

Namespaces

 PGE
 

Functions

PGE::IFACE KIFACE_I PGE::kiface ("pl_editor", KIWAY::FACE_PL_EDITOR)
 
 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...
 
void SaveFileAs (const wxString &aProjectBasePath, const wxString &aSrcProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
 Function SaveFileAs Saving a file under a different name is delegated to the various KIFACEs because the project doesn't know the internal format of the various files (which may have paths in them that need updating). More...
 
KIFACE_IKiface ()
 Global KIFACE_I "get" accessor. More...
 
 MY_API (KIFACE *) KIFACE_GETTER(int *aKIFACEversion
 
PGM_BASEPgm ()
 The global Program "get" accessor. More...
 

Variables

static PGM_BASEprocess
 
int aKiwayVersion
 
int PGM_BASEaProgram
 
return & kiface
 

Detailed Description

page layout editor main file.

Definition in file pl_editor.cpp.

Function Documentation

◆ CreateWindow()

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

Definition at line 150 of file pl_editor.cpp.

154  {
155  if( destFile.GetName() == aSrcProjectName )
156  destFile.SetName( aNewProjectName );
157 
158  CopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
159  }
160  else
161  {
162  wxFAIL_MSG( "Unexpected filetype for Pcbnew::SaveFileAs()" );
163  }
164 }
165 
void CopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Function CopyFile.
Definition: gestfich.cpp:362

◆ IFACE()

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

Definition at line 142 of file pl_editor.cpp.

142 {
143  wxFileName destFile( aSrcFilePath );
144  wxString destPath = destFile.GetPath();

◆ IfaceOrAddress()

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 179 of file pl_editor.cpp.

◆ Kiface()

KIFACE_I& Kiface ( )

Global KIFACE_I "get" accessor.

Definition at line 107 of file pl_editor.cpp.

107 { return kiface; }
return & kiface
Definition: pl_editor.cpp:115

References PGE::kiface().

◆ MY_API()

MY_API ( KIFACE )

◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )
override

◆ OnKifaceStart()

bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 
)
override

◆ Pgm()

PGM_BASE& Pgm ( )

The global Program "get" accessor.

Implemented in: 1) common/single_top.cpp, 2) kicad/kicad.cpp, and 3) scripting/kiway.i

Definition at line 119 of file pl_editor.cpp.

120 {
121  wxASSERT( process ); // KIFACE_GETTER has already been called.
122  return *process;
123 }
static PGM_BASE * process
Definition: pl_editor.cpp:105

References process, and program.

◆ SaveFileAs()

void kiface::SaveFileAs ( const wxString &  aProjectBasePath,
const wxString &  aSrcProjectName,
const wxString &  aNewProjectBasePath,
const wxString &  aNewProjectName,
const wxString &  aSrcFilePath,
wxString &  aErrors 
)
override

Function SaveFileAs Saving a file under a different name is delegated to the various KIFACEs because the project doesn't know the internal format of the various files (which may have paths in them that need updating).

Variable Documentation

◆ aKiwayVersion

int aKiwayVersion

Definition at line 112 of file pl_editor.cpp.

◆ aProgram

int PGM_BASE* aProgram
Initial value:
{
Class PGM_BASE keeps program (whole process) data for KiCad programs.
Definition: pgm_base.h:166
int PGM_BASE * aProgram
Definition: pl_editor.cpp:113
static PGM_BASE * process
Definition: pl_editor.cpp:105

Definition at line 113 of file pl_editor.cpp.

◆ kiface

return& kiface

Definition at line 115 of file pl_editor.cpp.

◆ process

PGM_BASE* process
static

Definition at line 105 of file pl_editor.cpp.

Referenced by Pgm().