Re: [Kicad-developers] [PATCH] Fix Touchpad Panning Regressions

2016-02-26 Thread Wayne Stambaugh
On 2/26/2016 11:11 AM, Bernhard Stegmaier wrote:
> Fix 3d-viewer regressions introduced by touchpad-panning for 
> non-touchpad-panning:
> * Fix broken horizontal scrolling with ctrl-wheel
> * Restore previous step size

Patch committed in product branch r6593.  Thanks.

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 6/8] Use ptrdiff_t in potrace instead of ssize_t

2016-02-26 Thread Simon Richter

This is backported from potrace 1.13.
---
 potrace/bitmap.h| 15 ---
 potrace/greymap.cpp |  2 +-
 potrace/greymap.h   |  3 ++-
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/potrace/bitmap.h b/potrace/bitmap.h
index 605aa31..059fb2b 100644
--- a/potrace/bitmap.h
+++ b/potrace/bitmap.h
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 /* The bitmap type is defined in potracelib.h */
@@ -28,7 +29,7 @@
 /* macros for accessing pixel at index (x,y). U* macros omit the
  *  bounds check. */
 
-#define bm_scanline( bm, y )( (bm)->map + (ssize_t) (y) * (ssize_t) (bm)->dy )
+#define bm_scanline( bm, y )( (bm)->map + (ptrdiff_t) (y) * (ptrdiff_t) (bm)->dy )
 #define bm_index( bm, x, y )(_scanline( bm, y )[(x) / BM_WORDBITS])
 #define bm_mask( x )( BM_HIBIT >> ( (x) & (BM_WORDBITS - 1) ) )
 #define bm_range( x, a )( (int) (x) >= 0 && (int) (x) < (a) )
@@ -62,7 +63,7 @@ static inline potrace_bitmap_t* bm_new( int w, int h )
 {
 potrace_bitmap_t* bm;
 int dy = w == 0 ? 0 : (w - 1) / BM_WORDBITS + 1;
-ssize_t size = (ssize_t) dy * (ssize_t) h * (ssize_t) BM_WORDSIZE;
+ptrdiff_t size = (ptrdiff_t) dy * (ptrdiff_t) h * (ptrdiff_t) BM_WORDSIZE;
 
 /* check for overflow error */
 if( size < 0 || size / h / dy != BM_WORDSIZE )
@@ -97,8 +98,8 @@ static inline potrace_bitmap_t* bm_new( int w, int h )
 static inline void bm_clear( potrace_bitmap_t* bm, int c )
 {
 /* Note: if the bitmap was created with bm_new, then it is
- *  guaranteed that size will fit into the ssize_t type. */
-ssize_t size = (ssize_t) bm->dy * (ssize_t) bm->h * (ssize_t) BM_WORDSIZE;
+ *  guaranteed that size will fit into the ptrdiff_t type. */
+ptrdiff_t size = (ptrdiff_t) bm->dy * (ptrdiff_t) bm->h * (ptrdiff_t) BM_WORDSIZE;
 
 memset( bm->map, c ? -1 : 0, size );
 }
@@ -108,7 +109,7 @@ static inline void bm_clear( potrace_bitmap_t* bm, int c )
 static inline potrace_bitmap_t* bm_dup( const potrace_bitmap_t* bm )
 {
 potrace_bitmap_t* bm1 = bm_new( bm->w, bm->h );
-ssize_t size = (ssize_t) bm->dy * (ssize_t) bm->h * (ssize_t) BM_WORDSIZE;
+ptrdiff_t size = (ptrdiff_t) bm->dy * (ptrdiff_t) bm->h * (ptrdiff_t) BM_WORDSIZE;
 
 if( !bm1 )
 {
@@ -123,8 +124,8 @@ static inline potrace_bitmap_t* bm_dup( const potrace_bitmap_t* bm )
 /* invert the given bitmap. */
 static inline void bm_invert( potrace_bitmap_t* bm )
 {
-ssize_t i;
-ssize_t size = (ssize_t) bm->dy * (ssize_t) bm->h;
+ptrdiff_t i;
+ptrdiff_t size = (ptrdiff_t) bm->dy * (ptrdiff_t) bm->h;
 
 for( i = 0; i < size; i++ )
 {
diff --git a/potrace/greymap.cpp b/potrace/greymap.cpp
index fd06d87..e4a0b85 100644
--- a/potrace/greymap.cpp
+++ b/potrace/greymap.cpp
@@ -29,7 +29,7 @@ static int  gm_readbody_bmp( FILE* f, greymap_t** gmp );
 greymap_t* gm_new( int w, int h )
 {
 greymap_t* gm;
-ssize_t size = (ssize_t) w * (ssize_t) h * (ssize_t) sizeof(signed short int);
+ptrdiff_t size = (ptrdiff_t) w * (ptrdiff_t) h * (ptrdiff_t) sizeof(signed short int);
 
 /* check for overflow error */
 if( size < 0 || size / w / h != sizeof(signed short int) )
diff --git a/potrace/greymap.h b/potrace/greymap.h
index 000c65e..2505232 100644
--- a/potrace/greymap.h
+++ b/potrace/greymap.h
@@ -8,6 +8,7 @@
 
 #include 
 #include 
+#include 
 
 /* internal format for greymaps. Note: in this format, rows are
  *  ordered from bottom to top. The pixels in each row are given from
@@ -24,7 +25,7 @@ typedef struct greymap_s greymap_t;
 /* macros for accessing pixel at index (x,y). Note that the origin is
  *  in the *lower* left corner. U* macros omit the bounds check. */
 
-#define gm_index( gm, x, y )(&(gm)->map[(x) + (y) * (ssize_t) (gm)->w])
+#define gm_index( gm, x, y )(&(gm)->map[(x) + (y) * (ptrdiff_t) (gm)->w])
 #define gm_safe( gm, x, \
  y )( (int) (x)>=0 && (int) (x)<(gm)->w && (int) (y)>=0 \
   && (int) (y)<(gm)->h )
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 5/8] Open namespace around definitions

2016-02-26 Thread Simon Richter

While defining functions in another namespace is technically allowed as
long as the definition can be matched to a declaration, this can lead to
ambiguous resolutions, such as here (GAL vs KIGFX).
---
 pcbnew/ratsnest_viewitem.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pcbnew/ratsnest_viewitem.cpp b/pcbnew/ratsnest_viewitem.cpp
index 252ef3c..d31c0bd 100644
--- a/pcbnew/ratsnest_viewitem.cpp
+++ b/pcbnew/ratsnest_viewitem.cpp
@@ -35,7 +35,7 @@
 
 #include 
 
-using namespace KIGFX;
+namespace KIGFX {
 
 RATSNEST_VIEWITEM::RATSNEST_VIEWITEM( RN_DATA* aData ) :
 EDA_ITEM( NOT_USED ), m_data( aData )
@@ -118,3 +118,5 @@ void RATSNEST_VIEWITEM::ViewGetLayers( int aLayers[], int& aCount ) const
 aCount = 1;
 aLayers[0] = ITEM_GAL_LAYER( RATSNEST_VISIBLE );
 }
+
+}
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 7/8] Avoid C99 style compound statement

2016-02-26 Thread Simon Richter

Support for C99 in C++ programs is a gcc extension.
---
 eeschema/autoplace_fields.cpp | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/eeschema/autoplace_fields.cpp b/eeschema/autoplace_fields.cpp
index 4d97cd8..07c1002 100644
--- a/eeschema/autoplace_fields.cpp
+++ b/eeschema/autoplace_fields.cpp
@@ -410,7 +410,10 @@ protected:
 }
 
 if( collision != COLLIDE_NONE )
-colliding.push_back( (SIDE_AND_COLL){ side, collision } );
+{
+SIDE_AND_COLL tmp = { side, collision };
+colliding.push_back( tmp );
+}
 }
 
 return colliding;
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 8/8] Avoid conflicting declaration for Pgm()

2016-02-26 Thread Simon Richter

This function has two conflicting definitions in the "kicad" executable and
the other wrapper programs. As the kifaces can be loaded from either, this
silently assumes compatible data layout for the PGM_KICAD and PGM_BASE
types when passed by reference, which is valid only when the compiler is
aware of the cast.

If the return type is encoded in the symbol name (such as when using the
MSVC compiler), this also causes an error during linking, as the symbol
names no longer match.
---
 include/pgm_base.h  | 2 --
 kicad/files-io.cpp  | 2 +-
 kicad/kicad.cpp | 9 -
 kicad/mainframe.cpp | 8 
 kicad/menubar.cpp   | 6 +++---
 kicad/pgm_kicad.h   | 3 ++-
 kicad/prjconfig.cpp | 8 
 7 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/include/pgm_base.h b/include/pgm_base.h
index e8cc98d..be63634 100644
--- a/include/pgm_base.h
+++ b/include/pgm_base.h
@@ -349,9 +349,7 @@ protected:
 };
 
 
-#if !defined(PGM_KICAD_H_)  // PGM_KICAD has an alternate
 /// The global Program "get" accessor.
 extern PGM_BASE& Pgm();
-#endif
 
 #endif  // PGM_BASE_H_
diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp
index 40f85b8..1ec505c 100644
--- a/kicad/files-io.cpp
+++ b/kicad/files-io.cpp
@@ -47,7 +47,7 @@
 void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event )
 {
 wxString fn = GetFileFromHistory( event.GetId(),
-_( "KiCad project file" ), ().GetFileHistory() );
+_( "KiCad project file" ), ().GetFileHistory() );
 
 if( fn.size() )
 {
diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp
index 6dd3677..180bfb8 100644
--- a/kicad/kicad.cpp
+++ b/kicad/kicad.cpp
@@ -91,7 +91,14 @@ KIFACE_I& Kiface()
 
 static PGM_KICAD program;
 
-PGM_KICAD& Pgm()
+
+PGM_BASE& Pgm()
+{
+return program;
+}
+
+
+PGM_KICAD& PgmTop()
 {
 return program;
 }
diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp
index 8170396..d4391af 100644
--- a/kicad/mainframe.cpp
+++ b/kicad/mainframe.cpp
@@ -119,7 +119,7 @@ KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME()
 
 wxConfigBase* KICAD_MANAGER_FRAME::config()
 {
-wxConfigBase* ret = Pgm().PgmSettings();
+wxConfigBase* ret = PgmTop().PgmSettings();
 wxASSERT( ret );
 return ret;
 }
@@ -181,13 +181,13 @@ void KICAD_MANAGER_FRAME::ReCreateTreePrj()
 
 const SEARCH_STACK& KICAD_MANAGER_FRAME::sys_search()
 {
-return Pgm().SysSearch();
+return PgmTop().SysSearch();
 }
 
 
 wxString KICAD_MANAGER_FRAME::help_name()
 {
-return Pgm().GetHelpFileName();
+return PgmTop().GetHelpFileName();
 }
 
 
@@ -212,7 +212,7 @@ void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
 {
 int px, py;
 
-UpdateFileHistory( GetProjectFileName(), ().GetFileHistory() );
+UpdateFileHistory( GetProjectFileName(), ().GetFileHistory() );
 
 if( !IsIconized() )   // save main frame position and size
 {
diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp
index e6a8980..57bacf0 100644
--- a/kicad/menubar.cpp
+++ b/kicad/menubar.cpp
@@ -201,7 +201,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
 // Before deleting, remove the menus managed by m_fileHistory
 // (the file history will be updated when adding/removing files in history)
 if( openRecentMenu )
-Pgm().GetFileHistory().RemoveMenu( openRecentMenu );
+PgmTop().GetFileHistory().RemoveMenu( openRecentMenu );
 
 // Delete all existing menus
 while( menuBar->GetMenuCount() )
@@ -220,8 +220,8 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
 
 // File history
 openRecentMenu = new wxMenu();
-Pgm().GetFileHistory().UseMenu( openRecentMenu );
-Pgm().GetFileHistory().AddFilesToMenu( );
+PgmTop().GetFileHistory().UseMenu( openRecentMenu );
+PgmTop().GetFileHistory().AddFilesToMenu( );
 AddMenuItem( fileMenu, openRecentMenu,
  wxID_ANY,
  _( "Open " ),
diff --git a/kicad/pgm_kicad.h b/kicad/pgm_kicad.h
index e7ff040..61990d9 100644
--- a/kicad/pgm_kicad.h
+++ b/kicad/pgm_kicad.h
@@ -72,6 +72,7 @@ protected:
 };
 
 
-extern PGM_KICAD&  Pgm();
+extern PGM_KICAD& PgmTop();
+
 
 #endif  // PGM_KICAD_H_
diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp
index 5e1f3bc..aec2ec5 100644
--- a/kicad/prjconfig.cpp
+++ b/kicad/prjconfig.cpp
@@ -161,7 +161,7 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString& aPrjFullFileName,
 
 // Write settings to project file
 // was: wxGetApp().WriteProjectConfig( aPrjFullFileName, GeneralGroupName, s_KicadManagerParams );
-Prj().ConfigSave( Pgm().SysSearch(), GeneralGroupName, s_KicadManagerParams );
+Prj().ConfigSave( PgmTop().SysSearch(), GeneralGroupName, s_KicadManagerParams );
 
 // Ensure a "stub" for a schematic root sheet and a board exist.
 // It will avoid messages from the schematic editor or the board editor to create a new file
@@ -324,7 +324,7 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
 

[Kicad-developers] [PATCH 3/8] Use PATH to search for shared libraries on Windows

2016-02-26 Thread Simon Richter

This is appropriate for all Windows targets, not just MSYS.
---
 include/kiway.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/kiway.h b/include/kiway.h
index 406ab91..347c0bb 100644
--- a/include/kiway.h
+++ b/include/kiway.h
@@ -118,8 +118,10 @@ as such!  As such, it is OK to use UTF8 characters:
  #define LIB_ENV_VARwxT( "LD_LIBRARY_PATH" )
 #elif defined(__WXMAC__)
  #define LIB_ENV_VARwxT( "DYLD_LIBRARY_PATH" )
-#elif defined(__MINGW32__)
+#elif defined(_WIN32)
  #define LIB_ENV_VARwxT( "PATH" )
+#else
+ #error Platform support missing
 #endif
 
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 2/8] Use Windows-style DLL import/export for all Windows compilers

2016-02-26 Thread Simon Richter

This should be used whenever Windows is targetted, not just for MSYS.
---
 include/import_export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/import_export.h b/include/import_export.h
index c31729e..672709f 100644
--- a/include/import_export.h
+++ b/include/import_export.h
@@ -28,7 +28,7 @@
 /// Macros which export functions from a DLL/DSO.
 /// See: http://gcc.gnu.org/wiki/Visibility
 
-#if defined(__MINGW32__)
+#if defined(_WIN32)
  #define APIEXPORT __declspec(dllexport)
  #define APIIMPORT __declspec(dllimport)
  #define APILOCAL
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 4/8] Add missing C++ stdlib headers

2016-02-26 Thread Simon Richter

The GCC standard library headers often include other headers, which makes
some code compile that forgets to include several headers.
---
 common/gal/graphics_abstraction_layer.cpp  | 2 ++
 common/grid_tricks.cpp | 2 ++
 common/selcolor.cpp| 2 ++
 common/tool/action_manager.cpp | 1 +
 eeschema/class_library.h   | 2 ++
 eeschema/dialogs/dialog_lib_edit_pin_table.cpp | 2 ++
 eeschema/sch_sheet_path.h  | 2 ++
 gerbview/class_GERBER.cpp  | 1 +
 include/tool/tool_event.h  | 1 +
 include/tool/tool_manager.h| 1 +
 pcb_calculator/transline/transline.cpp | 1 +
 pcbnew/layer_widget.cpp| 3 +++
 pcbnew/ratsnest_data.h | 2 ++
 pcbnew/router/pns_diff_pair.cpp| 1 +
 pcbnew/router/pns_optimizer.cpp| 2 ++
 pcbnew/router/pns_utils.cpp| 2 ++
 pcbnew/tools/conditional_menu.h| 1 +
 pcbnew/tools/edit_points.h | 3 +++
 polygon/math_for_graphics.cpp  | 1 +
 utils/idftools/idf_common.cpp  | 1 +
 20 files changed, 33 insertions(+)

diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp
index d9e9eac..5d9a502 100644
--- a/common/gal/graphics_abstraction_layer.cpp
+++ b/common/gal/graphics_abstraction_layer.cpp
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace KIGFX;
 
 
diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp
index c854411..3782786 100644
--- a/common/grid_tricks.cpp
+++ b/common/grid_tricks.cpp
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#include 
+
 
  // It works for table data on clipboard for an Excell spreadsheet,
 // why not us too for now.
diff --git a/common/selcolor.cpp b/common/selcolor.cpp
index f24ad1b..3b73426 100644
--- a/common/selcolor.cpp
+++ b/common/selcolor.cpp
@@ -32,6 +32,8 @@
 
 #include 
 
+#include 
+
 
 enum colors_id {
 ID_COLOR_BLACK = 2000 // ID_COLOR_ = ID_COLOR_BLACK a ID_COLOR_BLACK + 31
diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp
index ddc3cea..fcf2006 100644
--- a/common/tool/action_manager.cpp
+++ b/common/tool/action_manager.cpp
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 ACTION_MANAGER::ACTION_MANAGER( TOOL_MANAGER* aToolManager ) :
diff --git a/eeschema/class_library.h b/eeschema/class_library.h
index 37bf0dd..355cab0 100644
--- a/eeschema/class_library.h
+++ b/eeschema/class_library.h
@@ -37,6 +37,8 @@
 
 #include 
 
+#include 
+
 class LINE_READER;
 class OUTPUTFORMATTER;
 
diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
index 369a227..5414a58 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
@@ -27,6 +27,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 /* Avoid wxWidgets bug #16906 -- http://trac.wxwidgets.org/ticket/16906
  *
diff --git a/eeschema/sch_sheet_path.h b/eeschema/sch_sheet_path.h
index c301e03..1b208b1 100644
--- a/eeschema/sch_sheet_path.h
+++ b/eeschema/sch_sheet_path.h
@@ -33,6 +33,8 @@
 
 #include 
 
+#include 
+
 
 /** Info about complex hierarchies handling:
  * A hierarchical schematic uses sheets (hierarchical sheets) included in a
diff --git a/gerbview/class_GERBER.cpp b/gerbview/class_GERBER.cpp
index 59d7615..f4483c6 100644
--- a/gerbview/class_GERBER.cpp
+++ b/gerbview/class_GERBER.cpp
@@ -39,6 +39,7 @@
 #include 
 
 #include 
+#include 
 
 
 /**
diff --git a/include/tool/tool_event.h b/include/tool/tool_event.h
index 4def191..cd64c67 100644
--- a/include/tool/tool_event.h
+++ b/include/tool/tool_event.h
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h
index 76127ff..4703f63 100644
--- a/include/tool/tool_manager.h
+++ b/include/tool/tool_manager.h
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/pcb_calculator/transline/transline.cpp b/pcb_calculator/transline/transline.cpp
index fe608cb..cdaa633 100644
--- a/pcb_calculator/transline/transline.cpp
+++ b/pcb_calculator/transline/transline.cpp
@@ -21,6 +21,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
diff --git a/pcbnew/layer_widget.cpp b/pcbnew/layer_widget.cpp
index 275da91..c06b458 100644
--- a/pcbnew/layer_widget.cpp
+++ b/pcbnew/layer_widget.cpp
@@ -40,6 +40,9 @@
 #include 
 #include 
 
+#include 
+
+
 #define BUTT_SIZE_X 20
 #define BUTT_SIZE_Y 18
 #define BUTT_VOID   4
diff --git a/pcbnew/ratsnest_data.h b/pcbnew/ratsnest_data.h
index 72e0530..ec996ba 100644
--- a/pcbnew/ratsnest_data.h
+++ b/pcbnew/ratsnest_data.h
@@ -39,6 +39,8 @@
 #include 
 #include 
 
+#include 
+
 class BOARD;
 class BOARD_ITEM;
 

[Kicad-developers] [PATCH 1/8] Make locale init counter unsigned

2016-02-26 Thread Simon Richter

This counts initializations of the locale subsystem, there is no real good
reason why this should be a signed variable.
---
 common/common.cpp | 2 +-
 include/common.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/common.cpp b/common/common.cpp
index edb5282..ae1d8e7 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -70,7 +70,7 @@ EDA_COLOR_Tg_GhostColor;
 bool g_DisableFloatingPointLocalNotation = false;
 
 
-int LOCALE_IO::C_count;
+unsigned int LOCALE_IO::C_count;
 
 
 void SetLocaleTo_C_standard()
diff --git a/include/common.h b/include/common.h
index 169c0c2..da104ae 100644
--- a/include/common.h
+++ b/include/common.h
@@ -244,7 +244,7 @@ public:
 }
 
 private:
-static int  C_count;// allow for nesting of LOCALE_IO instantiations
+static unsigned int  C_count;// allow for nesting of LOCALE_IO instantiations
 };
 
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 3/5] Refactor ELECTRICAL_PINTYPE

2016-02-26 Thread Simon Richter

 - Move to separate header
 - Move UI text and bitmap lookups out of LIB_PIN
 - Move widget init code out of dialog, into own widget class
---
 eeschema/CMakeLists.txt   |   2 +
 eeschema/dialogs/dialog_erc.cpp   |  18 ++--
 eeschema/dialogs/dialog_erc.h |   4 +-
 eeschema/dialogs/dialog_lib_edit_pin.cpp  |  13 ---
 eeschema/dialogs/dialog_lib_edit_pin.h|   8 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.cpp |   3 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.fbp |   2 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.h   |   3 +-
 eeschema/erc.cpp  |  22 ++---
 eeschema/lib_pin.cpp  |  78 +++--
 eeschema/lib_pin.h|  45 +-
 eeschema/pin_type.cpp | 116 ++
 eeschema/pin_type.h   |  59 +
 eeschema/pinedit.cpp  |   2 -
 eeschema/widgets/pin_type_combobox.cpp|  69 +++
 eeschema/widgets/pin_type_combobox.h  |  51 +++
 16 files changed, 340 insertions(+), 155 deletions(-)
 create mode 100644 eeschema/pin_type.cpp
 create mode 100644 eeschema/pin_type.h
 create mode 100644 eeschema/widgets/pin_type_combobox.cpp
 create mode 100644 eeschema/widgets/pin_type_combobox.h

diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt
index 036322c..e68a5e8 100644
--- a/eeschema/CMakeLists.txt
+++ b/eeschema/CMakeLists.txt
@@ -74,6 +74,7 @@ set( EESCHEMA_DLGS
 set( EESCHEMA_WIDGETS
 widgets/widget_eeschema_color_config.cpp
 widgets/pin_shape_combobox.cpp
+widgets/pin_type_combobox.cpp
 )
 
 
@@ -140,6 +141,7 @@ set( EESCHEMA_SRCS
 pinedit.cpp
 pin_number.cpp
 pin_shape.cpp
+pin_type.cpp
 plot_schematic_DXF.cpp
 plot_schematic_HPGL.cpp
 plot_schematic_PS.cpp
diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp
index 3186bf5..5f15760 100644
--- a/eeschema/dialogs/dialog_erc.cpp
+++ b/eeschema/dialogs/dialog_erc.cpp
@@ -49,8 +49,8 @@
 #include 
 #include 
 
-extern int   DiagErc[PIN_NMAX][PIN_NMAX];
-extern int   DefaultDiagErc[PIN_NMAX][PIN_NMAX];
+extern int   DiagErc[PINTYPE_COUNT][PINTYPE_COUNT];
+extern int   DefaultDiagErc[PINTYPE_COUNT][PINTYPE_COUNT];
 
 
 
@@ -63,7 +63,7 @@ bool DIALOG_ERC::m_tstUniqueGlobalLabels = true;// saved only for the curren
 #define ID_MATRIX_0 1800
 
 BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
-EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PIN_NMAX * PIN_NMAX ) - 1,
+EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PINTYPE_COUNT * PINTYPE_COUNT ) - 1,
wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel )
 END_EVENT_TABLE()
 
@@ -91,9 +91,9 @@ void DIALOG_ERC::Init()
 {
 m_initialized = false;
 
-for( int ii = 0; ii < PIN_NMAX; ii++ )
+for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
 {
-for( int jj = 0; jj < PIN_NMAX; jj++ )
+for( int jj = 0; jj < PINTYPE_COUNT; jj++ )
 m_buttonList[ii][jj] = NULL;
 }
 
@@ -290,7 +290,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
 if( m_initialized == false )
 {
 // Print row labels
-for( int ii = 0; ii < PIN_NMAX; ii++ )
+for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
 {
 int y = pos.y + (ii * bitmap_size.y);
 text = new wxStaticText( m_matrixPanel, -1, CommentERC_H[ii],
@@ -305,7 +305,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
 else
 pos = m_buttonList[0][0]->GetPosition();
 
-for( int ii = 0; ii < PIN_NMAX; ii++ )
+for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
 {
 int y = pos.y + (ii * bitmap_size.y);
 
@@ -323,7 +323,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
 text = new wxStaticText( m_matrixPanel, -1, CommentERC_V[ii], txtpos );
 }
 
-int event_id = ID_MATRIX_0 + ii + ( jj * PIN_NMAX );
+int event_id = ID_MATRIX_0 + ii + ( jj * PINTYPE_COUNT );
 BITMAP_DEF bitmap_butt = erc_green_xpm;
 
 delete m_buttonList[ii][jj];
@@ -420,7 +420,7 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
 wxBitmapButton* butt = (wxBitmapButton*) event.GetEventObject();
 pos  = butt->GetPosition();
 
-x = ii / PIN_NMAX; y = ii % PIN_NMAX;
+x = ii / PINTYPE_COUNT; y = ii % PINTYPE_COUNT;
 
 level = DiagErc[y][x];
 
diff --git a/eeschema/dialogs/dialog_erc.h b/eeschema/dialogs/dialog_erc.h
index d7d9ff8..9cce8b1 100644
--- a/eeschema/dialogs/dialog_erc.h
+++ b/eeschema/dialogs/dialog_erc.h
@@ -27,7 +27,7 @@
 
 #include 
 #include 
-#include // For PIN_NMAX definition
+#include // For PINTYPE_COUNT definition
 
 #include 
 #include "dialog_erc_listbox.h"
@@ -40,7 +40,7 @@ class DIALOG_ERC : public DIALOG_ERC_BASE
 
 private:
 SCH_EDIT_FRAME* m_parent;
-

[Kicad-developers] [PATCH 4/5] Use TypeSheetLabel enum where appropriate

2016-02-26 Thread Simon Richter
---
 eeschema/dialogs/dialog_edit_label.cpp   | 3 ++-
 eeschema/dialogs/dialog_sch_edit_sheet_pin.h | 8 ++--
 eeschema/edit_label.cpp  | 8 
 eeschema/sch_sheet_pin.cpp   | 2 +-
 eeschema/sch_text.cpp| 4 ++--
 eeschema/sch_text.h  | 6 +++---
 eeschema/schframe.h  | 4 +++-
 eeschema/sheetlab.cpp| 2 +-
 8 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/eeschema/dialogs/dialog_edit_label.cpp b/eeschema/dialogs/dialog_edit_label.cpp
index e861a39..2bdb167 100644
--- a/eeschema/dialogs/dialog_edit_label.cpp
+++ b/eeschema/dialogs/dialog_edit_label.cpp
@@ -301,7 +301,8 @@ void DIALOG_LABEL_EDITOR::TextPropertiesAccept( wxCommandEvent& aEvent )
 m_CurrentText->SetSize( wxSize( value, value ) );
 
 if( m_TextShape )
-m_CurrentText->SetShape( m_TextShape->GetSelection() );
+/// @todo move cast to widget
+m_CurrentText->SetShape( static_cast( m_TextShape->GetSelection() ) );
 
 int style = m_TextStyle->GetSelection();
 
diff --git a/eeschema/dialogs/dialog_sch_edit_sheet_pin.h b/eeschema/dialogs/dialog_sch_edit_sheet_pin.h
index fc35864..4d02b01 100644
--- a/eeschema/dialogs/dialog_sch_edit_sheet_pin.h
+++ b/eeschema/dialogs/dialog_sch_edit_sheet_pin.h
@@ -34,6 +34,9 @@
 
 #include 
 
+// enum TypeSheetLabel
+#include 
+
 
 class DIALOG_SCH_EDIT_SHEET_PIN : public DIALOG_SCH_EDIT_SHEET_PIN_BASE
 {
@@ -49,8 +52,9 @@ public:
 void SetTextWidth( const wxString& aWidth ) { m_textWidth->SetValue( aWidth ); }
 wxString GetTextWidth() const { return m_textWidth->GetValue(); }
 
-void SetConnectionType( int aType ) { m_choiceConnectionType->SetSelection( aType ); }
-int GetConnectionType() const { return m_choiceConnectionType->GetCurrentSelection(); }
+void SetConnectionType( TypeSheetLabel aType ) { m_choiceConnectionType->SetSelection( aType ); }
+/// @todo move cast to widget
+TypeSheetLabel GetConnectionType() const { return static_cast( m_choiceConnectionType->GetCurrentSelection() ); }
 
 void SetTextHeightUnits( const wxString& aUnit ) { m_staticHeightUnits->SetLabel( aUnit ); }
 void SetTextWidthUnits( const wxString& aUnit ) { m_staticWidthUnits->SetLabel( aUnit ); }
diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp
index 2be1d87..2d8b243 100644
--- a/eeschema/edit_label.cpp
+++ b/eeschema/edit_label.cpp
@@ -41,10 +41,10 @@
 #include 
 
 
-static int   lastGlobalLabelShape = (int) NET_INPUT;
-static int   lastTextOrientation = 0;
-static bool  lastTextBold = false;
-static bool  lastTextItalic = false;
+static TypeSheetLabel   lastGlobalLabelShape = NET_INPUT;
+static int  lastTextOrientation = 0;
+static bool lastTextBold = false;
+static bool lastTextItalic = false;
 
 
 void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC )
diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp
index 048ffb1..52cdd5d 100644
--- a/eeschema/sch_sheet_pin.cpp
+++ b/eeschema/sch_sheet_pin.cpp
@@ -466,7 +466,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector & aPoints, const wx
  * for INPUT type the icon is the OUTPUT shape of SCH_HIERLABEL
  * for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL
  */
-int tmp = m_shape;
+TypeSheetLabel tmp = m_shape;
 
 switch( m_shape )
 {
diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp
index c84852c..964409a 100644
--- a/eeschema/sch_text.cpp
+++ b/eeschema/sch_text.cpp
@@ -102,11 +102,11 @@ static int* TemplateShape[5][4] =
 
 SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
 SCH_ITEM( NULL, aType ),
-EDA_TEXT( text )
+EDA_TEXT( text ),
+m_shape( NET_INPUT )
 {
 m_Layer = LAYER_NOTES;
 m_Pos = pos;
-m_shape = 0;
 m_isDangling = false;
 m_MultilineAllowed = true;
 m_schematicOrientation = 0;
diff --git a/eeschema/sch_text.h b/eeschema/sch_text.h
index a570bfc..e80448d 100644
--- a/eeschema/sch_text.h
+++ b/eeschema/sch_text.h
@@ -58,7 +58,7 @@ extern const char* SheetLabelType[];/* names of types of labels */
 class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
 {
 protected:
-int m_shape;
+TypeSheetLabel m_shape;
 
 /// True if not connected to another object if the object derive from SCH_TEXT
 /// supports connections.
@@ -120,9 +120,9 @@ public:
 
 int GetOrientation() { return m_schematicOrientation; }
 
-int GetShape() const { return m_shape; }
+TypeSheetLabel GetShape() const { return m_shape; }
 
-void SetShape( int aShape ) { m_shape = aShape; }
+void SetShape( TypeSheetLabel aShape ) { m_shape = aShape; }
 
 /**
  * Function GetSchematicTextOffset (virtual)
diff --git a/eeschema/schframe.h b/eeschema/schframe.h
index 95840f5..743eb29 100644
--- a/eeschema/schframe.h
+++ b/eeschema/schframe.h
@@ 

[Kicad-developers] [PATCH 5/5] Add icon to pin type column

2016-02-26 Thread Simon Richter
---
 eeschema/dialogs/dialog_lib_edit_pin_table.cpp | 51 --
 1 file changed, 47 insertions(+), 4 deletions(-)

diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
index 369a227..047f737 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
@@ -183,7 +183,7 @@ DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE( wxWindow* parent,
 100,
 wxAlignment( wxALIGN_LEFT | wxALIGN_TOP ),
 wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE );
-wxDataViewTextRenderer* rend2 = new wxDataViewTextRenderer( wxT( "string" ), wxDATAVIEW_CELL_INERT );
+wxDataViewIconTextRenderer* rend2 = new wxDataViewIconTextRenderer( wxT( "wxDataViewIconText" ), wxDATAVIEW_CELL_INERT );
 wxDataViewColumn* col2 = new wxDataViewColumn( _( "Type" ),
 rend2,
 DataViewModel::PIN_TYPE,
@@ -255,7 +255,23 @@ unsigned int DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::GetColumnCount() const
 
 wxString DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::GetColumnType( unsigned int aCol ) const
 {
-return wxT( "string" );
+switch( aCol )
+{
+case PIN_NUMBER:
+return wxT( "string" );
+
+case PIN_NAME:
+return wxT( "string" );
+
+case PIN_TYPE:
+return wxT( "wxDataViewIconText" );
+
+case PIN_POSITION:
+return wxT( "string" );
+}
+
+assert( ! "Unhandled column" );
+return wxT( "" );
 }
 
 
@@ -431,8 +447,20 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Group::GetValue( wxVariant& aValu
 if( aCol == m_GroupingColumn )
 // shortcut
 m_Members.front()->GetValue( aValue, aCol );
-else
+else if( aCol != PIN_TYPE )
 aValue = GetString( aCol );
+else
+{
+PinNumbers values;
+
+for( std::list::const_iterator i = m_Members.begin(); i != m_Members.end(); ++i )
+values.insert( (*i)->GetString( aCol ) );
+
+if( values.size() > 1 )
+aValue << wxDataViewIconText( boost::algorithm::join( values, "," ), wxNullIcon );
+else
+m_Members.front()->GetValue( aValue, aCol );
+}
 }
 
 
@@ -476,7 +504,22 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Group::Add( Pin* aPin )
 void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::GetValue( wxVariant& aValue,
 unsigned int aCol ) const
 {
-aValue = GetString( aCol );
+switch( aCol )
+{
+case PIN_NUMBER:
+case PIN_NAME:
+case PIN_POSITION:
+aValue = GetString( aCol );
+break;
+
+case PIN_TYPE:
+{
+wxIcon icon;
+icon.CopyFromBitmap( KiBitmap ( GetBitmap( m_Backing->GetType() ) ) );
+aValue << wxDataViewIconText( m_Backing->GetElectricalTypeName(), icon );
+}
+break;
+}
 }
 
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 2/5] Refactor DrawPinShape

2016-02-26 Thread Simon Richter

DrawPinShape is a bitmask, where only a limited set of values is valid.

 - Replace this with an enum that contains exactly the allowed values
 - Move UI text and bitmap lookups out of LIB_PIN
 - Move widget init code out of dialog, into own widget class
---
 eeschema/CMakeLists.txt   |   3 +
 eeschema/dialogs/dialog_lib_edit_pin.cpp  |  14 +-
 eeschema/dialogs/dialog_lib_edit_pin.h|   6 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.cpp |   3 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.fbp |   2 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.h   |   3 +-
 eeschema/lib_pin.cpp  | 265 --
 eeschema/lib_pin.h|  55 +-
 eeschema/pin_shape.cpp| 104 ++
 eeschema/pin_shape.h  |  57 ++
 eeschema/pinedit.cpp  |   7 +-
 eeschema/widgets/pin_shape_combobox.cpp   |  69 +++
 eeschema/widgets/pin_shape_combobox.h |  51 +
 13 files changed, 426 insertions(+), 213 deletions(-)
 create mode 100644 eeschema/pin_shape.cpp
 create mode 100644 eeschema/pin_shape.h
 create mode 100644 eeschema/widgets/pin_shape_combobox.cpp
 create mode 100644 eeschema/widgets/pin_shape_combobox.h

diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt
index 1537547..036322c 100644
--- a/eeschema/CMakeLists.txt
+++ b/eeschema/CMakeLists.txt
@@ -13,6 +13,7 @@ include_directories( BEFORE ${INC_BEFORE} )
 include_directories(
 ./dialogs
 ./netlist_exporters
+./widgets
 ../common
 ../common/dialogs
 ${INC_AFTER}
@@ -72,6 +73,7 @@ set( EESCHEMA_DLGS
 
 set( EESCHEMA_WIDGETS
 widgets/widget_eeschema_color_config.cpp
+widgets/pin_shape_combobox.cpp
 )
 
 
@@ -137,6 +139,7 @@ set( EESCHEMA_SRCS
 operations_on_items_lists.cpp
 pinedit.cpp
 pin_number.cpp
+pin_shape.cpp
 plot_schematic_DXF.cpp
 plot_schematic_HPGL.cpp
 plot_schematic_PS.cpp
diff --git a/eeschema/dialogs/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp
index f19c125..736d145 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin.cpp
@@ -133,7 +133,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
 int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
 int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
 int pinLength = ValueFromString( g_UserUnit, GetLength() );
-int pinShape = LIB_PIN::GetStyleCode( GetStyle() );
+GRAPHIC_PINSHAPE pinShape = GetStyle();
 ELECTRICAL_PINTYPE pinType = GetElectricalType();
 
 m_dummyPin->SetName( GetPinName() );
@@ -174,15 +174,3 @@ void DIALOG_LIB_EDIT_PIN::SetElectricalTypeList( const wxArrayString& list,
 m_choiceElectricalType->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
 }
 }
-
-
-void DIALOG_LIB_EDIT_PIN::SetStyleList( const wxArrayString& list, const BITMAP_DEF* aBitmaps )
-{
-for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
-{
-if( aBitmaps == NULL )
-m_choiceStyle->Append( list[ii] );
-else
-m_choiceStyle->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
-}
-}
diff --git a/eeschema/dialogs/dialog_lib_edit_pin.h b/eeschema/dialogs/dialog_lib_edit_pin.h
index 7df0792..a7ddedb 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.h
+++ b/eeschema/dialogs/dialog_lib_edit_pin.h
@@ -31,6 +31,7 @@
  */
 
 #include 
+#include 
 
 #include 
 
@@ -72,9 +73,8 @@ public:
 return (ELECTRICAL_PINTYPE)m_choiceElectricalType->GetSelection();
 }
 
-void SetStyleList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
-void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
-int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
+void SetStyle( GRAPHIC_PINSHAPE style ) { m_choiceStyle->SetSelection( style ); }
+GRAPHIC_PINSHAPE GetStyle( void ) { return m_choiceStyle->GetSelection(); }
 
 void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
 wxString GetPinName( void ) { return m_textPinName->GetValue(); }
diff --git a/eeschema/dialogs/dialog_lib_edit_pin_base.cpp b/eeschema/dialogs/dialog_lib_edit_pin_base.cpp
index e0f439b..af770d7 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin_base.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin_base.cpp
@@ -5,6 +5,7 @@
 // PLEASE DO "NOT" EDIT THIS FILE!
 ///
 
+#include "pin_shape_combobox.h"
 #include "wx/bmpcbox.h"
 
 #include "dialog_lib_edit_pin_base.h"
@@ -68,7 +69,7 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
 	m_staticTextGstyle->Wrap( -1 );
 	fgSizerPins->Add( m_staticTextGstyle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
 	
-	m_choiceStyle = new wxBitmapComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 

[Kicad-developers] [PATCH 0/5] Enum refactoring and shiny icons

2016-02-26 Thread Simon Richter
Hi,

this refactors two enum types, ELECTRICAL_PINTYPE and DrawPinShape (which
becomes GRAPHIC_PINSHAPE):

1. Move enum to separate header file, out of lib_pin.h.
2. Move UI text and bitmap lookup out of LIB_PIN (end goal: no UI code in
   data structures)
3. Create separate widget class for use in dialogs, that is completely
   self-initializing to maximize reusability

Then, the TypeSheetLabel enum type is used explicitly where possible, for
better typesafety (this is what is left of the ERC changes posted earlier).

Finally, the "pin type" column in the pin table gets icons to hopefully
enhandle readability. This requires the text/bitmap lookup changes from
earlier, that's why it's in this patch set.

   Simon

Simon Richter (5):
  Fix typo
  Refactor DrawPinShape
  Refactor ELECTRICAL_PINTYPE
  Use TypeSheetLabel enum where appropriate
  Add icon to pin type column

 eeschema/CMakeLists.txt|   5 +
 eeschema/dialogs/dialog_edit_label.cpp |   3 +-
 eeschema/dialogs/dialog_erc.cpp|  18 +-
 eeschema/dialogs/dialog_erc.h  |   4 +-
 eeschema/dialogs/dialog_lib_edit_pin.cpp   |  27 +-
 eeschema/dialogs/dialog_lib_edit_pin.h |  14 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.cpp  |   6 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.fbp  |   4 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.h|   6 +-
 eeschema/dialogs/dialog_lib_edit_pin_table.cpp |  51 +++-
 eeschema/dialogs/dialog_sch_edit_sheet_pin.h   |   8 +-
 eeschema/edit_label.cpp|   8 +-
 eeschema/erc.cpp   |  22 +-
 eeschema/lib_pin.cpp   | 343 ++---
 eeschema/lib_pin.h | 102 +---
 eeschema/pin_shape.cpp | 104 
 eeschema/pin_shape.h   |  57 
 eeschema/pin_type.cpp  | 116 +
 eeschema/pin_type.h|  59 +
 eeschema/pinedit.cpp   |   9 +-
 eeschema/sch_sheet_pin.cpp |   2 +-
 eeschema/sch_text.cpp  |   4 +-
 eeschema/sch_text.h|   6 +-
 eeschema/schframe.h|   4 +-
 eeschema/sheetlab.cpp  |   2 +-
 eeschema/widgets/pin_shape_combobox.cpp|  69 +
 eeschema/widgets/pin_shape_combobox.h  |  51 
 eeschema/widgets/pin_type_combobox.cpp |  69 +
 eeschema/widgets/pin_type_combobox.h   |  51 
 29 files changed, 836 insertions(+), 388 deletions(-)
 create mode 100644 eeschema/pin_shape.cpp
 create mode 100644 eeschema/pin_shape.h
 create mode 100644 eeschema/pin_type.cpp
 create mode 100644 eeschema/pin_type.h
 create mode 100644 eeschema/widgets/pin_shape_combobox.cpp
 create mode 100644 eeschema/widgets/pin_shape_combobox.h
 create mode 100644 eeschema/widgets/pin_type_combobox.cpp
 create mode 100644 eeschema/widgets/pin_type_combobox.h

-- 
2.1.4

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH 1/5] Fix typo

2016-02-26 Thread Simon Richter
---
 eeschema/lib_pin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eeschema/lib_pin.h b/eeschema/lib_pin.h
index 51f5f58..15d5412 100644
--- a/eeschema/lib_pin.h
+++ b/eeschema/lib_pin.h
@@ -277,7 +277,7 @@ public:
 /**
  * Get the electrical type of the pin.
  *
- * @return The electrical type of the pin (see enun ELECTRICAL_PINTYPE for values).
+ * @return The electrical type of the pin (see enum ELECTRICAL_PINTYPE for values).
  */
 ELECTRICAL_PINTYPE GetType() const { return m_type; }
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Serious issue after updating msys2 (32 bits)

2016-02-26 Thread Nick Østergaard
FWIW, some discussion related to this issue is happening on
https://github.com/Alexpux/MINGW-packages/issues/1104#issuecomment-189141900

2016-02-26 17:51 GMT+01:00 Wayne Stambaugh :
> On 2/26/2016 11:50 AM, Nick Østergaard wrote:
>> 2016-02-26 17:20 GMT+01:00 Wayne Stambaugh :
>>> On 2/26/2016 5:05 AM, jp charras wrote:
 Le 25/02/2016 21:59, Wayne Stambaugh a écrit :
> On 2/25/2016 3:50 PM, jp charras wrote:
 ...
>>> On 2/25/2016 3:33 PM, Wayne Stambaugh wrote:
 Yep!  I just confirmed this.  It must have been the mingw32 updates 
 that
 were just released.  I'm not sure which package is at fault.  I guess 
 we
 will have to downgrade to the previous version.  This is one of the
 issues with msys2.  They tend to break things fairly often.

 Here is the list of packages that were just updated that may have 
 caused
 the problem:

 mingw-w64-i686-crypto++
 mingw-w64-i686-openjpeg
 mingw-w64-i686-openssl
 mingw-w64-i686-crt-git
 mingw-w64-i686-headers-git

 I installed the previous version of mingw-w64-i686-crt-git and
 mingw-w64-i686-headers-git, and the issue is fixed.

 Last old version I installed from my cache:
 mingw-w64-i686-crt-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
 mingw-w64-i686-headers-git-5.0.0.4609.566d621-1-any.pkg.tar.xz

 Thanks for your advice, it was helpful to me.

>>>
>>> I just tested this and it also breaks mingw64 builds as well so expect a
>>> bunch of broken nightly windows builds.  Our windows package devs are
>>> going to have to pin the correct package versions in their pacman.conf
>>> when the install/upgrade msys2 or stop building windows nightly
>>> installers until the problem is resolved.  JP, have you notified the
>>> msys2 project of the issue?
>>
>> FWIW, I am not auto updating the installation on the build server. I
>> will just not update untill it has been fixed upstream.
>>
>
> Wise move!  I'll keep everyone posted when this is sorted out.

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-26 Thread Eldar Khayrullin
Add patch for carret return symbol in text

> On Feb 25 2016, at 10:36 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Next I will fix some other import bugs:

>

>   * carret return symbol \r - ?

>   * size and proportional of text

>   * etc

>

>> On Feb 25 2016, at 10:30 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Patch for position text with only justify from imported file. More accuary.

>>

>>> On Feb 25 2016, at 9:05 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
And it apply only for free text not to refdes and value...

>>>

 On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?



> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

>

>> On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  

>>

>> Regarding variable width font. I ran into the issue when I was trying
to generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 

>>

>>  

>>

>> You might need to rescale the font size to match the KiCad font. So if
you had a similar glyph size table for the PCAD font you might be able to
generate the new text to fit into the same space as the original.

>>

>>  

>>

>> I hope this is helpful in some way.

>>

>>  

>>

>> If you want the code that I used to generate the glyph width table with
let me know.

>>

>>  

>>

>> Cheers,

>>

>> Esden

>>

>>  

>>

>>  

>>

>>> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>>>

>>>  

>>>

>>> Ok, glad to help.  

>>>

 On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  



 If the differences are due to variable font width issues then there
is  
not much we can do about that. Thanks for fixing this.



 On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   


>>>

>>> ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe : 

Re: [Kicad-developers] gerbview/options.cpp

2016-02-26 Thread jp charras
Le 26/02/2016 18:06, Simon Wells a écrit :
> Can gerbview/options.cpp be removed? it hasn't been touch since mid
> 2012 and is not currently built nor used, It seems to have been
> replaced with events_called_functions.cpp
> 
> Simon
> 

Yes.


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] gerbview/options.cpp

2016-02-26 Thread Simon Wells
Can gerbview/options.cpp be removed? it hasn't been touch since mid
2012 and is not currently built nor used, It seems to have been
replaced with events_called_functions.cpp

Simon

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Serious issue after updating msys2 (32 bits)

2016-02-26 Thread Wayne Stambaugh
On 2/26/2016 11:50 AM, Nick Østergaard wrote:
> 2016-02-26 17:20 GMT+01:00 Wayne Stambaugh :
>> On 2/26/2016 5:05 AM, jp charras wrote:
>>> Le 25/02/2016 21:59, Wayne Stambaugh a écrit :
 On 2/25/2016 3:50 PM, jp charras wrote:
>>> ...
>> On 2/25/2016 3:33 PM, Wayne Stambaugh wrote:
>>> Yep!  I just confirmed this.  It must have been the mingw32 updates that
>>> were just released.  I'm not sure which package is at fault.  I guess we
>>> will have to downgrade to the previous version.  This is one of the
>>> issues with msys2.  They tend to break things fairly often.
>>>
>>> Here is the list of packages that were just updated that may have caused
>>> the problem:
>>>
>>> mingw-w64-i686-crypto++
>>> mingw-w64-i686-openjpeg
>>> mingw-w64-i686-openssl
>>> mingw-w64-i686-crt-git
>>> mingw-w64-i686-headers-git
>>>
>>> I installed the previous version of mingw-w64-i686-crt-git and
>>> mingw-w64-i686-headers-git, and the issue is fixed.
>>>
>>> Last old version I installed from my cache:
>>> mingw-w64-i686-crt-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
>>> mingw-w64-i686-headers-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
>>>
>>> Thanks for your advice, it was helpful to me.
>>>
>>
>> I just tested this and it also breaks mingw64 builds as well so expect a
>> bunch of broken nightly windows builds.  Our windows package devs are
>> going to have to pin the correct package versions in their pacman.conf
>> when the install/upgrade msys2 or stop building windows nightly
>> installers until the problem is resolved.  JP, have you notified the
>> msys2 project of the issue?
> 
> FWIW, I am not auto updating the installation on the build server. I
> will just not update untill it has been fixed upstream.
> 

Wise move!  I'll keep everyone posted when this is sorted out.

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Serious issue after updating msys2 (32 bits)

2016-02-26 Thread Nick Østergaard
2016-02-26 17:20 GMT+01:00 Wayne Stambaugh :
> On 2/26/2016 5:05 AM, jp charras wrote:
>> Le 25/02/2016 21:59, Wayne Stambaugh a écrit :
>>> On 2/25/2016 3:50 PM, jp charras wrote:
>> ...
> On 2/25/2016 3:33 PM, Wayne Stambaugh wrote:
>> Yep!  I just confirmed this.  It must have been the mingw32 updates that
>> were just released.  I'm not sure which package is at fault.  I guess we
>> will have to downgrade to the previous version.  This is one of the
>> issues with msys2.  They tend to break things fairly often.
>>
>> Here is the list of packages that were just updated that may have caused
>> the problem:
>>
>> mingw-w64-i686-crypto++
>> mingw-w64-i686-openjpeg
>> mingw-w64-i686-openssl
>> mingw-w64-i686-crt-git
>> mingw-w64-i686-headers-git
>>
>> I installed the previous version of mingw-w64-i686-crt-git and
>> mingw-w64-i686-headers-git, and the issue is fixed.
>>
>> Last old version I installed from my cache:
>> mingw-w64-i686-crt-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
>> mingw-w64-i686-headers-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
>>
>> Thanks for your advice, it was helpful to me.
>>
>
> I just tested this and it also breaks mingw64 builds as well so expect a
> bunch of broken nightly windows builds.  Our windows package devs are
> going to have to pin the correct package versions in their pacman.conf
> when the install/upgrade msys2 or stop building windows nightly
> installers until the problem is resolved.  JP, have you notified the
> msys2 project of the issue?

FWIW, I am not auto updating the installation on the build server. I
will just not update untill it has been fixed upstream.

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Serious issue after updating msys2 (32 bits)

2016-02-26 Thread jp charras
Le 26/02/2016 17:20, Wayne Stambaugh a écrit :
> On 2/26/2016 5:05 AM, jp charras wrote:
>> Le 25/02/2016 21:59, Wayne Stambaugh a écrit :
>>> On 2/25/2016 3:50 PM, jp charras wrote:
>> ...
> On 2/25/2016 3:33 PM, Wayne Stambaugh wrote:
>> Yep!  I just confirmed this.  It must have been the mingw32 updates that
>> were just released.  I'm not sure which package is at fault.  I guess we
>> will have to downgrade to the previous version.  This is one of the
>> issues with msys2.  They tend to break things fairly often.
>>
>> Here is the list of packages that were just updated that may have caused
>> the problem:
>>
>> mingw-w64-i686-crypto++
>> mingw-w64-i686-openjpeg
>> mingw-w64-i686-openssl
>> mingw-w64-i686-crt-git
>> mingw-w64-i686-headers-git
>>
>> I installed the previous version of mingw-w64-i686-crt-git and
>> mingw-w64-i686-headers-git, and the issue is fixed.
>>
>> Last old version I installed from my cache:
>> mingw-w64-i686-crt-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
>> mingw-w64-i686-headers-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
>>
>> Thanks for your advice, it was helpful to me.
>>
> 
> I just tested this and it also breaks mingw64 builds as well so expect a
> bunch of broken nightly windows builds.  Our windows package devs are
> going to have to pin the correct package versions in their pacman.conf
> when the install/upgrade msys2 or stop building windows nightly
> installers until the problem is resolved.  JP, have you notified the
> msys2 project of the issue?
> 

After more tests, this is only mingw-w64-i686-crt-git which is broken.

No, I did not notified the msys2 project.



-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Serious issue after updating msys2 (32 bits)

2016-02-26 Thread Wayne Stambaugh
On 2/26/2016 5:05 AM, jp charras wrote:
> Le 25/02/2016 21:59, Wayne Stambaugh a écrit :
>> On 2/25/2016 3:50 PM, jp charras wrote:
> ...
 On 2/25/2016 3:33 PM, Wayne Stambaugh wrote:
> Yep!  I just confirmed this.  It must have been the mingw32 updates that
> were just released.  I'm not sure which package is at fault.  I guess we
> will have to downgrade to the previous version.  This is one of the
> issues with msys2.  They tend to break things fairly often.
>
> Here is the list of packages that were just updated that may have caused
> the problem:
>
> mingw-w64-i686-crypto++
> mingw-w64-i686-openjpeg
> mingw-w64-i686-openssl
> mingw-w64-i686-crt-git
> mingw-w64-i686-headers-git
> 
> I installed the previous version of mingw-w64-i686-crt-git and
> mingw-w64-i686-headers-git, and the issue is fixed.
> 
> Last old version I installed from my cache:
> mingw-w64-i686-crt-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
> mingw-w64-i686-headers-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
> 
> Thanks for your advice, it was helpful to me.
> 

I just tested this and it also breaks mingw64 builds as well so expect a
bunch of broken nightly windows builds.  Our windows package devs are
going to have to pin the correct package versions in their pacman.conf
when the install/upgrade msys2 or stop building windows nightly
installers until the problem is resolved.  JP, have you notified the
msys2 project of the issue?


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH] Fix Touchpad Panning Regressions

2016-02-26 Thread Bernhard Stegmaier
Hi,

attached patch:

Fix 3d-viewer regressions introduced by touchpad-panning for 
non-touchpad-panning:
* Fix broken horizontal scrolling with ctrl-wheel
* Restore previous step size

Sorry for the inconvenience.


Regards,
Bernhard



fix-3d-tp-regr.patch
Description: Binary data



> On 26.02.2016, at 10:01, Mário Luzeiro  wrote:
> 
> yes it is on 3d-viewer. Everytime I scroll the y coordinate "jumps" in 6 
> steps.
> It is not usable for me :/
> 
> Mario
> 
> From: Bernhard Stegmaier [stegma...@sw-systems.de]
> Sent: 26 February 2016 06:40
> To: Mário Luzeiro
> Cc: Wayne Stambaugh; KiCad Developers
> Subject: Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning
> 
> Hi Mario,
> 
> what canvas are you talking about?
> What do you mean with “in steps of 6 / -6”?
> 
> 
> Regards,
> Bernhard
> 
>> On 25 Feb 2016, at 23:10, Mário Luzeiro  wrote:
>> 
>> Hi Wayne, Bernhard,
>> 
>> I am not sure if this patch is correct.
>> I updated my trunk kicad and install it (to make sure I was using the trunk 
>> version)
>> 
>> First if I select the option and scroll with mouse, it will jump in the Y in 
>> steps of 6 / -6 .. but I am not sure how it is supposed to work (I dont have 
>> a compatible? touchpad)
>> Second, I think it breaks the previous function of vertical / horizontal 
>> scrolling:
>> 
>> because if I (uncheck the option and) press shift / ctrl.. I also got that 
>> 6/-6 steps..
>> also it only work for Y.. and not for X
>> 
>> http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/view/head:/3d-viewer/3d_canvas.cpp#L284
>> 
>> So I think for my case the
>> if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL )
>> 
>> is not horizontal when I press the shift and scroll..
>> 
>> Would you mind to verify?
>> 
>> Thanks!
>> Mario
>> 
>> 
>> From: Kicad-developers 
>> [kicad-developers-bounces+mrluzeiro=ua...@lists.launchpad.net] on behalf of 
>> Wayne Stambaugh [stambau...@gmail.com]
>> Sent: 24 February 2016 19:56
>> To: Bernhard Stegmaier
>> Cc: KiCad Developers
>> Subject: Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning
>> 
>> Patch committed in r6586.  Thanks!
>> 
>> Wayne
>> 
>> On 2/23/2016 12:25 PM, Bernhard Stegmaier wrote:
>>> 
 On 23.02.2016, at 17:44, Bernhard Stegmaier  
 wrote:
 
> * The touchpad panning is not implemented in the component viewer,
> component editor, footprint viewer, and footprint editor.  I would think
> that we would want it implemented in these windows for the sake of
> consistency.  I image the first bug report filed against this patch will
> be about that.
 
 Strange, all of them work for me on OS X, both with legacy and GAL canvas.
 I’ll retest on Linux.
 
 I currently couldn’t imagine any reason why it shouldn’t work in Windows…
 The changes are just in the EDA_DRAW_PANEL classes.
 Are they different on Windows?
>>> 
>>> I just verified on my Debian/Xfce (via VirtualBox on OS X) and all of them
>>> do work with touchpad-panning.
>>> 
>>> What is the problem with it?
>>> Doesn’t it pan at all?
>>> 
>>> As said in the other mail these are the same events as for the scroll-wheel.
>>> So, if the touchpad in general works with touchpad-panning disabled and
>>> using shift/ctrl modifiers, it should also be OK with it enabled.
>>> There is no platform magic involved...
>>> 
>>> 
>>> Regards
>>> Bernhard
>>> 
>> 
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] 3D-Viewer feature proposal: display of the 3D Shapes based on Attributes of the footprint

