Minor cleanups and improvements
Just a set of small code cleanups to fix a bunch of warnings and remove dead code. Other than that the 'build:' commits avoid/remove/fix the installation of certain files: - it doesn't make much sense to install the INSTALL.txt - *.bat scripts shouldn't be installed on UNIX systems - use CMAKE_INSTALL_* consistently to install files in the correct places
This commit is contained in:
commit
d8f4e35c9a
|
@ -35,6 +35,6 @@ namespace S3D
|
|||
wxString& prevModelSelectDir, int& prevModelWildcard, MODULE_3D_SETTINGS* aModel );
|
||||
|
||||
bool Configure3DPaths( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver );
|
||||
};
|
||||
}
|
||||
|
||||
#endif // CACHE_DIALOGS_3D_H
|
||||
|
|
|
@ -362,7 +362,7 @@ bool S3D::degenerate( glm::dvec3* pts )
|
|||
return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static void calcTriad( glm::dvec3* pts, glm::dvec3& tri )
|
||||
|
|
|
@ -242,6 +242,6 @@ namespace S3D
|
|||
|
||||
// read an RGB color
|
||||
bool ReadColor( std::istream& aFile, SGCOLOR& aColor );
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SG_HELPERS_H
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace S3D
|
|||
|
||||
void FREE_SMESH( SMESH& aMesh);
|
||||
void FREE_S3DMODEL( S3DMODEL& aModel );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,6 +82,6 @@ namespace S3D
|
|||
}
|
||||
};
|
||||
|
||||
}; // end NAMESPACE
|
||||
} // end NAMESPACE
|
||||
|
||||
#endif // STR_RSORT_H
|
||||
|
|
|
@ -161,7 +161,7 @@ class EDA_3D_CANVAS : public wxGLCanvas
|
|||
|
||||
void OnTimerTimeout_Redraw( wxTimerEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ private:
|
|||
|
||||
void OnRightClick( wxMouseEvent &event );
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -222,7 +222,7 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER
|
|||
*/
|
||||
void RenderEngineChanged();
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -376,9 +376,9 @@ if( NOT APPLE )
|
|||
CACHE PATH "Location of KiCad user-loaded plugins" )
|
||||
endif()
|
||||
|
||||
set( KICAD_DATA share/kicad
|
||||
set( KICAD_DATA ${CMAKE_INSTALL_DATADIR}/kicad
|
||||
CACHE PATH "Location of KiCad data files." )
|
||||
set( KICAD_DOCS share/doc/kicad
|
||||
set( KICAD_DOCS ${CMAKE_INSTALL_DATADIR}/doc/kicad
|
||||
CACHE PATH "Location of KiCad documentation files." )
|
||||
set( KICAD_DEMOS ${KICAD_DATA}/demos
|
||||
CACHE PATH "Location of KiCad demo files." )
|
||||
|
@ -689,14 +689,6 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
|||
|
||||
endif()
|
||||
|
||||
if( EXISTS ${CMAKE_SOURCE_DIR}/include/config.h )
|
||||
# This file may exist ( created by an alternate process to the svn test above),
|
||||
# e.g. could be created by a checkout script that produces a source tar file.
|
||||
# This directive means the about box will have the svn date & revision in it,
|
||||
# but the hard coded release date ( program version) will be preserved.
|
||||
add_definitions( -DHAVE_SVN_REVISION )
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
# Remove app bundles in ${KICAD_BIN} before installing anything new.
|
||||
# Must be defined before all includes so that it is executed first.
|
||||
|
@ -771,10 +763,6 @@ add_custom_target( uninstall
|
|||
# Installation
|
||||
#================================================
|
||||
|
||||
install( FILES INSTALL.txt
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources )
|
||||
|
||||
###
|
||||
# Install scripts
|
||||
###
|
||||
|
@ -782,6 +770,7 @@ if( UNIX )
|
|||
install( DIRECTORY scripts
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources
|
||||
PATTERN "*.bat" EXCLUDE
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId,
|
|||
aMenu->Append( item );
|
||||
|
||||
return item;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId,
|
||||
|
@ -153,4 +153,4 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId,
|
|||
aMenu->Append( item );
|
||||
|
||||
return item;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <common.h>
|
||||
#include <base_struct.h>
|
||||
|
||||
#include <base_struct.h>
|
||||
#include <class_undoredo_container.h>
|
||||
|
||||
|
@ -180,8 +178,8 @@ EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx ) const
|
|||
{
|
||||
if( aIdx < m_ItemsList.size() )
|
||||
return m_ItemsList[aIdx].GetItem();
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -189,8 +187,8 @@ EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItemLink( unsigned int aIdx ) const
|
|||
{
|
||||
if( aIdx < m_ItemsList.size() )
|
||||
return m_ItemsList[aIdx].GetLink();
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -198,8 +196,8 @@ UNDO_REDO_T PICKED_ITEMS_LIST::GetPickedItemStatus( unsigned int aIdx ) const
|
|||
{
|
||||
if( aIdx < m_ItemsList.size() )
|
||||
return m_ItemsList[aIdx].GetStatus();
|
||||
else
|
||||
return UR_UNSPECIFIED;
|
||||
|
||||
return UR_UNSPECIFIED;
|
||||
}
|
||||
|
||||
|
||||
|
@ -207,8 +205,8 @@ STATUS_FLAGS PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx ) const
|
|||
{
|
||||
if( aIdx < m_ItemsList.size() )
|
||||
return m_ItemsList[aIdx].GetFlags();
|
||||
else
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -219,8 +217,8 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, unsigned aIdx )
|
|||
m_ItemsList[aIdx].SetItem( aItem );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,8 +229,8 @@ bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_ITEM* aLink, unsigned aIdx )
|
|||
m_ItemsList[aIdx].SetLink( aLink );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -244,8 +242,8 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, UNDO_REDO_T aStatus, uns
|
|||
m_ItemsList[aIdx].SetStatus( aStatus );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -256,8 +254,8 @@ bool PICKED_ITEMS_LIST::SetPickedItemStatus( UNDO_REDO_T aStatus, unsigned aIdx
|
|||
m_ItemsList[aIdx].SetStatus( aStatus );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -268,8 +266,8 @@ bool PICKED_ITEMS_LIST::SetPickerFlags( STATUS_FLAGS aFlags, unsigned aIdx )
|
|||
m_ItemsList[aIdx].SetFlags( aFlags );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,6 +275,7 @@ bool PICKED_ITEMS_LIST::RemovePicker( unsigned aIdx )
|
|||
{
|
||||
if( aIdx >= m_ItemsList.size() )
|
||||
return false;
|
||||
|
||||
m_ItemsList.erase( m_ItemsList.begin() + aIdx );
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -934,7 +934,7 @@ ECONNECT::ECONNECT( wxXmlNode* aConnect )
|
|||
gate = parseRequiredAttribute<string>( aConnect, "gate" );
|
||||
pin = parseRequiredAttribute<string>( aConnect, "pin" );
|
||||
pad = parseRequiredAttribute<string>( aConnect, "pad" );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
EDEVICE::EDEVICE( wxXmlNode* aDevice )
|
||||
|
@ -957,7 +957,7 @@ EDEVICE::EDEVICE( wxXmlNode* aDevice )
|
|||
connectNode = connectNode->GetNext();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet )
|
||||
|
|
|
@ -202,7 +202,7 @@ struct APP_SINGLE_TOP : public wxApp
|
|||
#endif
|
||||
};
|
||||
|
||||
IMPLEMENT_APP( APP_SINGLE_TOP );
|
||||
IMPLEMENT_APP( APP_SINGLE_TOP )
|
||||
|
||||
|
||||
bool PGM_SINGLE_TOP::OnPgmInit()
|
||||
|
|
|
@ -1397,4 +1397,4 @@ void VIEW::Update( VIEW_ITEM* aItem, int aUpdateFlags )
|
|||
|
||||
const int VIEW::TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1288,13 +1288,13 @@ mpScaleXBase::mpScaleXBase( wxString name, int flags, bool ticks, unsigned int t
|
|||
mpScaleX::mpScaleX( wxString name, int flags, bool ticks, unsigned int type ) :
|
||||
mpScaleXBase( name, flags, ticks, type )
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
mpScaleXLog::mpScaleXLog( wxString name, int flags, bool ticks, unsigned int type ) :
|
||||
mpScaleXBase( name, flags, ticks, type )
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
||||
|
@ -2701,7 +2701,7 @@ void mpWindow::SetMPScrollbars( bool status )
|
|||
//// SetVirtualSize((int) (m_maxX - m_minX), (int) (m_maxY - m_minY));
|
||||
// }
|
||||
// Refresh(false);*/
|
||||
};
|
||||
}
|
||||
|
||||
bool mpWindow::UpdateBBox()
|
||||
{
|
||||
|
|
|
@ -1,142 +0,0 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 CERN
|
||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* 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 "wxunittext.h"
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <limits>
|
||||
#include <base_units.h>
|
||||
#include <wx/valnum.h>
|
||||
#include <core/optional.h>
|
||||
|
||||
WX_UNIT_TEXT::WX_UNIT_TEXT( wxWindow* aParent, const wxString& aLabel, double aValue, double aStep ) :
|
||||
wxPanel( aParent, wxID_ANY ),
|
||||
m_step( aStep )
|
||||
{
|
||||
// Use the currently selected units
|
||||
m_units = g_UserUnit;
|
||||
|
||||
wxBoxSizer* sizer;
|
||||
sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
// Helper label
|
||||
m_inputLabel = new wxStaticText( this, wxID_ANY, aLabel,
|
||||
wxDefaultPosition, wxDefaultSize, 0 );
|
||||
wxSize size = m_inputLabel->GetMinSize();
|
||||
size.SetWidth( 150 );
|
||||
m_inputLabel->SetMinSize( size );
|
||||
sizer->Add( m_inputLabel, 1, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 5 );
|
||||
|
||||
// Main input control
|
||||
m_inputValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER );
|
||||
|
||||
SetValue( aValue );
|
||||
sizer->Add( m_inputValue, 0, wxALIGN_CENTER_VERTICAL | wxALL );
|
||||
|
||||
wxFloatingPointValidator<double> validator( 4, NULL, wxNUM_VAL_NO_TRAILING_ZEROES );
|
||||
validator.SetRange( 0.0, std::numeric_limits<double>::max() );
|
||||
m_inputValue->SetValidator( validator );
|
||||
|
||||
// Spin buttons for modifying values using the mouse
|
||||
m_spinButton = new wxSpinButton( this, wxID_ANY );
|
||||
m_spinButton->SetRange( std::numeric_limits<int>::min(), std::numeric_limits<int>::max() );
|
||||
|
||||
m_spinButton->SetCanFocus( false );
|
||||
sizer->Add( m_spinButton, 0, wxALIGN_CENTER_VERTICAL | wxALL );
|
||||
|
||||
Connect( wxEVT_SPIN_UP, wxSpinEventHandler( WX_UNIT_TEXT::onSpinUpEvent ), NULL, this );
|
||||
Connect( wxEVT_SPIN_DOWN, wxSpinEventHandler( WX_UNIT_TEXT::onSpinDownEvent ), NULL, this );
|
||||
|
||||
sizer->AddSpacer( 5 );
|
||||
|
||||
// Create units label
|
||||
m_unitLabel = new wxStaticText( this, wxID_ANY, GetUnitsLabel( g_UserUnit ),
|
||||
wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sizer->Add( m_unitLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL );
|
||||
|
||||
SetSizer( sizer );
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
WX_UNIT_TEXT::~WX_UNIT_TEXT()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void WX_UNIT_TEXT::SetUnits( EDA_UNITS_T aUnits, bool aConvert )
|
||||
{
|
||||
assert( !aConvert ); // TODO conversion does not work yet
|
||||
|
||||
m_unitLabel->SetLabel( GetUnitsLabel( g_UserUnit ) );
|
||||
}
|
||||
|
||||
|
||||
void WX_UNIT_TEXT::SetValue( double aValue )
|
||||
{
|
||||
if( aValue >= 0.0 )
|
||||
{
|
||||
m_inputValue->SetValue( wxString( Double2Str( aValue ).c_str(), wxConvUTF8 ) );
|
||||
m_inputValue->MarkDirty();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_inputValue->SetValue( DEFAULT_VALUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OPT<double> WX_UNIT_TEXT::GetValue() const
|
||||
{
|
||||
wxString text = m_inputValue->GetValue();
|
||||
double value;
|
||||
|
||||
if( text == DEFAULT_VALUE )
|
||||
return OPT<double>( -1.0 );
|
||||
|
||||
if( !text.ToDouble( &value ) )
|
||||
return OPT<double>();
|
||||
|
||||
return OPT<double>( value );
|
||||
}
|
||||
|
||||
|
||||
void WX_UNIT_TEXT::onSpinUpEvent( wxSpinEvent& aEvent )
|
||||
{
|
||||
SetValue( *GetValue() + m_step );
|
||||
}
|
||||
|
||||
|
||||
void WX_UNIT_TEXT::onSpinDownEvent( wxSpinEvent& aEvent )
|
||||
{
|
||||
double newValue = *GetValue() - m_step;
|
||||
|
||||
if( newValue >= 0.0 )
|
||||
SetValue( newValue );
|
||||
}
|
||||
|
||||
|
||||
const wxString WX_UNIT_TEXT::DEFAULT_VALUE = _( "default ");
|
|
@ -72,7 +72,7 @@ struct BOM_PLUGIN
|
|||
*/
|
||||
WX_DECLARE_OBJARRAY( BOM_PLUGIN, BOM_PLUGIN_ARRAY );
|
||||
#include <wx/arrimpl.cpp>
|
||||
WX_DEFINE_OBJARRAY( BOM_PLUGIN_ARRAY );
|
||||
WX_DEFINE_OBJARRAY( BOM_PLUGIN_ARRAY )
|
||||
|
||||
/**
|
||||
* Class BOM_CFG_READER_PARSER
|
||||
|
|
|
@ -101,4 +101,4 @@ BITMAP_DEF GetBitmap( GRAPHIC_PINSHAPE shape )
|
|||
|
||||
assert( !"Invalid pin shape" );
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ static const wxChar* plot_sheet_list( int aSize )
|
|||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth()
|
||||
|
|
|
@ -172,4 +172,4 @@ void SCH_IO_MGR::Save( SCH_FILE_T aFileType, const wxString& aFileName,
|
|||
}
|
||||
|
||||
|
||||
DECLARE_ENUM_VECTOR( SCH_IO_MGR, SCH_FILE_T );
|
||||
DECLARE_ENUM_VECTOR( SCH_IO_MGR, SCH_FILE_T )
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
// ALTIUM,
|
||||
// etc.
|
||||
} );
|
||||
} )
|
||||
|
||||
/**
|
||||
* Return a #SCH_PLUGIN which the caller can use to import, export, save, or load
|
||||
|
|
|
@ -40,13 +40,6 @@
|
|||
|
||||
const wxString traceFindItem = wxT( "KICAD_TRACE_FIND_ITEM" );
|
||||
|
||||
|
||||
bool sort_schematic_items( const SCH_ITEM* aItem1, const SCH_ITEM* aItem2 )
|
||||
{
|
||||
return *aItem1 < *aItem2;
|
||||
}
|
||||
|
||||
|
||||
/* Constructor and destructor for SCH_ITEM */
|
||||
/* They are not inline because this creates problems with gcc at linking time
|
||||
* in debug mode
|
||||
|
|
|
@ -427,8 +427,4 @@ private:
|
|||
virtual bool doIsConnected( const wxPoint& aPosition ) const { return false; }
|
||||
};
|
||||
|
||||
|
||||
extern bool sort_schematic_items( const SCH_ITEM* aItem1, const SCH_ITEM* aItem2 );
|
||||
|
||||
|
||||
#endif /* SCH_ITEM_STRUCT_H */
|
||||
|
|
|
@ -66,9 +66,6 @@ static double SchematicZoomList[] =
|
|||
13.0, 16.0, 20.0, 26.0, 32.0, 48.0, 64.0, 80.0, 128.0
|
||||
};
|
||||
|
||||
#define MM_TO_SCH_UNITS 1000.0 / 25.4 //schematic internal unites are mils
|
||||
|
||||
|
||||
/* Default grid sizes for the schematic editor.
|
||||
* Do NOT add others values (mainly grid values in mm), because they
|
||||
* can break the schematic: Because wires and pins are considered as
|
||||
|
|
|
@ -46,7 +46,7 @@ class GBR_DISPLAY_OPTIONS;
|
|||
namespace KIGFX
|
||||
{
|
||||
class VIEW;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/* Shapes id for basic shapes ( .m_Shape member ) */
|
||||
|
|
|
@ -367,7 +367,7 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
|||
/*
|
||||
* Virtual Function useAlternateBitmap
|
||||
* return true if bitmaps shown in Render layer list
|
||||
* must be alternate bitmap (when a gerber iùmage is loaded), or false to use "normal" bitmap
|
||||
* must be alternate bitmap (when a gerber image is loaded), or false to use "normal" bitmap
|
||||
*/
|
||||
bool GERBER_LAYER_WIDGET::useAlternateBitmap(int aRow)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ class WX_VIEW_CONTROLS;
|
|||
class VIEW_CONTROLS;
|
||||
class PAINTER;
|
||||
class GAL_DISPLAY_OPTIONS;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
class EDA_DRAW_PANEL_GAL : public wxScrolledCanvas
|
||||
|
|
|
@ -28,19 +28,7 @@
|
|||
|
||||
|
||||
#ifndef SWIG
|
||||
#include <cstdio>
|
||||
|
||||
template<typename T>
|
||||
struct remove_pointer
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct remove_pointer<T*>
|
||||
{
|
||||
typedef typename remove_pointer<T>::type type;
|
||||
};
|
||||
#include <type_traits>
|
||||
|
||||
/**
|
||||
* Function IsA()
|
||||
|
@ -52,13 +40,13 @@ struct remove_pointer<T*>
|
|||
template <class T, class I>
|
||||
bool IsA( const I* aObject )
|
||||
{
|
||||
return aObject && remove_pointer<T>::type::ClassOf( aObject );
|
||||
return aObject && std::remove_pointer<T>::type::ClassOf( aObject );
|
||||
}
|
||||
|
||||
template <class T, class I>
|
||||
bool IsA( const I& aObject )
|
||||
{
|
||||
return remove_pointer<T>::type::ClassOf( &aObject );
|
||||
return std::remove_pointer<T>::type::ClassOf( &aObject );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,10 +60,10 @@ bool IsA( const I& aObject )
|
|||
template<class Casted, class From>
|
||||
Casted dyn_cast( From aObject )
|
||||
{
|
||||
if( remove_pointer<Casted>::type::ClassOf ( aObject ) )
|
||||
if( std::remove_pointer<Casted>::type::ClassOf ( aObject ) )
|
||||
return static_cast<Casted>( aObject );
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class EDA_ITEM;
|
||||
|
|
|
@ -822,7 +822,7 @@ bool RTREE_QUAL::Load( const char* a_fileName )
|
|||
stream.Close();
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
RTREE_TEMPLATE
|
||||
|
|
|
@ -193,6 +193,6 @@ namespace S3D
|
|||
* creates and initializes an SMESH struct
|
||||
*/
|
||||
SGLIB_API void Init3DMesh( SMESH& aMesh );
|
||||
};
|
||||
}
|
||||
|
||||
#endif // IFSG_API_H
|
||||
|
|
|
@ -44,6 +44,6 @@ namespace S3D
|
|||
SGTYPE_SHAPE,
|
||||
SGTYPE_END
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SG_TYPES_H
|
||||
|
|
|
@ -85,11 +85,11 @@ fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext( void* sp, size_t size,
|
|||
void (* fn)( intptr_t ) );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; // namespace
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; // extern "C"
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace KIGFX
|
|||
{
|
||||
class VIEW;
|
||||
class VIEW_CONTROLS;
|
||||
};
|
||||
}
|
||||
|
||||
enum TOOL_TYPE
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ class ACTIONS;
|
|||
namespace KIGFX
|
||||
{
|
||||
class VIEW;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Class TOOL_DISPATCHER
|
||||
|
|
|
@ -184,6 +184,6 @@ struct TTLtraits
|
|||
//@} // End of Geometric Predicates Group
|
||||
};
|
||||
|
||||
}; // End of hed namespace
|
||||
} // End of hed namespace
|
||||
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@ class CN_CLUSTER;
|
|||
namespace ttl
|
||||
{
|
||||
class TRIANGULATION_HELPER;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The half-edge data structure
|
||||
|
@ -426,6 +426,6 @@ public:
|
|||
|
||||
friend class ttl::TRIANGULATION_HELPER;
|
||||
};
|
||||
}; // End of hed namespace
|
||||
} // End of hed namespace
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 CERN
|
||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef WXUNITTEXT_H_
|
||||
#define WXUNITTEXT_H_
|
||||
|
||||
#include <common.h>
|
||||
#include <wx/spinbutt.h>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class T>
|
||||
class optional;
|
||||
}
|
||||
class wxTextCtrl;
|
||||
class wxSpinButton;
|
||||
class wxStaticText;
|
||||
|
||||
class WX_UNIT_TEXT : public wxPanel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* @param aParent is the parent window.
|
||||
* @param aLabel is the label displayed next to the text input control.
|
||||
* @param aValue is the initial value for the control.
|
||||
* @param aStep is the step size when using spin buttons.
|
||||
*/
|
||||
WX_UNIT_TEXT( wxWindow* aParent, const wxString& aLabel = _( "Size:" ),
|
||||
double aValue = 0.0, double aStep = 0.1 );
|
||||
|
||||
virtual ~WX_UNIT_TEXT();
|
||||
|
||||
/**
|
||||
* Function SetUnits
|
||||
* Changes the units used by the control.
|
||||
* @param aUnits is the new unit to be used.
|
||||
* @param aConvert decides if the current value should be converted to the value in new units
|
||||
* or should it stay the same.
|
||||
*/
|
||||
void SetUnits( EDA_UNITS_T aUnits, bool aConvert = false );
|
||||
|
||||
/**
|
||||
* Function SetValue
|
||||
* Sets new value for the control.
|
||||
* @param aValue is the new value.
|
||||
*/
|
||||
virtual void SetValue( double aValue );
|
||||
|
||||
/*
|
||||
* Function GetValue
|
||||
* Returns the current value using specified units (if currently used units are different, then
|
||||
* they are converted first).
|
||||
* @param aUnits is the wanted unit.
|
||||
*/
|
||||
//virtual double GetValue( EDA_UNITS_T aUnits ) const;
|
||||
|
||||
/**
|
||||
* Function GetValue
|
||||
* Returns the current value in currently used units.
|
||||
*/
|
||||
virtual OPT<double> GetValue() const;
|
||||
|
||||
/**
|
||||
* Function GetUnits
|
||||
* Returns currently used units.
|
||||
*/
|
||||
EDA_UNITS_T GetUnits() const
|
||||
{
|
||||
return m_units;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetStep
|
||||
* Sets the difference introduced by a single spin button click.
|
||||
* @param aStep is new step size.
|
||||
*/
|
||||
void SetStep( double aStep )
|
||||
{
|
||||
assert( aStep > 0.0 );
|
||||
|
||||
m_step = aStep;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function GetStep
|
||||
* Returns the difference introduced by a single spin button click.
|
||||
*/
|
||||
double GetStep() const
|
||||
{
|
||||
return m_step;
|
||||
}
|
||||
|
||||
protected:
|
||||
///> Spin up button click event handler.
|
||||
void onSpinUpEvent( wxSpinEvent& aEvent );
|
||||
|
||||
///> Spin down button click event handler.
|
||||
void onSpinDownEvent( wxSpinEvent& aEvent );
|
||||
|
||||
///> Label for the input (e.g. "Size:")
|
||||
wxStaticText* m_inputLabel;
|
||||
|
||||
///> Text input control.
|
||||
wxTextCtrl* m_inputValue;
|
||||
|
||||
///> Spin buttons for changing the value using mouse.
|
||||
wxSpinButton* m_spinButton;
|
||||
|
||||
///> Label showing currently used units.
|
||||
wxStaticText* m_unitLabel;
|
||||
|
||||
///> Currently used units.
|
||||
EDA_UNITS_T m_units;
|
||||
|
||||
///> Step size (added/subtracted difference if spin buttons are used).
|
||||
double m_step;
|
||||
|
||||
///> Default value (or non-specified)
|
||||
static const wxString DEFAULT_VALUE;
|
||||
};
|
||||
|
||||
#endif /* WXUNITTEXT_H_ */
|
|
@ -262,7 +262,7 @@ struct APP_KICAD : public wxApp
|
|||
}
|
||||
};
|
||||
|
||||
IMPLEMENT_APP( APP_KICAD );
|
||||
IMPLEMENT_APP( APP_KICAD )
|
||||
|
||||
|
||||
// The C++ project manager supports one open PROJECT, so Prj() calls within
|
||||
|
|
|
@ -40,7 +40,7 @@ UNIT_SELECTOR_LEN::UNIT_SELECTOR_LEN( wxWindow *parent, wxWindowID id,
|
|||
Append( _( "cm" ) );
|
||||
Append( _( "mil" ) );
|
||||
Append( _( "inch" ) );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -73,7 +73,7 @@ UNIT_SELECTOR_THICKNESS::UNIT_SELECTOR_THICKNESS( wxWindow *parent, wxWindowID i
|
|||
Append( _( "mil" ) );
|
||||
Append( _( "inch" ) );
|
||||
Append( _( "oz/ft^2" ) );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -105,7 +105,7 @@ UNIT_SELECTOR_FREQUENCY::UNIT_SELECTOR_FREQUENCY( wxWindow *parent, wxWindowID i
|
|||
Append( _( "MHz" ) );
|
||||
Append( _( "KHz" ) );
|
||||
Append( _( "Hz" ) );
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Function GetUnitScale
|
||||
|
@ -132,7 +132,7 @@ UNIT_SELECTOR_ANGLE::UNIT_SELECTOR_ANGLE( wxWindow *parent, wxWindowID id,
|
|||
{
|
||||
Append( _( "Radian" ) );
|
||||
Append( _( "Degree" ) );
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Function GetUnitScale
|
||||
|
@ -157,7 +157,7 @@ UNIT_SELECTOR_RESISTOR::UNIT_SELECTOR_RESISTOR( wxWindow *parent, wxWindowID id,
|
|||
{
|
||||
Append( _( "Ohm" ) );
|
||||
Append( _( "KOhm" ) );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -102,7 +102,7 @@ void DRAWSEGMENT::Rotate( const wxPoint& aRotCentre, double aAngle )
|
|||
+ ShowShape( m_Shape ) ) );
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void DRAWSEGMENT::Flip( const wxPoint& aCentre )
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ class MSG_PANEL_ITEM;
|
|||
|
||||
namespace KIGFX {
|
||||
class VIEW;
|
||||
};
|
||||
}
|
||||
|
||||
enum INCLUDE_NPTH_T
|
||||
{
|
||||
|
|
|
@ -219,7 +219,7 @@ public:
|
|||
|
||||
|
||||
DECL_SPTR_FOR_SWIG( NETCLASSPTR, NETCLASS )
|
||||
DECL_MAP_FOR_SWIG( NETCLASS_MAP, wxString, NETCLASSPTR );
|
||||
DECL_MAP_FOR_SWIG( NETCLASS_MAP, wxString, NETCLASSPTR )
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,7 +57,7 @@ class MSG_PANEL_INFO;
|
|||
namespace KIGFX
|
||||
{
|
||||
class VIEW;
|
||||
};
|
||||
}
|
||||
|
||||
// Helper class to store parameters used to draw a pad
|
||||
class PAD_DRAWINFO
|
||||
|
|
|
@ -655,7 +655,7 @@ void ZONE_CONTAINER::SetCornerRadius( unsigned int aRadius )
|
|||
m_cornerRadius = aRadius;
|
||||
if( m_cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
|
||||
m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
bool ZONE_CONTAINER::HitTest( const wxPoint& aPosition ) const
|
||||
|
|
|
@ -142,4 +142,4 @@ void ZONE_SETTINGS::SetCornerRadius( int aRadius )
|
|||
m_cornerRadius = 0;
|
||||
else
|
||||
m_cornerRadius = aRadius;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
#include <python_scripting.h>
|
||||
#else
|
||||
// Dummy functions, actually defined in python_scripting.h when KICAD_SCRIPTING is enabled
|
||||
static void pcbnewGetWizardsBackTrace( wxString& aText ) {};
|
||||
static void pcbnewGetScriptsSearchPaths( wxString& aText ) {};
|
||||
static void pcbnewGetUnloadableScriptNames( wxString& aText ) {};
|
||||
static void pcbnewGetWizardsBackTrace( wxString& aText ) {}
|
||||
static void pcbnewGetScriptsSearchPaths( wxString& aText ) {}
|
||||
static void pcbnewGetUnloadableScriptNames( wxString& aText ) {}
|
||||
#endif
|
||||
|
||||
enum FPGeneratorRowNames
|
||||
|
|
|
@ -156,7 +156,7 @@ static std::string GenCADLayerName( int aCuCount, PCB_LAYER_ID aId )
|
|||
|
||||
return txt;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static const PCB_LAYER_ID gc_seq[] = {
|
||||
|
@ -204,7 +204,7 @@ static std::string GenCADLayerNameFlipped( int aCuCount, PCB_LAYER_ID aId )
|
|||
}
|
||||
|
||||
return GenCADLayerName( aCuCount, aId );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static wxString escapeString( const wxString& aString )
|
||||
|
|
|
@ -1618,7 +1618,7 @@ static SGNODE* getSGColor( VRML_COLOR_INDEX colorIdx )
|
|||
sgmaterial[colorIdx] = vcolor.GetRawPtr();
|
||||
|
||||
return sgmaterial[colorIdx];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static void create_vrml_plane( IFSG_TRANSFORM& PcbOutput, VRML_COLOR_INDEX colorID,
|
||||
|
|
|
@ -398,7 +398,7 @@ const wxString FOOTPRINT_EDIT_FRAME::getLibPath()
|
|||
const wxString FOOTPRINT_EDIT_FRAME::GetCurrentLib() const
|
||||
{
|
||||
return Prj().GetRString( PROJECT::PCB_LIB_NICKNAME );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_EDIT_FRAME::retainLastFootprint()
|
||||
|
|
|
@ -107,4 +107,4 @@ void PCB_VIEW::UpdateDisplayOptions( PCB_DISPLAY_OPTIONS* aOptions )
|
|||
|
||||
settings->LoadDisplayOptions( aOptions );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -59,6 +59,6 @@ private:
|
|||
PCB_LAYER_ID m_routeLayerBottom;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -37,7 +37,7 @@ class PCB_TOOL;
|
|||
namespace KIGFX
|
||||
{
|
||||
class VIEW;
|
||||
};
|
||||
}
|
||||
|
||||
class PNS_KICAD_IFACE : public PNS::ROUTER_IFACE {
|
||||
public:
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace KIGFX
|
|||
class VIEW;
|
||||
class VIEW_GROUP;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
namespace PNS {
|
||||
|
||||
|
|
|
@ -72,6 +72,6 @@ namespace TOOL_EVT_UTILS
|
|||
*/
|
||||
int GetEventRotationAngle( const PCB_BASE_EDIT_FRAME& aFrame,
|
||||
const TOOL_EVENT& aEvt );
|
||||
};
|
||||
}
|
||||
|
||||
#endif // TOOL_EVENT_UTILS_H
|
||||
|
|
|
@ -181,7 +181,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE_CONTAINER> aZone )
|
|||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
bool ZONE_CREATE_HELPER::OnFirstPoint()
|
||||
|
|
|
@ -169,7 +169,7 @@ static SGNODE* getColor( IFSG_SHAPE& shape, int colorIdx )
|
|||
cidx = 1;
|
||||
|
||||
return material.GetRawPtr();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const char* GetKicadPluginName( void )
|
||||
|
|
|
@ -62,7 +62,7 @@ static bool VDegenerate( glm::vec3* pts )
|
|||
return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static WRLVEC3F VCalcTriNorm( const WRLVEC3F& p1, const WRLVEC3F& p2, const WRLVEC3F& p3 )
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace X3D
|
|||
bool ParseSFVec3( const wxString& aSource, WRLVEC3F& aResult );
|
||||
bool ParseSFRotation( const wxString& aSource, WRLROTATION& aResult );
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif // X3D_OPS_H
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ Int128 Int128Mul( long64 lhs, long64 rhs )
|
|||
tmp = -tmp;
|
||||
|
||||
return tmp;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue