Commit Graph

3010 Commits

Author SHA1 Message Date
Maciej Suminski e6cfb6af52 Revert "Fix setting the background color in OPENGL_GAL"
Causes flickering on some GPUs.
This reverts commit ca985791bc.
2017-03-04 08:51:35 +01:00
Maciej Suminski 94d8e1e69c Fixed a memleak in ReadHotkeyConfig() 2017-03-04 08:38:35 +01:00
Cirilo Bernardo 68bcdec87e Workaround for non-ASCII filenames in Windows 2017-03-03 14:30:47 -05:00
jean-pierre charras 4eeed8d04f Icons options menu: code rework 2017-03-03 14:18:25 +01:00
Jon Evans 88f7c55d95 Move ZoomFitScreen and ZoomPreset from PCBNEW_CONTROL to COMMON_TOOLS
BOARD::GetBoundingBox() now directly calls BOARD::ComputeBoundingBox()
and there is a new method BOARD::GetBoardEdgesBoundingBox() used for
call sites that needed to use ComputeBoundingBox( true ) in the past.

This allows COMMON_TOOLS to implement ZoomFitScreen without knowledge
of the BOARD class.
2017-03-03 13:28:19 +01:00
Maciej Suminski 906ee77dbf Fixed VIEW_ITEM memory leaks 2017-03-02 23:57:13 +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
Maciej Suminski 1d8730752c Restore valid force cursor setting before saving VIEW_CONTROLS settings
There are times, when TOOL_MANAGER has to force cursor position
to make tools work as expected (e.g. when popping up a menu,
so tools get the right click position instead of current position
pointing to an entry in the menu).

If another tool is invoked, VIEW_CONTROLS settings have to be stored
in the TOOL_STATE object. In such case, it is necessary to revert the
force cursor setting when saving VIEW_CONTROLS settings.

Fixes: lp:1668712
* https://bugs.launchpad.net/kicad/+bug/1668712
2017-03-02 12:07:09 +01:00
Maciej Suminski ca985791bc Fix setting the background color in OPENGL_GAL
Fixes: lp:1669098
* https://bugs.launchpad.net/kicad/+bug/1669098
2017-03-02 09:32:10 +01:00
John Beard 4547b2e26d Don't init wxBitmaps before GUI is ready
Init'ing static wxBitmaps in the global scope happens before the GUI is
ready, which segfaults, at least on GTK+. This can happen in, for
example, the Python module. In normal use, the singletop/kicad
loader has initialised the GUI first, so it doesn't manifest there.
2017-03-01 13:28:10 +01:00
jean-pierre charras 8526935183 GAL: better progression between zoom in/zoom out (in/out/in sequence keeps the same zoom value) 2017-03-01 13:00:42 +01:00
jean-pierre charras 1cffcafe2d GAL mode: Add small cross option to grid style (now: options are Dots, Grid, Small cross) 2017-03-01 10:29:19 +01:00
John Beard 1d039cb4c1 Break row indicators out to own class
The introduces INDICATOR_ICON, which is a very simple class holding a
bitmap that can toggle on or off.

The ICON_PROVIDER class then provides icons to INDICATOR_ICONS, which
means the class can be used for more than just row indicators.

A default row icon provider is also provided for use in the standard row
selector.
2017-03-01 09:44:41 +01:00
John Beard b8d0b0d7be Move layer/render swatches to own class
This introduces COLOR_SWATCH, which is a reusable
widget that shows a color swatch and can invoke the colour picker
when duble/middle clicked.

It uses it's own wxCommandEvent to signal the change.

This makes the layer widget simpler internally, and also allows other
code to show identical swatches if needed.
2017-03-01 09:44:41 +01:00
Jon Evans fd4e2b042c Refactor SELECTION, SELECTION_CONDITIONS, and context menus to common
SELECTION now holds EDA_ITEMs not BOARD_ITEMs so various places had to
change to casting the selected items to BOARD_ITEMs.

Fixed compilation warnings on clang (Tom)
2017-02-28 14:47:20 +01:00
Jon Evans 0afb249447 Add drawing priority support to VIEW
Call UseDrawPriority( true ) after creating GAL to enable.

VIEW::Add() gets a new optional argument to specify the draw order
when adding an item.  If the new argument is left default, the draw
order will increment with each call of VIEW::Add().

Fix std::bind calls after change to VIEW::Add
2017-02-28 14:47:20 +01:00
Maciej Suminski 9ead2b068b Fixed crash when placing a component in standalone eeschema
Fixes: lp:1668157
* https://bugs.launchpad.net/kicad/+bug/1668157
2017-02-27 10:29:53 +01:00
Chris Pavlina 23d4da9e49 Optimize TWO_COLUMN_TREE_LIST column sizing
This was particularly slow for very long lists on macOS.
2017-02-24 12:51:53 -05:00
Maciej Suminski adba96fd2b Changed optional::value_or() to optional::get_value_or()
get_value_or() is considered deprecated, but still works in the newest
boost (1.63). On the other hand, value_or() is not available in some
versions that are still used by major distros.
2017-02-24 17:34:23 +01:00
Maciej Suminski e34b73e187 Do not freeze cursor when a tool was cancelled using the context menu
dispatchContextMenu() stores the cursor position before displaying a
menu, so the tools use the original cursor position when processing
events (instead of the mouse position pointing to a menu entry). Later,
the previous position has to be restored, but if in the meantime the
tool was cancelled - previous settings were restored to a wrong tool.
2017-02-24 16:55:18 +01:00
Maciej Suminski b25ded4d90 Store VIEW_CONTROLS settings when tools are switched
Fixes: lp:1663783
* https://bugs.launchpad.net/kicad/+bug/1663783