2016-02-26 Thread jp charras
Le 26/02/2016 14:03, Mário Luzeiro a écrit :
> Hello again,
> 
> Could someone clarify this:
> https://github.com/KiCad/kicad-source-mirror/blob/a356293fee05b5a48853a3bb1c0d565f846113e6/pcbnew/class_module.h#L64
>  * Enum MODULE_ATTR_T
>  * is the set of attributes allowed within a MODULE, using 
> MODULE::SetAttributes()
>  * and MODULE::GetAttributes().  These are to be ORed together when calling
>  * MODULE::SetAttributes()
> 
> However, in the options:
> http://docs.kicad-pcb.org/en/pcbnew.html#_attributes
> 
> only an option can be set at one time.
> 
> On the source code I see lots of | (or) with this flags. Example:
> https://github.com/KiCad/kicad-source-mirror/blob/d24bd85bf503f83429acbeb31e34323f901f0873/pcbnew/muonde.cpp#L292
> 
> Could you clarify how it should be interpreted?
> 
> Thanks
> Mario

Attributes are flags which can be ORed (at least they were intended to
be ORed).
However currently, there are only 2 attributes, which are (obviously)
mutually exclusive:
VIRTUAL
MOD_SMD

the "Attribute" NORMAL is in fact no attribute.

