7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 20:11:41 +00:00

Build time optimizations.

This commit is contained in:
Alex Shvartzkop 2024-04-27 22:57:24 +03:00
parent 16f3237983
commit 16e3692e71
175 changed files with 560 additions and 303 deletions
3d-viewer
common
cvpcb
eeschema
gerbview
include
kicad
pagelayout_editor
pcbnew
qa/tests/eeschema

View File

@ -34,6 +34,7 @@
#include "../3d_rendering/raytracing/shapes2D/round_segment_2d.h"
#include "../3d_rendering/raytracing/shapes2D/triangle_2d.h"
#include <board_adapter.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_text.h>

View File

@ -36,6 +36,7 @@
#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h"
#include "raytracing/shapes2D/triangle_2d.h"
#include <board_design_settings.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_text.h>

View File

@ -30,6 +30,7 @@
#include "render_3d_opengl.h"
#include "opengl_utils.h"
#include "common_ogl/ogl_utils.h"
#include <board.h>
#include <footprint.h>
#include <3d_math.h>
#include <glm/geometric.hpp>

View File

@ -31,6 +31,7 @@
#define _BBOX_3D_H_
#include <plugins/3dapi/xv3d_types.h> // SFVEC2F
#include <glm/mat4x4.hpp>
struct RAY;

View File

@ -38,6 +38,7 @@
#include <3d_viewer/tools/eda_3d_actions.h>
#include <3d_viewer/tools/eda_3d_controller.h>
#include <3d_viewer/tools/eda_3d_conditions.h>
#include <board.h>
#include <advanced_config.h>
#include <bitmaps.h>
#include <board_design_settings.h>

View File

@ -133,6 +133,7 @@ set( KICOMMON_SRCS
exceptions.cpp
gestfich.cpp
json_conversions.cpp
kidialog.cpp
kiid.cpp
kiway.cpp
kiway_express.cpp

View File

@ -22,134 +22,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <confirm.h>
#include <functional>
#include <wx/app.h>
#include <wx/stockitem.h>
#include <wx/richmsgdlg.h>
#include <wx/msgdlg.h>
#include <wx/choicdlg.h>
#include <wx/crt.h>
#include <confirm.h>
#include <functional>
#include <unordered_map>
// Set of dialogs that have been chosen not to be shown again
static std::unordered_map<unsigned long, int> doNotShowAgainDlgs;
KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, const wxString& aCaption,
long aStyle )
: wxRichMessageDialog( aParent, aMessage, aCaption, aStyle | wxCENTRE | wxSTAY_ON_TOP ),
m_hash( 0 ),
m_cancelMeansCancel( true )
{
}
KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, KD_TYPE aType,
const wxString& aCaption )
: wxRichMessageDialog( aParent, aMessage, getCaption( aType, aCaption ), getStyle( aType ) ),
m_hash( 0 ),
m_cancelMeansCancel( true )
{
}
void KIDIALOG::DoNotShowCheckbox( wxString aUniqueId, int line )
{
ShowCheckBox( _( "Do not show again" ), false );
m_hash = std::hash<wxString>{}( aUniqueId ) + line;
}
bool KIDIALOG::DoNotShowAgain() const
{
return doNotShowAgainDlgs.count( m_hash ) > 0;
}
void KIDIALOG::ForceShowAgain()
{
doNotShowAgainDlgs.erase( m_hash );
}
bool KIDIALOG::Show( bool aShow )
{
// We should check the do-not-show-again setting only when the dialog is displayed
if( aShow )
{
// Check if this dialog should be shown to the user
auto it = doNotShowAgainDlgs.find( m_hash );
if( it != doNotShowAgainDlgs.end() )
return it->second;
}
int ret = wxRichMessageDialog::Show( aShow );
// Has the user asked not to show the dialog again?
// Note that we don't save a Cancel value unless the Cancel button is being used for some
// other function (which is actually more common than it being used for Cancel).
if( IsCheckBoxChecked() && (!m_cancelMeansCancel || ret != wxID_CANCEL ) )
doNotShowAgainDlgs[m_hash] = ret;
return ret;
}
int KIDIALOG::ShowModal()
{
// Check if this dialog should be shown to the user
auto it = doNotShowAgainDlgs.find( m_hash );
if( it != doNotShowAgainDlgs.end() )
return it->second;
int ret = wxRichMessageDialog::ShowModal();
// Has the user asked not to show the dialog again?
// Note that we don't save a Cancel value unless the Cancel button is being used for some
// other function (which is actually more common than it being used for Cancel).
if( IsCheckBoxChecked() && (!m_cancelMeansCancel || ret != wxID_CANCEL ) )
doNotShowAgainDlgs[m_hash] = ret;
return ret;
}
wxString KIDIALOG::getCaption( KD_TYPE aType, const wxString& aCaption )
{
if( !aCaption.IsEmpty() )
return aCaption;
switch( aType )
{
case KD_NONE: /* fall through */
case KD_INFO: return _( "Message" );
case KD_QUESTION: return _( "Question" );
case KD_WARNING: return _( "Warning" );
case KD_ERROR: return _( "Error" );
}
return wxEmptyString;
}
long KIDIALOG::getStyle( KD_TYPE aType )
{
long style = wxOK | wxCENTRE | wxSTAY_ON_TOP;
switch( aType )
{
case KD_NONE: break;
case KD_INFO: style |= wxICON_INFORMATION; break;
case KD_QUESTION: style |= wxICON_QUESTION; break;
case KD_WARNING: style |= wxICON_WARNING; break;
case KD_ERROR: style |= wxICON_ERROR; break;
}
return style;
}
bool AskOverrideLock( wxWindow* aParent, const wxString& aMessage )