Fixes: lp:1667580
* https://bugs.launchpad.net/kicad/+bug/1667580
2017-02-24 16:47:19 +01:00
Maciej Suminski 57050cdeb3 Introduced VIEW_CONTROLS::SETTINGS to keep settings
The new class facilitates saving and restoring VIEW_CONTROLS
settings such as cursor visibility, snapping, etc.
2017-02-24 13:33:17 +01:00
Maciej Suminski 72cae92320 Disable context menu trigger if the assigned menu is set to null 2017-02-24 13:32:43 +01:00
John Beard c001c6114f Add cancel interactive tool action to GAL
This is used to provide menu entries that allows cancellation of
interactive drawing and routing tools without needing the keyboard.

It is provided in the drawing tools and the router tool.

The cancel event doesn't have any new functionality (e.g. track rip-up
for the PNS router - lp:1448460), this just adds it to the menu, where
it behaves the same as an Escape keypress.
2017-02-24 10:37:07 +01:00
jean-pierre charras 04d1b2fca7 fix incorrect COLOR4D::COLOR4D( EDA_COLOR_T aColor ) ctor for UNDEFINED_COLOR 2017-02-23 18:17:47 +01:00
jean-pierre charras 2f24b31b28 simplify color calculation. 2017-02-23 17:55:55 +01:00
jean-pierre charras 1f345052cd Fix erroneous conversion between wxColor and COLOR4D 2017-02-23 14:30:43 +01:00
jean-pierre charras 11dcb76fc9 Add -Wshadow compil option, if exists to warn about shadowed variables.
Swig auto generated .cxx file has a lot of shadowed variables, so this option cannot be used to compil all files.
2017-02-23 13:17:23 +01:00
jean-pierre charras a9d6af8001 Fix a comment 2017-02-23 13:17:23 +01:00
jean-pierre charras 10396ff435 Tool manager: renames Yield() to KiYield(), due to a collision name between the Yield macro in wxWidgets and Tool manager Yield.
Can be dependent on platforms.
2017-02-23 08:30:29 +01:00
Chris Pavlina d1a2ed63c0 Add gal as dependency of common
This is required due to the use of COLOR4D in common
2017-02-22 19:45:52 -05:00
Jon Evans f9bc5914b3 Wrong type of arguments in wxPen constructor
Has pointed out by Jon Evans the constructor need the .ToColour() and should be called like:
wxPen pen( GetParent()->GetGridColor().ToColour(), h );

Submitted-by: Diogo Condeco <diogocondeco@gmail.com>
2017-02-22 14:12:58 -05:00
Maciej Suminski d7bf44eee0 Removed a few more headers from base_struct.h 2017-02-22 17:54:01 +01:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Jon Evans 4c83b0a94d Move TOOL_ACTIONs to their corresponding tools; create COMMON_TOOLS
Some grid/zoom tools are left in PCBNEW_CONTROL because they currently
depend on Pcbnew-specific class members.  Once refactoring is done to
make it possible to use all zoom and grid controls outside of pcbnew,
these last tools can be moved to common to match their ACTIONs.
2017-02-22 10:32:48 +01:00
Jon Evans 167f45ca2b Refactor COMMON_ACTIONS into a base and derived class
New virtual class ACTIONS is added as a member to EDA_DRAW_FRAME so
that the TOOL_DISPATCHER can have access to the appropriate derived
version of TranslateLegacyId()
2017-02-22 10:32:48 +01:00
John Beard ca91c27852 Adjust pad sub-menu enablements
The apply settings and push settings options now take account of the
validity of the global pad settings when deciding whether to show or
not.

Global pad push now requires a source pad and doesn't push from the
global pad setting when there is no selection.

The whole submenu is hidden when there are no enabled items.

Fixes: lp:1664016
* https://bugs.launchpad.net/kicad/+bug/1664016
2017-02-20 11:08:34 +01:00
John Beard 8766b475c6 Sanitise incoming GAL config options using mapping tables
When reading config options from files, it's important to make sure the
value makes sense - the incoming data could be anything, and may have
incompatible values or be otherwise unreliable.

This introduces a simple way to define and use "mapping tables" which
can map between a "native" value, probably an enum (but not necessarily)
and some external value, for example the value written to file.

This provides a decoupling between the two values, as well as sanitising
inputs and outputs. This is important, as over time, if there isn't a
decoupled interface, changing options result in corrupt configs, or a
proliferation of obsolete enum values kept for compatibility.
2017-02-20 10:52:34 +01:00
John Beard 0bf3a19967 Add user control for grid minimum spacing in GAL
This allows the user to set a thicker grid line without causing the
grid lines to become over dense, or just make the grid denser according
to preference.

The term "density" is modified to "minimum grid spacing", which is
the pixel spacing between adjacent grid lines.

The spacing settings now comes in along, with other GAL display settings,
as part of GAL_DISPLAY_OPTIONS observer functionality. To this end, the
setter in GAL interface is removed, as an external user should be
setting this parameter via the GAL_DISPLAY_OPTIONS interface.
2017-02-20 10:52:34 +01:00
John Beard 970e4f8eb4 Add grid line thickness control to Display Options Dialog
This adds a user-settable control for the grid line thickness on GAL
canvases to the display options dialog.

