Commit f86eb756 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Source license, coding policy, and documentation fixes.

* Add more missing source code licenses.
* Fix coding policy violations (tabs and trailing white space) in Python
  scripting code.
* Add stable release policy to full documentation build.
parent 045f7f0d
......@@ -645,7 +645,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = Documentation/development/road-map.md \
INPUT = Documentation/development/stable-release-policy.md \
Documentation/development/road-map.md \
kicad \
pcbnew \
cvpcb \
......
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2013-2014 KiCad Developers, see change_log.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# This python script wizard creates a FPC connector
# for Surface Mounted Technology
......
#!/usr/bin/python
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2012-2014 KiCad Developers, see change_log.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
from pcbnew import *
class TouchSliderWizard(FootprintWizardPlugin):
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2007-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file polygon_test_point_inside.cpp
*/
......
/////////////////////////////////////////////////////////////////////////////
// Name: polygon_test_point_inside.h
/////////////////////////////////////////////////////////////////////////////
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2007-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WXWINDOWS__
// define here wxPoint if we want to compile outside wxWidgets
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* file polygons_defs.h
* definitions to use boost::polygon in KiCad.
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo <miguelangel@nbee.es>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* DLIST python iteration code, to allow standard iteration over DLIST */
%extend DLIST
{
%pythoncode
{
class DLISTIter:
def __init__(self,aList):
self.last = aList # last item is the start of list
def next(self): # get the next item
item = self.last
try:
item = item.Get()
except:
pass
if item is None: # if the item is None, then finish the iteration
raise StopIteration
else:
ret = None
# first item in list has "Get" as a DLIST
try:
ret = self.last.Get()
except:
ret = self.last # next items do not..
self.last = self.last.Next()
# when the iterated object can be casted down in inheritance, just do it..
if 'Cast' in dir(ret):
ret = ret.Cast()
return ret
def __iter__(self):
return self.DLISTIter(self)
}
%pythoncode
{
class DLISTIter:
def __init__(self,aList):
self.last = aList # last item is the start of list
def next(self): # get the next item
item = self.last
try:
item = item.Get()
except:
pass
if item is None: # if the item is None, then finish the iteration
raise StopIteration
else:
ret = None
# first item in list has "Get" as a DLIST
try:
ret = self.last.Get()
except:
ret = self.last # next items do not..
self.last = self.last.Next()
# when the iterated object can be casted down in inheritance, just do it..
if 'Cast' in dir(ret):
ret = ret.Cast()
return ret
def __iter__(self):
return self.DLISTIter(self)
}
}
......@@ -60,19 +60,19 @@ public:
int GetWidth() const { return width; }
void SetWidth(int w) { width = w; }
int GetHeight() const { return height; }
void SetHeight(int h) { height = h; }
wxPoint GetPosition() const { return wxPoint(x, y); }
void SetPosition( const wxPoint &p ) { x = p.x; y = p.y; }
int x, y, width, height;
%extend
{
%extend
{
/* extend the wxRect object so it can be converted into a tuple */
PyObject* Get()
PyObject* Get()
{
PyObject* res = PyTuple_New(4);
PyTuple_SET_ITEM(res, 0, PyInt_FromLong(self->x));
......@@ -82,23 +82,23 @@ public:
return res;
}
}
%pythoncode
%pythoncode
{
def __eq__(self,other):
return self.x==other.x and self.y==other.y and self.width==other.width and self.height==other.height
def __eq__(self,other):
return self.x==other.x and self.y==other.y and self.width==other.width and self.height==other.height
def __str__(self): return str(self.Get())
def __repr__(self): return 'wxRect'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.SetX(val)
elif index == 1: self.SetY(val)
elif index == 2: self.SetWidth(val)
elif index == 3: self.SetHeight(val)
else: raise IndexError
if index == 0: self.SetX(val)
elif index == 1: self.SetY(val)
elif index == 2: self.SetWidth(val)
elif index == 3: self.SetHeight(val)
else: raise IndexError
def __nonzero__(self): return self.Get() != (0,0,0,0)
__safe_for_unpickling__ = True
}
......@@ -113,9 +113,9 @@ public:
int x,y;
wxSize(int xx, int yy) : x(xx), y(yy) { }
wxSize(double xx, double yy) : x(xx), y(yy) {}
%extend
{
PyObject* Get()
%extend
{
PyObject* Get()
{
PyObject* res = PyTuple_New(2);
PyTuple_SET_ITEM(res, 0, PyInt_FromLong(self->x));
......@@ -123,39 +123,39 @@ public:
return res;
}
}
~wxSize();
void SetWidth(int w);
void SetHeight(int h);
int GetWidth() const;
int GetHeight() const;
%pythoncode
%pythoncode
{
def Scale(self,xscale,yscale):
return wxSize(self.x*xscale,self.y*yscale)
def __eq__(self,other):
return self.GetWidth()==other.GetWidth() and self.GetHeight()==other.GetHeight()
def __str__(self): return str(self.Get())
def __repr__(self): return 'wxSize'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.SetWidth(val)
elif index == 1: self.SetHeight(val)
else: raise IndexError
def __nonzero__(self): return self.Get() != (0,0)
__safe_for_unpickling__ = True
def Scale(self,xscale,yscale):
return wxSize(self.x*xscale,self.y*yscale)
def __eq__(self,other):
return self.GetWidth()==other.GetWidth() and self.GetHeight()==other.GetHeight()
def __str__(self): return str(self.Get())
def __repr__(self): return 'wxSize'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.SetWidth(val)
elif index == 1: self.SetHeight(val)
else: raise IndexError
def __nonzero__(self): return self.Get() != (0,0)
__safe_for_unpickling__ = True
}
};
// wxPoint class wrapper to (xx,yy) tuple /////////////////////////////////////
class wxPoint
{
{
public:
int x, y;
wxPoint(int xx, int yy);
......@@ -166,8 +166,8 @@ public:
wxPoint __sub__(const wxPoint& pt) { return *self - pt; }
void Set(long x, long y) { self->x = x; self->y = y; }
PyObject* Get()
{
PyObject* Get()
{
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
......@@ -175,7 +175,7 @@ public:
}
}
%pythoncode {
%pythoncode {
def __eq__(self,other): return (self.x==other.x and self.y==other.y)
def __ne__(self,other): return not (self==other)
def __str__(self): return str(self.Get())
......@@ -183,11 +183,11 @@ public:
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0:
if index == 0:
self.x = val
elif index == 1:
elif index == 1:
self.y = val
else:
else:
raise IndexError
def __nonzero__(self): return self.Get() != (0,0)
......@@ -204,7 +204,7 @@ public:
// wxString wrappers /////////////////////////////////////////////////////////
%typemap(out) wxString&
%typemap(out) wxString&
{
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1->c_str(), $1->Len());
......@@ -215,7 +215,7 @@ public:
%apply wxString& { wxString* }
%typemap(out) wxString
%typemap(out) wxString
{
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1.c_str(), $1.Len());
......@@ -224,7 +224,7 @@ public:
%#endif
}
%typemap(varout) wxString
%typemap(varout) wxString
{
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1.c_str(), $1.Len());
......@@ -233,14 +233,14 @@ public:
%#endif
}
%typemap(in) wxString& (bool temp=false)
%typemap(in) wxString& (bool temp=false)
{
$1 = newWxStringFromPy($input);
if ($1 == NULL) SWIG_fail;
temp = true;
}
%typemap(freearg) wxString&
%typemap(freearg) wxString&
{
if (temp$argnum)
delete $1;
......@@ -261,20 +261,20 @@ public:
// wxArrayString wrappers //////////////////////////////////////////////////////
%typemap(in) wxArrayString& (bool temp=false) {
if (!PySequence_Check($input))
if (!PySequence_Check($input))
{
PyErr_SetString(PyExc_TypeError, "Not a sequence of strings");
SWIG_fail;
}
$1 = new wxArrayString;
temp = true;
int last=PySequence_Length($input);
for (int i=0; i<last; i++)
for (int i=0; i<last; i++)
{
PyObject* pyStr = PySequence_GetItem($input, i);
wxString* wxS = newWxStringFromPy(pyStr);
if (PyErr_Occurred())
if (PyErr_Occurred())
SWIG_fail;
$1->Add(*wxS);
delete wxS;
......@@ -282,21 +282,19 @@ public:
}
}
%typemap(freearg) wxArrayString&
%typemap(freearg) wxArrayString&
{
if (temp$argnum)
if (temp$argnum)
delete $1;
}
%typemap(out) wxArrayString&
%typemap(out) wxArrayString&
{
$result = wxArrayString2PyList(*$1);
}
%typemap(out) wxArrayString
%typemap(out) wxArrayString
{
$result = wxArrayString2PyList($1);
}
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