Commit 69756df3 authored by charras's avatar charras

Some update for Kicad Release Candidate 1

parent aa541fcb
* Copyright (C) 1992-2008 Jean-Pierre Charras, jean-pierre.charras@inpg.fr
* Copyright (C) 1992-2008 Kicad Developers
* under GNU General Public License (see copyright.txt)
Main author:
Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
Maitre de Conferences
IUT1 GEII2
Universite Joseph Fourier (U.J.F.)
Saint Martin d'Hres (38402)
Laboratiore GIPSA-Lab
Saint Martin d'Hres
Contributors
Dick Hollenbeck <dick@softplc.com>
Jerry Jacobs <jerkejacobs@gmail.com>
Jonas Diemer <diemer@gmx.de>
KBool Library http://boolean.klaasholwerda.nl/bool.html
Rok Markovic <rok@kanardia.eu>
Tim Hanson <sideskate@gmail.com>
Vesa Solonen <vesa.solonen@hut.fi>
Wayne Stambaugh <stambaughw@verizon.net>
See also CHANGELOG.txt for contributors.
Document writers
Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
Igor Plyatov <plyatov@gmail.com>
Translators
Czech (CZ) Martin Kratoška <martin@ok1rr.com>
Dutch (NL) Jerry Jacobs <jerkejacobs@gmail.com>
French (FR) Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
Polish (PL) Mateusz Skowroński <skowri@gmail.com>
Portuguese (PT) Renie Marquet <reniemarquet@uol.com.br>"
Russian (RU) Igor Plyatov <plyatov@gmail.com>
Spanish (ES) Pedro Martin del Valle <pkicad@yahoo.es>
Spanish (ES) Iñigo Zuluaga <inigo_zuluaga@yahoo.es>
Remy Halvick
David Briscoe
Dominique Laigle
Paul Burke
Programm credits for icons and others
Icons by Iñigo Zuluaga
3D modules by Renie Marquet <reniemarquet@uol.com.br>
...@@ -15,26 +15,41 @@ ...@@ -15,26 +15,41 @@
#define FILLED 1 #define FILLED 1
#endif #endif
/* Important Note:
* These drawing functions clip draw item before send these items to wxDC draw functions.
* For guy who aks why i did it, see a sample of problems encounted when pixels
* coordinates overflow 16 bits values:
* http://trac.wxwidgets.org/ticket/10446
* Problems can be found under Windows **and** Linux (mainly when drawing arcs)
* (mainly at low zoom values (2, 1 or 0.5), in pcbnew)
* some of these problems could be now fixed in recent distributions.
*
* Currently (feb 2009) there are overflow problems when drawing solid (filled) polygons under linux without clipping
*
* So before removing cliping functions, be aware these bug (they are not in kicad or wxWidgets)
* are fixed by testing how are drawn complex lines arcs and solid polygons under Windows and Linux
* and remember users can have old versions with bugs
*/
/* global variables */ /* global variables */
extern BASE_SCREEN* ActiveScreen; extern BASE_SCREEN* ActiveScreen;
/* Variables locales */ /* Variables locales */
static int GRLastMoveToX, GRLastMoveToY; static int GRLastMoveToX, GRLastMoveToY;
static int Text_Color = LIGHTGRAY; static int Text_Color = LIGHTGRAY;
static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0) static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0)
* (utile pour trace sur imprimante) */ * (utile pour trace sur imprimante) */
static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
* sur imprimante */ * sur imprimante */
static int xcliplo = 0, static int xcliplo = 0,
ycliplo = 0, ycliplo = 0,
xcliphi = 2000, xcliphi = 2000,
ycliphi = 2000; /* coord de la surface de trace */ ycliphi = 2000; /* coord de la surface de trace */
static int lastcolor = -1; static int lastcolor = -1;
static int lastwidth = -1; static int lastwidth = -1;
static int s_Last_Pen_Style = -1; static int s_Last_Pen_Style = -1;
static wxDC* lastDC = NULL; static wxDC* lastDC = NULL;
/* /*
* Macro de clipping du trace d'une ligne: * Macro de clipping du trace d'une ligne:
...@@ -58,8 +73,8 @@ static inline int USCALE( us arg, us num, us den ) ...@@ -58,8 +73,8 @@ static inline int USCALE( us arg, us num, us den )
#endif #endif
} }
static int inline ZoomValue( int val )
{ static int inline ZoomValue( int val ) {
return ActiveScreen->Scale( val ); return ActiveScreen->Scale( val );
} }
...@@ -142,15 +157,15 @@ static inline bool clip_line( int& x1, int& y1, int& x2, int& y2 ) ...@@ -142,15 +157,15 @@ static inline bool clip_line( int& x1, int& y1, int& x2, int& y2 )
if( x1 < xcliplo ) if( x1 < xcliplo )
{ {
temp = USCALE( (y2 - y1), (xcliplo - x1), (x2 - x1) ); temp = USCALE( (y2 - y1), (xcliplo - x1), (x2 - x1) );
y1 += temp; y1 += temp;
x1 = xcliplo; x1 = xcliplo;
WHEN_INSIDE; WHEN_INSIDE;
} }
if( x2 > xcliphi ) if( x2 > xcliphi )
{ {
temp = USCALE( (y2 - y1), (x2 - xcliphi), (x2 - x1) ); temp = USCALE( (y2 - y1), (x2 - xcliphi), (x2 - x1) );
y2 -= temp; y2 -= temp;
x2 = xcliphi; x2 = xcliphi;
WHEN_INSIDE; WHEN_INSIDE;
} }
} }
...@@ -183,15 +198,15 @@ static inline bool clip_line( int& x1, int& y1, int& x2, int& y2 ) ...@@ -183,15 +198,15 @@ static inline bool clip_line( int& x1, int& y1, int& x2, int& y2 )
if( x1 < xcliplo ) if( x1 < xcliplo )
{ {
temp = USCALE( (y1 - y2), (xcliplo - x1), (x2 - x1) ); temp = USCALE( (y1 - y2), (xcliplo - x1), (x2 - x1) );
y1 -= temp; y1 -= temp;
x1 = xcliplo; x1 = xcliplo;
WHEN_INSIDE; WHEN_INSIDE;
} }
if( x2 > xcliphi ) if( x2 > xcliphi )
{ {
temp = USCALE( (y1 - y2), (x2 - xcliphi), (x2 - x1) ); temp = USCALE( (y1 - y2), (x2 - xcliphi), (x2 - x1) );
y2 += temp; y2 += temp;
x2 = xcliphi; x2 = xcliphi;
WHEN_INSIDE; WHEN_INSIDE;
} }
} }
...@@ -253,7 +268,7 @@ void SetPenMinWidth( int minwidth ) ...@@ -253,7 +268,7 @@ void SetPenMinWidth( int minwidth )
/** /**
* Function GRSetColorPen * Function GRSetColorPen
* sets a pen style, width, color, and alpha into the given device context. * sets a pen style, width, color, and alpha into the given device context.
*/ */
void GRSetColorPen( wxDC* DC, int Color, int width, int style ) void GRSetColorPen( wxDC* DC, int Color, int width, int style )
{ {
if( width < PenMinWidth ) if( width < PenMinWidth )
...@@ -265,13 +280,13 @@ void GRSetColorPen( wxDC* DC, int Color, int width, int style ) ...@@ -265,13 +280,13 @@ void GRSetColorPen( wxDC* DC, int Color, int width, int style )
} }
if( lastcolor != Color if( lastcolor != Color
|| lastwidth != width || lastwidth != width
|| s_Last_Pen_Style != style || s_Last_Pen_Style != style
|| lastDC != DC ) || lastDC != DC )
{ {
wxPen pen; wxPen pen;
wxColour wx_color = MakeColour( Color ); wxColour wx_color = MakeColour( Color );
pen.SetColour( wx_color ); pen.SetColour( wx_color );
pen.SetWidth( width ); pen.SetWidth( width );
...@@ -281,7 +296,7 @@ void GRSetColorPen( wxDC* DC, int Color, int width, int style ) ...@@ -281,7 +296,7 @@ void GRSetColorPen( wxDC* DC, int Color, int width, int style )
lastcolor = Color; lastcolor = Color;
lastwidth = width; lastwidth = width;
lastDC = DC; lastDC = DC;
s_Last_Pen_Style = style; s_Last_Pen_Style = style;
} }
...@@ -313,6 +328,7 @@ void GRSetBrush( wxDC* DC, int Color, int fill ) ...@@ -313,6 +328,7 @@ void GRSetBrush( wxDC* DC, int Color, int fill )
/*************************************/ /*************************************/
void GRForceBlackPen( bool flagforce ) void GRForceBlackPen( bool flagforce )
/*************************************/ /*************************************/
/** function GRForceBlackPen /** function GRForceBlackPen
* @param flagforce True to force a black pen whenever the asked color * @param flagforce True to force a black pen whenever the asked color
*/ */
...@@ -320,9 +336,11 @@ void GRForceBlackPen( bool flagforce ) ...@@ -320,9 +336,11 @@ void GRForceBlackPen( bool flagforce )
ForceBlackPen = flagforce; ForceBlackPen = flagforce;
} }
/***********************************/ /***********************************/
bool GetGRForceBlackPenState( void ) bool GetGRForceBlackPenState( void )
/***********************************/ /***********************************/
/** function GetGRForceBlackPenState /** function GetGRForceBlackPenState
* @return ForceBlackPen (True if a black pen was forced) * @return ForceBlackPen (True if a black pen was forced)
*/ */
...@@ -337,9 +355,11 @@ bool GetGRForceBlackPenState( void ) ...@@ -337,9 +355,11 @@ bool GetGRForceBlackPenState( void )
void GRSetDrawMode( wxDC* DC, int draw_mode ) void GRSetDrawMode( wxDC* DC, int draw_mode )
{ {
if( draw_mode & GR_OR ) if( draw_mode & GR_OR )
#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS #if defined (__WXMAC__) && wxMAC_USE_CORE_GRAPHICS
DC->SetLogicalFunction( wxCOPY ); DC->SetLogicalFunction( wxCOPY );
#else #else
DC->SetLogicalFunction( wxOR ); DC->SetLogicalFunction( wxOR );
#endif #endif
else if( draw_mode & GR_XOR ) else if( draw_mode & GR_XOR )
...@@ -847,7 +867,7 @@ static bool IsGRSPolyDrawable( EDA_Rect* ClipBox, int n, wxPoint Points[] ) ...@@ -847,7 +867,7 @@ static bool IsGRSPolyDrawable( EDA_Rect* ClipBox, int n, wxPoint Points[] )
/* Routine to draw a new polyline and fill it if Fill, in screen space. */ /* Routine to draw a new polyline and fill it if Fill, in screen space. */
/************************************************************************/ /************************************************************************/
static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool Fill, static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool Fill,
int width, int Color, int BgColor ) int width, int Color, int BgColor )
{ {
if( !IsGRSPolyDrawable( ClipBox, n, Points ) ) if( !IsGRSPolyDrawable( ClipBox, n, Points ) )
return; return;
...@@ -861,7 +881,7 @@ static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool ...@@ -861,7 +881,7 @@ static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool
} }
else else
{ {
wxPoint endPt = Points[n-1]; wxPoint endPt = Points[n - 1];
GRSetBrush( DC, Color ); GRSetBrush( DC, Color );
DC->DrawLines( n, Points ); DC->DrawLines( n, Points );
...@@ -869,7 +889,7 @@ static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool ...@@ -869,7 +889,7 @@ static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool
// The last point is not drawn by DrawLine and DrawLines // The last point is not drawn by DrawLine and DrawLines
// Add it if the polygon is not closed // Add it if the polygon is not closed
if( endPt != Points[0] ) if( endPt != Points[0] )
DC->DrawPoint(endPt.x, endPt.y); DC->DrawPoint( endPt.x, endPt.y );
} }
} }
...@@ -878,7 +898,7 @@ static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool ...@@ -878,7 +898,7 @@ static void GRSPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool
/* Routine to draw a new closed polyline and fill it if Fill, in screen space */ /* Routine to draw a new closed polyline and fill it if Fill, in screen space */
/******************************************************************************/ /******************************************************************************/
static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int aPointCount, wxPoint aPoints[], static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int aPointCount, wxPoint aPoints[],
bool Fill, int width, int Color, int BgColor ) bool Fill, int width, int Color, int BgColor )
{ {
if( !IsGRSPolyDrawable( ClipBox, aPointCount, aPoints ) ) if( !IsGRSPolyDrawable( ClipBox, aPointCount, aPoints ) )
return; return;
...@@ -887,7 +907,7 @@ static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int aPointCount, wxPoint ...@@ -887,7 +907,7 @@ static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int aPointCount, wxPoint
if( Fill && ( aPointCount > 2 ) ) if( Fill && ( aPointCount > 2 ) )
{ {
GRSMoveTo( aPoints[aPointCount-1].x, aPoints[aPointCount-1].y ); GRSMoveTo( aPoints[aPointCount - 1].x, aPoints[aPointCount - 1].y );
GRSetBrush( DC, BgColor, FILLED ); GRSetBrush( DC, BgColor, FILLED );
DC->DrawPolygon( aPointCount, aPoints, 0, 0, wxODDEVEN_RULE ); DC->DrawPolygon( aPointCount, aPoints, 0, 0, wxODDEVEN_RULE );
} }
...@@ -897,21 +917,22 @@ static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int aPointCount, wxPoint ...@@ -897,21 +917,22 @@ static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int aPointCount, wxPoint
DC->DrawLines( aPointCount, aPoints ); DC->DrawLines( aPointCount, aPoints );
/* Fermeture du polygone */ /* Fermeture du polygone */
if( aPoints[aPointCount-1] != aPoints[0] ) if( aPoints[aPointCount - 1] != aPoints[0] )
{ {
GRSLine( ClipBox, DC, aPoints[0].x, aPoints[0].y, GRSLine( ClipBox, DC, aPoints[0].x, aPoints[0].y,
aPoints[aPointCount-1].x, aPoints[aPointCount-1].y, width, Color ); aPoints[aPointCount - 1].x, aPoints[aPointCount - 1].y, width, Color );
} }
} }
} }
/* not used /* not used
static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], * static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[],
bool Fill, int Color, int BgColor ) * bool Fill, int Color, int BgColor )
{ * {
GRSClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor ); * GRSClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor );
} * }
*/ */
/************************************************************************/ /************************************************************************/
...@@ -920,7 +941,7 @@ static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], ...@@ -920,7 +941,7 @@ static void GRSClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[],
void GRPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], void GRPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[],
bool Fill, int width, int Color, int BgColor ) bool Fill, int width, int Color, int BgColor )
{ {
for( int i=0; i<n; ++i ) for( int i = 0; i<n; ++i )
{ {
Points[i].x = GRMapX( Points[i].x ); Points[i].x = GRMapX( Points[i].x );
Points[i].y = GRMapY( Points[i].y ); Points[i].y = GRMapY( Points[i].y );
...@@ -944,7 +965,7 @@ void GRClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], ...@@ -944,7 +965,7 @@ void GRClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[],
void GRClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], void GRClosedPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[],
bool Fill, int width, int Color, int BgColor ) bool Fill, int width, int Color, int BgColor )
{ {
for( int i=0; i<n; ++i ) for( int i = 0; i<n; ++i )
{ {
Points[i].x = GRMapX( Points[i].x ); Points[i].x = GRMapX( Points[i].x );
Points[i].y = GRMapY( Points[i].y ); Points[i].y = GRMapY( Points[i].y );
......
...@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion ...@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h" # include "config.h"
(wxT(KICAD_SVN_VERSION)) (wxT(KICAD_SVN_VERSION))
# else # else
(wxT("(20090214-RC1)")) /* main program version */ (wxT("(20090216-RC1)")) /* main program version */
# endif # endif
#endif #endif
; ;
...@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion ...@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h" # include "config.h"
(wxT(KICAD_ABOUT_VERSION)) (wxT(KICAD_ABOUT_VERSION))
# else # else
(wxT("(20090214-RC1)")) /* svn date & rev (normally overridden) */ (wxT("(20090216-RC1)")) /* svn date & rev (normally overridden) */
# endif # endif
#endif #endif
; ;
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
; General Product Description Definitions ; General Product Description Definitions
!define PRODUCT_NAME "KiCad" !define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2008.08.25" !define PRODUCT_VERSION "2009.02.16"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME "" !define COMPANY_NAME ""
!define TRADE_MARKS "" !define TRADE_MARKS ""
!define COPYRIGHT "Jean-Pierre Charras" !define COPYRIGHT "Kicad Team (Jean-Pierre Charras and others)"
!define COMMENTS "" !define COMMENTS ""
!define HELP_WEB_SITE "http://groups.yahoo.com/group/kicad-users/" !define HELP_WEB_SITE "http://groups.yahoo.com/group/kicad-users/"
!define DEVEL_WEB_SITE "http://groups.yahoo.com/group/kicad-devel/" !define DEVEL_WEB_SITE "http://groups.yahoo.com/group/kicad-devel/"
......
release version: release version:
25 aug 2008 16 feb 2009
files (.zip,.tgz): files (.zip,.tgz):
kicad-2008-08-25 kicad-2009-02-16-RC1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment