7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-03-30 05:16:58 +00:00

Revert "Header folder housekeeping."

This reverts commit d1898aab47.
This commit is contained in:
Wayne Stambaugh 2025-01-08 12:19:50 -05:00
parent 954e194f77
commit f74d97d2e1
45 changed files with 640 additions and 817 deletions

View File

@ -728,12 +728,12 @@ private:
ADVANCED_CFG();
/**
* Load the config from the normal configuration file.
* Load the config from the normal config file
*/
void loadFromConfigFile();
/**
* Load config from the given configuration base.
/*
* Load config from the given config base
*/
void loadSettings( wxConfigBase& aCfg );
};

View File

@ -43,14 +43,12 @@ public:
{
NUMBERING_NUMERIC = 0, ///< Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11...
NUMBERING_HEX,
/**
* Alphabet, excluding IOSQXZ
*
* Per ASME Y14.35M-1997 sec. 5.2 (previously MIL-STD-100 sec. 406.5) as these can be
* confused with numerals and are often not used for pin numbering on BGAs, etc.
*/
NUMBERING_ALPHA_NO_IOSQXZ,
NUMBERING_ALPHA_NO_IOSQXZ, /*!< Alphabet, excluding IOSQXZ
*
* Per ASME Y14.35M-1997 sec. 5.2 (previously MIL-STD-100 sec. 406.5)
* as these can be confused with numerals and are often not used
* for pin numbering on BGAs, etc
*/
NUMBERING_ALPHA_FULL, ///< Full 26-character alphabet
};
@ -58,19 +56,19 @@ public:
/**
* Get the alphabet for the current numbering scheme.
* @param type the numbering scheme.
* @return the alphabet (as a string).
* @param type the numbering scheme
* @return the alphabet (as a string)
*/
const wxString& GetAlphabet() const;
/**
* Set the axis numbering type.
* Set the axis numbering type
*/
void SetAxisType( NUMBERING_TYPE aType );
/**
* Set the axis start (as a string, which should decode to a valid index
* in the alphabet),
* in the alphabet)
*/
bool SetOffset( const wxString& aOffsetName );
@ -78,28 +76,28 @@ public:
* Set the start offset for the series (e.g. 0 to start at 0/A, 4 to start
* at 4/E).
*
* @param aOffset offset of the first item in the.
* @param aOffset offset of the first item in the
*/
void SetOffset( int aOffset );
/**
* Get the numbering offset for the axis
*
* @return the current offset.
* @return the current offset
*/
int GetOffset() const;
/**
* Set the skip between consecutive numbers (useful when doing a partial
* array, e.g. only one side of a connector).
* array, e.g. only one side of a connector)
*/
void SetStep( int aStep );
/**
* Get the position number (name) for the n'th axis point
*
* @param n array point index, from 0.
* @return the point's name.
* @param n array point index, from 0
* @return the point's name
*/
wxString GetItemNumber( int n ) const;
@ -107,16 +105,16 @@ private:
/**
* Get the numbering offset for a given numbering string
*
* @param str is a numbering string, say "B" or "5".
* @return the offset, if found, else empty.
* @param str a numbering string, say "B" or "5"
* @return the offset, if found, else empty
*/
std::optional<int> getNumberingOffset( const wxString& str ) const;
NUMBERING_TYPE m_type;
int m_offset;
/// Skip every 'n' numbers.
///< Skip every 'n' numbers
int m_step;
};
#endif // ARRAY_AXIS__H
#endif // ARRAY_AXIS__H

View File

