Compare commits
376 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9389a2b7c5 | |||
| 97aa507dd4 | |||
| eed62789a8 | |||
| 17a29794a1 | |||
| c49a9497ff | |||
| 362366d6f5 | |||
| 372a9c3f51 | |||
| 8c2a6fc818 | |||
| 7054963d90 | |||
| b894e7fe91 | |||
| 55e5596cda | |||
| ec405f02f8 | |||
| 29b2c79f0a | |||
| 0682d319fb | |||
| b2de4cf40a | |||
| f724dab4b2 | |||
| bef63fe76b | |||
| ec649593ae | |||
| fec6882e0a | |||
| 28b2e656e5 | |||
| b46bce8f8f | |||
| 8b5cd26dc7 | |||
| 1bf44150b1 | |||
| c7b4da3ef9 | |||
| c24192108d | |||
| c07f83b06b | |||
| 716c899a6b | |||
| e1810c9835 | |||
| 9f18dc3cbf | |||
| f1d69af419 | |||
| 708c6cca63 | |||
| 8d9ae99258 | |||
| 9bc6fde2f6 | |||
| 1ef0a5e22b | |||
| 6c356aa21c | |||
| 69cf4fb6ef | |||
| 3adf9f0c82 | |||
| 777860d520 | |||
| 1a510a297e | |||
| d65d41286f | |||
| b40d42696a | |||
| 3e25689be7 | |||
| cad5a2722c | |||
| a673970435 | |||
| 45ba00ac22 | |||
| 8d858fe998 | |||
| 232b286793 | |||
| 60b40579cb | |||
| 3ba87b9d08 | |||
| 849e3d2f18 | |||
| 9f2eade5f5 | |||
| 857d4f3803 | |||
| 5f06f0d863 | |||
| 9b7b923e34 | |||
| d551b0b949 | |||
| 59a4cc2e4b | |||
| 9ab4fef369 | |||
| 8024555323 | |||
| d209dddcc6 | |||
| 96022ee169 | |||
| 4eb0e70ddf | |||
| 879e76b28e | |||
| 72a59c547c | |||
| d96479dd34 | |||
| 8874f137fa | |||
| ada1a9b054 | |||
| 56ca054c0d | |||
| 5dc8e9a5de | |||
| 91d5238f4c | |||
| bc25044e78 | |||
| 30affcd7a1 | |||
| a7f5fc45e7 | |||
| 88a404580a | |||
| 29311393a5 | |||
| e765ad0c2f | |||
| d9809fb816 | |||
| 50e2a12e17 | |||
| 636c6c4efb | |||
| c5120b9090 | |||
| 8955e33e80 | |||
| 4037894b99 | |||
| 74b174e4f0 | |||
| 062a813139 | |||
| afb61b3b4e | |||
| 9e510759b8 | |||
| d4c9e1f069 | |||
| ccb39fb775 | |||
| a5d643cbaa | |||
| 9083c9e6ab | |||
| 0c4ff6b640 | |||
| 8bdc7f108b | |||
| 4cf8274b2b | |||
| 799ea8317d | |||
| 3baa6cd791 | |||
| 12dc00b8d8 | |||
| 09c8ac2038 | |||
| 36e155ee58 | |||
| 4ec8aee7d8 | |||
| 25a49a64a6 | |||
| c436207659 | |||
| 3260aa2213 | |||
| 94444adb54 | |||
| 683be91b60 | |||
| 3078d82bd5 | |||
| fb87ea6837 | |||
| 112e8e7ccb | |||
| 9beca90185 | |||
| 46ada43166 | |||
| c6e049df2a | |||
| 088e0e80a1 | |||
| 3f90cfb0ca | |||
| 81fbaacae2 | |||
| ff820bd809 | |||
| e316b33a08 | |||
| 7ea6206126 | |||
| f34f962455 | |||
| 919931f0f0 | |||
| 0d86b88008 | |||
| 1641878af7 | |||
| f871255005 | |||
| 6c2a559cbe | |||
| 33a8425d3d | |||
| 17af30d26f | |||
| 5aa8f1841f | |||
| c9985f02cf | |||
| 37e74c9614 | |||
| 23fff95362 | |||
| 5ff079fb3f | |||
| 8220f72db0 | |||
| 5ab146aa7b | |||
| 90229d0129 | |||
| 05c7900363 | |||
| 1c13ab4dc9 | |||
| cb6be36969 | |||
| 4b20b9bf92 | |||
| 0786b005b3 | |||
| 22afe8c060 | |||
| d395091899 | |||
| 001962c8b7 | |||
| 3191ba4d70 | |||
| da94a9127d | |||
| 8bf308573a | |||
| 5139cbb0ab | |||
| 8a6c9bd395 | |||
| fe19b02ea3 | |||
| a51173d017 | |||
| b6be36f7ef | |||
| f039378bde | |||
| 493db877c9 | |||
| 04ca6e6d5c | |||
| dc20d120eb | |||
| 40e8a573f0 | |||
| 342217478b | |||
| 1d928ea1b0 | |||
| 981fb67d57 | |||
| d49059be91 | |||
| b00a7e294f | |||
| 9cb500654b | |||
| 3ce858e88d | |||
| e23777e826 | |||
| 1cd9929b15 | |||
| 39d87c339b | |||
| dc8cb076c6 | |||
| d361e58da9 | |||
| bec82d1951 | |||
| 1a00405a87 | |||
| 1082aa2861 | |||
| 9f685ddec8 | |||
| 202833aa8d | |||
| fdb3401ec1 | |||
| 812e2983a5 | |||
| bebe0216f9 | |||
| 0a13094913 | |||
| 1159ff2735 | |||
| 37db18b249 | |||
| 4b19a6d33a | |||
| 014df49c4f | |||
| 7d532e4502 | |||
| 3aca721bb4 | |||
| f4e65c54cf | |||
| cfaf70c0a4 | |||
| 9399f2ba7d | |||
| 94c3f05bd7 | |||
| 07d7cddafb | |||
| c9a06ca564 | |||
| ab3d2e4c60 | |||
| 641070db7c | |||
| c71ea22e7d | |||
| ea6e527063 | |||
| 57c9120c20 | |||
| ee4dd37ad1 | |||
| 9c3b246c36 | |||
| 6903f6c71c | |||
| 6077f467ec | |||
| 31863bb266 | |||
| 5dd563f2db | |||
| 863b460d09 | |||
| 2e1029fc53 | |||
| 4dccffa153 | |||
| d5ebe0f6f6 | |||
| 088e2f96ee | |||
| eca0bf6f0b | |||
| 6209b3b23a | |||
| 7824f1d650 | |||
| dfa8bc2adc | |||
| 16eda46396 | |||
| 785edc3247 | |||
| c912250b0d | |||
| 0ba7f0e766 | |||
| 19708d2a75 | |||
| d16c28911e | |||
| e94052ccb3 | |||
| e8e0b07223 | |||
| 6652d3eca7 | |||
| 76083e507a | |||
| d90862b444 | |||
| 28a4ca2d80 | |||
| 8a7bf78b38 | |||
| e417b209a0 | |||
| 6e54b88fe0 | |||
| 00e4d72d4b | |||
| 25379b3094 | |||
| e530bab396 | |||
| a9500de3f8 | |||
| e21ec0558e | |||
| 32673a0ead | |||
| fccb661487 | |||
| c9001cc187 | |||
| 048669eced | |||
| b2ef81808b | |||
| 68b3f66cd3 | |||
| 76728ab748 | |||
| 8903a82c50 | |||
| e487f19260 | |||
| 42b9a9604b | |||
| 7080d99464 | |||
| c120254aa4 | |||
| 66df840353 | |||
| 9cf4dd05b3 | |||
| 4e80c6fdc1 | |||
| 1dfe3ebc54 | |||
| 60c2469c75 | |||
| 6f2a3582ae | |||
| 86394b7598 | |||
| 59f20cdedc | |||
| fb6d3c1808 | |||
| 9eaefa3301 | |||
| 0011586372 | |||
| 43be371f83 | |||
| d9a243d98c | |||
| 09bbaa5813 | |||
| b25cc8eb02 | |||
| 38054953d1 | |||
| b7592db2b3 | |||
| 877e197fec | |||
| de7f735856 | |||
| 5b07bb4f6a | |||
| 954ef70a8a | |||
| 469d2176dd | |||
| 4c65085fa5 | |||
| 7f307afb04 | |||
| a9ddcf4287 | |||
| 48b32f781e | |||
| e9269e59f7 | |||
| dc5276c1df | |||
| 90465d6261 | |||
| df1b5dd62c | |||
| 8fe8637297 | |||
| d562336760 | |||
| 0748a1ca34 | |||
| 88b56413d5 | |||
| e19bce2f93 | |||
| be38fa5cac | |||
| 9a57f7d573 | |||
| 95a1d17603 | |||
| 84f4f7f724 | |||
| 78cf47bd00 | |||
| 8f60a47a81 | |||
| 0c694de209 | |||
| 4eaadcae5c | |||
| 76849b05a7 | |||
| 2278ee070f | |||
| c0e2acc8cb | |||
| 0281bfe05e | |||
| 4118c14d97 | |||
| 71353b11f1 | |||
| 988d229bbf | |||
| dac7c9d4d7 | |||
| 5a57e5cfd4 | |||
| 4fe05bfe47 | |||
| 27755ac317 | |||
| a0dd0485e9 | |||
| d21eeb4249 | |||
| d50b69f1ae | |||
| 427d7d2dad | |||
| a50d3b5d1b | |||
| a71b7e14d4 | |||
| eb24b18f0a | |||
| 7171713315 | |||
| aa960e661b | |||
| 0cd67e3c66 | |||
| 56c19a9257 | |||
| f54de9181d | |||
| 1f90c17f39 | |||
| 15652dd1a7 | |||
| e2db63236e | |||
| 3b943ad079 | |||
| 56a19c5e1e | |||
| 1cbcab4208 | |||
| 40c8dc7e8e | |||
| 2867b28a24 | |||
| 0e8c04888d | |||
| 6dde23a1d2 | |||
| dd14092d5f | |||
| 1da00b7d1e | |||
| ba1b65cf69 | |||
| 058d99f236 | |||
| b7ca7163f9 | |||
| ed662c3f1f | |||
| b2c8c9c302 | |||
| 196b3d100b | |||
| b891860c25 | |||
| 056b8d668a | |||
| 9143ab47c1 | |||
| e8adb46e59 | |||
| 910a5d2483 | |||
| 6c794b85fd | |||
| 4efa78abc9 | |||
| 3702f73de9 | |||
| fc54a2615e | |||
| 8c4e2f1577 | |||
| 239f200b2d | |||
| 613be802b9 | |||
| 6af44c8ffa | |||
| 0216b186aa | |||
| abbdea4412 | |||
| 689441ebab | |||
| 062a03c3aa | |||
| 8a0bff7351 | |||
| ca5f867957 | |||
| becaba531b | |||
| 240a745aa7 | |||
| db877e6a00 | |||
| 5e6795a774 | |||
| 44840c7df2 | |||
| 6b6729284c | |||
| c50ce416f2 | |||
| dd20d464f3 | |||
| 867e6858c8 | |||
| 1abfc13755 | |||
| f226287360 | |||
| 775b768833 | |||
| 0118d7fb38 | |||
| 6b3396ea2d | |||
| 87c42db898 | |||
| e85f1bea0c | |||
| e0c61e6069 | |||
| f0d1052547 | |||
| d53ed205f2 | |||
| 975fe32fa7 | |||
| b582f178dd | |||
| 6423571349 | |||
| 7993daecf0 | |||
| 6122fca858 | |||
| e6eff2ce27 | |||
| 24ec25a24c | |||
| 3a3e2fe835 | |||
| d74744596e | |||
| cd403a27a9 | |||
| 8557deec54 | |||
| a1fa0bdb0b | |||
| c16d403dd0 | |||
| 7972ba84fa | |||
| 1259e6057a | |||
| b933d3228f | |||
| a1fbff35e8 |
@@ -65,6 +65,7 @@ Coverity:
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_USE_CMAKE_FINDPROTOBUF=ON
|
||||
- coverity/bin/cov-build --dir cov-int make -j10
|
||||
- *coverity_submit
|
||||
artifacts:
|
||||
@@ -72,4 +73,4 @@ Coverity:
|
||||
expose_as: 'Coverity log'
|
||||
name: "coverity_log.txt"
|
||||
paths:
|
||||
- cov-int/build-log.txt
|
||||
- cov-int/build-log.txt
|
||||
|
||||
@@ -642,12 +642,33 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// add also this shape to the plated copper polygon list if required
|
||||
if( cfg.DifferentiatePlatedCopper() )
|
||||
{
|
||||
if( layer == F_Cu )
|
||||
item->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu,
|
||||
0, maxError, ERROR_INSIDE );
|
||||
else if( layer == B_Cu )
|
||||
item->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu,
|
||||
0, maxError, ERROR_INSIDE );
|
||||
// Note: for TEXT and TEXTBOX, TransformShapeToPolygon returns the bounding
|
||||
// box shape, not the exact text shape. So it is not used for these items
|
||||
if( layer == F_Cu || layer == B_Cu )
|
||||
{
|
||||
SHAPE_POLY_SET* platedCopperPolys = layer == F_Cu
|
||||
? m_frontPlatedCopperPolys
|
||||
: m_backPlatedCopperPolys;
|
||||
|
||||
if( item->Type() == PCB_TEXTBOX_T )
|
||||
{
|
||||
PCB_TEXTBOX* text_box = static_cast<PCB_TEXTBOX*>( item );
|
||||
text_box->TransformTextToPolySet( *platedCopperPolys,
|
||||
0, maxError, ERROR_INSIDE );
|
||||
// Add box outlines
|
||||
text_box->PCB_SHAPE::TransformShapeToPolygon( *platedCopperPolys, layer,
|
||||
0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
else if( item->Type() == PCB_TEXT_T )
|
||||
{
|
||||
static_cast<PCB_TEXT*>( item )->TransformTextToPolySet(
|
||||
*platedCopperPolys,
|
||||
0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
else
|
||||
item->TransformShapeToPolygon( *platedCopperPolys, layer,
|
||||
0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,12 @@ COLOR_RGBA::COLOR_RGBA( const SFVEC4F& aColor )
|
||||
}
|
||||
|
||||
|
||||
COLOR_RGBA::operator SFVEC4F() const
|
||||
{
|
||||
return SFVEC4F( r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f );
|
||||
}
|
||||
|
||||
|
||||
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2 )
|
||||
{
|
||||
const unsigned int r = aC1.r + aC2.r;
|
||||
|
||||
@@ -60,6 +60,8 @@ union COLOR_RGBA
|
||||
b = aB;
|
||||
a = aA;
|
||||
}
|
||||
|
||||
operator SFVEC4F() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,10 +42,15 @@ void FRUSTUM::GenerateFrustum( const RAY& topLeft, const RAY& topRight, const RA
|
||||
m_point[2] = bottomLeft.m_Origin;
|
||||
m_point[3] = topLeft.m_Origin;
|
||||
|
||||
m_normals[0] = glm::cross( topRight.m_Dir, topLeft.m_Dir ); // TOP
|
||||
m_normals[1] = glm::cross( bottomRight.m_Dir, topRight.m_Dir ); // RIGHT
|
||||
m_normals[2] = glm::cross( bottomLeft.m_Dir, bottomRight.m_Dir ); // BOTTOM
|
||||
m_normals[3] = glm::cross( topLeft.m_Dir, bottomLeft.m_Dir ); // LEFT
|
||||
SFVEC3F tl_tr = topRight.m_Origin - topLeft.m_Origin;
|
||||
SFVEC3F tr_br = bottomRight.m_Origin - topRight.m_Origin;
|
||||
SFVEC3F br_bl = bottomLeft.m_Origin - bottomRight.m_Origin;
|
||||
SFVEC3F bl_tl = topLeft.m_Origin - bottomLeft.m_Origin;
|
||||
|
||||
m_normals[0] = glm::cross( tl_tr, topLeft.m_Dir ); // TOP
|
||||
m_normals[1] = glm::cross( tr_br, topRight.m_Dir ); // RIGHT
|
||||
m_normals[2] = glm::cross( br_bl, bottomRight.m_Dir ); // BOTTOM
|
||||
m_normals[3] = glm::cross( bl_tl, bottomLeft.m_Dir ); // LEFT
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,53 @@
|
||||
#include <wx/log.h>
|
||||
|
||||
|
||||
#ifdef USE_SRGB_SPACE
|
||||
|
||||
/// @todo This should be removed in future when KiCad supports a greater version of glm lib.
|
||||
#define SRGB_GAMA 2.4f
|
||||
|
||||
|
||||
// This function implements the conversion from linear RGB to sRGB
|
||||
// https://github.com/g-truc/glm/blob/master/glm/gtc/color_space.inl#L12
|
||||
static SFVEC3F convertLinearToSRGB( const SFVEC3F& aRGBcolor )
|
||||
{
|
||||
const float gammaCorrection = 1.0f / SRGB_GAMA;
|
||||
const SFVEC3F clampedColor = glm::clamp( aRGBcolor, SFVEC3F( 0.0f ), SFVEC3F( 1.0f ) );
|
||||
|
||||
return glm::mix( glm::pow( clampedColor, SFVEC3F(gammaCorrection) ) * 1.055f - 0.055f,
|
||||
clampedColor * 12.92f,
|
||||
glm::lessThan( clampedColor, SFVEC3F(0.0031308f) ) );
|
||||
}
|
||||
|
||||
|
||||
static SFVEC4F convertLinearToSRGBA( const SFVEC4F& aRGBAcolor )
|
||||
{
|
||||
return SFVEC4F( convertLinearToSRGB( SFVEC3F( aRGBAcolor ) ), aRGBAcolor.a );
|
||||
}
|
||||
|
||||
|
||||
// This function implements the conversion from sRGB to linear RGB
|
||||
// https://github.com/g-truc/glm/blob/master/glm/gtc/color_space.inl#L35
|
||||
SFVEC3F ConvertSRGBToLinear( const SFVEC3F& aSRGBcolor )
|
||||
{
|
||||
const float gammaCorrection = SRGB_GAMA;
|
||||
|
||||
return glm::mix( glm::pow( ( aSRGBcolor + SFVEC3F( 0.055f ) )
|
||||
* SFVEC3F( 0.94786729857819905213270142180095f ),
|
||||
SFVEC3F( gammaCorrection ) ),
|
||||
aSRGBcolor * SFVEC3F( 0.07739938080495356037151702786378f ),
|
||||
glm::lessThanEqual( aSRGBcolor, SFVEC3F( 0.04045f ) ) );
|
||||
}
|
||||
|
||||
|
||||
SFVEC4F ConvertSRGBAToLinear( const SFVEC4F& aSRGBAcolor )
|
||||
{
|
||||
return SFVEC4F( ConvertSRGBToLinear( SFVEC3F( aSRGBAcolor ) ), aSRGBAcolor.a );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
RENDER_3D_RAYTRACE_BASE::RENDER_3D_RAYTRACE_BASE( BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
|
||||
RENDER_3D_BASE( aAdapter, aCamera ),
|
||||
m_postShaderSsao( aCamera )
|
||||
@@ -116,6 +163,19 @@ static inline void SetPixel( uint8_t* p, const COLOR_RGBA& v )
|
||||
}
|
||||
|
||||
|
||||
static void SetPixelSRGBA( uint8_t* p, const COLOR_RGBA& v )
|
||||
{
|
||||
SFVEC4F color = v;
|
||||
|
||||
#ifdef USE_SRGB_SPACE
|
||||
color = convertLinearToSRGB( color );
|
||||
#endif
|
||||
|
||||
COLOR_RGBA rgba( color );
|
||||
SetPixel( p, rgba );
|
||||
}
|
||||
|
||||
|
||||
SFVEC4F RENDER_3D_RAYTRACE_BASE::premultiplyAlpha( const SFVEC4F& aInput )
|
||||
{
|
||||
return SFVEC4F( aInput.r * aInput.a, aInput.g * aInput.a, aInput.b * aInput.a, aInput.a );
|
||||
@@ -238,53 +298,6 @@ void RENDER_3D_RAYTRACE_BASE::renderTracing( uint8_t* ptrPBO, REPORTER* aStatusR
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_SRGB_SPACE
|
||||
|
||||
/// @todo This should be removed in future when KiCad supports a greater version of glm lib.
|
||||
#define SRGB_GAMA 2.4f
|
||||
|
||||
|
||||
// This function implements the conversion from linear RGB to sRGB
|
||||
// https://github.com/g-truc/glm/blob/master/glm/gtc/color_space.inl#L12
|
||||
static SFVEC3F convertLinearToSRGB( const SFVEC3F& aRGBcolor )
|
||||
{
|
||||
const float gammaCorrection = 1.0f / SRGB_GAMA;
|
||||
const SFVEC3F clampedColor = glm::clamp( aRGBcolor, SFVEC3F( 0.0f ), SFVEC3F( 1.0f ) );
|
||||
|
||||
return glm::mix( glm::pow( clampedColor, SFVEC3F(gammaCorrection) ) * 1.055f - 0.055f,
|
||||
clampedColor * 12.92f,
|
||||
glm::lessThan( clampedColor, SFVEC3F(0.0031308f) ) );
|
||||
}
|
||||
|
||||
|
||||
static SFVEC4F convertLinearToSRGBA( const SFVEC4F& aRGBAcolor )
|
||||
{
|
||||
return SFVEC4F( convertLinearToSRGB( SFVEC3F( aRGBAcolor ) ), aRGBAcolor.a );
|
||||
}
|
||||
|
||||
|
||||
// This function implements the conversion from sRGB to linear RGB
|
||||
// https://github.com/g-truc/glm/blob/master/glm/gtc/color_space.inl#L35
|
||||
SFVEC3F ConvertSRGBToLinear( const SFVEC3F& aSRGBcolor )
|
||||
{
|
||||
const float gammaCorrection = SRGB_GAMA;
|
||||
|
||||
return glm::mix( glm::pow( ( aSRGBcolor + SFVEC3F( 0.055f ) )
|
||||
* SFVEC3F( 0.94786729857819905213270142180095f ),
|
||||
SFVEC3F( gammaCorrection ) ),
|
||||
aSRGBcolor * SFVEC3F( 0.07739938080495356037151702786378f ),
|
||||
glm::lessThanEqual( aSRGBcolor, SFVEC3F( 0.04045f ) ) );
|
||||
}
|
||||
|
||||
|
||||
SFVEC4F ConvertSRGBAToLinear( const SFVEC4F& aSRGBAcolor )
|
||||
{
|
||||
return SFVEC4F( ConvertSRGBToLinear( SFVEC3F( aSRGBAcolor ) ), aSRGBAcolor.a );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void RENDER_3D_RAYTRACE_BASE::renderFinalColor( uint8_t* ptrPBO, const SFVEC4F& rgbColor,
|
||||
bool applyColorSpaceConversion )
|
||||
{
|
||||
@@ -791,6 +804,10 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( uint8_t* ptrPBO )
|
||||
{
|
||||
m_isPreview = true;
|
||||
|
||||
m_backgroundColorTop = ConvertSRGBAToLinear( premultiplyAlpha( m_boardAdapter.m_BgColorTop ) );
|
||||
m_backgroundColorBottom =
|
||||
ConvertSRGBAToLinear( premultiplyAlpha( m_boardAdapter.m_BgColorBot ) );
|
||||
|
||||
std::atomic<size_t> nextBlock( 0 );
|
||||
std::atomic<size_t> threadsFinished( 0 );
|
||||
|
||||
@@ -827,8 +844,8 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( uint8_t* ptrPBO )
|
||||
// Calculate background gradient color
|
||||
SFVEC4F bgColor[RAYPACKET_DIM];
|
||||
|
||||
SFVEC4F bgTopColor = premultiplyAlpha( m_boardAdapter.m_BgColorTop );
|
||||
SFVEC4F bgBotColor = premultiplyAlpha( m_boardAdapter.m_BgColorBot );
|
||||
SFVEC4F bgTopColor = m_backgroundColorTop;
|
||||
SFVEC4F bgBotColor = m_backgroundColorBottom;
|
||||
|
||||
for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
|
||||
{
|
||||
@@ -1350,28 +1367,29 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( uint8_t* ptrPBO )
|
||||
&ptrPBO[( 4 * x + m_blockPositionsFast[iBlock].x
|
||||
+ m_realBufferSize.x
|
||||
* ( m_blockPositionsFast[iBlock].y + 4 * y ) ) * 4];
|
||||
SetPixel( ptr + 0, cLT );
|
||||
SetPixel( ptr + 4, BlendColor( cLT, cLRT, cLTC ) );
|
||||
SetPixel( ptr + 8, cLRT );
|
||||
SetPixel( ptr + 12, BlendColor( cLRT, cRT, cRTC ) );
|
||||
|
||||
SetPixelSRGBA( ptr + 0, cLT );
|
||||
SetPixelSRGBA( ptr + 4, BlendColor( cLT, cLRT, cLTC ) );
|
||||
SetPixelSRGBA( ptr + 8, cLRT );
|
||||
SetPixelSRGBA( ptr + 12, BlendColor( cLRT, cRT, cRTC ) );
|
||||
|
||||
ptr += m_realBufferSize.x * 4;
|
||||
SetPixel( ptr + 0, BlendColor( cLT , cLTB, cLTC ) );
|
||||
SetPixel( ptr + 4, BlendColor( cLTC, BlendColor( cLT , cC ) ) );
|
||||
SetPixel( ptr + 8, BlendColor( cC, BlendColor( cLRT, cLTC, cRTC ) ) );
|
||||
SetPixel( ptr + 12, BlendColor( cRTC, BlendColor( cRT , cC ) ) );
|
||||
SetPixelSRGBA( ptr + 0, BlendColor( cLT , cLTB, cLTC ) );
|
||||
SetPixelSRGBA( ptr + 4, BlendColor( cLTC, BlendColor( cLT , cC ) ) );
|
||||
SetPixelSRGBA( ptr + 8, BlendColor( cC, BlendColor( cLRT, cLTC, cRTC ) ) );
|
||||
SetPixelSRGBA( ptr + 12, BlendColor( cRTC, BlendColor( cRT , cC ) ) );
|
||||
|
||||
ptr += m_realBufferSize.x * 4;
|
||||
SetPixel( ptr + 0, cLTB );
|
||||
SetPixel( ptr + 4, BlendColor( cC, BlendColor( cLTB, cLTC, cLBC ) ) );
|
||||
SetPixel( ptr + 8, cC );
|
||||
SetPixel( ptr + 12, BlendColor( cC, BlendColor( cRTB, cRTC, cRBC ) ) );
|
||||
SetPixelSRGBA( ptr + 0, cLTB );
|
||||
SetPixelSRGBA( ptr + 4, BlendColor( cC, BlendColor( cLTB, cLTC, cLBC ) ) );
|
||||
SetPixelSRGBA( ptr + 8, cC );
|
||||
SetPixelSRGBA( ptr + 12, BlendColor( cC, BlendColor( cRTB, cRTC, cRBC ) ) );
|
||||
|
||||
ptr += m_realBufferSize.x * 4;
|
||||
SetPixel( ptr + 0, BlendColor( cLB , cLTB, cLBC ) );
|
||||
SetPixel( ptr + 4, BlendColor( cLBC, BlendColor( cLB , cC ) ) );
|
||||
SetPixel( ptr + 8, BlendColor( cC, BlendColor( cLRB, cLBC, cRBC ) ) );
|
||||
SetPixel( ptr + 12, BlendColor( cRBC, BlendColor( cRB , cC ) ) );
|
||||
SetPixelSRGBA( ptr + 0, BlendColor( cLB , cLTB, cLBC ) );
|
||||
SetPixelSRGBA( ptr + 4, BlendColor( cLBC, BlendColor( cLB , cC ) ) );
|
||||
SetPixelSRGBA( ptr + 8, BlendColor( cC, BlendColor( cLRB, cLBC, cRBC ) ) );
|
||||
SetPixelSRGBA( ptr + 12, BlendColor( cRBC, BlendColor( cRB , cC ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1425,9 +1443,6 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
|
||||
|
||||
light->GetLightParameters( hitPoint, vectorToLight, colorOfLight, distToLight );
|
||||
|
||||
if( m_isPreview )
|
||||
colorOfLight = SFVEC3F( 1.0f );
|
||||
|
||||
const float NdotL = glm::dot( aHitInfo.m_HitNormal, vectorToLight );
|
||||
|
||||
// Only calc shade if the normal is facing the direction of light,
|
||||
@@ -1496,10 +1511,6 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
|
||||
shadow_att_factor_light ),
|
||||
1.0 );
|
||||
}
|
||||
|
||||
// Only use the headlight for preview
|
||||
if( m_isPreview )
|
||||
break;
|
||||
}
|
||||
|
||||
// Improvement: this is not taking in account the lightcolor
|
||||
|
||||
@@ -65,7 +65,7 @@ void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
|
||||
KiBitmapBundle( BITMAPS::render_mode ),
|
||||
KiBitmapBundle( BITMAPS::ray_tracing ),
|
||||
_( "Render current view using Raytracing" ), wxITEM_CHECK );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
|
||||
@@ -634,12 +634,12 @@ void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( int aFlags )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::CommonSettingsChanged" ) );
|
||||
|
||||
// Regen menu bars, etc
|
||||
EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
EDA_BASE_FRAME::CommonSettingsChanged( aFlags );
|
||||
|
||||
// There is no base class that handles toolbars for this frame
|
||||
ReCreateMainToolbar();
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
* This would be private (and only called by the Kiway), but we need to do this manually
|
||||
* from the PCB frame because the 3D viewer isn't updated via the #KIWAY.
|
||||
*/
|
||||
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
||||
void CommonSettingsChanged( int aFlags ) override;
|
||||
void ShowChangedLanguage() override;
|
||||
|
||||
APPEARANCE_CONTROLS_3D* GetAppearanceManager() { return m_appearancePanel; }
|
||||
|
||||
@@ -90,7 +90,7 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
||||
m_bpvRight->SetBitmap( KiBitmapBundle( BITMAPS::axis3d_right ) );
|
||||
m_bpvBottom->SetBitmap( KiBitmapBundle( BITMAPS::axis3d_bottom ) );
|
||||
m_bpvISO->SetBitmap( KiBitmapBundle( BITMAPS::ortho ) );
|
||||
m_bpvBodyStyle->SetBitmap( KiBitmapBundle( BITMAPS::axis3d ) );
|
||||
m_bpvBodyStyle->SetBitmap( KiBitmapBundle( BITMAPS::show_board_body ) );
|
||||
m_bpUpdate->SetBitmap( KiBitmapBundle( BITMAPS::reload ) );
|
||||
m_bpSettings->SetBitmap( KiBitmapBundle( BITMAPS::options_3drender ) );
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
|
||||
bSizer3DButtons = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
bSizer3DButtons->Add( 0, 14, 0, wxEXPAND, 5 );
|
||||
|
||||
m_bpvISO = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
|
||||
m_bpvISO->SetToolTip( _("Enable/disable orthographic projection") );
|
||||
@@ -238,10 +238,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
|
||||
bSizer3DButtons->Add( m_bpUpdate, 0, wxTOP, 5 );
|
||||
|
||||
m_bpSettings = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bSizer3DButtons->Add( m_bpSettings, 0, wxTOP, 5 );
|
||||
|
||||
|
||||
bSizer3DButtons->Add( 0, 10, 1, wxEXPAND, 5 );
|
||||
bSizer3DButtons->Add( m_bpSettings, 0, wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
bSizermain->Add( bSizer3DButtons, 0, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
@@ -2075,9 +2075,9 @@
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="height">14</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
@@ -2779,7 +2779,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -2852,16 +2852,6 @@
|
||||
<event name="OnButtonClick">View3DSettings</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">10</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
+8
-13
@@ -165,15 +165,9 @@ cmake_dependent_option( KICAD_APPLE_MAKE_RELOCATEABLE_BUNDLE
|
||||
"On macOS, post-process the build to make it relocateable (default ON)"
|
||||
ON "APPLE" OFF )
|
||||
|
||||
# CMake's FindProtobuf module doesn't work correctly on MacOS or Windows but is
|
||||
# required for Linux
|
||||
if( UNIX_NOT_APPLE )
|
||||
set( KICAD_CMAKE_PROTOBUF_DEFAULT ON )
|
||||
else()
|
||||
set( KICAD_CMAKE_PROTOBUF_DEFAULT OFF )
|
||||
endif()
|
||||
|
||||
option( KICAD_USE_CMAKE_FINDPROTOBUF "Use FindProtobuf provided by CMake" ${KICAD_CMAKE_PROTOBUF_DEFAULT} )
|
||||
# Old versions of CMake and/or protobuf can require the FindProtobuf.cmake,
|
||||
# but modern platforms require this to be off
|
||||
option( KICAD_USE_CMAKE_FINDPROTOBUF "Use FindProtobuf provided by CMake" OFF )
|
||||
mark_as_advanced( KICAD_USE_CMAKE_FINDPROTOBUF )
|
||||
|
||||
####################################
|
||||
@@ -532,10 +526,6 @@ if( MSVC )
|
||||
add_compile_definitions( NOMINMAX )
|
||||
# source and execution charset are UTF-8
|
||||
string( APPEND CMAKE_CXX_FLAGS " /utf-8" )
|
||||
# C4290: throw() is interpreted as declspec(nothrow)
|
||||
string( APPEND CMAKE_CXX_FLAGS " /wd4290" )
|
||||
# C4800: non-bool is explicitly cast to bool, forcing value of 0 or 1
|
||||
string( APPEND CMAKE_CXX_FLAGS " /wd4800" )
|
||||
|
||||
# cmake 3.25 or higher requried for MSVC, should be fine
|
||||
if( USE_CCACHE AND CCACHE_FOUND )
|
||||
@@ -550,6 +540,8 @@ if( MSVC )
|
||||
|
||||
# /Zc:__cplusplus: define this macro according to C++ standard version
|
||||
string( APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus" )
|
||||
# /Zc:inline: enforces C++11 requirement that inline functions must have a definition in the same unit
|
||||
string( APPEND CMAKE_CXX_FLAGS " /Zc:inline" )
|
||||
# /GF: enable string pooling
|
||||
string( APPEND CMAKE_CXX_FLAGS_RELEASE " /GF" )
|
||||
string( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /GF" )
|
||||
@@ -607,6 +599,9 @@ if( MSVC )
|
||||
if( KICAD_WIN32_BUILD_PARALLEL_CL_MP )
|
||||
string( APPEND CMAKE_CXX_FLAGS " /MP" )
|
||||
endif()
|
||||
|
||||
set( CMAKE_INSTALL_UCRT_LIBRARIES TRUE )
|
||||
include( InstallRequiredSystemLibraries )
|
||||
endif()
|
||||
|
||||
# KIFACE_SUFFIX is the file extension used for top level program modules which
|
||||
|
||||
@@ -326,6 +326,47 @@ message GetBoundingBoxResponse
|
||||
repeated kiapi.common.types.Box2 boxes = 2;
|
||||
}
|
||||
|
||||
// Retrieves a list of items. Returns SelectionResponse
|
||||
message GetSelection
|
||||
{
|
||||
// Specifies which document to query for selected items.
|
||||
kiapi.common.types.ItemHeader header = 1;
|
||||
|
||||
// An optional list of types to filter on.
|
||||
// If none are provided, all selected items will be returned.
|
||||
repeated kiapi.common.types.KiCadObjectType types = 2;
|
||||
}
|
||||
|
||||
// The set of currently selected items
|
||||
message SelectionResponse
|
||||
{
|
||||
repeated google.protobuf.Any items = 1;
|
||||
}
|
||||
|
||||
// Adds the given items to the selection. Returns SelectionResponse
|
||||
message AddToSelection
|
||||
{
|
||||
kiapi.common.types.ItemHeader header = 1;
|
||||
|
||||
// The items to select
|
||||
repeated kiapi.common.types.KIID items = 2;
|
||||
}
|
||||
|
||||
// Removes the given items to the selection. Returns SelectionResponse
|
||||
message RemoveFromSelection
|
||||
{
|
||||
kiapi.common.types.ItemHeader header = 1;
|
||||
|
||||
// The items to deselect
|
||||
repeated kiapi.common.types.KIID items = 2;
|
||||
}
|
||||
|
||||
// Removes all items from selection
|
||||
message ClearSelection
|
||||
{
|
||||
kiapi.common.types.ItemHeader header = 1;
|
||||
}
|
||||
|
||||
// Tests if a certain point falls within tolerance of an item's geometry
|
||||
message HitTest
|
||||
{
|
||||
|
||||
@@ -30,14 +30,13 @@
|
||||
#include <bitmaps.h>
|
||||
#include <common.h>
|
||||
#include <id.h>
|
||||
#include <kiface_base.h>
|
||||
#include <pgm_base.h>
|
||||
#include <widgets/wx_menubar.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <file_history.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tool_dispatcher.h>
|
||||
#include <tool/common_control.h>
|
||||
#include <tool/action_manager.h>
|
||||
#include <bitmap2cmp_control.h>
|
||||
#include <tool/actions.h>
|
||||
|
||||
@@ -333,8 +332,8 @@ void BITMAP2CMP_FRAME::ShowChangedLanguage()
|
||||
mainSizer->Add( m_panel, 1, wxEXPAND, 5 );
|
||||
Layout();
|
||||
|
||||
if( !m_bitmapFileName.IsEmpty() )
|
||||
OpenProjectFiles( std::vector<wxString>( 1, m_bitmapFileName ) );
|
||||
if( !m_srcFileName.IsEmpty() )
|
||||
OpenProjectFiles( std::vector<wxString>( 1, m_srcFileName ) );
|
||||
|
||||
LoadSettings( config() );
|
||||
m_panel->SetOutputSize( imageSizeX, imageSizeY );
|
||||
@@ -348,9 +347,9 @@ void BITMAP2CMP_FRAME::UpdateTitle()
|
||||
{
|
||||
wxString title;
|
||||
|
||||
if( !m_bitmapFileName.IsEmpty() )
|
||||
if( !m_srcFileName.IsEmpty() )
|
||||
{
|
||||
wxFileName filename( m_bitmapFileName );
|
||||
wxFileName filename( m_srcFileName );
|
||||
title = filename.GetFullName() + wxT( " \u2014 " );
|
||||
}
|
||||
|
||||
@@ -364,12 +363,10 @@ void BITMAP2CMP_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||
{
|
||||
EDA_BASE_FRAME::LoadSettings( aCfg );
|
||||
|
||||
BITMAP2CMP_SETTINGS* cfg = dynamic_cast<BITMAP2CMP_SETTINGS*>( aCfg );
|
||||
|
||||
if( cfg )
|
||||
if( BITMAP2CMP_SETTINGS* cfg = dynamic_cast<BITMAP2CMP_SETTINGS*>( aCfg ) )
|
||||
{
|
||||
m_bitmapFileName = cfg->m_BitmapFileName;
|
||||
m_convertedFileName = cfg->m_ConvertedFileName;
|
||||
m_srcFileName = cfg->m_BitmapFileName;
|
||||
m_outFileName = cfg->m_ConvertedFileName;
|
||||
m_panel->LoadSettings( cfg );
|
||||
}
|
||||
}
|
||||
@@ -379,12 +376,10 @@ void BITMAP2CMP_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||
{
|
||||
EDA_BASE_FRAME::SaveSettings( aCfg );
|
||||
|
||||
BITMAP2CMP_SETTINGS* cfg = dynamic_cast<BITMAP2CMP_SETTINGS*>( aCfg );
|
||||
|
||||
if( cfg )
|
||||
if( BITMAP2CMP_SETTINGS* cfg = dynamic_cast<BITMAP2CMP_SETTINGS*>( aCfg ) )
|
||||
{
|
||||
cfg->m_BitmapFileName = m_bitmapFileName;
|
||||
cfg->m_ConvertedFileName = m_convertedFileName;
|
||||
cfg->m_BitmapFileName = m_srcFileName;
|
||||
cfg->m_ConvertedFileName = m_outFileName;
|
||||
m_panel->SaveSettings( cfg );
|
||||
}
|
||||
}
|
||||
@@ -392,7 +387,7 @@ void BITMAP2CMP_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||
|
||||
void BITMAP2CMP_FRAME::OnLoadFile()
|
||||
{
|
||||
wxFileName fn( m_bitmapFileName );
|
||||
wxFileName fn( m_srcFileName );
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists( path ) )
|
||||
@@ -402,9 +397,7 @@ void BITMAP2CMP_FRAME::OnLoadFile()
|
||||
_( "Image Files" ) + wxS( " " )+ wxImage::GetImageExtWildcard(),
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
int diag = fileDlg.ShowModal();
|
||||
|
||||
if( diag != wxID_OK )
|
||||
if( fileDlg.ShowModal() != wxID_OK )
|
||||
return;
|
||||
|
||||
wxString fullFilename = fileDlg.GetPath();
|
||||
@@ -422,11 +415,11 @@ void BITMAP2CMP_FRAME::OnLoadFile()
|
||||
|
||||
bool BITMAP2CMP_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
|
||||
{
|
||||
m_bitmapFileName = aFileSet[0];
|
||||
m_srcFileName = aFileSet[0];
|
||||
|
||||
if( m_panel->OpenProjectFiles( aFileSet, aCtl ) )
|
||||
{
|
||||
UpdateFileHistory( m_bitmapFileName );
|
||||
UpdateFileHistory( m_srcFileName );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -436,7 +429,7 @@ bool BITMAP2CMP_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet,
|
||||
|
||||
void BITMAP2CMP_FRAME::ExportDrawingSheetFormat()
|
||||
{
|
||||
wxFileName fn( m_convertedFileName );
|
||||
wxFileName fn( m_outFileName );
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
@@ -444,28 +437,24 @@ void BITMAP2CMP_FRAME::ExportDrawingSheetFormat()
|
||||
|
||||
wxFileDialog fileDlg( this, _( "Create Drawing Sheet File" ), path, wxEmptyString,
|
||||
FILEEXT::DrawingSheetFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
int diag = fileDlg.ShowModal();
|
||||
|
||||
if( diag != wxID_OK )
|
||||
if( fileDlg.ShowModal() != wxID_OK )
|
||||
return;
|
||||
|
||||
fn = fileDlg.GetPath();
|
||||
fn.SetExt( FILEEXT::DrawingSheetFileExtension );
|
||||
m_convertedFileName = fn.GetFullPath();
|
||||
m_outFileName = fn.GetFullPath();
|
||||
|
||||
FILE* outfile;
|
||||
outfile = wxFopen( m_convertedFileName, wxT( "w" ) );
|
||||
FILE* outfile = wxFopen( m_outFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == nullptr )
|
||||
if( !outfile )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File '%s' could not be created." ), m_convertedFileName );
|
||||
wxMessageBox( msg );
|
||||
wxMessageBox( wxString::Format( _( "File '%s' could not be created." ), m_outFileName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
std::string buffer;
|
||||
m_panel->ExportToBuffer( buffer, KICAD_WKS_LOGO );
|
||||
m_panel->ExportToBuffer( buffer, DRAWING_SHEET_FMT );
|
||||
fputs( buffer.c_str(), outfile );
|
||||
fclose( outfile );
|
||||
}
|
||||
@@ -473,7 +462,7 @@ void BITMAP2CMP_FRAME::ExportDrawingSheetFormat()
|
||||
|
||||
void BITMAP2CMP_FRAME::ExportPostScriptFormat()
|
||||
{
|
||||
wxFileName fn( m_convertedFileName );
|
||||
wxFileName fn( m_outFileName );
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists( path ) )
|
||||
@@ -487,16 +476,13 @@ void BITMAP2CMP_FRAME::ExportPostScriptFormat()
|
||||
|
||||
fn = fileDlg.GetPath();
|
||||
fn.SetExt( wxT( "ps" ) );
|
||||
m_convertedFileName = fn.GetFullPath();
|
||||
m_outFileName = fn.GetFullPath();
|
||||
|
||||
FILE* outfile;
|
||||
outfile = wxFopen( m_convertedFileName, wxT( "w" ) );
|
||||
FILE* outfile = wxFopen( m_outFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == nullptr )
|
||||
if( !outfile )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File '%s' could not be created." ), m_convertedFileName );
|
||||
wxMessageBox( msg );
|
||||
wxMessageBox( wxString::Format( _( "File '%s' could not be created." ), m_outFileName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -509,10 +495,10 @@ void BITMAP2CMP_FRAME::ExportPostScriptFormat()
|
||||
|
||||
void BITMAP2CMP_FRAME::ExportEeschemaFormat()
|
||||
{
|
||||
wxFileName fn( m_convertedFileName );
|
||||
wxFileName fn( m_outFileName );
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
if( path.IsEmpty() || !wxDirExists( path ) )
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxFileDialog fileDlg( this, _( "Create Symbol Library" ), path, wxEmptyString,
|
||||
@@ -523,20 +509,18 @@ void BITMAP2CMP_FRAME::ExportEeschemaFormat()
|
||||
return;
|
||||
|
||||
fn = EnsureFileExtension( fileDlg.GetPath(), FILEEXT::KiCadSymbolLibFileExtension );
|
||||
m_convertedFileName = fn.GetFullPath();
|
||||
m_outFileName = fn.GetFullPath();
|
||||
|
||||
FILE* outfile = wxFopen( m_convertedFileName, wxT( "w" ) );
|
||||
FILE* outfile = wxFopen( m_outFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == nullptr )
|
||||
if( !outfile )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File '%s' could not be created." ), m_convertedFileName );
|
||||
wxMessageBox( msg );
|
||||
wxMessageBox( wxString::Format( _( "File '%s' could not be created." ), m_outFileName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
std::string buffer;
|
||||
m_panel->ExportToBuffer( buffer, EESCHEMA_FMT );
|
||||
m_panel->ExportToBuffer( buffer, SYMBOL_FMT );
|
||||
fputs( buffer.c_str(), outfile );
|
||||
fclose( outfile );
|
||||
}
|
||||
@@ -544,7 +528,7 @@ void BITMAP2CMP_FRAME::ExportEeschemaFormat()
|
||||
|
||||
void BITMAP2CMP_FRAME::ExportPcbnewFormat()
|
||||
{
|
||||
wxFileName fn( m_convertedFileName );
|
||||
wxFileName fn( m_outFileName );
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists( path ) )
|
||||
@@ -558,20 +542,18 @@ void BITMAP2CMP_FRAME::ExportPcbnewFormat()
|
||||
return;
|
||||
|
||||
fn = EnsureFileExtension( fileDlg.GetPath(), FILEEXT::KiCadFootprintFileExtension );
|
||||
m_convertedFileName = fn.GetFullPath();
|
||||
m_outFileName = fn.GetFullPath();
|
||||
|
||||
FILE* outfile = wxFopen( m_convertedFileName, wxT( "w" ) );
|
||||
FILE* outfile = wxFopen( m_outFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == nullptr )
|
||||
if( !outfile )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File '%s' could not be created." ), m_convertedFileName );
|
||||
wxMessageBox( msg );
|
||||
wxMessageBox( wxString::Format( _( "File '%s' could not be created." ), m_outFileName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
std::string buffer;
|
||||
m_panel->ExportToBuffer( buffer, PCBNEW_KICAD_MOD );
|
||||
m_panel->ExportToBuffer( buffer, FOOTPRINT_FMT );
|
||||
fputs( buffer.c_str(), outfile );
|
||||
fclose( outfile );
|
||||
m_mruPath = fn.GetPath();
|
||||
|
||||
@@ -88,8 +88,8 @@ private:
|
||||
BITMAP2CMP_PANEL* m_panel;
|
||||
wxStatusBar* m_statusBar;
|
||||
|
||||
wxString m_bitmapFileName;
|
||||
wxString m_convertedFileName;
|
||||
wxString m_srcFileName;
|
||||
wxString m_outFileName;
|
||||
};
|
||||
|
||||
#endif// BITMOP2CMP_GUI_H_
|
||||
|
||||
@@ -27,11 +27,8 @@
|
||||
#include <bitmap2cmp_panel.h>
|
||||
#include <bitmap2cmp_settings.h>
|
||||
#include <bitmap_io.h>
|
||||
#include <bitmaps.h>
|
||||
#include <common.h>
|
||||
#include <kiface_base.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <pgm_base.h>
|
||||
#include <potracelib.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/rawbmp.h>
|
||||
@@ -44,10 +41,11 @@
|
||||
|
||||
BITMAP2CMP_PANEL::BITMAP2CMP_PANEL( BITMAP2CMP_FRAME* aParent ) :
|
||||
BITMAP2CMP_PANEL_BASE( aParent ),
|
||||
m_parentFrame( aParent ), m_negative( false ),
|
||||
m_parentFrame( aParent ),
|
||||
m_negative( false ),
|
||||
m_aspectRatio( 1.0 )
|
||||
{
|
||||
for( wxString unit : { _( "mm" ), _( "Inch" ), _( "DPI" ) } )
|
||||
for( const wxString& unit : { _( "mm" ), _( "Inch" ), _( "DPI" ) } )
|
||||
m_PixelUnit->Append( unit );
|
||||
|
||||
m_outputSizeX.SetUnit( getUnitFromSelection() );
|
||||
@@ -55,19 +53,14 @@ BITMAP2CMP_PANEL::BITMAP2CMP_PANEL( BITMAP2CMP_FRAME* aParent ) :
|
||||
m_outputSizeX.SetOutputSize( 0, getUnitFromSelection() );
|
||||
m_outputSizeY.SetOutputSize( 0, getUnitFromSelection() );
|
||||
|
||||
m_UnitSizeX->ChangeValue( FormatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( FormatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
m_UnitSizeX->ChangeValue( formatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( formatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
|
||||
m_buttonExportFile->Enable( false );
|
||||
m_buttonExportClipboard->Enable( false );
|
||||
}
|
||||
|
||||
|
||||
BITMAP2CMP_PANEL::~BITMAP2CMP_PANEL()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxWindow* BITMAP2CMP_PANEL::GetCurrentPage()
|
||||
{
|
||||
return m_Notebook->GetCurrentPage();
|
||||
@@ -76,12 +69,8 @@ wxWindow* BITMAP2CMP_PANEL::GetCurrentPage()
|
||||
|
||||
void BITMAP2CMP_PANEL::LoadSettings( BITMAP2CMP_SETTINGS* cfg )
|
||||
{
|
||||
int u_select = cfg->m_Units;
|
||||
|
||||
if( u_select < 0 || u_select > 2 ) // Validity control
|
||||
u_select = 0;
|
||||
|
||||
m_PixelUnit->SetSelection( u_select );
|
||||
if( cfg->m_Units >= 0 && cfg->m_Units < (int) m_PixelUnit->GetCount() )
|
||||
m_PixelUnit->SetSelection( cfg->m_Units );
|
||||
|
||||
m_sliderThreshold->SetValue( cfg->m_Threshold );
|
||||
|
||||
@@ -91,32 +80,31 @@ void BITMAP2CMP_PANEL::LoadSettings( BITMAP2CMP_SETTINGS* cfg )
|
||||
m_aspectRatio = 1.0;
|
||||
m_aspectRatioCheckbox->SetValue( true );
|
||||
|
||||
int format = cfg->m_LastFormat;
|
||||
switch( cfg->m_LastFormat )
|
||||
{
|
||||
default:
|
||||
case FOOTPRINT_FMT: m_rbFootprint->SetValue( true ); break;
|
||||
case SYMBOL_FMT:
|
||||
case SYMBOL_PASTE_FMT: m_rbSymbol->SetValue( true ); break;
|
||||
case POSTSCRIPT_FMT: m_rbPostscript->SetValue( true ); break;
|
||||
case DRAWING_SHEET_FMT: m_rbWorksheet->SetValue( true ); break;
|
||||
}
|
||||
|
||||
if( format < 0 || format > FINAL_FMT )
|
||||
format = PCBNEW_KICAD_MOD;
|
||||
m_layerLabel->Enable( cfg->m_LastFormat == FOOTPRINT_FMT );
|
||||
m_layerCtrl->Enable( cfg->m_LastFormat == FOOTPRINT_FMT );
|
||||
|
||||
m_rbOutputFormat->SetSelection( format );
|
||||
|
||||
bool enable = format == PCBNEW_KICAD_MOD;
|
||||
m_chPCBLayer->Enable( enable );
|
||||
|
||||
int last_layer = cfg->m_LastModLayer;
|
||||
|
||||
if( last_layer < 0 || last_layer > static_cast<int>( MOD_LYR_FINAL ) ) // Out of range
|
||||
last_layer = MOD_LYR_FSILKS;
|
||||
|
||||
m_chPCBLayer->SetSelection( last_layer );
|
||||
if( cfg->m_LastLayer >= 0 && cfg->m_LastLayer < (int) m_layerCtrl->GetCount() )
|
||||
m_layerCtrl->SetSelection( cfg->m_LastLayer );
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::SaveSettings( BITMAP2CMP_SETTINGS* cfg )
|
||||
{
|
||||
cfg->m_Threshold = m_sliderThreshold->GetValue();
|
||||
cfg->m_Negative = m_checkNegative->IsChecked();
|
||||
cfg->m_LastFormat = m_rbOutputFormat->GetSelection();
|
||||
cfg->m_LastModLayer = m_chPCBLayer->GetSelection();
|
||||
cfg->m_Units = m_PixelUnit->GetSelection();
|
||||
cfg->m_Threshold = m_sliderThreshold->GetValue();
|
||||
cfg->m_Negative = m_checkNegative->IsChecked();
|
||||
cfg->m_LastFormat = getOutputFormat();
|
||||
cfg->m_LastLayer = m_layerCtrl->GetSelection();
|
||||
cfg->m_Units = m_PixelUnit->GetSelection();
|
||||
}
|
||||
|
||||
|
||||
@@ -244,9 +232,9 @@ bool BITMAP2CMP_PANEL::OpenProjectFiles( const std::vector<wxString>& aFileSet,
|
||||
{
|
||||
for( int y = 0; y < m_Pict_Bitmap.GetHeight(); y++ )
|
||||
{
|
||||
if( m_Pict_Image.GetRed( x, y ) == m_Pict_Image.GetMaskRed() &&
|
||||
m_Pict_Image.GetGreen( x, y ) == m_Pict_Image.GetMaskGreen() &&
|
||||
m_Pict_Image.GetBlue( x, y ) == m_Pict_Image.GetMaskBlue() )
|
||||
if( m_Pict_Image.GetRed( x, y ) == m_Pict_Image.GetMaskRed()
|
||||
&& m_Pict_Image.GetGreen( x, y ) == m_Pict_Image.GetMaskGreen()
|
||||
&& m_Pict_Image.GetBlue( x, y ) == m_Pict_Image.GetMaskBlue() )
|
||||
{
|
||||
m_Greyscale_Image.SetRGB( x, y, 255, 255, 255 );
|
||||
}
|
||||
@@ -255,26 +243,26 @@ bool BITMAP2CMP_PANEL::OpenProjectFiles( const std::vector<wxString>& aFileSet,
|
||||
}
|
||||
|
||||
if( m_negative )
|
||||
NegateGreyscaleImage( );
|
||||
negateGreyscaleImage();
|
||||
|
||||
m_Greyscale_Bitmap = wxBitmap( m_Greyscale_Image );
|
||||
m_NB_Image = m_Greyscale_Image;
|
||||
Binarize( (double) m_sliderThreshold->GetValue() / m_sliderThreshold->GetMax() );
|
||||
binarize( (double)m_sliderThreshold->GetValue() / m_sliderThreshold->GetMax() );
|
||||
|
||||
m_buttonExportFile->Enable( true );
|
||||
m_buttonExportClipboard->Enable( true );
|
||||
|
||||
m_outputSizeX.SetOutputSizeFromInitialImageSize();
|
||||
m_UnitSizeX->ChangeValue( FormatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeX->ChangeValue( formatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_outputSizeY.SetOutputSizeFromInitialImageSize();
|
||||
m_UnitSizeY->ChangeValue( FormatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( formatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// return a string giving the output size, according to the selected unit
|
||||
wxString BITMAP2CMP_PANEL::FormatOutputSize( double aSize )
|
||||
wxString BITMAP2CMP_PANEL::formatOutputSize( double aSize )
|
||||
{
|
||||
wxString text;
|
||||
|
||||
@@ -295,13 +283,9 @@ void BITMAP2CMP_PANEL::updateImageInfo()
|
||||
|
||||
if( m_Pict_Bitmap.IsOk() )
|
||||
{
|
||||
int h = m_Pict_Bitmap.GetHeight();
|
||||
int w = m_Pict_Bitmap.GetWidth();
|
||||
int nb = m_Pict_Bitmap.GetDepth();
|
||||
|
||||
m_SizeXValue->SetLabel( wxString::Format( wxT( "%d" ), w ) );
|
||||
m_SizeYValue->SetLabel( wxString::Format( wxT( "%d" ), h ) );
|
||||
m_BPPValue->SetLabel( wxString::Format( wxT( "%d" ), nb ) );
|
||||
m_SizeXValue->SetLabel( wxString::Format( wxT( "%d" ), m_Pict_Bitmap.GetWidth() ) );
|
||||
m_SizeYValue->SetLabel( wxString::Format( wxT( "%d" ), m_Pict_Bitmap.GetHeight() ) );
|
||||
m_BPPValue->SetLabel( wxString::Format( wxT( "%d" ), m_Pict_Bitmap.GetDepth() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,7 +322,7 @@ void BITMAP2CMP_PANEL::OnSizeChangeX( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
m_outputSizeY.SetOutputSize( calculatedY, getUnitFromSelection() );
|
||||
m_UnitSizeY->ChangeValue( FormatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( formatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
}
|
||||
|
||||
m_outputSizeX.SetOutputSize( new_size, getUnitFromSelection() );
|
||||
@@ -367,7 +351,7 @@ void BITMAP2CMP_PANEL::OnSizeChangeY( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
m_outputSizeX.SetOutputSize( calculatedX, getUnitFromSelection() );
|
||||
m_UnitSizeX->ChangeValue( FormatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeX->ChangeValue( formatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
}
|
||||
|
||||
m_outputSizeY.SetOutputSize( new_size, getUnitFromSelection() );
|
||||
@@ -383,8 +367,8 @@ void BITMAP2CMP_PANEL::OnSizeUnitChange( wxCommandEvent& event )
|
||||
m_outputSizeY.SetUnit( getUnitFromSelection() );
|
||||
updateImageInfo();
|
||||
|
||||
m_UnitSizeX->ChangeValue( FormatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( FormatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
m_UnitSizeX->ChangeValue( formatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( formatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -394,8 +378,8 @@ void BITMAP2CMP_PANEL::SetOutputSize( const IMAGE_SIZE& aSizeX, const IMAGE_SIZE
|
||||
m_outputSizeY = aSizeY;
|
||||
updateImageInfo();
|
||||
|
||||
m_UnitSizeX->ChangeValue( FormatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( FormatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
m_UnitSizeX->ChangeValue( formatOutputSize( m_outputSizeX.GetOutputSize() ) );
|
||||
m_UnitSizeY->ChangeValue( formatOutputSize( m_outputSizeY.GetOutputSize() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -410,28 +394,25 @@ void BITMAP2CMP_PANEL::ToggleAspectRatioLock( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::Binarize( double aThreshold )
|
||||
void BITMAP2CMP_PANEL::binarize( double aThreshold )
|
||||
{
|
||||
int h = m_Greyscale_Image.GetHeight();
|
||||
int w = m_Greyscale_Image.GetWidth();
|
||||
unsigned char threshold = aThreshold * 255;
|
||||
unsigned char alpha_thresh = 0.7 * threshold;
|
||||
|
||||
for( int y = 0; y < h; y++ )
|
||||
for( int y = 0; y < m_Greyscale_Image.GetHeight(); y++ )
|
||||
{
|
||||
for( int x = 0; x < w; x++ )
|
||||
for( int x = 0; x < m_Greyscale_Image.GetWidth(); x++ )
|
||||
{
|
||||
unsigned char pixout;
|
||||
unsigned char pixin = m_Greyscale_Image.GetGreen( x, y );
|
||||
unsigned char pixel = m_Greyscale_Image.GetGreen( x, y );
|
||||
unsigned char alpha = m_Greyscale_Image.HasAlpha() ? m_Greyscale_Image.GetAlpha( x, y )
|
||||
: wxALPHA_OPAQUE;
|
||||
|
||||
if( pixin < threshold && alpha > alpha_thresh )
|
||||
pixout = 0;
|
||||
if( pixel < threshold && alpha > alpha_thresh )
|
||||
pixel = 0;
|
||||
else
|
||||
pixout = 255;
|
||||
pixel = 255;
|
||||
|
||||
m_NB_Image.SetRGB( x, y, pixout, pixout, pixout );
|
||||
m_NB_Image.SetRGB( x, y, pixel, pixel, pixel );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,19 +420,15 @@ void BITMAP2CMP_PANEL::Binarize( double aThreshold )
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::NegateGreyscaleImage( )
|
||||
void BITMAP2CMP_PANEL::negateGreyscaleImage( )
|
||||
{
|
||||
unsigned char pix;
|
||||
int h = m_Greyscale_Image.GetHeight();
|
||||
int w = m_Greyscale_Image.GetWidth();
|
||||
|
||||
for( int y = 0; y < h; y++ )
|
||||
for( int y = 0; y < m_Greyscale_Image.GetHeight(); y++ )
|
||||
{
|
||||
for( int x = 0; x < w; x++ )
|
||||
for( int x = 0; x < m_Greyscale_Image.GetWidth(); x++ )
|
||||
{
|
||||
pix = m_Greyscale_Image.GetGreen( x, y );
|
||||
pix = ~pix;
|
||||
m_Greyscale_Image.SetRGB( x, y, pix, pix, pix );
|
||||
unsigned char pixel = m_Greyscale_Image.GetGreen( x, y );
|
||||
pixel = ~pixel;
|
||||
m_Greyscale_Image.SetRGB( x, y, pixel, pixel, pixel );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -461,10 +438,10 @@ void BITMAP2CMP_PANEL::OnNegativeClicked( wxCommandEvent& )
|
||||
{
|
||||
if( m_checkNegative->GetValue() != m_negative )
|
||||
{
|
||||
NegateGreyscaleImage();
|
||||
negateGreyscaleImage();
|
||||
|
||||
m_Greyscale_Bitmap = wxBitmap( m_Greyscale_Image );
|
||||
Binarize( (double)m_sliderThreshold->GetValue()/m_sliderThreshold->GetMax() );
|
||||
binarize( (double)m_sliderThreshold->GetValue() / m_sliderThreshold->GetMax() );
|
||||
m_negative = m_checkNegative->GetValue();
|
||||
|
||||
Refresh();
|
||||
@@ -474,27 +451,41 @@ void BITMAP2CMP_PANEL::OnNegativeClicked( wxCommandEvent& )
|
||||
|
||||
void BITMAP2CMP_PANEL::OnThresholdChange( wxScrollEvent& event )
|
||||
{
|
||||
Binarize( (double)m_sliderThreshold->GetValue()/m_sliderThreshold->GetMax() );
|
||||
binarize( (double)m_sliderThreshold->GetValue() / m_sliderThreshold->GetMax() );
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::OnExportToFile( wxCommandEvent& event )
|
||||
{
|
||||
// choices of m_rbOutputFormat are expected to be in same order as
|
||||
// OUTPUT_FMT_ID. See bitmap2component.h
|
||||
OUTPUT_FMT_ID format = (OUTPUT_FMT_ID) m_rbOutputFormat->GetSelection();
|
||||
exportBitmap( format );
|
||||
switch( getOutputFormat() )
|
||||
{
|
||||
case SYMBOL_FMT:
|
||||
case SYMBOL_PASTE_FMT: m_parentFrame->ExportEeschemaFormat(); break;
|
||||
case FOOTPRINT_FMT: m_parentFrame->ExportPcbnewFormat(); break;
|
||||
case POSTSCRIPT_FMT: m_parentFrame->ExportPostScriptFormat(); break;
|
||||
case DRAWING_SHEET_FMT: m_parentFrame->ExportDrawingSheetFormat(); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OUTPUT_FMT_ID BITMAP2CMP_PANEL::getOutputFormat()
|
||||
{
|
||||
if( m_rbSymbol->GetValue() )
|
||||
return SYMBOL_FMT;
|
||||
else if( m_rbPostscript->GetValue() )
|
||||
return POSTSCRIPT_FMT;
|
||||
else if( m_rbWorksheet->GetValue() )
|
||||
return DRAWING_SHEET_FMT;
|
||||
else
|
||||
return FOOTPRINT_FMT;
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::OnExportToClipboard( wxCommandEvent& event )
|
||||
{
|
||||
// choices of m_rbOutputFormat are expected to be in same order as
|
||||
// OUTPUT_FMT_ID. See bitmap2component.h
|
||||
OUTPUT_FMT_ID format = (OUTPUT_FMT_ID) m_rbOutputFormat->GetSelection();
|
||||
|
||||
std::string buffer;
|
||||
OUTPUT_FMT_ID format = getOutputFormat() == SYMBOL_FMT ? SYMBOL_PASTE_FMT : getOutputFormat();
|
||||
ExportToBuffer( buffer, format );
|
||||
|
||||
wxLogNull doNotLog; // disable logging of failed clipboard actions
|
||||
@@ -515,61 +506,59 @@ void BITMAP2CMP_PANEL::OnExportToClipboard( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::exportBitmap( OUTPUT_FMT_ID aFormat )
|
||||
{
|
||||
switch( aFormat )
|
||||
{
|
||||
case EESCHEMA_FMT: m_parentFrame->ExportEeschemaFormat(); break;
|
||||
case PCBNEW_KICAD_MOD: m_parentFrame->ExportPcbnewFormat(); break;
|
||||
case POSTSCRIPT_FMT: m_parentFrame->ExportPostScriptFormat(); break;
|
||||
case KICAD_WKS_LOGO: m_parentFrame->ExportDrawingSheetFormat(); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::ExportToBuffer( std::string& aOutput, OUTPUT_FMT_ID aFormat )
|
||||
{
|
||||
// Create a potrace bitmap
|
||||
int h = m_NB_Image.GetHeight();
|
||||
int w = m_NB_Image.GetWidth();
|
||||
potrace_bitmap_t* potrace_bitmap = bm_new( w, h );
|
||||
potrace_bitmap_t* potrace_bitmap = bm_new( m_NB_Image.GetWidth(), m_NB_Image.GetHeight() );
|
||||
|
||||
if( !potrace_bitmap )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Error allocating memory for potrace bitmap" ) );
|
||||
wxMessageBox( msg );
|
||||
wxMessageBox( _( "Error allocating memory for potrace bitmap" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
/* fill the bitmap with data */
|
||||
for( int y = 0; y < h; y++ )
|
||||
for( int y = 0; y < m_NB_Image.GetHeight(); y++ )
|
||||
{
|
||||
for( int x = 0; x < w; x++ )
|
||||
for( int x = 0; x < m_NB_Image.GetWidth(); x++ )
|
||||
{
|
||||
unsigned char pix = m_NB_Image.GetGreen( x, y );
|
||||
BM_PUT( potrace_bitmap, x, y, pix ? 0 : 1 );
|
||||
unsigned char pixel = m_NB_Image.GetGreen( x, y );
|
||||
BM_PUT( potrace_bitmap, x, y, pixel ? 0 : 1 );
|
||||
}
|
||||
}
|
||||
|
||||
// choices of m_rbPCBLayer are expected to be in same order as
|
||||
// BMP2CMP_MOD_LAYER. See bitmap2component.h
|
||||
BMP2CMP_MOD_LAYER modLayer = MOD_LYR_FSILKS;
|
||||
wxString layer = wxT( "F.SilkS" );
|
||||
|
||||
if( aFormat == PCBNEW_KICAD_MOD )
|
||||
modLayer = (BMP2CMP_MOD_LAYER) m_chPCBLayer->GetSelection();
|
||||
if( aFormat == FOOTPRINT_FMT )
|
||||
{
|
||||
switch( m_layerCtrl->GetSelection() )
|
||||
{
|
||||
case 0: layer = wxT( "F.Cu" ); break;
|
||||
case 1: layer = wxT( "F.SilkS" ); break;
|
||||
case 2: layer = wxT( "F.Mask" ); break;
|
||||
case 3: layer = wxT( "Dwgs.User" ); break;
|
||||
case 4: layer = wxT( "Cmts.User" ); break;
|
||||
case 5: layer = wxT( "Eco1.User" ); break;
|
||||
case 6: layer = wxT( "Eco2.User" ); break;
|
||||
case 7: layer = wxT( "F.Fab" ); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
WX_STRING_REPORTER reporter;
|
||||
BITMAPCONV_INFO converter( aOutput, reporter );
|
||||
|
||||
BITMAPCONV_INFO converter( aOutput );
|
||||
converter.ConvertBitmap( potrace_bitmap, aFormat, m_outputSizeX.GetOutputDPI(),
|
||||
m_outputSizeY.GetOutputDPI(), modLayer );
|
||||
m_outputSizeY.GetOutputDPI(), layer );
|
||||
|
||||
if( !converter.GetErrorMessages().empty() )
|
||||
wxMessageBox( converter.GetErrorMessages().c_str(), _( "Errors" ) );
|
||||
if( reporter.HasMessage() )
|
||||
wxMessageBox( reporter.GetMessages(), _( "Errors" ) );
|
||||
}
|
||||
|
||||
|
||||
void BITMAP2CMP_PANEL::OnFormatChange( wxCommandEvent& event )
|
||||
{
|
||||
bool enable = m_rbOutputFormat->GetSelection() == PCBNEW_KICAD_MOD;
|
||||
m_chPCBLayer->Enable( enable );
|
||||
m_layerLabel->Enable( m_rbFootprint->GetValue() );
|
||||
m_layerCtrl->Enable( m_rbFootprint->GetValue() );
|
||||
}
|
||||
|
||||
@@ -40,32 +40,13 @@ public:
|
||||
// to the value in new unit
|
||||
void SetUnit( EDA_UNITS aUnit );
|
||||
|
||||
// Accessors:
|
||||
void SetOriginalDPI( int aDPI )
|
||||
{
|
||||
m_originalDPI = aDPI;
|
||||
}
|
||||
void SetOriginalDPI( int aDPI ) { m_originalDPI = aDPI; }
|
||||
|
||||
void SetOriginalSizePixels( int aPixels )
|
||||
{
|
||||
m_originalSizePixels = aPixels;
|
||||
}
|
||||
void SetOriginalSizePixels( int aPixels ) { m_originalSizePixels = aPixels; }
|
||||
int GetOriginalSizePixels() { return m_originalSizePixels; }
|
||||
|
||||
double GetOutputSize()
|
||||
{
|
||||
return m_outputSize;
|
||||
}
|
||||
|
||||
void SetOutputSize( double aSize, EDA_UNITS aUnit )
|
||||
{
|
||||
m_unit = aUnit;
|
||||
m_outputSize = aSize;
|
||||
}
|
||||
|
||||
int GetOriginalSizePixels()
|
||||
{
|
||||
return m_originalSizePixels;
|
||||
}
|
||||
double GetOutputSize() { return m_outputSize; }
|
||||
void SetOutputSize( double aSize, EDA_UNITS aUnit ) { m_outputSize = aSize; m_unit = aUnit; }
|
||||
|
||||
// Set the m_outputSize value from the m_originalSizePixels and the selected unit
|
||||
void SetOutputSizeFromInitialImageSize();
|
||||
@@ -88,7 +69,7 @@ class BITMAP2CMP_PANEL : public BITMAP2CMP_PANEL_BASE
|
||||
{
|
||||
public:
|
||||
BITMAP2CMP_PANEL( BITMAP2CMP_FRAME* aParent );
|
||||
~BITMAP2CMP_PANEL();
|
||||
~BITMAP2CMP_PANEL() {}
|
||||
|
||||
bool OpenProjectFiles( const std::vector<wxString>& aFilenames, int aCtl = 0 );
|
||||
|
||||
@@ -117,28 +98,27 @@ private:
|
||||
void OnPaintBW( wxPaintEvent& event ) override;
|
||||
void OnExportToFile( wxCommandEvent& event ) override;
|
||||
void OnExportToClipboard( wxCommandEvent& event ) override;
|
||||
void OnFormatChange( wxCommandEvent& event ) override;
|
||||
void OnNegativeClicked( wxCommandEvent& event ) override;
|
||||
void OnThresholdChange( wxScrollEvent& event ) override;
|
||||
void OnSizeChangeX( wxCommandEvent& event ) override;
|
||||
void OnSizeChangeY( wxCommandEvent& event ) override;
|
||||
void OnSizeUnitChange( wxCommandEvent& event ) override;
|
||||
void ToggleAspectRatioLock( wxCommandEvent& event ) override;
|
||||
|
||||
OUTPUT_FMT_ID getOutputFormat();
|
||||
|
||||
///< @return the EDA_UNITS from the m_PixelUnit choice
|
||||
EDA_UNITS getUnitFromSelection();
|
||||
|
||||
// return a string giving the output size, according to the selected unit
|
||||
wxString FormatOutputSize( double aSize );
|
||||
wxString formatOutputSize( double aSize );
|
||||
|
||||
void Binarize( double aThreshold ); // aThreshold = 0.0 (black level) to 1.0 (white level)
|
||||
void OnNegativeClicked( wxCommandEvent& event ) override;
|
||||
void OnThresholdChange( wxScrollEvent& event ) override;
|
||||
void binarize( double aThreshold ); // aThreshold = 0.0 (black level) to 1.0 (white level)
|
||||
|
||||
void OnSizeChangeX( wxCommandEvent& event ) override;
|
||||
void OnSizeChangeY( wxCommandEvent& event ) override;
|
||||
void OnSizeUnitChange( wxCommandEvent& event ) override;
|
||||
|
||||
void ToggleAspectRatioLock( wxCommandEvent& event ) override;
|
||||
|
||||
void NegateGreyscaleImage();
|
||||
void negateGreyscaleImage();
|
||||
|
||||
void updateImageInfo();
|
||||
void OnFormatChange( wxCommandEvent& event ) override;
|
||||
void exportBitmap( OUTPUT_FMT_ID aFormat );
|
||||
|
||||
private:
|
||||
BITMAP2CMP_FRAME* m_parentFrame;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -27,7 +27,7 @@ BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
m_BNPicturePanel->SetScrollRate( 5, 5 );
|
||||
m_Notebook->AddPage( m_BNPicturePanel, _("Black && White Picture"), true );
|
||||
|
||||
bMainSizer->Add( m_Notebook, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
|
||||
bMainSizer->Add( m_Notebook, 1, wxEXPAND|wxBOTTOM|wxLEFT, 10 );
|
||||
|
||||
wxBoxSizer* brightSizer;
|
||||
brightSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -96,7 +96,7 @@ BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
brightSizer->Add( sbSizerInfo, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_buttonLoad = new wxButton( this, wxID_ANY, _("Load Source Image"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
brightSizer->Add( m_buttonLoad, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
brightSizer->Add( m_buttonLoad, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
brightSizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
@@ -104,35 +104,35 @@ BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
wxStaticBoxSizer* sbSizerImgPrms;
|
||||
sbSizerImgPrms = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Output Size") ), wxVERTICAL );
|
||||
|
||||
m_aspectRatioCheckbox = new wxCheckBox( sbSizerImgPrms->GetStaticBox(), wxID_ANY, _("Lock height / width ratio"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerImgPrms->Add( m_aspectRatioCheckbox, 0, wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bSizerRes;
|
||||
bSizerRes = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticTextOSize = new wxStaticText( sbSizerImgPrms->GetStaticBox(), wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextOSize->Wrap( -1 );
|
||||
bSizerRes->Add( m_staticTextOSize, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
m_sizeLabel = new wxStaticText( sbSizerImgPrms->GetStaticBox(), wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_sizeLabel->Wrap( -1 );
|
||||
bSizerRes->Add( m_sizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_UnitSizeX = new wxTextCtrl( sbSizerImgPrms->GetStaticBox(), wxID_ANY, _("300"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_UnitSizeX->SetMinSize( wxSize( 60,-1 ) );
|
||||
|
||||
bSizerRes->Add( m_UnitSizeX, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizerRes->Add( m_UnitSizeX, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_UnitSizeY = new wxTextCtrl( sbSizerImgPrms->GetStaticBox(), wxID_ANY, _("300"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_UnitSizeY->SetMinSize( wxSize( 60,-1 ) );
|
||||
|
||||
bSizerRes->Add( m_UnitSizeY, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizerRes->Add( m_UnitSizeY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
wxArrayString m_PixelUnitChoices;
|
||||
m_PixelUnit = new wxChoice( sbSizerImgPrms->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PixelUnitChoices, 0 );
|
||||
m_PixelUnit->SetSelection( 0 );
|
||||
m_PixelUnit->SetMinSize( wxSize( 80,-1 ) );
|
||||
|
||||
bSizerRes->Add( m_PixelUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
|
||||
bSizerRes->Add( m_PixelUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
|
||||
sbSizerImgPrms->Add( bSizerRes, 0, wxEXPAND, 5 );
|
||||
sbSizerImgPrms->Add( bSizerRes, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_aspectRatioCheckbox = new wxCheckBox( sbSizerImgPrms->GetStaticBox(), wxID_ANY, _("Lock height / width ratio"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerImgPrms->Add( m_aspectRatioCheckbox, 0, wxALL, 5 );
|
||||
|
||||
|
||||
brightSizer->Add( sbSizerImgPrms, 0, wxALL|wxEXPAND, 5 );
|
||||
@@ -142,7 +142,7 @@ BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
|
||||
m_ThresholdText = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Black / white threshold:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ThresholdText->Wrap( -1 );
|
||||
sbSizer2->Add( m_ThresholdText, 0, wxLEFT, 5 );
|
||||
sbSizer2->Add( m_ThresholdText, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sliderThreshold = new wxSlider( sbSizer2->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
|
||||
m_sliderThreshold->SetToolTip( _("Adjust the level to convert the greyscale picture to a black and white picture.") );
|
||||
@@ -150,29 +150,54 @@ BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
sbSizer2->Add( m_sliderThreshold, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_checkNegative = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Negative"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizer2->Add( m_checkNegative, 0, wxBOTTOM, 5 );
|
||||
sbSizer2->Add( m_checkNegative, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
brightSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_sizerPcbLayer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pcb Layer for Graphics") ), wxVERTICAL );
|
||||
wxStaticBoxSizer* sbOutputFormat;
|
||||
sbOutputFormat = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Output Format") ), wxVERTICAL );
|
||||
|
||||
wxString m_chPCBLayerChoices[] = { _("Front silk screen"), _("Front solder mask"), _("Front Fab layer"), _("User layer drawings"), _("User layer comments"), _("User layer Eco1"), _("User layer Eco2") };
|
||||
int m_chPCBLayerNChoices = sizeof( m_chPCBLayerChoices ) / sizeof( wxString );
|
||||
m_chPCBLayer = new wxChoice( m_sizerPcbLayer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_chPCBLayerNChoices, m_chPCBLayerChoices, 0 );
|
||||
m_chPCBLayer->SetSelection( 0 );
|
||||
m_sizerPcbLayer->Add( m_chPCBLayer, 0, wxALL|wxEXPAND, 5 );
|
||||
wxFlexGridSizer* fgSizer2;
|
||||
fgSizer2 = new wxFlexGridSizer( 5, 1, 2, 0 );
|
||||
fgSizer2->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_rbSymbol = new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY, _("Symbol (.kicad_sym file)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_rbSymbol, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_rbFootprint = new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY, _("Footprint (.kicad_mod file)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_rbFootprint, 0, wxTOP|wxRIGHT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer4;
|
||||
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_layerLabel = new wxStaticText( sbOutputFormat->GetStaticBox(), wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_layerLabel->Wrap( -1 );
|
||||
bSizer4->Add( m_layerLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 28 );
|
||||
|
||||
wxString m_layerCtrlChoices[] = { _("F.Cu"), _("F.Silkscreen"), _("F.Mask"), _("User.Drawings"), _("User.Comments"), _("User.Eco1"), _("User.Eco2"), _("F.Fab") };
|
||||
int m_layerCtrlNChoices = sizeof( m_layerCtrlChoices ) / sizeof( wxString );
|
||||
m_layerCtrl = new wxChoice( sbOutputFormat->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCtrlNChoices, m_layerCtrlChoices, 0 );
|
||||
m_layerCtrl->SetSelection( 0 );
|
||||
bSizer4->Add( m_layerCtrl, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
brightSizer->Add( m_sizerPcbLayer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
fgSizer2->Add( bSizer4, 1, wxEXPAND, 5 );
|
||||
|
||||
wxString m_rbOutputFormatChoices[] = { _("Symbol (.kicad_sym file)"), _("Footprint (.kicad_mod file)"), _("Postscript (.ps file)"), _("Drawing Sheet (.kicad_wks file)") };
|
||||
int m_rbOutputFormatNChoices = sizeof( m_rbOutputFormatChoices ) / sizeof( wxString );
|
||||
m_rbOutputFormat = new wxRadioBox( this, wxID_ANY, _("Output Format"), wxDefaultPosition, wxDefaultSize, m_rbOutputFormatNChoices, m_rbOutputFormatChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbOutputFormat->SetSelection( 0 );
|
||||
brightSizer->Add( m_rbOutputFormat, 0, wxEXPAND|wxALL, 5 );
|
||||
m_rbPostscript = new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY, _("Postscript (.ps file)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_rbPostscript, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_buttonExportFile = new wxButton( this, wxID_ANY, _("Export to File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_rbWorksheet = new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY, _("Drawing Sheet (.kicad_wks file)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_rbWorksheet, 0, wxTOP|wxRIGHT, 5 );
|
||||
|
||||
|
||||
sbOutputFormat->Add( fgSizer2, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
brightSizer->Add( sbOutputFormat, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_buttonExportFile = new wxButton( this, wxID_ANY, _("Export to File..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
brightSizer->Add( m_buttonExportFile, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_buttonExportClipboard = new wxButton( this, wxID_ANY, _("Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
@@ -191,14 +216,17 @@ BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
m_GreyscalePicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BITMAP2CMP_PANEL_BASE::OnPaintGreyscale ), NULL, this );
|
||||
m_BNPicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BITMAP2CMP_PANEL_BASE::OnPaintBW ), NULL, this );
|
||||
m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnLoadFile ), NULL, this );
|
||||
m_aspectRatioCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::ToggleAspectRatioLock ), NULL, this );
|
||||
m_UnitSizeX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnSizeChangeX ), NULL, this );
|
||||
m_UnitSizeY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnSizeChangeY ), NULL, this );
|
||||
m_PixelUnit->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnSizeUnitChange ), NULL, this );
|
||||
m_aspectRatioCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::ToggleAspectRatioLock ), NULL, this );
|
||||
m_sliderThreshold->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( BITMAP2CMP_PANEL_BASE::OnThresholdChange ), NULL, this );
|
||||
m_sliderThreshold->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BITMAP2CMP_PANEL_BASE::OnThresholdChange ), NULL, this );
|
||||
m_checkNegative->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnNegativeClicked ), NULL, this );
|
||||
m_rbOutputFormat->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbSymbol->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbFootprint->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbPostscript->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbWorksheet->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_buttonExportFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnExportToFile ), NULL, this );
|
||||
m_buttonExportClipboard->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnExportToClipboard ), NULL, this );
|
||||
}
|
||||
@@ -210,14 +238,17 @@ BITMAP2CMP_PANEL_BASE::~BITMAP2CMP_PANEL_BASE()
|
||||
m_GreyscalePicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BITMAP2CMP_PANEL_BASE::OnPaintGreyscale ), NULL, this );
|
||||
m_BNPicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BITMAP2CMP_PANEL_BASE::OnPaintBW ), NULL, this );
|
||||
m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnLoadFile ), NULL, this );
|
||||
m_aspectRatioCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::ToggleAspectRatioLock ), NULL, this );
|
||||
m_UnitSizeX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnSizeChangeX ), NULL, this );
|
||||
m_UnitSizeY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnSizeChangeY ), NULL, this );
|
||||
m_PixelUnit->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnSizeUnitChange ), NULL, this );
|
||||
m_aspectRatioCheckbox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::ToggleAspectRatioLock ), NULL, this );
|
||||
m_sliderThreshold->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( BITMAP2CMP_PANEL_BASE::OnThresholdChange ), NULL, this );
|
||||
m_sliderThreshold->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BITMAP2CMP_PANEL_BASE::OnThresholdChange ), NULL, this );
|
||||
m_checkNegative->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnNegativeClicked ), NULL, this );
|
||||
m_rbOutputFormat->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbSymbol->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbFootprint->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbPostscript->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_rbWorksheet->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnFormatChange ), NULL, this );
|
||||
m_buttonExportFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnExportToFile ), NULL, this );
|
||||
m_buttonExportClipboard->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BITMAP2CMP_PANEL_BASE::OnExportToClipboard ), NULL, this );
|
||||
|
||||
|
||||
+2204
-1886
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -24,23 +24,23 @@
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/valtext.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class BITMAP2CMP_PANEL_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class BITMAP2CMP_PANEL_BASE : public wxPanel
|
||||
{
|
||||
private:
|
||||
wxStaticText* m_sizeLabel;
|
||||
|
||||
protected:
|
||||
wxNotebook* m_Notebook;
|
||||
@@ -59,17 +59,19 @@ class BITMAP2CMP_PANEL_BASE : public wxPanel
|
||||
wxStaticText* m_BPPValue;
|
||||
wxStaticText* m_BPPunits;
|
||||
wxButton* m_buttonLoad;
|
||||
wxCheckBox* m_aspectRatioCheckbox;
|
||||
wxStaticText* m_staticTextOSize;
|
||||
wxTextCtrl* m_UnitSizeX;
|
||||
wxTextCtrl* m_UnitSizeY;
|
||||
wxChoice* m_PixelUnit;
|
||||
wxCheckBox* m_aspectRatioCheckbox;
|
||||
wxStaticText* m_ThresholdText;
|
||||
wxSlider* m_sliderThreshold;
|
||||
wxCheckBox* m_checkNegative;
|
||||
wxStaticBoxSizer* m_sizerPcbLayer;
|
||||
wxChoice* m_chPCBLayer;
|
||||
wxRadioBox* m_rbOutputFormat;
|
||||
wxRadioButton* m_rbSymbol;
|
||||
wxRadioButton* m_rbFootprint;
|
||||
wxStaticText* m_layerLabel;
|
||||
wxChoice* m_layerCtrl;
|
||||
wxRadioButton* m_rbPostscript;
|
||||
wxRadioButton* m_rbWorksheet;
|
||||
wxButton* m_buttonExportFile;
|
||||
wxButton* m_buttonExportClipboard;
|
||||
|
||||
@@ -78,10 +80,10 @@ class BITMAP2CMP_PANEL_BASE : public wxPanel
|
||||
virtual void OnPaintGreyscale( wxPaintEvent& event ) { event.Skip(); }
|
||||
virtual void OnPaintBW( wxPaintEvent& event ) { event.Skip(); }
|
||||
virtual void OnLoadFile( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void ToggleAspectRatioLock( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSizeChangeX( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSizeChangeY( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSizeUnitChange( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void ToggleAspectRatioLock( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnThresholdChange( wxScrollEvent& event ) { event.Skip(); }
|
||||
virtual void OnNegativeClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnFormatChange( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
@@ -27,28 +27,45 @@
|
||||
|
||||
|
||||
///! Update the schema version whenever a migration is required
|
||||
const int bitmap2cmpSchemaVersion = 0;
|
||||
const int bitmap2cmpSchemaVersion = 1;
|
||||
|
||||
|
||||
BITMAP2CMP_SETTINGS::BITMAP2CMP_SETTINGS() :
|
||||
APP_SETTINGS_BASE( "bitmap2component", bitmap2cmpSchemaVersion ),
|
||||
m_BitmapFileName(), m_ConvertedFileName(), m_Units(), m_Threshold(), m_Negative(),
|
||||
m_LastFormat(), m_LastModLayer()
|
||||
m_BitmapFileName(),
|
||||
m_ConvertedFileName(),
|
||||
m_Units(),
|
||||
m_Threshold(),
|
||||
m_Negative(),
|
||||
m_LastFormat(),
|
||||
m_LastLayer()
|
||||
{
|
||||
m_params.emplace_back( new PARAM<wxString>( "bitmap_file_name", &m_BitmapFileName, "" ) );
|
||||
|
||||
m_params.emplace_back(
|
||||
new PARAM<wxString>( "converted_file_name", &m_ConvertedFileName, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "converted_file_name", &m_ConvertedFileName, "" ) );
|
||||
m_params.emplace_back( new PARAM<int>( "units", &m_Units, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "threshold", &m_Threshold, 50 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "negative", &m_Negative, false ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "last_format", &m_LastFormat, 0 ) );
|
||||
m_params.emplace_back( new PARAM<int>( "last_mod_layer", &m_LastLayer, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "last_mod_layer", &m_LastModLayer, 0 ) );
|
||||
registerMigration( 0, 1,
|
||||
[&]() -> bool
|
||||
{
|
||||
// Version 1 introduced a new layer (F.Cu), and changed the ordering to
|
||||
// be consistent with PCBNew.
|
||||
switch( Get<int>( "last_mod_layer" ).value_or( 0 ) )
|
||||
{
|
||||
default:
|
||||
case 0: Set( "last_mod_layer", 1 ); break;
|
||||
case 1: Set( "last_mod_layer", 2 ); break;
|
||||
case 2: Set( "last_mod_layer", 7 ); break;
|
||||
case 3: Set( "last_mod_layer", 3 ); break;
|
||||
case 4: Set( "last_mod_layer", 4 ); break;
|
||||
case 5: Set( "last_mod_layer", 5 ); break;
|
||||
case 6: Set( "last_mod_layer", 6 ); break;
|
||||
}
|
||||
return true;
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,22 +35,16 @@ public:
|
||||
|
||||
virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
|
||||
|
||||
public:
|
||||
wxString m_BitmapFileName;
|
||||
|
||||
wxString m_ConvertedFileName;
|
||||
|
||||
int m_Units;
|
||||
|
||||
int m_Threshold;
|
||||
|
||||
bool m_Negative;
|
||||
|
||||
int m_LastFormat;
|
||||
|
||||
int m_LastModLayer;
|
||||
int m_Units;
|
||||
int m_Threshold;
|
||||
bool m_Negative;
|
||||
int m_LastFormat;
|
||||
int m_LastLayer;
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string getLegacyFrameName() const override { return "Bmconverter_"; }
|
||||
};
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
#include <kiid.h>
|
||||
|
||||
#include <build_version.h>
|
||||
#include <layer_ids.h>
|
||||
|
||||
#include <locale_io.h>
|
||||
#include <macros.h>
|
||||
#include <potracelib.h>
|
||||
|
||||
#include <reporter.h>
|
||||
#include <fmt/format.h>
|
||||
#include <wx/translation.h>
|
||||
|
||||
#include "bitmap2component.h"
|
||||
|
||||
@@ -46,23 +46,21 @@
|
||||
/* free a potrace bitmap */
|
||||
static void bm_free( potrace_bitmap_t* bm )
|
||||
{
|
||||
if( bm != nullptr )
|
||||
{
|
||||
if( bm )
|
||||
free( bm->map );
|
||||
}
|
||||
|
||||
free( bm );
|
||||
}
|
||||
|
||||
|
||||
static void BezierToPolyline( std::vector <potrace_dpoint_t>& aCornersBuffer,
|
||||
potrace_dpoint_t p1,
|
||||
potrace_dpoint_t p2,
|
||||
potrace_dpoint_t p3,
|
||||
potrace_dpoint_t p4 );
|
||||
potrace_dpoint_t p1, potrace_dpoint_t p2,
|
||||
potrace_dpoint_t p3, potrace_dpoint_t p4 );
|
||||
|
||||
BITMAPCONV_INFO::BITMAPCONV_INFO( std::string& aData ):
|
||||
m_Data( aData )
|
||||
|
||||
BITMAPCONV_INFO::BITMAPCONV_INFO( std::string& aData, REPORTER& aReporter ):
|
||||
m_Data( aData ),
|
||||
m_reporter( aReporter )
|
||||
{
|
||||
m_Format = POSTSCRIPT_FMT;
|
||||
m_PixmapWidth = 0;
|
||||
@@ -75,7 +73,7 @@ BITMAPCONV_INFO::BITMAPCONV_INFO( std::string& aData ):
|
||||
|
||||
|
||||
int BITMAPCONV_INFO::ConvertBitmap( potrace_bitmap_t* aPotrace_bitmap, OUTPUT_FMT_ID aFormat,
|
||||
int aDpi_X, int aDpi_Y, BMP2CMP_MOD_LAYER aModLayer )
|
||||
int aDpi_X, int aDpi_Y, const wxString& aLayer )
|
||||
{
|
||||
potrace_param_t* param;
|
||||
potrace_state_t* st;
|
||||
@@ -85,7 +83,8 @@ int BITMAPCONV_INFO::ConvertBitmap( potrace_bitmap_t* aPotrace_bitmap, OUTPUT_FM
|
||||
|
||||
if( !param )
|
||||
{
|
||||
m_errors += fmt::format( "Error allocating parameters: {}\n", strerror( errno ) );
|
||||
m_reporter.Report( fmt::format( "Error allocating parameters: {}\n", strerror( errno ) ),
|
||||
RPT_SEVERITY_ERROR );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -100,57 +99,48 @@ int BITMAPCONV_INFO::ConvertBitmap( potrace_bitmap_t* aPotrace_bitmap, OUTPUT_FM
|
||||
if( !st || st->status != POTRACE_STATUS_OK )
|
||||
{
|
||||
if( st )
|
||||
{
|
||||
potrace_state_free( st );
|
||||
}
|
||||
|
||||
potrace_param_free( param );
|
||||
|
||||
m_errors += fmt::format( "Error tracing bitmap: {}\n", strerror( errno ) );
|
||||
m_reporter.Report( fmt::format( "Error tracing bitmap: {}\n", strerror( errno ) ),
|
||||
RPT_SEVERITY_ERROR );
|
||||
return 1;
|
||||
}
|
||||
|
||||
m_PixmapWidth = aPotrace_bitmap->w;
|
||||
m_PixmapHeight = aPotrace_bitmap->h; // the bitmap size in pixels
|
||||
m_Paths = st->plist;
|
||||
m_Paths = st->plist;
|
||||
m_Format = aFormat;
|
||||
|
||||
switch( aFormat )
|
||||
{
|
||||
case KICAD_WKS_LOGO:
|
||||
m_Format = KICAD_WKS_LOGO;
|
||||
case DRAWING_SHEET_FMT:
|
||||
m_ScaleX = PL_IU_PER_MM * 25.4 / aDpi_X; // the conversion scale from PPI to micron
|
||||
m_ScaleY = PL_IU_PER_MM * 25.4 / aDpi_Y; // Y axis is top to bottom
|
||||
createOutputData();
|
||||
break;
|
||||
|
||||
case POSTSCRIPT_FMT:
|
||||
m_Format = POSTSCRIPT_FMT;
|
||||
m_ScaleX = 1.0; // the conversion scale
|
||||
m_ScaleY = m_ScaleX;
|
||||
|
||||
// output vector data, e.g. as a rudimentary EPS file (mainly for tests)
|
||||
createOutputData();
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
m_Format = EESCHEMA_FMT;
|
||||
case SYMBOL_FMT:
|
||||
case SYMBOL_PASTE_FMT:
|
||||
m_ScaleX = SCH_IU_PER_MM * 25.4 / aDpi_X; // the conversion scale from PPI to eeschema iu
|
||||
m_ScaleY = -SCH_IU_PER_MM * 25.4 / aDpi_Y; // Y axis is bottom to Top for components in libs
|
||||
createOutputData();
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
m_Format = PCBNEW_KICAD_MOD;
|
||||
case FOOTPRINT_FMT:
|
||||
m_ScaleX = PCB_IU_PER_MM * 25.4 / aDpi_X; // the conversion scale from PPI to IU
|
||||
m_ScaleY = PCB_IU_PER_MM * 25.4 / aDpi_Y; // Y axis is top to bottom in Footprint Editor
|
||||
createOutputData( aModLayer );
|
||||
break;
|
||||
|
||||
default:
|
||||
createOutputData( aLayer );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
bm_free( aPotrace_bitmap );
|
||||
potrace_state_free( st );
|
||||
potrace_param_free( param );
|
||||
@@ -159,131 +149,86 @@ int BITMAPCONV_INFO::ConvertBitmap( potrace_bitmap_t* aPotrace_bitmap, OUTPUT_FM
|
||||
}
|
||||
|
||||
|
||||
const char* BITMAPCONV_INFO::getBoardLayerName( BMP2CMP_MOD_LAYER aChoice )
|
||||
void BITMAPCONV_INFO::outputDataHeader( const wxString& aBrdLayerName )
|
||||
{
|
||||
const char* layerName = "F.SilkS";
|
||||
|
||||
switch( aChoice )
|
||||
{
|
||||
case MOD_LYR_FSOLDERMASK:
|
||||
layerName = "F.Mask";
|
||||
break;
|
||||
|
||||
case MOD_LYR_FAB:
|
||||
layerName = "F.Fab";
|
||||
break;
|
||||
|
||||
case MOD_LYR_DRAWINGS:
|
||||
layerName = "Dwgs.User";
|
||||
break;
|
||||
|
||||
case MOD_LYR_COMMENTS:
|
||||
layerName = "Cmts.User";
|
||||
break;
|
||||
|
||||
case MOD_LYR_ECO1:
|
||||
layerName = "Eco1.User";
|
||||
break;
|
||||
|
||||
case MOD_LYR_ECO2:
|
||||
layerName = "Eco2.User";
|
||||
break;
|
||||
|
||||
case MOD_LYR_FSILKS:
|
||||
break;
|
||||
}
|
||||
|
||||
return layerName;
|
||||
}
|
||||
|
||||
|
||||
void BITMAPCONV_INFO::outputDataHeader( const char * aBrdLayerName )
|
||||
{
|
||||
double Ypos = ( m_PixmapHeight / 2 * m_ScaleY ); // fields Y position in mm
|
||||
double Ypos = ( m_PixmapHeight / 2.0 * m_ScaleY ); // fields Y position in mm
|
||||
double fieldSize; // fields text size in mm
|
||||
std::string strbuf;
|
||||
|
||||
switch( m_Format )
|
||||
{
|
||||
case POSTSCRIPT_FMT:
|
||||
/* output vector data, e.g. as a rudimentary EPS file */
|
||||
m_Data += "%!PS-Adobe-3.0 EPSF-3.0\n";
|
||||
strbuf = fmt::format( "%%BoundingBox: 0 0 {} {}\n", m_PixmapWidth, m_PixmapHeight );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( "%%BoundingBox: 0 0 {} {}\n", m_PixmapWidth, m_PixmapHeight );
|
||||
m_Data += "gsave\n";
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
case FOOTPRINT_FMT:
|
||||
// fields text size = 1.5 mm
|
||||
// fields text thickness = 1.5 / 5 = 0.3mm
|
||||
strbuf = fmt::format( "(footprint \"{}\" (version 20221018) (generator \"bitmap2component\") (generator_version \"{}\")\n"
|
||||
" (layer \"F.Cu\")\n",
|
||||
m_CmpName.c_str(), GetMajorMinorVersion().ToStdString() );
|
||||
m_Data += fmt::format( "(footprint \"{}\" (version 20221018) (generator \"bitmap2component\") (generator_version \"{}\")\n"
|
||||
" (layer \"F.Cu\")\n",
|
||||
m_CmpName.c_str(),
|
||||
GetMajorMinorVersion().ToStdString() );
|
||||
|
||||
m_Data += strbuf;
|
||||
strbuf = fmt::format(
|
||||
" (attr board_only exclude_from_pos_files exclude_from_bom)\n" );
|
||||
m_Data += strbuf;
|
||||
strbuf = fmt::format(
|
||||
" (fp_text reference \"G***\" (at 0 0) (layer \"{}\")\n"
|
||||
" (effects (font (size 1.5 1.5) (thickness 0.3)))\n"
|
||||
" (uuid {})\n )\n",
|
||||
aBrdLayerName, KIID().AsString().ToStdString().c_str() );
|
||||
m_Data += fmt::format( " (attr board_only exclude_from_pos_files exclude_from_bom)\n" );
|
||||
m_Data += fmt::format( " (fp_text reference \"G***\" (at 0 0) (layer \"{}\")\n"
|
||||
" (effects (font (size 1.5 1.5) (thickness 0.3)))\n"
|
||||
" (uuid {})\n )\n",
|
||||
aBrdLayerName.ToStdString().c_str(),
|
||||
KIID().AsString().ToStdString().c_str() );
|
||||
|
||||
m_Data += strbuf;
|
||||
strbuf = fmt::format(
|
||||
" (fp_text value \"{}\" (at 0.75 0) (layer \"{}\") hide\n"
|
||||
" (effects (font (size 1.5 1.5) (thickness 0.3)))\n"
|
||||
" (uuid {})\n )\n",
|
||||
m_CmpName.c_str(), aBrdLayerName, KIID().AsString().ToStdString().c_str() );
|
||||
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (fp_text value \"{}\" (at 0.75 0) (layer \"{}\") hide\n"
|
||||
" (effects (font (size 1.5 1.5) (thickness 0.3)))\n"
|
||||
" (uuid {})\n )\n",
|
||||
m_CmpName.c_str(),
|
||||
aBrdLayerName.ToStdString().c_str(),
|
||||
KIID().AsString().ToStdString().c_str() );
|
||||
break;
|
||||
|
||||
case KICAD_WKS_LOGO:
|
||||
m_Data += fmt::format("(kicad_wks (version 20220228) (generator \"bitmap2component\") (generator_version \"{}\")\n", GetMajorMinorVersion().ToStdString() );
|
||||
case DRAWING_SHEET_FMT:
|
||||
m_Data += fmt::format( "(kicad_wks (version 20220228) (generator \"bitmap2component\") (generator_version \"{}\")\n",
|
||||
GetMajorMinorVersion().ToStdString() );
|
||||
m_Data += " (setup (textsize 1.5 1.5)(linewidth 0.15)(textlinewidth 0.15)\n";
|
||||
m_Data += " (left_margin 10)(right_margin 10)(top_margin 10)(bottom_margin 10))\n";
|
||||
m_Data += " (polygon (name \"\") (pos 0 0) (linewidth 0.01)\n";
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
case SYMBOL_FMT:
|
||||
m_Data += fmt::format( "(kicad_symbol_lib (version 20220914) (generator \"bitmap2component\") (generator_version \"{}\")\n",
|
||||
GetMajorMinorVersion().ToStdString() );
|
||||
KI_FALLTHROUGH;
|
||||
|
||||
case SYMBOL_PASTE_FMT:
|
||||
fieldSize = 1.27; // fields text size in mm (= 50 mils)
|
||||
Ypos /= SCH_IU_PER_MM;
|
||||
Ypos += fieldSize / 2;
|
||||
// snprintf( strbuf, sizeof(strbuf), "# pixmap size w = %d, h = %d\n#\n", m_PixmapWidth, m_PixmapHeight );
|
||||
strbuf = fmt::format(
|
||||
"(kicad_symbol_lib (version 20220914) (generator \"bitmap2component\") (generator_version \"{}\")\n"
|
||||
" (symbol \"{}\" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)\n",
|
||||
GetMajorMinorVersion().ToStdString(), m_CmpName.c_str() );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (symbol \"{}\" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)\n",
|
||||
m_CmpName.c_str() );
|
||||
|
||||
strbuf = fmt::format(
|
||||
" (property \"Reference\" \"#G\" (at 0 {:g} 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
-Ypos, fieldSize, fieldSize );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (property \"Reference\" \"#G\" (at 0 {:g} 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
-Ypos,
|
||||
fieldSize,
|
||||
fieldSize );
|
||||
|
||||
strbuf = fmt::format(
|
||||
" (property \"Value\" \"{}\" (at 0 {:g} 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
m_CmpName.c_str(), Ypos, fieldSize, fieldSize );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (property \"Value\" \"{}\" (at 0 {:g} 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
m_CmpName.c_str(),
|
||||
Ypos,
|
||||
fieldSize,
|
||||
fieldSize );
|
||||
|
||||
strbuf = fmt::format(
|
||||
" (property \"Footprint\" \"\" (at 0 0 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
fieldSize, fieldSize );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (property \"Footprint\" \"\" (at 0 0 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
fieldSize,
|
||||
fieldSize );
|
||||
|
||||
strbuf = fmt::format(
|
||||
" (property \"Datasheet\" \"\" (at 0 0 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
fieldSize, fieldSize );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (property \"Datasheet\" \"\" (at 0 0 0)\n"
|
||||
" (effects (font (size {:g} {:g})) hide)\n )\n",
|
||||
fieldSize,
|
||||
fieldSize );
|
||||
|
||||
strbuf = fmt::format( " (symbol \"{}_0_0\"\n", m_CmpName.c_str() );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (symbol \"{}_0_0\"\n", m_CmpName.c_str() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -298,15 +243,20 @@ void BITMAPCONV_INFO::outputDataEnd()
|
||||
m_Data += "%%EOF\n";
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
case FOOTPRINT_FMT:
|
||||
m_Data += ")\n";
|
||||
break;
|
||||
|
||||
case KICAD_WKS_LOGO:
|
||||
case DRAWING_SHEET_FMT:
|
||||
m_Data += " )\n)\n";
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
case SYMBOL_PASTE_FMT:
|
||||
m_Data += " )\n"; // end symbol_0_0
|
||||
m_Data += " )\n"; // end symbol
|
||||
break;
|
||||
|
||||
case SYMBOL_FMT:
|
||||
m_Data += " )\n"; // end symbol_0_0
|
||||
m_Data += " )\n"; // end symbol
|
||||
m_Data += ")\n"; // end lib
|
||||
@@ -315,16 +265,14 @@ void BITMAPCONV_INFO::outputDataEnd()
|
||||
}
|
||||
|
||||
|
||||
void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char* aBrdLayerName )
|
||||
void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const wxString& aBrdLayerName )
|
||||
{
|
||||
// write one polygon to output file.
|
||||
// coordinates are expected in target unit.
|
||||
int ii, jj;
|
||||
int ii, jj;
|
||||
VECTOR2I currpoint;
|
||||
std::string strbuf;
|
||||
|
||||
int offsetX = (int)( m_PixmapWidth / 2 * m_ScaleX );
|
||||
int offsetY = (int)( m_PixmapHeight / 2 * m_ScaleY );
|
||||
int offsetX = KiROUND( m_PixmapWidth / 2.0 * m_ScaleX );
|
||||
int offsetY = KiROUND( m_PixmapHeight / 2.0 * m_ScaleY );
|
||||
|
||||
const VECTOR2I startpoint = aPolygon.CPoint( 0 );
|
||||
|
||||
@@ -332,15 +280,13 @@ void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char*
|
||||
{
|
||||
case POSTSCRIPT_FMT:
|
||||
offsetY = (int)( m_PixmapHeight * m_ScaleY );
|
||||
strbuf = fmt::format( "newpath\n{} {} moveto\n", startpoint.x, offsetY - startpoint.y );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( "newpath\n{} {} moveto\n", startpoint.x, offsetY - startpoint.y );
|
||||
jj = 0;
|
||||
|
||||
for( ii = 1; ii < aPolygon.PointCount(); ii++ )
|
||||
{
|
||||
currpoint = aPolygon.CPoint( ii );
|
||||
strbuf = fmt::format( " {} {} lineto", currpoint.x, offsetY - currpoint.y );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " {} {} lineto", currpoint.x, offsetY - currpoint.y );
|
||||
|
||||
if( jj++ > 6 )
|
||||
{
|
||||
@@ -352,9 +298,7 @@ void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char*
|
||||
m_Data += "\nclosepath fill\n";
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
{
|
||||
double width = 0.0; // outline thickness in mm: no thickness
|
||||
case FOOTPRINT_FMT:
|
||||
m_Data += " (fp_poly\n (pts\n";
|
||||
|
||||
jj = 0;
|
||||
@@ -362,23 +306,20 @@ void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char*
|
||||
for( ii = 0; ii < aPolygon.PointCount(); ii++ )
|
||||
{
|
||||
currpoint = aPolygon.CPoint( ii );
|
||||
strbuf = fmt::format( " (xy {} {})\n",
|
||||
( currpoint.x - offsetX ) / PCB_IU_PER_MM,
|
||||
( currpoint.y - offsetY ) / PCB_IU_PER_MM );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (xy {} {})\n",
|
||||
( currpoint.x - offsetX ) / PCB_IU_PER_MM,
|
||||
( currpoint.y - offsetY ) / PCB_IU_PER_MM );
|
||||
}
|
||||
// No need to close polygon
|
||||
|
||||
m_Data += " )\n\n";
|
||||
strbuf = fmt::format(
|
||||
" (stroke (width {:f}) (type solid)) (fill solid) (layer \"{}\") (uuid {}))\n",
|
||||
width, aBrdLayerName, KIID().AsString().ToStdString().c_str() );
|
||||
m_Data += fmt::format( " (stroke (width {:f}) (type solid)) (fill solid) (layer \"{}\") (uuid {}))\n",
|
||||
0.0,
|
||||
aBrdLayerName.ToStdString().c_str(),
|
||||
KIID().AsString().ToStdString().c_str() );
|
||||
break;
|
||||
|
||||
m_Data += strbuf;
|
||||
}
|
||||
break;
|
||||
|
||||
case KICAD_WKS_LOGO:
|
||||
case DRAWING_SHEET_FMT:
|
||||
m_Data += " (pts";
|
||||
|
||||
// Internal units = micron, file unit = mm
|
||||
@@ -387,10 +328,9 @@ void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char*
|
||||
for( ii = 0; ii < aPolygon.PointCount(); ii++ )
|
||||
{
|
||||
currpoint = aPolygon.CPoint( ii );
|
||||
strbuf = fmt::format( " (xy {:.3f} {:.3f})",
|
||||
( currpoint.x - offsetX ) / PL_IU_PER_MM,
|
||||
( currpoint.y - offsetY ) / PL_IU_PER_MM );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (xy {:.3f} {:.3f})",
|
||||
( currpoint.x - offsetX ) / PL_IU_PER_MM,
|
||||
( currpoint.y - offsetY ) / PL_IU_PER_MM );
|
||||
|
||||
if( jj++ > 4 )
|
||||
{
|
||||
@@ -400,13 +340,13 @@ void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char*
|
||||
}
|
||||
|
||||
// Close polygon
|
||||
strbuf = fmt::format( " (xy {:.3f} {:.3f}) )\n",
|
||||
m_Data += fmt::format( " (xy {:.3f} {:.3f}) )\n",
|
||||
( startpoint.x - offsetX ) / PL_IU_PER_MM,
|
||||
( startpoint.y - offsetY ) / PL_IU_PER_MM );
|
||||
m_Data += strbuf;
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
case SYMBOL_FMT:
|
||||
case SYMBOL_PASTE_FMT:
|
||||
// The polygon outline thickness is fixed here to 0.01 ( 0.0 is the default thickness)
|
||||
#define SCH_LINE_THICKNESS_MM 0.01
|
||||
//snprintf( strbuf, sizeof(strbuf), "P %d 0 0 %d", (int) aPolygon.PointCount() + 1, EE_LINE_THICKNESS );
|
||||
@@ -415,31 +355,27 @@ void BITMAPCONV_INFO::outputOnePolygon( SHAPE_LINE_CHAIN& aPolygon, const char*
|
||||
for( ii = 0; ii < aPolygon.PointCount(); ii++ )
|
||||
{
|
||||
currpoint = aPolygon.CPoint( ii );
|
||||
strbuf = fmt::format( " (xy {:f} {:f})\n",
|
||||
( currpoint.x - offsetX ) / SCH_IU_PER_MM,
|
||||
( currpoint.y - offsetY ) / SCH_IU_PER_MM );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (xy {:f} {:f})\n",
|
||||
( currpoint.x - offsetX ) / SCH_IU_PER_MM,
|
||||
( currpoint.y - offsetY ) / SCH_IU_PER_MM );
|
||||
}
|
||||
|
||||
// Close polygon
|
||||
strbuf = fmt::format( " (xy {:f} {:f})\n",
|
||||
( startpoint.x - offsetX ) / SCH_IU_PER_MM,
|
||||
( startpoint.y - offsetY ) / SCH_IU_PER_MM );
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (xy {:f} {:f})\n",
|
||||
( startpoint.x - offsetX ) / SCH_IU_PER_MM,
|
||||
( startpoint.y - offsetY ) / SCH_IU_PER_MM );
|
||||
m_Data += " )\n"; // end pts
|
||||
|
||||
strbuf = fmt::format(
|
||||
" (stroke (width {:g}) (type default))\n (fill (type outline))\n",
|
||||
SCH_LINE_THICKNESS_MM );
|
||||
|
||||
m_Data += strbuf;
|
||||
m_Data += fmt::format( " (stroke (width {:g}) (type default))\n"
|
||||
" (fill (type outline))\n",
|
||||
SCH_LINE_THICKNESS_MM );
|
||||
m_Data += " )\n"; // end polyline
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
void BITMAPCONV_INFO::createOutputData( const wxString& aLayer )
|
||||
{
|
||||
std::vector <potrace_dpoint_t> cornersBuffer;
|
||||
|
||||
@@ -456,7 +392,7 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
// The layer name has meaning only for .kicad_mod files.
|
||||
// For these files the header creates 2 invisible texts: value and ref
|
||||
// (needed but not useful) on silk screen layer
|
||||
outputDataHeader( getBoardLayerName( MOD_LYR_FSILKS ) );
|
||||
outputDataHeader( "F.SilkS" );
|
||||
|
||||
bool main_outline = true;
|
||||
|
||||
@@ -465,9 +401,10 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
*/
|
||||
potrace_path_t* paths = m_Paths; // the list of paths
|
||||
|
||||
if(!m_Paths)
|
||||
if( !m_Paths )
|
||||
{
|
||||
m_errors += "No shape in black and white image to convert: no outline created\n";
|
||||
m_reporter.Report( _( "No shape in black and white image to convert: no outline created." ),
|
||||
RPT_SEVERITY_ERROR );
|
||||
}
|
||||
|
||||
while( paths != nullptr )
|
||||
@@ -501,10 +438,11 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
|
||||
// build the current main polygon
|
||||
polyset_areas.NewOutline();
|
||||
for( unsigned int i = 0; i < cornersBuffer.size(); i++ )
|
||||
|
||||
for( const potrace_dpoint_s& pt : cornersBuffer )
|
||||
{
|
||||
polyset_areas.Append( int( cornersBuffer[i].x * m_ScaleX ),
|
||||
int( cornersBuffer[i].y * m_ScaleY ) );
|
||||
polyset_areas.Append( int( pt.x * m_ScaleX ),
|
||||
int( pt.y * m_ScaleY ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -512,10 +450,10 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
// Add current hole in polyset_holes
|
||||
polyset_holes.NewOutline();
|
||||
|
||||
for( unsigned int i = 0; i < cornersBuffer.size(); i++ )
|
||||
for( const potrace_dpoint_s& pt : cornersBuffer )
|
||||
{
|
||||
polyset_holes.Append( int( cornersBuffer[i].x * m_ScaleX ),
|
||||
int( cornersBuffer[i].y * m_ScaleY ) );
|
||||
polyset_holes.Append( int( pt.x * m_ScaleX ),
|
||||
int( pt.y * m_ScaleY ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +476,7 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
|
||||
{
|
||||
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
|
||||
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
|
||||
outputOnePolygon( poly, aLayer );
|
||||
}
|
||||
|
||||
polyset_areas.RemoveAllContours();
|
||||
|
||||
@@ -27,71 +27,53 @@
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <potracelib.h>
|
||||
|
||||
// for consistency this enum should conform to the
|
||||
// indices in m_radioBoxFormat from bitmap2cmp_gui.cpp
|
||||
class REPORTER;
|
||||
|
||||
enum OUTPUT_FMT_ID
|
||||
{
|
||||
EESCHEMA_FMT = 0,
|
||||
PCBNEW_KICAD_MOD,
|
||||
SYMBOL_FMT,
|
||||
SYMBOL_PASTE_FMT, // This does not include the header information
|
||||
FOOTPRINT_FMT,
|
||||
POSTSCRIPT_FMT,
|
||||
KICAD_WKS_LOGO,
|
||||
FINAL_FMT = KICAD_WKS_LOGO
|
||||
DRAWING_SHEET_FMT,
|
||||
};
|
||||
|
||||
// for consistency this enum should conform to the
|
||||
// indices in m_cbPcbLayer from bitmap2cmp_gui.cpp
|
||||
enum BMP2CMP_MOD_LAYER
|
||||
{
|
||||
MOD_LYR_FSILKS = 0,
|
||||
MOD_LYR_FSOLDERMASK,
|
||||
MOD_LYR_FAB,
|
||||
MOD_LYR_DRAWINGS,
|
||||
MOD_LYR_COMMENTS,
|
||||
MOD_LYR_ECO1,
|
||||
MOD_LYR_ECO2,
|
||||
MOD_LYR_FINAL = MOD_LYR_ECO2
|
||||
};
|
||||
|
||||
|
||||
/* Helper class to handle useful info to convert a bitmap image to
|
||||
* a polygonal object description
|
||||
*/
|
||||
class BITMAPCONV_INFO
|
||||
{
|
||||
private:
|
||||
enum OUTPUT_FMT_ID m_Format; // File format
|
||||
int m_PixmapWidth;
|
||||
int m_PixmapHeight; // the bitmap size in pixels
|
||||
enum OUTPUT_FMT_ID m_Format; // File format
|
||||
int m_PixmapWidth;
|
||||
int m_PixmapHeight; // the bitmap size in pixels
|
||||
double m_ScaleX;
|
||||
double m_ScaleY; // the conversion scale
|
||||
potrace_path_t* m_Paths; // the list of paths, from potrace (list of lines and bezier curves)
|
||||
std::string m_CmpName; // The string used as cmp/footprint name
|
||||
std::string& m_Data; // the buffer containing the conversion
|
||||
std::string m_errors; // a buffer to return error messages
|
||||
double m_ScaleY; // the conversion scale
|
||||
potrace_path_t* m_Paths; // the list of paths, from potrace (list of lines and bezier curves)
|
||||
std::string m_CmpName; // The string used as cmp/footprint name
|
||||
std::string& m_Data; // the buffer containing the conversion
|
||||
REPORTER& m_reporter;
|
||||
|
||||
public:
|
||||
BITMAPCONV_INFO( std::string& aData );
|
||||
BITMAPCONV_INFO( std::string& aData, REPORTER& aReporter );
|
||||
|
||||
/**
|
||||
* Run the conversion of the bitmap
|
||||
*/
|
||||
int ConvertBitmap( potrace_bitmap_t* aPotrace_bitmap,
|
||||
OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y,
|
||||
BMP2CMP_MOD_LAYER aModLayer );
|
||||
|
||||
std::string& GetErrorMessages() {return m_errors; }
|
||||
int ConvertBitmap( potrace_bitmap_t* aPotrace_bitmap, OUTPUT_FMT_ID aFormat, int aDpi_X,
|
||||
int aDpi_Y, const wxString& aLayer );
|
||||
|
||||
private:
|
||||
/**
|
||||
* Creates the data specified by m_Format
|
||||
*/
|
||||
void createOutputData( BMP2CMP_MOD_LAYER aModLayer = (BMP2CMP_MOD_LAYER) 0 );
|
||||
void createOutputData( const wxString& aBrdLayerName = wxT( "F.SilkS" ) );
|
||||
|
||||
/**
|
||||
* Function outputDataHeader
|
||||
* write to file the header depending on file format
|
||||
*/
|
||||
void outputDataHeader( const char * aBrdLayerName );
|
||||
void outputDataHeader( const wxString& aBrdLayerName );
|
||||
|
||||
/**
|
||||
* Function outputDataEnd
|
||||
@@ -99,20 +81,12 @@ private:
|
||||
*/
|
||||
void outputDataEnd();
|
||||
|
||||
|
||||
/**
|
||||
* @return the board layer name depending on the board layer selected
|
||||
* @param aChoice = the choice (MOD_LYR_FSILKS to MOD_LYR_FINAL)
|
||||
*/
|
||||
const char * getBoardLayerName( BMP2CMP_MOD_LAYER aChoice );
|
||||
|
||||
/**
|
||||
* Function outputOnePolygon
|
||||
* write one polygon to output file.
|
||||
* Polygon coordinates are expected scaled by the polygon extraction function
|
||||
*/
|
||||
void outputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char* aBrdLayerName );
|
||||
|
||||
void outputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const wxString& aBrdLayerName );
|
||||
};
|
||||
|
||||
#endif // BITMAP2COMPONENT_H
|
||||
|
||||
@@ -274,4 +274,10 @@ if( MSVC )
|
||||
string( APPEND WARN_FLAGS_CXX " /wd5267" )
|
||||
# disable "reinterpret_cast used between related classes"
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4946" )
|
||||
# disable throw() is interpreted as declspec(nothrow)
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4290" )
|
||||
# disable non-bool is explicitly cast to bool, forcing value of 0 or 1
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4800" )
|
||||
# disable volatile access of '<expression>' is subject to /volatile:[iso|ms] setting;
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4746" )
|
||||
endif()
|
||||
|
||||
@@ -348,6 +348,8 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/dialog_color_picker_base.cpp
|
||||
dialogs/dialog_configure_paths.cpp
|
||||
dialogs/dialog_configure_paths_base.cpp
|
||||
dialogs/dialog_design_block_properties.cpp
|
||||
dialogs/dialog_design_block_properties_base.cpp
|
||||
dialogs/dialog_display_html_text_base.cpp
|
||||
dialogs/dialog_edit_library_tables.cpp
|
||||
dialogs/dialog_embed_files.cpp
|
||||
@@ -421,6 +423,7 @@ set( COMMON_WIDGET_SRCS
|
||||
widgets/bitmap_toggle.cpp
|
||||
widgets/button_row_panel.cpp
|
||||
widgets/color_swatch.cpp
|
||||
widgets/design_block_pane.cpp
|
||||
widgets/filter_combobox.cpp
|
||||
widgets/font_choice.cpp
|
||||
widgets/footprint_choice.cpp
|
||||
@@ -445,6 +448,7 @@ set( COMMON_WIDGET_SRCS
|
||||
widgets/mathplot.cpp
|
||||
widgets/msgpanel.cpp
|
||||
widgets/paged_dialog.cpp
|
||||
widgets/panel_design_block_chooser.cpp
|
||||
widgets/properties_panel.cpp
|
||||
widgets/search_pane.cpp
|
||||
widgets/search_pane_base.cpp
|
||||
@@ -607,6 +611,7 @@ set( COMMON_SRCS
|
||||
lib_table_grid_tricks.cpp
|
||||
lib_tree_model.cpp
|
||||
lib_tree_model_adapter.cpp
|
||||
design_block_tree_model_adapter.cpp
|
||||
marker_base.cpp
|
||||
origin_transforms.cpp
|
||||
printout.cpp
|
||||
@@ -640,6 +645,7 @@ set( COMMON_SRCS
|
||||
tool/construction_manager.cpp
|
||||
tool/common_tools.cpp
|
||||
tool/conditional_menu.cpp
|
||||
tool/design_block_control.cpp
|
||||
tool/edit_constraints.cpp
|
||||
tool/edit_points.cpp
|
||||
tool/editor_conditions.cpp
|
||||
|
||||
@@ -260,7 +260,7 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
m_EnableLibDir = false;
|
||||
|
||||
m_EnableEeschemaPrintCairo = true;
|
||||
m_EnableEeschemaExportClipboardCairo = false;
|
||||
m_EnableEeschemaExportClipboardCairo = true;
|
||||
|
||||
m_3DRT_BevelHeight_um = 30;
|
||||
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
|
||||
@@ -292,7 +292,7 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
m_ResolveTextRecursionDepth = 3;
|
||||
|
||||
m_EnableExtensionSnaps = true;
|
||||
m_ExtensionSnapTimeoutMs = 500;
|
||||
m_ExtensionSnapTimeoutMs = 400;
|
||||
m_ExtensionSnapActivateOnHover = true;
|
||||
m_EnableSnapAnchorsDebug = false;
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ void API_PLUGIN_MANAGER::InvokeAction( const wxString& aIdentifier )
|
||||
if( !aError.IsEmpty() )
|
||||
wxLogTrace( traceApi, wxString::Format( "Manager: action stderr: %s", aError ) );
|
||||
},
|
||||
&env );
|
||||
&env, true );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
|
||||
#include <api/common/envelope.pb.h>
|
||||
|
||||
#ifdef __UNIX__
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
using kiapi::common::ApiRequest, kiapi::common::ApiResponse, kiapi::common::ApiStatusCode;
|
||||
|
||||
|
||||
@@ -63,6 +67,7 @@ KICAD_API_SERVER::KICAD_API_SERVER() :
|
||||
|
||||
KICAD_API_SERVER::~KICAD_API_SERVER()
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +92,31 @@ void KICAD_API_SERVER::Start()
|
||||
return;
|
||||
}
|
||||
|
||||
if( socket.FileExists() )
|
||||
{
|
||||
socket.SetFullName( wxString::Format( wxS( "api-%ul.sock" ), ::wxGetProcessId() ) );
|
||||
#ifndef __WINDOWS__
|
||||
// We use non-abstract sockets because macOS and some other non-Linux platforms don't support
|
||||
// abstract sockets, which means there might be an old socket to unlink. In order to try to
|
||||
// recover this, we lock a file (which will be unlocked on process exit) and if we get the lock,
|
||||
// we know the old socket is orphaned and can be removed.
|
||||
wxFileName lockFilePath( socket.GetPath(), wxS( "api.lock" ) );
|
||||
|
||||
if( socket.FileExists() )
|
||||
int lockFile = open( lockFilePath.GetFullPath().c_str(), O_RDONLY | O_CREAT, 0600 );
|
||||
|
||||
if( lockFile >= 0 && flock( lockFile, LOCK_EX | LOCK_NB ) == 0 )
|
||||
{
|
||||
if( socket.Exists() )
|
||||
{
|
||||
wxLogTrace( traceApi, wxString::Format( "Server: cleaning up stale socket path %s",
|
||||
socket.GetFullPath() ) );
|
||||
wxRemoveFile( socket.GetFullPath() );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if( socket.Exists() )
|
||||
{
|
||||
socket.SetFullName( wxString::Format( wxS( "api-%lu.sock" ), ::wxGetProcessId() ) );
|
||||
|
||||
if( socket.Exists() )
|
||||
{
|
||||
wxLogTrace( traceApi, wxString::Format( "Server: PID socket path %s already exists!",
|
||||
socket.GetFullPath() ) );
|
||||
@@ -210,6 +235,8 @@ void KICAD_API_SERVER::handleApiEvent( wxCommandEvent& aEvent )
|
||||
|
||||
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
|
||||
log( "Response (ERROR): " + error.Utf8DebugString() );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
API_RESULT result;
|
||||
|
||||
@@ -183,7 +183,7 @@ BACKGROUND_JOB_REPORTER::BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMoni
|
||||
|
||||
bool BACKGROUND_JOB_REPORTER::updateUI()
|
||||
{
|
||||
return true;
|
||||
return !m_cancelled;
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,11 @@ void BACKGROUND_JOBS_MONITOR::Remove( std::shared_ptr<BACKGROUND_JOB> aJob )
|
||||
return job == aJob;
|
||||
} ) );
|
||||
|
||||
if( m_jobs.size() == 0 )
|
||||
if( m_jobs.size() > 0 )
|
||||
{
|
||||
jobUpdated( m_jobs.front() );
|
||||
}
|
||||
else
|
||||
{
|
||||
for( KISTATUSBAR* statusBar : m_statusBars )
|
||||
{
|
||||
|
||||
+2
-2
@@ -107,9 +107,9 @@ wxBitmap KiBitmap( BITMAPS aBitmap, int aHeightTag )
|
||||
}
|
||||
|
||||
|
||||
wxBitmapBundle KiBitmapBundle( BITMAPS aBitmap )
|
||||
wxBitmapBundle KiBitmapBundle( BITMAPS aBitmap, int aMinHeight )
|
||||
{
|
||||
return GetBitmapStore()->GetBitmapBundle( aBitmap );
|
||||
return GetBitmapStore()->GetBitmapBundle( aBitmap, aMinHeight );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ bool BITMAP_BASE::LoadLegacyData( LINE_READER& aLine, wxString& aErrorMsg )
|
||||
m_image->LoadFile( istream, wxBITMAP_TYPE_ANY );
|
||||
m_bitmap = new wxBitmap( *m_image );
|
||||
m_originalImage = new wxImage( *m_image );
|
||||
UpdateImageDataBuffer();
|
||||
updateImageDataBuffer();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ void BITMAP_BASE::Mirror( FLIP_DIRECTION aFlipDirection )
|
||||
m_isMirroredX = !m_isMirroredX;
|
||||
|
||||
rebuildBitmap( false );
|
||||
UpdateImageDataBuffer();
|
||||
updateImageDataBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ void BITMAP_BASE::Rotate( bool aRotateCCW )
|
||||
|
||||
m_rotation += ( aRotateCCW ? ANGLE_90 : -ANGLE_90 );
|
||||
rebuildBitmap( false );
|
||||
UpdateImageDataBuffer();
|
||||
updateImageDataBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ void BITMAP_BASE::ConvertToGreyscale()
|
||||
*m_image = m_image->ConvertToGreyscale();
|
||||
*m_originalImage = m_originalImage->ConvertToGreyscale();
|
||||
rebuildBitmap();
|
||||
UpdateImageDataBuffer();
|
||||
updateImageDataBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ void BITMAP_BASE::PlotImage( PLOTTER* aPlotter, const VECTOR2I& aPos,
|
||||
}
|
||||
|
||||
|
||||
void BITMAP_BASE::UpdateImageDataBuffer()
|
||||
void BITMAP_BASE::updateImageDataBuffer()
|
||||
{
|
||||
if( m_image )
|
||||
{
|
||||
|
||||
+171
-11
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright 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
|
||||
@@ -423,6 +423,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -558,6 +559,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -657,6 +660,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -667,11 +671,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -697,6 +701,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -736,6 +741,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -843,6 +859,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -978,6 +995,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1077,6 +1096,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1087,11 +1107,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1117,6 +1137,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1156,6 +1177,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1263,6 +1295,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1398,6 +1431,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1497,6 +1532,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1507,11 +1543,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1537,6 +1573,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1576,6 +1613,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1683,6 +1731,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -1818,6 +1867,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -1917,6 +1968,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -1927,11 +1979,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -1957,6 +2009,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -1996,6 +2049,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -2103,6 +2167,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2238,6 +2303,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2337,6 +2404,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2347,11 +2415,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2377,6 +2445,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2416,6 +2485,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2523,6 +2603,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2658,6 +2739,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2757,6 +2840,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2767,11 +2851,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2797,6 +2881,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2836,6 +2921,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2943,6 +3039,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3078,6 +3175,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3177,6 +3276,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3187,11 +3287,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3217,6 +3317,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3256,6 +3357,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3363,6 +3475,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3498,6 +3611,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3597,6 +3712,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3607,11 +3723,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3637,6 +3753,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3676,6 +3793,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3783,6 +3911,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -3918,6 +4047,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4017,6 +4148,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4027,11 +4159,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4057,6 +4189,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4096,6 +4229,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4203,6 +4347,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::axis3d_right].emplace_back( BITMAPS::axis3d_right, wxT( "axis3d_right_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d_top].emplace_back( BITMAPS::axis3d_top, wxT( "axis3d_top_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::axis3d].emplace_back( BITMAPS::axis3d, wxT( "axis3d_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::body_style].emplace_back( BITMAPS::body_style, wxT( "body_style_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::break_line].emplace_back( BITMAPS::break_line, wxT( "break_line_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bug].emplace_back( BITMAPS::bug, wxT( "bug_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::bus_definition_tool].emplace_back( BITMAPS::bus_definition_tool, wxT( "bus_definition_tool_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4338,6 +4483,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::info].emplace_back( BITMAPS::info, wxT( "info_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::insert_module_board].emplace_back( BITMAPS::insert_module_board, wxT( "insert_module_board_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::intersect_polygons].emplace_back( BITMAPS::intersect_polygons, wxT( "intersect_polygons_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4437,6 +4584,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_clone].emplace_back( BITMAPS::project_clone, wxT( "project_clone_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_close].emplace_back( BITMAPS::project_close, wxT( "project_close_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::project_kicad].emplace_back( BITMAPS::project_kicad, wxT( "project_kicad_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ps_diff_pair].emplace_back( BITMAPS::ps_diff_pair, wxT( "ps_diff_pair_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4447,11 +4595,11 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::push_pad_settings].emplace_back( BITMAPS::push_pad_settings, wxT( "push_pad_settings_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::puzzle_piece].emplace_back( BITMAPS::puzzle_piece, wxT( "puzzle_piece_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::py_script].emplace_back( BITMAPS::py_script, wxT( "py_script_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::ray_tracing].emplace_back( BITMAPS::ray_tracing, wxT( "ray_tracing_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::recent].emplace_back( BITMAPS::recent, wxT( "recent_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::redo].emplace_back( BITMAPS::redo, wxT( "redo_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::refresh].emplace_back( BITMAPS::refresh, wxT( "refresh_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::reload].emplace_back( BITMAPS::reload, wxT( "reload_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::render_mode].emplace_back( BITMAPS::render_mode, wxT( "render_mode_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::rescue].emplace_back( BITMAPS::rescue, wxT( "rescue_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::restore_from_file].emplace_back( BITMAPS::restore_from_file, wxT( "restore_from_file_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::right].emplace_back( BITMAPS::right, wxT( "right_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4477,6 +4625,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::shape_3d].emplace_back( BITMAPS::shape_3d, wxT( "shape_3d_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::shape_3d_back].emplace_back( BITMAPS::shape_3d_back, wxT( "shape_3d_back_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sheetset].emplace_back( BITMAPS::sheetset, wxT( "sheetset_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::show_board_body].emplace_back( BITMAPS::show_board_body, wxT( "show_board_body_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::simulator].emplace_back( BITMAPS::simulator, wxT( "simulator_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_add_plot].emplace_back( BITMAPS::sim_add_plot, wxT( "sim_add_plot_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::sim_command].emplace_back( BITMAPS::sim_command, wxT( "sim_command_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4516,6 +4665,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::swap].emplace_back( BITMAPS::swap, wxT( "swap_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::swap_layer].emplace_back( BITMAPS::swap_layer, wxT( "swap_layer_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::switch_corner_rounding_shape].emplace_back( BITMAPS::switch_corner_rounding_shape, wxT( "switch_corner_rounding_shape_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table].emplace_back( BITMAPS::table, wxT( "table_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_after].emplace_back( BITMAPS::table_add_column_after, wxT( "table_add_column_after_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_column_before].emplace_back( BITMAPS::table_add_column_before, wxT( "table_add_column_before_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_above].emplace_back( BITMAPS::table_add_row_above, wxT( "table_add_row_above_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_add_row_below].emplace_back( BITMAPS::table_add_row_below, wxT( "table_add_row_below_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_column].emplace_back( BITMAPS::table_delete_column, wxT( "table_delete_column_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_delete_row].emplace_back( BITMAPS::table_delete_row, wxT( "table_delete_row_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_edit].emplace_back( BITMAPS::table_edit, wxT( "table_edit_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select].emplace_back( BITMAPS::table_select, wxT( "table_select_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_column].emplace_back( BITMAPS::table_select_column, wxT( "table_select_column_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::table_select_row].emplace_back( BITMAPS::table_select_row, wxT( "table_select_row_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text].emplace_back( BITMAPS::text, wxT( "text_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_sketch].emplace_back( BITMAPS::text_sketch, wxT( "text_sketch_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::thermal_spokes].emplace_back( BITMAPS::thermal_spokes, wxT( "thermal_spokes_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
|
||||
@@ -121,7 +121,7 @@ wxBitmap BITMAP_STORE::GetBitmap( BITMAPS aBitmapId, int aHeight )
|
||||
}
|
||||
|
||||
|
||||
wxBitmapBundle BITMAP_STORE::GetBitmapBundle( BITMAPS aBitmapId )
|
||||
wxBitmapBundle BITMAP_STORE::GetBitmapBundle( BITMAPS aBitmapId, int aMinHeight )
|
||||
{
|
||||
wxVector<wxBitmap> bmps;
|
||||
|
||||
@@ -130,6 +130,9 @@ wxBitmapBundle BITMAP_STORE::GetBitmapBundle( BITMAPS aBitmapId )
|
||||
if( info.theme != m_theme )
|
||||
continue;
|
||||
|
||||
if( aMinHeight > 0 && info.height < aMinHeight )
|
||||
continue;
|
||||
|
||||
bmps.push_back( wxBitmap( getImage( info.id, info.height ) ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -175,8 +175,14 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
gal->SetLookAtPoint( drawingAreaBBox.Centre() );
|
||||
gal->SetZoomFactor( m_settings.m_scale );
|
||||
gal->SetClearColor( dstSettings->GetBackgroundColor() );
|
||||
|
||||
// Clearing the screen for the background color needs the screen set to the page size
|
||||
// in pixels. This can ?somehow? prevent some but not all foreground elements from being printed
|
||||
// TODO: figure out what's going on here and fix printing. See also sch_printout
|
||||
VECTOR2I size = gal->GetScreenPixelSize();
|
||||
gal->ResizeScreen( pageSizePx.GetWidth(),pageSizePx.GetHeight() );
|
||||
gal->ClearScreen();
|
||||
gal->ResizeScreen( size.x, size.y );
|
||||
|
||||
if( m_gerbviewPrint )
|
||||
// Mandatory in Gerbview to use the same order for printing as for screen redraw
|
||||
|
||||
+13
-3
@@ -21,6 +21,10 @@
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DESIGN_BLOCK_H
|
||||
#define DESIGN_BLOCK_H
|
||||
|
||||
#include <kicommon.h>
|
||||
#include <lib_id.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
@@ -41,6 +45,9 @@ public:
|
||||
const wxString& GetSchematicFile() const { return m_schematicFile; }
|
||||
void SetSchematicFile( const wxString& aFile ) { m_schematicFile = aFile; }
|
||||
|
||||
const wxString& GetBoardFile() const { return m_boardFile; }
|
||||
void SetBoardFile( const wxString& aFile ) { m_boardFile = aFile; }
|
||||
|
||||
void SetFields( nlohmann::ordered_map<wxString, wxString>& aFields )
|
||||
{
|
||||
m_fields = std::move( aFields );
|
||||
@@ -55,9 +62,12 @@ public:
|
||||
|
||||
private:
|
||||
LIB_ID m_lib_id;
|
||||
wxString m_schematicFile; ///< File name and path for schematic symbol.
|
||||
wxString m_libDescription; ///< File name and path for documentation file.
|
||||
wxString m_keywords; ///< Search keywords to find footprint in library.
|
||||
wxString m_schematicFile; // File name and path for schematic file.
|
||||
wxString m_boardFile; // File name and path for board file
|
||||
wxString m_libDescription; // File name and path for documentation file.
|
||||
wxString m_keywords; // Search keywords to find design block in library.
|
||||
|
||||
nlohmann::ordered_map<wxString, wxString> m_fields;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+12
-18
@@ -21,10 +21,6 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* @file design_block_info.h
|
||||
*/
|
||||
|
||||
#ifndef DESIGN_BLOCK_INFO_H_
|
||||
#define DESIGN_BLOCK_INFO_H_
|
||||
|
||||
@@ -119,15 +115,16 @@ protected:
|
||||
/// lazily load stuff not filled in by constructor. This may throw IO_ERRORS.
|
||||
virtual void load(){};
|
||||
|
||||
DESIGN_BLOCK_LIST* m_owner; ///< provides access to DESIGN_BLOCK_LIB_TABLE
|
||||
protected:
|
||||
DESIGN_BLOCK_LIST* m_owner; ///< provides access to DESIGN_BLOCK_LIB_TABLE
|
||||
|
||||
bool m_loaded;
|
||||
bool m_loaded;
|
||||
|
||||
wxString m_nickname; ///< library as known in DESIGN_BLOCK_LIB_TABLE
|
||||
wxString m_dbname; ///< Module name.
|
||||
int m_num; ///< Order number in the display list.
|
||||
wxString m_doc; ///< Design block description.
|
||||
wxString m_keywords; ///< Design block keywords.
|
||||
wxString m_nickname; ///< library as known in DESIGN_BLOCK_LIB_TABLE
|
||||
wxString m_dbname; ///< Module name.
|
||||
int m_num; ///< Order number in the display list.
|
||||
wxString m_doc; ///< Design block description.
|
||||
wxString m_keywords; ///< Design block keywords.
|
||||
};
|
||||
|
||||
|
||||
@@ -141,9 +138,6 @@ protected:
|
||||
class KICOMMON_API DESIGN_BLOCK_LIST
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::unique_ptr<DESIGN_BLOCK_INFO>> DBILIST;
|
||||
typedef SYNC_QUEUE<std::unique_ptr<IO_ERROR>> ERRLIST;
|
||||
|
||||
DESIGN_BLOCK_LIST() : m_lib_table( nullptr ) {}
|
||||
|
||||
virtual ~DESIGN_BLOCK_LIST() {}
|
||||
@@ -154,7 +148,7 @@ public:
|
||||
unsigned GetCount() const { return m_list.size(); }
|
||||
|
||||
/// Was forced to add this by modview_frame.cpp
|
||||
const DBILIST& GetList() const { return m_list; }
|
||||
const std::vector<std::unique_ptr<DESIGN_BLOCK_INFO>>& GetList() const { return m_list; }
|
||||
|
||||
/**
|
||||
* @return Clears the design block info cache
|
||||
@@ -209,10 +203,10 @@ public:
|
||||
DESIGN_BLOCK_LIB_TABLE* GetTable() const { return m_lib_table; }
|
||||
|
||||
protected:
|
||||
DESIGN_BLOCK_LIB_TABLE* m_lib_table = nullptr; ///< no ownership
|
||||
DESIGN_BLOCK_LIB_TABLE* m_lib_table = nullptr; ///< no ownership
|
||||
|
||||
DBILIST m_list;
|
||||
ERRLIST m_errors; ///< some can be PARSE_ERRORs also
|
||||
std::vector<std::unique_ptr<DESIGN_BLOCK_INFO>> m_list;
|
||||
SYNC_QUEUE<std::unique_ptr<IO_ERROR>> m_errors; ///< some can be PARSE_ERRORs also
|
||||
};
|
||||
|
||||
#endif // DESIGN_BLOCK_INFO_H_
|
||||
|
||||
@@ -110,49 +110,36 @@ bool DESIGN_BLOCK_LIST_IMPL::ReadDesignBlockFiles( DESIGN_BLOCK_LIB_TABLE* aTabl
|
||||
|
||||
m_progress_reporter = aProgressReporter;
|
||||
|
||||
if( m_progress_reporter )
|
||||
{
|
||||
m_progress_reporter->SetMaxProgress( m_queue_in.size() );
|
||||
m_progress_reporter->Report( _( "Fetching design_block libraries..." ) );
|
||||
}
|
||||
|
||||
m_cancelled = false;
|
||||
m_lib_table = aTable;
|
||||
|
||||
// Clear data before reading files
|
||||
m_errors.clear();
|
||||
m_list.clear();
|
||||
m_queue_in.clear();
|
||||
m_queue_out.clear();
|
||||
m_queue.clear();
|
||||
|
||||
if( aNickname )
|
||||
{
|
||||
m_queue_in.push( *aNickname );
|
||||
m_queue.push( *aNickname );
|
||||
}
|
||||
else
|
||||
{
|
||||
for( const wxString& nickname : aTable->GetLogicalLibs() )
|
||||
m_queue_in.push( nickname );
|
||||
m_queue.push( nickname );
|
||||
}
|
||||
|
||||
|
||||
loadLibs();
|
||||
|
||||
if( !m_cancelled )
|
||||
if( m_progress_reporter )
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
{
|
||||
m_progress_reporter->SetMaxProgress( m_queue_out.size() );
|
||||
m_progress_reporter->AdvancePhase();
|
||||
m_progress_reporter->Report( _( "Loading design_blocks..." ) );
|
||||
}
|
||||
|
||||
loadDesignBlocks();
|
||||
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase();
|
||||
m_progress_reporter->SetMaxProgress( (int) m_queue.size() );
|
||||
m_progress_reporter->Report( _( "Loading design_blocks..." ) );
|
||||
}
|
||||
|
||||
loadDesignBlocks();
|
||||
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase();
|
||||
|
||||
if( m_cancelled )
|
||||
m_list_timestamp = 0; // God knows what we got before we were canceled
|
||||
else
|
||||
@@ -162,53 +149,6 @@ bool DESIGN_BLOCK_LIST_IMPL::ReadDesignBlockFiles( DESIGN_BLOCK_LIB_TABLE* aTabl
|
||||
}
|
||||
|
||||
|
||||
void DESIGN_BLOCK_LIST_IMPL::loadLibs()
|
||||
{
|
||||
thread_pool& tp = GetKiCadThreadPool();
|
||||
size_t num_returns = m_queue_in.size();
|
||||
std::vector<std::future<size_t>> returns( num_returns );
|
||||
|
||||
auto loader_job =
|
||||
[this]() -> size_t
|
||||
{
|
||||
wxString nickname;
|
||||
size_t retval = 0;
|
||||
|
||||
if( !m_cancelled && m_queue_in.pop( nickname ) )
|
||||
{
|
||||
if( CatchErrors( [this, &nickname]()
|
||||
{
|
||||
m_lib_table->PrefetchLib( nickname );
|
||||
m_queue_out.push( nickname );
|
||||
} ) && m_progress_reporter )
|
||||
{
|
||||
m_progress_reporter->AdvanceProgress();
|
||||
}
|
||||
|
||||
++retval;
|
||||
}
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
for( size_t ii = 0; ii < num_returns; ++ii )
|
||||
returns[ii] = tp.submit( loader_job );
|
||||
|
||||
for( const std::future<size_t>& ret : returns )
|
||||
{
|
||||
std::future_status status = ret.wait_for( std::chrono::milliseconds( 250 ) );
|
||||
|
||||
while( status != std::future_status::ready )
|
||||
{
|
||||
if( m_progress_reporter && !m_progress_reporter->KeepRefreshing() )
|
||||
m_cancelled = true;
|
||||
|
||||
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
|
||||
{
|
||||
LOCALE_IO toggle_locale;
|
||||
@@ -221,16 +161,17 @@ void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
|
||||
// TODO: blast LOCALE_IO into the sun
|
||||
|
||||
SYNC_QUEUE<std::unique_ptr<DESIGN_BLOCK_INFO>> queue_parsed;
|
||||
thread_pool& tp = GetKiCadThreadPool();
|
||||
size_t num_elements = m_queue_out.size();
|
||||
std::vector<std::future<size_t>> returns( num_elements );
|
||||
|
||||
thread_pool& tp = GetKiCadThreadPool();
|
||||
size_t num_elements = m_queue.size();
|
||||
std::vector<std::future<size_t>> returns( num_elements );
|
||||
|
||||
auto db_thread =
|
||||
[ this, &queue_parsed ]() -> size_t
|
||||
{
|
||||
wxString nickname;
|
||||
|
||||
if( m_cancelled || !m_queue_out.pop( nickname ) )
|
||||
if( m_cancelled || !m_queue.pop( nickname ) )
|
||||
return 0;
|
||||
|
||||
wxArrayString dbnames;
|
||||
@@ -291,6 +232,8 @@ void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
|
||||
|
||||
|
||||
DESIGN_BLOCK_LIST_IMPL::DESIGN_BLOCK_LIST_IMPL() :
|
||||
m_list_timestamp( 0 ), m_progress_reporter( nullptr ), m_cancelled( false )
|
||||
m_list_timestamp( 0 ),
|
||||
m_progress_reporter( nullptr ),
|
||||
m_cancelled( false )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ public:
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
|
||||
protected:
|
||||
void loadLibs();
|
||||
void loadDesignBlocks();
|
||||
|
||||
private:
|
||||
@@ -98,8 +97,8 @@ private:
|
||||
*/
|
||||
bool CatchErrors( const std::function<void()>& aFunc );
|
||||
|
||||
SYNC_QUEUE<wxString> m_queue_in;
|
||||
SYNC_QUEUE<wxString> m_queue_out;
|
||||
private:
|
||||
SYNC_QUEUE<wxString> m_queue;
|
||||
long long m_list_timestamp;
|
||||
PROGRESS_REPORTER* m_progress_reporter;
|
||||
std::atomic_bool m_cancelled;
|
||||
|
||||
+73
-18
@@ -265,7 +265,10 @@ void DESIGN_BLOCK_IO::DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
|
||||
wxDir dir( aLibraryPath );
|
||||
|
||||
if( !dir.IsOpened() )
|
||||
return;
|
||||
{
|
||||
THROW_IO_ERROR(
|
||||
wxString::Format( _( "Design block '%s' does not exist." ), aLibraryPath ) );
|
||||
}
|
||||
|
||||
wxString dirname;
|
||||
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockPathExtension );
|
||||
@@ -287,17 +290,23 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
+ FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
|
||||
wxString dbSchPath = dbPath + aDesignBlockName + wxT( "." )
|
||||
+ FILEEXT::KiCadSchematicFileExtension;
|
||||
wxString dbPcbPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::KiCadPcbFileExtension;
|
||||
wxString dbMetadataPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::JsonFileExtension;
|
||||
|
||||
if( !wxFileExists( dbSchPath ) )
|
||||
return nullptr;
|
||||
if( !wxDir::Exists( dbPath ) )
|
||||
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), dbPath ) );
|
||||
|
||||
DESIGN_BLOCK* newDB = new DESIGN_BLOCK();
|
||||
|
||||
// Library name needs to be empty for when we fill it in with the correct library nickname
|
||||
// one layer above
|
||||
newDB->SetLibId( LIB_ID( wxEmptyString, aDesignBlockName ) );
|
||||
newDB->SetSchematicFile( dbSchPath );
|
||||
|
||||
if( wxFileExists( dbSchPath ) )
|
||||
newDB->SetSchematicFile( dbSchPath );
|
||||
|
||||
if( wxFileExists( dbPcbPath ) )
|
||||
newDB->SetBoardFile( dbPcbPath );
|
||||
|
||||
// Parse the JSON file if it exists
|
||||
if( wxFileExists( dbMetadataPath ) )
|
||||
@@ -333,16 +342,27 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
delete newDB;
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "Design block metadata file '%s' could not be read." ), dbMetadataPath ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return newDB;
|
||||
}
|
||||
|
||||
|
||||
bool DESIGN_BLOCK_IO::DesignBlockExists( const wxString& aLibraryPath,
|
||||
const wxString& aDesignBlockName,
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
{
|
||||
wxString dbPath = aLibraryPath + wxFileName::GetPathSeparator() + aDesignBlockName + wxT( "." )
|
||||
+ FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
|
||||
|
||||
return wxDir::Exists( dbPath );
|
||||
}
|
||||
|
||||
|
||||
void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibraryPath,
|
||||
const DESIGN_BLOCK* aDesignBlock,
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
@@ -353,12 +373,24 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
|
||||
THROW_IO_ERROR( _( "Design block does not have a valid library ID." ) );
|
||||
}
|
||||
|
||||
if( !wxFileExists( aDesignBlock->GetSchematicFile() ) )
|
||||
if( aDesignBlock->GetSchematicFile().IsEmpty() && aDesignBlock->GetBoardFile().IsEmpty() )
|
||||
{
|
||||
THROW_IO_ERROR( _( "Design block does not have a schematic or board file." ) );
|
||||
}
|
||||
|
||||
if( !aDesignBlock->GetSchematicFile().IsEmpty()
|
||||
&& !wxFileExists( aDesignBlock->GetSchematicFile() ) )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Schematic source file '%s' does not exist." ),
|
||||
aDesignBlock->GetSchematicFile() ) );
|
||||
}
|
||||
|
||||
if( !aDesignBlock->GetBoardFile().IsEmpty() && !wxFileExists( aDesignBlock->GetBoardFile() ) )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Board source file '%s' does not exist." ),
|
||||
aDesignBlock->GetBoardFile() ) );
|
||||
}
|
||||
|
||||
// Create the design block folder
|
||||
wxFileName dbFolder( aLibraryPath + wxFileName::GetPathSeparator()
|
||||
+ aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
|
||||
@@ -374,23 +406,46 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
|
||||
}
|
||||
}
|
||||
|
||||
// The new schematic file name is based on the design block name, not the source sheet name
|
||||
wxString dbSchematicFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
|
||||
+ wxT( "." ) + FILEEXT::KiCadSchematicFileExtension;
|
||||
|
||||
// If the source and destination files are the same, then we don't need to copy the file
|
||||
// as we are just updating the metadata
|
||||
if( aDesignBlock->GetSchematicFile() != dbSchematicFile )
|
||||
if( !aDesignBlock->GetSchematicFile().IsEmpty() )
|
||||
{
|
||||
// Copy the source sheet file to the design block folder, under the design block name
|
||||
if( !wxCopyFile( aDesignBlock->GetSchematicFile(), dbSchematicFile ) )
|
||||
// The new schematic file name is based on the design block name, not the source sheet name
|
||||
wxString dbSchematicFile = dbFolder.GetFullPath()
|
||||
+ aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
|
||||
+ FILEEXT::KiCadSchematicFileExtension;
|
||||
|
||||
// If the source and destination files are the same, then we don't need to copy the file
|
||||
// as we are just updating the metadata
|
||||
if( aDesignBlock->GetSchematicFile() != dbSchematicFile )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "Schematic file '%s' could not be saved as design block at '%s'." ),
|
||||
aDesignBlock->GetSchematicFile().GetData(), dbSchematicFile ) );
|
||||
// Copy the source sheet file to the design block folder, under the design block name
|
||||
if( !wxCopyFile( aDesignBlock->GetSchematicFile(), dbSchematicFile ) )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "Schematic file '%s' could not be saved as design block at '%s'." ),
|
||||
aDesignBlock->GetSchematicFile().GetData(), dbSchematicFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !aDesignBlock->GetBoardFile().IsEmpty() )
|
||||
{
|
||||
// The new Board file name is based on the design block name, not the source sheet name
|
||||
wxString dbBoardFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
|
||||
+ wxT( "." ) + FILEEXT::KiCadPcbFileExtension;
|
||||
|
||||
// If the source and destination files are the same, then we don't need to copy the file
|
||||
// as we are just updating the metadata
|
||||
if( aDesignBlock->GetBoardFile() != dbBoardFile )
|
||||
{
|
||||
// Copy the source sheet file to the design block folder, under the design block name
|
||||
if( !wxCopyFile( aDesignBlock->GetBoardFile(), dbBoardFile ) )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "Board file '%s' could not be saved as design block at '%s'." ),
|
||||
aDesignBlock->GetBoardFile().GetData(), dbBoardFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxString dbMetadataFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
|
||||
+ wxT( "." ) + FILEEXT::JsonFileExtension;
|
||||
|
||||
@@ -76,10 +76,7 @@ public:
|
||||
}
|
||||
|
||||
bool DesignBlockExists( const wxString& aLibraryPath, const wxString& aDesignBlockName,
|
||||
const std::map<std::string, UTF8>* aProperties = nullptr )
|
||||
{
|
||||
return DesignBlockLoad( aLibraryPath, aDesignBlockName, true, aProperties ) != nullptr;
|
||||
}
|
||||
const std::map<std::string, UTF8>* aProperties = nullptr );
|
||||
|
||||
DESIGN_BLOCK* ImportDesignBlock( const wxString& aDesignBlockPath,
|
||||
wxString& aDesignBlockNameOut,
|
||||
@@ -106,11 +103,6 @@ public:
|
||||
|
||||
void DesignBlockDelete( const wxString& aLibraryPath, const wxString& aDesignBlockName,
|
||||
const std::map<std::string, UTF8>* aProperties = nullptr );
|
||||
|
||||
virtual void PrefetchLib( const wxString& aLibraryPath,
|
||||
const std::map<std::string, UTF8>* aProperties = nullptr )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,6 +73,23 @@ void DESIGN_BLOCK_LIB_TABLE_ROW::SetType( const wxString& aType )
|
||||
}
|
||||
|
||||
|
||||
bool DESIGN_BLOCK_LIB_TABLE_ROW::Refresh()
|
||||
{
|
||||
if( !plugin )
|
||||
{
|
||||
wxArrayString dummyList;
|
||||
|
||||
plugin.reset( DESIGN_BLOCK_IO_MGR::FindPlugin( type ) );
|
||||
SetLoaded( false );
|
||||
plugin->DesignBlockEnumerate( dummyList, GetFullURI( true ), true, GetProperties() );
|
||||
SetLoaded( true );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
DESIGN_BLOCK_LIB_TABLE::DESIGN_BLOCK_LIB_TABLE( DESIGN_BLOCK_LIB_TABLE* aFallBackTable ) :
|
||||
LIB_TABLE( aFallBackTable )
|
||||
{
|
||||
@@ -322,14 +339,6 @@ void DESIGN_BLOCK_LIB_TABLE::DesignBlockEnumerate( wxArrayString& aDesignBlockN
|
||||
}
|
||||
|
||||
|
||||
void DESIGN_BLOCK_LIB_TABLE::PrefetchLib( const wxString& aNickname )
|
||||
{
|
||||
const DESIGN_BLOCK_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||
wxASSERT( row->plugin );
|
||||
row->plugin->PrefetchLib( row->GetFullURI( true ), row->GetProperties() );
|
||||
}
|
||||
|
||||
|
||||
const DESIGN_BLOCK_LIB_TABLE_ROW* DESIGN_BLOCK_LIB_TABLE::FindRow( const wxString& aNickname,
|
||||
bool aCheckIfEnabled )
|
||||
{
|
||||
|
||||
+19
-9
@@ -25,29 +25,34 @@
|
||||
#include <project/project_file.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/tokenzr.h>
|
||||
#include <settings/app_settings.h>
|
||||
#include <string_utils.h>
|
||||
#include <eda_pattern_match.h>
|
||||
#include <design_block.h>
|
||||
#include <design_block_lib_table.h>
|
||||
#include <design_block_info.h>
|
||||
#include <design_block_tree_model_adapter.h>
|
||||
#include <tools/sch_design_block_control.h>
|
||||
|
||||
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>
|
||||
DESIGN_BLOCK_TREE_MODEL_ADAPTER::Create( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs )
|
||||
DESIGN_BLOCK_TREE_MODEL_ADAPTER::Create( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs,
|
||||
APP_SETTINGS_BASE::LIB_TREE& aSettings,
|
||||
TOOL_INTERACTIVE* aContextMenuTool )
|
||||
{
|
||||
auto* adapter = new DESIGN_BLOCK_TREE_MODEL_ADAPTER( aParent, aLibs );
|
||||
adapter->m_frame = aParent;
|
||||
auto* adapter = new DESIGN_BLOCK_TREE_MODEL_ADAPTER( aParent, aLibs, aSettings, aContextMenuTool );
|
||||
return wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>( adapter );
|
||||
}
|
||||
|
||||
|
||||
DESIGN_BLOCK_TREE_MODEL_ADAPTER::DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent,
|
||||
LIB_TABLE* aLibs ) :
|
||||
LIB_TREE_MODEL_ADAPTER( aParent, wxT( "pinned_design_block_libs" ),
|
||||
Kiface().KifaceSettings() ),
|
||||
LIB_TABLE* aLibs,
|
||||
APP_SETTINGS_BASE::LIB_TREE& aSettings,
|
||||
TOOL_INTERACTIVE* aContextMenuTool ) :
|
||||
LIB_TREE_MODEL_ADAPTER( aParent,
|
||||
wxT( "pinned_design_block_libs" ),
|
||||
Kiface().KifaceSettings()->m_DesignBlockChooserPanel.tree ),
|
||||
m_libs( (DESIGN_BLOCK_LIB_TABLE*) aLibs ),
|
||||
m_frame( aParent )
|
||||
m_frame( aParent ),
|
||||
m_contextMenuTool( aContextMenuTool )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -193,6 +198,11 @@ wxString DESIGN_BLOCK_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, in
|
||||
|
||||
html.Replace( "__FIELDS__", fieldTable );
|
||||
}
|
||||
else
|
||||
{
|
||||
html.Printf( _( "Error loading design block %s from library '%s'." ) + wxS( "\n" ),
|
||||
aLibId.GetLibItemName().wx_str(), aLibId.GetLibNickname().wx_str() );
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
@@ -200,5 +210,5 @@ wxString DESIGN_BLOCK_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, in
|
||||
|
||||
TOOL_INTERACTIVE* DESIGN_BLOCK_TREE_MODEL_ADAPTER::GetContextMenuTool()
|
||||
{
|
||||
return m_frame->GetToolManager()->GetTool<SCH_DESIGN_BLOCK_CONTROL>();
|
||||
return m_contextMenuTool;
|
||||
}
|
||||
+9
-2
@@ -34,7 +34,9 @@ public:
|
||||
* @param aLibs library set from which parts will be loaded
|
||||
*/
|
||||
static wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> Create( EDA_BASE_FRAME* aParent,
|
||||
LIB_TABLE* aLibs );
|
||||
LIB_TABLE* aLibs,
|
||||
APP_SETTINGS_BASE::LIB_TREE& aSettings,
|
||||
TOOL_INTERACTIVE* aContextMenuTool );
|
||||
|
||||
void AddLibraries( EDA_BASE_FRAME* aParent );
|
||||
void ClearLibraries();
|
||||
@@ -43,11 +45,15 @@ public:
|
||||
|
||||
TOOL_INTERACTIVE* GetContextMenuTool() override;
|
||||
|
||||
void SetLibTable( DESIGN_BLOCK_LIB_TABLE* aLibs ) { m_libs = aLibs; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Constructor; takes a set of libraries to be included in the search.
|
||||
*/
|
||||
DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs );
|
||||
DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs,
|
||||
APP_SETTINGS_BASE::LIB_TREE& aSettings,
|
||||
TOOL_INTERACTIVE* aContextMenuTool );
|
||||
|
||||
std::vector<LIB_TREE_ITEM*> getDesignBlocks( EDA_BASE_FRAME* aParent,
|
||||
const wxString& aLibName );
|
||||
@@ -57,6 +63,7 @@ protected:
|
||||
protected:
|
||||
DESIGN_BLOCK_LIB_TABLE* m_libs;
|
||||
EDA_BASE_FRAME* m_frame;
|
||||
TOOL_INTERACTIVE* m_contextMenuTool;
|
||||
};
|
||||
|
||||
#endif // DESIGN_BLOCK_TREE_MODEL_ADAPTER_H
|
||||
@@ -64,6 +64,18 @@ public:
|
||||
m_win->Raise(); // let's focus back on the parent window
|
||||
}
|
||||
}
|
||||
|
||||
void SuspendForTrueModal()
|
||||
{
|
||||
if( m_win )
|
||||
m_win->Enable();
|
||||
}
|
||||
|
||||
void ResumeAfterTrueModal()
|
||||
{
|
||||
if( m_win )
|
||||
m_win->Disable();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -560,6 +572,20 @@ int DIALOG_SHIM::ShowQuasiModal()
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SHIM::PrepareForModalSubDialog()
|
||||
{
|
||||
if( m_qmodal_parent_disabler )
|
||||
m_qmodal_parent_disabler->SuspendForTrueModal();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SHIM::CleanupAfterModalSubDialog()
|
||||
{
|
||||
if( m_qmodal_parent_disabler )
|
||||
m_qmodal_parent_disabler->ResumeAfterTrueModal();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SHIM::EndQuasiModal( int retCode )
|
||||
{
|
||||
// Hook up validator and transfer data from controls handling so quasi-modal dialogs
|
||||
|
||||
@@ -65,12 +65,14 @@ DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS( wxWindow* aParent ) :
|
||||
m_errorGrid( nullptr ),
|
||||
m_errorRow( -1 ),
|
||||
m_errorCol( -1 ),
|
||||
m_helpBox( nullptr ),
|
||||
m_heightBeforeHelp( 400 )
|
||||
m_helpBox( nullptr )
|
||||
{
|
||||
m_heightBeforeHelp = FromDIP ( 400 );
|
||||
m_btnAddEnvVar->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
|
||||
m_btnDeleteEnvVar->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
|
||||
|
||||
m_EnvVars->SetMinSize( FromDIP( m_EnvVars->GetMinSize() ) );
|
||||
|
||||
m_EnvVars->ClearRows();
|
||||
m_EnvVars->AppendCols( 1 ); // for the isExternal flags
|
||||
m_EnvVars->HideCol( TV_FLAG_COL );
|
||||
@@ -81,7 +83,7 @@ DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS( wxWindow* aParent ) :
|
||||
m_EnvVars->SetColAttr( TV_VALUE_COL, attr );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_EnvVars->SetDefaultRowSize( m_EnvVars->GetDefaultRowSize() + 4 );
|
||||
m_EnvVars->SetDefaultRowSize( m_EnvVars->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
|
||||
m_EnvVars->PushEventHandler( new GRID_TRICKS( m_EnvVars,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
|
||||
+4
-3
@@ -24,16 +24,16 @@
|
||||
|
||||
|
||||
#include <dialogs/dialog_design_block_properties.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/tooltip.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <design_block.h>
|
||||
|
||||
DIALOG_DESIGN_BLOCK_PROPERTIES::DIALOG_DESIGN_BLOCK_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
DESIGN_BLOCK* aDesignBlock ) :
|
||||
DIALOG_DESIGN_BLOCK_PROPERTIES::DIALOG_DESIGN_BLOCK_PROPERTIES( wxWindow* aParent,
|
||||
DESIGN_BLOCK* aDesignBlock ) :
|
||||
DIALOG_DESIGN_BLOCK_PROPERTIES_BASE( aParent ), m_designBlock( aDesignBlock )
|
||||
{
|
||||
if( !m_textName->IsEmpty() )
|
||||
@@ -74,6 +74,7 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataToWindow()
|
||||
// Typical assignment operator does not work here because of the ordered_map
|
||||
auto source = m_designBlock->GetFields();
|
||||
m_fields.clear();
|
||||
|
||||
for( const auto& field : source )
|
||||
{
|
||||
m_fields[field.first] = field.second;
|
||||
+7
-2
@@ -22,6 +22,9 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_DESIGN_BLOCK_PROPERTIES_H
|
||||
#define DIALOG_DESIGN_BLOCK_PROPERTIES_H
|
||||
|
||||
#include <dialogs/dialog_design_block_properties_base.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -31,7 +34,7 @@ class DESIGN_BLOCK;
|
||||
class DIALOG_DESIGN_BLOCK_PROPERTIES : public DIALOG_DESIGN_BLOCK_PROPERTIES_BASE
|
||||
{
|
||||
public:
|
||||
DIALOG_DESIGN_BLOCK_PROPERTIES( SCH_EDIT_FRAME* aParent, DESIGN_BLOCK* aDesignBlock );
|
||||
DIALOG_DESIGN_BLOCK_PROPERTIES( wxWindow* aParent, DESIGN_BLOCK* aDesignBlock );
|
||||
~DIALOG_DESIGN_BLOCK_PROPERTIES() override;
|
||||
|
||||
bool TransferDataToWindow() override;
|
||||
@@ -50,6 +53,8 @@ public:
|
||||
private:
|
||||
void AdjustGridColumns( int aWidth );
|
||||
|
||||
DESIGN_BLOCK* m_designBlock;
|
||||
DESIGN_BLOCK* m_designBlock;
|
||||
nlohmann::ordered_map<wxString, wxString> m_fields;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -36,13 +36,13 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
|
||||
int m_outputModeNChoices = sizeof( m_outputModeChoices ) / sizeof( wxString );
|
||||
m_outputMode = new wxChoice( m_sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_outputModeNChoices, m_outputModeChoices, 0 );
|
||||
m_outputMode->SetSelection( 0 );
|
||||
m_gbOptionsSizer->Add( m_outputMode, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
m_gbOptionsSizer->Add( m_outputMode, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_titleBlock = new wxCheckBox( m_sbOptionsSizer->GetStaticBox(), wxID_FRAME_SEL, _("Print drawing sheet"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_titleBlock->SetValue(true);
|
||||
m_titleBlock->SetToolTip( _("Print Frame references.") );
|
||||
|
||||
m_gbOptionsSizer->Add( m_titleBlock, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
m_gbOptionsSizer->Add( m_titleBlock, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_gbOptionsSizer->AddGrowableCol( 1 );
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -42,8 +42,8 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
wxID_FRAME_SEL = 1000,
|
||||
wxID_PRINT_OPTIONS
|
||||
wxID_FRAME_SEL = 8200,
|
||||
wxID_PRINT_OPTIONS,
|
||||
};
|
||||
|
||||
wxBoxSizer* m_bUpperSizer;
|
||||
|
||||
@@ -29,7 +29,7 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
|
||||
m_textCtrlOutputPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textCtrlOutputPath->SetMinSize( wxSize( 350,-1 ) );
|
||||
|
||||
fgSizer1->Add( m_textCtrlOutputPath, 1, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_textCtrlOutputPath, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_staticText18 = new wxStaticText( this, wxID_ANY, _("Format:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText18->Wrap( -1 );
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_RC_JOB_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="size">443,239</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h; forward_declare</property>
|
||||
<property name="title"></property>
|
||||
@@ -144,8 +144,8 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
|
||||
@@ -56,7 +56,7 @@ class KICOMMON_API DIALOG_RC_JOB_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 443,239 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
~DIALOG_RC_JOB_BASE();
|
||||
|
||||
|
||||
@@ -57,6 +57,10 @@ WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString&
|
||||
{
|
||||
m_labelX->SetLabel( aLabelX );
|
||||
m_labelY->SetLabel( aLabelY );
|
||||
|
||||
m_unit_binder_x.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD );
|
||||
m_unit_binder_y.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD );
|
||||
|
||||
m_unit_binder_x.SetValue( aDefaultValue.x );
|
||||
m_unit_binder_y.SetValue( aDefaultValue.y );
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
// wxWidgets spends *far* too long calculating column widths (most of it, believe it or
|
||||
// not, in repeatedly creating/destroying a wxDC to do the measurement in).
|
||||
// Use default column widths instead.
|
||||
// Note, these are "standard DPI" widths
|
||||
static int DEFAULT_SINGLE_COL_WIDTH = 260;
|
||||
static int DEFAULT_COL_WIDTHS[] = { 200, 300 };
|
||||
|
||||
@@ -43,6 +44,8 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( wxWindow* aParent, const wxString& aTitle,
|
||||
EDA_LIST_DIALOG_BASE( aParent, wxID_ANY, aTitle ),
|
||||
m_sortList( aSortList )
|
||||
{
|
||||
// correct for wxfb not supporting FromDIP
|
||||
m_listBox->SetMinSize( FromDIP( m_listBox->GetMinSize() ) );
|
||||
m_filterBox->SetHint( _( "Filter" ) );
|
||||
|
||||
initDialog( aItemHeaders, aItemList, aPreselectText );
|
||||
@@ -96,21 +99,21 @@ void EDA_LIST_DIALOG::initDialog( const wxArrayString& aItemHeaders,
|
||||
if( aItemHeaders.Count() == 1 )
|
||||
{
|
||||
m_listBox->InsertColumn( 0, aItemHeaders.Item( 0 ), wxLIST_FORMAT_LEFT,
|
||||
DEFAULT_SINGLE_COL_WIDTH );
|
||||
FromDIP( DEFAULT_SINGLE_COL_WIDTH ) );
|
||||
|
||||
m_listBox->SetMinClientSize( wxSize( DEFAULT_SINGLE_COL_WIDTH, 200 ) );
|
||||
SetMinClientSize( wxSize( DEFAULT_COL_WIDTHS[0], 220 ) );
|
||||
m_listBox->SetMinClientSize( FromDIP( wxSize( DEFAULT_SINGLE_COL_WIDTH, 200 ) ) );
|
||||
SetMinClientSize( FromDIP( wxSize( DEFAULT_COL_WIDTHS[0], 220 ) ) );
|
||||
}
|
||||
else if( aItemHeaders.Count() == 2 )
|
||||
{
|
||||
for( unsigned i = 0; i < aItemHeaders.Count(); i++ )
|
||||
{
|
||||
m_listBox->InsertColumn( i, aItemHeaders.Item( i ), wxLIST_FORMAT_LEFT,
|
||||
DEFAULT_COL_WIDTHS[ i ] );
|
||||
FromDIP( DEFAULT_COL_WIDTHS[ i ] ) );
|
||||
}
|
||||
|
||||
m_listBox->SetMinClientSize( wxSize( DEFAULT_COL_WIDTHS[0] * 3, 200 ) );
|
||||
SetMinClientSize( wxSize( DEFAULT_COL_WIDTHS[0] * 2, 220 ) );
|
||||
m_listBox->SetMinClientSize( FromDIP( wxSize( DEFAULT_COL_WIDTHS[0] * 3, 200 ) ) );
|
||||
SetMinClientSize( FromDIP( wxSize( DEFAULT_COL_WIDTHS[0] * 2, 220 ) ) );
|
||||
}
|
||||
|
||||
m_itemsList = aItemList;
|
||||
@@ -126,7 +129,7 @@ void EDA_LIST_DIALOG::initDialog( const wxArrayString& aItemHeaders,
|
||||
|
||||
// Set to a small size so EnsureVisible() won't be foiled by later additions.
|
||||
// ListBox will expand to fit later.
|
||||
m_listBox->SetSize( m_listBox->GetSize().GetX(), 100 );
|
||||
m_listBox->SetSize( m_listBox->GetSize().GetX(), FromDIP( 100 ) );
|
||||
m_listBox->EnsureVisible( sel );
|
||||
}
|
||||
}
|
||||
@@ -230,7 +233,7 @@ void EDA_LIST_DIALOG::InsertItems( const std::vector< wxArrayString >& itemList,
|
||||
info.m_itemId = row + position;
|
||||
info.m_col = col;
|
||||
info.m_text = itemList[row].Item( col );
|
||||
info.m_width = DEFAULT_COL_WIDTHS[ col ];
|
||||
info.m_width = FromDIP( DEFAULT_COL_WIDTHS[ col ] );
|
||||
info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH;
|
||||
|
||||
if( col == 0 )
|
||||
|
||||
@@ -193,20 +193,16 @@ void PANEL_COLOR_SETTINGS::OnThemeChanged( wxCommandEvent& event )
|
||||
void PANEL_COLOR_SETTINGS::updateSwatches()
|
||||
{
|
||||
if( m_swatches.empty() )
|
||||
{
|
||||
createSwatches();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isReadOnly = m_currentSettings->IsReadOnly();
|
||||
COLOR4D background = m_currentSettings->GetColor( m_backgroundLayer );
|
||||
|
||||
for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
|
||||
{
|
||||
pair.second->SetSwatchBackground( background );
|
||||
pair.second->SetSwatchColor( m_currentSettings->GetColor( pair.first ), false );
|
||||
pair.second->SetReadOnly( isReadOnly );
|
||||
}
|
||||
bool isReadOnly = m_currentSettings->IsReadOnly();
|
||||
COLOR4D background = m_currentSettings->GetColor( m_backgroundLayer );
|
||||
|
||||
for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
|
||||
{
|
||||
pair.second->SetSwatchBackground( background );
|
||||
pair.second->SetSwatchColor( m_currentSettings->GetColor( pair.first ), false );
|
||||
pair.second->SetReadOnly( isReadOnly );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -633,6 +633,46 @@ bool PANEL_DESIGN_BLOCK_LIB_TABLE::verifyTables()
|
||||
}
|
||||
}
|
||||
|
||||
for( DESIGN_BLOCK_LIB_TABLE* table : { global_model(), project_model() } )
|
||||
{
|
||||
if( !table )
|
||||
continue;
|
||||
|
||||
for( unsigned int r = 0; r < table->GetCount(); ++r )
|
||||
{
|
||||
DESIGN_BLOCK_LIB_TABLE_ROW& row =
|
||||
dynamic_cast<DESIGN_BLOCK_LIB_TABLE_ROW&>( table->At( r ) );
|
||||
|
||||
// Newly-added rows won't have set this yet
|
||||
row.SetParent( table );
|
||||
|
||||
if( !row.GetIsEnabled() )
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
if( row.Refresh() )
|
||||
{
|
||||
if( table == global_model() )
|
||||
m_parent->m_GlobalTableChanged = true;
|
||||
else
|
||||
m_parent->m_ProjectTableChanged = true;
|
||||
}
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "Design block library '%s' failed to load." ), row.GetNickName() );
|
||||
|
||||
wxWindow* topLevelParent = wxGetTopLevelParent( this );
|
||||
wxMessageDialog errdlg( topLevelParent, msg + wxS( "\n" ) + ioe.What(),
|
||||
_( "Error Loading Library" ) );
|
||||
errdlg.ShowModal();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,24 @@ PANEL_EMBEDDED_FILES::PANEL_EMBEDDED_FILES( wxWindow* parent, EMBEDDED_FILES* aF
|
||||
m_files_grid->EnableAlternateRowColors();
|
||||
|
||||
m_files_grid->PushEventHandler( new EMBEDDED_FILES_GRID_TRICKS( m_files_grid ) );
|
||||
|
||||
m_localFiles->SetFileAddedCallback( [this](EMBEDDED_FILES::EMBEDDED_FILE* file) {
|
||||
|
||||
for( int ii = 0; ii < m_files_grid->GetNumberRows(); ii++ )
|
||||
{
|
||||
if( m_files_grid->GetCellValue( ii, 1 ) == file->GetLink() )
|
||||
{
|
||||
m_files_grid->DeleteRows( ii );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_files_grid->AppendRows( 1 );
|
||||
int ii = m_files_grid->GetNumberRows() - 1;
|
||||
m_files_grid->SetCellValue( ii, 0, file->name );
|
||||
m_files_grid->SetCellValue( ii, 1, file->GetLink() );
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -255,56 +273,85 @@ void PANEL_EMBEDDED_FILES::onFontEmbedClick( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* PANEL_EMBEDDED_FILES::AddEmbeddedFile( const wxString& aFile )
|
||||
{
|
||||
wxFileName fileName( aFile );
|
||||
wxString name = fileName.GetFullName();
|
||||
|
||||
if( m_localFiles->HasFile( name ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "File '%s' already exists." ), name );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||
errorDlg.SetOKLabel( _( "Overwrite" ) );
|
||||
|
||||
if( errorDlg.ShowModal() != wxID_OK )
|
||||
return nullptr;
|
||||
|
||||
for( int ii = 0; ii < m_files_grid->GetNumberRows(); ii++ )
|
||||
{
|
||||
if( m_files_grid->GetCellValue( ii, 0 ) == name )
|
||||
{
|
||||
m_files_grid->DeleteRows( ii );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* result = m_localFiles->AddFile( fileName, true );
|
||||
|
||||
if( !result )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Failed to add file '%s'." ), name );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Error" ), wxOK | wxICON_ERROR );
|
||||
errorDlg.ShowModal();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void PANEL_EMBEDDED_FILES::onAddEmbeddedFile( wxCommandEvent& event )
|
||||
{
|
||||
wxFileDialog fileDialog( this, _( "Select a file to embed" ), wxEmptyString, wxEmptyString,
|
||||
_( "All files|*.*" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( fileDialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
wxFileName fileName( fileDialog.GetPath() );
|
||||
wxString name = fileName.GetFullName();
|
||||
|
||||
if( m_localFiles->HasFile( name ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "File '%s' already exists." ), name );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxICON_WARNING );
|
||||
errorDlg.SetOKLabel( _( "Overwrite" ) );
|
||||
|
||||
if( errorDlg.ShowModal() != wxID_OK )
|
||||
return;
|
||||
|
||||
for( int ii = 0; ii < m_files_grid->GetNumberRows(); ii++ )
|
||||
{
|
||||
if( m_files_grid->GetCellValue( ii, 0 ) == name )
|
||||
{
|
||||
m_files_grid->DeleteRows( ii );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* result = m_localFiles->AddFile( fileName, true );
|
||||
|
||||
if( !result )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Failed to add file '%s'." ),
|
||||
name );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Error" ), wxOK | wxICON_ERROR );
|
||||
errorDlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
||||
m_files_grid->AppendRows( 1 );
|
||||
int ii = m_files_grid->GetNumberRows() - 1;
|
||||
m_files_grid->SetCellValue( ii, 0, name );
|
||||
m_files_grid->SetCellValue( ii, 1, result->GetLink() );
|
||||
}
|
||||
AddEmbeddedFile( fileDialog.GetPath() );
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_EMBEDDED_FILES::RemoveEmbeddedFile( const wxString& aFileName )
|
||||
{
|
||||
wxString name = aFileName;
|
||||
|
||||
if( name.StartsWith( FILEEXT::KiCadUriPrefix ) )
|
||||
name = name.Mid( FILEEXT::KiCadUriPrefix.size() + 3 );
|
||||
|
||||
int row = std::max( 0, m_files_grid->GetGridCursorRow() );
|
||||
|
||||
for( int ii = 0; ii < m_files_grid->GetNumberRows(); ii++ )
|
||||
{
|
||||
if( m_files_grid->GetCellValue( ii, 0 ) == name )
|
||||
{
|
||||
m_files_grid->DeleteRows( ii );
|
||||
m_localFiles->RemoveFile( name );
|
||||
|
||||
if( row < m_files_grid->GetNumberRows() )
|
||||
m_files_grid->SetGridCursor( row, 0 );
|
||||
else if( m_files_grid->GetNumberRows() > 0 )
|
||||
m_files_grid->SetGridCursor( m_files_grid->GetNumberRows() - 1, 0 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void PANEL_EMBEDDED_FILES::onDeleteEmbeddedFile( wxCommandEvent& event )
|
||||
{
|
||||
int row = m_files_grid->GetGridCursorRow();
|
||||
|
||||
@@ -24,12 +24,11 @@
|
||||
#ifndef PANEL_EMBEDDED_FILES_H
|
||||
#define PANEL_EMBEDDED_FILES_H
|
||||
|
||||
#include <embedded_files.h>
|
||||
#include "panel_embedded_files_base.h"
|
||||
|
||||
#include "grid_tricks.h"
|
||||
|
||||
class EMBEDDED_FILES;
|
||||
|
||||
class EMBEDDED_FILES_GRID_TRICKS : public GRID_TRICKS
|
||||
{
|
||||
enum
|
||||
@@ -63,6 +62,10 @@ public:
|
||||
bool TransferDataToWindow() override;
|
||||
bool GetEmbedFonts() const { return m_cbEmbedFonts->GetValue(); }
|
||||
|
||||
EMBEDDED_FILES* GetLocalFiles() { return m_localFiles; }
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* AddEmbeddedFile( const wxString& aFileName );
|
||||
bool RemoveEmbeddedFile( const wxString& aFileName );
|
||||
|
||||
protected:
|
||||
void onFontEmbedClick( wxCommandEvent& event ) override;
|
||||
void onAddEmbeddedFile( wxCommandEvent& event ) override;
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
#include <drawing_sheet/drawing_sheet_lexer.h>
|
||||
#include <drawing_sheet/ds_file_versions.h>
|
||||
#include <font/font.h>
|
||||
#include <io/kicad/kicad_io_utils.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
#include <wx/base64.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/mstream.h>
|
||||
|
||||
using namespace DRAWINGSHEET_T;
|
||||
|
||||
@@ -422,21 +423,11 @@ void DS_DATA_MODEL_IO::format( DS_DATA_ITEM_BITMAP* aItem ) const
|
||||
// Write image in png readable format
|
||||
m_out->Print( "(data" );
|
||||
|
||||
wxString out = wxBase64Encode( aItem->m_ImageBitmap->GetImageDataBuffer() );
|
||||
wxMemoryOutputStream stream;
|
||||
aItem->m_ImageBitmap->SaveImageData( stream );
|
||||
|
||||
// Apparently the MIME standard character width for base64 encoding is 76 (unconfirmed)
|
||||
// so use it in a vain attempt to be standard like.
|
||||
#define MIME_BASE64_LENGTH 76
|
||||
KICAD_FORMAT::FormatStreamData( *m_out, *stream.GetOutputStreamBuffer() );
|
||||
|
||||
size_t first = 0;
|
||||
|
||||
while( first < out.Length() )
|
||||
{
|
||||
m_out->Print( "\n\"%s\"", TO_UTF8( out( first, MIME_BASE64_LENGTH ) ) );
|
||||
first += MIME_BASE64_LENGTH;
|
||||
}
|
||||
|
||||
m_out->Print( ")" ); // Closes data token.
|
||||
m_out->Print( ")" ); // Closes bitmap token.
|
||||
}
|
||||
|
||||
|
||||
@@ -555,9 +555,9 @@ void EDA_BASE_FRAME::ShowChangedLanguage()
|
||||
}
|
||||
|
||||
|
||||
void EDA_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
void EDA_BASE_FRAME::CommonSettingsChanged( int aFlags )
|
||||
{
|
||||
TOOLS_HOLDER::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
TOOLS_HOLDER::CommonSettingsChanged( aFlags );
|
||||
|
||||
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
|
||||
|
||||
@@ -791,7 +791,7 @@ void EDA_BASE_FRAME::LoadWindowSettings( const WINDOW_SETTINGS* aCfg )
|
||||
m_perspective = aCfg->perspective;
|
||||
m_mruPath = aCfg->mru_path;
|
||||
|
||||
TOOLS_HOLDER::CommonSettingsChanged( false, false );
|
||||
TOOLS_HOLDER::CommonSettingsChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -1288,7 +1288,7 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent
|
||||
// Update our grids that are cached in the tool
|
||||
m_toolManager->ResetTools( TOOL_BASE::REDRAW );
|
||||
Pgm().GetSettingsManager().Save();
|
||||
dlg.Kiway().CommonSettingsChanged( false, false );
|
||||
dlg.Kiway().CommonSettingsChanged( HOTKEYS_CHANGED );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -293,9 +293,9 @@ void EDA_DRAW_FRAME::ToggleUserUnits()
|
||||
}
|
||||
|
||||
|
||||
void EDA_DRAW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
void EDA_DRAW_FRAME::CommonSettingsChanged( int aFlags )
|
||||
{
|
||||
EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
EDA_BASE_FRAME::CommonSettingsChanged( aFlags );
|
||||
|
||||
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
|
||||
KIGFX::VIEW_CONTROLS* viewControls = GetCanvas()->GetViewControls();
|
||||
|
||||
@@ -2206,16 +2206,15 @@ static struct EDA_SHAPE_DESC
|
||||
.Map( SHAPE_T::POLY, _HKI( "Polygon" ) )
|
||||
.Map( SHAPE_T::BEZIER, _HKI( "Bezier" ) );
|
||||
|
||||
auto& plotDashTypeEnum = ENUM_MAP<LINE_STYLE>::Instance();
|
||||
ENUM_MAP<LINE_STYLE>& lineStyleEnum = ENUM_MAP<LINE_STYLE>::Instance();
|
||||
|
||||
if( plotDashTypeEnum.Choices().GetCount() == 0 )
|
||||
if( lineStyleEnum.Choices().GetCount() == 0 )
|
||||
{
|
||||
plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) )
|
||||
.Map( LINE_STYLE::SOLID, _HKI( "Solid" ) )
|
||||
.Map( LINE_STYLE::DASH, _HKI( "Dashed" ) )
|
||||
.Map( LINE_STYLE::DOT, _HKI( "Dotted" ) )
|
||||
.Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) )
|
||||
.Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) );
|
||||
lineStyleEnum.Map( LINE_STYLE::SOLID, _HKI( "Solid" ) )
|
||||
.Map( LINE_STYLE::DASH, _HKI( "Dashed" ) )
|
||||
.Map( LINE_STYLE::DOT, _HKI( "Dotted" ) )
|
||||
.Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) )
|
||||
.Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) );
|
||||
}
|
||||
|
||||
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
*
|
||||
* 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.
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
@@ -101,7 +101,11 @@ EMBEDDED_FILES::EMBEDDED_FILE* EMBEDDED_FILES::AddFile( const wxFileName& aName,
|
||||
|
||||
efile->is_valid = true;
|
||||
|
||||
m_files[aName.GetFullName()] = efile.release();
|
||||
EMBEDDED_FILE* result = efile.release();
|
||||
m_files[aName.GetFullName()] = result;
|
||||
|
||||
if( m_fileAddedCallback )
|
||||
m_fileAddedCallback( result );
|
||||
|
||||
return m_files[aName.GetFullName()];
|
||||
}
|
||||
@@ -110,6 +114,9 @@ EMBEDDED_FILES::EMBEDDED_FILE* EMBEDDED_FILES::AddFile( const wxFileName& aName,
|
||||
void EMBEDDED_FILES::AddFile( EMBEDDED_FILE* aFile )
|
||||
{
|
||||
m_files.insert( { aFile->name, aFile } );
|
||||
|
||||
if( m_fileAddedCallback )
|
||||
m_fileAddedCallback( aFile );
|
||||
}
|
||||
|
||||
|
||||
@@ -516,3 +523,56 @@ const std::vector<wxString>* EMBEDDED_FILES::UpdateFontFiles()
|
||||
|
||||
return &m_fontFiles;
|
||||
}
|
||||
|
||||
// Move constructor
|
||||
EMBEDDED_FILES::EMBEDDED_FILES( EMBEDDED_FILES&& other ) noexcept :
|
||||
m_files( std::move( other.m_files ) ),
|
||||
m_fontFiles( std::move( other.m_fontFiles ) ),
|
||||
m_fileAddedCallback( std::move( other.m_fileAddedCallback ) ),
|
||||
m_embedFonts( other.m_embedFonts )
|
||||
{
|
||||
other.m_embedFonts = false;
|
||||
}
|
||||
|
||||
// Move assignment operator
|
||||
EMBEDDED_FILES& EMBEDDED_FILES::operator=(EMBEDDED_FILES&& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
ClearEmbeddedFiles();
|
||||
m_files = std::move( other.m_files );
|
||||
m_fontFiles = std::move( other.m_fontFiles );
|
||||
m_fileAddedCallback = std::move( other.m_fileAddedCallback );
|
||||
m_embedFonts = other.m_embedFonts;
|
||||
other.m_embedFonts = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
EMBEDDED_FILES::EMBEDDED_FILES( const EMBEDDED_FILES& other ) : m_embedFonts( other.m_embedFonts )
|
||||
{
|
||||
for( const auto& [name, file] : other.m_files )
|
||||
{
|
||||
m_files[name] = new EMBEDDED_FILE( *file );
|
||||
}
|
||||
m_fontFiles = other.m_fontFiles;
|
||||
m_fileAddedCallback = other.m_fileAddedCallback;
|
||||
}
|
||||
|
||||
// Copy assignment operator
|
||||
EMBEDDED_FILES& EMBEDDED_FILES::operator=( const EMBEDDED_FILES& other )
|
||||
{
|
||||
if( this != &other )
|
||||
{
|
||||
ClearEmbeddedFiles();
|
||||
for( const auto& [name, file] : other.m_files )
|
||||
{
|
||||
m_files[name] = new EMBEDDED_FILE( *file );
|
||||
}
|
||||
m_fontFiles = other.m_fontFiles;
|
||||
m_fileAddedCallback = other.m_fileAddedCallback;
|
||||
m_embedFonts = other.m_embedFonts;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ private:
|
||||
|
||||
static MARKUP_CACHE s_markupCache( 1024 );
|
||||
static std::mutex s_markupCacheMutex;
|
||||
static std::mutex s_defaultFontMutex;;
|
||||
|
||||
|
||||
FONT::FONT()
|
||||
@@ -136,6 +137,8 @@ FONT::FONT()
|
||||
|
||||
FONT* FONT::getDefaultFont()
|
||||
{
|
||||
std::lock_guard lock( s_defaultFontMutex );
|
||||
|
||||
if( !s_defaultFont )
|
||||
s_defaultFont = STROKE_FONT::LoadFont( wxEmptyString );
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <mutex>
|
||||
#include <font/fontconfig.h>
|
||||
#include <wx/log.h>
|
||||
#include <trace_helpers.h>
|
||||
@@ -40,6 +40,7 @@ static FONTCONFIG* g_config = nullptr;
|
||||
static bool g_fcInitSuccess = false;
|
||||
|
||||
REPORTER* FONTCONFIG::s_reporter = nullptr;
|
||||
static std::mutex g_fontConfigMutex;
|
||||
|
||||
/**
|
||||
* A simple wrapper to avoid exporting fontconfig in the header
|
||||
@@ -63,6 +64,7 @@ FONTCONFIG::FONTCONFIG()
|
||||
|
||||
void fontconfig::FONTCONFIG::SetReporter( REPORTER* aReporter )
|
||||
{
|
||||
std::lock_guard lock( g_fontConfigMutex );
|
||||
s_reporter = aReporter;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,15 @@ void FP_LIB_TABLE_ROW::SetType( const wxString& aType )
|
||||
}
|
||||
|
||||
|
||||
bool FP_LIB_TABLE_ROW::LibraryExists() const
|
||||
{
|
||||
if( plugin )
|
||||
return plugin->CanReadLibrary( GetFullURI( true ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
FP_LIB_TABLE::FP_LIB_TABLE( FP_LIB_TABLE* aFallBackTable ) :
|
||||
LIB_TABLE( aFallBackTable )
|
||||
{
|
||||
@@ -307,14 +316,6 @@ void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxS
|
||||
}
|
||||
|
||||
|
||||
void FP_LIB_TABLE::PrefetchLib( const wxString& aNickname )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||
wxASSERT( row->plugin );
|
||||
row->plugin->PrefetchLib( row->GetFullURI( true ), row->GetProperties() );
|
||||
}
|
||||
|
||||
|
||||
const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname, bool aCheckIfEnabled )
|
||||
{
|
||||
FP_LIB_TABLE_ROW* row = static_cast<FP_LIB_TABLE_ROW*>( findRow( aNickname, aCheckIfEnabled ) );
|
||||
|
||||
@@ -63,6 +63,7 @@ bool GIT_CLONE_HANDLER::PerformClone()
|
||||
cloneOptions.fetch_opts.callbacks.payload = this;
|
||||
|
||||
m_testedTypes = 0;
|
||||
ResetNextKey();
|
||||
|
||||
if( git_clone( &m_repo, m_URL.ToStdString().c_str(), m_clonePath.ToStdString().c_str(),
|
||||
&cloneOptions ) != 0 )
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
|
||||
GIT_PULL_HANDLER::GIT_PULL_HANDLER( git_repository* aRepo ) : KIGIT_COMMON( aRepo )
|
||||
GIT_PULL_HANDLER::GIT_PULL_HANDLER( KIGIT_COMMON* aRepo ) : KIGIT_COMMON( *aRepo )
|
||||
{}
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ bool GIT_PULL_HANDLER::PerformFetch()
|
||||
remoteCallbacks.credentials = credentials_cb;
|
||||
remoteCallbacks.payload = this;
|
||||
|
||||
m_testedTypes = 0;
|
||||
ResetNextKey();
|
||||
|
||||
if( git_remote_connect( remote, GIT_DIRECTION_FETCH, &remoteCallbacks, nullptr, nullptr ) )
|
||||
{
|
||||
git_remote_free( remote );
|
||||
|
||||
@@ -42,14 +42,14 @@ struct CommitDetails
|
||||
std::string m_date;
|
||||
};
|
||||
|
||||
// Enum for result codes
|
||||
enum class PullResult
|
||||
// Enum for result codes, error codes are negative, success codes are positive
|
||||
enum class PullResult : int
|
||||
{
|
||||
Success,
|
||||
Error,
|
||||
MergeFailed = -2,
|
||||
Error = -1,
|
||||
Success = 0,
|
||||
UpToDate,
|
||||
FastForward,
|
||||
MergeFailed
|
||||
FastForward
|
||||
};
|
||||
|
||||
struct ConflictData
|
||||
@@ -68,7 +68,7 @@ struct ConflictData
|
||||
class GIT_PULL_HANDLER : public KIGIT_COMMON, public GIT_PROGRESS
|
||||
{
|
||||
public:
|
||||
GIT_PULL_HANDLER( git_repository* aRepo );
|
||||
GIT_PULL_HANDLER( KIGIT_COMMON* aCommon );
|
||||
~GIT_PULL_HANDLER();
|
||||
|
||||
PullResult PerformPull();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
GIT_PUSH_HANDLER::GIT_PUSH_HANDLER( git_repository* aRepo ) : KIGIT_COMMON( aRepo )
|
||||
GIT_PUSH_HANDLER::GIT_PUSH_HANDLER( KIGIT_COMMON* aRepo ) : KIGIT_COMMON( *aRepo )
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ enum class PushResult
|
||||
class GIT_PUSH_HANDLER : public KIGIT_COMMON, public GIT_PROGRESS
|
||||
{
|
||||
public:
|
||||
GIT_PUSH_HANDLER( git_repository* aRepo );
|
||||
GIT_PUSH_HANDLER( KIGIT_COMMON* aRepo );
|
||||
~GIT_PUSH_HANDLER();
|
||||
|
||||
PushResult PerformPush();
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
|
||||
#include "kicad_git_common.h"
|
||||
|
||||
#include <kiplatform/secrets.h>
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/textfile.h>
|
||||
#include <wx/utils.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -70,7 +74,7 @@ wxString KIGIT_COMMON::GetCurrentBranchName() const
|
||||
|
||||
git_reference_free( branch );
|
||||
|
||||
return branchName;
|
||||
return wxString( branchName );
|
||||
}
|
||||
|
||||
|
||||
@@ -387,6 +391,207 @@ bool KIGIT_COMMON::HasPushAndPullRemote() const
|
||||
}
|
||||
|
||||
|
||||
wxString KIGIT_COMMON::GetRemotename() const
|
||||
{
|
||||
wxString retval;
|
||||
git_reference* head = nullptr;
|
||||
git_reference* upstream = nullptr;
|
||||
|
||||
if( git_repository_head( &head, m_repo ) != GIT_OK )
|
||||
return retval;
|
||||
|
||||
if( git_branch_upstream( &upstream, head ) == GIT_OK )
|
||||
{
|
||||
git_buf remote_name = GIT_BUF_INIT_CONST( nullptr, 0 );
|
||||
|
||||
if( git_branch_remote_name( &remote_name, m_repo, git_reference_name( upstream ) ) == GIT_OK )
|
||||
{
|
||||
retval = remote_name.ptr;
|
||||
git_buf_dispose( &remote_name );
|
||||
}
|
||||
|
||||
git_reference_free( upstream );
|
||||
}
|
||||
|
||||
git_reference_free( head );
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void KIGIT_COMMON::SetSSHKey( const wxString& aKey )
|
||||
{
|
||||
auto it = std::find( m_publicKeys.begin(), m_publicKeys.end(), aKey );
|
||||
|
||||
if( it != m_publicKeys.end() )
|
||||
m_publicKeys.erase( it );
|
||||
|
||||
m_publicKeys.insert( m_publicKeys.begin(), aKey );
|
||||
}
|
||||
|
||||
|
||||
void KIGIT_COMMON::updatePublicKeys()
|
||||
{
|
||||
m_publicKeys.clear();
|
||||
|
||||
wxFileName keyFile( wxGetHomeDir(), wxEmptyString );
|
||||
keyFile.AppendDir( ".ssh" );
|
||||
keyFile.SetFullName( "id_rsa" );
|
||||
|
||||
if( keyFile.FileExists() )
|
||||
m_publicKeys.push_back( keyFile.GetFullPath() );
|
||||
|
||||
keyFile.SetFullName( "id_dsa" );
|
||||
|
||||
if( keyFile.FileExists() )
|
||||
m_publicKeys.push_back( keyFile.GetFullPath() );
|
||||
|
||||
keyFile.SetFullName( "id_ecdsa" );
|
||||
|
||||
if( keyFile.FileExists() )
|
||||
m_publicKeys.push_back( keyFile.GetFullPath() );
|
||||
|
||||
keyFile.SetFullName( "id_ed25519" );
|
||||
|
||||
if( keyFile.FileExists() )
|
||||
m_publicKeys.push_back( keyFile.GetFullPath() );
|
||||
|
||||
// Parse SSH config file for hostname information
|
||||
wxFileName sshConfig( wxGetHomeDir(), wxEmptyString );
|
||||
sshConfig.AppendDir( ".ssh" );
|
||||
sshConfig.SetFullName( "config" );
|
||||
|
||||
if( sshConfig.FileExists() )
|
||||
{
|
||||
wxTextFile configFile( sshConfig.GetFullPath() );
|
||||
configFile.Open();
|
||||
|
||||
bool match = false;
|
||||
|
||||
for( wxString line = configFile.GetFirstLine(); !configFile.Eof(); line = configFile.GetNextLine() )
|
||||
{
|
||||
line.Trim( false ).Trim( true );
|
||||
|
||||
if( line.StartsWith( "Host " ) )
|
||||
match = false;
|
||||
|
||||
// The difference here is that we are matching either "Hostname" or "Host" to get the
|
||||
// match. This is because in the absence of a "Hostname" line, the "Host" line is used
|
||||
if( line.StartsWith( "Host" ) && line.Contains( m_hostname ) )
|
||||
match = true;
|
||||
|
||||
if( match && line.StartsWith( "IdentityFile" ) )
|
||||
{
|
||||
wxString keyPath = line.AfterFirst( ' ' ).Trim( false ).Trim( true );
|
||||
|
||||
// Expand ~ to home directory if present
|
||||
if( keyPath.StartsWith( "~" ) )
|
||||
keyPath.Replace( "~", wxGetHomeDir(), false );
|
||||
|
||||
// Add the public key to the beginning of the list
|
||||
if( wxFileName::FileExists( keyPath ) )
|
||||
SetSSHKey( keyPath );
|
||||
}
|
||||
}
|
||||
|
||||
configFile.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KIGIT_COMMON::UpdateCurrentBranchInfo()
|
||||
{
|
||||
// We want to get the current branch's upstream url as well as the stored password
|
||||
// if one exists given the url and username.
|
||||
|
||||
wxString remote_name = GetRemotename();
|
||||
git_remote* remote = nullptr;
|
||||
|
||||
if( git_remote_lookup( &remote, m_repo, remote_name.ToStdString().c_str() ) == GIT_OK )
|
||||
{
|
||||
const char* url = git_remote_url( remote );
|
||||
|
||||
if( url )
|
||||
m_remote = url;
|
||||
|
||||
git_remote_free( remote );
|
||||
}
|
||||
|
||||
// Find the stored password if it exists
|
||||
KIPLATFORM::SECRETS::GetSecret( m_remote, m_username, m_password );
|
||||
|
||||
updateConnectionType();
|
||||
updatePublicKeys();
|
||||
}
|
||||
|
||||
void KIGIT_COMMON::updateConnectionType()
|
||||
{
|
||||
if( m_remote.StartsWith( "https://" ) || m_remote.StartsWith( "http://" ) )
|
||||
m_connType = GIT_CONN_TYPE::GIT_CONN_HTTPS;
|
||||
else if( m_remote.StartsWith( "ssh://" ) || m_remote.StartsWith( "git@" ) || m_remote.StartsWith( "git+ssh://" ) )
|
||||
m_connType = GIT_CONN_TYPE::GIT_CONN_SSH;
|
||||
else
|
||||
m_connType = GIT_CONN_TYPE::GIT_CONN_LOCAL;
|
||||
|
||||
if( m_connType != GIT_CONN_TYPE::GIT_CONN_LOCAL )
|
||||
{
|
||||
wxString uri = m_remote;
|
||||
size_t atPos = uri.find( '@' );
|
||||
|
||||
if( atPos != wxString::npos )
|
||||
{
|
||||
size_t protoEnd = uri.find( "//" );
|
||||
|
||||
if( protoEnd != wxString::npos )
|
||||
{
|
||||
wxString credentials = uri.Mid( protoEnd + 2, atPos - protoEnd - 2 );
|
||||
size_t colonPos = credentials.find( ':' );
|
||||
|
||||
if( colonPos != wxString::npos )
|
||||
{
|
||||
m_username = credentials.Left( colonPos );
|
||||
m_password = credentials.Mid( colonPos + 1, credentials.Length() - colonPos - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_username = credentials;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_username = uri.Left( atPos );
|
||||
}
|
||||
}
|
||||
|
||||
if( m_remote.StartsWith( "git@" ) )
|
||||
{
|
||||
// SSH format: git@hostname:path
|
||||
size_t colonPos = m_remote.find( ':' );
|
||||
if( colonPos != wxString::npos )
|
||||
m_hostname = m_remote.Mid( 4, colonPos - 4 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// other URL format: proto://[user@]hostname/path
|
||||
size_t hostStart = m_remote.find( "://" ) + 2;
|
||||
size_t hostEnd = m_remote.find( '/', hostStart );
|
||||
wxString host;
|
||||
|
||||
if( hostEnd != wxString::npos )
|
||||
host = m_remote.Mid( hostStart, hostEnd - hostStart );
|
||||
else
|
||||
host = m_remote.Mid( hostStart );
|
||||
|
||||
atPos = host.find( '@' );
|
||||
|
||||
if( atPos != wxString::npos )
|
||||
m_hostname = host.Mid( atPos + 1 );
|
||||
else
|
||||
m_hostname = host;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" int fetchhead_foreach_cb( const char*, const char*,
|
||||
const git_oid* aOID, unsigned int aIsMerge, void* aPayload )
|
||||
{
|
||||
@@ -532,7 +737,14 @@ extern "C" int credentials_cb( git_cred** aOut, const char* aUrl, const char* aU
|
||||
&& !( parent->TestedTypes() & GIT_CREDTYPE_SSH_KEY ) )
|
||||
{
|
||||
// SSH key authentication
|
||||
wxString sshKey = parent->GetSSHKey();
|
||||
wxString sshKey = parent->GetNextPublicKey();
|
||||
|
||||
if( sshKey.IsEmpty() )
|
||||
{
|
||||
parent->TestedTypes() |= GIT_CREDTYPE_SSH_KEY;
|
||||
return GIT_PASSTHROUGH;
|
||||
}
|
||||
|
||||
wxString sshPubKey = sshKey + ".pub";
|
||||
wxString username = parent->GetUsername().Trim().Trim( false );
|
||||
wxString password = parent->GetPassword().Trim().Trim( false );
|
||||
@@ -541,7 +753,6 @@ extern "C" int credentials_cb( git_cred** aOut, const char* aUrl, const char* aU
|
||||
sshPubKey.ToStdString().c_str(),
|
||||
sshKey.ToStdString().c_str(),
|
||||
password.ToStdString().c_str() );
|
||||
parent->TestedTypes() |= GIT_CREDTYPE_SSH_KEY;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -89,12 +89,11 @@ public:
|
||||
|
||||
wxString GetUsername() const { return m_username; }
|
||||
wxString GetPassword() const { return m_password; }
|
||||
wxString GetSSHKey() const { return m_sshKey; }
|
||||
GIT_CONN_TYPE GetConnType() const { return m_connType; }
|
||||
|
||||
void SetUsername( const wxString& aUsername ) { m_username = aUsername; }
|
||||
void SetPassword( const wxString& aPassword ) { m_password = aPassword; }
|
||||
void SetSSHKey( const wxString& aSSHKey ) { m_sshKey = aSSHKey; }
|
||||
void SetSSHKey( const wxString& aSSHKey );
|
||||
|
||||
void SetConnType( GIT_CONN_TYPE aConnType ) { m_connType = aConnType; }
|
||||
void SetConnType( unsigned aConnType )
|
||||
@@ -114,16 +113,39 @@ public:
|
||||
// Returns true if the repository has a remote that can be pushed to pulled from
|
||||
bool HasPushAndPullRemote() const;
|
||||
|
||||
// Updates the password and remote information for the repository given the current branch
|
||||
void UpdateCurrentBranchInfo();
|
||||
|
||||
wxString GetRemotename() const;
|
||||
|
||||
void ResetNextKey() { m_nextPublicKey = 0; }
|
||||
|
||||
wxString GetNextPublicKey()
|
||||
{
|
||||
if( m_nextPublicKey >= static_cast<int>( m_publicKeys.size() ) )
|
||||
return wxEmptyString;
|
||||
|
||||
return m_publicKeys[m_nextPublicKey++];
|
||||
}
|
||||
|
||||
protected:
|
||||
git_repository* m_repo;
|
||||
|
||||
GIT_CONN_TYPE m_connType;
|
||||
wxString m_remote; // This is the full connection string
|
||||
wxString m_hostname; // This is just the hostname without the protocol, username, or password
|
||||
wxString m_username;
|
||||
wxString m_password;
|
||||
wxString m_sshKey;
|
||||
|
||||
unsigned m_testedTypes;
|
||||
|
||||
private:
|
||||
void updatePublicKeys();
|
||||
void updateConnectionType();
|
||||
|
||||
std::vector<wxString> m_publicKeys;
|
||||
int m_nextPublicKey;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -338,6 +338,8 @@ ALTIUM_BINARY_PARSER::ALTIUM_BINARY_PARSER( std::unique_ptr<char[]>& aContent, s
|
||||
std::map<wxString, wxString> ALTIUM_BINARY_PARSER::ReadProperties(
|
||||
std::function<std::map<wxString, wxString>( const std::string& )> handleBinaryData )
|
||||
{
|
||||
// TSAN reports calling this wx macro is not thread-safe
|
||||
static wxCSConv convISO8859_1 = wxConvISO8859_1;
|
||||
|
||||
std::map<wxString, wxString> kv;
|
||||
|
||||
@@ -412,7 +414,7 @@ std::map<wxString, wxString> ALTIUM_BINARY_PARSER::ReadProperties(
|
||||
|
||||
// convert the strings to wxStrings, since we use them everywhere
|
||||
// value can have non-ASCII characters, so we convert them from LATIN1/ISO8859-1
|
||||
wxString key( keyS.c_str(), wxConvISO8859_1 );
|
||||
wxString key( keyS.c_str(), convISO8859_1 );
|
||||
|
||||
// Altium stores keys either in Upper, or in CamelCase. Lets unify it.
|
||||
wxString canonicalKey = key.Trim( false ).Trim( true ).MakeUpper();
|
||||
@@ -423,7 +425,7 @@ std::map<wxString, wxString> ALTIUM_BINARY_PARSER::ReadProperties(
|
||||
if( canonicalKey.StartsWith( "%UTF8%" ) )
|
||||
value = wxString( valueS.c_str(), wxConvUTF8 );
|
||||
else
|
||||
value = wxString( valueS.c_str(), wxConvISO8859_1 );
|
||||
value = wxString( valueS.c_str(), convISO8859_1 );
|
||||
|
||||
if( canonicalKey != wxS( "PATTERN" ) && canonicalKey != wxS( "SOURCEFOOTPRINTLIBRARY" ) )
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <trace_helpers.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/regex.h>
|
||||
#include <wx/tokenzr.h>
|
||||
|
||||
#include <functional>
|
||||
#include <cstdio>
|
||||
@@ -213,8 +214,6 @@ size_t GetNodeCount( const wxXmlNode* aNode )
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
template<> template<>
|
||||
OPTIONAL_XML_ATTRIBUTE<wxString>::OPTIONAL_XML_ATTRIBUTE( wxString aData )
|
||||
{
|
||||
@@ -291,6 +290,55 @@ long long int ECOORD::ConvertToNm( int aValue, enum EAGLE_UNIT aUnit )
|
||||
}
|
||||
|
||||
|
||||
EURN::EURN( const wxString& aUrn )
|
||||
{
|
||||
Parse( aUrn );
|
||||
}
|
||||
|
||||
|
||||
void EURN::Parse( const wxString& aUrn )
|
||||
{
|
||||
wxStringTokenizer tokens( aUrn, ":" );
|
||||
|
||||
host = tokens.GetNextToken();
|
||||
path = tokens.GetNextToken();
|
||||
assetType = tokens.GetNextToken();
|
||||
|
||||
// Split off the version if there is one.
|
||||
wxString tmp = tokens.GetNextToken();
|
||||
|
||||
assetId = tmp.BeforeFirst( '/' );
|
||||
assetVersion = tmp.AfterLast( '/' );
|
||||
}
|
||||
|
||||
|
||||
bool EURN::IsValid() const
|
||||
{
|
||||
if( host != "urn" )
|
||||
return false;
|
||||
|
||||
if( path.IsEmpty() )
|
||||
return false;
|
||||
|
||||
static std::set<wxString> validAssetTypes =
|
||||
{
|
||||
"component",
|
||||
"footprint",
|
||||
"library",
|
||||
"package",
|
||||
"symbol"
|
||||
};
|
||||
|
||||
if( validAssetTypes.count( assetType ) == 0 )
|
||||
return false;
|
||||
|
||||
if( assetId.IsEmpty() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Template specializations below parse wxString to the used types:
|
||||
// - wxString (preferred)
|
||||
// - string
|
||||
@@ -376,6 +424,13 @@ ECOORD Convert<ECOORD>( const wxString& aCoord )
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
EURN Convert<EURN>( const wxString& aUrn )
|
||||
{
|
||||
return EURN( aUrn );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse \a aAttribute of the XML node \a aNode.
|
||||
*
|
||||
@@ -1406,7 +1461,7 @@ EELEMENT::EELEMENT( wxXmlNode* aElement, IO_BASE* aIo ) :
|
||||
y = parseRequiredAttribute<ECOORD>( aElement, "y" );
|
||||
|
||||
// optional
|
||||
library_urn = parseOptionalAttribute<wxString>( aElement, "library_urn" );
|
||||
library_urn = parseOptionalAttribute<EURN>( aElement, "library_urn" );
|
||||
locked = parseOptionalAttribute<bool>( aElement, "locked" );
|
||||
smashed = parseOptionalAttribute<bool>( aElement, "smashed" );
|
||||
rot = parseOptionalAttribute<EROT>( aElement, "rot" );
|
||||
@@ -1471,7 +1526,7 @@ EPART::EPART( wxXmlNode* aPart, IO_BASE* aIo ) :
|
||||
*/
|
||||
name = parseRequiredAttribute<wxString>( aPart, "name" );
|
||||
library = parseRequiredAttribute<wxString>( aPart, "library" );
|
||||
libraryUrn = parseOptionalAttribute<wxString>( aPart, "library_urn" );
|
||||
libraryUrn = parseOptionalAttribute<EURN>( aPart, "library_urn" );
|
||||
deviceset = parseRequiredAttribute<wxString>( aPart, "deviceset" );
|
||||
device = parseRequiredAttribute<wxString>( aPart, "device" );
|
||||
package3d_urn = parseOptionalAttribute<wxString>( aPart, "package3d_urn" );
|
||||
@@ -1717,7 +1772,7 @@ EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet, IO_BASE* aIo ) :
|
||||
* inside boards or schematics -->
|
||||
*/
|
||||
name = parseRequiredAttribute<wxString>( aDeviceSet, "name" );
|
||||
urn = parseOptionalAttribute<wxString>( aDeviceSet, "urn" );
|
||||
urn = parseOptionalAttribute<EURN>( aDeviceSet, "urn" );
|
||||
locally_modified = parseOptionalAttribute<bool>( aDeviceSet, "locally_modified" );
|
||||
prefix = parseOptionalAttribute<wxString>( aDeviceSet, "prefix" );
|
||||
uservalue = parseOptionalAttribute<bool>( aDeviceSet, "uservalue" );
|
||||
@@ -2216,7 +2271,7 @@ EPACKAGE::EPACKAGE( wxXmlNode* aPackage, IO_BASE* aIo ) :
|
||||
* inside boards or schematics -->
|
||||
*/
|
||||
name = parseRequiredAttribute<wxString>( aPackage, "name" );
|
||||
urn = parseOptionalAttribute<wxString>( aPackage, "urn" );
|
||||
urn = parseOptionalAttribute<EURN>( aPackage, "urn" );
|
||||
locally_modified = parseOptionalAttribute<bool>( aPackage, "locally_modified" );
|
||||
library_version = parseOptionalAttribute<int>( aPackage, "library_version" );
|
||||
library_locally_modified = parseOptionalAttribute<bool>( aPackage, "library_locally_modified" );
|
||||
@@ -2349,7 +2404,7 @@ ESYMBOL::ESYMBOL( wxXmlNode* aSymbol, IO_BASE* aIo ) :
|
||||
*/
|
||||
|
||||
name = parseRequiredAttribute<wxString>( aSymbol, "name" );
|
||||
urn = parseOptionalAttribute<wxString>( aSymbol, "urn" );
|
||||
urn = parseOptionalAttribute<EURN>( aSymbol, "urn" );
|
||||
locally_modified = parseOptionalAttribute<bool>( aSymbol, "locally_modified" );
|
||||
library_version = parseOptionalAttribute<int>( aSymbol, "library_version" );
|
||||
library_locally_modified = parseOptionalAttribute<bool>( aSymbol, "library_locally_modified" );
|
||||
@@ -2420,7 +2475,7 @@ ELIBRARY::ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo ) :
|
||||
if( parentNodeName == "libraries" )
|
||||
{
|
||||
name = parseRequiredAttribute<wxString>( aLibrary, "name" );
|
||||
urn = parseOptionalAttribute<wxString>( aLibrary, "urn" );
|
||||
urn = parseOptionalAttribute<EURN>( aLibrary, "urn" );
|
||||
}
|
||||
|
||||
for( wxXmlNode* child = aLibrary->GetChildren(); child; child = child->GetNext() )
|
||||
@@ -2491,6 +2546,24 @@ ELIBRARY::ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo ) :
|
||||
}
|
||||
|
||||
|
||||
wxString ELIBRARY::GetName() const
|
||||
{
|
||||
wxString libName = name;
|
||||
|
||||
// Use the name when no library urn exists.
|
||||
if( !urn )
|
||||
return libName;
|
||||
|
||||
// Suffix the library name with the urn library identifier. Eagle schematics can have
|
||||
// mulitple libraries with the same name. The urn library identifier is used to prevent
|
||||
// library name clashes.
|
||||
if( urn->IsValid() )
|
||||
libName += wxS( "_" ) + urn->assetId;
|
||||
|
||||
return libName;
|
||||
}
|
||||
|
||||
|
||||
EAPPROVED::EAPPROVED( wxXmlNode* aApproved, IO_BASE* aIo ) :
|
||||
EAGLE_BASE( aIo )
|
||||
{
|
||||
@@ -2533,7 +2606,34 @@ ESCHEMATIC::ESCHEMATIC( wxXmlNode* aSchematic, IO_BASE* aIo ) :
|
||||
if( library->GetName() == "library" )
|
||||
{
|
||||
std::unique_ptr<ELIBRARY> tmp = std::make_unique<ELIBRARY>( library, aIo );
|
||||
libraries[ tmp->name ] = std::move( tmp );
|
||||
|
||||
wxString libName = tmp->GetName();
|
||||
|
||||
// Prevent duplicate library names. This should only happen if the Eagle
|
||||
// file has an invalid format.
|
||||
if( libraries.find( libName ) != libraries.end() )
|
||||
{
|
||||
wxString uniqueName;
|
||||
std::set<wxString> usedNames;
|
||||
|
||||
for( const auto& [setName, setLibrary] : libraries )
|
||||
usedNames.emplace( setName );
|
||||
|
||||
if( usedNames.find( libName ) != usedNames.end() )
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
do
|
||||
{
|
||||
uniqueName.Format( wxS( "%s_%d" ), libName, i );
|
||||
i += 1;
|
||||
} while( usedNames.find( uniqueName ) != usedNames.end() );
|
||||
}
|
||||
|
||||
libName = uniqueName;
|
||||
}
|
||||
|
||||
libraries[ libName ] = std::move( tmp );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -386,13 +386,15 @@ VECTOR2I ConvertArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double
|
||||
// Pre-declare for typedefs
|
||||
struct EROT;
|
||||
struct ECOORD;
|
||||
struct EURN;
|
||||
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<wxString> opt_wxString;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<int> opt_int;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<double> opt_double;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<bool> opt_bool;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<EROT> opt_erot;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<ECOORD> opt_ecoord;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<int> opt_int;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<double> opt_double;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<bool> opt_bool;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<EROT> opt_erot;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<ECOORD> opt_ecoord;
|
||||
typedef OPTIONAL_XML_ATTRIBUTE<EURN> opt_eurn;
|
||||
|
||||
|
||||
struct EAGLE_BASE
|
||||
@@ -413,6 +415,45 @@ struct EAGLE_BASE
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Container that parses Eagle library file "urn" definitions.
|
||||
*
|
||||
* According to the eagle.dtd, the "urn" definition is as follows:
|
||||
*
|
||||
* <!ENTITY % Urn "%String;"> <!-- of the form "urn:adsk.eagle:<ASSET_TYPE>:<ASSET_ID>/<VERSION>"
|
||||
* - <ASSET_TYPE> is "symbol", "footprint", "package", "component", or "library"
|
||||
* - <ASSET_ID> is an integer
|
||||
* - <VERSION> is an integer
|
||||
*
|
||||
* The "/<VERSION>" is omitted when referencing the asset without specifying a particular version.
|
||||
* For example, "urn:adsk.eagle:component:60986/2" references version 2 of component 60986 and
|
||||
* "urn:adsk.eagle:library:60968" references library 60986 without specifying a version.
|
||||
*/
|
||||
struct EURN : public EAGLE_BASE
|
||||
{
|
||||
EURN() {}
|
||||
|
||||
/// Parse an Eagle "urn" string.
|
||||
EURN( const wxString& aUrn );
|
||||
|
||||
void Parse( const wxString& aUrn );
|
||||
|
||||
/**
|
||||
* Check if the string passed to the ctor was a valid Eagle urn.
|
||||
*
|
||||
* @retval true if the urn string is valid.
|
||||
* @retval false if the urn string is not valid.
|
||||
*/
|
||||
bool IsValid() const;
|
||||
|
||||
wxString host; ///< Should always be "urn".
|
||||
wxString path; ///< Path to the asset type below.
|
||||
wxString assetType; ///< Must be "symbol", "footprint", "package", "component", or "library".
|
||||
wxString assetId; ///< The unique asset identifier for the asset type.
|
||||
wxString assetVersion; ///< May be empty depending on the asset type.
|
||||
};
|
||||
|
||||
|
||||
// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
|
||||
// For maintenance and troubleshooting purposes, it was thought that we'd need to
|
||||
// separate the conversion process into distinct steps. There is no intent to have KiCad
|
||||
@@ -1282,7 +1323,7 @@ struct EELEMENT : public EAGLE_BASE
|
||||
|
||||
wxString name;
|
||||
wxString library;
|
||||
opt_wxString library_urn;
|
||||
opt_eurn library_urn;
|
||||
wxString package;
|
||||
opt_wxString package3d_urn;
|
||||
opt_wxString override_package3d_urn;
|
||||
@@ -1455,7 +1496,7 @@ struct EPART : public EAGLE_BASE
|
||||
|
||||
wxString name;
|
||||
wxString library;
|
||||
opt_wxString libraryUrn;
|
||||
opt_eurn libraryUrn;
|
||||
wxString deviceset;
|
||||
wxString device;
|
||||
opt_wxString package3d_urn;
|
||||
@@ -1588,7 +1629,7 @@ struct EDEVICE_SET : public EAGLE_BASE
|
||||
*/
|
||||
|
||||
wxString name;
|
||||
opt_wxString urn;
|
||||
opt_eurn urn;
|
||||
opt_bool locally_modified;
|
||||
opt_wxString prefix;
|
||||
opt_bool uservalue;
|
||||
@@ -2005,7 +2046,7 @@ struct EPACKAGE : public EAGLE_BASE
|
||||
* inside boards or schematics -->
|
||||
*/
|
||||
wxString name;
|
||||
opt_wxString urn;
|
||||
opt_eurn urn;
|
||||
opt_bool locally_modified;
|
||||
opt_int library_version;
|
||||
opt_bool library_locally_modified;
|
||||
@@ -2055,7 +2096,7 @@ struct EPACKAGE3D : public EAGLE_BASE
|
||||
* inside boards or schematics -->
|
||||
*/
|
||||
wxString name;
|
||||
wxString urn;
|
||||
EURN urn;
|
||||
wxString type;
|
||||
opt_int library_version;
|
||||
opt_bool library_locally_modified;
|
||||
@@ -2084,7 +2125,7 @@ struct ESYMBOL : public EAGLE_BASE
|
||||
*/
|
||||
|
||||
wxString name;
|
||||
opt_wxString urn;
|
||||
opt_eurn urn;
|
||||
opt_bool locally_modified;
|
||||
opt_int library_version;
|
||||
opt_bool library_locally_modified;
|
||||
@@ -2115,7 +2156,7 @@ struct ELIBRARY : public EAGLE_BASE
|
||||
* <!-- urn: Only in online libraries used inside boards or schematics -->
|
||||
*/
|
||||
wxString name;
|
||||
opt_wxString urn;
|
||||
opt_eurn urn;
|
||||
|
||||
std::optional<EDESCRIPTION> description;
|
||||
std::map<wxString, std::unique_ptr<EPACKAGE>> packages;
|
||||
@@ -2123,6 +2164,12 @@ struct ELIBRARY : public EAGLE_BASE
|
||||
std::map<wxString, std::unique_ptr<ESYMBOL>> symbols;
|
||||
std::map<wxString, std::unique_ptr<EDEVICE_SET>> devicesets;
|
||||
|
||||
/**
|
||||
* Fetch the fully unique library name.
|
||||
*
|
||||
* @return the unique library name.
|
||||
*/
|
||||
wxString GetName() const;
|
||||
ELIBRARY( wxXmlNode* aLibrary, IO_BASE* aIo = nullptr );
|
||||
};
|
||||
|
||||
|
||||
@@ -17,10 +17,16 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "io/kicad/kicad_io_utils.h"
|
||||
|
||||
// For some reason wxWidgets is built with wxUSE_BASE64 unset so expose the wxWidgets
|
||||
// base64 code.
|
||||
#define wxUSE_BASE64 1
|
||||
#include <wx/base64.h>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <kiid.h>
|
||||
#include <io/kicad/kicad_io_utils.h>
|
||||
#include <richio.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
@@ -37,6 +43,29 @@ void FormatUuid( OUTPUTFORMATTER* aOut, const KIID& aUuid )
|
||||
aOut->Print( "(uuid %s)", aOut->Quotew( aUuid.AsString() ).c_str() );
|
||||
}
|
||||
|
||||
|
||||
void FormatStreamData( OUTPUTFORMATTER& aOut, const wxStreamBuffer& aStream )
|
||||
{
|
||||
aOut.Print( "(data" );
|
||||
|
||||
const wxString out = wxBase64Encode( aStream.GetBufferStart(), aStream.GetBufferSize() );
|
||||
|
||||
// Apparently the MIME standard character width for base64 encoding is 76 (unconfirmed)
|
||||
// so use it in a vein attempt to be standard like.
|
||||
static constexpr unsigned MIME_BASE64_LENGTH = 76;
|
||||
|
||||
size_t first = 0;
|
||||
|
||||
while( first < out.Length() )
|
||||
{
|
||||
aOut.Print( "\n\"%s\"", TO_UTF8( out( first, MIME_BASE64_LENGTH ) ) );
|
||||
first += MIME_BASE64_LENGTH;
|
||||
}
|
||||
|
||||
aOut.Print( ")" ); // Closes data token.
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Formatting rules:
|
||||
* - All extra (non-indentation) whitespace is trimmed
|
||||
|
||||
@@ -51,9 +51,9 @@ JOB_EXPORT_PCB_POS::JOB_EXPORT_PCB_POS() :
|
||||
m_excludeFootprintsWithTh( false ),
|
||||
m_excludeDNP( false ),
|
||||
m_negateBottomX( false ),
|
||||
m_side( SIDE::BOTH ),
|
||||
m_singleFile( false ),
|
||||
m_nakedFilename( false ),
|
||||
m_side( SIDE::BOTH ),
|
||||
m_units( UNITS::MILLIMETERS ),
|
||||
m_format( FORMAT::ASCII ),
|
||||
m_gerberBoardEdge( true )
|
||||
|
||||
@@ -120,7 +120,8 @@ static int progressinfo( void* aProgress, double aDLtotal, double aDLnow, double
|
||||
|
||||
|
||||
KICAD_CURL_EASY::KICAD_CURL_EASY() :
|
||||
m_headers( nullptr )
|
||||
m_headers( nullptr ),
|
||||
m_curlSharedLock( KICAD_CURL::Mutex() )
|
||||
{
|
||||
m_CURL = curl_easy_init();
|
||||
|
||||
@@ -200,12 +201,6 @@ KICAD_CURL_EASY::~KICAD_CURL_EASY()
|
||||
|
||||
int KICAD_CURL_EASY::Perform()
|
||||
{
|
||||
std::shared_lock lock( KICAD_CURL::Mutex(), std::try_to_lock );
|
||||
|
||||
// If can't lock, we should be in the process of tearing down.
|
||||
if( !lock )
|
||||
return CURLE_ABORTED_BY_CALLBACK;
|
||||
|
||||
if( m_headers )
|
||||
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
|
||||
|
||||
|
||||
+3
-3
@@ -614,7 +614,7 @@ void KIWAY::SetLanguage( int aLanguage )
|
||||
}
|
||||
|
||||
|
||||
void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
void KIWAY::CommonSettingsChanged( int aFlags )
|
||||
{
|
||||
if( m_ctl & KFCTL_CPP_PROJECT_SUITE )
|
||||
{
|
||||
@@ -624,7 +624,7 @@ void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
EDA_BASE_FRAME* top = static_cast<EDA_BASE_FRAME*>( m_top );
|
||||
|
||||
if( top )
|
||||
top->CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
top->CommonSettingsChanged( aFlags );
|
||||
}
|
||||
|
||||
for( unsigned i=0; i < KIWAY_PLAYER_COUNT; ++i )
|
||||
@@ -632,7 +632,7 @@ void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
KIWAY_PLAYER* frame = GetPlayerFrame( ( FRAME_T )i );
|
||||
|
||||
if( frame )
|
||||
frame->CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
frame->CommonSettingsChanged( aFlags );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-46
@@ -37,36 +37,6 @@ wxString LayerName( int aLayer )
|
||||
|
||||
// Copper
|
||||
case PCB_LAYER_ID::F_Cu: return wxT( "F.Cu" );
|
||||
case PCB_LAYER_ID::In1_Cu: return wxT( "In1.Cu" );
|
||||
case PCB_LAYER_ID::In2_Cu: return wxT( "In2.Cu" );
|
||||
case PCB_LAYER_ID::In3_Cu: return wxT( "In3.Cu" );
|
||||
case PCB_LAYER_ID::In4_Cu: return wxT( "In4.Cu" );
|
||||
case PCB_LAYER_ID::In5_Cu: return wxT( "In5.Cu" );
|
||||
case PCB_LAYER_ID::In6_Cu: return wxT( "In6.Cu" );
|
||||
case PCB_LAYER_ID::In7_Cu: return wxT( "In7.Cu" );
|
||||
case PCB_LAYER_ID::In8_Cu: return wxT( "In8.Cu" );
|
||||
case PCB_LAYER_ID::In9_Cu: return wxT( "In9.Cu" );
|
||||
case PCB_LAYER_ID::In10_Cu: return wxT( "In10.Cu" );
|
||||
case PCB_LAYER_ID::In11_Cu: return wxT( "In11.Cu" );
|
||||
case PCB_LAYER_ID::In12_Cu: return wxT( "In12.Cu" );
|
||||
case PCB_LAYER_ID::In13_Cu: return wxT( "In13.Cu" );
|
||||
case PCB_LAYER_ID::In14_Cu: return wxT( "In14.Cu" );
|
||||
case PCB_LAYER_ID::In15_Cu: return wxT( "In15.Cu" );
|
||||
case PCB_LAYER_ID::In16_Cu: return wxT( "In16.Cu" );
|
||||
case PCB_LAYER_ID::In17_Cu: return wxT( "In17.Cu" );
|
||||
case PCB_LAYER_ID::In18_Cu: return wxT( "In18.Cu" );
|
||||
case PCB_LAYER_ID::In19_Cu: return wxT( "In19.Cu" );
|
||||
case PCB_LAYER_ID::In20_Cu: return wxT( "In20.Cu" );
|
||||
case PCB_LAYER_ID::In21_Cu: return wxT( "In21.Cu" );
|
||||
case PCB_LAYER_ID::In22_Cu: return wxT( "In22.Cu" );
|
||||
case PCB_LAYER_ID::In23_Cu: return wxT( "In23.Cu" );
|
||||
case PCB_LAYER_ID::In24_Cu: return wxT( "In24.Cu" );
|
||||
case PCB_LAYER_ID::In25_Cu: return wxT( "In25.Cu" );
|
||||
case PCB_LAYER_ID::In26_Cu: return wxT( "In26.Cu" );
|
||||
case PCB_LAYER_ID::In27_Cu: return wxT( "In27.Cu" );
|
||||
case PCB_LAYER_ID::In28_Cu: return wxT( "In28.Cu" );
|
||||
case PCB_LAYER_ID::In29_Cu: return wxT( "In29.Cu" );
|
||||
case PCB_LAYER_ID::In30_Cu: return wxT( "In30.Cu" );
|
||||
case PCB_LAYER_ID::B_Cu: return wxT( "B.Cu" );
|
||||
|
||||
// Technicals
|
||||
@@ -93,21 +63,6 @@ wxString LayerName( int aLayer )
|
||||
case PCB_LAYER_ID::F_Fab: return wxT( "F.Fab" );
|
||||
case PCB_LAYER_ID::B_Fab: return wxT( "B.Fab" );
|
||||
|
||||
// User definable layers.
|
||||
case PCB_LAYER_ID::User_1: return wxT( "User.1" );
|
||||
case PCB_LAYER_ID::User_2: return wxT( "User.2" );
|
||||
case PCB_LAYER_ID::User_3: return wxT( "User.3" );
|
||||
case PCB_LAYER_ID::User_4: return wxT( "User.4" );
|
||||
case PCB_LAYER_ID::User_5: return wxT( "User.5" );
|
||||
case PCB_LAYER_ID::User_6: return wxT( "User.6" );
|
||||
case PCB_LAYER_ID::User_7: return wxT( "User.7" );
|
||||
case PCB_LAYER_ID::User_8: return wxT( "User.8" );
|
||||
case PCB_LAYER_ID::User_9: return wxT( "User.9" );
|
||||
case 57: return wxT( "User.10" );
|
||||
case 59: return wxT( "User.11" );
|
||||
case 61: return wxT( "User.12" );
|
||||
case 63: return wxT( "User.13" );
|
||||
|
||||
// Rescue
|
||||
case PCB_LAYER_ID::Rescue: return _( "Rescue" );
|
||||
|
||||
@@ -202,7 +157,11 @@ wxString LayerName( int aLayer )
|
||||
case LAYER_VIA_NETNAMES: return _( "Via net names" );
|
||||
|
||||
default:
|
||||
wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
|
||||
// Catch the general board layers that have numerically increasing names
|
||||
if( aLayer > 0 && aLayer < PCB_LAYER_ID_COUNT && aLayer & 1 )
|
||||
return wxString::Format( wxT( "User.%d" ), ( aLayer - PCB_LAYER_ID::User_1 ) / 2 + 1 );
|
||||
|
||||
return wxString::Format( wxT( "In%d.Cu" ), ( aLayer - PCB_LAYER_ID::In1_Cu ) / 2 + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,13 +168,13 @@ void LIB_TABLE_ROW::SetOptions( const wxString& aOptions )
|
||||
|
||||
|
||||
LIB_TABLE::LIB_TABLE( LIB_TABLE* aFallBackTable, std::unique_ptr<LIB_TABLE_IO> aTableIo ) :
|
||||
m_io( std::move( aTableIo ) ), m_fallBack( aFallBackTable ), m_version( 0 )
|
||||
m_io( std::move( aTableIo ) ),
|
||||
m_fallBack( aFallBackTable ),
|
||||
m_version( 0 )
|
||||
{
|
||||
// If not given, use the default file-based I/O.
|
||||
if( !m_io )
|
||||
{
|
||||
m_io = std::make_unique<FILE_LIB_TABLE_IO>();
|
||||
}
|
||||
|
||||
// not copying fall back, simply search aFallBackTable separately
|
||||
// if "nickName not found".
|
||||
|
||||
+18
-11
@@ -87,17 +87,16 @@ bool LIB_TREE_NODE::Compare( LIB_TREE_NODE const& aNode1, LIB_TREE_NODE const& a
|
||||
return aNode1.m_Type < aNode2.m_Type;
|
||||
|
||||
// Recently used sorts at top
|
||||
if( aNode1.m_Name.StartsWith( wxT( "-- " ) ) )
|
||||
if( aNode1.m_IsRecentlyUsedGroup )
|
||||
{
|
||||
if( aNode2.m_Name.StartsWith( wxT( "-- " ) ) )
|
||||
if( aNode2.m_IsRecentlyUsedGroup )
|
||||
{
|
||||
// Make sure -- Recently Used is always at the top
|
||||
// Start by checking the name of aNode2, because we
|
||||
// want to satisfy the irreflexive property of the
|
||||
// strict weak ordering.
|
||||
if( aNode2.m_Name.StartsWith( wxT( "-- Recently Used" ) ) )
|
||||
// Make sure "-- Recently Used" is always at the top
|
||||
// Start by checking the name of aNode2, because we want to satisfy the irreflexive
|
||||
// property of the strict weak ordering.
|
||||
if( aNode2.m_IsRecentlyUsedGroup )
|
||||
return false;
|
||||
else if( aNode1.m_Name.StartsWith( wxT( "-- Recently Used" ) ) )
|
||||
else if( aNode1.m_IsRecentlyUsedGroup )
|
||||
return true;
|
||||
|
||||
return aNode1.m_IntrinsicRank > aNode2.m_IntrinsicRank;
|
||||
@@ -136,7 +135,9 @@ LIB_TREE_NODE::LIB_TREE_NODE()
|
||||
m_Pinned( false ),
|
||||
m_PinCount( 0 ),
|
||||
m_Unit( 0 ),
|
||||
m_IsRoot( false )
|
||||
m_IsRoot( false ),
|
||||
m_IsRecentlyUsedGroup( false ),
|
||||
m_IsAlreadyPlacedGroup( false )
|
||||
{}
|
||||
|
||||
|
||||
@@ -359,12 +360,18 @@ LIB_TREE_NODE_LIBRARY& LIB_TREE_NODE_ROOT::AddLib( wxString const& aName, wxStri
|
||||
}
|
||||
|
||||
|
||||
void LIB_TREE_NODE_ROOT::RemoveLib( wxString const& aName )
|
||||
void LIB_TREE_NODE_ROOT::RemoveGroup( bool aRecentlyUsedGroup, bool aAlreadyPlacedGroup )
|
||||
{
|
||||
m_Children.erase( std::remove_if( m_Children.begin(), m_Children.end(),
|
||||
[&]( std::unique_ptr<LIB_TREE_NODE>& aNode )
|
||||
{
|
||||
return aNode->m_Name == aName;
|
||||
if( aRecentlyUsedGroup && aNode->m_IsRecentlyUsedGroup )
|
||||
return true;
|
||||
|
||||
if( aAlreadyPlacedGroup && aNode->m_IsAlreadyPlacedGroup )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
} ),
|
||||
m_Children.end() );
|
||||
}
|
||||
|
||||
@@ -127,10 +127,10 @@ LIB_TREE_NODE* LIB_TREE_MODEL_ADAPTER::ToNode( wxDataViewItem aItem )
|
||||
|
||||
LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent,
|
||||
const wxString& aPinnedKey,
|
||||
APP_SETTINGS_BASE* aCfg ) :
|
||||
APP_SETTINGS_BASE::LIB_TREE& aSettingsStruct ) :
|
||||
m_widget( nullptr ),
|
||||
m_parent( aParent ),
|
||||
m_cfg( aCfg ),
|
||||
m_cfg( aSettingsStruct ),
|
||||
m_sort_mode( BEST_MATCH ),
|
||||
m_show_units( true ),
|
||||
m_preselect_unit( 0 ),
|
||||
@@ -143,10 +143,10 @@ LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent,
|
||||
|
||||
m_availableColumns = { _HKI( "Item" ), _HKI( "Description" ) };
|
||||
|
||||
for( const std::pair<const wxString, int>& pair : m_cfg->m_LibTree.column_widths )
|
||||
for( const std::pair<const wxString, int>& pair : m_cfg.column_widths )
|
||||
m_colWidths[pair.first] = pair.second;
|
||||
|
||||
m_shownColumns = m_cfg->m_LibTree.columns;
|
||||
m_shownColumns = m_cfg.columns;
|
||||
|
||||
if( m_shownColumns.empty() )
|
||||
m_shownColumns = { _HKI( "Item" ), _HKI( "Description" ) };
|
||||
@@ -196,13 +196,13 @@ void LIB_TREE_MODEL_ADAPTER::SaveSettings()
|
||||
{
|
||||
if( m_widget )
|
||||
{
|
||||
m_cfg->m_LibTree.columns = GetShownColumns();
|
||||
m_cfg->m_LibTree.column_widths.clear();
|
||||
m_cfg.columns = GetShownColumns();
|
||||
m_cfg.column_widths.clear();
|
||||
|
||||
for( const std::pair<const wxString, wxDataViewColumn*>& pair : m_colNameMap )
|
||||
m_cfg->m_LibTree.column_widths[pair.first] = pair.second->GetWidth();
|
||||
m_cfg.column_widths[pair.first] = pair.second->GetWidth();
|
||||
|
||||
m_cfg->m_LibTree.open_libs = GetOpenLibs();
|
||||
m_cfg.open_libs = GetOpenLibs();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,9 +232,10 @@ LIB_TREE_NODE_LIBRARY& LIB_TREE_MODEL_ADAPTER::DoAddLibraryNode( const wxString&
|
||||
}
|
||||
|
||||
|
||||
void LIB_TREE_MODEL_ADAPTER::DoAddLibrary( const wxString& aNodeName, const wxString& aDesc,
|
||||
const std::vector<LIB_TREE_ITEM*>& aItemList,
|
||||
bool pinned, bool presorted )
|
||||
LIB_TREE_NODE_LIBRARY& LIB_TREE_MODEL_ADAPTER::DoAddLibrary( const wxString& aNodeName,
|
||||
const wxString& aDesc,
|
||||
const std::vector<LIB_TREE_ITEM*>& aItemList,
|
||||
bool pinned, bool presorted )
|
||||
{
|
||||
LIB_TREE_NODE_LIBRARY& lib_node = DoAddLibraryNode( aNodeName, aDesc, pinned );
|
||||
|
||||
@@ -242,12 +243,14 @@ void LIB_TREE_MODEL_ADAPTER::DoAddLibrary( const wxString& aNodeName, const wxSt
|
||||
lib_node.AddItem( item );
|
||||
|
||||
lib_node.AssignIntrinsicRanks( presorted );
|
||||
|
||||
return lib_node;
|
||||
}
|
||||
|
||||
|
||||
void LIB_TREE_MODEL_ADAPTER::DoRemoveLibrary( const wxString& aNodeName )
|
||||
void LIB_TREE_MODEL_ADAPTER::RemoveGroup( bool aRecentGroup, bool aPlacedGroup )
|
||||
{
|
||||
m_tree.RemoveLib( aNodeName );
|
||||
m_tree.RemoveGroup( aRecentGroup, aPlacedGroup );
|
||||
}
|
||||
|
||||
|
||||
@@ -409,6 +412,20 @@ void LIB_TREE_MODEL_ADAPTER::UnpinLibrary( LIB_TREE_NODE* aTreeNode )
|
||||
}
|
||||
|
||||
|
||||
void LIB_TREE_MODEL_ADAPTER::ShowChangedLanguage()
|
||||
{
|
||||
recreateColumns();
|
||||
|
||||
for( const std::unique_ptr<LIB_TREE_NODE>& lib: m_tree.m_Children )
|
||||
{
|
||||
if( lib->m_IsRecentlyUsedGroup )
|
||||
lib->m_Name = wxT( "-- " ) + _( "Recently Used" ) + wxT( " --" );
|
||||
else if( lib->m_IsAlreadyPlacedGroup )
|
||||
lib->m_Name = wxT( "-- " ) + _( "Already Placed" ) + wxT( " --" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxDataViewColumn* LIB_TREE_MODEL_ADAPTER::doAddColumn( const wxString& aHeader, bool aTranslate )
|
||||
{
|
||||
wxString translatedHeader = aTranslate ? wxGetTranslation( aHeader ) : aHeader;
|
||||
|
||||
+47
-6
@@ -224,7 +224,9 @@ wxString LSET::Name( PCB_LAYER_ID aLayerId )
|
||||
|
||||
default:
|
||||
|
||||
if( static_cast<int>( aLayerId ) & 1 )
|
||||
if( aLayerId < 0 )
|
||||
txt = wxT( "UNDEFINED" );
|
||||
else if( static_cast<int>( aLayerId ) & 1 )
|
||||
{
|
||||
int offset = ( aLayerId - Rescue ) / 2;
|
||||
txt = wxString::Format( wxT( "User.%d" ), offset );
|
||||
@@ -572,7 +574,11 @@ LSET LSET::AllCuMask( int aCuLayerCount )
|
||||
|
||||
LSET LSET::AllNonCuMask()
|
||||
{
|
||||
static const LSET saved = LSET().set() & ~AllCuMask();
|
||||
LSET saved = LSET().set();
|
||||
|
||||
for( auto it = saved.copper_layers_begin(); it != saved.copper_layers_end(); ++it )
|
||||
saved.reset( *it );
|
||||
|
||||
return saved;
|
||||
}
|
||||
|
||||
@@ -648,12 +654,21 @@ LSET LSET::PhysicalLayersMask()
|
||||
}
|
||||
|
||||
|
||||
LSET LSET::UserDefinedLayers()
|
||||
LSET LSET::UserDefinedLayersMask( int aUserDefinedLayerCount )
|
||||
{
|
||||
static const LSET saved(
|
||||
{ User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, User_9 } );
|
||||
LSET ret;
|
||||
size_t layer = User_1;
|
||||
|
||||
return saved;
|
||||
for( int ulayer = 1; ulayer <= aUserDefinedLayerCount; ulayer++ )
|
||||
{
|
||||
if( layer > ret.size() )
|
||||
break;
|
||||
|
||||
ret.set( layer );
|
||||
layer += 2;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -882,4 +897,30 @@ LSET::non_copper_layers_iterator LSET::non_copper_layers_end() const
|
||||
}
|
||||
|
||||
|
||||
LSET& LSET::ClearCopperLayers()
|
||||
{
|
||||
for( size_t ii = 0; ii < size(); ii += 2 )
|
||||
reset( ii );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
LSET& LSET::ClearNonCopperLayers()
|
||||
{
|
||||
for( size_t ii = 1; ii < size(); ii += 2 )
|
||||
reset( ii );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
LSET& LSET::ClearUserDefinedLayers()
|
||||
{
|
||||
for( size_t ii = User_1; ii < size(); ii += 2 )
|
||||
reset( ii );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,34 +31,37 @@
|
||||
#include <wx/settings.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/time.h>
|
||||
|
||||
#include <paths.h>
|
||||
|
||||
#include <notifications_manager.h>
|
||||
#include <widgets/kistatusbar.h>
|
||||
#include <widgets/ui_common.h>
|
||||
#include <json_common.h>
|
||||
#include <kiplatform/ui.h>
|
||||
|
||||
#include "core/wx_stl_compat.h"
|
||||
#include <core/wx_stl_compat.h>
|
||||
#include <core/json_serializers.h>
|
||||
#include <core/kicad_algo.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <core/json_serializers.h>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
#include <wx/string.h>
|
||||
|
||||
|
||||
static long long g_last_closed_timer = 0;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE( NOTIFICATION, title, description, href, key, date )
|
||||
|
||||
class NOTIFICATION_PANEL : public wxPanel
|
||||
{
|
||||
public:
|
||||
NOTIFICATION_PANEL( wxWindow* aParent, NOTIFICATIONS_MANAGER* aManager, NOTIFICATION* aNoti ) :
|
||||
wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxSize( -1, 75 ),
|
||||
wxBORDER_SIMPLE ),
|
||||
wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxSize( -1, 75 ), wxBORDER_SIMPLE ),
|
||||
m_hlDetails( nullptr ),
|
||||
m_notification( aNoti ),
|
||||
m_manager( aManager )
|
||||
@@ -68,17 +71,17 @@ public:
|
||||
wxBoxSizer* mainSizer;
|
||||
mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) );
|
||||
wxColour fg, bg;
|
||||
KIPLATFORM::UI::GetInfoBarColours( fg, bg );
|
||||
SetBackgroundColour( bg );
|
||||
SetForegroundColour( fg );
|
||||
|
||||
m_stTitle = new wxStaticText( this, wxID_ANY, aNoti->title );
|
||||
m_stTitle->Wrap( -1 );
|
||||
m_stTitle->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT,
|
||||
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false,
|
||||
wxEmptyString ) );
|
||||
m_stTitle->SetFont( KIUI::GetControlFont( this ).Bold() );
|
||||
mainSizer->Add( m_stTitle, 0, wxALL | wxEXPAND, 1 );
|
||||
|
||||
m_stDescription = new wxStaticText( this, wxID_ANY, aNoti->description, wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
m_stDescription = new wxStaticText( this, wxID_ANY, aNoti->description );
|
||||
m_stDescription->Wrap( -1 );
|
||||
mainSizer->Add( m_stDescription, 0, wxALL | wxEXPAND, 1 );
|
||||
|
||||
@@ -87,22 +90,17 @@ public:
|
||||
|
||||
if( !aNoti->href.IsEmpty() )
|
||||
{
|
||||
m_hlDetails =
|
||||
new wxHyperlinkCtrl( this, wxID_ANY, _( "View Details" ), aNoti->href,
|
||||
wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_hlDetails = new wxHyperlinkCtrl( this, wxID_ANY, _( "View Details" ), aNoti->href );
|
||||
tailSizer->Add( m_hlDetails, 0, wxALL, 2 );
|
||||
}
|
||||
|
||||
m_hlDismiss = new wxHyperlinkCtrl( this, wxID_ANY, _( "Dismiss" ), aNoti->href,
|
||||
wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_hlDismiss = new wxHyperlinkCtrl( this, wxID_ANY, _( "Dismiss" ), aNoti->href );
|
||||
tailSizer->Add( m_hlDismiss, 0, wxALL, 2 );
|
||||
|
||||
mainSizer->Add( tailSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
if( m_hlDetails != nullptr )
|
||||
{
|
||||
m_hlDetails->Bind( wxEVT_HYPERLINK, &NOTIFICATION_PANEL::onDetails, this );
|
||||
}
|
||||
|
||||
m_hlDismiss->Bind( wxEVT_HYPERLINK, &NOTIFICATION_PANEL::onDismiss, this );
|
||||
|
||||
@@ -140,11 +138,12 @@ private:
|
||||
} );
|
||||
}
|
||||
|
||||
wxStaticText* m_stTitle;
|
||||
wxStaticText* m_stDescription;
|
||||
wxHyperlinkCtrl* m_hlDetails;
|
||||
wxHyperlinkCtrl* m_hlDismiss;
|
||||
NOTIFICATION* m_notification;
|
||||
private:
|
||||
wxStaticText* m_stTitle;
|
||||
wxStaticText* m_stDescription;
|
||||
wxHyperlinkCtrl* m_hlDetails;
|
||||
wxHyperlinkCtrl* m_hlDismiss;
|
||||
NOTIFICATION* m_notification;
|
||||
NOTIFICATIONS_MANAGER* m_manager;
|
||||
};
|
||||
|
||||
@@ -163,7 +162,12 @@ public:
|
||||
bSizer1 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition,
|
||||
wxSize( -1, -1 ), wxVSCROLL );
|
||||
wxSize( -1, -1 ), wxVSCROLL | wxBORDER_SIMPLE );
|
||||
wxColour fg, bg;
|
||||
KIPLATFORM::UI::GetInfoBarColours( fg, bg );
|
||||
m_scrolledWindow->SetBackgroundColour( bg );
|
||||
m_scrolledWindow->SetForegroundColour( fg );
|
||||
|
||||
m_scrolledWindow->SetScrollRate( 5, 5 );
|
||||
m_contentSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
@@ -172,9 +176,10 @@ public:
|
||||
m_contentSizer->Fit( m_scrolledWindow );
|
||||
bSizer1->Add( m_scrolledWindow, 1, wxEXPAND | wxALL, 0 );
|
||||
|
||||
m_noNotificationsText = new wxStaticText(
|
||||
m_scrolledWindow, wxID_ANY, _( "There are no notifications available" ),
|
||||
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
m_noNotificationsText = new wxStaticText( m_scrolledWindow, wxID_ANY,
|
||||
_( "There are no notifications available" ),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxALIGN_CENTER_HORIZONTAL );
|
||||
m_noNotificationsText->Wrap( -1 );
|
||||
m_contentSizer->Add( m_noNotificationsText, 1, wxALL | wxEXPAND, 5 );
|
||||
|
||||
@@ -190,9 +195,15 @@ public:
|
||||
|
||||
void onFocusLoss( wxFocusEvent& aEvent )
|
||||
{
|
||||
// check if a child like say, the hyperlink texts got focus
|
||||
if( !IsDescendant( aEvent.GetWindow() ) )
|
||||
if( IsDescendant( aEvent.GetWindow() ) )
|
||||
{
|
||||
// Child (such as the hyperlink texts) got focus
|
||||
}
|
||||
else
|
||||
{
|
||||
Close( true );
|
||||
g_last_closed_timer = wxGetLocalTimeMillis().GetValue();
|
||||
}
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
@@ -277,7 +288,7 @@ void NOTIFICATIONS_MANAGER::Load()
|
||||
if( wxGetEnv( wxT( "KICAD_TEST_NOTI" ), nullptr ) )
|
||||
{
|
||||
CreateOrUpdate( wxS( "test" ), wxS( "Test Notification" ), wxS( "Test please ignore" ),
|
||||
wxS( "https://kicad.org" ) );
|
||||
wxS( "https://kicad.org" ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,15 +335,11 @@ void NOTIFICATIONS_MANAGER::CreateOrUpdate( const wxString& aKey,
|
||||
{
|
||||
// update dialogs
|
||||
for( NOTIFICATIONS_LIST* list : m_shownDialogs )
|
||||
{
|
||||
list->Add( &m_notifications.back() );
|
||||
}
|
||||
}
|
||||
|
||||
for( KISTATUSBAR* statusBar : m_statusBars )
|
||||
{
|
||||
statusBar->SetNotificationCount( m_notifications.size() );
|
||||
}
|
||||
|
||||
Save();
|
||||
}
|
||||
@@ -347,18 +354,14 @@ void NOTIFICATIONS_MANAGER::Remove( const wxString& aKey )
|
||||
} );
|
||||
|
||||
if( it == m_notifications.end() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_shownDialogs.size() > 0 )
|
||||
{
|
||||
// update dialogs
|
||||
|
||||
for( NOTIFICATIONS_LIST* list : m_shownDialogs )
|
||||
{
|
||||
list->Remove( &(*it) );
|
||||
}
|
||||
}
|
||||
|
||||
m_notifications.erase( it );
|
||||
@@ -366,9 +369,7 @@ void NOTIFICATIONS_MANAGER::Remove( const wxString& aKey )
|
||||
Save();
|
||||
|
||||
for( KISTATUSBAR* statusBar : m_statusBars )
|
||||
{
|
||||
statusBar->SetNotificationCount( m_notifications.size() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -376,11 +377,10 @@ void NOTIFICATIONS_MANAGER::onListWindowClosed( wxCloseEvent& aEvent )
|
||||
{
|
||||
NOTIFICATIONS_LIST* evtWindow = dynamic_cast<NOTIFICATIONS_LIST*>( aEvent.GetEventObject() );
|
||||
|
||||
m_shownDialogs.erase( std::remove_if( m_shownDialogs.begin(), m_shownDialogs.end(),
|
||||
[&]( NOTIFICATIONS_LIST* dialog )
|
||||
{
|
||||
return dialog == evtWindow;
|
||||
} ) );
|
||||
alg::delete_if( m_shownDialogs, [&]( NOTIFICATIONS_LIST* dialog )
|
||||
{
|
||||
return dialog == evtWindow;
|
||||
} );
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
@@ -388,12 +388,19 @@ void NOTIFICATIONS_MANAGER::onListWindowClosed( wxCloseEvent& aEvent )
|
||||
|
||||
void NOTIFICATIONS_MANAGER::ShowList( wxWindow* aParent, wxPoint aPos )
|
||||
{
|
||||
// Debounce clicking on the icon with a list already showing. The button will get focus
|
||||
// first, which will cause a focus-loss on the list (thereby closing it), and then we'd open
|
||||
// it again without this guard.
|
||||
if( wxGetLocalTimeMillis().GetValue() - g_last_closed_timer < 300 )
|
||||
{
|
||||
g_last_closed_timer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
NOTIFICATIONS_LIST* list = new NOTIFICATIONS_LIST( this, aParent, aPos );
|
||||
|
||||
for( NOTIFICATION& job : m_notifications )
|
||||
{
|
||||
list->Add( &job );
|
||||
}
|
||||
|
||||
m_shownDialogs.push_back( list );
|
||||
|
||||
@@ -404,6 +411,7 @@ void NOTIFICATIONS_MANAGER::ShowList( wxWindow* aParent, wxPoint aPos )
|
||||
list->SetPosition( aPos - windowSize );
|
||||
|
||||
list->Show();
|
||||
KIPLATFORM::UI::ForceFocus( list );
|
||||
}
|
||||
|
||||
|
||||
@@ -418,9 +426,8 @@ void NOTIFICATIONS_MANAGER::RegisterStatusBar( KISTATUSBAR* aStatusBar )
|
||||
|
||||
void NOTIFICATIONS_MANAGER::UnregisterStatusBar( KISTATUSBAR* aStatusBar )
|
||||
{
|
||||
m_statusBars.erase( std::remove_if( m_statusBars.begin(), m_statusBars.end(),
|
||||
[&]( KISTATUSBAR* statusBar )
|
||||
{
|
||||
return statusBar == aStatusBar;
|
||||
} ) );
|
||||
alg::delete_if( m_statusBars, [&]( KISTATUSBAR* statusBar )
|
||||
{
|
||||
return statusBar == aStatusBar;
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ pdf_metadata
|
||||
pdf_single_document
|
||||
plotframeref
|
||||
plotfptext
|
||||
plot_black_and_white
|
||||
plotinvisibletext
|
||||
plotpadnumbers
|
||||
plotreference
|
||||
|
||||
@@ -777,9 +777,21 @@ void PDF_PLOTTER::ClosePage()
|
||||
auto iuToPdfUserSpace =
|
||||
[&]( const VECTOR2I& aCoord ) -> VECTOR2D
|
||||
{
|
||||
VECTOR2D retval = VECTOR2D( aCoord ) * PTsPERMIL / ( m_IUsPerDecimil * 10 );
|
||||
VECTOR2D pos = VECTOR2D( aCoord ) * PTsPERMIL / ( m_IUsPerDecimil * 10 );
|
||||
|
||||
// PDF y=0 is at bottom of page, invert coordinate
|
||||
retval.y = psPaperSize.y - retval.y;
|
||||
VECTOR2D retval( pos.x, psPaperSize.y - pos.y );
|
||||
|
||||
// The pdf plot can be mirrored (from left to right). So mirror the
|
||||
// x coordinate if m_plotMirror is set
|
||||
if( m_plotMirror )
|
||||
{
|
||||
if( m_mirrorIsHorizontal )
|
||||
retval.x = ( psPaperSize.x - pos.x );
|
||||
else
|
||||
retval.y = pos.y;
|
||||
}
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
|
||||
@@ -164,6 +164,8 @@ void CONSTRUCTION_GEOM::ViewDraw( int aLayer, VIEW* aView ) const
|
||||
|
||||
std::vector<int> CONSTRUCTION_GEOM::ViewGetLayers() const
|
||||
{
|
||||
std::vector<int> layers{ LAYER_GP_OVERLAY };
|
||||
// Don't use LAYER_GP_OVERLAY, we need the construction geometry to be visible
|
||||
// on top of the axis cross
|
||||
std::vector<int> layers{ LAYER_UI_START };
|
||||
return layers;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
|
||||
{
|
||||
m_defaultNetClass = std::make_shared<NETCLASS>( NETCLASS::Default, true );
|
||||
m_defaultNetClass->SetDescription( _( "This is the default net class." ) );
|
||||
m_defaultNetClass->SetPriority( std::numeric_limits<int>::max() );
|
||||
|
||||
auto saveNetclass =
|
||||
[]( nlohmann::json& json_array, const std::shared_ptr<NETCLASS>& nc )
|
||||
@@ -670,7 +671,7 @@ std::shared_ptr<NETCLASS> NET_SETTINGS::GetEffectiveNetClass( const wxString& aN
|
||||
if( ii == m_impicitNetClasses.end() )
|
||||
{
|
||||
std::shared_ptr<NETCLASS> nc = std::make_shared<NETCLASS>( netclass, false );
|
||||
nc->SetPriority( std::numeric_limits<int>().max() - 1 ); // Priority > default netclass
|
||||
nc->SetPriority( std::numeric_limits<int>::max() - 1 ); // Priority > default netclass
|
||||
m_impicitNetClasses[netclass] = nc;
|
||||
return nc;
|
||||
}
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
class PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER : public wxDirTraverser
|
||||
{
|
||||
public:
|
||||
PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER( const std::string& aExtRegex, const wxString& aPrjDir,
|
||||
wxZipOutputStream& aZipFileOutput,
|
||||
PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER( const std::string& aExtRegex, const wxString& aPrjDir, wxZipOutputStream& aZipFileOutput,
|
||||
REPORTER& aReporter, bool aVerbose ) :
|
||||
m_zipFile( aZipFileOutput ),
|
||||
m_prjDir( aPrjDir ),
|
||||
@@ -66,7 +65,6 @@ public:
|
||||
wxFileName package( aFilename );
|
||||
package.MakeRelativeTo( m_prjDir );
|
||||
package.SetExt( wxS( "pkg" ) );
|
||||
KIPLATFORM::IO::LongPathAdjustment( package );
|
||||
|
||||
if( package.Exists() )
|
||||
addFileToZip( package.GetFullPath() );
|
||||
@@ -92,21 +90,13 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void addFileToZip( const wxString& aFilename )
|
||||
void addFileToZip( const wxString& aFilename)
|
||||
{
|
||||
wxString msg;
|
||||
wxFileSystem fsfile;
|
||||
|
||||
wxFileName curr_fn( aFilename );
|
||||
wxFileName curr_prjdir;
|
||||
curr_prjdir.AssignDir( m_prjDir );
|
||||
|
||||
KIPLATFORM::IO::LongPathAdjustment( curr_fn );
|
||||
KIPLATFORM::IO::LongPathAdjustment( curr_prjdir );
|
||||
|
||||
// Note: MakeRelativeTo() works only if curr_fn and curr_prjdir use the same
|
||||
// long path adjustment (no long path of both use long path)
|
||||
curr_fn.MakeRelativeTo( curr_prjdir.GetFullPath() );
|
||||
curr_fn.MakeRelativeTo( m_prjDir );
|
||||
|
||||
wxString currFilename = curr_fn.GetFullPath();
|
||||
|
||||
@@ -155,12 +145,10 @@ private:
|
||||
unsigned long m_uncompressedBytes = 0;
|
||||
};
|
||||
|
||||
|
||||
PROJECT_ARCHIVER::PROJECT_ARCHIVER()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool PROJECT_ARCHIVER::AreZipArchivesIdentical( const wxString& aZipFileA,
|
||||
const wxString& aZipFileB, REPORTER& aReporter )
|
||||
{
|
||||
@@ -250,7 +238,6 @@ bool PROJECT_ARCHIVER::Unarchive( const wxString& aSrcFile, const wxString& aDes
|
||||
// Now let's set the filetimes based on what's in the zip
|
||||
wxFileName outputFileName( fullname );
|
||||
wxDateTime fileTime = entry->GetDateTime();
|
||||
|
||||
// For now we set access, mod, create to the same datetime
|
||||
// create (third arg) is only used on Windows
|
||||
outputFileName.SetTimes( &fileTime, &fileTime, &fileTime );
|
||||
@@ -331,7 +318,7 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
|
||||
wxString oldCwd = wxGetCwd();
|
||||
|
||||
wxFileName sourceDir( aSrcDir );
|
||||
KIPLATFORM::IO::LongPathAdjustment( sourceDir );
|
||||
|
||||
wxSetWorkingDirectory( sourceDir.GetFullPath() );
|
||||
|
||||
wxFFileOutputStream ostream( aDestFile );
|
||||
@@ -364,7 +351,7 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
|
||||
try
|
||||
{
|
||||
PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER traverser( fileExtensionRegex, aSrcDir, zipstream,
|
||||
aReporter, aVerbose );
|
||||
aReporter, aVerbose );
|
||||
|
||||
projectDir.Traverse( traverser );
|
||||
|
||||
|
||||
@@ -191,8 +191,6 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "git.repo_username", &m_GitRepoUsername, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "git.repo_password", &m_GitRepoPassword, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "git.repo_type", &m_GitRepoType, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "git.ssh_key", &m_GitSSHKey, "" ) );
|
||||
|
||||
@@ -605,8 +605,12 @@ wxValidator* PGPROPERTY_ANGLE::DoGetValidator() const
|
||||
|
||||
wxSize PGPROPERTY_COLORENUM::OnMeasureImage( int aItem ) const
|
||||
{
|
||||
// TODO(JE) calculate size from window metrics?
|
||||
return wxSize( 16, 12 );
|
||||
wxSize size( 16, -1 );
|
||||
|
||||
if( wxPropertyGrid* pg = GetGrid() )
|
||||
size = pg->FromDIP( size );
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-1
@@ -25,6 +25,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <mutex>
|
||||
#include <macros.h>
|
||||
#include <reporter.h>
|
||||
#include <string_utils.h>
|
||||
@@ -42,6 +43,8 @@
|
||||
*/
|
||||
static const wxChar traceReporter[] = wxT( "KICAD_REPORTER" );
|
||||
|
||||
static std::mutex g_logReporterMutex;
|
||||
|
||||
|
||||
REPORTER& REPORTER::Report( const char* aText, SEVERITY aSeverity )
|
||||
{
|
||||
@@ -199,6 +202,7 @@ REPORTER& WXLOG_REPORTER::Report( const wxString& aMsg, SEVERITY aSeverity )
|
||||
REPORTER& WXLOG_REPORTER::GetInstance()
|
||||
{
|
||||
static REPORTER* s_wxLogReporter = nullptr;
|
||||
std::lock_guard lock( g_logReporterMutex );
|
||||
|
||||
if( !s_wxLogReporter )
|
||||
s_wxLogReporter = new WXLOG_REPORTER();
|
||||
@@ -222,4 +226,4 @@ bool STATUSBAR_REPORTER::HasMessage() const
|
||||
return !m_statusBar->GetStatusText( m_position ).IsEmpty();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user