Commit Graph

71 Commits

Author SHA1 Message Date
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00
Wayne Stambaugh 5ecef204cd Coding policy fixes.
Using "this->" violates coding policy section 2.7.
2021-02-09 11:35:43 -05:00
Roberto Fernandez Bautista 9aedeae5c3 Don't log error messages when using the clipboard
wxClipboard::GetData()and wxClipboard::SetData() both log a "wxLogSysError" error-level message (see for example:  https://github.com/wxWidgets/wxWidgets/blob/v3.1.4/src/msw/clipbrd.cpp#L703 ). This logged message gets displayed as a messagebox to the user.

The logging can be disabled temporarily by creating a wxLogNull object. See https://docs.wxwidgets.org/3.0/classwx_log_null.html

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6956
2021-02-03 01:55:05 +00:00
Seth Hillbrand 61ac9c8d90 Add multiple size icons for programs
In theory, the WM should now choose the closest size icon for its
purpose, making it easier to distinguish in space-constrained settings

Fixes https://gitlab.com/kicad/code/kicad/issues/6798
2020-12-22 15:37:26 -08:00
Jeff Young a207bd97bb Naming conventions. 2020-11-17 16:05:49 +00:00
Seth Hillbrand 2a43b88115 Standardize PostScript capitalizaiton 2020-10-20 13:09:13 -07:00
Seth Hillbrand 4085757aeb Remove beginning/ending spaces in translations
Adding space padding makes translations more difficult by increasing
string counts
2020-10-20 12:08:04 -07:00
Wayne Stambaugh b624c7090a Deprecate saving legacy schematic and symbol library file formats.
REMOVED: The ability to save schematics in the legacy file format.
2020-05-29 12:43:00 +00:00
Jeff Young d69ebfae49 Push tool framework base down into TOOL_HOLDER.
This allows us to use it outside of EDA_BASE_FRAMEs (in this case, in
PANEL_PREVIEW_3D.)
2020-03-24 19:00:25 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Jeff Young 45ca0a5ab8 Avoid divide-by-zero. 2020-01-15 18:50:47 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Seth Hillbrand 77cefe0c16 Normalize line endings
A few files snuck in with CRLF for the line endings.  These make it hard
to look at diffs as every line appears to have changed.  This commit
makes only line ending changes, so can be ignored
2019-06-19 15:18:30 -07:00
Jeff Young bacb8c26cc Fix compiler warnings. 2019-06-19 19:10:46 +01:00
jean-pierre charras 6a9eb4576d Fixes in bitmap2cmp: enhancements and fixes.
* Better messages, more easy to translate
* Error messages are now displayed.
* Move start code to bitmap2cmp_main.cpp.
2019-06-19 18:24:39 +02:00
jean-pierre charras 0e4cd590cf Fixes in bitmap2cmp: enhancements and fixes.
* Cleaning code
* When changing the units, the displayed sizes are converted to the new value.
* Fix incorrect changes when the aspect ration is fixed, in DPI units.
2019-06-19 16:23:00 +02:00
jean-pierre charras b2eac14552 Fixes in bitmap2cmp: remove empty strings (not translatable) and a few cosmetic enhancements. 2019-06-19 08:24:09 +02:00
Johannes Wågen 3ecf3ae4b2 bitmap2component: Added support for multiple input units and locking of aspect ratio. 2019-06-19 08:24:08 +02:00
jean-pierre charras a076f5092c I18n: fix a few useless leading spaces in messages. 2019-06-16 20:29:11 +02:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Seth Hillbrand 35da498a32 bitmap2component: Fix logic for alpha mask
For POTRACE, black is the foreground and white is the background.  We
should keep the convention by requiring the pixin to be less than the
black threshhold as well as the alpha to be at least the alpha
threshhold.

Fixes: lp:1821563
* https://bugs.launchpad.net/kicad/+bug/1821563

(cherry picked from commit f1704fd61a)
2019-06-08 12:06:18 -07:00
jean-pierre charras 6695209246 Bitmap2component: add button to export to the Clipboard.
It is useful mainly in Pcbnew, to import a logo from Bitmap2component,
without the constraint to create a file and use the fp editor.
Also a bit of cleanup code.

Fixes: lp:1820829
https://bugs.launchpad.net/kicad/+bug/1820829
2019-05-30 20:23:07 +02:00
Seth Hillbrand 5cfa37da09 bitmap2component: Handle mask/alpha
Use alpha and mask components of bitmaps to set boundaries for the image
tracing.

Fixes: lp:1815216
* https://bugs.launchpad.net/kicad/+bug/1815216
2019-02-09 08:40:59 -08:00
Maciej Suminski 24f9bfa13b Fixed memory leaks
This is commit a9efbf47 with a fix for SWIG to deal with unique_ptr.
2018-12-20 10:05:58 +01:00
Seth Hillbrand e307d9318b Revert "Fixed memory leaks"
This reverts commit a9efbf4716.

The commit broke compiles with scripting
2018-12-11 10:12:44 -08:00
Maciej Suminski a9efbf4716 Fixed memory leaks 2018-12-11 16:21:43 +01:00
Jeff Young 49ea6e1670 Fix occurrences of "edition" which should be "editing"
Fixes: lp:1778168
* https://bugs.launchpad.net/kicad/+bug/1778168

(cherry picked from commit bcb1220)
2018-07-17 15:12:39 +01:00
Seth Hillbrand bc7bd107d9 Fix a number of untranslated strings. 2018-06-12 17:05:25 -07:00
jean-pierre charras bc6763e14d bitmap2cmp_gui: fix incorrect initialization of m_Negative when starting bitmap2cmp. 2018-02-20 14:08:25 +01:00
Jeff Young 702eb48ca0 Fix issues with Bitmap2Component positive/negative radio buttons.
Cleaned up the UI a bit and removed the radio buttons (Negative
is now a checkbox).

Fixes: lp:1744043
* https://bugs.launchpad.net/kicad/+bug/1744043
2018-02-20 13:26:10 +01:00
Jeff Young 12247db467 Enable Bmp2Component Export button when loaded from argv
Fixes: lp:1608813
* https://bugs.launchpad.net/kicad/+bug/1608813
2018-02-18 17:47:26 -05:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01: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
Wayne Stambaugh 652b969193 GTK+ file dialog wildcard improvements.
The GTK+ file dialog is case sensitive however it does support regular
expressions.  Most of the file dialog wildcards are lower case so only
files with the lower case extensions will show up in the file dialog.
This code adds a method to convert file extensions of any case to the
appropriate (sch -> [sS][cC][hH]) regular expression on GTK+ builds so
all file extension case combinations will show up in the file dialog.

A note to developers: make sure to add a file extension when setting
when setting the default file argument.  If you do don't set an
extension, the GTK+ file dialog will happily append the regular
expression as the file extension which is surely not what you want.

There are still a few known places (mostly gerbview) where there are
some complex wildcard code that has not been converted.

Fixes lp:1720542

https://bugs.launchpad.net/kicad/+bug/1720542
2017-11-11 19:32:26 -05:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

Fixes: lp:1530543
* https://bugs.launchpad.net/kicad/+bug/1530543

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
Simon Richter ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Simon Richter 715eddf68b Code cleanup: remove dead code, add comment. 2016-06-08 08:32:01 +02:00
Simon Richter dca358076e Make sure KIFACE_GETTER linkage is consistent
This makes sure that the declaration is always the same within a single
module, so all users have the same idea of whether the symbol is imported.

In all dynamically linked objects, all users should be aware that the
symbol is imported, while in the statically linked bitmap2component
program, no import/export decorations should be used.
2016-05-28 13:10:06 -04:00
Simon Wells 24d293ab8d bmp2cmp: include cleanup 2016-01-15 19:57:52 -05:00
Wayne Stambaugh a6a9d8eedf Default and most recently used path fixes. (fixes: 1494210)
* Rename Eda_FileSelector to EDA_FILE_SELECTOR.
* Add optional pointer to wxString to save the most recently used path to EDA_FILE_SELECTOR.
* Rename Eda_DirectorySelector to EDA_PATH_SELECTOR.
* Replace wxGetCwd() with wxStandardPaths::GetDocumentsDir().  This fixes the windows issue
  where wxGetCwd() returns the path where the executable files are located.
* Add code to handle most recently used path to EDA_BASE_FRAME.
* Fix string formatting error in kicad/files-io.cpp.
* Remove setting and restoring current working directory when launching GerbView.  Setting the CWD
  has no effect on the launched executable which starts with it's own CWD.
* Allow project path to be passed to GerbView when launched from KiCad.
* Note: this is a work in progress.  Do not expect every path and/or file selection dialog to properly
  update the most recently used path.  The correct solution to this problem requires a much more
  well though out solution which will not happen until after the next stable release.
2015-09-25 15:38:09 -04:00
unknown b411b240f2 bitmap2component: Add a layer selection to export a logo for Pcbnew from a Cirilo Bernardo's patch.
Apply patch from Cirilo Bernardo with some minor changes: mainly allows also the solder mask layer and keep ref and value fields on the silk layer.
2014-11-12 17:59:12 +01:00
Moses McKnight 6da5e2cdd0 Configuration file consolidation patch from Moses McKnight.
* Create GetNewConfig() and GetKicadConfigPath() to unify configuration file
  creation and location.
* Move Windows configuration out of the registry into configuration files.
* Move Linux configuration files from $HOME to $HOME/.config/kicad to eliminate
  configuration file pollution in the users $HOME folder.
* Fix a bug in the configuration file where the Eeschema hot keys are saved.
2014-09-05 17:12:38 -04:00
jean-pierre charras a26449b3ef 3d-viewer: code cleaning; bitmap2component: minor fix and code cleanup 2014-08-22 12:24:14 +02:00
unknown eec819a274 Bitmap2component: old .emp output format removed (patch from Cirilo Bernardo) 2014-08-21 16:57:25 +02:00
Dick Hollenbeck 5f65d0da93 *) Add KIFACE_I::StartFlags() and IsSingle() so a KIFACE implementation can know
if it is running under single_top.cpp or under a project manager.

*)  Test Kiface().IsSingle() when adding menus, some operations are not permitted
    when running under a project manager and the KIWAY_PLAYER is pegged to a
    specific project.

*)  Implemented KIWAY::KiFACE() so it loads *.kiface files.  They still have to be
    in the same directory as the main *.exe launcher, so this presents some difficulty
    when the binaries are not yet installed but rather the *.kiface files are still
    in their original build directories.  For today, I simply copied _pcbnew.kiface
    to build/kicad/.

*)  Add a test case to kicad/mainframe.cpp just to get an early peek at loading
    _pcbnew.kiface under the C++ project manager.  Got that working for one
    specific invocation just for proof of concept.  Surprise, it works.
2014-04-17 21:05:40 -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
jean-pierre charras 91c53a947a bitmap2component: add management of image resolution: Is read from file, when exists, and can be modified in bitmap2component.
It also fix issue #747631
2014-03-16 15:10:42 +01:00