geda-pcb/pcjc2.git
7 years agoHack to avoid GL calls when we're out of contextpcb+gl_on_fixup_hidgl/hack-to-avoid-gl-calls-when-we
Peter Clifton [Sun, 4 Jan 2015 20:07:17 +0000 (4 20:07 +0000)]
Hack to avoid GL calls when we're out of context

7 years agoAdd cache for board-outlinepcb+gl_on_fixup_hidgl/add-cache-for-board-outline
Peter Clifton [Sun, 4 Jan 2015 20:07:17 +0000 (4 20:07 +0000)]
Add cache for board-outline

This adds a cache of the board outline, to improve rendering speed
when plotting the board with an outline.

The cache is invalidated when the "outline" or "route" layer is
updated. We catch this by bodging the ClearFromPolygon() routine,
which is called for almost all layer geometry changes which might
affect us.

XXX: We really need to add a nicer place to be notified of board
layer changes!

7 years agoBoard outline polygon generationpcb+gl_on_fixup_hidgl/board-outline-polygon
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
Board outline polygon generation

FIXME: Make this work with the GL masking polygon drawing routines, rather
       than relying on the dicer.

7 years agoAdd routines to render just a single contourpcb+gl_on_fixup_hidgl/add-routines-to-render-just-a
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
Add routines to render just a single contour

Use them rather than the GLU tessellator

7 years agoBORAST: Fixup to only draw the passed POLYAREA, not walk the linked list of POLYAREA... pcb+gl_on_fixup_hidgl/borast-fixup-to-only-draw-the
Peter Clifton [Thu, 8 Jan 2015 01:17:10 +0000 (8 01:17 +0000)]
BORAST: Fixup to only draw the passed POLYAREA, not walk the linked list of POLYAREA and draw them all!

7 years agoborast: Win32: Comment #define in borast-compiler-private.hpcb+gl_on_fixup_hidgl/borast-win32-comment-define-in
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
borast: Win32: Comment #define in borast-compiler-private.h

7 years agoFix borast not to build for non-GL enabled buildspcb+gl_on_fixup_hidgl/fix-borast-not-to-build-for
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
Fix borast not to build for non-GL enabled builds

7 years agoFixup borast to buildpcb+gl_on_fixup_hidgl/fixup-borast-to-build
Peter Clifton [Thu, 8 Jan 2015 00:37:27 +0000 (8 00:37 +0000)]
Fixup borast to build

7 years agoBentley-Ottann test implementationpcb+gl_on_fixup_hidgl/bentley-ottann-test
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
Bentley-Ottann test implementation

Code from cairo - intersection routines stripped out

XXX: Appears to be some breakage in demo.pcb (See top LHS component layer polygons)

7 years agoSilly space navigator interface to allow funky viewspcb+gl_on_fixup_hidgl/silly-space-navigator
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
Silly space navigator interface to allow funky views

7 years agoDraw pin / pad names first, so they don't get masked by the padpcb+gl_on_fixup_hidgl/draw-pin-pad-names-first-so
Peter Clifton [Sun, 4 Jan 2015 20:07:16 +0000 (4 20:07 +0000)]
Draw pin / pad names first, so they don't get masked by the pad

Since we use stencil masking to ensure we don't redraw an area
multiple times, confusingly, we need to draw the text first to
ensure it isn't occluded by the pad its-self.

HACK:

We probably draw the names multiple times - as we still use the
common draw.c code which assumes it can draw labels on top of
the pads.

7 years agogtk/gl: Play with layer translucencypcb+gl_on_fixup_hidgl/gtk-gl-play-with-layer
Peter Clifton [Sun, 4 Jan 2015 21:26:54 +0000 (4 21:26 +0000)]
gtk/gl: Play with layer translucency

7 years agoAdd support for drawing objects from the soldermask layerpcb+gl_on_fixup_hidgl/add-support-for-drawing
Peter Clifton [Sun, 4 Jan 2015 21:26:53 +0000 (4 21:26 +0000)]
Add support for drawing objects from the soldermask layer

7 years agoFixup code to determine whether we draw pins/vias on a given layerpcb+gl_on_fixup_hidgl/fixup-code-to-determine
Peter Clifton [Wed, 7 Jan 2015 01:09:17 +0000 (7 01:09 +0000)]
Fixup code to determine whether we draw pins/vias on a given layer