@ -31,7 +31,6 @@
/**
* Options that govern the setup of an "array" of multiple item.
*
* The base #ARRAY_OPTIONS do not encode a specific geometry or numbering
* method, this is done by derived classes.
*/
@ -55,7 +54,7 @@ public:
virtual ~ARRAY_OPTIONS(){};
/**
* Transform applied to an object by this array.
* Transform applied to an object by this array
*/
struct TRANSFORM
{
@ -64,29 +63,28 @@ public:
};
/**
* Get the transform of the n-th point in the array.
*
* @param aN the index of the array point (0 is the original point).
* @param aPos the existing item position.
* @return a transform (an offset and a rotation)/
* Get the transform of the n-th point in the array
* @param aN the index of the array point (0 is the original point)
* @param aPos the existing item position
* @return a transform (an offset and a rotation)
*/
virtual TRANSFORM GetTransform( int aN, const VECTOR2I& aPos ) const = 0;
/**
* The number of points in this array.
* The number of points in this array
*/
virtual int GetArraySize() const = 0;
/**
* Get the position number (name) for the n'th array point.
*
* @param n array point index, from 0 to GetArraySize() - 1.
* @return the point's name.
* Get the position number (name) for the n'th array point
* @param n array point index, from 0 to GetArraySize() - 1
* @return the point's name
*/
virtual wxString GetItemNumber( int n ) const = 0;
/**
* @return are the items in this array numbered, or are all the items numbered the same?
/*!
* @return are the items in this array numbered, or are all the
* items numbered the same?
*/
bool ShouldNumberItems() const
{
@ -98,7 +96,7 @@ public:
m_shouldNumber = aShouldNumber;
}
/**
/*!
* @return are the footprints in this array reannotated to be unique (true), or do they
* keep the original annotation (false)?
*/
@ -112,7 +110,7 @@ public:
m_reannotateFootprints = aShouldReannotate;
}
/**
/*!
* @return is the numbering is enabled and should start at a point
* specified in these options or is it implicit according to the calling
* code?
@ -191,7 +189,6 @@ struct KICOMMON_API ARRAY_CIRCULAR_OPTIONS : public ARRAY_OPTIONS
/// number of point in the array
long m_nPts;
/// angle between points, or 0 for each point separated by this value (decideg)
EDA_ANGLE m_angle;
VECTOR2I m_centre;

View File

@ -212,8 +212,7 @@ public:
// Define less-than operator for comparison
bool operator<( const BASE_SET& other ) const
{
return alg::lexicographical_compare_three_way( begin(), end(), other.begin(),
other.end() ) < 0;
return alg::lexicographical_compare_three_way( begin(), end(), other.begin(), other.end() ) < 0;
}
/**
@ -284,12 +283,10 @@ public:
/**
* Convert the output of FmtHex() and replaces this set's values
* with those given in the input string.
*
* Parsing stops at the first non hex ASCII byte, except that marker bytes output from
* FmtHex() are not terminators.
*
* @return the number of bytes consumed.
* with those given in the input string. Parsing stops at the first
* non hex ASCII byte, except that marker bytes output from FmtHex are
* not terminators.
* @return int - number of bytes consumed
*/
int ParseHex( const std::string& str )
{
@ -298,12 +295,10 @@ public:
/**
* Convert the output of FmtHex() and replaces this set's values
* with those given in the input string.
*
* Parsing stops at the first non hex ASCII byte, except that marker bytes output from
* FmtHex() are not terminators.
*
* @return number of bytes consumed.
* with those given in the input string. Parsing stops at the first
* non hex ASCII byte, except that marker bytes output from FmtHex are
* not terminators.
* @return int - number of bytes consumed
*/
int ParseHex( const char* aStart, int aCount )
{

View File

@ -66,10 +66,10 @@
* unit used in pcbnew, cvpcb or gerbview (nanometer or deci-mil) depending on compile time option
*/
constexpr double GERB_IU_PER_MM = 1e5; ///< Gerbview IU is 10 nanometers.
constexpr double PCB_IU_PER_MM = 1e6; ///< Pcbnew IU is 1 nanometer.
constexpr double PL_IU_PER_MM = 1e3; ///< Internal units in micron (should be enough).
constexpr double SCH_IU_PER_MM = 1e4; ///< Schematic internal units 1=100nm.
constexpr double GERB_IU_PER_MM = 1e5; // Gerbview IU is 10 nanometers.
constexpr double PCB_IU_PER_MM = 1e6; // Pcbnew IU is 1 nanometer.
constexpr double PL_IU_PER_MM = 1e3; // internal units in micron (should be enough)
constexpr double SCH_IU_PER_MM = 1e4; // Schematic internal units 1=100nm
struct EDA_IU_SCALE
{

View File

@ -251,7 +251,7 @@ public:
void UpdateImageDataBuffer();
private:
/**
/*
* Rebuild the internal bitmap used to draw/plot image.
*
* This must be called after a #m_image change.
@ -262,18 +262,19 @@ private:
void updatePPI();
double m_scale; ///< The scaling factor of the bitmap
///< with #m_pixelSizeIu, controls the actual draw size.
wxMemoryBuffer m_imageData; ///< The original image data in its original format.
wxBitmapType m_imageType; ///< The image type (png, jpeg, etc.).
double m_scale; // The scaling factor of the bitmap
// With m_pixelSizeIu, controls the actual draw size
wxMemoryBuffer m_imageData; // The original image data, in its original format
wxBitmapType m_imageType; // the image type (png, jpeg, etc.)
wxImage* m_image; ///< The raw, uncompressed image data.
wxImage* m_originalImage; ///< Raw image data, not transformed by rotate/mirror.
wxBitmap* m_bitmap; ///< The bitmap used to draw/plot image.
double m_pixelSizeIu; ///< The scaling factor of the bitmap to convert the bitmap
///< size (in pixels) to internal KiCad units. This usually
///< does not change.
int m_ppi; ///< The bitmap definition. The default is 300PPI.
wxImage* m_image; // the raw, uncompressed image data
wxImage* m_originalImage; // Raw image data, not transformed by rotate/mirror
wxBitmap* m_bitmap; // the bitmap used to draw/plot image
double m_pixelSizeIu; // The scaling factor of the bitmap
// to convert the bitmap size (in pixels)
// to internal KiCad units
// Usually does not change
int m_ppi; // the bitmap definition. the default is 300PPI
KIID m_imageId;
bool m_isMirroredX; // Used for OpenGL rendering only
bool m_isMirroredY; // Used for OpenGL rendering only

View File

@ -105,9 +105,9 @@
#define MINIMUM_LINE_WIDTH_MM 0.005 // minimal line width entered in a dialog
#define MAXIMUM_LINE_WIDTH_MM 100.0 // max line width entered in a dialog
// Default pad properties
// Default pad properies
#define DEFAULT_PAD_WIDTH_MM 2.54 // master pad width
#define DEFAULT_PAD_HEIGTH_MM 1.27 // master pad height
#define DEFAULT_PAD_HEIGTH_MM 1.27 // master pad heigth
#define DEFAULT_PAD_DRILL_DIAMETER_MM 0.8 // master pad drill diameter for PTH
#define DEFAULT_PAD_REACT_RADIUS 15 // master pad corner radius in percent
@ -476,7 +476,7 @@ public:
* Sets custom track width for differential pairs (i.e. not available in netclasses or
* preset list).
*
* @param aDrill is the new track width.
* @param aDrill is the new track wdith.
*/
inline void SetCustomDiffPairWidth( int aWidth )
{
@ -619,7 +619,7 @@ public:
inline int GetBoardThickness() const { return m_boardThickness; }
inline void SetBoardThickness( int aThickness ) { m_boardThickness = aThickness; }
/**
/*
* Return an epsilon which accounts for rounding errors, etc.
*
* While currently an advanced cfg, going through this API allows us to easily change
@ -673,10 +673,8 @@ public:
std::vector<VIA_DIMENSION> m_ViasDimensionsList;
std::vector<DIFF_PAIR_DIMENSION> m_DiffPairDimensionsList;
/**
* The parameters of teardrops for the different teardrop targets (via/pad, track end).
*
* 3 set of parameters always exist: for round shapes, for rect shapes, for track ends.
/** The parameters of teardrops for the different teardrop targets (via/pad, track end)
* 3 set of parameters always exist: for round shapes, for rect shapes, for track ends
*/
TEARDROP_PARAMETERS_LIST m_TeardropParamsList;
@ -801,15 +799,13 @@ private:
/// This is also the last used netclass after starting a track.
wxString m_currentNetClassName;
/**
* The description of layers stackup, for board fabrication only physical layers are in
* layers stackup.
*
* It includes not only layers enabled for the board edition, but also dielectric layers.
/** the description of layers stackup, for board fabrication
* only physical layers are in layers stackup.
* It includes not only layers enabled for the board edition, but also dielectric layers
*/
BOARD_STACKUP m_stackup;
/// The default settings that will be used for new zones.
/// The default settings that will be used for new zones
ZONE_SETTINGS m_defaultZoneSettings;
};

View File

@ -140,7 +140,7 @@ public:
* object. The scale runs from 0.0 (definitely different objects) to 1.0 (same)
*
* This is a pure virtual function. Derived classes must implement this.
*/
*/
virtual double Similarity( const BOARD_ITEM& aItem ) const = 0;
virtual bool operator==( const BOARD_ITEM& aItem ) const = 0;
@ -201,14 +201,12 @@ public:
/**
* Invoke a function on all children.
*
* @note This function should not add or remove items to the parent.
*/
virtual void RunOnChildren( const std::function<void ( BOARD_ITEM* )>& aFunction ) const { }
/**
* Invoke a function on all descendants.
*
* @note This function should not add or remove items.
*/
virtual void RunOnDescendants( const std::function<void ( BOARD_ITEM* )>& aFunction,

View File

@ -93,31 +93,31 @@ public:
int aPageNum = 1, int aPageCount = 1 );
protected:
/// Convert mils to internal units.
///< Convert mils to internal units
virtual int milsToIU( double aMils ) const = 0;
/// Enable layers visibility for a printout.
///< Enables layers visibility for a printout
virtual void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet );
/// Configure #PAINTER object for a printout.
///< Configures PAINTER object for a printout
virtual void setupPainter( KIGFX::PAINTER& aPainter );
/// Configure #GAL object for a printout.
///< Configures GAL object for a printout
virtual void setupGal( KIGFX::GAL* aGal );
/// Return bounding box of the printed objects (excluding drawing-sheet frame).
///< Returns bounding box of the printed objects (excluding drawing-sheet frame)
virtual BOX2I getBoundingBox() = 0;
/// Return the #PAINTER instance used to draw the items.
///< Returns a PAINTER instance used to draw the items.
virtual std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) = 0;
/// Source VIEW object (note that actual printing only refers to this object).
///< Source VIEW object (note that actual printing only refers to this object)
const KIGFX::VIEW* m_view;
/// Printout parameters.
///< Printout parameters
BOARD_PRINTOUT_SETTINGS m_settings;
/// True if the caller is Gerbview, false for Pcbnew.
/// True if the caller is Gerbview, false for Pcbnew
bool m_gerbviewPrint;
};

View File