in muonde.cpp, you can see VIRTUAL|MOD_SMD like a (minor) bug in a
rather old code.




-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] 3D-Viewer feature proposal: display of the 3D Shapes based on Attributes of the footprint

2016-02-26 Thread Mário Luzeiro
Hello again,

Could someone clarify this:
https://github.com/KiCad/kicad-source-mirror/blob/a356293fee05b5a48853a3bb1c0d565f846113e6/pcbnew/class_module.h#L64
 * Enum MODULE_ATTR_T
 * is the set of attributes allowed within a MODULE, using 
MODULE::SetAttributes()
 * and MODULE::GetAttributes().  These are to be ORed together when calling
 * MODULE::SetAttributes()

However, in the options:
http://docs.kicad-pcb.org/en/pcbnew.html#_attributes

only an option can be set at one time.

On the source code I see lots of | (or) with this flags. Example:
https://github.com/KiCad/kicad-source-mirror/blob/d24bd85bf503f83429acbeb31e34323f901f0873/pcbnew/muonde.cpp#L292

Could you clarify how it should be interpreted?

Thanks
Mario

From: Kicad-developers 
[kicad-developers-bounces+mrluzeiro=ua...@lists.launchpad.net] on behalf of 
Mário Luzeiro [mrluze...@ua.pt]
Sent: 25 February 2016 12:30
To: kicad-developers@lists.launchpad.net
Subject: [Kicad-developers] 3D-Viewer feature proposal: display of the 3D 
Shapes based on Attributes of the footprint