The thickness settings now comes in, along with other GAL display
settings, as part of GAL_DISPLAY_OPTIONS observer functionality. To this
end, the setter in GAL interface is removed, as an external user should
be setting this parameter via the GAL_DISPLAY_OPTIONS interface.

Fixes: lp:1662482
* https://bugs.launchpad.net/kicad/+bug/1662482
2017-02-20 10:52:34 +01:00
John Beard 061d659bb1 Add a class to govern an "incrementing" text control
This class, INCREMENTAL_TEXT_CTRL, is used to provide a frameworks for
classes that want to control a text control that can be incremented
according to some scheme.

Also provided is a wxWidgets implementation with spin buttons for
control, as well as mousewheel support.
2017-02-20 10:52:34 +01:00
John Beard ff3bfaf82b Make KIGFX::GRID_STYLE an enum class
This provides stronger typing to these values.
2017-02-20 10:52:34 +01:00
John Beard 7ad30b7167 Move Grid style to Graphics Options dialog
This puts the graphical/display options with the other similar options
in that dialog, rather than with the dimension options found in the Set
Grid dialog, which is in the Dimensions menu.

Also place the option itself in the GAL Display Options structure, so it
can be updated using the observer mechanism there.

The setter for the style in the GAL interface is removed, as the public
interface for setting this option is now to modify the
GAL_DISPLAY_OPTIONS structure and notify the GAL when done.
2017-02-20 10:52:34 +01:00
John Beard ddded86a06 Give all GAL canvases access to a GAL_DISPLAY_OPTIONS structure instance
Also loads the gal options when loading a canvas, as the canvas
otherwise might not register the initial settings.
2017-02-20 10:52:34 +01:00
John Beard cdfcc9a2ab Put draw_frame.h GAL_DISPLAY_OPTIONS behind firewall
The GAL_DISPLAY_OPTIONS member of EDA_DRAW_FRAME is a private member and
is used in only a couple of places in the class. The real use of this
member is by a by-ref interface, GetGalDisplayOptions.

Because te GAL options are used by a very select few users of
EDA_DRAW_FRAME, it makes little sense to force all the (many) files
including draw_frame.h to also include gal_display_options.h, when the
vast majority have no need for it.

This massively speeds up compilation of the project when
gal_display_options.h is changed.

More isolation could be acheived by separating the GAL config types (eg
OpenGL antialias modes and grid style) from the options header, as,
although the GAL class uses them, not many includers of the GAL header
need the options struct as well.
2017-02-20 10:52:33 +01:00
Jon Evans 9d68c970dc Remove dependence on LAYER_ID from EDA_DRAW_PANEL_GAL 2017-02-20 09:15:55 +01:00
Chris Pavlina 2e07d83461 Reduce footprint preview flickering in component selector 2017-02-19 14:54:36 -05:00
Chris Pavlina 3d88cc2a36 Rename method for consistency with similar class
FOOTPRINT_PREVIEW_PANEL::AddToPanel -> InstallOnPanel
2017-02-19 07:53:02 -05:00
Chris Pavlina fb6bf0c861 Fix SetColumnWidth() assertion in TWO_COLUMN_TREE_LIST
Fixes: lp:1665982
* https://bugs.launchpad.net/kicad/+bug/1665982
2017-02-19 06:38:53 -05:00
Chris Pavlina 2632b1d1a0 Revamp component chooser and add footprint preview
This commit brings several changes:

- Add a footprint preview pane to the eeschema component selector
- Upgrade component list to wxTreeListCtrl
- Factor out wxTreeListCtrl subclass TWO_COLUMN_TREE_LIST which
  patches a column size bug
- Linkify datasheet URL in info pane
2017-02-18 21:39:55 -05:00
Jon Evans 7cd72d6ffb Move layer colors from PCB_RENDER_SETTINGS to RENDER_SETTINGS 2017-02-16 17:30:31 +01:00
Jon Evans 7058e4eb21 Setup painter in PCB_DRAW_PANEL_GAL instead of EDA_DRAW_PANEL_GAL 2017-02-16 17:30:31 +01:00
Wayne Stambaugh eb06b35852 Eeschema: fix schematic I/O plugin symbol name issue.
LIB_ID was changing the symbol name due to the parser dropping everything
past the first '/' character which is interpreted by LIB_ID as the item
version.  Add flag to ignore this in LIB_ID::SetLibItemName() and add a
new ctor so the library nickname, item name, and revision can be set as
required to prevent the standard LIB_ID parsing.

Fix a few places where PART_LIBS functions FindLibraryAlias() and
FindLibPar() were translating wxString symbol names to LIB_IDs where the
LIB_ID parser was truncating the symbol name.
2017-02-11 13:44:17 -05:00
Wayne Stambaugh 899fe08f20 Remove KICAD_USE_SCH_IO_MANAGER build option from docs and build info. 2017-02-10 11:58:15 -05:00
jean-pierre charras 283ba553ba Change wxItemMenu GetLabel (deprecated) to GetItemLabelText
GetLabel can compile or not, depending on the compatibility level used to build wxWidgets.
2017-02-10 08:33:48 +01:00
Maciej Suminski 1bcbbb41cd Fixed double menu entries in context menus 2017-02-10 00:08:53 +01:00
Maciej Suminski 060e163511 Fixed invoking TOOL_ACTIONs in submenus
Fixes: lp:1663101
* https://bugs.launchpad.net/kicad/+bug/1663101
2017-02-10 00:08:23 +01:00
Chris Pavlina bca74853d1 Display more information in component selector 2017-02-07 15:01:20 -05:00
Maciej Suminski 6561c8e61a Fixed a crash occuring on closing pad properties dialog in Windows
Fixes: lp:1660276
* https://bugs.launchpad.net/kicad/+bug/1660276
2017-02-07 00:07:43 +01:00
jean-pierre charras 1338ff02f9 Fix a build issue, broken by commit 78a5f450ce 2017-02-04 10:08:54 +01:00
Maciej Suminski 77af6547c1 Coverity fixes (mostly initializing variables) 2017-02-01 17:31:55 +01:00
jean-pierre charras 6ae65b4cba Dialog about: remove dead url link 2017-01-31 08:56:31 +01:00
Maciej Suminski 4b9243e0bf Allow registering TOOLs in any order. 2017-01-30 13:21:43 +01:00
Diogo Condeco 75ffcbcef5 MACOS Setfocus and CancelButtonIssue moved into dialog_shim.
Setfocus now works on macos dialogs by setting DLGSHIM_USE_SETFOCUS.
This option is only enabled __WXMAC__ is defined.

FixOSXCancelButtonIssue() is now called inside DIALOG_SHIM::SHOW.
All other calls from within the dialogs were removed.
2017-01-29 23:51:35 +01:00
jean-pierre charras 6c5808fd18 Update dale of last change. Add a small comment about CTL_OMIT_HIDE. 2017-01-29 09:29:49 +01:00
Dick Hollenbeck 35fc1f3361 Move "hide" back to prior fp_text location 2017-01-28 09:33:25 -05:00
Maciej Suminski 80956ef1e6 Added GAL::DrawPolygon(SHAPE_POLY_SET) & GAL::DrawPolyLine(SHAPE_LINE_CHAIN) 2017-01-27 19:08:32 +01:00
Chris Pavlina 498e8b122a Clean up file format error message a bit more
If a FUTURE_FORMAT_ERROR wraps another FUTURE_FORMAT_ERROR, only print
the error for it once.
2017-01-27 07:27:53 -05:00
Dick Hollenbeck d4acfb9f5a Remove doubled fp_text "hide" output, change *.kicad_pcb format under authorization of Wayne. Fix exceptions.cpp PARSE_PROBLEM which was missing the offset %d. 2017-01-26 08:02:35 -05:00
Maciej Suminski 8f82f04153 Copy menu title in CONTEXT_MENU::copyFrom() 2017-01-25 20:29:27 +01:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
Maciej Suminski 5d9190038f TOOL_EVENTs of "message" type are passed to all tools
Message type is a kind of notification, so it should be received by all
interested tools. It used to be like that in the past, but has been
broken recently.
2017-01-25 11:31:55 +01:00
Maciej Suminski 1102eb0d0d Store menu titles in CONTEXT_MENU
Previously a title had to be provided when a submenu was added,
but this led to storing the same title in many places.
2017-01-23 14:52:11 +01:00
jean-pierre charras 2b5769c0a8 Action plugins: simplify code, and fix an issue: the menubar was not correctly rebuilt after closing and reopening pcbnew from kicad.
It was also not correctly rebuilt after language change.
2017-01-23 13:27:49 +01:00
John Beard 7863e70181 Move PostCommandMenuEvent to EDA_BASE_FRAME
There is nothing PCB-frame-specific about this function,
it is equally applicable to an frame, for example
PCB_EDIT_FRAME and CVPCB_MAINFRAME, which have EDA_BASE_FRAME
as the nearest common ancestor, except KIWAY_PLAYER,
which is not really concerned with this kind of UI event method.
2017-01-23 11:41:00 +01:00
Maciej Suminski fc7be1a497 Removed redundant CONTEXT_MENU::m_parent field. 2017-01-23 11:40:59 +01:00
Maciej Suminski 682da70a86 Fixed the issue of creating and event handling in context menus (GAL).
When creating a copy of CONTEXT_MENU, always a CONTEXT_MENU instance was
constructed, whereas an inherited type should be used. Solved with
CONTEXT_MENU::create() that has to be overridden in inheriting classes.