The net change of this patch is that we consider whether to draw pins/vias
for each layer within the layer group. Previously, if we encoundered a layer
named "outline" or "route" within the layer group, all _subsequent_ layers
within that group would not have their pins/vias rendered.

As ordering of the layers within the group should not be important like this,
change behaviour to apply test on a per-layer basis.

7 years agodraw_funcs.c: Don't draw pins/vias in layer for non GUI exporterspcb+gl_on_fixup_hidgl/draw_funcs-c-don-t-draw-pins
Peter Clifton [Wed, 7 Jan 2015 01:41:02 +0000 (7 01:41 +0000)]
draw_funcs.c: Don't draw pins/vias in layer for non GUI exporters

The non-gui paths render pins and vias with draw_ppv, so no need to
also render them for each layer.

7 years agoFixup gtkhid-gl to buildpcb+gl_on_fixup_hidgl/fixup-gtkhid-gl-to-build
Peter Clifton [Thu, 8 Jan 2015 00:33:58 +0000 (8 00:33 +0000)]
Fixup gtkhid-gl to build

7 years agoMajor re-write to drawing routinespcb+gl_on_fixup_hidgl/major-re-write-to-drawing
Peter Clifton [Wed, 7 Jan 2015 01:38:16 +0000 (7 01:38 +0000)]
Major re-write to drawing routines

FIXME: FULLY OF NASTY API HACKS TO draw.c

Notes from squashed patches:
  Pin and via hole cores are drawn in the appropriate colour
  Playing with stack rendering order
  Fix mask display in 3D (Allow both side masks to display at once)
  Fix rendering depths for silk and mask layers
  Fixup depth for layers and element marks
  Move more rendering to world coordinates
  Fix get_coords function
  Re-write parts of the PCB+GL set_layer function
  Fix layer on/off rendering after commit 9768e060fad7bc3dfc366da76ea1db8154005018
  Only assign stencil planes where sub-compositing is required - that is, not the far-side, mask, rat or switched off layers.
  Pass an explicit graphics context to DrawAttached and DrawMark

7 years agoTMP FIXESpcb+gl_on_fixup_hidgl/tmp-fixes
Peter Clifton [Wed, 7 Jan 2015 01:38:15 +0000 (7 01:38 +0000)]
TMP FIXES

7 years agoDRAW_FUNCS: Attempt at different render order for PCB+GLpcb+gl_on_fixup_hidgl/draw_funcs-attempt-at
Peter Clifton [Wed, 7 Jan 2015 01:38:15 +0000 (7 01:38 +0000)]
DRAW_FUNCS: Attempt at different render order for PCB+GL

7 years agoFixup gtkhid-gl.c to accomodate depth being set per hidgl contextpcb+gl_on_fixup_hidgl/fixup-gtkhid-gl-c-to
Peter Clifton [Thu, 8 Jan 2015 00:19:52 +0000 (8 00:19 +0000)]
Fixup gtkhid-gl.c to accomodate depth being set per hidgl context

7 years agoShiny 3D eye-candypcb+gl_on_fixup_hidgl/shiny-3d-eye-candy
Peter Clifton [Thu, 8 Jan 2015 00:01:42 +0000 (8 00:01 +0000)]
Shiny 3D eye-candy

Experiments in progress - don't expect this to work yet!

Squashed:
  Fix grid extents in 3D view

7 years agoCrasy testpcb+gl_on_fixup_hidgl/crasy-test
Peter Clifton [Thu, 8 Jan 2015 00:01:42 +0000 (8 00:01 +0000)]
Crasy test

7 years agoTemp play of splitting out hidgl API changes from big refactor
Peter Clifton [Wed, 7 Jan 2015 20:05:36 +0000 (7 20:05 +0000)]
Temp play of splitting out hidgl API changes from big refactor

7 years agoRemove unused parameter SetDefaultNames from CreateNewPCB
Peter Clifton [Wed, 7 Jan 2015 00:56:50 +0000 (7 00:56 +0000)]
Remove unused parameter SetDefaultNames from CreateNewPCB

The SetDefaultNames parameter to CreateNewPCB was not used (despite various
callers passing both true and false), so remove it.

