Commit Graph

61 Commits

Author SHA1 Message Date
Sylwester Kocjan a9c2a59049 tools: add mock generator script
Rough version, generates MOCK_METHOD macros to the qa/mocks/out.txt
2022-03-18 17:51:09 +00:00
Seth Hillbrand 9a8d1246cc We don't keep a CHANGELOG.TXT
Direct interested readers to AUTHORS.TXT instead.
2021-10-05 19:46:53 -07:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Jon Evans e570b9b548 Update dark mode icons 2021-03-11 08:39:24 -05:00
Jon Evans afc11ca771 Preliminary take on dark theme colors
Script added to generate dark theme from light.
Target colors can be adjusted and then icons can be
re-generated until we're happy with the starting point,
then individual icons can be tweaked.
2021-03-01 21:24:30 -05:00
Jon Evans 7df3df3381 Add basic netlist QA test 2020-04-19 19:13:24 -04:00
Ian McInerney 06c979dfaa Convert all CMake paths to absolute instead of relative
It is cleaner and safer to handle the include and source paths
as absolute from the source directory instead of relative to every
path.
2020-01-22 23:27:20 +00:00
Jon Evans 27db1c90bc Add netlist comparison script 2020-01-15 18:52:49 -05:00
Seth Hillbrand 77c60d9655 Remove the last vestiges of dlist
It served us (mostly) well for more than a decade.  It helped KiCad grow
before the std:: came into decent shape or speed.  It was a good little
list.

RIP DLIST 2008-2020
2020-01-10 06:37:08 -08:00
Ian McInerney f0c386f5dd Update GitLab CI script
Changes SHA detection to find the start of the MR and makes check_coding return non-zero when formatting changes needed
2019-12-03 18:51:59 +00:00
Seth Hillbrand 2ce7d9a708 Adding merge CI
Adds GitLab merge CI for code formatting.
2019-11-29 21:55:36 -08:00
John Beard 241127788e Format: add some formatting aliases, improve dev docs
The aliases are easier than calling check_coding.sh manually,
and we already provide an alias file for the fixes alias, so
do the same for these.
2019-05-23 21:28:42 +01:00
John Beard a69cdf1793 Formatting: exclude generated files from git formatting hook
Add a .gitattributes files to provide a place to store file
attributes. Add a custom attribute for files that should be under
KiCad style guidelines.

Exclude generated files from the style enforcement. So far:

* bitmap .cpp files
* wxFormBuilder base classes
* Lemon grammars

It's now trivial to add the 'generated' attribute to any such
file.

Putting this into .gitattributes also means it can be retreived
programmatically, by other scripts, git alaises or on the command
line.

Use the attributes to provide a utility script to show or apply
formatting to controlled files (plain git clang-format won't
pick up our custom git attributes). Add details for the script in
the dev docs.

Also modiify the check-format hook to follow the .gitattributes
and only apply to cached (staged for commit) changes. Then you
won't be stopped committing because of bad formatting in unstaged
changed, or uncontrolled files.

Concept and some aspects of the implementation inspired by
CMake commit d5f39a56 [1].

[1]: d5f39a56a4

tool
2019-03-29 15:06:48 +00:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
John Beard bb2ae8e13b Bitmaps: move bitmap defs to bitmaps library
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.

Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.

This avoids a circular dependency that was previously reported
by static analysis.

Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)

Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
2019-02-04 19:29:31 -08:00
John Beard bb2e402bc7 QA: Move io_benchmark into common_tools 2019-01-22 09:04:38 -05:00
John Beard b88121e377 Add an in-memory STREAM_LINE_READER benchmark
This adds an io-benchmark case of the STRING_LINE_READER
class, which reads a file into a std::string, *then*
reads it line by line.

As expected, due to it all being in memory, this is very fast.

Also fixes an issue in io_benchmark where the input file
must be in the current dir.
2018-10-31 12:22:47 -04:00
John Beard acd103631b QA: PCB file input parse test program (fuzzable)
This adds a test program which can be used to test the
parsing of a given KiCad PCB file. This interface is
useful for both manual or automated debugging of given
files, as well as providing an interface suitable for
fuzz-testing tools.

Also adds to the testing docs to detail how fuzzing can
be used.

Also moves some useful re-usable code from io-benchmark
to a new library qa_utils, which can contain code that
isn't need in the actual KiCad libs.
2018-10-22 12:32:24 -04:00
Seth Hillbrand 441cac9f1b UTF8: Correct MSW issue with previous commit
Linux does not handle the resize command with wide-character extended
table UTF-8.  The solution did not work for W7-32bit.  This is a
compromise, attempting first the preferred, previous solution and
falling back to the secondary solution.

