Commit 4f26386e authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

Initial KIWAY (modular-kicad) work. Various tweeks.

parent 63bc40b5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line

# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
if( DEFINED CMAKE_BUILD_TYPE )
    set( CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Set to either \"Release\" or \"Debug\"" )
else()
    set( CMAKE_BUILD_TYPE Release CACHE STRING "Set to either \"Release\" or \"Debug\"" )
endif()

project( kicad )

cmake_minimum_required( VERSION 2.8.4 FATAL_ERROR )
+3 −0
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@
/// When defined, build the GITHUB_PLUGIN for pcbnew.
#cmakedefine BUILD_GITHUB_PLUGIN

/// When defined, use KIWAY and DSOs
#cmakedefine USE_KIWAY_DLLS

/// Name of repo from which this build came.
#define KICAD_REPO_NAME                 "@KICAD_REPO_NAME@"

+1 −1
Original line number Diff line number Diff line
@@ -548,6 +548,6 @@ bool EDA_APP::OnInit()
}


void EDA_APP::MacOpenFile(const wxString &fileName)
void EDA_APP::MacOpenFile( const wxString& aFileName )
{
}
+1 −10
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ set( COMMON_SRCS
    hotkeys_basic.cpp
    hotkey_grid_table.cpp
    html_messagebox.cpp
    kiway.cpp
    msgpanel.cpp
    netlist_keywords.cpp
    newstroke_font.cpp
@@ -177,16 +178,6 @@ set( COMMON_SRCS
)


# TODO: remove this whole "if test" on or after 14-Jan-2014 and remove the system/*.s
# sources if no one complains by then.
# boost::context library replaces this functionality:
if( false )
    enable_language( C CXX ASM )
    set_source_files_properties( system/fcontext.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp" )
    list( APPEND COMMON_SRCS system/fcontext.s )
endif()


add_library( common STATIC ${COMMON_SRCS} )

set( PCB_COMMON_SRCS

common/kiway.cpp

0 → 100644
+95 −0
Original line number Diff line number Diff line
/*
 * 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 <wx/debug.h>
#include <string.h>

// one for each FACE_T
wxDynamicLibrary KIWAY::s_sch_dso;
wxDynamicLibrary KIWAY::s_pcb_dso;


KIWAY::KIWAY()
{
    memset( &m_dso_players, 0, sizeof( m_dso_players ) );
}


const wxString KIWAY::dso_name( FACE_T aFaceId )
{
    switch( aFaceId )
    {
    case FACE_SCH:  return wxT( "_eeschema." ) DSO_EXT;
    case FACE_PCB:  return wxT( "_pcbnew."   ) DSO_EXT;

    default:
        wxASSERT_MSG( 0, wxT( "caller has a bug, passed a bad aFaceId" ) );
        return wxEmptyString;
    }
}


PROJECT& KIWAY::Project()
{
    return m_project;
}


KIFACE*  KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
{
    switch( aFaceId )
    {
    case FACE_SCH:
    case FACE_PCB:
    //case FACE_LIB:
    //case FACE_MOD:
        if( m_dso_players[aFaceId] )
            return m_dso_players[aFaceId];

    default:
        wxASSERT_MSG( 0, wxT( "caller has a bug, passed a bad aFaceId" ) );
        return NULL;
    }

    // DSO with KIFACE has not been loaded yet, does user want to load it?
    if( doLoad  )
    {
        switch( aFaceId )
        {
        case FACE_SCH:
            break;

        case FACE_PCB:
            break;

        //case FACE_LIB:
        //case FACE_MOD:
        default:
            ;
        }
    }

    return NULL;
}
Loading