7 years agoAlways set default layernames for silk and mask layers
Peter Clifton [Wed, 7 Jan 2015 01:33:20 +0000 (7 01:33 +0000)]
Always set default layernames for silk and mask layers

This avoids incorrect layernames being left over from our layer stack
should a board be loaded with missing layers (e.g. an old file format
board with no solder-mask layers).

XXX: Check what happens if we load a board with LOTS of defined layers
(more than our default layer stack), but has Layer() definitions missing!
Does it crash?

7 years agoFixup some bugs from the added soldermask layers
Peter Clifton [Sun, 4 Jan 2015 21:16:36 +0000 (4 21:16 +0000)]
Fixup some bugs from the added soldermask layers

(TODO: Finish this fixup and merge it down into the relevant patches)

7 years agodraw.c: Opencode the mask layer object drawing functions
Peter Clifton [Sun, 4 Jan 2015 21:16:36 +0000 (4 21:16 +0000)]
draw.c: Opencode the mask layer object drawing functions

Calling DrawLayer() did not render using the correct graphics context / colors.
NB: We're still using the "wrong" GC, but we now avoid selecting inappropriate
colors which prevent (say) PS export working correctly for mask layer objects.

7 years agoAdd support for a two soldermask layers, defining regions of removed mask
Peter Clifton [Sun, 4 Jan 2015 21:16:35 +0000 (4 21:16 +0000)]
Add support for a two soldermask layers, defining regions of removed mask

File-format wise, these work similarly to how silk layers are supported now:

Layer (1 to n "[NAME]")            # "ordinary" design layers
Layer (n+1 "silk")                 # bottom side silk
Layer (n+2 "silk")                 # top side silk
Layer (n+3 "bottom soldermask")    # bottom side soldermask
Layer (n+4 "top soldermask")       # top side soldermask

7 years agoAvoid hard-coding the number of extra layers in use (for 2x silkscreen)
Peter Clifton [Sun, 4 Jan 2015 21:16:35 +0000 (4 21:16 +0000)]
Avoid hard-coding the number of extra layers in use (for 2x silkscreen)

We will shorty add support for soldermask layers, so this will need changing

NOTE....... IF THE parse_y.y patch in the stg series before this gets
dropped, there is one more case where + 2 needs to be replaced with EXTRA_LAYERS

7 years agofind.c: The User varaible needs to die...
Peter Clifton [Sun, 4 Jan 2015 21:16:35 +0000 (4 21:16 +0000)]
find.c: The User varaible needs to die...

Reduce its usage to where absolutely necessary... oh, what a surprise,
another variable passing state down into add_object_to_list ()

7 years agoAdd the drc flag as a parameter
Peter Clifton [Sun, 4 Jan 2015 21:16:35 +0000 (4 21:16 +0000)]
Add the drc flag as a parameter

Ok, this is nasty.. I'm obscuring setting of the global varaible... be careful!

7 years agoAdd the bloat as a parameter
Peter Clifton [Sun, 4 Jan 2015 21:16:35 +0000 (4 21:16 +0000)]
Add the bloat as a parameter

Ok, this is nasty.. I'm obscuring setting of the global varaible... be careful!

7 years agofind.c: Refactor some common sequences into a helper function
Peter Clifton [Sun, 4 Jan 2015 21:16:34 +0000 (4 21:16 +0000)]
find.c: Refactor some common sequences into a helper function

7 years agoparse_y.y: Try to avoid two shift/reduce and reduce/reduce warnings
Peter Clifton [Sun, 4 Jan 2015 21:16:34 +0000 (4 21:16 +0000)]
parse_y.y: Try to avoid two shift/reduce and reduce/reduce warnings

TODO: Check this matches up against our expected behavior.

Removing the parsedata section ("I think") has no effect, as elements
hit the alternative | element clause within parsepcb.

HOWEVER... I need to check whether there is any other valid syntax
inside an element file, or any backwards compatibility with old formats
which we may miss with the loss of parsedata.

7 years agoPlay with grid snapping heuristics a little
Peter Clifton [Sun, 4 Jan 2015 21:16:34 +0000 (4 21:16 +0000)]
Play with grid snapping heuristics a little

Require the pointer to be inside the bounding box of a pin / pad / via before snapping.
This makse it MUCH easier to place vias in a regular grid spaced at the PCB grid spacing.