Event & update handlers are now virtual functions, instead of setting
the handlers with Set{Event,Update}Handler().
2017-01-23 11:40:59 +01:00
jean-pierre charras d7ed3ede72 Ensure paths and filenames are always stored with '/' as separator in fp_lib_table, like in other kicad files.
Ensure also paths and filenames read from a fp_lib_table always use '/' as separator (works fine on Windows)
Fixes: lp:1658534
https://bugs.launchpad.net/kicad/+bug/1658534
2017-01-23 11:32:58 +01:00
Baranovskiy Konstantin 4be2c79b87 Make doc extension (pdf) case insensitive. 2017-01-22 10:40:37 -05:00
Robbert Lagerweij 550a1ea4d6 eeschema: set title of plotted pdf to sheet title
Fixes: lp:1656956
https://bugs.launchpad.net/kicad/+bug/1656956
2017-01-20 17:11:12 -05:00
jean-pierre charras 2de913797a Fix a UI policy issue. Very minor cosmetic change: give same look to Zoom and Grid selection in 2 menus. 2017-01-20 11:35:24 +01:00
jean-pierre charras adb679dc46 ROUTER_TOOL_MENU: add zoom selection to this menu. 2017-01-20 08:51:12 +01:00
jean-pierre charras e710b8b370 Fix incorrect parameter type when appending zoom and grid menuitems 2017-01-19 20:26:57 +01:00
Tomasz Włostowski ba9576b014 router: snap to clearance boundaries in Highlight Collisions mode
Fixes: lp:1655819
* https://bugs.launchpad.net/kicad/+bug/1655819
2017-01-19 17:47:15 +01:00
Maciej Suminski 838c6097d9 Removed a redundant assert in OPENGL_COMPOSITOR. 2017-01-18 14:30:08 +01:00
Maciej Suminski 196c5aca83 Fixed 'unreferenced local variable' warning in OPENGL_GAL. 2017-01-18 14:23:06 +01:00
Maciej Suminski 75fb04d650 TOOL_ACTIONs are handled with transitions, no handlers needed in the event loops
There used to be a number of TOOL_ACTIONs that had entries both in
SetTransitions() and the event loop, which seemed redundant and
troublesome.
Now it is not necessary anymore, transitions setup is enough to execute
associated actions.
2017-01-18 14:20:39 +01:00
Maciej Suminski 3c61b16e7b Code formatting 2017-01-18 13:22:40 +01:00
Maciej Suminski c758f434c0 Removed unused fields in VIEW & ANTIALIASING_SMAA classes 2017-01-18 13:22:18 +01:00
Baranovskiy Konstantin 3dc2050498 Improved MousewheelPAN mode. 2017-01-17 16:34:11 -05:00
Maciej Suminski 004ca3c6f9 Fixed a memory leak in VIEW_ITEM (proper way of doing 9bc2bb2)
The problem with simple deleting VIEW_ITEM_DATA upon VIEW_ITEM removal was
caused by the default copy constructors that copied pointers.
Once a copy of an item was destroyed, the VIEW_ITEM_DATA has been
destroyed, effectively invalidating m_viewPrivData for the other item.
2017-01-16 14:57:50 +01:00
Chris Pavlina 99bfa2fea2 Revert "Fixed a VIEW_ITEM memory leak"
This reverts commit 9bc2bb2651.

Fixes: lp:1656481 (pcbnew segfault in KIGFX::VIEW_ITEM_DATA::getGroup)
https://bugs.launchpad.net/kicad/+bug/1656481
2017-01-13 21:37:31 -05:00
Maciej Suminski bf735b6fe7 Yet another trial to use wxString as a std::runtime_error message 2017-01-13 22:48:26 +01:00
Maciej Suminski 90710cfcc5 Added a missing #include directive 2017-01-13 17:15:32 +01:00
Maciej Suminski 7eacd1b15d Restored cursor in OpenGL canvas (still an issue with subpixel AA) 2017-01-13 17:10:16 +01:00
Maciej Suminski 7cf1cfedb3 Change exception message time from wxString to std::string 2017-01-13 16:59:31 +01:00
Maciej Suminski 88eb648cbb Alternative way of handling OpenGL initialization & errors
Some faults could result in a crash, as they were not properly
handled. Now the rendering loop is wrapped with try..catch block
which will revert to Cairo in case of an error and display an
error message.