Hello all,

Does it makes sense to add an option in 3D Viewer to display the footprint 3D 
Shapes, based on the Attributes of a footprint?
http://docs.kicad-pcb.org/en/pcbnew.html#_attributes

So user can individual select to visualize all "Normal" 3dshapes (THT?) and/or 
"Normal+Insert" (SMD?) 3dshapes and/or "Virtual" (?) 3dshapes ?

Some users (i.e. Maurice) suggest that the "Virtual" option could also be used 
with the propose to place/display mechanical (eg: enclosures) 3dshapes.

Mario Luzeiro
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Python functionality on Windows

2016-02-26 Thread Miguel Angel Ajo Pelayo
I understand the issue with dependencies.

I don’t have a windows but, has anybody tried easy_install ? 

https://pythonhosted.org/setuptools/easy_install.html 


It’s supposed to be lighter than pip, I’m not sure if it comes with the base
python.

> On 24 Feb 2016, at 16:40, Wayne Stambaugh  wrote:
> 
> On 2/24/2016 4:15 AM, Miguel Angel Ajo Pelayo wrote:
>> 
>> If it’s not hard to provide pip, IMHO one of the strengths of python is the
>> availability of lots libraries. I believe it’s ok to let the user know they 
>> will
>> need to reinstall their libraries after an update.
> 
> I'm OK with providing pip but all of the python dependencies will have
> to be added to the windows installer.  If someone wants to look at that,
> fine but I would rather we focus on KiCad rather than third Python support.
> 
> I'm OK with informing users about loosing their custom installed Python
> libraries when upgrading kicad but I can assure you there will be
> complaining.
> 
>> 
>> 
>> 
>>> On 24 Feb 2016, at 01:28, Wayne Stambaugh  wrote:
>>> 
>>> On 2/23/2016 3:53 PM, Nick Østergaard wrote:
 As far as I can se, we need python2w.exe, that should be easy to add.
 But what I worry about is if we include pip, it might not work as
 expeced for the user, beacause when he upgrades he might get into
 trouble if he uninstalls kicad and then installs. The user will have
 to reinstall the modules that he uses. An other thing is if kicad is
 installed to %PROGRAMFILES%, then you will likely have trouble
 modifying stuff there, because of the user access control. But I have
 not tested this.