7 years agoAdd hysteresis to grid-snapping
Peter Clifton [Sun, 4 Jan 2015 21:16:34 +0000 (4 21:16 +0000)]
Add hysteresis to grid-snapping

7 years agoUse calling wrappers rather than accessing HID_DRAW* vfunc tables directly
Peter Clifton [Sun, 4 Jan 2015 20:07:53 +0000 (4 20:07 +0000)]
Use calling wrappers rather than accessing HID_DRAW* vfunc tables directly

7 years agoAdd calling wrappers for HID_DRAW virtual functions
Peter Clifton [Sun, 4 Jan 2015 20:06:06 +0000 (4 20:06 +0000)]
Add calling wrappers for HID_DRAW virtual functions

NB: hid_draw_make_gc() and hid_draw_use_mask() take a HID_DRAW * pointer,
    not a hidGC pointer like all the other hid_draw_*() functions..

Ugly inconsistency, but avoids making the change too disruptive.

7 years agoAdd a pointer in hid_gc_struct to link a gc and the relevant HID_DRAW vfunc table
Peter Clifton [Sun, 4 Jan 2015 18:50:37 +0000 (4 18:50 +0000)]
Add a pointer in hid_gc_struct to link a gc and the relevant HID_DRAW vfunc table

7 years agoRename hidGC "me_pointer" to "hid"
Peter Clifton [Sun, 4 Jan 2015 18:49:45 +0000 (4 18:49 +0000)]
Rename hidGC "me_pointer" to "hid"

The pointer provides a link between a HID specific graphics context and HID
in question, name it accordingly.

7 years agoExpose a base hidGC structure for HIDs to inherit from.
Peter Clifton [Sun, 4 Jan 2015 16:21:07 +0000 (4 16:21 +0000)]
Expose a base hidGC structure for HIDs to inherit from.

Have each HID inherit from a common base structure, which will later allow us
to store enough reference to the HID / HID_DRAW code owning the hidGC to
wrap up the API calls (rather than calling directly into the vfunc table).

7 years agoUpdate "missing" (automake) script to a later version
Peter Clifton [Sat, 3 Jan 2015 23:49:36 +0000 (3 23:49 +0000)]
Update "missing" (automake) script to a later version

Avoids some warnings at configure time noted with automake 1.14

7 years agoPass an explicit graphics context to DrawAttached and DrawMark
Peter Clifton [Sat, 3 Jan 2015 14:24:53 +0000 (3 14:24 +0000)]
Pass an explicit graphics context to DrawAttached and DrawMark

7 years agolesstif: Fix lesstif_use_mask and associated state to use the mask_mode enum
Peter Clifton [Sat, 3 Jan 2015 12:57:26 +0000 (3 12:57 +0000)]
lesstif: Fix lesstif_use_mask and associated state to use the mask_mode enum

7 years agohid/hidint.h: Remove header guard check, it appears not to be required
Peter Clifton [Sat, 3 Jan 2015 12:51:46 +0000 (3 12:51 +0000)]
hid/hidint.h: Remove header guard check, it appears not to be required

7 years agoUpdate header guard macro check in hidint.h to match rename
Peter Clifton [Sat, 3 Jan 2015 12:52:32 +0000 (3 12:52 +0000)]
Update header guard macro check in hidint.h to match rename

The header guard in global.h was renamed in
commit f6c2d4907583614a10918a121f45670620f1946e

Fixes an implicitly defined function warning in lesstif/main.c

7 years agolesstif: Silence two set but unused variable warnings
Peter Clifton [Sat, 3 Jan 2015 12:55:58 +0000 (3 12:55 +0000)]
lesstif: Silence two set but unused variable warnings

7 years agolesstif: Silence set but unused variable warning
Peter Clifton [Sat, 3 Jan 2015 12:13:04 +0000 (3 12:13 +0000)]
lesstif: Silence set but unused variable warning

7 years agolesstif: Silence set but unused variable warning
Peter Clifton [Sat, 3 Jan 2015 12:11:39 +0000 (3 12:11 +0000)]
lesstif: Silence set but unused variable warning

7 years agolesstif: Silence set but unused variable warning
Peter Clifton [Sat, 3 Jan 2015 12:08:42 +0000 (3 12:08 +0000)]
lesstif: Silence set but unused variable warning