Fixes: lp:1655766
* https://bugs.launchpad.net/kicad/+bug/1655766
2017-01-13 16:50:36 +01:00
Maciej Suminski e0577c0218 checkGlError() may throw exceptions or display an error message 2017-01-13 16:46:02 +01:00
Maciej Suminski 5a7604cbb4 More code formatting 2017-01-13 10:36:59 +01:00
Maciej Suminski 9bc2bb2651 Fixed a VIEW_ITEM memory leak 2017-01-12 15:41:00 +01:00
Maciej Suminski aabf8300c3 Removed non-ASCII characters 2017-01-12 09:20:04 +01:00
Maciej Suminski 67b0a8c990 Fixed type casting in SHADER class 2017-01-11 17:37:10 +01:00
Maciej Suminski da00d64877 OpenGL antialising code clean up & formatting 2017-01-11 16:20:37 +01:00
decimad 32a125a767 improve class observable 2017-01-11 16:20:37 +01:00
decimad 5a4e247564 EDA_DRAW_PANEL_GAL now takes the gal display options per dependency injection
Add a hack so that the pad properties base dialog constructor can pass in the dependency. Since the derived dialog's constructor takes the parent by this exact type, the static cast is safe.
2017-01-11 16:20:37 +01:00
decimad e71070fe1b final touch-ups (license information, includes) 2017-01-11 16:20:37 +01:00
decimad 64cd1228ea Clearer error messages for OPENGL_COMPOSITOR::CreateBuffer() (thanks Orson) 2017-01-11 16:20:37 +01:00
decimad 77138e3702 Add UI control to set up gal opengl antialiasing and load/store the settings 2017-01-11 16:20:37 +01:00
decimad bbaeeceeac A model/subscribe helper-class OBSERVABLE to common 2017-01-11 16:20:37 +01:00
decimad 2a8dd508c4 Add smaa (subsample morphological antialiasing) 2017-01-11 16:20:37 +01:00
decimad afacee5d96 Add supersampling (2x/4x) antialiasing 2017-01-11 16:20:37 +01:00
decimad 02bb410cdb Refactor COMPOSITOR/OPENGL_COMPOSITOR to enable customization of scene rendering and presentation 2017-01-11 16:20:35 +01:00
decimad 77f9cd0cb0 remove custom shader header generation build-step in favor of c++11 raw string literals
rework shader loading code to handle an arbitrary amount of to-be-concatenated strings
2017-01-11 16:20:34 +01:00
decimad 047f52e7cb Move builtin font resources out of opengl_gal translation unit 2017-01-11 16:20:33 +01:00
Oliver Walters 66ee44cb1f Footprint Wizards Update 2017-01-03 16:01:47 +01:00
jean-pierre charras d56a49d218 Performance counter rework: More comments, code cleaning, and move GetRunningMicroSecs() prototype from common.h to profile.h.
profile.h should now contain all info for profiling.
2017-01-02 13:49:36 +01:00
jean-pierre charras fff449ecf0 Performance counter rework: Add comments, fix coding style issues. 2016-12-31 13:00:24 +01:00
Simon Richter ac9f858813 Performance counter rework 2016-12-31 12:57:42 +01:00
jean-pierre charras b8b08dafd6 Code cleaning: remove pcbcommon.* which contains nothing really useful. The very few lines of code are moved to a better place. 2016-12-31 12:56:21 +01:00
jean-pierre charras a9fbedfb12 More Coverity warnings fixes. 2016-12-30 14:36:23 +01:00
jean-pierre charras dec2d6e8cc Fix a few Coverity warnings. A bit of clean code in export_vrml.cpp. 2016-12-30 12:40:05 +01:00
Chris Pavlina aa27e9ff7e IO_ERROR: improve What() message 2016-12-29 13:50:38 -05:00
Maciej Suminski effc8bebb1 Store view flip setting between canvas changes 2016-12-12 16:45:52 +01:00
Maciej Suminski 027515f4e1 Fixed refreshing after flipping the view 2016-12-12 16:45:52 +01:00
Maciej Suminski 7ad5fca6de More code formatting, updated copyright headers 2016-12-12 16:45:52 +01:00
Maciej Suminski a2a950fdae Reduced the Cairo command entry size 2016-12-12 16:45:52 +01:00
Maciej Suminski 660e4ca9d4 Cairo group arguments are stored in a union. 2016-12-12 16:45:52 +01:00
Maciej Suminski 8f924ed125 Added checks to ensure VIEW_ITEM_DATA != nullptr. 2016-12-12 16:45:52 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski daf103d7e4 GAL: fix grid origin and grid rendering in flipped view mode 2016-12-12 16:45:52 +01:00
Tomasz Włostowski da28e163d2 Optimizations/fixes to the VIEW/GAL classes:
- much faster Cairo rendering (outperforms legacy)
- improvements in VIEW update handling
- fixed issue with grid rendering in flip view mode
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 3f7c5a0845 fixed post-rebase issues 2016-12-12 16:45:52 +01:00
Tomasz Włostowski c661c30f68 pcbnew: added flip view mode 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 1c1f4e9a50 Refactoring of VIEW/VIEW_ITEM classes:
- Remove dependency of EDA_ITEM on VIEW
- VIEW_ITEM is now a pure virtual interface
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 27a10e8597 Multiple simplifications to GAL tools in PCBNew:
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
2016-12-12 16:45:52 +01:00
jean-pierre charras 5d7d210f28 Simulator, plot panel: fix incorrect calculation of the vertical size of the traces when resizing the simulator frame 2016-11-28 15:37:00 +01:00
jean-pierre charras c225af747f mathplot: fix a bug and remove unused variables ( it fixes a few compil warnings) from Coverity analysis.
Uncrustify mathplot.h and fix a few coding style issues.
2016-11-28 14:18:22 +01:00
jean-pierre charras 30df041de6 fix shadowed local variables 2016-11-25 18:17:34 +01:00
Wayne Stambaugh fd54d394bd Version string improvements.
Define empty string variable KICAD_BRANCH_NAME that can be used as an
optional version string element.  When git is used to build the version
string, this variable is set to the git branch name.  It can also be
defined at configuration time as an optional string appended to the
$KICAD_VERSION variable.

Define empty string variable KICAD_VERSION_EXTRA that can be set by
the user at configuration.

The variables KICAD_BRANCH_NAME and KICAD_VERSION_EXTRA are only
appended to KICAD_VERSION if they are set.  Otherwise, only KICAD_VERSION
is uses as the version string.

Update the developer building from source document to reflect the changes.
2016-11-25 09:09:10 -05:00
unknown 334c50477a Auto save: fix case of auto save interval is set to 0 (disabling auto save feature)
This fix allows also the new value of the auto save interval immediately taken in account.
2016-11-22 11:26:31 +01:00
Simon Richter f7cc0a9334 Add missing build dependency.
The generated lib_table_lexer.h file is required to build the pcbcommon
static library.
2016-11-21 07:38:15 -05:00
Wayne Stambaugh 64c892ee23 Make footprint ID into a generic library ID.
Rename FPID to LIB_ID as is now used as a generic library identifier and
is no longer specific to footprints.

Remove all mention of footprint from the new LIB_ID doxygen comments and
code.

Rename files fpid.h and fpid.cpp to lib_id.h and lib_id.cpp.

Rename fp_lib_table.keywords file to lib_table.keywords and adjust CMake
build dependencies accordingly.

Update all source files effected by the code and file name changes.

Update .gitignore for file name changes.
2016-11-20 18:35:08 -05:00
Wayne Stambaugh 4d018039aa Eeschema: lay the groundwork for symbol library tables.
Create SYM_LIB_TABLE and SYMBOL_LIB_TABLE_ROW objects derived from LIB_TABLE
and LIB_TABLE_ROW respectively for supporting symbol library tables.

Add FPID member to LIB_PART for associating a symbol to a specific library
nickname.  Please note, this is not used in any way at this time and will be
implemented when the symbol library table is actually implemented.

Add sym_lib_table keyword to keywords file.  This is a temporary measure
until a more elegant method for parsing and formatting library tables can
be implemented.