@ -76,19 +76,19 @@ public:
COMMIT();
virtual ~COMMIT();
/// Add a new item to the model.
///< Add a new item to the model
COMMIT& Add( EDA_ITEM* aItem, BASE_SCREEN *aScreen = nullptr )
{
return Stage( aItem, CHT_ADD, aScreen );
}
/// Notify observers that aItem has been added.
///< Notify observers that aItem has been added
COMMIT& Added( EDA_ITEM* aItem, BASE_SCREEN *aScreen = nullptr )
{
return Stage( aItem, CHT_ADD | CHT_DONE, aScreen );
}
/// Remove a new item from the model.
///< Remove a new item from the model
COMMIT& Remove( EDA_ITEM* aItem, BASE_SCREEN *aScreen = nullptr )
{
return Stage( aItem, CHT_REMOVE, aScreen );
@ -100,21 +100,15 @@ public:
return Stage( aItem, CHT_REMOVE | CHT_DONE, aScreen );
}
/**
* Modify a given item in the model.
*
* @note Must be called before modification is performed.
*/
///< Modify a given item in the model.
///< Must be called before modification is performed.
COMMIT& Modify( EDA_ITEM* aItem, BASE_SCREEN *aScreen = nullptr )
{
return Stage( aItem, CHT_MODIFY, aScreen );
}
/**
* Create an undo entry for an item that has been already modified.
*
* @note Requires a copy done before the modification.
*/
///< Create an undo entry for an item that has been already modified. Requires a copy done
///< before the modification.
COMMIT& Modified( EDA_ITEM* aItem, EDA_ITEM* aCopy, BASE_SCREEN *aScreen = nullptr )
{
return createModified( aItem, aCopy, 0, aScreen );
@ -130,7 +124,7 @@ public:
return *this;
}
/// Add a change of the item aItem of type aChangeType to the change list.
///< Add a change of the item aItem of type aChangeType to the change list.
virtual COMMIT& Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType,
BASE_SCREEN *aScreen = nullptr );
@ -141,10 +135,10 @@ public:
UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED,
BASE_SCREEN *aScreen = nullptr );
/// Execute the changes.
///< Execute the changes.
virtual void Push( const wxString& aMessage = wxT( "A commit" ), int aFlags = 0 ) = 0;
/// Revert the commit by restoring the modified items state.
///< Revert the commit by restoring the modified items state.
virtual void Revert() = 0;
bool Empty() const
@ -152,7 +146,7 @@ public:
return m_changes.empty();
}
/// Returns status of an item.
///< Returns status of an item.
int GetStatus( EDA_ITEM* aItem, BASE_SCREEN *aScreen = nullptr );
EDA_ITEM* GetFirst() const { return m_changes.empty() ? nullptr : m_changes[0].m_item; }
@ -167,7 +161,7 @@ protected:
BASE_SCREEN* m_screen;
};
/// Should be called in Push() & Revert() methods
// Should be called in Push() & Revert() methods
void clear()
{
m_changedItems.clear();

View File

@ -21,31 +21,27 @@
#pragma once
// These flags are used to control the data items that must be disabled when creating
// mainly a netlist but also some other KiCad files.
// mainly a netlist but also some other kicad files.
// They allow skipping specified data in these files.
#define CTL_OMIT_EXTRA (1 << 0)
#define CTL_OMIT_NETS (1 << 1)
#define CTL_OMIT_PAD_NETS (1 << 1) ///< Omit pads net names (useless in library).
#define CTL_OMIT_PAD_NETS (1 << 1) ///< Omit pads net names (useless in library)
#define CTL_OMIT_UUIDS (1 << 2) ///< Omit component unique ids (useless in library)
#define CTL_OMIT_FP_UUID (1 << 3) ///< Don't prefix the footprint UUID to the sheet
///< path.
#define CTL_OMIT_PATH (1 << 4) ///< Omit component sheet time stamp (useless in
///< library).
#define CTL_OMIT_FP_UUID (1 << 3) ///< Don't prefix the footprint UUID to the sheet path.
#define CTL_OMIT_PATH (1 << 4) ///< Omit component sheet time stamp (useless in library)
#define CTL_OMIT_AT (1 << 5) ///< Omit position and rotation. (always saved
///< with position 0,0 and rotation = 0 in library).
// If set, when calling EDA_TEXT::Format, disable writing the "hide" keyword in save file.
#define CTL_OMIT_HIDE (1 << 6) ///< Omit the hide attribute in .kicad_xxx files.
// If set, when calling EDA_TEXT::Format, disable writing the "hide" keyword in save file
#define CTL_OMIT_HIDE (1 << 6) ///< Omit the hide attribute in .kicad_xxx files
#define CTL_OMIT_LIBNAME (1 << 7) ///< Omit lib alias when saving (used for
///< board/not library)..
///< board/not library).
#define CTL_OMIT_FOOTPRINT_VERSION (1 << 8) ///< Omit the version string from the (footprint)
///< sexpr group.
#define CTL_OMIT_FILTERS (1 << 9) ///< Omit the ki_fp_filters attribute in
///< .kicad_xxx files.
#define CTL_OMIT_INITIAL_COMMENTS (1 << 10) ///< Omit #FOOTPRINT initial comments.
///< sexpr group
#define CTL_OMIT_FILTERS (1 << 9) ///< Omit the ki_fp_filters attribute in .kicad_xxx files
#define CTL_OMIT_INITIAL_COMMENTS (1 << 10) ///< omit FOOTPRINT initial comments
#define CTL_OMIT_COLOR (1 << 11) ///< Omit the color attribute in .kicad_xxx files.
#define CTL_OMIT_HYPERLINK (1 << 12) ///< Omit the hyperlink attribute in .kicad_xxx
///< files.
#define CTL_OMIT_COLOR (1 << 11) ///< Omit the color attribute in .kicad_xxx files
#define CTL_OMIT_HYPERLINK (1 << 12) ///< Omit the hyperlink attribute in .kicad_xxx files

View File

@ -53,7 +53,7 @@ public:
bool operator!=( const DESIGN_BLOCK_LIB_TABLE_ROW& aRow ) const { return !( *this == aRow ); }
/**
* Return the type of design block library table represented by this row.
* return the type of design block library table represented by this row.
*/
const wxString GetType() const override { return DESIGN_BLOCK_IO_MGR::ShowType( type ); }
@ -110,14 +110,14 @@ public:
bool operator!=( const DESIGN_BLOCK_LIB_TABLE& r ) const { return !( *this == r ); }
/**
* Return an #DESIGN_BLOCK_LIB_TABLE_ROW if \a aNickName is found in this table or in any
* chained fall back table fragment.
* Return an #DESIGN_BLOCK_LIB_TABLE_ROW if \a aNickName is found in this table or in any chained
* fall back table fragment.
*
* If \a aCheckIfEnabled is true, the library will be ignored even if it is disabled.
* Otherwise, the row found will be returned even if entry is disabled.
*
* The #PLUGIN is loaded and attached to the "plugin" field of the #DESIGN_BLOCK_LIB_TABLE_ROW
* if not already loaded.
* The #PLUGIN is loaded and attached to the "plugin" field of the #DESIGN_BLOCK_LIB_TABLE_ROW if
* not already loaded.
*
* @param aNickName is the name of library nickname to find.
* @param aCheckIfEnabled is the flag to check if the library found is enabled.
@ -130,8 +130,7 @@ public:
/**
* Return a list of design block names contained within the library given by @a aNickname.
*
* @param aDesignBlockNames is the list to fill with the design block names found in
* \a aNickname.
* @param aDesignBlockNames is the list to fill with the design block names found in \a aNickname
* @param aNickname is a locator for the "library", it is a "name" in LIB_TABLE_ROW.
* @param aBestEfforts if true, don't throw on errors.
*
@ -219,8 +218,7 @@ public:
* @param aNickname is a locator for the "library", it is a "name" in #LIB_TABLE_ROW.
* @param aDesignBlockName is the name of a design block to delete from the specified library.
*
* @throw IO_ERROR if there is a problem finding the design block or the library, or deleting
* it.
* @throw IO_ERROR if there is a problem finding the design block or the library, or deleting it.
*/
void DesignBlockDelete( const wxString& aNickname, const wxString& aDesignBlockName );
@ -281,7 +279,7 @@ public:
* Return the name of the environment variable used to hold the directory of
* locally installed "KiCad sponsored" system design block libraries.
*
* These can be either legacy or pretty format. The only thing special about this
*These can be either legacy or pretty format. The only thing special about this
* particular environment variable is that it is set automatically by KiCad on
* program start up, <b>if</b> it is not set already in the environment.
*/

View File

@ -58,46 +58,43 @@ public:
/**
* Get the content scale factor, which may be different from the scale
* factor on some platforms.
*
* This value should be used for scaling user interface elements (fonts, icons, etc) whereas
* the scale factor should be used for scaling canvases.
* factor on some platforms. This value should be used for scaling
* user interface elements (fonts, icons, etc) whereas the scale
* factor should be used for scaling canvases.
*/
virtual double GetContentScaleFactor() const = 0;
/**
* Is the current value auto scaled or is it user-set in the config.
* Is the current value auto scaled, or is it user-set in the config
*/
virtual bool GetCanvasIsAutoScaled() const = 0;
/**
* Set the common DPI config in a given config object.
* Set the common DPI config in a given config object
*
* The encoding of the automatic/manual nature of the config is handled internally.
*
* @param aAuto store a value meaning "no user-set scale".
* @param aValue the value to store (ignored if aAuto set).
* @param aAuto store a value meaning "no user-set scale"
* @param aValue the value to store (ignored if aAuto set)
*/
virtual void SetDpiConfig( bool aAuto, double aValue ) = 0;
/**
/*
* Get the maximum scaling factor that should be presented to the user.
*
* This is only advisory, it has no real technical use other than for validation.
*/
static double GetMaxScaleFactor();
/**
/*
* Get the minimum scaling factor that should be presented to the user.
*
* This is only advisory, it has no real technical use other than for validation.
*/
static double GetMinScaleFactor();
/**
* Get the "default" scaling factor to use if not other config is available.
* Get the "default" scaling factor to use if not other config is available
*/
static double GetDefaultScaleFactor();
};
#endif // DPI_SCALING__H
#endif // DPI_SCALING__H

View File

@ -528,17 +528,17 @@ protected:
return parseDouble( GetTokenText( aToken ) );
}
bool iOwnReaders; ///< On readerStack, should I delete them?
bool iOwnReaders; ///< on readerStack, should I delete them?
const char* start;
const char* next;
const char* limit;
char dummy[1]; ///< When there is no reader.
char dummy[1]; ///< when there is no reader.
typedef std::vector<LINE_READER*> READER_STACK;
READER_STACK readerStack; ///< all the LINE_READERs by pointer.
/// No ownership. ownership is via readerStack, maybe, if #iOwnReaders.
///< no ownership. ownership is via readerStack, maybe, if iOwnReaders
LINE_READER* reader;
bool specctraMode; ///< if true, then:
@ -548,19 +548,19 @@ protected:
///< else not.
char stringDelimiter;
bool space_in_quoted_tokens; ///< Blank spaces within quoted strings.
bool space_in_quoted_tokens; ///< blank spaces within quoted strings
bool commentsAreTokens; ///< True if should return comments as tokens.
bool commentsAreTokens; ///< true if should return comments as tokens
int prevTok; ///< #curTok from previous NextTok() call.
int curOffset; ///< Offset within current line of the current token
int prevTok; ///< curTok from previous NextTok() call.
int curOffset; ///< offset within current line of the current token
int curTok; ///< The current token obtained on last NextTok().
std::string curText; ///< The text of the current token.
int curTok; ///< the current token obtained on last NextTok()
std::string curText; ///< the text of the current token
const KEYWORD* keywords; ///< Table sorted by CMake for bsearch().
unsigned keywordCount; ///< Count of keywords table.
const KEYWORD_MAP* keywordsLookup; ///< Fast, specialized "C string" hashtable.
const KEYWORD* keywords; ///< table sorted by CMake for bsearch()
unsigned keywordCount; ///< count of keywords table
const KEYWORD_MAP* keywordsLookup; ///< fast, specialized "C string" hashtable
#endif // SWIG
};

View File

@ -108,7 +108,7 @@ class EDA_BASE_FRAME : public wxFrame, public TOOLS_HOLDER, public KIWAY_HOLDER,
{
public:
/**
* Specify whether we are interacting with the undo or redo stacks.
* Specifies whether we are interacting with the undo or redo stacks
*/
enum UNDO_REDO_LIST
{
@ -216,7 +216,7 @@ public:
void OnPreferences( wxCommandEvent& event );
/**
* Display the preferences and settings of all opened editors paged dialog, starting with
* Displays the preferences and settings of all opened editors paged dialog, starting with
* a particular page
*/
void ShowPreferences( wxString aStartPage, wxString aStartParentPage );
@ -284,13 +284,12 @@ public:
void ShowInfoBarMsg( const wxString& aMsg, bool aShowCloseButton = false );
/**
* Return the settings object used in SaveSettings(), and is overloaded in
* Returns the settings object used in SaveSettings(), and is overloaded in
* #KICAD_MANAGER_FRAME.
*/
virtual APP_SETTINGS_BASE* config() const;
void LoadWindowState( const wxString& aFileName );
/**
* Load window settings from the given settings object.
*
@ -333,7 +332,7 @@ public:
virtual WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg );
/**
* Load frame state info from a configuration file.
* Load frame state info from a configuration file
*/
virtual void LoadWindowState( const WINDOW_STATE& aState );
@ -354,15 +353,14 @@ public:
}
/**
* Save changes to the project local settings.
*
* These settings are used to save/restore the view state for a specific project, and
* should never contain design data. This method is normally called automatically at
* various points in the workflow so that the user's most recent display settings are
* automatically persisted.
* Save changes to the project local settings. These settings are used to save/restore the
* view state for a specific project, and should never contain design data. This method is
* normally called automatically at various points in the workflow so that the user's most
* recent display settings are automatically persisted.
*
* The method is virtual so you can override it to call the suitable save method.
* The base method does nothing.
*
*/
virtual void SaveProjectLocalSettings() {};
@ -377,7 +375,7 @@ public:
const wxString& aDefaultShortname );
/**
* Fetch the file name from the file history list.
* Fetches the file name from the file history list.
*
* This removes the selected file, if this file does not exist. The menu is also updated,
* if #FILE_HISTORY::UseMenu was called at initialization time.
@ -392,7 +390,7 @@ public:
FILE_HISTORY* aFileHistory = nullptr );
/**
* Remove all files from the file history.
* Removes all files from the file history.
*
* @param aFileHistory The FILE_HISTORY in use. If null, the main application file
* history is used
@ -434,7 +432,7 @@ public:
virtual wxString GetCurrentFileName() const { return wxEmptyString; }
/**
* Recreate the menu bar.
* Recreates the menu bar.
*
* Needed when the language or icons are changed
*/
@ -443,12 +441,12 @@ public:
void SetMenuBar( wxMenuBar *menu_bar ) override;
/**
* Add the standard KiCad help menu to the menubar.
* Adds the standard KiCad help menu to the menubar.
*/
void AddStandardHelpMenu( wxMenuBar* aMenuBar );
/**
* Check if \a aFileName can be written.
* Checks if \a aFileName can be written.
*
* The function performs a number of tests on \a aFileName to verify that it can be saved.
* If \a aFileName defines a path with no file name, them the path is tested for user write
@ -603,15 +601,14 @@ public:
virtual void HandleSystemColorChange();
/**
* Check if this frame is ready to accept API commands.
*
* Checks if this frame is ready to accept API commands.
* A frame might not accept commands if a long-running process is underway, a dialog is open,
* the user is interacting with a tool, etc.
*/
virtual bool CanAcceptApiCommands() { return IsEnabled(); }
protected:
/// Default style flags used for wxAUI toolbars.
///< Default style flags used for wxAUI toolbars.
static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND;
virtual void doReCreateMenuBar() {}
@ -664,7 +661,7 @@ protected:
virtual void setupUIConditions();
/**
* Set the common key-pair for exiting the application (Ctrl-Q) and ties it
* Sets the common key-pair for exiting the application (Ctrl-Q) and ties it
* to the wxID_EXIT event id.
*
* This is useful in sub-applications to pass the event up to a non-owning window.
@ -674,16 +671,14 @@ protected:
void ensureWindowIsOnScreen();
/**
* Save any design-related project settings associated with this frame.
*
* Saves any design-related project settings associated with this frame.
* This method should only be called as the result of direct user action, for example from an
* explicit "Save Project" command or as a consequence of saving a design document.
*/
virtual void saveProjectSettings() {}
/**
* Handle event fired when a file is dropped to the window.
*
* Handles event fired when a file is dropped to the window.
* In this base class, stores the path of files accepted.
* Calls DoWithAcceptedFiles() to execute actions on files.
*/
@ -694,8 +689,7 @@ protected:
/**
* Execute action on accepted dropped file.
*
* Called in OnDropFiles() and should be populated with
* Called in OnDropFiles and should be populated with
* the action to execute in inherited classes.
*/
virtual void DoWithAcceptedFiles();
@ -734,7 +728,7 @@ private:
#ifdef __WXMSW__
/**
* Windows specific override of the wxWidgets message handler for a window.
* Windows specific override of the wxWidgets message handler for a window
*/
WXLRESULT MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam ) override;
#endif
@ -787,7 +781,7 @@ private:
bool m_isNonUserClose;
/**
* Associate file extensions with action to execute.
* Associates files extensions with action to execute.
*/
std::map<const wxString, TOOL_ACTION*> m_acceptedExts;
};