(cherry picked from commit 6106210c87)
2018-10-17 12:40:28 -07:00
Simon Richter a9ccf1161b Fix quotes in UI messages
This replaces all single and angle bracket quotes in UI messages with
double quotes, for consistency.

Sorry to all translators.
2017-12-15 07:33:07 -05:00
jean-pierre charras 2337b83ba6 richio.h, class LINE_READER: prefix variable member names by "m_", like in other classes in Kicad. 2017-11-12 18:29:56 +01:00
Dick Hollenbeck a5f57d8b0b Add CMakeLists.txt build support for tools/utf8_tests.cpp 2017-07-26 10:11:40 -04:00
Dick Hollenbeck 19e6bde09a Rewrite class UTF8 to contain rather than extend std::string storage.
This forces the compiler class specific features rather than borrowing
from the base class's std::string.  In some cases prior to this,
wxString( std::string ) was being called rather than UTF8::operator
wxString() leading to garbled wxStrings.

Added function UTF8::wx_str() which is of great convenience also.

Implicit conversions still work as before, and hopefully more reliably.
2017-07-26 08:30:12 -04:00
Dick Hollenbeck 0aedaffed9 add utf8_test.cpp to project 2017-07-26 08:29:36 -04:00
Kristoffer Ödmark 19d5cc7548 Removed all exception specifiers since deprecated.
Exception specifiers are deprecated in cpp11, so went through them all
and removed them from the code.
2017-06-12 13:54:55 -04:00
Simon Richter ae9bbf7aeb Fix building benchmark test
Passing a wxString to std::ifstream::ifstream() is ambiguous, at least on MSVC.
2017-03-08 10:45:26 -05:00
John Beard 75a9589213 io_benchmark: Add wxBufferedInputStream benchmarks
When run, these show a 10x speed up over wxFileInputStream alone and
about 30% over wxFFInputStream.
2017-03-02 12:28:53 -05:00
John Beard 814ff7c7fc io_benchmark: construct std::ifstream directly
This appears to normally use the move constructor, but on Jenkins Fedora
20, it tried to use the copy ctor, which is deleted.

Constructing directly fixes this, and is the right way, anyway.
2017-03-02 17:25:58 +01:00
John Beard bea0a9ab6e IO benchmark program: RICHIO vs std::fstream and wxStream
This compares the performance of RICHIO line readers against other
implementations, and can be used for profiling and optimisation.

Current benchmarks provided:

* richio FILE_LINE_READER
* Raw std::ifstream (no LINE_READER wrapper), using getline (so no line
length limiting)
* LINE_READER wrapper around std::istream, with a std::ifstream
implementation
* Existing richio wxInputStream wrappers (with File and FFile
implemntations)
2017-03-02 09:29:38 -05:00
Dick Hollenbeck 340da50315 Update tools/property_tree support so it builds again. 2017-02-02 12:58:03 -05:00
Simon Wells 4d2a05856f Minor CMake configuration file fixes.
* Move add_directory()s in main CMakeList.txt after all find_package()
  macros are run so all flags in the main CMakeList.txt are propagated
  to the sub-folder CMakeList.txt files.
* Remove commented out include of config.h
* Make the link maps only build on linux as -${TO_LINKER},-cref
  -${TO_LINKER},-Map=blah just gives warnings on osx w/ clang
* Make the link maps only build with flag -DKICAD_MAKE_LINK_MAPS is
  defined during CMake configuration as they are highly specific.
* Moved the code for setting link maps into the main CMakeList.txt
  file to avoid duplication.
* Removed -D__ASSERTMACRO__ from osx as its no longer needed
* Removed a couple of other OSX only things that wouldn't work anyway
* Moved set (BU_CHMOD_BUNDLE_ITEMS) to the main CMakeList.txt as
  otherwise it would only work for the KiCad build not the other
  applications
* Made KICAD_SCRIPTING_MODULES enable KICAD_SCRIPTING as currently if
  you have modules enabled without the scripting base it will on build.
  This could be changed to a fatal error saying you need to also enable
  scripting but it seems unnecessary.
* Removed duplication of pcbnew.py install code under modules and
  scripting since you can't have modules without scripting now