7 years agoFix typo converting request_debug_draw to return a HID_DRAW structure
Peter Clifton [Sat, 3 Jan 2015 11:57:19 +0000 (3 11:57 +0000)]
Fix typo converting request_debug_draw to return a HID_DRAW structure

Fixes GTK HID built without OpenGL

7 years agohid.h: Update comment to reflect change in API
Peter Clifton [Fri, 2 Jan 2015 22:55:48 +0000 (2 22:55 +0000)]
hid.h: Update comment to reflect change in API

7 years agoPass a HID_DRAW structure for debug drawing, not HID
Peter Clifton [Thu, 1 Jan 2015 16:35:27 +0000 (1 16:35 +0000)]
Pass a HID_DRAW structure for debug drawing, not HID

Avoids passing the caller access to more functionality than required.

7 years agoautoroute.c: Add missing include required for debug drawing
Peter Clifton [Thu, 1 Jan 2015 16:55:07 +0000 (1 16:55 +0000)]
autoroute.c: Add missing include required for debug drawing

7 years agoDon't use abuse mask drawing of pin/via drawing routines to show DRC clearance during...
Peter Clifton [Thu, 1 Jan 2015 15:57:16 +0000 (1 15:57 +0000)]
Don't use abuse mask drawing of pin/via drawing routines to show DRC clearance during placement

Explicitly call the graphical drawing routines as necessary.

7 years agoDon't put generated i18n helper files under version control
Roland Lutz [Tue, 9 Dec 2014 18:53:13 +0000 (9 19:53 +0100)]
Don't put generated i18n helper files under version control

Reported-by: Sergey Alyoshin <alyoshin.s@gmail.com>
7 years agoSkip prompt on `make distcheck'
Roland Lutz [Mon, 8 Dec 2014 20:55:06 +0000 (8 21:55 +0100)]
Skip prompt on `make distcheck'

7 years agoFix menus not being translated
Roland Lutz [Mon, 8 Dec 2014 20:32:28 +0000 (8 21:32 +0100)]
Fix menus not being translated

7 years agoPCB make distcheck
Eugene Mikhantiev [Wed, 12 Nov 2014 04:33:11 +0000 (12 11:33 +0700)]
PCB make distcheck

7 years agoList real source files, not generated C files, in po/POTFILES.in
Roland Lutz [Wed, 12 Nov 2014 13:42:31 +0000 (12 14:42 +0100)]
List real source files, not generated C files, in po/POTFILES.in

7 years agoAdd support for arbitrary-depth footprint libraries
Roland Lutz [Wed, 29 Oct 2014 14:43:10 +0000 (29 15:43 +0100)]
Add support for arbitrary-depth footprint libraries

Tested-by: Kai-Martin Knaak <knaak@iqo.uni-hannover.de>
7 years agoDon't recurse into relatively-specified library directories
Roland Lutz [Sun, 21 Sep 2014 12:02:13 +0000 (21 14:02 +0200)]
Don't recurse into relatively-specified library directories

When PCB is run from the user's home directory and "." is specified
as a library directory (which may be a valid use case), PCB tries to
read the user's whole home directory.  There is no easy way to tell
if a given relative path should be searched recursively or not, so
don't do it at all.

7 years agoRemove 509-character limit on configuration values
Roland Lutz [Wed, 10 Sep 2014 19:08:56 +0000 (10 21:08 +0200)]
Remove 509-character limit on configuration values

Tested-by: Kai-Martin Knaak <knaak@iqo.uni-hannover.de>
7 years agoIf there is only one library root node, keep it expanded
Roland Lutz [Thu, 11 Sep 2014 11:52:20 +0000 (11 13:52 +0200)]
If there is only one library root node, keep it expanded

7 years agoLoad footprints recursively from subdirectories
Roland Lutz [Thu, 11 Sep 2014 11:17:52 +0000 (11 13:17 +0200)]
Load footprints recursively from subdirectories

7 years agoAdd support for recursive directories to GTK library dialog
Roland Lutz [Thu, 11 Sep 2014 10:57:39 +0000 (11 12:57 +0200)]
Add support for recursive directories to GTK library dialog

7 years agoStore full library path with menus
Roland Lutz [Thu, 11 Sep 2014 10:39:48 +0000 (11 12:39 +0200)]
Store full library path with menus