Build FPID support in the common library instead of the pcbcommon library
for use in Eeschema.
2016-11-20 13:38:20 -05:00
Wayne Stambaugh 40e93d263d Split out library table common code into separate source files. 2016-11-20 13:34:03 -05:00
Wayne Stambaugh b9c296420a Complete library table and library table row refactor.
Derive LIB_TABLE_ROW from boost::noncopyable for use in boost pointer
containers.

Use std::unique_ptr to manage PROPERTIES pointer.

Add clone support for boost pointer containers.

Split common library table code out from FP_LIB_TABLE into base LIB_TABLE
object.  The FP_LIB_TABLE object only contains the code specific to
footprint library tables.

Use boost::vector_ptr for storing library table row objects.

Fix move up and down bugs in footprint library table edit dialog.
2016-11-19 17:16:43 -05:00
Chris Pavlina b9c62b658e Bring back KICAD_REPO_NAME 2016-11-12 16:16:35 -05:00
Jean-Noel Avila 58af5bc3a4 Eeschema: Fix off-by-one in saving bitmaps 2016-11-09 09:46:35 +01:00
Wayne Stambaugh 192d4b87ad Rework footprint library table for use in symbol library table.
Factor out ROW object from FP_LIB_TABLE so it can be reused to create a
symbol library table row object.

Create base LIB_TABLE_ROW object from ROW object common code.

Derived FP_LIB_TABLE_ROW object from LIB_TABLE_ROW to provide support for
footprint library table rows.

Update all instances of FP_LIB_TABLE::ROW with FP_LIB_TABLE_ROW.

Purge wxT() macros from modified files where possible.
2016-10-28 09:12:28 -04:00
Maciej Suminski a2f06a9dc4 Merge branch 'font-refine' 2016-10-21 10:25:42 +02:00
Maciej Suminski 74b5858665 Fixed a crash when removing zones using the Global Deletion dialog
Fixes: lp:1635266
* https://bugs.launchpad.net/kicad/+bug/1635266
2016-10-20 17:15:50 +02:00
decimad 402f53a302 update font code along with the changes done in the msdf atlas tool (use codepoint spans and refined char placement)
add font coordinate system clarification drawing (svg)
2016-10-20 14:31:09 +02:00
decimad d9a8aac96c transfer font texture width to the fragment shader via uniform variable 2016-10-20 14:31:09 +02:00
Tomasz Włostowski bb20a7f592 common: remove dependency on libbitmaps in EDA_ITEM::GetMenuImage() 2016-10-19 17:54:00 +02:00
Tomasz Włostowski 69cd7177b9 SHAPE_POLY_SET: mark all newly added hole outlines as closed 2016-10-19 17:54:00 +02:00
jean-pierre charras 9fdcba8229 Gerbview: Fix 2 (minor) issues in aperture macro "moire". Add a .gbr test file for this aperture macro. 2016-10-13 10:26:49 +02:00
Wayne Stambaugh 03da56a9b5 Minor version string generation improvements.
Remove the KICAD_REPO_NAME option from the main cmake file and the
generated config.h file since it is no longer used.

Set the default branch name to "undefined" in CreateGitVersionHeader.cmake
instead of the KICAD_REPO_NAME option.

Remove generating KICAD_FULL_VERSION from CreateGitVersionHeader.cmake
and add it to WriteVersionHeader.cmake so that the default settings and
the new KiCadVersion.cmake definitions can be used to generate the full
version string as well.

Check to see if the branch name is set and only use the version to
generate the full version string.  This allows the use of the KiCad
version cmake file to create a version only string like "4.0.4" with
no trailing branch name.

Change build_version.cpp to use the full version string rather than
concatenating the version and branch strings.
2016-10-12 20:29:46 -04:00
Cirilo Bernardo 48ed9f080e Add Help Menu item to open browser at kicad-pcb.org/contribute 2016-10-10 19:01:45 -04:00
decimad 4248a7ffce remove boost::thread dependency 2016-10-09 10:33:52 -04:00
jean-pierre charras fdebcd8a6d Fixes: lp:1629387 (pagelayout text sometimes shrinking)
https://bugs.launchpad.net/kicad/+bug/1629387
2016-10-06 17:19:55 +02:00
Chris Pavlina 71263c32e8 Dismiss signed index warning in opengl_gal.cpp 2016-09-30 22:32:24 -04:00
Chris Pavlina 91c8201b8b Dismiss warning for inconsistent exception spec in ~KIWAY_PLAYER() 2016-09-30 22:32:24 -04:00
Maciej Suminski 7a5f72c948 Fixed a crash when drawing a single point polyline 2016-09-29 15:34:08 +02:00
Maciej Suminski 1420a0179f Removed deprecated pragmas to mute warnings 2016-09-26 14:53:43 +02:00
Simon Richter ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04:00
jean-pierre charras e9c0dc1a2b Fix a minor issue when creating net attributes in Gerber files for oval pads when they are not horizontal or vertical . 2016-09-25 10:55:24 +02:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Dick Hollenbeck 374808ac5b Cleanup SWIG's board.i, remove scrap *.{ref,orig} files, and add .pyc to .gitignore 2016-09-23 08:04:12 -04:00
decimad 6a9c1cb6a1 Split the undo/redo event into the two stages "pre" and "post" for convenient synchronization of dependent state. 2016-09-23 13:29:25 +02:00
Dick Hollenbeck 29be200843 Add SWIG support for NETCLASSPTR. Reduce SWIG visibility from C++ headers. 2016-09-21 19:52:04 -04:00
decimad ee3d75f273 Add coroutine call invocation context to identify the main stack frame.
Run the text draw-tool on the main stack frame.

