Commit Graph

21 Commits

Author SHA1 Message Date
jean-pierre charras fa10e1b7fe rename a few files 2018-01-29 09:39:47 +01:00
jean-pierre charras e499d337d8 rename files: update filenames in sources 2018-01-28 19:12:26 +01:00
jean-pierre charras bdc6a5950b rename plot_common.h to class_plotter.h, a better name, consistent with other class definitions. 2017-11-16 15:53:30 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Jean-Noel Avila 58af5bc3a4 Eeschema: Fix off-by-one in saving bitmaps 2016-11-09 09:46:35 +01:00
Simon Richter bfb6e0bbb2 Convert remaining occurences of stri[n]cmp to str[n]casecmp.
This also reverses the substitution logic if strcasecmp is missing (config.h.cmake)
2016-08-16 10:27:09 +02:00
Wayne Stambaugh 98ad5096b0 Eeschema: add saving schematic files to schematic plugin.
* Add SCH_PLUGIN::Save() for current file format and code for saving all
  SCH_XXX objects.

* Add function to SCH_FIELD to get the position of the field in the component
  not the position added to the component position which is what GetPosition()
  does.  This was required because saving the component field expects position
  of the field sans the position of the component.

* Remove public members from BITMAP_BASE object and fix all associated
  code.

* Fix the never ending coding policy violations found making these changes.
2016-07-11 15:48:46 -04:00
Wayne Stambaugh bedf0b6aec Remove incorrect comment regarding wxWidgets bug report from class_bitmap_base.cpp. 2016-02-23 19:31:34 -05:00
Nick Winters 8cb1f39ed5 OSX: fix bug caused by wxBitmap drawing 0 width or heigth bitmap. (fixes lp:1529159) 2016-02-22 16:23:17 -05:00
jean-pierre charras 10d67ffbd9 Fix some coverity warnings (not initialized members). Add comments. Better (more informative) title in dialog to download .pretty libs. 2015-02-26 11:33:15 +01:00
jean-pierre charras 64925bfc4f Very minor fixes: add missing const return type to some GetBoundingBox() declarations. Change few functions names to better names in some places (like GetName() to GetPinName() ) 2015-01-18 18:28:14 +01:00
jean-pierre charras 24f516f6ae Fix many doxygen warnings (due to missing info, old comments, typo ...) when building the doxygen doc. 2014-11-02 17:25:04 +01:00
jean-pierre charras b0e2908c9b pl_editor: add a PPI (pixel per inch) setup option for bitmaps. 2013-10-19 12:29:54 +02:00
jean-pierre charras 6bb62a7196 Remove duplicate files.
Page layout editor: Add bitmap items to the page layout existing items.
Now a bitmap image can be added to a page layout description. Currently the bitmap is expected having a 300 ppi definition.
Note: not all plotters can plot a bitmap, and in this case the bounding box is plotted instead of the bitmap
2013-10-18 19:38:03 +02:00
jean-pierre charras 50743cf3ba Initial release of pl_editor, the page layout and title block editor. 2013-07-19 20:27:22 +02:00
jean-pierre charras a9744e3f84 Pcbnew: added: SVG plotter. Need refinements, but works.
Mainly to plot drill maps, but can be used to plot boards, for documentation.
The print svg still exists, but the plot SVG has more options (mirroring, holes in pads),
however  print svg allows color print, and full board printing, and plot does not.
2012-09-15 14:13:03 +02:00
jean-pierre charras 61acac28e1 Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue under Windows (zlib sources added) 2012-05-03 20:37:56 +02:00
Dick Hollenbeck c24863c078 // Dick Hollenbeck's KiROUND R&D
// This provides better project control over rounding to int from double
// than wxRound() did.  This scheme provides better logging in Debug builds
// and it provides for compile time calculation of constants.


#include <stdio.h>
#include <assert.h>
#include <limits.h>

//-----<KiROUND KIT>------------------------------------------------------------

/**
 * KiROUND
 * rounds a floating point number to an int using
 * "round halfway cases away from zero".
 * In Debug build an assert fires if will not fit into an int.
 */

#if defined( DEBUG )

// DEBUG: a macro to capture line and file, then calls this inline

static inline int KiRound( double v, int line, const char* filename )
{
    v = v < 0 ? v - 0.5 : v + 0.5;
    if( v > INT_MAX + 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' > 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    else if( v < INT_MIN - 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' < 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    return int( v );
}

#define KiROUND( v )    KiRound( v, __LINE__, __FILE__ )

#else

// RELEASE: a macro so compile can pre-compute constants.

#define KiROUND( v )  int( (v) < 0 ? (v) - 0.5 : (v) + 0.5 )

#endif


//-----</KiROUND KIT>-----------------------------------------------------------

// Only a macro is compile time calculated, an inline function causes a static constructor
// in a situation like this.
// Therefore the Release build is best done with a MACRO not an inline function.
int Computed = KiROUND( 14.3 * 8 );


int main( int argc, char** argv )
{
    for( double d = double(INT_MAX)-1;  d < double(INT_MAX)+8;  d += 2.0 )
    {
        int i = KiROUND( d );

        printf( "t: %d  %.16g\n", i, d );
    }

    return 0;
}
2012-04-19 01:55:45 -05:00
Wayne Stambaugh 4b853dedb4 Application name capitalization fixes.
* Correct all user strings and comments for the correct capitalization of
  application names according to JP.  They are KiCad, Pcbnew, CvPcb,
  Eeschema, and GerbView.
* Add a note the the user interface policy about the correct capitalization.
2011-09-30 14:15:37 -04:00
jean-pierre charras 4da0bfc20b Eeschema: bitmap editor dialog: some enhancements 2011-09-02 21:43:56 +02:00
jean-pierre charras 4402c97c7a Eeschema: Fix a subtle bug in undo command when editing texts and labels.
Add a new schematic item: SCH_BITMAP. One can insert now images in a schematic.
Add Fabrizio Tappero as contributor  in Kicad About dialog
2011-08-31 16:59:20 +02:00