>>> 
>>> This was my concern.  Providing a full Python implementation is outside
>>> the scope of the project.  If someone needs this, they should install
>>> msys2 and either build kicad from source or create pacman packages.  If
>>> you don't mind, I would like to cherry pick your changes to PKGBUILD and
>>> push them to the msys2 kicad-git package repo.  I'll also create a kicad
>>> PKGBUID for the stable version of kicad using your PKGBUILD-STABLE so
>>> the msys2 project can provide both git mirror and stable version kicad
>>> packages.
>>> 
>>> Thanks,
>>> 
>>> Wayne
>>> 
 
 2016-02-23 20:32 GMT+01:00 Wayne Stambaugh :
> AFAIK kicad-winbuilder is no longer used or maintained.  KiCad is now
> built using msys2/mingw32 and msys2/mingw64 and the appropriate python
> run time requirements are installed in the same path as kicad.  Package
> devs correct me if I'm wrong but this is a partial install of the
> mingw32 or mingw64 python system containing only the run time
> requirements to use the python console and the Pcbnew Python modules and
> scripts.
> 
> If you want to maintain kicad-winbuilder, feel free to modify it any way
> you see fit but the windows installers will still continue to use msys2
> as the build environment.  We are using msys2/mingw32/64 because all of
> the dependency libraries required to build kicad are supplied by the
> msys2 project.  There is no need to build wxwidgets, boost, cairo, etc.
> from source to build kicad.
> 
> On 2/23/2016 1:51 PM, Константин Барановский wrote:
>> I'm confused. I'm not understand what is your point of view about
>> integration python to the installation of kicad on Windows. Will it
>> still done with kicad-winbuilder or you planning to separate python from
>> kicad installation and to use system-wide?
>> As I see (thank you xarx and Torsten Hüter), simplest way to include
>> full-featured python - it modify kicad-winbuilder. If you do not mind,
>> I'll try to do it.
>> 
>> Regards, Konstantin.
>> 
>> 
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>>> 
>>> 
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : 