Fixes: lp:1547282
* https://bugs.launchpad.net/kicad/+bug/1547282
2016-09-21 11:56:40 +02:00
Dick Hollenbeck 1edaa773d3 Fix minor SWIG issues due to git rebase issues. 2016-09-20 21:52:48 -04:00
Dick Hollenbeck 1718ac1083 More SWIG improvements.
SWIG support for BOARD_ITEM_CONTAINER.
Split board.i into smaller included *.i files.
Add depencies on these smaller *.i files to CMakeLists.txt
2016-09-20 21:48:44 -04:00
Dick Hollenbeck d957670034 Add more HANDLE_EXCEPTIONS(), board.i refactoring. 2016-09-20 12:00:17 -04:00
Dick Hollenbeck 64232ce10c Comment out kiway from python preliminary work. 2016-09-20 12:00:09 -04: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
Dick Hollenbeck 9ad49dc2d1 Split IO_ERROR out of richio.* and store Problem() and Where() separately 2016-09-20 11:56:18 -04:00
Simon Wells a2116ae070 Removed wxPaintDC from EDA_DRAW_PANEL_GAL::onPaint() 2016-09-19 15:17:18 +02:00
jean-pierre charras 6edee2ae1d Prepare Plot Gerber file to include advanced aperture and net attributes.
This option is not yet activated because the net attributes are not yet fully fixed by Ucamco, in Gerber file format specifications.
(To activate it, see dialog_plot.cpp, line 43)
2016-09-19 13:01:36 +02:00
decimad f78721b451 Multichannel Signed Distance Field text rendering for OpenGL GAL 2016-09-14 10:00:49 +02:00
Maciej Suminski 6481ff75c9 Changed one of COMMIT::Stage() methods to COMMIT::Modified() 2016-09-12 13:45:57 +02:00
Maciej Suminski 65b1225231 Added CHT_DONE flag to COMMIT::Stage to skip add/remove step 2016-09-12 13:45:57 +02:00
Maciej Suminski 74d53e517c VIEW_GROUP objects redraw itself after a change 2016-09-12 11:50:06 +02:00
Maciej Suminski acd7214586 Moved commit.h to 'include' directory 2016-09-12 11:50:06 +02:00
Maciej Suminski 38177b70b9 Comments for COMMIT class 2016-09-12 11:50:06 +02:00
Maciej Suminski 940765f4b3 COMMIT class: removed m_committed flag, added clear() and Empty() methods. 2016-09-12 11:50:06 +02:00
Maciej Suminski b8350f037b COMMIT: Added an interface to store items that already have a copy created. 2016-09-12 11:50:06 +02:00
Maciej Suminski 0223425d30 COMMIT: changed BOOST_FOREACH to for. 2016-09-12 11:50:06 +02:00
Maciej Suminski dac7c5aa1f Store parent object when creating a COMMIT. 2016-09-12 11:50:06 +02:00
Tomasz Wlostowski 9588a7974c Added classes COMMIT & BOARD_COMMIT. 2016-09-12 11:50:06 +02:00
Maciej Suminski b5bfa14057 Removed unused EDA_ITEM::m_Image field. 2016-09-12 11:50:06 +02:00
Maciej Suminski 1dd43d1d98 Unified undo buffer handling code for PCB & module editor.
Replaced UR_MODEDIT with UR_CHANGED.
2016-09-12 11:50:06 +02:00
Maciej Suminski 09e0311d4e Replaced Copy() method with operator=. Removed Copy() where default copy ctor was enough. 2016-09-12 11:50:06 +02:00
Maciej Suminski f95628c132 Switched to default constructor and operator= for EDA_TEXT. 2016-09-12 11:50:06 +02:00
Ian Roth 7ad2f37391 Add %L formatter to worksheets to print layer name. 2016-09-10 14:23:59 -04:00
Chris Pavlina 7318238daa Update version string formatting after git migration
It is no longer necessary (or sensible) to include a simulated bzr
revision number, and we can reliably get a branch name now. Therefore,
the new version strings look like:

(2016-08-26 revision 67230ac)-master
 |                   |        |
 |                   |        branch name, "HEAD" if not on a branch,
 |                   |          or "unknown" if no .git present
 |                   |
 |                   abbreviated commit hash, or no-git if no .git
 |                     present
 |
 date of commit, or date of build if no .git present

Signed-off-by: Chris Pavlina <pavlina.chris@gmail.com>
2016-09-09 20:19:54 -04:00
Nick Østergaard 76f78bb48b Remove unused version info
USE_FP_LIB_TABLE is not used anywhere in the code when grepping
2016-09-04 19:14:26 -04:00
Nick Østergaard c784d45ed7 Add new development build swtiches to version info
Add:
* KICAD_USE_SCH_IO_MANAGER
* KICAD_USE_OCE
2016-09-04 19:13:05 -04:00
Wayne Stambaugh cbcb3b896b Fix incorrect string translation macros.
* Replace _T() with _() for translatable strings.

* Don't translate debug messages.

* Don't translate copyright symbol.
2016-09-03 12:10:49 -04:00
Chris Pavlina 4b6d28333e Revert "Memoize SHAPE_LINE_CHAIN bounding box computation"
This reverts commit 30566de69a, which
caused some issues in PNS.
2016-09-01 12:09:06 -04:00