7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-14 12:49:34 +00:00

Fix broken Doxygen comment specifiers.

Please note, ///> is not a valid Doxygen comment specifier.  ///< is the
correct specifier to use for single line or short Doxygen comments.
This commit is contained in:
Wayne Stambaugh 2021-01-25 07:42:36 -05:00
parent 9f18fee124
commit 6ab1144ea3
69 changed files with 1128 additions and 1229 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2016 CERN
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -99,7 +99,7 @@ public:
static TOOL_ACTION toggleComments;
static TOOL_ACTION toggleECO;
///> @copydoc COMMON_ACTIONS::TranslateLegacyId()
///< @copydoc COMMON_ACTIONS::TranslateLegacyId()
virtual OPT<TOOL_EVENT> TranslateLegacyId( int aId ) override { return OPT<TOOL_EVENT>(); }
};

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Ian McInerney <ian.s.mcinerney at ieee.org>
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@ -72,19 +72,19 @@ public:
SELECTION_CONDITION GridSize( GRID3D_TYPE aGridSize );
private:
///> Helper function used by MaterialMode()
///< Helper function used by MaterialMode()
static bool materialModeFunction( const SELECTION& aSelection, BOARD_ADAPTER* aAdapter,
MATERIAL_MODE aMaterial );
///> Helper function used by Flag()
///< Helper function used by Flag()
static bool flagFunction( const SELECTION& aSelection, BOARD_ADAPTER* aAdapter,
DISPLAY3D_FLG aFlag );
///> Helper function used by GridDize()
///< Helper function used by GridDize()
static bool gridSizeFunction( const SELECTION& aSelection, BOARD_ADAPTER* aAdapter,
GRID3D_TYPE aGridSize );
///> The board adapter to read the 3D viewer state from
///< The board adapter to read the 3D viewer state from
BOARD_ADAPTER* m_adapter;
};

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 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
@ -97,7 +97,7 @@ public:
int ToggleVisibility( const TOOL_EVENT& aEvent );
private:
///> Sets up handlers for various events.
///< Sets up handlers for various events.
void setTransitions() override;
int doZoomInOut( bool aDirection, bool aCenterOnCursor );

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2019 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2021 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
@ -100,7 +100,7 @@ private:
void OnExportToFile( wxCommandEvent& event ) override;
void OnExportToClipboard( wxCommandEvent& event ) override;
///> @return the EDA_UNITS from the m_PixelUnit choice
///< @return the EDA_UNITS from the m_PixelUnit choice
EDA_UNITS getUnitFromSelection();
// return a string giving the output size, according to the selected unit

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2014-2017 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2014-2021 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -114,7 +114,7 @@ public:
void SetAppIcon( const wxIcon& aIcon ) { m_appIcon = aIcon; }
wxIcon& GetAppIcon() { return m_appIcon; }
///> Wrapper to manage memory allocation for bitmaps
///< Wrapper to manage memory allocation for bitmaps
wxBitmap* CreateKiBitmap( BITMAP_DEF aBitmap )
{
m_bitmaps.emplace_back( KiBitmapNew( aBitmap ) );
@ -140,7 +140,7 @@ private:
wxIcon m_appIcon;
///> Bitmaps to be freed when the dialog is closed
///< Bitmaps to be freed when the dialog is closed
std::vector<std::unique_ptr<wxBitmap>> m_bitmaps;
};

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -27,9 +27,7 @@
#include <eda_units.h>
/**
* WX_HTML_REPORT_BOX
*
* A slimmed down version of WX_HTML_REPORT_PANEL
* A slimmed down version of #WX_HTML_REPORT_PANEL
*/
class WX_HTML_REPORT_BOX : public wxHtmlWindow, public REPORTER
{
@ -60,7 +58,7 @@ private:
// reports, but can be very slow for larger reports.
bool m_immediateMode;
///> copy of the report, stored for filtering
///< copy of the report, stored for filtering
std::vector<wxString> m_messages;
};

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 CERN
* Copyright (C) 2015 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
@ -30,8 +30,6 @@
/**
* WX_HTML_REPORT_PANEL
*
* A widget for browsing a rich text error/status report. Used in numerous
* dialogs in eeschema and pcbnew. Provides error filtering functionality
* and saving report files.
@ -46,10 +44,10 @@ public:
const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL );
~WX_HTML_REPORT_PANEL();
///> Set the min size of the area which displays html messages:
///< Set the min size of the area which displays html messages:
void MsgPanelSetMinSize( const wxSize& aMinSize );
///> returns the reporter object that reports to this panel
///< returns the reporter object that reports to this panel
REPORTER& Reporter();
/**
@ -61,43 +59,43 @@ public:
void Report( const wxString& aText, SEVERITY aSeverity,
REPORTER::LOCATION aLocation = REPORTER::LOC_BODY );
///> clears the report panel
///< clears the report panel
void Clear();
///> return the number of messages matching the given severity mask.
///< return the number of messages matching the given severity mask.
int Count( int severityMask );
///> sets the frame label
///< sets the frame label
void SetLabel( const wxString& aLabel ) override;
///> Sets the lasy update. If this mode is on, messages are stored but the display
///> is not updated (Updating display can be very time consumming if there are many messages)
///> A call to Flush() will be needed after build the report
///< Sets the lasy update. If this mode is on, messages are stored but the display
///< is not updated (Updating display can be very time consumming if there are many messages)
///< A call to Flush() will be needed after build the report
void SetLazyUpdate( bool aLazyUpdate );
///> Forces updating the HTML page, after the report is built in lazy mode
///> If aSort = true, the body messages will be ordered by severity
///< Forces updating the HTML page, after the report is built in lazy mode
///< If aSort = true, the body messages will be ordered by severity
void Flush( bool aSort = false );
///> Set the visible severity filter.
///> if aSeverities < 0 the m_showAll option is set
///< Set the visible severity filter.
///< if aSeverities < 0 the m_showAll option is set
void SetVisibleSeverities( int aSeverities );
///> @return the visible severity filter.
///> If the m_showAll option is set, the mask is < 0
///< @return the visible severity filter.
///< If the m_showAll option is set, the mask is < 0
int GetVisibleSeverities() const;
///> If true prints Info: at the beginning of each Info severity line (Default)
///< If true prints Info: at the beginning of each Info severity line (Default)
void SetPrintInfo( bool aPrintInfo );
///> @return the visible severity filter.
///> If the m_showAll option is set, the mask is < 0
///< @return the visible severity filter.
///< If the m_showAll option is set, the mask is < 0
void SetShowSeverity( SEVERITY aSeverity, bool aValue );
///> Set the report full file name to the string
///< Set the report full file name to the string
void SetFileName( const wxString& aReportFileName );
///> @return reference to the current report fill file name string.
///< @return reference to the current report fill file name string.
wxString& GetFileName( void );
@ -128,27 +126,27 @@ private:
void onBtnSaveToFile( wxCommandEvent& event ) override;
///> copy of the report, stored for filtering
///< copy of the report, stored for filtering
REPORT_LINES m_report;
///> Lines to print at the very end of the report, regardless of sorting
///< Lines to print at the very end of the report, regardless of sorting
REPORT_LINES m_reportTail;
///> Lines to print at the very beginning of the report, regardless of sorting
///< Lines to print at the very beginning of the report, regardless of sorting
REPORT_LINES m_reportHead;
///> the reporter
///< the reporter
WX_HTML_PANEL_REPORTER m_reporter;
///> message severities to display (mask)
///< message severities to display (mask)
int m_severities;
bool m_lazyUpdate;
///> Print "Info:" at the front of Info messages (default)
///< Print "Info:" at the front of Info messages (default)
bool m_printInfo;
///> Use this as the filename instead of /bin/report.txt (default)
///< Use this as the filename instead of /bin/report.txt (default)
wxString m_reportFileName;
};

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017 CERN
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
*
@ -52,7 +52,7 @@ typedef std::map<wxString, FOOTPRINT*> FOOTPRINT_MAP;
typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
///> Translates Eagle special characters to their counterparts in KiCad.
///< Translates Eagle special characters to their counterparts in KiCad.
wxString escapeName( const wxString& aNetName );
static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
@ -63,8 +63,7 @@ static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName
/**
* XML_PARSER_ERROR
* implements a simple wrapper around runtime_error to isolate the errors thrown by the
* Implement a simple wrapper around runtime_error to isolate the errors thrown by the
* Eagle XML parser.
*/
struct XML_PARSER_ERROR : std::runtime_error
@ -97,8 +96,8 @@ struct TRIPLET
/**
* XPATH
* keeps track of what we are working on within a PTREE.
* Keep track of what we are working on within a PTREE.
*
* Then if an exception is thrown, the place within the tree that gave us
* grief can be reported almost accurately. To minimally impact
* speed, merely assign const char* pointers during the tree walking
@ -165,8 +164,8 @@ public:
/**
* Function Convert
* converts a wxString to a generic type T.
* Convert a wxString to a generic type T.
*
* @param aValue is a wxString containing the value that will be converted to type T.
* @throw XML_PARSER_ERROR - an exception is thrown if the parsing fails or if the conversion to
* type T is unknown.
@ -181,8 +180,8 @@ template <>
wxString Convert<wxString>( const wxString& aValue );
/**
* OPTIONAL_XML_ATTRIBUTE
* models an optional XML attribute.
* Model an optional XML attribute.
*
* This was implemented as an alternative to OPT. This class should be replaced with a
* simple typedef per type using std::optional when C++17 is published.
*/
@ -198,8 +197,7 @@ private:
public:
/**
* Constructor OPTIONAL_XML_ATTRIBUTE
* construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
* Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
*/
OPTIONAL_XML_ATTRIBUTE() :
m_isAvailable( false ),
@ -207,7 +205,6 @@ public:
{}
/**
* Constructor OPTIONAL_XML_ATTRIBUTE
* @param aData is a wxString containing the value that should be converted to type T. If
* aData is empty, the attribute is understood as unavailable; otherwise, the
* conversion to T is tried.
@ -222,7 +219,6 @@ public:
}
/**
* Constructor OPTIONAL_XML_ATTRIBUTE
* @param aData is the value of the XML attribute. If this constructor is called, the
* attribute is available.
*/
@ -233,8 +229,7 @@ public:
{}
/**
* Operator bool
* @return bool - the availability of the attribute.
* @return bool the availability of the attribute.
*/
operator bool() const
{
@ -242,8 +237,8 @@ public:
}
/**
* Assignment operator
* to a string (optionally) containing the data.
* Assign to a string (optionally) containing the data.
*
* @param aData is a wxString that should be converted to T. If the string is empty, the
* attribute is set to unavailable.
*/
@ -258,8 +253,8 @@ public:
}
/**
* Assignment operator
* to an object of the base type containing the data.
* Assign to an object of the base type containing the data.
*
* @param aData is the actual value of the attribute. Calling this assignment, the attribute
* is automatically made available.
*/
@ -272,8 +267,6 @@ public:
}
/**
* Equal operator
* to an object of the base type.
* @param aOther is the object of the base type that should be compared with this one.
*/
bool operator ==( const T& aOther ) const
@ -282,8 +275,8 @@ public:
}
/**
* Function Set
* tries to convert a string to the base type.
* Attempt to convert a string to the base type.
*
* @param aString is the string that will be converted to the base type.
*/
void Set( const wxString& aString )
@ -293,8 +286,8 @@ public:
}
/**
* Function Get
* returns a reference to the value of the attribute assuming it is available.
* Return a reference to the value of the attribute assuming it is available.
*
* @return T& - the value of the attribute.
*/
T& Get()
@ -304,8 +297,8 @@ public:
}
/**
* Function CGet
* returns a constant reference to the value of the attribute assuming it is available.
* Return a constant reference to the value of the attribute assuming it is available.
*
* @return const T& - the value of the attribute.
*/
const T& CGet() const
@ -315,8 +308,8 @@ public:
}
/**
* Operator *
* returns a reference to the value of the attribute assuming it is available.
* Return a reference to the value of the attribute assuming it is available.
*
* @return T& - the value of the attribute.
*/
T& operator*()
@ -325,8 +318,8 @@ public:
}
/**
* Operator *
* returns a constant reference to the value of the attribute assuming it is available.
* Return a constant reference to the value of the attribute assuming it is available.
*
* @return const T& - the value of the attribute.
*/
const T& operator*() const
@ -335,8 +328,8 @@ public:
}
/**
* Operator ->
* returns a pointer to the value of the attribute assuming it is available.
* Return a pointer to the value of the attribute assuming it is available.
*
* @return T* - the value of the attribute.
*/
T* operator->()
@ -345,8 +338,8 @@ public:
}
/**
* Operator ->
* returns a constant pointer to the value of the attribute assuming it is available.
* Return a constant pointer to the value of the attribute assuming it is available.
*
* @return const T* - the value of the attribute.
*/
const T* operator->() const
@ -357,15 +350,15 @@ public:
/**
* Function MapChildren
* provides an easy access to the children of an XML node via their names.
* Provide an easy access to the children of an XML node via their names.
*
* @param currentNode is a pointer to a wxXmlNode, whose children will be mapped.
* @return NODE_MAP - a map linking the name of each children to the children itself (via a
* @return NODE_MAP is a map linking the name of each children to the children itself (via a
* wxXmlNode*)
*/
NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
///> Convert an Eagle curve end to a KiCad center for S_ARC
///< Convert an Eagle curve end to a KiCad center for S_ARC
wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAngle );
// Pre-declare for typedefs
@ -396,10 +389,10 @@ struct ECOORD
EU_MIL, ///< mils/thous
};
///> Value expressed in nanometers
///< Value expressed in nanometers
long long int value;
///> Unit used for the value field
///< Unit used for the value field
static constexpr EAGLE_UNIT ECOORD_UNIT = EU_NM;
ECOORD()
@ -452,7 +445,7 @@ struct ECOORD
return value == aOther.value;
}
///> Converts a size expressed in a certain unit to nanometers.
///< Converts a size expressed in a certain unit to nanometers.
static long long int ConvertToNm( int aValue, enum EAGLE_UNIT aUnit );
};
@ -594,10 +587,10 @@ struct ERECT
/**
* EATTR
* parses an Eagle "attribute" XML element. Note that an attribute element
* is different than an XML element attribute. The attribute element is a
* full XML node in and of itself, and has attributes of its own. Blame Eagle.
* Parse an Eagle "attribute" XML element.
*
* @note An attribute element is different than an XML element attribute. The attribute element
* is a full XML node in and of itself, and has attributes of its own. Blame Eagle.
*/
struct EATTR
{

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2021 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
@ -28,7 +28,7 @@
using namespace KIGFX::PREVIEW;
///> Snap an angle to the nearest 45 degrees
///< Snap an angle to the nearest 45 degrees
static double snapAngle( double aAngle )
{
return KiROUND( aAngle / M_PI_4 ) * M_PI_4;

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2017-2021 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -90,9 +90,9 @@ static double getTickLineWidth( const TEXT_DIMS& textDims, bool aDrawingDropShad
*/
struct TICK_FORMAT
{
double divisionBase; ///> multiple from the last scale
int majorStep; ///> ticks between major ticks
int midStep; ///> ticks between medium ticks (0 if no medium ticks)
double divisionBase; ///< multiple from the last scale
int majorStep; ///< ticks between major ticks
int midStep; ///< ticks between medium ticks (0 if no medium ticks)
};

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* Copyright (C) 2013-2020 KiCad Developers, see CHANGELOG.txt for contributors.
* Copyright (C) 2013-2021 KiCad Developers, see CHANGELOG.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -43,7 +43,7 @@
#include <wx/stc/stc.h>
#include <kiplatform/app.h>
///> Stores information about a mouse button state
///< Stores information about a mouse button state
struct TOOL_DISPATCHER::BUTTON_STATE
{
BUTTON_STATE( TOOL_MOUSE_BUTTONS aButton, const wxEventType& aDownEvent,
@ -57,45 +57,45 @@ struct TOOL_DISPATCHER::BUTTON_STATE
dblClickEvent( aDblClickEvent )
{};
///> Flag indicating that dragging is active for the given button.
///< Flag indicating that dragging is active for the given button.
bool dragging;
///> Flag indicating that the given button is pressed.
///< Flag indicating that the given button is pressed.
bool pressed;
///> Point where dragging has started (in world coordinates).
///< Point where dragging has started (in world coordinates).
VECTOR2D dragOrigin;
///> Point where click event has occurred.
///< Point where click event has occurred.
VECTOR2D downPosition;
///> Difference between drag origin point and current mouse position (expressed as distance in
///> pixels).
///< Difference between drag origin point and current mouse position (expressed as distance in
///< pixels).
double dragMaxDelta;
///> Determines the mouse button for which information are stored.
///< Determines the mouse button for which information are stored.
TOOL_MOUSE_BUTTONS button;
///> The type of wxEvent that determines mouse button press.
///< The type of wxEvent that determines mouse button press.
wxEventType downEvent;
///> The type of wxEvent that determines mouse button release.
///< The type of wxEvent that determines mouse button release.
wxEventType upEvent;
///> The type of wxEvent that determines mouse button double click.
///< The type of wxEvent that determines mouse button double click.
wxEventType dblClickEvent;
///> Time stamp for the last mouse button press event.
///< Time stamp for the last mouse button press event.
wxLongLong downTimestamp;
///> Restores initial state.
///< Restores initial state.
void Reset()
{
dragging = false;
pressed = false;
}
///> Checks the current state of the button.
///< Checks the current state of the button.
bool GetState() const
{
wxMouseState mouseState = wxGetMouseState();
@ -251,6 +251,7 @@ bool TOOL_DISPATCHER::handleMouseButton( wxEvent& aEvent, int aIndex, bool aMoti
return false;
}
// Helper function to know if a special key ( see key list ) should be captured
// or if the event can be skipped
// on Linux, the event must be passed to the GUI if they are not used by KiCad,
@ -279,6 +280,7 @@ bool isKeySpecialCode( int aKeyCode )
return isInList;
}
// Helper function to know if a key should be managed by DispatchWxEvent()
// or if the event can be ignored and skipped because the key is only a modifier
// that is not used alone in kicad
@ -430,7 +432,8 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
wxWindow* focus = wxWindow::FindFocus();
// Required in win32 to ensure wxTimer events get scheduled in between other events
// Or else we may stall them out entirely and never get them during actions like rapid mouse moves
// Or else we may stall them out entirely and never get them during actions like rapid
// mouse moves.
KIPLATFORM::APP::ForceTimerMessagesToBeCreatedIfNecessary();
wxEventType type = aEvent.GetEventType();
@ -607,7 +610,8 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
// Not handled wxEVT_CHAR must be Skipped (sent to GUI).
// Otherwise accelerators and shortcuts in main menu or toolbars are not seen.
// Escape key presses are never skipped by the handler since they correspond to tool cancel
// events, and if they aren't skipped then they are propagated to other frames (which we don't want).
// events, and if they aren't skipped then they are propagated to other frames (which we
// don't want).
if( (type == wxEVT_CHAR || type == wxEVT_CHAR_HOOK)
&& !keyIsSpecial
&& !handled

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2018 CERN
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -144,8 +144,7 @@ struct TOOL_MANAGER::TOOL_STATE
}
/**
* Function Push()
* Stores the current state of the tool on stack. Stacks are stored internally and are not
* Store the current state of the tool on stack. Stacks are stored internally and are not
* shared between different TOOL_STATE objects.
*/
void Push()
@ -156,9 +155,9 @@ struct TOOL_MANAGER::TOOL_STATE
}
/**
* Function Pop()
* Restores state of the tool from stack. Stacks are stored internally and are not
* Restore state of the tool from stack. Stacks are stored internally and are not
* shared between different TOOL_STATE objects.
*
* @return True if state was restored, false if the stack was empty.
*/
bool Pop()
@ -179,10 +178,10 @@ struct TOOL_MANAGER::TOOL_STATE
}
private:
///> Stack preserving previous states of a TOOL.
///< Stack preserving previous states of a TOOL.
std::stack<std::unique_ptr<TOOL_STATE>> stateStack;
///> Restores the initial state.
///< Restores the initial state.
void clear()
{
idle = true;

View File

@ -2,6 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2017 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -70,8 +72,7 @@ private:
friend class VIEW;
/**
* Function getLayers()
* Returns layer numbers used by the item.
* Return layer numbers used by the item.
*
* @param aLayers[]: output layer index array
* @param aCount: number of layer indices in aLayers[]
@ -91,17 +92,16 @@ private:
int m_requiredUpdate; ///< Flag required for updating
int m_drawPriority; ///< Order to draw this item in a layer, lowest first
///> Helper for storing cached items group ids
///< Helper for storing cached items group ids
typedef std::pair<int, int> GroupPair;
///> Indexes of cached GAL display lists corresponding to the item (for every layer it occupies).
///> (in the std::pair "first" stores layer number, "second" stores group id).
///< Indexes of cached GAL display lists corresponding to the item (for every layer it.
///< occupies)(in the std::pair "first" stores layer number, "second" stores group id).
GroupPair* m_groups;
int m_groupsSize;
/**
* Function getGroup()
* Returns number of the group id for the given layer, or -1 in case it was not cached before.
* Return number of the group id for the given layer, or -1 in case it was not cached before.
*
* @param aLayer is the layer number for which group id is queried.
* @return group id or -1 in case there is no group id (ie. item is not cached).
@ -118,8 +118,7 @@ private:
}
/**
* Function setGroup()
* Sets a group id for the item and the layer combination.
* Set a group id for the item and the layer combination.
*
* @param aLayer is the layer numbe.
* @param aGroup is the group id.
@ -151,8 +150,7 @@ private:
/**
* Function deleteGroups()
* Removes all of the stored group ids. Forces recaching of the item.
* Remove all of the stored group ids. Forces recaching of the item.
*/
void deleteGroups()
{
@ -163,8 +161,7 @@ private:
/**
* Function storesGroups()
* Returns information if the item uses at least one group id (ie. if it is cached at all).
* Return information if the item uses at least one group id (ie. if it is cached at all).
*
* @returns true in case it is cached at least for one layer.
*/
@ -175,7 +172,8 @@ private:
/**
* Reorders the stored groups (to facilitate reordering of layers)
* Reorder the stored groups (to facilitate reordering of layers).
*
* @see VIEW::ReorderLayerData
*
* @param aReorderMap is the mapping of old to new layer ids
@ -202,8 +200,7 @@ private:
std::vector<int> m_layers;
/**
* Function saveLayers()
* Saves layers used by the item.
* Save layers used by the item.
*
* @param aLayers is an array containing layer numbers to be saved.
* @param aCount is the size of the array.
@ -222,8 +219,7 @@ private:
}
/**
* Function viewRequiredUpdate()
* Returns current update flag for an item.
* Return current update flag for an item.
*/
int requiredUpdate() const
{
@ -231,8 +227,7 @@ private:
}
/**
* Function clearUpdateFlags()
* Marks an item as already updated, so it is not going to be redrawn.
* Mark an item as already updated, so it is not going to be redrawn.
*/
void clearUpdateFlags()
{
@ -240,8 +235,7 @@ private:
}
/**
* Function isRenderable()
* Returns if the item should be drawn or not.
* Return if the item should be drawn or not.
*/
bool isRenderable() const
{
@ -1198,7 +1192,8 @@ void VIEW::invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags )
}
else
{
// updateLayers updates geometry too, so we do not have to update both of them at the same time
// updateLayers updates geometry too, so we do not have to update both of them at the
// same time
if( aUpdateFlags & LAYERS )
{
updateLayers( aItem );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018 CERN
* Author: Maciej Suminski <maciej.suminski@cern.ch>
*
@ -90,34 +90,34 @@ public:
*
* @param aLayerName a text which can be printed as layer name.
* @param aPageNum the number of the current page (only used to print this value).
* @param aPageCount the number of pages to ptint (only used to print this value).
* @param aPageCount the number of pages to print (only used to print this value).
*/
virtual void DrawPage( const wxString& aLayerName = wxEmptyString,
int aPageNum = 1, int aPageCount = 1 );
protected:
///> Convert mils to internal units
///< Convert mils to internal units
virtual int milsToIU( double aMils ) const = 0;
///> Enables layers visibility for a printout
///< Enables layers visibility for a printout
virtual void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet );
///> Configures PAINTER object for a printout
///< Configures PAINTER object for a printout
virtual void setupPainter( KIGFX::PAINTER& aPainter );
///> Configures GAL object for a printout
///< Configures GAL object for a printout
virtual void setupGal( KIGFX::GAL* aGal );
///> Returns bounding box of the printed objects (excluding worksheet frame)
///< Returns bounding box of the printed objects (excluding worksheet frame)
virtual EDA_RECT getBoundingBox() = 0;
///> Returns a 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;
};

View File

@ -2,7 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright 2016-2017 CERN
* Copyright (C) 2020 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see change_log.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -34,15 +35,15 @@
class EDA_ITEM;
///> Types of changes
///< Types of changes
enum CHANGE_TYPE {
CHT_ADD = 1,
CHT_REMOVE = 2,
CHT_MODIFY = 4,
CHT_TYPE = CHT_ADD | CHT_REMOVE | CHT_MODIFY,
///> Flag to indicate the change is already applied,
///> just notify observers (not compatible with CHT_MODIFY)
///< Flag to indicate the change is already applied,
///< just notify observers (not compatible with CHT_MODIFY)
CHT_DONE = 8,
CHT_FLAGS = CHT_DONE
};
@ -73,39 +74,39 @@ public:
COMMIT();
virtual ~COMMIT();
///> Adds a new item to the model
///< Add a new item to the model
COMMIT& Add( EDA_ITEM* aItem )
{
return Stage( aItem, CHT_ADD );
}
///> Notifies observers that aItem has been added
///< Notify observers that aItem has been added
COMMIT& Added( EDA_ITEM* aItem )
{
return Stage( aItem, CHT_ADD | CHT_DONE );
}
///> Removes a new item from the model
///< Remove a new item from the model
COMMIT& Remove( EDA_ITEM* aItem )
{
return Stage( aItem, CHT_REMOVE );
}
///> Notifies observers that aItem has been removed
///< Notify observers that aItem has been removed
COMMIT& Removed( EDA_ITEM* aItem )
{
return Stage( aItem, CHT_REMOVE | CHT_DONE );
}
///> Modifies a given item in the model.
///> 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 )
{
return Stage( aItem, CHT_MODIFY );
}
///> Creates an undo entry for an item that has been already modified. 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 )
{
return createModified( aItem, aCopy );
@ -121,7 +122,7 @@ public:
return *this;
}
///> Adds 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 );
virtual COMMIT& Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType );
@ -129,11 +130,11 @@ public:
virtual COMMIT& Stage( const PICKED_ITEMS_LIST& aItems,
UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED );
///> Executes the changes.
///< Execute the changes.
virtual void Push( const wxString& aMessage = wxT( "A commit" ),
bool aCreateUndoEntry = true, bool aSetDirtyBit = true ) = 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
@ -141,15 +142,15 @@ public:
return m_changes.empty();
}
///> Returns status of an item.
///< Returns status of an item.
int GetStatus( EDA_ITEM* aItem );
protected:
struct COMMIT_LINE
{
EDA_ITEM* m_item; ///> Main item that is added/deleted/modified
EDA_ITEM* m_copy; ///> Optional copy of the item
CHANGE_TYPE m_type; ///> Modification type
EDA_ITEM* m_item; ///< Main item that is added/deleted/modified
EDA_ITEM* m_copy; ///< Optional copy of the item
CHANGE_TYPE m_type; ///< Modification type
};
// Should be called in Push() & Revert() methods

View File

@ -4,7 +4,7 @@
* Copyright (C) 2014-2020 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2007-2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@ -148,7 +148,7 @@ wxString GetOSXKicadDataDir();
// this function, so add it if missing
#if !wxCHECK_VERSION( 3, 1, 0 )
#define USE_KICAD_WXSTRING_HASH // for common.cpp
///> Template specialization to enable wxStrings for certain containers (e.g. unordered_map)
///< Template specialization to enable wxStrings for certain containers (e.g. unordered_map)
namespace std
{
template<> struct hash<wxString>

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@ -23,7 +23,8 @@
*/
/**
* This file is part of the common library
* This file is part of the common library.
*
* @file confirm.h
* @see common.h
*/
@ -44,7 +45,7 @@ class wxStaticBitmap;
class KIDIALOG : public wxRichMessageDialog
{
public:
///> Dialog type. Selects appropriate icon and default dialog title
///< Dialog type. Selects appropriate icon and default dialog title
enum KD_TYPE { KD_NONE, KD_INFO, KD_QUESTION, KD_WARNING, KD_ERROR };
KIDIALOG( wxWindow* aParent, const wxString& aMessage, const wxString& aCaption,
@ -58,10 +59,10 @@ public:
return wxRichMessageDialog::SetOKCancelLabels( ok, cancel );
}
///> Shows the 'do not show again' checkbox
///< Shows the 'do not show again' checkbox
void DoNotShowCheckbox( wxString file, int line );
///> Checks the 'do not show again' setting for the dialog
///< Checks the 'do not show again' setting for the dialog
bool DoNotShowAgain() const;
void ForceShowAgain();
@ -154,7 +155,7 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& aMessage,
bool IsOK( wxWindow* aParent, const wxString& aMessage );
/**
* Displays a warning dialog with \a aMessage and returns the user response.
* Display a warning dialog with \a aMessage and returns the user response.
*
* @param aParent is the parent window. NULL can be used if the parent is the top level window.
* @param aWarning is the warning to display in the top part of the dialog box using a bold font.
@ -174,7 +175,7 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
/**
* Displays a dialog with radioboxes asking the user to select an option.
* Display a dialog with radioboxes asking the user to select an option.
*
* @param aParent is the parent window.
* @param aTitle is the dialog title.
@ -183,6 +184,6 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
* @return Index of the selected option or -1 when the dialog has been canceled.
*/
int SelectSingleOption( wxWindow* aParent, const wxString& aTitle, const wxString& aMessage,
const wxArrayString& aOptions );
const wxArrayString& aOptions );
#endif /* __INCLUDE__CONFIRM_H__ */

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2019-2021 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -76,21 +76,21 @@ public:
*/
struct CURSOR_DEF
{
///> The ID key used to uniquely identify a cursor in a given store
///< The ID key used to uniquely identify a cursor in a given store
KICURSOR m_id_key;
///> The image data bitmap
///< The image data bitmap
const unsigned char* m_image_data;
///> The mask data bitmap
///< The mask data bitmap
const unsigned char* m_mask_data;
const char** m_xpm;
///> The image size in pixels
///< The image size in pixels
wxSize m_size;
///> The "hotspot" where the cursor "is" in the image
///< The "hotspot" where the cursor "is" in the image
wxPoint m_hotspot;
};
@ -116,7 +116,7 @@ public:
static const wxStockCursor GetStockCursor( KICURSOR aCursorType );
private:
///> Internal store of cursors by ID
///< Internal store of cursors by ID
std::map<KICURSOR, wxCursor> m_store;
};

View File

@ -5,7 +5,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2021 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
@ -84,9 +84,10 @@ public:
* Dialog constructor
* @param aParent is the caller
* @param aCurrentColor is the current color, used to show it in dialog
* @param aAllowOpacityControl = true to allow opacity (alpha channel) setting
* @param aAllowOpacityControl true to allow opacity (alpha channel) setting
* false to not show this setting (opacity = 1.0 always)
* @param aUserColors: if not null is a list of defined colors replacing the dialog predefined colors
* @param aUserColors if not null is a list of defined colors replacing the dialog
* predefined colors
*/
DIALOG_COLOR_PICKER( wxWindow* aParent, const KIGFX::COLOR4D& aCurrentColor,
bool aAllowOpacityControl, CUSTOM_COLORS_LIST* aUserColors = nullptr,
@ -105,7 +106,7 @@ private:
bool m_allowMouseEvents;
bool m_allowOpacityCtrl; ///< true to show the widget,
///< false to keep alpha channel = 1.0
KIGFX::COLOR4D m_previousColor4D; ///< the inital color4d
KIGFX::COLOR4D m_previousColor4D; ///< the initial color4d
KIGFX::COLOR4D m_newColor4D; ///< the current color4d
KIGFX::COLOR4D m_defaultColor; ///< The default color4d
@ -117,7 +118,7 @@ private:
wxPoint m_cursorBitmapGreen; ///< the green cursor on the RGB bitmap palette.
wxPoint m_cursorBitmapBlue; ///< the blue cursor on the RGB bitmap palette.
wxPoint m_cursorBitmapHSV; ///< the cursor on the HSV bitmap palette.
wxPoint* m_selectedCursor; ///< the ref cursor to the selected curor, if any, or null.
wxPoint* m_selectedCursor; ///< the ref cursor to the selected cursor, if any, or null.
double m_hue; ///< the current hue, in degrees (0 ... 360)
double m_sat; ///< the current saturation (0 ... 1.0)
@ -136,7 +137,7 @@ private:
void createRGBBitmap(); ///< generate the bitmap that shows the RVB color space
void drawRGBPalette(); ///< draws the RVB color space
///> repaint a static bitmap with the aColor4D color
///< repaint a static bitmap with the aColor4D color
void updatePreview( wxStaticBitmap* aStaticBitmap, KIGFX::COLOR4D& aColor4D );
///< Event handler from wxSlider: brightness (value) control
@ -152,7 +153,7 @@ private:
void OnChangeEditHue( wxSpinEvent& event ) override;
void OnChangeEditSat( wxSpinEvent& event ) override;
///> mouse handlers, when clicking on a palette bitmap
///< mouse handlers, when clicking on a palette bitmap
void onRGBMouseClick( wxMouseEvent& event ) override;
void onRGBMouseDrag( wxMouseEvent& event ) override;
void onHSVMouseClick( wxMouseEvent& event ) override;
@ -163,8 +164,9 @@ private:
///< Event handler for the reset button press
void OnResetButton( wxCommandEvent& aEvent ) override;
/** manage the Hue and Saturation settings when the mouse cursor
* is at aMouseCursor.
/**
* Manage the Hue and Saturation settings when the mouse cursor is at aMouseCursor.
*
* @param aMouseCursor is the mouse cursor position on the HSV bitmap
* @return true if the Hue and Saturation can be set from aMouseCursor,
* if Saturation value computed from aMouseCursor is <= 1.0,
@ -172,14 +174,16 @@ private:
*/
bool setHSvaluesFromCursor( wxPoint aMouseCursor );
///> Event handler for defined color buttons
///< Event handler for defined color buttons
void buttColorClick( wxMouseEvent& event );
///> called when creating the dialog
///< called when creating the dialog
bool TransferDataToWindow() override;
/** creates the bitmap buttons for each defined colors
* if aPredefinedColors is nullptr, a internal predefined list will be used
/**
* Create the bitmap buttons for each defined colors.
*
* If aPredefinedColors is nullptr, a internal predefined list will be used.
*/
void initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColors );

View File

@ -2,8 +2,9 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017 CERN
*
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
@ -20,7 +21,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
///> Helper functions to substitute paths with environmental variables.
///< Helper functions to substitute paths with environmental variables.
#ifndef ENV_PATHS_H
#define ENV_PATHS_H
@ -28,45 +29,46 @@
#include <pgm_base.h>
/**
* Normalizes a file path to an environmental variable, if possible.
* Normalize a file path to an environmental variable, if possible.
*
* @param aFilePath is the full file path (path and file name) to be normalized.
* @param aEnvVars is an optional map of environmental variables to try substition with.
* @param aEnvVars is an optional map of environmental variables to try substitution with.
* @param aProject is an optional project, to normalize the file path to the project path.
* @return Normalized full file path (path and file name) if succeeded or empty string if the
* path could not be normalized.
* path could not be normalized.
*/
wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars,
const PROJECT* aProject );
/**
* Normalizes a file path to an environmental variable, if possible.
* Normalize a file path to an environmental variable, if possible.
*
* @param aFilePath is the full file path (path and file name) to be normalized.
* @param aEnvVars is an optional map of environmental variables to try substition with.
* @param aEnvVars is an optional map of environmental variables to try substitution with.
* @param aProjectPath is an optional string to normalize the file path to the project path.
* @return Normalized full file path (path and file name) if succeeded or empty string if the
* path could not be normalized.
* path could not be normalized.
*/
wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars,
const wxString& aProjectPath );
/**
* Searches the default paths trying to find one with the requested file.
* Search the default paths trying to find one with the requested file.
*
* @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 (apth and file name) if the file was found in one of the paths, otherwise
* an empty string.
* an empty string.
*/
wxString ResolveFile( const wxString& aFileName, const ENV_VAR_MAP* aEnvVars,
const PROJECT* aProject );
/**
* Checks if a given filename is within a given project directory (not whether it exists!)
* Check if a given filename is within a given project directory (not whether it exists!)
*
* @param aFileName is the absolute path to check
* @param aProject is the project to test agains
* @param aProject is the project to test against
* @param aSubPath will be filled with the relative path to the file inside the project (if any)
* @return true if aFileName's path is inside aProject's path
*/

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012-2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2018 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -40,7 +40,7 @@
#include <memory>
/**
* Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
* The Cairo implementation of the graphics abstraction layer.
*
* Quote from Wikipedia:
* " Cairo is a software library used to provide a vector graphics-based, device-independent
@ -213,7 +213,7 @@ public:
void EnableDepthTest( bool aEnabled = false ) override;
///> @copydoc GAL::DrawGrid()
///< @copydoc GAL::DrawGrid()
void DrawGrid() override;
@ -264,17 +264,17 @@ protected:
void storePath(); ///< Store the actual path
/**
* Blits cursor into the current screen.
* Blit cursor into the current screen.
*/
void blitCursor( wxMemoryDC& clientDC );
/// Drawing polygons & polylines is the same in cairo, so here is the common code
/// Drawing polygons & polylines is the same in Cairo, so here is the common code
void drawPoly( const std::deque<VECTOR2D>& aPointList );
void drawPoly( const VECTOR2D aPointList[], int aListSize );
void drawPoly( const SHAPE_LINE_CHAIN& aLineChain );
/**
* Returns a valid key that can be used as a new group number.
* Return a valid key that can be used as a new group number.
*
* @return An unique group number that is not used by any other group.
*/
@ -369,7 +369,7 @@ public:
~CAIRO_GAL();
///> @copydoc GAL::IsVisible()
///< @copydoc GAL::IsVisible()
bool IsVisible() const override
{
return IsShownOnScreen() && !GetClientRect().IsEmpty();
@ -443,7 +443,7 @@ public:
*/
void skipMouseEvent( wxMouseEvent& aEvent );
///> Cairo-specific update handlers
///< Cairo-specific update handlers
bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
protected:
@ -462,7 +462,7 @@ protected:
unsigned char* wxOutput; ///< wxImage compatible buffer
// Variables related to Cairo <-> wxWidgets
unsigned char* bitmapBuffer; ///< Storage of the cairo image
unsigned char* bitmapBuffer; ///< Storage of the Cairo image
int stride; ///< Stride value for Cairo
int wxBufferWidth;
bool isInitialized; ///< Are Cairo image & surface ready to use

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2018 CERN
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* Author: Maciej Suminski <maciej.suminski@cern.ch>
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
@ -71,7 +71,7 @@ private:
cairo_surface_t* m_surface;
#ifdef __WXMSW__
///> DC handle on Windows
///< DC handle on Windows
void* m_hdc; // the real type is HDC, but do not pull in extra headers
#endif /* __WXMSW__ */
@ -110,17 +110,17 @@ public:
void SetSheetSize( const VECTOR2D& aSize ) override;
private:
///> Returns true if page orientation is landscape
///< Returns true if page orientation is landscape
bool isLandscape() const
{
return m_nativePaperSize.x > m_nativePaperSize.y;
}
///> Printout size
///< Printout size
VECTOR2D m_nativePaperSize;
///> Flag indicating whether the platform rotates page automatically or
///> GAL needs to handle it in the transformation matrix
///< Flag indicating whether the platform rotates page automatically or
///< GAL needs to handle it in the transformation matrix
bool m_hasNativeLandscapeRotation;
std::unique_ptr<CAIRO_PRINT_CTX> m_printCtx;

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2017 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2017-2021 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
@ -86,7 +86,7 @@ namespace KIGFX
GAL_DISPLAY_OPTIONS();
/**
* Read GAL config options from applicaton-level config
* Read GAL config options from application-level config
* @param aCfg the window settings to load from
*/
void ReadWindowSettings( WINDOW_SETTINGS& aCfg );
@ -120,28 +120,28 @@ namespace KIGFX
DPI_SCALING m_dpi;
///> The grid style to draw the grid in
///< The grid style to draw the grid in
KIGFX::GRID_STYLE m_gridStyle;
///> Snapping options for the grid
///< Snapping options for the grid
GRID_SNAPPING m_gridSnapping;
///> Thickness to render grid lines/dots
///< Thickness to render grid lines/dots
double m_gridLineWidth;
///> Minimum pixel distance between displayed grid lines
///< Minimum pixel distance between displayed grid lines
double m_gridMinSpacing;
///> Whether or not to draw the coordinate system axes
///< Whether or not to draw the coordinate system axes
bool m_axesEnabled;
///> Fullscreen crosshair or small cross
///< Fullscreen crosshair or small cross
bool m_fullscreenCursor;
///> Force cursor display
///< Force cursor display
bool m_forceDisplayCursor;
///> The pixel scale factor (>1 for hi-DPI scaled displays)
///< The pixel scale factor (>1 for hi-DPI scaled displays)
double m_scaleFactor;
};

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* Graphics Abstraction Layer (GAL) - base class
*
@ -47,10 +47,10 @@ namespace KIGFX
{
/**
* Class GAL is the abstract interface for drawing on a 2D-surface.
* Abstract interface for drawing on a 2D-surface.
*
* The functions are optimized for drawing shapes of an EDA-program such as KiCad. Most methods
* are abstract and need to be implemented by a lower layer, for example by a cairo or OpenGL
* are abstract and need to be implemented by a lower layer, for example by a Cairo or OpenGL
* implementation. Almost all methods use world coordinates as arguments. The board design is
* defined in world space units for drawing purposes these are transformed to screen units with
* this layer. So zooming is handled here as well.
@ -69,16 +69,16 @@ public:
GAL( GAL_DISPLAY_OPTIONS& aOptions );
virtual ~GAL();
/// Returns the initialization status for the canvas.
/// Return the initialization status for the canvas.
virtual bool IsInitialized() const { return true; }
/// Returns true if the GAL canvas is visible on the screen.
/// Return true if the GAL canvas is visible on the screen.
virtual bool IsVisible() const { return true; }
/// Returns true if the GAL engine is a cairo based type.
/// Return true if the GAL engine is a Cairo based type.
virtual bool IsCairoEngine() { return false; }
/// Returns true if the GAL engine is a OpenGL based type.
/// Return true if the GAL engine is a OpenGL based type.
virtual bool IsOpenGlEngine() { return false; }
// ---------------
@ -198,13 +198,13 @@ public:
// Screen methods
// --------------
/// Resizes the canvas.
/// Resize the canvas.
virtual void ResizeScreen( int aWidth, int aHeight ) {};
/// Shows/hides the GAL canvas
/// Show/hide the GAL canvas
virtual bool Show( bool aShow ) { return true; };
/// Returns GAL canvas size in pixels
/// Return GAL canvas size in pixels
const VECTOR2I& GetScreenPixelSize() const
{
return screenSize;
@ -337,7 +337,7 @@ public:
}
/**
* Draws a vector type text using preloaded Newstroke font.
* Draw a vector type text using preloaded Newstroke font.
*
* @param aText is the text to be drawn.
* @param aPosition is the text position in world coordinates.
@ -350,7 +350,7 @@ public:
}
/**
* Draws a text using a bitmap font. It should be faster than StrokeText(),
* Draw a text using a bitmap font. It should be faster than StrokeText(),
* but can be used only for non-Gerber elements.
*
* @param aText is the text to be drawn.
@ -373,8 +373,7 @@ public:
}
/**
* Compute the X and Y size of a given text. The text is expected to be
* a only one line text.
* Compute the X and Y size of a given text. The text is expected to be a only one line text.
*
* @param aText is the text string (one line).
* @return is the text size.
@ -389,7 +388,7 @@ public:
virtual void SetTextAttributes( const EDA_TEXT* aText );
/**
* Reset text attributes to default styling
* Reset text attributes to default styling.
*
* Normally, custom attributes will be set individually after this,
* otherwise you can use SetTextAttributes()
@ -442,7 +441,7 @@ public:
}
/**
* Returns current text horizontal justification setting.
* Return current text horizontal justification setting.
*/
inline EDA_TEXT_HJUSTIFY_T GetHorizontalJustify() const
{
@ -531,7 +530,7 @@ public:
virtual void DrawGroup( int aGroupNumber ) {};
/**
* Changes the color used to draw the group.
* Change the color used to draw the group.
*
* @param aGroupNumber is the group number.
* @param aNewColor is the new color.
@ -539,7 +538,7 @@ public:
virtual void ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor ) {};
/**
* Changes the depth (Z-axis position) of the group.
* Change the depth (Z-axis position) of the group.
*
* @param aGroupNumber is the group number.
* @param aDepth is the new depth.
@ -703,7 +702,7 @@ public:
}
/**
* Returns the minimum depth in the currently used range (the top).
* Return the minimum depth in the currently used range (the top).
*/
inline double GetMinDepth() const
{
@ -711,7 +710,7 @@ public:
}
/**
* Returns the maximum depth in the currently used range (the bottom).
* Return the maximum depth in the currently used range (the bottom).
*/
inline double GetMaxDepth() const
{
@ -761,28 +760,28 @@ public:
// ---------------------------
/**
* Sets the target for rendering.
* Set the target for rendering.
*
* @param aTarget is the new target for rendering.
*/
virtual void SetTarget( RENDER_TARGET aTarget ) {};
/**
* Gets the currently used target for rendering.
* Get the currently used target for rendering.
*
* @return The current rendering target.
*/
virtual RENDER_TARGET GetTarget() const { return TARGET_CACHED; };
/**
* Clears the target for rendering.
* Clear the target for rendering.
*
* @param aTarget is the target to be cleared.
*/
virtual void ClearTarget( RENDER_TARGET aTarget ) {};
/**
* Returns true if the target exists.
* Return true if the target exists.
*
* @param aTarget is the target to be checked.
*/
@ -792,7 +791,7 @@ public:
};
/**
* Sets negative draw mode in the renderer
* Set negative draw mode in the renderer.
*
* When negative mode is enabled, drawn items will subtract from
* previously drawn items. This is mainly needed for Gerber
@ -809,7 +808,7 @@ public:
// -------------
/**
* Sets the visibility setting of the grid.
* Set the visibility setting of the grid.
*
* @param aVisibility is the new visibility setting of the grid.
*/
@ -861,7 +860,7 @@ public:
}
/**
* Returns the grid size.
* Return the grid size.
*
* @return A vector containing the grid size in x and y direction.
*/
@ -891,7 +890,7 @@ public:
}
/**
* Enables drawing the axes.
* Enable drawing the axes.
*/
inline void SetAxesEnabled( bool aAxesEnabled )
{
@ -918,7 +917,7 @@ public:
return gridLineWidth;
}
///> Draw the grid
///< Draw the grid
virtual void DrawGrid() {};
/**
@ -962,7 +961,7 @@ public:
}
/**
* Returns information about cursor visibility.
* Return information about cursor visibility.
*
* @return True if cursor is visible.
*/
@ -989,7 +988,7 @@ public:
virtual void DrawCursor( const VECTOR2D& aCursorPosition ) {};
/**
* Changes the current depth to deeper, so it is possible to draw objects right beneath
* Change the current depth to deeper, so it is possible to draw objects right beneath
* other.
*/
inline void AdvanceDepth()
@ -998,7 +997,7 @@ public:
}
/**
* Stores current drawing depth on the depth stack.
* Store current drawing depth on the depth stack.
*/
inline void PushDepth()
{
@ -1006,7 +1005,7 @@ public:
}
/**
* Restores previously stored drawing depth for the depth stack.
* Restore previously stored drawing depth for the depth stack.
*/
inline void PopDepth()
{
@ -1026,16 +1025,16 @@ public:
}
protected:
/// Private: use GAL_CONTEXT_LOCKER RAII object
/// Use GAL_CONTEXT_LOCKER RAII object
virtual void lockContext( int aClientCookie ) {}
virtual void unlockContext( int aClientCookie ) {}
/// Enables item update mode.
/// Enable item update mode.
/// Private: use GAL_UPDATE_CONTEXT RAII object
virtual void beginUpdate() {}
/// Disables item update mode.
/// Disable item update mode.
virtual void endUpdate() {}
/// Begin the drawing, needs to be called for every new frame.
@ -1067,7 +1066,7 @@ protected:
static const int GRID_DEPTH;
/**
* Gets the actual cursor color to draw
* Get the actual cursor color to draw
*/
COLOR4D getCursorColor() const;
@ -1075,7 +1074,7 @@ protected:
// Settings observer interface
// ---------------
/**
* Handler for observer settings changes
* Handler for observer settings changes.
*/
void OnGalDisplayOptionsChanged( const GAL_DISPLAY_OPTIONS& aOptions ) override;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright 2013-2017 CERN
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -54,19 +54,19 @@ public:
return true;
}
///> @copydoc VERTEX_CONTAINER::SetItem()
///< @copydoc VERTEX_CONTAINER::SetItem()
virtual void SetItem( VERTEX_ITEM* aItem ) override;
///> @copydoc VERTEX_CONTAINER::FinishItem()
///< @copydoc VERTEX_CONTAINER::FinishItem()
virtual void FinishItem() override;
///> @copydoc VERTEX_CONTAINER::Allocate()
///< @copydoc VERTEX_CONTAINER::Allocate()
virtual VERTEX* Allocate( unsigned int aSize ) override;
///> @copydoc VERTEX_CONTAINER::Delete()
///< @copydoc VERTEX_CONTAINER::Delete()
virtual void Delete( VERTEX_ITEM* aItem ) override;
///> @copydoc VERTEX_CONTAINER::Clear()
///< @copydoc VERTEX_CONTAINER::Clear()
virtual void Clear() override;
/**
@ -79,14 +79,14 @@ public:
*/
virtual bool IsMapped() const = 0;
///> @copydoc VERTEX_CONTAINER::Map()
///< @copydoc VERTEX_CONTAINER::Map()
virtual void Map() override = 0;
///> @copydoc VERTEX_CONTAINER::Unmap()
///< @copydoc VERTEX_CONTAINER::Unmap()
virtual void Unmap() override = 0;
protected:
///> Maps size of free memory chunks to their offsets
///< Maps size of free memory chunks to their offsets
typedef std::pair<unsigned int, unsigned int> CHUNK;
typedef std::multimap<unsigned int, unsigned int> FREE_CHUNK_MAP;
@ -153,20 +153,20 @@ protected:
*/
void addFreeChunk( unsigned int aOffset, unsigned int aSize );
///> Store size & offset of free chunks.
///< Store size & offset of free chunks.
FREE_CHUNK_MAP m_freeChunks;
///> Stored VERTEX_ITEMs
///< Stored VERTEX_ITEMs
ITEMS m_items;
///> Currently modified item
///< Currently modified item
VERTEX_ITEM* m_item;
///> Properties of currently modified chunk & item
///< Properties of currently modified chunk & item
unsigned int m_chunkSize;
unsigned int m_chunkOffset;
///> Maximal vertex index number stored in the container
///< Maximal vertex index number stored in the container
unsigned int m_maxIndex;
private:

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