7 years agoRemove 511-character limit on configuration file lines
Roland Lutz [Wed, 10 Sep 2014 18:55:27 +0000 (10 20:55 +0200)]
Remove 511-character limit on configuration file lines

Tested-by: Kai-Martin Knaak <knaak@iqo.uni-hannover.de>
7 years agoRemove outdated copy of `mdate-sh'
Roland Lutz [Wed, 10 Sep 2014 18:30:37 +0000 (10 20:30 +0200)]
Remove outdated copy of `mdate-sh'

7 years agoAdd `test-driver' to the list of ignored files
Roland Lutz [Wed, 10 Sep 2014 18:26:33 +0000 (10 20:26 +0200)]
Add `test-driver' to the list of ignored files

8 years agoRemove unused #include "setjmp.h" from a few files
Peter Clifton [Thu, 10 Jul 2014 17:58:15 +0000 (10 18:58 +0100)]
Remove unused #include "setjmp.h" from a few files

8 years agoRemove function SearchScreenGridSlop() and use SearchObjectByLocation() directly
Peter Clifton [Sat, 5 Jul 2014 15:36:54 +0000 (5 16:36 +0100)]
Remove function SearchScreenGridSlop() and use SearchObjectByLocation() directly

8 years agoaction.c: Fix handling of the case where a segment already exists when drawing lines
Peter Clifton [Sat, 5 Jul 2014 16:14:08 +0000 (5 17:14 +0100)]
action.c: Fix handling of the case where a segment already exists when drawing lines

We cancel creating any segment which would overlay an existing, but we previously
failed to move the start-point and toggle the line-start direction so as to
continue drawing from the desired point as if we HAD created the line.

8 years agohid/gtk: Remove debugging printf accidentally committed
Peter Clifton [Fri, 4 Jul 2014 02:04:39 +0000 (4 03:04 +0100)]
hid/gtk: Remove debugging printf accidentally committed

8 years ago(no commit message)
Peter Clifton [Fri, 4 Jul 2014 02:04:01 +0000 (4 03:04 +0100)]