View File

@ -36,13 +36,13 @@
// TCP/IP ports used by Pcbnew and Eeschema respectively.
/// Pcbnew listens on this port for commands from Eeschema.
///< Pcbnew listens on this port for commands from Eeschema
#define KICAD_PCB_PORT_SERVICE_NUMBER 4242
/// Eeschema listens on this port for commands from Pcbnew.
///< Eeschema listens on this port for commands from Pcbnew
#define KICAD_SCH_PORT_SERVICE_NUMBER 4243
/// Scripting window listens for commands for other apps.
///< Scripting window listens for commands for other apps
#define KICAD_PY_PORT_SERVICE_NUMBER 4244
@ -51,7 +51,7 @@
bool SendCommand( int aPort, const std::string& aMessage );
/// Must be called to clean up the socket thread used by SendCommand.
///< Must be called to clean up the socket thread used by SendCommand
void SocketCleanup();
#endif // EDA_DDE_H_

View File

@ -105,12 +105,12 @@ public:
void ReleaseFile();
/**
* Toggle the scripting console visibility.
* Toggles the scripting console visibility
*/
void ScriptingConsoleEnableDisable();
/**
* Get the current visibility of the scripting console window.
* Gets the current visibility of the scripting console window
*/
bool IsScriptingConsoleVisible();
@ -316,7 +316,7 @@ public:
void AddStandardSubMenus( TOOL_MENU& aMenu );
/**
* Print the drawing-sheet (frame and title block).
* Prints the drawing-sheet (frame and title block).
*
* @param aScreen screen to draw.
* @param aProperties Optional properties for text variable resolution.
@ -326,8 +326,7 @@ public:
*/
void PrintDrawingSheet( const RENDER_SETTINGS* aSettings, BASE_SCREEN* aScreen,
const std::map<wxString, wxString>* aProperties, double aMils2Iu,
const wxString& aFilename,
const wxString& aSheetLayer = wxEmptyString );
const wxString& aFilename, const wxString& aSheetLayer = wxEmptyString );
void DisplayToolMsg( const wxString& msg ) override;
@ -335,7 +334,6 @@ public:
/**
* Called when modifying the page settings.
*
* In derived classes it can be used to modify parameters like draw area size,
* and any other local parameter related to the page settings.
*/
@ -441,7 +439,7 @@ public:
virtual void ActivateGalCanvas();
/**
* Change the current rendering backend.
* Changes the current rendering backend.
*/
virtual void SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
@ -466,7 +464,7 @@ public:
}
/**
* Return bounding box of document with option to not include some items.
* Returns bbox of document with option to not include some items.
*
* Used most commonly by "Zoom to Fit" and "Zoom to Objects". In Eeschema for "Zoom to Fit"
* it's passed "true" to include drawing sheet border, and "false" by "Zoom To Objects" to
@ -480,12 +478,12 @@ public:
virtual const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const;
/**
* Rebuild all toolbars and update the checked state of check tools.
* Rebuild all toolbars, and update the checked state of check tools
*/
void RecreateToolbars();
/**
* Update toolbars if desired toolbar icon changed.
* Update toolbars if desired toolbar icon changed
*/
void OnToolbarSizeChanged();
@ -510,22 +508,19 @@ public:
bool SaveCanvasImageToFile( const wxString& aFileName, BITMAP_TYPE aBitmapType );
/**
* Handler for activating an API plugin (via toolbar or menu).
* Handler for activating an API plugin (via toolbar or menu)
*/
virtual void OnApiPluginInvoke( wxCommandEvent& aEvent );
virtual PLUGIN_ACTION_SCOPE PluginActionScope() const { return PLUGIN_ACTION_SCOPE::INVALID; }
static bool IsPluginActionButtonVisible( const PLUGIN_ACTION& aAction,
APP_SETTINGS_BASE* aCfg );
static bool IsPluginActionButtonVisible( const PLUGIN_ACTION& aAction, APP_SETTINGS_BASE* aCfg );
/**
* Return ordered list of plugin actions for display in the toolbar.
*
* Return ordered list of plugin actions for display in the toolbar
* Must be static at the moment because this needs to be called from the preferences dialog,
* which can exist without the frame in question actually being created.
*
* @param aCfg is the settings to read the plugin ordering from.
* @param aCfg is the settings to read the plugin ordering from
*/
static std::vector<const PLUGIN_ACTION*> GetOrderedPluginActions( PLUGIN_ACTION_SCOPE aScope,
APP_SETTINGS_BASE* aCfg );
@ -544,20 +539,19 @@ protected:
std::vector<wxWindow*> findDialogs();
/**
* Determine the canvas type to load (with prompt if required) and initializes #m_canvasType.
* Determines the Canvas type to load (with prompt if required) and initializes m_canvasType
*/
virtual void resolveCanvasType();
/**
* Return the canvas type stored in the application settings.
*
* Returns the canvas type stored in the application settings.
* @param aCfg is the APP_SETTINGS_BASE config storing the canvas type.
* If nullptr (default) the KifaceSettings() will be used
*/
EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting( APP_SETTINGS_BASE* aCfg = nullptr );
/**
* Store the canvas type in the application settings.
* Stores the canvas type in the application settings.
*/
bool saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
@ -585,8 +579,7 @@ protected:
// to screens
bool m_polarCoords; // For those frames that support polar coordinates
// Show the drawing sheet (border & title block).
bool m_showBorderAndTitleBlock;
bool m_showBorderAndTitleBlock; // Show the drawing sheet (border & title block).
wxChoice* m_gridSelectBox;
wxChoice* m_zoomSelectBox;
@ -610,17 +603,17 @@ protected:
HOTKEY_CYCLE_POPUP* m_hotkeyPopup;
/// The current canvas type.
///< The current canvas type.
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType;
static bool m_openGLFailureOccured; ///< Has any failure occurred when switching to OpenGL in
static bool m_openGLFailureOccured; ///< Has any failure occured when switching to OpenGL in
///< any EDA_DRAW_FRAME?
private:
BASE_SCREEN* m_currentScreen; ///< current used SCREEN
EDA_DRAW_PANEL_GAL* m_canvas;
/// This the frame's interface to setting GAL display options.
///< This the frame's interface to setting GAL display options.
GAL_DISPLAY_OPTIONS_IMPL m_galDisplayOptions;
int m_lastToolbarIconSize;

View File

@ -78,7 +78,7 @@ namespace google { namespace protobuf { class Any; } }
*/
typedef std::function< INSPECT_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC;
/// std::function passed to nested users by ref, avoids copying std::function.
///< std::function passed to nested users by ref, avoids copying std::function.
typedef const INSPECTOR_FUNC& INSPECTOR;
@ -197,7 +197,6 @@ public:
/**
* Populate \a aList of #MSG_PANEL_ITEM objects with it's internal state for display
* purposes.
*
* @param aFrame is the EDA_DRAW_FRAME that displays the message panel
* @param aList is the list to populate.
*/
@ -245,7 +244,7 @@ public:
virtual void SetPosition( const VECTOR2I& aPos ){};
/**
* Similar to GetPosition() but allows items to return their visual center rather
* Similar to GetPosition, but allows items to return their visual center rather
* than their anchor.
*/
virtual const VECTOR2I GetFocusPosition() const { return GetPosition(); }
@ -491,15 +490,14 @@ public:
private:
/**
* Run time identification, _keep private_ so it can never be changed after a ctor sets it.
*
* See comment near SetType() regarding virtual functions.
* Run time identification, _keep private_ so it can never be changed after a ctor
* sets it. See comment near SetType() regarding virtual functions.
*/
KICAD_T m_structType;
protected:
EDA_ITEM_FLAGS m_flags;
EDA_ITEM* m_parent; ///< Linked list: Link (parent struct).
EDA_ITEM* m_parent; ///< Linked list: Link (parent struct)
bool m_forceVisible;
};