View File

@ -24,6 +24,7 @@
#include <build_version.h>
#include <eda_base_frame.h>
#include <wx/clipbrd.h>
#include <wx/msgdlg.h>
#include <wx/hyperlink.h>

View File

@ -526,7 +526,7 @@ int DIALOG_SHIM::ShowQuasiModal()
m_qmodal_showing = true;
WX_EVENT_LOOP event_loop;
wxGUIEventLoop event_loop;
m_qmodal_loop = &event_loop;

View File

@ -26,6 +26,7 @@
#include <project.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <eda_base_frame.h>
DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent, const wxString aNetName,

View File

@ -23,7 +23,8 @@
#include <dialogs/dialog_book_reporter.h>
#include <widgets/wx_html_report_box.h>
#include <wx/wxhtml.h>
#include <wx/event.h>
#include <kiway_player.h>
wxDEFINE_EVENT( EDA_EVT_CLOSE_DIALOG_BOOK_REPORTER, wxCommandEvent );

View File

@ -26,8 +26,10 @@
#include <bitmaps.h>
#include <confirm.h>
#include <kidialog.h>
#include <validators.h>
#include <dialogs/html_message_box.h>
#include <settings/common_settings.h>
#include <filename_resolver.h>
#include <env_vars.h>
#include <grid_tricks.h>

View File

@ -17,8 +17,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <dialogs/dialog_edit_library_tables.h>

View File

@ -22,8 +22,7 @@
*/
#include <bitmaps.h>
#include <confirm.h>
#include <wx/textdlg.h>
#include <wx/msgdlg.h>
#include <dialogs/dialog_grid_settings.h>
#include <widgets/std_bitmap_button.h>
#include <common.h>

View File

@ -23,6 +23,7 @@
#include <dialogs/dialog_hotkey_list.h>
#include <kiface_base.h>
#include <eda_base_frame.h>
#include <panel_hotkeys_editor.h>
#include <widgets/ui_common.h>

View File

@ -22,7 +22,6 @@
#include <bitmaps.h>
#include <base_screen.h>
#include <common.h> // ExpandEnvVarSubstitutions
#include <confirm.h>
#include <core/arraydim.h>
#include <dialogs/dialog_page_settings.h>
#include <eda_draw_frame.h>
@ -43,6 +42,7 @@
#include <wx/tokenzr.h>
#include <wx/filedlg.h>
#include <wx/dcmemory.h>
#include <wx/msgdlg.h>
#define MAX_PAGE_EXAMPLE_SIZE 200

View File

@ -19,10 +19,10 @@
#include <dialogs/dialog_print_generic.h>
#include <confirm.h>
#include <eda_draw_frame.h>
#include <printout.h>
#include <pgm_base.h>
#include <confirm.h>
#include <wx/print.h>
#include <wx/printdlg.h>

View File

@ -18,6 +18,7 @@
*/
#include <algorithm>
#include <set>
#include <bitmaps.h>
#include <string_utils.h>
#include <dialogs/eda_reorderable_list_dialog.h>

View File

@ -26,9 +26,13 @@
#include <dialog_shim.h>
#include <git2.h>
#include <vector>
class wxCheckBox;
class wxTextCtrl;
class wxListCtrl;
class wxButton;
class DIALOG_GIT_COMMIT : public DIALOG_SHIM
{
public:

View File

@ -29,6 +29,7 @@
#include <wx/listctrl.h>
#include <wx/event.h>
#include <wx/sizer.h>
#include <wx/timer.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>

View File

@ -26,12 +26,12 @@
#define DIALOG_GIT_SWITCH_H
#include <dialog_shim.h>
#include <wx/timer.h>
#include <git2.h>
class wxButton;
class wxListView;
class wxTextCtrl;
class wxTimer;
class wxListEvent;
struct BranchData

View File

@ -27,6 +27,7 @@
#include <eda_view_switcher_base.h>
class EDA_DRAW_FRAME;
class wxTimer;
/**
* Similar to EDA_VIEW_SWITCHER, this dialog is a popup that shows feedback when using a hotkey to

View File

@ -27,10 +27,12 @@
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <validators.h>
#include <widgets/ui_common.h>
#include <widgets/color_swatch.h>
#include <widgets/wx_panel.h>
#include <wx/msgdlg.h>
#include <wx/menu.h>
#include <wx/textdlg.h>
// Button ID starting point

View File

@ -22,12 +22,12 @@
*/
#include <bitmaps.h>
#include <confirm.h>
#include <wx/textdlg.h>
#include <dialogs/panel_grid_settings.h>
#include <dialogs/dialog_grid_settings.h>
#include <widgets/std_bitmap_button.h>
#include <common.h>
#include <confirm.h>
#include <settings/app_settings.h>
#include <eda_draw_frame.h>
#include <tool/tool_manager.h>

View File

@ -23,11 +23,12 @@
*/
#include <wx/dcclient.h>
#include <confirm.h>
#include <wx/msgdlg.h>
#include <bitmap_base.h>
#include <pcb_base_edit_frame.h>
#include <tool/tool_manager.h>
#include <tool/actions.h>
#include <confirm.h>
#include <dialogs/panel_image_editor.h>

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