8 years agohid/*: layer_sort() Only copper layers participate in the layer stack
Peter Clifton [Fri, 4 Jul 2014 00:45:02 +0000 (4 01:45 +0100)]
hid/*: layer_sort()  Only copper layers participate in the layer stack

Don't consider the layers greater than or equal to max_copper_layer,
ie.. Silk layers are not in the layer stack. Actually, don't even
worry about checking the layer is a copper layer - it will be.

Use GetLayerGroupNumberByNumber() directly, there is no need to worry
about being passed strange layer numbers.

Rename layer_sort() to layer_stack_sort(), reflecting our (new) preconditions.

8 years agoRevert "Introduce dynamic board size."
Peter Clifton [Thu, 3 Jul 2014 23:27:00 +0000 (4 00:27 +0100)]
Revert "Introduce dynamic board size."

This reverts commit d91daad65c3ea7e2e1b6ce876b7d41550f6a784e.

    The goal is to eventually define the board's extent by the outline
    layer, only. That way, all the exporters can export properly
    sized layouts.

    Undoubtly, this can also influence the GUIs. For example, "zoom to fit"
    becomes a slightly different meaning and drawing outside the board's
    extent becomes possible. Autorouting and similars can be limited to
    the actual board size. Resizing a board to the lower left no longer
    requires the error-prone moving of all the stuff and keeps file diffs
    small.

The code in question does NOT dynamically update the desired information
when the outline layer changes, and it adds yet more magic meaning to the
 "outline" layer which I'm trying slowly to remove from PCB. This is the
wrong way to cope with unlimited board sizes.

8 years agohid/gcode: Don't use PCB->Extent{Min,Max}{X,Y}.. they are about to be killed
Peter Clifton [Thu, 3 Jul 2014 23:31:05 +0000 (4 00:31 +0100)]
hid/gcode: Don't use PCB->Extent{Min,Max}{X,Y}.. they are about to be killed

The extent updating code is broken, and adds yet more special-case code which
handles the "outline" layer. Use PCB->MaxWidth and PCB->MaxHeight, these
represent the size the of board, and are the values which the extents code
defaulted to if it did not find any lines on the "outline" layer.

8 years agohid/gtk: Don't use a static local variable for the tooltip id, it is ugly.
Peter Clifton [Thu, 3 Jul 2014 23:55:14 +0000 (4 00:55 +0100)]
hid/gtk: Don't use a static local variable for the tooltip id, it is ugly.

8 years agohid/gerber: Fix broken eagle-suffix filename assignemnt
Peter Clifton [Thu, 3 Jul 2014 23:12:16 +0000 (4 00:12 +0100)]
hid/gerber: Fix broken eagle-suffix filename assignemnt

This was broken carelessly in commit c812fbae2dfe74cd3d39dd2dcc5cdbb08e07555a

NB: Please pay attention to compiler warnings... they are there for a reason!

8 years agoconstify name argument to ghid_notebook_page()
Peter Clifton [Thu, 3 Jul 2014 23:05:11 +0000 (4 00:05 +0100)]
constify name argument to ghid_notebook_page()

Avoids a compiler warning when building the GTK hid.

8 years agoRemove function GetGroupOfLayer, use GetLayerGroupNumberByNumber() instead.
Peter Clifton [Thu, 3 Jul 2014 22:55:10 +0000 (3 23:55 +0100)]
Remove function GetGroupOfLayer, use GetLayerGroupNumberByNumber() instead.

These functions are virtually identical, the only difference being special-case
handling in the deleted function to force returning max_group if passed layer
number "max_copper_layer".

This actually (as it happens), corresponds to the bottom silk layer, and this
handling is suspect at best. GetLayerGroupNumberByNumber() will return the
group corresponding to the bottom of the board (whichever that may be).

8 years agoAvoid walking off the layer group string in ParseGroupString
Peter Clifton [Thu, 3 Jul 2014 22:32:42 +0000 (3 23:32 +0100)]
Avoid walking off the layer group string in ParseGroupString

Oops - fix bug introduced in previous commit

8 years agoDetermine layer count in ParseGroupString
Peter Clifton [Sat, 28 Jun 2014 18:43:15 +0000 (28 19:43 +0100)]
Determine layer count in ParseGroupString

This may break support for reading a board without a valid Groups()
construct, although that will only affect ancient PCB files.

8 years agoparse_y.y: Don't bother setting LayerFlag[1,2] for elements - it isn't used
Peter Clifton [Sat, 28 Jun 2014 20:28:08 +0000 (28 21:28 +0100)]
parse_y.y: Don't bother setting LayerFlag[1,2] for elements - it isn't used

8 years agoMove contents of PreLoadElementPCB and PostLoadElementPCB into parse_y.y
Peter Clifton [Sat, 28 Jun 2014 20:16:01 +0000 (28 21:16 +0100)]
Move contents of PreLoadElementPCB and PostLoadElementPCB into parse_y.y

These functions are only called from parse_y.y, and access yy prefixed
variables which should be private to the parser/lexer.

8 years agoCreate a new constant MAX_GROUP to size arrays of layer groups.
Peter Clifton [Sat, 28 Jun 2014 18:47:46 +0000 (28 19:47 +0100)]
Create a new constant MAX_GROUP to size arrays of layer groups.

This is clearer than using MAX_LAYER. (Although the numbers are identical).

8 years agoRename "{component,solder}_silk_layer" to "{top,bottom}_silk_layer"
Peter Clifton [Thu, 26 Jun 2014 20:21:44 +0000 (26 21:21 +0100)]
Rename "{component,solder}_silk_layer" to "{top,bottom}_silk_layer"

This will avoid confusion when we start adding "soldermask" layers.

The resulting variables solder_soldermask_layer and component_soldermask_layer
are not ideal (repeated use of the word solder), so lets start using "top_" and
"bottom_" to define the board sides. The corresponding new layer names are then
"top_soldermask_layer" and "bottom_soldermask_layer", which is less confusing.

Patch includes various other renaming of component -> top and solder -> bottom.

8 years agoUse new function GetLayerGroupNumberBySide() to make code clearer
Peter Clifton [Thu, 26 Jun 2014 22:47:22 +0000 (26 23:47 +0100)]
Use new function GetLayerGroupNumberBySide() to make code clearer

Replaces code calling GetLayerGroupNumberByNumber() against one of the
silk-screen layers in order to find the layer group containing the top
or bottom side of the board.

Patch includes various renaming of component -> top, and solder -> bottom

8 years agoline.c: Cleanup group checking in drc_lines()
Peter Clifton [Fri, 27 Jun 2014 00:36:58 +0000 (27 01:36 +0100)]
line.c: Cleanup group checking in drc_lines()

Avoid using an out-of-bounds layer number which might be used in future.

8 years agoCreate new function GetLayerGroupNumberBySide()
Peter Clifton [Fri, 27 Jun 2014 00:40:34 +0000 (27 01:40 +0100)]
Create new function GetLayerGroupNumberBySide()

8 years agoReplace {COMPONENT,SOLDER}_LAYER with {TOP,BOTTOM}_{SILK_LAYER,SIDE} depending on...
Peter Clifton [Thu, 26 Jun 2014 20:12:40 +0000 (26 21:12 +0100)]
Replace {COMPONENT,SOLDER}_LAYER with {TOP,BOTTOM}_{SILK_LAYER,SIDE} depending on usage

We used the {COMPONENT,SOLDER}_LAYER constants for two distinct meanings:

1. To identify board sides, ie. use as an integer constant representing top / bottom
2. As an offset at the end of the layer array to index the two silk-screen layers

Split the usage of these constants as appropriate, so the difference in meaning
is clear. {TOP,BOTTOM}_SIDE are used where we need an integer constant (1 and 0
respectively) refering to the side of the board. This is used, for example, as a
side specifier in draw.c, and for indexing arrays of pads per board-side in find.c.

Usage as an offset into the layer for referencing the silk-screen layers is now
{TOP,BOTTOM}_SILK_LAYER. The relevant offset of PCB->LayerN must still be added.

8 years agomove.c: Fix incorrect usage of max_group
Peter Clifton [Thu, 26 Jun 2014 22:31:55 +0000 (26 23:31 +0100)]
move.c: Fix incorrect usage of max_group

Numerically correct (at the moment), semantically wrong.

8 years agoFix some broken assumptions regarding 32-bit integer coordinates in polygon1.c
Peter Clifton [Fri, 13 Jun 2014 00:57:53 +0000 (13 01:57 +0100)]
Fix some broken assumptions regarding 32-bit integer coordinates in polygon1.c

8 years agopolygon.c: Readability cleanup for frac_circle()
Peter Clifton [Thu, 12 Jun 2014 22:51:25 +0000 (12 23:51 +0100)]
polygon.c: Readability cleanup for frac_circle()

8 years agopng: add explicit round() calls to the scaling
Andrew Poelstra [Sun, 8 Jun 2014 18:03:24 +0000 (8 11:03 -0700)]
png: add explicit round() calls to the scaling

After this commit the tests pass on both 32- and 64-bit builds.
Hopefully this time it's really dead; the previous "fix" af27c2d
by myself merely increased the DPI of the output, but this one
attempts to get deterministic rounding behaviour.

Tests from folks with actual 32-bit machines are welcome.

Closes-bug: lp-860037

8 years agohid/gtk: Focus file save dialog at exit to "Save", not "Close without saving".
Peter Clifton [Fri, 6 Jun 2014 11:18:53 +0000 (6 12:18 +0100)]
hid/gtk: Focus file save dialog at exit to "Save", not "Close without saving".

Avoids inadvertently loosing work when closing the application. "Cancel" would
also be a safe choice of default focus, but the choice of "Save" is copied from
gedit to help give better platform consistency on Gnome systems.

8 years agoTranslation of Getting Started with PCB to pt_BR
Jorge Barros de Abreu [Sun, 23 Feb 2014 16:27:02 +0000 (23 13:27 -0300)]
Translation of Getting Started with PCB to pt_BR

Signed-off-by: bert <bert.timmerman@xs4all.nl>
8 years agoChanged the backup file suffix from dash to tilde.
bert [Thu, 17 Apr 2014 19:39:28 +0000 (17 21:39 +0200)]
Changed the backup file suffix from dash to tilde.

Reported-by: rosvall
Signed-off-by: bert <bert.timmerman@xs4all.nl>
8 years agoFix the AppData and update to the latest spec version
Richard Hughes [Thu, 22 May 2014 20:50:55 +0000 (22 21:50 +0100)]
Fix the AppData and update to the latest spec version

Also, include the full size screenshot as the old one was too small to be used.

Signed-off-by: bert <bert.timmerman@xs4all.nl>