171 changed files with 4424 additions and 2562 deletions
-
63d-viewer/3d_canvas.h
-
973d-viewer/3d_draw.cpp
-
23d-viewer/3d_frame.cpp
-
293d-viewer/vrmlmodelparser.cpp
-
23CMakeLists.txt
-
8CMakeModules/download_avhttp.cmake
-
2CMakeModules/download_boost.cmake
-
6bitmap2component/bitmap2cmp_gui.cpp
-
3common/CMakeLists.txt
-
9common/basicframe.cpp
-
17common/common_plotDXF_functions.cpp
-
13common/common_plotPDF_functions.cpp
-
37common/common_plotPS_functions.cpp
-
14common/common_plotSVG_functions.cpp
-
9common/dialog_about/dialog_about.cpp
-
5common/dialog_about/dialog_about_base.cpp
-
987common/dialog_about/dialog_about_base.fbp
-
15common/dialog_about/dialog_about_base.h
-
4common/draw_frame.cpp
-
13common/eda_text.cpp
-
4common/kiface_i.cpp
-
308common/kiway.cpp
-
60common/kiway_express.cpp
-
58common/kiway_player.cpp
-
70common/prependpath.cpp
-
19common/project.cpp
-
153common/single_top.cpp
-
2cvpcb/CMakeLists.txt
-
2cvpcb/class_DisplayFootprintsFrame.cpp
-
18cvpcb/cvframe.cpp
-
8cvpcb/cvpcb.cpp
-
3cvpcb/readwrite_dlgs.cpp
-
4eeschema/CMakeLists.txt
-
3eeschema/controle.cpp
-
99eeschema/cross-probing.cpp
-
30eeschema/eeschema.cpp
-
2eeschema/lib_pin.cpp
-
2eeschema/libeditframe.cpp
-
100eeschema/menubar.cpp
-
2eeschema/sch_base_frame.cpp
-
33eeschema/sch_field.cpp
-
2eeschema/sch_screen.cpp
-
12eeschema/sch_sheet_path.cpp
-
14eeschema/sch_sheet_path.h
-
46eeschema/schframe.cpp
-
2eeschema/sheet.cpp
-
2eeschema/viewlib_frame.cpp
-
2gerbview/CMakeLists.txt
-
2gerbview/class_gbr_screen.h
-
4gerbview/class_gerber_draw_item.h
-
8gerbview/gerbview.cpp
-
2gerbview/gerbview_frame.cpp
-
4include/base_struct.h
-
3include/class_board_design_settings.h
-
4include/class_board_item.h
-
2include/class_pcb_screen.h
-
2include/class_sch_screen.h
-
4include/common.h
-
1include/config_params.h
-
2include/draw_frame.h
-
32include/frame_type.h
-
8include/geometry/rtree.h
-
23include/kiface_i.h
-
153include/kiway.h
-
105include/kiway_express.h
-
68include/kiway_mgr.h
-
77include/kiway_player.h
-
16include/mail_type.h
-
12include/plot_common.h
-
2include/sch_base_frame.h
-
4include/sch_item_struct.h
-
4include/view/view_item.h
-
2include/wxBasePcbFrame.h
-
2include/wxEeschemaStruct.h
-
4include/wxPcbStruct.h
-
27include/wxstruct.h
-
70kicad/CMakeLists.txt
-
2kicad/commandframe.cpp
-
136kicad/kicad.cpp
-
100kicad/mainframe.cpp
-
2pagelayout_editor/CMakeLists.txt
-
8pagelayout_editor/pl_editor.cpp
-
2pagelayout_editor/pl_editor_frame.cpp
-
6pcb_calculator/pcb_calculator.cpp
-
4pcbnew/CMakeLists.txt
-
7pcbnew/autorouter/auto_place_footprints.cpp
-
2pcbnew/autorouter/autorout.h
-
90pcbnew/autorouter/graphpcb.cpp
-
28pcbnew/autorouter/routing_matrix.cpp
-
19pcbnew/autorouter/solve.cpp
-
2pcbnew/basepcbframe.cpp
-
43pcbnew/board_undo_redo.cpp
-
64pcbnew/class_board.cpp
-
12pcbnew/class_board.h
-
3pcbnew/class_drawsegment.h
-
3pcbnew/class_edge_mod.h
-
3pcbnew/class_mire.h
-
7pcbnew/class_module.cpp
-
4pcbnew/class_module.h
-
4pcbnew/class_netinfo.h
987
common/dialog_about/dialog_about_base.fbp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,60 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> |
|||
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <kiway_express.h>
|
|||
|
|||
//IMPLEMENT_DYNAMIC_CLASS( KIWAY_EXPRESS, wxEvent )
|
|||
|
|||
|
|||
#if 0 // requires that this code reside in only a single link image, rather than
|
|||
// in each of kicad.exe, _pcbnew.kiface, and _eeschema.kiface as now.
|
|||
// In the current case wxEVENT_ID will get a different value in each link
|
|||
// image. We need to put this into a shared library for common utilization,
|
|||
// I think that library should be libki.so. I am reluctant to do that now
|
|||
// because the cost will be finding libki.so at runtime, and we need infrastructure
|
|||
// to set our LIB_ENV_VAR to the proper place so libki.so can be reliably found.
|
|||
// All things in due course.
|
|||
const wxEventType KIWAY_EXPRESS::wxEVENT_ID = wxNewEventType(); |
|||
#else
|
|||
const wxEventType KIWAY_EXPRESS::wxEVENT_ID = 30000; // commmon accross all link images, hopefully unique.
|
|||
#endif
|
|||
|
|||
|
|||
KIWAY_EXPRESS::KIWAY_EXPRESS( const KIWAY_EXPRESS& anOther ) : |
|||
wxEvent( anOther ) |
|||
{ |
|||
m_destination = anOther.m_destination; |
|||
m_payload = anOther.m_payload; |
|||
} |
|||
|
|||
|
|||
KIWAY_EXPRESS::KIWAY_EXPRESS( FRAME_T aDestination, MAIL_T aCommand, |
|||
const std::string& aPayload, wxWindow* aSource ) : |
|||
wxEvent( aCommand, wxEVENT_ID ), |
|||
m_destination( aDestination ), |
|||
m_payload( aPayload ) |
|||
{ |
|||
SetEventObject( aSource ); |
|||
} |
|||
|
@ -0,0 +1,58 @@ |
|||
|
|||
|
|||
#include <kiway_player.h>
|
|||
#include <kiway_express.h>
|
|||
#include <typeinfo>
|
|||
|
|||
|
|||
BEGIN_EVENT_TABLE( KIWAY_PLAYER, EDA_BASE_FRAME ) |
|||
/* have not been able to get this to work yet:
|
|||
EVT_KIWAY_EXPRESS( KIWAY_PLAYER::kiway_express ) |
|||
Use Connect() in constructor until this can be sorted out. |
|||
|
|||
OK the problem is KIWAY_PLAYER::wxEVENT_ID not being unique accross all link images. |
|||
*/ |
|||
END_EVENT_TABLE() |
|||
|
|||
|
|||
|
|||
KIWAY_PLAYER::KIWAY_PLAYER( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, |
|||
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize, |
|||
long aStyle, const wxString& aWdoName ) : |
|||
EDA_BASE_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aWdoName ), |
|||
KIWAY_HOLDER( aKiway ) |
|||
{ |
|||
DBG( printf("KIWAY_EXPRESS::wxEVENT_ID:%d\n", KIWAY_EXPRESS::wxEVENT_ID );) |
|||
Connect( KIWAY_EXPRESS::wxEVENT_ID, wxKiwayExressHandler( KIWAY_PLAYER::kiway_express ) ); |
|||
} |
|||
|
|||
|
|||
KIWAY_PLAYER::KIWAY_PLAYER( wxWindow* aParent, wxWindowID aId, const wxString& aTitle, |
|||
const wxPoint& aPos, const wxSize& aSize, long aStyle, |
|||
const wxString& aWdoName ) : |
|||
EDA_BASE_FRAME( aParent, (FRAME_T) aId, aTitle, aPos, aSize, aStyle, aWdoName ), |
|||
KIWAY_HOLDER( 0 ) |
|||
{ |
|||
DBG( printf("KIWAY_EXPRESS::wxEVENT_ID:%d\n", KIWAY_EXPRESS::wxEVENT_ID );) |
|||
Connect( KIWAY_EXPRESS::wxEVENT_ID, wxKiwayExressHandler( KIWAY_PLAYER::kiway_express ) ); |
|||
} |
|||
|
|||
|
|||
void KIWAY_PLAYER::kiway_express( KIWAY_EXPRESS& aEvent ) |
|||
{ |
|||
// logging support
|
|||
#if defined(DEBUG)
|
|||
const char* class_name = typeid(this).name(); |
|||
|
|||
printf( "%s: cmd:%d pay:'%s'\n", class_name, |
|||
aEvent.GetEventType(), aEvent.GetPayload().c_str() ); |
|||
#endif
|
|||
|
|||
KiwayMailIn( aEvent ); // call the virtual, overload in derived.
|
|||
} |
|||
|
|||
|
|||
void KIWAY_PLAYER::KiwayMailIn( KIWAY_EXPRESS& aEvent ) |
|||
{ |
|||
// overload this.
|
|||
} |
@ -0,0 +1,70 @@ |
|||
|
|||
#include <macros.h>
|
|||
#include <fctsys.h>
|
|||
#include <wx/filename.h>
|
|||
|
|||
|
|||
|
|||
#if !wxCHECK_VERSION( 3, 0, 0 )
|
|||
|
|||
// implement missing wx2.8 function until >= wx3.0 pervades.
|
|||
static wxString wxJoin(const wxArrayString& arr, const wxChar sep, |
|||
const wxChar escape = '\\') |
|||
{ |
|||
size_t count = arr.size(); |
|||
if ( count == 0 ) |
|||
return wxEmptyString; |
|||
|
|||
wxString str; |
|||
|
|||
// pre-allocate memory using the estimation of the average length of the
|
|||
// strings in the given array: this is very imprecise, of course, but
|
|||
// better than nothing
|
|||
str.reserve(count*(arr[0].length() + arr[count-1].length()) / 2); |
|||
|
|||
if ( escape == wxT('\0') ) |
|||
{ |
|||
// escaping is disabled:
|
|||
for ( size_t i = 0; i < count; i++ ) |
|||
{ |
|||
if ( i ) |
|||
str += sep; |
|||
str += arr[i]; |
|||
} |
|||
} |
|||
else // use escape character
|
|||
{ |
|||
for ( size_t n = 0; n < count; n++ ) |
|||
{ |
|||
if ( n ) |
|||
str += sep; |
|||
|
|||
for ( wxString::const_iterator i = arr[n].begin(), |
|||
end = arr[n].end(); |
|||
i != end; |
|||
++i ) |
|||
{ |
|||
const wxChar ch = *i; |
|||
if ( ch == sep ) |
|||
str += escape; // escape this separator
|
|||
str += ch; |
|||
} |
|||
} |
|||
} |
|||
|
|||
str.Shrink(); // release extra memory if we allocated too much
|
|||
return str; |
|||
} |
|||
#endif
|
|||
|
|||
|
|||
/// Put aPriorityPath in front of all paths in the value of aEnvVar.
|
|||
const wxString PrePendPath( const wxString& aEnvVar, const wxString& aPriorityPath ) |
|||
{ |
|||
wxPathList paths; |
|||
|
|||
paths.AddEnvList( aEnvVar ); |
|||
paths.Insert( aPriorityPath, 0 ); |
|||
|
|||
return wxJoin( paths, wxPATH_SEP[0] ); |
|||
} |
@ -0,0 +1,32 @@ |
|||
#ifndef FRAME_T_H_ |
|||
#define FRAME_T_H_ |
|||
|
|||
/** |
|||
* Enum FRAME_T |
|||
* is the set of EDA_BASE_FRAME derivatives, typically stored in |
|||
* EDA_BASE_FRAME::m_Ident. |
|||
*/ |
|||
enum FRAME_T |
|||
{ |
|||
FRAME_SCH, |
|||
FRAME_SCH_LIB_EDITOR, |
|||
FRAME_SCH_VIEWER, |
|||
FRAME_PCB, |
|||
FRAME_PCB_MODULE_EDITOR, |
|||
FRAME_PCB_MODULE_VIEWER, |
|||
FRAME_PCB_FOOTPRINT_WIZARD, |
|||
FRAME_PCB_DISPLAY3D, |
|||
FRAME_CVPCB, |
|||
FRAME_CVPCB_DISPLAY, |
|||
FRAME_GERBER, |
|||
|
|||
KIWAY_PLAYER_COUNT, // counts subset of FRAME_T's tracked in class KIWAY |
|||
|
|||
KICAD_MAIN_FRAME_T = KIWAY_PLAYER_COUNT, |
|||
FRAME_PL_EDITOR, |
|||
//TEXT_EDITOR_FRAME_T, |
|||
|
|||
FRAME_T_COUNT |
|||
}; |
|||
|
|||
#endif // FRAME_T_H_ |
@ -0,0 +1,105 @@ |
|||
#ifndef KIWAY_EXPRESS_H_ |
|||
#define KIWAY_EXPRESS_H_ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> |
|||
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
// @see http://wiki.wxwidgets.org/Custom_Events_Tutorial |
|||
|
|||
#include <wx/wx.h> |
|||
#include <frame_type.h> |
|||
#include <mail_type.h> |
|||
|
|||
|
|||
/** |
|||
* Class KIWAY_EXPRESS |
|||
* carries a payload from one KIWAY_PLAYER to another within a PROJECT. |
|||
*/ |
|||
class KIWAY_EXPRESS : public wxEvent |
|||
{ |
|||
public: |
|||
/** |
|||
* Function Dest |
|||
* returns the destination player id of the message. |
|||
*/ |
|||
FRAME_T Dest() { return m_destination; } |
|||
|
|||
/** |
|||
* Function Command |
|||
* returns the MAIL_T associated with this mail. |
|||
*/ |
|||
MAIL_T Command() |
|||
{ |
|||
return (MAIL_T) GetId(); // re-purposed control id. |
|||
} |
|||
|
|||
/** |
|||
* Function Payload |
|||
* returns the payload, which can be any text but it typicall self |
|||
* identifying s-expression. |
|||
*/ |
|||
const std::string& GetPayload() { return m_payload; } |
|||
void SetPayload( const std::string& aPayload ) { m_payload = aPayload; } |
|||
|
|||
KIWAY_EXPRESS* Clone() const { return new KIWAY_EXPRESS( *this ); } |
|||
|
|||
//KIWAY_EXPRESS() {} |
|||
|
|||
KIWAY_EXPRESS( FRAME_T aDestination, |
|||
MAIL_T aCommand, |
|||
const std::string& aPayload, |
|||
wxWindow* aSource = NULL ); |
|||
|
|||
KIWAY_EXPRESS( const KIWAY_EXPRESS& anOther ); |
|||
|
|||
/// The wxEventType argument to wxEvent() and identifies an event class |
|||
/// in a hurry. These wxEventTypes also allow a common class to be used |
|||
/// multiple ways. Should be allocated at startup by wxNewEventType(); |
|||
static const wxEventType wxEVENT_ID; |
|||
|
|||
//DECLARE_DYNAMIC_CLASS( KIWAY_EXPRESS ) |
|||
|
|||
private: |
|||
FRAME_T m_destination; ///< could have been a bitmap indicating multiple recipients |
|||
std::string m_payload; ///< very often s-expression text, but not always |
|||
|
|||
// possible new ideas here. |
|||
}; |
|||
|
|||
|
|||
typedef void ( wxEvtHandler::*kiwayExpressFunction )( KIWAY_EXPRESS& ); |
|||
|
|||
#define wxKiwayExressHandler(func) \ |
|||
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(kiwayExpressFunction, &func) |
|||
|
|||
|
|||
#define EVT_KIWAY_EXPRESS( func ) \ |
|||
DECLARE_EVENT_TABLE_ENTRY( \ |
|||
KIWAY_EXPRESS::wxEVENT_ID, -1, -1, \ |
|||
(wxObjectEventFunction) \ |
|||
(kiwayExpressFunction) & func, \ |
|||
(wxObject*) NULL ), |
|||
|
|||
|
|||
#endif // KIWAY_EXPRESS_H_ |
|||
|
@ -0,0 +1,68 @@ |
|||
|
|||
#ifndef KIWAY_MGR_H_ |
|||
#define KIWAY_MGR_H_ |
|||
|
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> |
|||
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
|
|||
#include <kiway.h> |
|||
#include <boost/ptr_container/ptr_vector.hpp> |
|||
|
|||
|
|||
/** |
|||
* Class KIWAY_MGR |
|||
* is a container for all KIWAYS [and PROJECTS]. This class needs to work both |
|||
* for a C++ project manager and an a wxPython one (after being moved into a |
|||
* header later). |
|||
*/ |
|||
class KIWAY_MGR |
|||
{ |
|||
public: |
|||
//KIWAY_MGR(); |
|||
// ~KIWAY_MGR(); |
|||
|
|||
bool OnStart( wxApp* aProcess ); |
|||
|
|||
void OnEnd(); |
|||
|
|||
KIWAY& operator[]( int aIndex ) |
|||
{ |
|||
wxASSERT( m_kiways.size() ); // stuffed in OnStart() |
|||
return m_kiways[aIndex]; |
|||
} |
|||
|
|||
private: |
|||
|
|||
// KIWAYs may not be moved once doled out, since window DNA depends on the |
|||
// pointer being good forever. |
|||
// boost_ptr::vector however never moves the object pointed to. |
|||
typedef boost::ptr_vector<KIWAY> KIWAYS; |
|||
|
|||
KIWAYS m_kiways; |
|||
}; |
|||
|
|||
extern KIWAY_MGR Kiways; |
|||
|
|||
#endif // KIWAY_MGR_H_ |
@ -0,0 +1,16 @@ |
|||
#ifndef MAIL_TYPE_H_ |
|||
#define MAIL_TYPE_H_ |
|||
|
|||
/** |
|||
* Enum MAIL_T |
|||
* is the set of mail types sendable via KIWAY::ExpressMail() and supplied as |
|||
* the @a aCommand parameter to that function. Such mail will be received in |
|||
* KIWAY_PLAYER::KiwayMailIn( KIWAY_EXPRESS& aEvent ) and aEvent.Command() will |
|||
* match aCommand to KIWAY::ExpressMail(). |
|||
*/ |
|||
enum MAIL_T |
|||
{ |
|||
MAIL_CROSS_PROBE, ///< PCB<->SCH, CVPCB->SCH cross-probing. |
|||
}; |
|||
|
|||
#endif // MAIL_TYPE_H_ |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue