Commit Graph

25 Commits

Author SHA1 Message Date
John Beard 567bdd9b9d Add configuration of Hi-DPI canvas scaling in OpenGL
First, add automatic detection of toolkit DPI scaling options. For now, this
is, in order,

* Check the GDK_SCALE option under GTK+ (users can set this to force the scaling)
* Check the value from WX's GetContentScalingFactor(). This will start to work
  correctly from WX 3.1 and GTK+ 3.10.

Then, add a user-settable override in the main prefs panel, next to the icon
scaling. This is independent of the icon scaling options.

DPI handling is performed in a standalone class, so they can be shared between
the prefs UI and the OpenGL backend easily. Also means Cairo could use the same
interface in future.

Also adjust the OpenGL grid drawing code to use the computed scale factor,
which avoids over-thick grids in scaled environments (the user can manually
thicken the grid if wanted).

Fixes: lp:1797308
* https://bugs.launchpad.net/kicad/+bug/1797308
2019-03-25 15:00:55 +00:00
Seth Hillbrand e8333633fe GAL: Add antialiasing options to Cairo
Cairo supports antialiasing when rendering but can be slow when set to
sub-pixel mode.  This bumps the minimum version of Cairo to 1.12
(available in 14.04 LTS as well as mingw) to support three antialias
settings (fast, good, best) that offer speed/appearance tradeoffs.

This can provide a higher-quality eeschema render as it works on a
per-element basis as opposed to the OpenGL per-screen antialias.
2019-01-04 13:39:56 -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 afeebc8944 Grid settings for Eeschema GAL.
Split antialiasing options out from display options.  Move
antialiasing to common.  Duplicate the rest of display options
for Eeschema.

Implement OnSelectGrid and hookup GAL canvas refresh to
SetPresetGrid.

Add Grid Settings... to View menu and move Show Grid from
preferences to View Menu to match Pcbnew.
2018-10-09 11:08:55 +01:00
Jeff Young da4fb4ae3a Move galDisplayOptions access from pcbnew to common. 2018-10-09 11:08:55 +01:00
Jeff Young 86a801aabc Allow updating of file history size on the fly.
Also updates the file menu IDs so that we can actually handle
more than 9 items in the file history.

Also adds configurable file history length to the other gerber
files (zip, drill and job).

Fixes: lp:1745729
* https://bugs.launchpad.net/kicad/+bug/1745729
2018-08-21 10:34:41 +01:00
José Jorge Enríquez 8d625854b8 Allows custom number of entries in recently opened files menu.
NEW: Adds a configuration option to set number of entries in the "Open Recent" menu.

Fixes: lp:1745729
* https://bugs.launchpad.net/kicad/+bug/1745729
2018-08-21 10:34:41 +01:00
Jeff Young 7841f8a466 Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
2018-07-17 15:11:17 +01:00
Jeff Young 8f0aa68ab8 Fold 3D Search Paths dialog into Configure Paths.
Use in-place editing for both.

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

(cherry picked from commit 33622cd)
2018-07-17 15:11:01 +01:00
jean-pierre charras 4eeed8d04f Icons options menu: code rework 2017-03-03 14:18:25 +01:00
jean-pierre charras e7e972804a Make show/hide icons in menus a run time option, instead of compil option. 2017-03-02 15:45:54 +01:00
Dick Hollenbeck 7311f07eaf SWIG Improvements
*) Extend SWIG support deeper into the BOARD class.
*) Move swig *.i files into a directory identified for SWIG, in preparation
   for a parallel universe involving Phoenix's SIP.
*) Move swig files which will be common to both eeschema and pcbnew into
   common/swig.
*) Sketch out a "common" python module, and plan on dovetailing that into a
   libkicad_shared.{dll,so}
*) Add common/swig/ki_exceptions.i and define a macro HANDLE_EXCEPTIONS()
   which is to be applied to any function which needs C++ to python
   exception translation.
*) Move the test for SWIG tool into top level CMakeLists.txt file for use
   in all python modules beyond pcbnew, i.e. eeschema and common.
*) Add SWIG_MODULE_pcbnew_EXTRA_DEPS which generates a better Makefile, one
   which rebuilds the swig generated *.cxx file when one of its dependencies
   change.
*) Re-architect the board.i file so that it can be split into multiple *.i
   files easily.
*) Make some KIWAY from python progress, in preparation for Modular KiCad
   phase III.
2016-09-20 11:59:43 -04:00
Simon Richter b9a6c4988f Avoid conflicting declaration for Pgm()
This function has two conflicting definitions in the "kicad" executable and
the other wrapper programs. As the kifaces can be loaded from either, this
silently assumes compatible data layout for the PGM_KICAD and PGM_BASE
types when passed by reference, which is valid only when the compiler is
aware of the cast.

If the return type is encoded in the symbol name (such as when using the
MSVC compiler), this also causes an error during linking, as the symbol
names no longer match.
2016-05-28 12:57:29 -04:00
jean-pierre charras ec096cc1d2 Fix an issue in LOCALE_IO class, used to switch to/back locale "C" when reading/writing files: the back to locale was broken, and created issues in countries using the ',' as fp separator, especially when the non default language was used.
It was reported in many bugs.
2016-05-10 09:11:09 +02:00
dwilches 1c19699a7c Fix Preferred Editor dialog (lp: 1558353)
The functions involved in the problem were PGM_BASE::GetEditorName and
EDA_BASE_FRAME::OnSelectPreferredEditor:

1) OnSelectPreferredEditor showed a dialog to allow the user selecting the
editor, but before that called GetEditorName to get the name of the current
editor (to show as a default in the choose file dialog).

2) The problem was when there was no editor, GetEditorName showed its own
dialog.

3) So the user was seeing first the dialog from (2) and then the dialog from
(1).

4) As GetEditorName is used in many other places the solution I did was to add
to it an optional parameter that tells it what to do if no editor is set. To
avoid modifying other code that relies on the current behaviour, this parameter
has a default value that causes to show the dialog. But now when
OnSelectPreferredEditor calls it, it passes the parameter that causes it to
return an empty string if no editor was set.

5) Also, I found a second bug while doing it which allowed in the first dialog
to select an unexistent file (the dialog was missing the wxFD_FILE_MUST_EXIST
flag).

6) Lastly, to avoid having duplicated code (the one that showed the same dialog
and that configured the wildcard was in two methods) I created a single
function that now both functions call: PGM_BASE::AskUserForPreferredEditor.
This way we also will have consistency in the behaviour of both dialogs and
there is a single place where it needs to be modified.
2016-03-17 16:59:35 -04:00
Wayne Stambaugh 45d0448bb9 Add path (environment variable) configuration dialog.
* Create new dialog to edit environment variables.
* Add helper class ENV_VAR_ITEM to manage environment variable values and
  if they were defined externally.
* A path configuration dialog access to KiCad, CvPcb, Pcbnew, and Footprint Editor
  window menus.
* Add validator for environment variables.
2015-03-29 17:22:53 -04:00
Wayne Stambaugh bd199b894e Set default footprint library table and 3D model library environment variables. 2015-02-03 15:42:33 -05:00
Dick Hollenbeck 3e861db371 Lock file improvements. 2014-09-07 15:01:26 -04:00
jean-pierre charras e5e388f2b4 Help files: can now be html or pdf files: Kicad search first for a .html help file, and if not found in a path, search for the corresponding .pdf file.
Therefore our .pdf files can be replaced at any time  by .html corresponding files in kicad doc/help sub directories.
2014-09-02 18:44:53 +02:00
jean-pierre charras d8c3ccb424 Pcbnew, Eeschema: release lock file when these editors are closed (Until now, the lock file was released when the full Kicad application was closed, not when the editor was closed).
Should fix Bug #1360470  and Bug #1359502 .
2014-08-26 12:54:22 +02:00
Dick Hollenbeck c39385a5cd improve help file finding after kiway breakage. 2014-04-14 13:49:52 -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