Move executable name constants to own file

The executable name constants are only used by two files, they do not
have to be in common.h.

Also converted to const wxString for better type-safety and removed
old-style wxT macros.
This commit is contained in:
John Beard 2017-02-09 17:36:38 +08:00 committed by Wayne Stambaugh
parent ece7eeb280
commit e98ae3e463
7 changed files with 92 additions and 20 deletions

View File

@ -241,6 +241,7 @@ set( COMMON_SRCS
eda_doc.cpp
eda_pattern_match.cpp
exceptions.cpp
executable_names.cpp
filter_reader.cpp
lib_id.cpp
lib_table_keywords.cpp

View File

@ -0,0 +1,46 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.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 <executable_names.h>
// TODO Executable names TODO
#ifdef __WINDOWS__
const wxString CVPCB_EXE ( "cvpcb.exe" );
const wxString PCBNEW_EXE ( "pcbnew.exe" );
const wxString EESCHEMA_EXE ( "eeschema.exe" );
const wxString GERBVIEW_EXE ( "gerbview.exe" );
const wxString BITMAPCONVERTER_EXE ( "bitmap2component.exe" );
const wxString PCB_CALCULATOR_EXE ( "pcb_calculator.exe" );
const wxString PL_EDITOR_EXE ( "pl_editor.exe" );
#else
const wxString CVPCB_EXE ( "cvpcb" );
const wxString PCBNEW_EXE ( "pcbnew" );
const wxString EESCHEMA_EXE ( "eeschema" );
const wxString GERBVIEW_EXE ( "gerbview" );
const wxString BITMAPCONVERTER_EXE ( "bitmap2component" );
const wxString PCB_CALCULATOR_EXE ( "pcb_calculator" );
const wxString PL_EDITOR_EXE ( "pl_editor" );
#endif

View File

@ -36,6 +36,7 @@
#include <base_units.h>
#include <msgpanel.h>
#include <html_messagebox.h>
#include <executable_names.h>
#include <general.h>
#include <eeschema_id.h>

View File

@ -86,26 +86,6 @@ enum pseudokeys {
#define ESC 27
// TODO Executable names TODO
#ifdef __WINDOWS__
#define CVPCB_EXE wxT( "cvpcb.exe" )
#define PCBNEW_EXE wxT( "pcbnew.exe" )
#define EESCHEMA_EXE wxT( "eeschema.exe" )
#define GERBVIEW_EXE wxT( "gerbview.exe" )
#define BITMAPCONVERTER_EXE wxT( "bitmap2component.exe" )
#define PCB_CALCULATOR_EXE wxT( "pcb_calculator.exe" )
#define PL_EDITOR_EXE wxT( "pl_editor.exe" )
#else
#define CVPCB_EXE wxT( "cvpcb" )
#define PCBNEW_EXE wxT( "pcbnew" )
#define EESCHEMA_EXE wxT( "eeschema" )
#define GERBVIEW_EXE wxT( "gerbview" )
#define BITMAPCONVERTER_EXE wxT( "bitmap2component" )
#define PCB_CALCULATOR_EXE wxT( "pcb_calculator" )
#define PL_EDITOR_EXE wxT( "pl_editor" )
#endif
/// Frequent text rotations, used with {Set,Get}TextAngle(),
/// in 0.1 degrees for now, hoping to migrate to degrees eventually.
#define TEXT_ANGLE_HORIZ 0

View File

@ -0,0 +1,42 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 KiCad Developers, see AUTHORS.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
*/
/**
* KiCad executable names
* @file executable_names.h
*/
#ifndef INCLUDE__EXECUTABLE_NAMES_H_
#define INCLUDE__EXECUTABLE_NAMES_H_
#include <wx/string.h>
extern const wxString CVPCB_EXE;
extern const wxString PCBNEW_EXE;
extern const wxString EESCHEMA_EXE;
extern const wxString GERBVIEW_EXE;
extern const wxString BITMAPCONVERTER_EXE;
extern const wxString PCB_CALCULATOR_EXE;
extern const wxString PL_EDITOR_EXE;
#endif // INCLUDE__EXECUTABLE_NAMES_H_

View File

@ -32,6 +32,7 @@
#include <wx/regex.h>
#include <gestfich.h>
#include <executable_names.h>
#include "class_treeprojectfiles.h"
#include "pgm_kicad.h"

View File

@ -36,6 +36,7 @@
#include <kiway_player.h>
#include <wildcards_and_files_ext.h>
#include <bitmaps.h>
#include <executable_names.h>
#include "pgm_kicad.h"
#include "tree_project_frame.h"