2016-02-29 14:08:03 -05:00
Dick Hollenbeck acbe6290c5 switch back to original sexpr usage of PTREE, add new DSNLEXER constructor, enforce accessors in kicad.exe 2014-07-07 14:49:14 -05:00
Dick Hollenbeck 4011953455 Jettison FP_LIB_TABLE::ConvertFromLegacy() into a static function, where it
was used locally.  Then comment it out in favor of a newer strategy for
filling in nicknames in cvpcb. 

Add MODULE* FootprintLoadWithOptionalNickname( const FPID& aFootprintId )
        throw( IO_ERROR, PARSE_ERROR );
from code found elsewhere.
2014-04-09 08:33:04 -05:00
Dick Hollenbeck 6bfff89fe5 merge tip in, resolve. 2014-03-20 01:24:33 -05:00
Dick Hollenbeck 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
Marco Serantoni 2acaa2871d [MacOSX] Fixing build system, sorry guys, refining build system and make building smoother. 2014-02-08 16:15:06 +01:00
Dick Hollenbeck 33e26b278d KIWAY in progress... 2014-02-03 13:26:18 -06:00
Dick Hollenbeck 4f26386e8d Initial KIWAY (modular-kicad) work. Various tweeks. 2014-02-03 09:10:37 -06:00
Dick Hollenbeck edc5783411 file maintenance, update some scripts 2014-01-09 09:01:59 -06:00
Dick Hollenbeck dba4fccec9 *) Change FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE*, const wxString*)
To use multiple working threads.  This entailed adding KiCad typedefs:
*) Add typedefs for MUTEX and MUTLOCK which mask the actual choices for the project.
*) Add FOOTPRINT_LIST::DisplayErrors( wxWindow* ) which is a single strategy for
   showing aggregated load errors.  Although what's there is only scaffolding
   and needs a volunteer who knows HTML pretty well.
*) Ensure all callers of ReadFootprintFiles() use the new DisplayErrors() function.   
*) Push utf8.cpp and utf8.h into common library for open use.
2013-12-09 12:09:58 -06:00
Dick Hollenbeck 7717aa9279 fixes, a couple more unit tests. 2013-12-08 09:25:11 -06:00
Dick Hollenbeck 5df7288678 complete class UTF8.cpp 2013-12-08 00:48:25 -06:00
Dick Hollenbeck 03a4f5c4ea Move "code costly" functions in experimental class UTF8 to be not "inlined", prefering compactness. 2013-12-06 14:22:10 -06:00
Dick Hollenbeck a0623d9584 UTF8::uni_iter made leaner. 2013-12-06 07:32:33 -06:00
Dick Hollenbeck 391ff6699a sketch out class UTF8::uni_iter, add tools/make-UTF8.sh 2013-12-06 06:51:39 -06:00
Dick Hollenbeck 6274740de9 add a concept of an 8 bit string class for testing and experimentation. 2013-12-05 14:36:18 -06:00
Maciej Suminski 07cd3bcb56 Upstream merged 2013-04-10 15:03:35 +02:00
Dick Hollenbeck 6bf3d7cdc3 Implement "KiCad s-epression" support for boost::property_tree's ptree, the 8
bit string version of property_tree. The ram resident structure of the ptree is
mostly compatible with one created using the xml_parser from
boost::property_tree, with slight differences in the way atoms are stored. The
result is you can use Format() to convert from xml to s-expression, but not the
other way around. You can write a simple s-expression beautifier in just a few
lines of code.

The main value however is the s-expression parser, i.e. Scan(), which is an
alternative to crafting a custom recursive descent parser for a particular
grammar. The tipping point depends on whether you want to read only a small
portion of a much larger document. If so, then using the ptree will likely be a
"faster to code" route. Documentation on how to navigate a ptree can be found on
the boost website and there are a number of examples in the
pcbnew/eagle_plugin.cpp file in this project. Powerful path navigation support
makes it easy to extract a subset of a ptree.
2013-04-08 16:04:45 -05:00
Maciej Suminski e262b32198 Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
    - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
    - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
    - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
    - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
    - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
    - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
    - STROKE_FONT - Implements stroke font drawing using GAL methods.
                          
Most important changes to Kicad original code:
    * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
    * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
    * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
    * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
    * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
    * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
    * Removed tools/class_painter.h, as now it is extended and included in source code.
                         
Build changes:
    * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
    * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
    * GAL-related code is compiled into a static library (common/libgal).
    * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
                            
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 08:54:03 +02:00
Miguel Angel Ajo da9e6b1679 checkcoding.py refactor from Edwin van den Oetelaar, some extra refactorings by me, improvement suggestions from Carl Poirier 2013-03-18 12:22:31 +01:00