Re: [Kicad-developers] Serious issue after updating msys2 (32 bits)

2016-02-26 Thread jp charras
Le 25/02/2016 21:59, Wayne Stambaugh a écrit :
> On 2/25/2016 3:50 PM, jp charras wrote:
...
>>> On 2/25/2016 3:33 PM, Wayne Stambaugh wrote:
 Yep!  I just confirmed this.  It must have been the mingw32 updates that
 were just released.  I'm not sure which package is at fault.  I guess we
 will have to downgrade to the previous version.  This is one of the
 issues with msys2.  They tend to break things fairly often.

 Here is the list of packages that were just updated that may have caused
 the problem:

 mingw-w64-i686-crypto++
 mingw-w64-i686-openjpeg
 mingw-w64-i686-openssl
 mingw-w64-i686-crt-git
 mingw-w64-i686-headers-git

I installed the previous version of mingw-w64-i686-crt-git and
mingw-w64-i686-headers-git, and the issue is fixed.

Last old version I installed from my cache:
mingw-w64-i686-crt-git-5.0.0.4609.566d621-1-any.pkg.tar.xz
mingw-w64-i686-headers-git-5.0.0.4609.566d621-1-any.pkg.tar.xz

Thanks for your advice, it was helpful to me.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning

2016-02-26 Thread Simon Wells
fair enough,

In case you missed it wx 3.1 has been announced for release on 29/02,
however this probably won't mean much until 3.2 is out as it seems
they follow the old linux numbering where odd minor is not stable

On Fri, Feb 26, 2016 at 9:30 PM, Bernhard Stegmaier
 wrote:
> I guess the other gestures would have to be covered by wxWidgets in a way
> similar to pinch-to-zoom.
>
> You can have a look here:
>   http://docs.wxwidgets.org/trunk/classwx_mouse_event.html
> wxWidgets recently added the EVT_MAGNIFY for pinch-to-zoom, but apparently
> they didn't yet think of supporting more gestures.
>
>
> Regards,
> Bernhard
>
>
> On 2016-02-26 08:10, Simon Wells wrote:
>>
>> thanks bernhard... this has increased usability on osx for me by an
>> infinite amount Do you have any code for using 2 finger rotate in
>> 3d-viewer?
>>
>> On Fri, Feb 26, 2016 at 8:06 PM, Bernhard Stegmaier
>>  wrote:
>>>
>>> Hi Mario,
>>>
>>> didn’t see on first glance, you mean the 3d-viewer.
>>> Yes, sorry about that… obviously the .y should be a .x in the “else if(
>>> event.ControlDown() )” block.
>>> I’ll check that tonight.
>>> I will also check the default step size.
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
>>>
 On 26 Feb 2016, at 07:40, Bernhard Stegmaier 
 wrote:

 Hi Mario,

 what canvas are you talking about?
 What do you mean with “in steps of 6 / -6”?


 Regards,
 Bernhard