View File

@ -38,10 +38,10 @@
static const int EDA_PATTERN_NOT_FOUND = wxNOT_FOUND;
/**
/*
* A structure for storing weighted search terms.
*
* @note An exact match is scored at 8 * Score while a match at the start of the text is scored
* NOTE: an exact match is scored at 8 * Score while a match at the start of the text is scored
* at 2 * Score.
*/
struct KICOMMON_API SEARCH_TERM
@ -58,8 +58,8 @@ struct KICOMMON_API SEARCH_TERM
};
/**
* Interface for a pattern matcher for which there are several implementations.
/*
* Interface for a pattern matcher, for which there are several implementations
*/
class KICOMMON_API EDA_PATTERN_MATCH
{
@ -83,9 +83,8 @@ public:
virtual ~EDA_PATTERN_MATCH() {}
/**
* Set the pattern against which candidates will be matched.
*
* @return false if the pattern not be processed.
* Set the pattern against which candidates will be matched. If the pattern
* can not be processed, returns false.
*/
virtual bool SetPattern( const wxString& aPattern ) = 0;
@ -95,17 +94,16 @@ public:
virtual wxString const& GetPattern() const = 0;
/**
* Return the location and possibly length of a match if a given candidate
* Return the location and possibly length of a match iff a given candidate
* string matches the set pattern.
*
* Otherwise, return an invalid #FIND_RESULT.
* Otherwise, return an invalid FIND_RESULT.
*/
virtual FIND_RESULT Find( const wxString& aCandidate ) const = 0;
};
/**
* Match simple substring.
/*
* Match simple substring
*/
class KICOMMON_API EDA_PATTERN_MATCH_SUBSTR : public EDA_PATTERN_MATCH
{
@ -120,8 +118,8 @@ protected:
};
/**
* Match regular expression.
/*
* Match regular expression
*/
class KICOMMON_API EDA_PATTERN_MATCH_REGEX : public EDA_PATTERN_MATCH
{
@ -213,24 +211,25 @@ class KICOMMON_API EDA_COMBINED_MATCHER
public:
EDA_COMBINED_MATCHER( const wxString& aPattern, COMBINED_MATCHER_CONTEXT aContext );
/**
/*
* Deleted copy or else we have to implement copy constructors for all EDA_PATTERN_MATCH classes
* due to this class' m_matchers member being copied.
* due to this class' m_matchers member being copied
*/
EDA_COMBINED_MATCHER( EDA_COMBINED_MATCHER const& ) = delete;
/**
/*
* Deleted copy or else we have to implement copy constructors for all EDA_PATTERN_MATCH classes
* due to this class' m_matchers member being copied
*/
EDA_COMBINED_MATCHER& operator=( EDA_COMBINED_MATCHER const& ) = delete;
/**
* Look in all existing matchers, return the earliest match of any of the existing.
/*
* Look in all existing matchers, return the earliest match of any of
* the existing.
*
* @param aTerm term to look for.
* @param aMatchersTriggered out: number of matcher that found the term.
* @param aPostion out: where the term was found, or #EDA_PATTERN_NOT_FOUND.
* @param aTerm term to look for
* @param aMatchersTriggered out: number of matcher that found the term
* @param aPostion out: where the term was found, or EDA_PATTERN_NOT_FOUND
*
* @return true if any matchers found the term
*/
@ -245,7 +244,7 @@ public:
int ScoreTerms( std::vector<SEARCH_TERM>& aWeightedTerms );
private:
/// Add matcher if it can compile the pattern.
// Add matcher if it can compile the pattern.
void AddMatcher( const wxString& aPattern, std::unique_ptr<EDA_PATTERN_MATCH> aMatcher );
std::vector<std::unique_ptr<EDA_PATTERN_MATCH>> m_matchers;

View File

@ -43,7 +43,7 @@ enum class SHAPE_T : int
{
UNDEFINED = -1,
SEGMENT = 0,
RECTANGLE, ///< Use RECTANGLE instead of RECT to avoid collision in a Windows header.
RECTANGLE, /// use RECTANGLE instead of RECT to avoid collision in a Windows header
ARC,
CIRCLE,
POLY,
@ -55,13 +55,13 @@ enum class SHAPE_T : int
enum class FILL_T : int
{
NO_FILL = 1,
FILLED_SHAPE, ///< Fill with object color.
FILLED_WITH_BG_BODYCOLOR, //< Fill with background body color.
FILLED_WITH_COLOR //< Fill with a separate color.
FILLED_SHAPE, // Fill with object color
FILLED_WITH_BG_BODYCOLOR, // Fill with background body color
FILLED_WITH_COLOR // Fill with a separate color
};
/// Holding struct to keep originating midpoint
// Holding struct to keep originating midpoint
struct ARC_MID
{
VECTOR2I mid;
@ -75,7 +75,7 @@ class EDA_SHAPE : public SERIALIZABLE
public:
EDA_SHAPE( SHAPE_T aType, int aLineWidth, FILL_T aFill );
/// Construct an EDA_SHAPE from an abstract SHAPE geometry.
// Construct an EDA_SHAPE from an abstract SHAPE geometry
EDA_SHAPE( const SHAPE& aShape );
// Do not create a copy constructor & operator=.
@ -217,7 +217,6 @@ public:
/**
* Set the end point from the angle center and start.
*
* aAngle is:
* - clockwise in right-down coordinate system
* - counter-clockwise in right-up (libedit) coordinate system.
@ -230,9 +229,8 @@ public:
/**
* Have the start and end points been swapped since they were set?
*
* @return true if they have.
*/
* @return true if they have
*/
bool EndsSwapped() const { return m_endsSwapped; }
// Some attributes are read only, since they are derived from m_Start, m_End, and m_Angle.
@ -258,32 +256,29 @@ public:
void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd );
/**
* Set the data used for mid point caching.
* Set the data used for mid point caching. If the controlling points remain constant, then
* we keep the midpoint the same as it was when read in. This minimizes VCS churn
*
* If the controlling points remain constant, then we keep the midpoint the same as it was
* when read in. This minimizes VCS churn.
*
* @param aStart Cached start point.
* @param aMid Cached mid point.
* @param aEnd Cached end point.
* @param aCenter Calculated center point using the preceeding three.
* @param aStart Cached start point
* @param aMid Cached mid point
* @param aEnd Cached end point
* @param aCenter Calculated center point using the preceeding three
*/
void SetCachedArcData( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd,
const VECTOR2I& aCenter );
void SetCachedArcData( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd, const VECTOR2I& aCenter );
const std::vector<VECTOR2I>& GetBezierPoints() const { return m_bezierPoints; }
/**
* Duplicate the list of corners in a std::vector<VECTOR2I>.
* Duplicate the list of corners in a std::vector<VECTOR2I>
*
* It must be used only to convert the SHAPE_POLY_SET internal corner buffer
* to a list of VECTOR2Is, and nothing else, because it duplicates the buffer,
* that is inefficient to know for instance the corner count.
* that is inefficient to know for instance the corner count
*/
void DupPolyPointsList( std::vector<VECTOR2I>& aBuffer ) const;
/**
* @return the number of corners of the polygonal shape.
* @return the number of corners of the polygonal shape
*/
int GetPointCount() const;
@ -292,7 +287,7 @@ public:
const SHAPE_POLY_SET& GetPolyShape() const { return m_poly; }
/**
* @return true if the polygonal shape is valid (has more than 2 points).
* @return true if the polygonal shape is valid (has more than 2 points)
*/
bool IsPolyShapeValid() const;
@ -316,16 +311,14 @@ public:
* Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of
* segments.
*
* Has meaning only for #BEZIER shape.
* Has meaning only for BEZIER shape.
*
* @param aMinSegLen is the max deviation between the polyline and the curve.
* @param aMinSegLen is the max deviation between the polyline and the curve
*/
void RebuildBezierToSegmentsPointsList( int aMaxError );
/**
* Make a set of SHAPE objects representing the #EDA_SHAPE.
*
* Caller owns the objects.
* Make a set of SHAPE objects representing the EDA_SHAPE. Caller owns the objects.
*
* @param aEdgeOnly indicates only edges should be generated (even if 0 width), and no fill
* shapes.
@ -358,14 +351,12 @@ public:
int GetRectangleWidth() const;
/**
* Convert the shape to a closed polygon.
*
* Circles and arcs are approximated by segments.
* Convert the shape to a closed polygon. Circles and arcs are approximated by segments.
*
* @param aBuffer is a buffer to store the polygon.
* @param aClearance is the clearance around the pad.
* @param aError is the maximum deviation from a true arc.
* @param aErrorLoc whether any approximation error should be placed inside or outside
* @param aErrorLoc whether any approximation error shoule be placed inside or outside
* @param ignoreLineWidth is used for edge cut items where the line width is only for
* visualization
*/
@ -408,22 +399,19 @@ protected:
void calcEdit( const VECTOR2I& aPosition );
/**
* Finish editing the shape.
*
* @param aClosed Should polygon shapes be closed (yes for pcbnew/fpeditor, no for libedit).
* Finishes editing the shape.
* @param aClosed Should polygon shapes be closed (yes for pcbnew/fpeditor, no for libedit)
*/
void endEdit( bool aClosed = true );
void setEditState( int aState ) { m_editState = aState; }
/**
* Make a set of #SHAPE objects representing the #EDA_SHAPE.
*
* Caller owns the objects.
* Make a set of SHAPE objects representing the EDA_SHAPE. Caller owns the objects.
*
* @param aEdgeOnly indicates only edges should be generated (even if 0 width), and no fill
* shapes.
* @param aLineChainOnly indicates #SHAPE_POLY_SET is being abused slightly to represent a
* lineChain rather than a closed polygon.
* @param aLineChainOnly indicates SHAPE_POLY_SET is being abused slightly to represent a
* lineChain rather than a closed polygon
*/
// fixme: move to shape_compound
std::vector<SHAPE*> makeEffectiveShapes( bool aEdgeOnly, bool aLineChainOnly = false ) const;

View File

@ -35,7 +35,7 @@
#include <wx/filename.h>
/**
* Enumeration of tools.
* Enumeration of tools
*/
enum class EDA_TOOLS
{
@ -43,13 +43,12 @@ enum class EDA_TOOLS
};
/**
* Check if \a aFileName is a \a aTool file.
*
* As an example, can be used to check if a .sch file is an EAGLE file (may be a legacy KICAD file).
*
* @param aFileName name of file to check. Must be given with full path.
* @param aTool EDA tool.
* @return true if the file is an EDA_TOOL file type, false if not or file does not exist.
* Check if aFileName is a aTool file
* As an example, can be used to check if a .sch file is an EAGLE file
* (may be a legacy KICAD file)
* @param aFileName name of file to check. Must be given with full path
* @param aTool EDA tool
* @return true if the file is an EDA_TOOL file type, false if not or file does not exist
*/
bool IsFileFromEDATool( const wxFileName& aFileName, const EDA_TOOLS aTool );

View File

@ -71,9 +71,8 @@ namespace EDA_UNIT_UTILS
KICOMMON_API int Mils2mm( double aVal );
/**
* Write any unit info found in the string to \a aUnits.
*
* @return true when unit was found or false when unit could not be determined.
* Writes any unit info found in the string to aUnits.
* @return true - when unit was found, false - when unit could not be determined
*/
KICOMMON_API bool FetchUnitsFromString( const wxString& aTextValue, EDA_UNITS& aUnits );
@ -83,11 +82,10 @@ namespace EDA_UNIT_UTILS
* This version is for appending to a value string.
*
* @param aUnits The units requested.
* @param aType DISTANCE, AREA, or VOLUME.
* @param aType DISTANCE, AREA, or VOLUME
* @return The human readable units string with appropriate separators.
*/
KICOMMON_API wxString GetText( EDA_UNITS aUnits,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE );
KICOMMON_API wxString GetText( EDA_UNITS aUnits, EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE );
/**
* Get the units string for a given units type.
@ -102,9 +100,9 @@ namespace EDA_UNIT_UTILS
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE );
/**
* Convert \a aAngle from board units to a string appropriate for writing to file.
* Converts \a aAngle from board units to a string appropriate for writing to file.
*
* This should only be used for writing to files as it ignores locale.
* This should only be used for writing to files as it ignores locale
*
* @note Internal angles for board items can be either degrees or tenths of degree
* on how KiCad is built.
@ -116,7 +114,7 @@ namespace EDA_UNIT_UTILS
/**
* Converts \a aValue from internal units to a string appropriate for writing to file.
*
* This should only be used for writing to files as it ignores locale.
* This should only be used for writing to files as it ignores locale
*
* @note Internal units for board items can be either deci-mils or nanometers depending
* on how KiCad is built.
@ -130,9 +128,9 @@ namespace EDA_UNIT_UTILS
#if 0 // No support for std::from_chars on MacOS yet
/**
* Convert \a aInput string to internal units when reading from a file.
* Converts \a aInput string to internal units when reading from a file.
*
* This should only be used for reading from files as it ignores locale.
* This should only be used for reading from files as it ignores locale
*
* @param aInput is std::string to parse.
* @param aIuScale is the scale to use.
@ -165,28 +163,28 @@ namespace EDA_UNIT_UTILS
namespace UI
{
/**
* Convert \a aValue in internal units to the appropriate user units defined by \a aUnit.
* Function To_User_Unit
* convert \a aValue in internal units to the appropriate user units defined by \a aUnit.
*
* @return The converted value, in double
* @param aUnit The units to convert \a aValue to.
* @param aValue The value in internal units to convert.
* @return The converted value, in double.
*/
KICOMMON_API double ToUserUnit( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnit,
double aValue );
/**
* Return the string from \a aValue according to \a aUnits (inch, mm ...) for display.
* Returns the string from \a aValue according to \a aUnits (inch, mm ...) for display.
*
* For readability, if the mantissa has 3 or more digits then any trailing 0's are removed.
* This function should be used to display values in dialogs because a value entered in mm
* (for instance 2.0 mm) could need up to 8 digits mantissa to preserve precision.
*
* @param aUnits Units (INCHES, MILLIMETRE ..).
* @param aValue Value in internal units.
* @param aAddUnitsText Add units text with appropriate separators.
* @param aType DISTANCE, AREA, or VOLUME.
* @return A wxString object containing value and optionally the symbol unit
* (like 2.000 mm).
* @param aUnits Units (INCHES, MILLIMETRE ..)
* @param aValue Value in internal units
* @param aAddUnitsText Add units text with appropriate separators
* @param aType DISTANCE, AREA, or VOLUME
* @return A wxString object containing value and optionally the symbol unit (like 2.000 mm)
*/
KICOMMON_API wxString StringFromValue( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
double aValue,
@ -201,10 +199,10 @@ namespace EDA_UNIT_UTILS
* because the mantissa of the number displayed has 4 digits max for readability. The
* actual internal value could need up to 8 digits to preserve precision.
*
* @param aUnits Units (INCHES, MILLIMETRE ..).
* @param aUnits Units (INCHES, MILLIMETRE ..)
* @param aValue The double value to convert.
* @param aAddUnitsText If true, adds the unit label to the end of the string.
* @param aType DISTANCE, AREA, or VOLUME.
* @param aAddUnitsText If true, adds the unit label to the end of the string
* @param aType DISTANCE, AREA, or VOLUME
* @return The converted string for display in user interface elements.
*/
KICOMMON_API wxString MessageTextFromValue( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
@ -227,21 +225,21 @@ namespace EDA_UNIT_UTILS
const MINOPTMAX<int>& aValue );
/**
* Return in internal units the value \a aValue given in a real unit such as "in", "mm",
* or "deg".
* or "deg"
*/
KICOMMON_API double FromUserUnit( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnit,
double aValue );
/**
* Convert \a aTextValue to a double.
*
* @warning This utilizes the current locale and will break if decimal formats differ.
* Function DoubleValueFromString
* converts \a aTextValue to a double
* @warning This utilizes the current locale and will break if decimal formats differ
*
* @param aIuScale The internal units scale for the current frame/app.
* @param aUnits The units of \a aTextValue.
* @param aTextValue A reference to a wxString object containing the string to convert.
* @return A double representing that value in internal units.
* @return A double representing that value in internal units
*/
KICOMMON_API double DoubleValueFromString( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
const wxString& aTextValue,
@ -250,14 +248,14 @@ namespace EDA_UNIT_UTILS
KICOMMON_API double DoubleValueFromString( const wxString& aTextValue );
/**
* Convert \a aTextValue in \a aUnits to internal units used by the application.
*
* Function ValueFromString
* converts \a aTextValue in \a aUnits to internal units used by the application.
* @warning This utilizes the current locale and will break if decimal formats differ
*
* @param aIuScale The internal units scale for the current frame/app.
* @param aUnits The units of \a aTextValue.
* @param aTextValue A reference to a wxString object containing the string to convert.
* @return A long long int representing that value in internal units.
* @return A long long int representing that value in internal units
*/
KICOMMON_API long long int ValueFromString( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
const wxString& aTextValue,

View File

@ -84,12 +84,12 @@ public:
enum class RETURN_CODE : int
{
OK, ///< Success.
FILE_NOT_FOUND, ///< File not found on disk.
PERMISSIONS_ERROR, ///< Could not read/write file.
FILE_ALREADY_EXISTS, ///< File already exists in the collection.
OUT_OF_MEMORY, ///< Could not allocate memory.
CHECKSUM_ERROR, ///< Checksum in file does not match data.
OK, // Success
FILE_NOT_FOUND, // File not found on disk
PERMISSIONS_ERROR, // Could not read/write file
FILE_ALREADY_EXISTS, // File already exists in the collection
OUT_OF_MEMORY, // Could not allocate memory
CHECKSUM_ERROR, // Checksum in file does not match data
};
EMBEDDED_FILES() = default;
@ -101,41 +101,37 @@ public:
}
/**
* Load a file from disk and adds it to the collection.
*
* Loads a file from disk and adds it to the collection.
* @param aName is the name of the file to load.
* @param aOverwrite is true if the file should be overwritten if it already exists.
*/
EMBEDDED_FILE* AddFile( const wxFileName& aName, bool aOverwrite );
/**
* Append a file to the collection.
*/
* Appends a file to the collection.
*/
void AddFile( EMBEDDED_FILE* aFile );
/**
* Remove a file from the collection and frees the memory.
*
* Removes a file from the collection and frees the memory.
* @param aName is the name of the file to remove.
*/
*/
void RemoveFile( const wxString& name, bool aErase = true );
/**
* Output formatter for the embedded files.
*
* @param aOut is the output formatter.
* @param aWriteData is true if the actual data should be written. This is false when writing
* an element that is already embedded in a file that itself has embedded
* files (boards, schematics, etc.).
*/
* files (boards, schematics, etc.)
*/
void WriteEmbeddedFiles( OUTPUTFORMATTER& aOut, bool aWriteData ) const;
/**
* Return the link for an embedded file.
*
* Returns the link for an embedded file.
* @param aFile is the file to get the link for.
* @return the link for the file to be used in a hyperlink.
*/
*/
wxString GetEmbeddedFileLink( const EMBEDDED_FILE& aFile ) const
{
return aFile.GetLink();
@ -156,43 +152,42 @@ public:
/**
* Helper function to get a list of fonts for fontconfig to add to the library.
*
* This is necessary because EMBEDDED_FILES lives in common at the moment and
* This is neccesary because EMBEDDED_FILES lives in common at the moment and
* fontconfig is in libkicommon. This will create the cache files in the KiCad
* cache directory (if they do not already exist) and return the temp files names
*/
*/
const std::vector<wxString>* UpdateFontFiles();
/**
* If we just need the cached version of the font files, we can use this function which
* is const and will not update the font files.
*/
*/
const std::vector<wxString>* GetFontFiles() const;
/**
* Remove all embedded fonts from the collection.
*/
* Removes all embedded fonts from the collection
*/
void ClearEmbeddedFonts();
/**
* Take data from the #decompressedData buffer and compresses it using ZSTD
* into the #compressedEncodedData buffer.
* Takes data from the #decompressedData buffer and compresses it using ZSTD
* into the #compressedEncodedData buffer. The data is then Base64 encoded.
*
* The data is then Base64 encoded. This call is used when adding a new file to the
* collection from disk.
*/
* This call is used when adding a new file to the collection from disk
*/
static RETURN_CODE CompressAndEncode( EMBEDDED_FILE& aFile );
/**
* Takes data from the #compressedEncodedData buffer and Base64 decodes it.
*
* The data is then decompressed using ZSTD and stored in the #decompressedData buffer.
*
* This call is used when loading the embedded files using the parsers.
*/
*/
static RETURN_CODE DecompressAndDecode( EMBEDDED_FILE& aFile );
/**
* Returns the embedded file with the given name or nullptr if it does not exist.
*/
*/
EMBEDDED_FILE* GetEmbeddedFile( const wxString& aName ) const
{
auto it = m_files.find( aName );
@ -242,7 +237,7 @@ private:
std::vector<wxString> m_fontFiles;
protected:
bool m_embedFonts = false; ///< If set, fonts will be embedded in the element on save.
///< Otherwise, font files embedded in the element will be
///< removed on save.
bool m_embedFonts = false; // If set, fonts will be embedded in the element on save
// Otherwise, font files embedded in the element will be
// removed on save
};

View File

@ -26,10 +26,9 @@
#include <type_traits>
/**
* Macro to create const vectors containing enum values to enable easy iteration.
*
* @warning Do not use in new code. Use the #DEFINE_ENUM_CLASS_WITH_ITERATOR and
* #DECLARE_ENUM_CLASS_ITERATOR macros instead (unless they don't work ;) ).
* Macro to create const vectors containing enum values to enable easy iteration. Do not use in new
* code. Use the DEFINE_ENUM_CLASS_WITH_ITERATOR and DECLARE_ENUM_CLASS_ITERATOR macros instead
* (unless they don't work ;) ).
*
* Usage:
* [header]

View File

@ -21,10 +21,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file env_paths.h
* @brief Helper functions to substitute paths with environmental variables.
*/
///< Helper functions to substitute paths with environmental variables.
#ifndef ENV_PATHS_H
#define ENV_PATHS_H
@ -65,9 +62,9 @@ wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars
* @param aFileName is the name of the searched file. It might be a relative path.
* @param aEnvVars is an optional map of environmental variables that can contain paths.
* @param aProject is an optional project, to check the project path.
* @return Full path (path and file name) if the file was found in one of the paths, otherwise
* @return Full path (apth and file name) if the file was found in one of the paths, otherwise
* an empty string.
*/
*/
wxString ResolveFile( const wxString& aFileName, const ENV_VAR_MAP* aEnvVars,
const PROJECT* aProject );

Some files were not shown because too many files have changed in this diff Show More