> On 25 Feb 2016, at 23:10, Mário Luzeiro  wrote:
>
> Hi Wayne, Bernhard,
>
> I am not sure if this patch is correct.
> I updated my trunk kicad and install it (to make sure I was using the
> trunk version)
>
> First if I select the option and scroll with mouse, it will jump in the
> Y in steps of 6 / -6 .. but I am not sure how it is supposed to work (I 
> dont
> have a compatible? touchpad)
> Second, I think it breaks the previous function of vertical /
> horizontal scrolling:
>
> because if I (uncheck the option and) press shift / ctrl.. I also got
> that 6/-6 steps..
> also it only work for Y.. and not for X
>
>
> http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/view/head:/3d-viewer/3d_canvas.cpp#L284
>
> So I think for my case the
> if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL )
>
> is not horizontal when I press the shift and scroll..
>
> Would you mind to verify?
>
> Thanks!
> Mario
>
> 
> From: Kicad-developers
> [kicad-developers-bounces+mrluzeiro=ua...@lists.launchpad.net] on behalf 
> of
> Wayne Stambaugh [stambau...@gmail.com]
> Sent: 24 February 2016 19:56
> To: Bernhard Stegmaier
> Cc: KiCad Developers
> Subject: Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning
>
> Patch committed in r6586.  Thanks!
>
> Wayne
>
> On 2/23/2016 12:25 PM, Bernhard Stegmaier wrote:
>>
>>
>>> On 23.02.2016, at 17:44, Bernhard Stegmaier 
>>> wrote:
>>>
 * The touchpad panning is not implemented in the component viewer,
 component editor, footprint viewer, and footprint editor.  I would
 think
 that we would want it implemented in these windows for the sake of
 consistency.  I image the first bug report filed against this patch
 will
 be about that.
>>>
>>>
>>> Strange, all of them work for me on OS X, both with legacy and GAL
>>> canvas.
>>> I’ll retest on Linux.
>>>
>>> I currently couldn’t imagine any reason why it shouldn’t work in
>>> Windows…
>>> The changes are just in the EDA_DRAW_PANEL classes.
>>> Are they different on Windows?
>>
>>
>> I just verified on my Debian/Xfce (via VirtualBox on OS X) and all of
>> them
>> do work with touchpad-panning.
>>
>> What is the problem with it?
>> Doesn’t it pan at all?
>>
>> As said in the other mail these are the same events as for the
>> scroll-wheel.
>> So, if the touchpad in general works with touchpad-panning disabled
>> and
>> using shift/ctrl modifiers, it should also be OK with it enabled.
>> There is no platform magic involved...
>>
>>
>> Regards
>> Bernhard
>>
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp



 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers

Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning

2016-02-26 Thread Mário Luzeiro
yes it is on 3d-viewer. Everytime I scroll the y coordinate "jumps" in 6 steps.
It is not usable for me :/

Mario

From: Bernhard Stegmaier [stegma...@sw-systems.de]
Sent: 26 February 2016 06:40
To: Mário Luzeiro
Cc: Wayne Stambaugh; KiCad Developers
Subject: Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning

Hi Mario,

what canvas are you talking about?
What do you mean with “in steps of 6 / -6”?


Regards,
Bernhard

> On 25 Feb 2016, at 23:10, Mário Luzeiro  wrote:
>
> Hi Wayne, Bernhard,
>
> I am not sure if this patch is correct.
> I updated my trunk kicad and install it (to make sure I was using the trunk 
> version)
>
> First if I select the option and scroll with mouse, it will jump in the Y in 
> steps of 6 / -6 .. but I am not sure how it is supposed to work (I dont have 
> a compatible? touchpad)
> Second, I think it breaks the previous function of vertical / horizontal 
> scrolling:
>
> because if I (uncheck the option and) press shift / ctrl.. I also got that 
> 6/-6 steps..
> also it only work for Y.. and not for X
>
> http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/view/head:/3d-viewer/3d_canvas.cpp#L284
>
> So I think for my case the
> if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL )
>
> is not horizontal when I press the shift and scroll..
>
> Would you mind to verify?
>
> Thanks!
> Mario
>
> 
> From: Kicad-developers 
> [kicad-developers-bounces+mrluzeiro=ua...@lists.launchpad.net] on behalf of 
> Wayne Stambaugh [stambau...@gmail.com]
> Sent: 24 February 2016 19:56
> To: Bernhard Stegmaier
> Cc: KiCad Developers
> Subject: Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning
>
> Patch committed in r6586.  Thanks!
>
> Wayne
>
> On 2/23/2016 12:25 PM, Bernhard Stegmaier wrote:
>>
>>> On 23.02.2016, at 17:44, Bernhard Stegmaier  wrote:
>>>
 * The touchpad panning is not implemented in the component viewer,
 component editor, footprint viewer, and footprint editor.  I would think
 that we would want it implemented in these windows for the sake of
 consistency.  I image the first bug report filed against this patch will
 be about that.
>>>
>>> Strange, all of them work for me on OS X, both with legacy and GAL canvas.
>>> I’ll retest on Linux.
>>>
>>> I currently couldn’t imagine any reason why it shouldn’t work in Windows…
>>> The changes are just in the EDA_DRAW_PANEL classes.
>>> Are they different on Windows?
>>
>> I just verified on my Debian/Xfce (via VirtualBox on OS X) and all of them
>> do work with touchpad-panning.
>>
>> What is the problem with it?
>> Doesn’t it pan at all?
>>
>> As said in the other mail these are the same events as for the scroll-wheel.
>> So, if the touchpad in general works with touchpad-panning disabled and
>> using shift/ctrl modifiers, it should also be OK with it enabled.
>> There is no platform magic involved...
>>
>>
>> Regards
>> Bernhard
>>
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] New Feature: Touchpad Panning

2016-02-26 Thread Bernhard Stegmaier
I guess the other gestures would have to be covered by wxWidgets in a 
way

similar to pinch-to-zoom.

You can have a look here:
  http://docs.wxwidgets.org/trunk/classwx_mouse_event.html
wxWidgets recently added the EVT_MAGNIFY for pinch-to-zoom, but 
apparently

they didn't yet think of supporting more gestures.


Regards,
Bernhard

On 2016-02-26 08:10, Simon Wells wrote:

thanks bernhard... this has increased usability on osx for me by an
infinite amount Do you have any code for using 2 finger rotate in
3d-viewer?

On Fri, Feb 26, 2016 at 8:06 PM, Bernhard Stegmaier
 wrote:

Hi Mario,

didn’t see on first glance, you mean the 3d-viewer.
Yes, sorry about that… obviously the .y should be a .x in the “else 
if( event.ControlDown() )” block.

I’ll check that tonight.
I will also check the default step size.


Regards,
Bernhard


On 26 Feb 2016, at 07:40, Bernhard Stegmaier 
 wrote:


Hi Mario,

what canvas are you talking about?
What do you mean with “in steps of 6 / -6”?


Regards,
Bernhard


On 25 Feb 2016, at 23:10, Mário Luzeiro  wrote:

Hi Wayne, Bernhard,

I am not sure if this patch is correct.
I updated my trunk kicad and install it (to make sure I was using 
the trunk version)


First if I select the option and scroll with mouse, it will jump in 
the Y in steps of 6 / -6 .. but I am not sure how it is supposed to 
work (I dont have a compatible? touchpad)
Second, I think it breaks the previous function of vertical / 
horizontal scrolling:


because if I (uncheck the option and) press shift / ctrl.. I also 
got that 6/-6 steps..

also it only work for Y.. and not for X

http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/view/head:/3d-viewer/3d_canvas.cpp#L284

So I think for my case the
if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL )

is not horizontal when I press the shift and scroll..

Would you mind to verify?

Thanks!
Mario


From: Kicad-developers 
[kicad-developers-bounces+mrluzeiro=ua...@lists.launchpad.net] on 
behalf of Wayne Stambaugh [stambau...@gmail.com]

Sent: 24 February 2016 19:56
To: Bernhard Stegmaier
Cc: KiCad Developers
Subject: Re: [Kicad-developers] [PATCH] New Feature: Touchpad 
Panning


Patch committed in r6586.  Thanks!

Wayne

On 2/23/2016 12:25 PM, Bernhard Stegmaier wrote:


On 23.02.2016, at 17:44, Bernhard Stegmaier 
 wrote:


* The touchpad panning is not implemented in the component 
viewer,
component editor, footprint viewer, and footprint editor.  I 
would think
that we would want it implemented in these windows for the sake 
of
consistency.  I image the first bug report filed against this 
patch will

be about that.


Strange, all of them work for me on OS X, both with legacy and GAL 
canvas.

I’ll retest on Linux.

I currently couldn’t imagine any reason why it shouldn’t work in 
Windows…

The changes are just in the EDA_DRAW_PANEL classes.
Are they different on Windows?


I just verified on my Debian/Xfce (via VirtualBox on OS X) and all 
of them

do work with touchpad-panning.

What is the problem with it?
Doesn’t it pan at all?

As said in the other mail these are the same events as for the 
scroll-wheel.
So, if the touchpad in general works with touchpad-panning disabled 
and

using shift/ctrl modifiers, it should also be OK with it enabled.
There is no platform magic involved...


Regards
Bernhard



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp