diff --git a/common/trace_helpers.cpp b/common/trace_helpers.cpp index 8779bf64f0..5b6ea28a53 100644 --- a/common/trace_helpers.cpp +++ b/common/trace_helpers.cpp @@ -1,270 +1,272 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2018 Wayne Stambaugh - * Copyright (C) 2018 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 Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file trace_helpers.cpp - * @brief wxLogTrace helper implementation. - */ - -#include -#include -#include -#include - - -const wxChar* traceFindReplace = wxT( "KICAD_FIND_REPLACE" ); -const wxChar* kicadTraceCoords = wxT( "KICAD_COORDS" ); -const wxChar* kicadTraceKeyEvent = wxT( "KICAD_KEY_EVENTS" ); -const wxChar* traceSchLibMem = wxT( "KICAD_SCH_LIB_MEM" ); -const wxChar* traceFindItem = wxT( "KICAD_FIND_ITEM" ); -const wxChar* traceSchLegacyPlugin = wxT( "KICAD_SCH_LEGACY_PLUGIN" ); -const wxChar* traceGedaPcbPlugin = wxT( "KICAD_GEDA_PLUGIN" ); -const wxChar* traceKicadPcbPlugin = wxT( "KICAD_PCB_PLUGIN" ); -const wxChar* tracePrinting = wxT( "KICAD_PRINT" ); -const wxChar* traceAutoSave = wxT( "KICAD_AUTOSAVE" ); - - -wxString dump( const wxArrayString& aArray ) -{ - wxString tmp; - - for( unsigned i = 0; i < aArray.GetCount(); i++ ) - { - if( aArray[i].IsEmpty() ) - tmp << wxT( "\"\" " ); - else - tmp << aArray[i] << wxT( " " ); - } - - return tmp; -} - - -// The following code was shamelessly copied from the wxWidgets keyboard sample -// at https://github.com/wxWidgets/wxWidgets/blob/master/samples/keyboard/keyboard.cpp. - -///////////////////////////////////////////////////////////////////////////// -// Author: Vadim Zeitlin -// Modified by: Marcin Wojdyr -// Created: 07.04.02 -// Copyright: (c) 2002 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// helper function that returns textual description of wx virtual keycode -const char* GetVirtualKeyCodeName(int keycode) -{ - switch ( keycode ) - { -#define WXK_(x) \ - case WXK_##x: return #x; - - WXK_(BACK) - WXK_(TAB) - WXK_(RETURN) - WXK_(ESCAPE) - WXK_(SPACE) - WXK_(DELETE) - WXK_(START) - WXK_(LBUTTON) - WXK_(RBUTTON) - WXK_(CANCEL) - WXK_(MBUTTON) - WXK_(CLEAR) - WXK_(SHIFT) - WXK_(ALT) - WXK_(CONTROL) - WXK_(MENU) - WXK_(PAUSE) - WXK_(CAPITAL) - WXK_(END) - WXK_(HOME) - WXK_(LEFT) - WXK_(UP) - WXK_(RIGHT) - WXK_(DOWN) - WXK_(SELECT) - WXK_(PRINT) - WXK_(EXECUTE) - WXK_(SNAPSHOT) - WXK_(INSERT) - WXK_(HELP) - WXK_(NUMPAD0) - WXK_(NUMPAD1) - WXK_(NUMPAD2) - WXK_(NUMPAD3) - WXK_(NUMPAD4) - WXK_(NUMPAD5) - WXK_(NUMPAD6) - WXK_(NUMPAD7) - WXK_(NUMPAD8) - WXK_(NUMPAD9) - WXK_(MULTIPLY) - WXK_(ADD) - WXK_(SEPARATOR) - WXK_(SUBTRACT) - WXK_(DECIMAL) - WXK_(DIVIDE) - WXK_(F1) - WXK_(F2) - WXK_(F3) - WXK_(F4) - WXK_(F5) - WXK_(F6) - WXK_(F7) - WXK_(F8) - WXK_(F9) - WXK_(F10) - WXK_(F11) - WXK_(F12) - WXK_(F13) - WXK_(F14) - WXK_(F15) - WXK_(F16) - WXK_(F17) - WXK_(F18) - WXK_(F19) - WXK_(F20) - WXK_(F21) - WXK_(F22) - WXK_(F23) - WXK_(F24) - WXK_(NUMLOCK) - WXK_(SCROLL) - WXK_(PAGEUP) - WXK_(PAGEDOWN) - WXK_(NUMPAD_SPACE) - WXK_(NUMPAD_TAB) - WXK_(NUMPAD_ENTER) - WXK_(NUMPAD_F1) - WXK_(NUMPAD_F2) - WXK_(NUMPAD_F3) - WXK_(NUMPAD_F4) - WXK_(NUMPAD_HOME) - WXK_(NUMPAD_LEFT) - WXK_(NUMPAD_UP) - WXK_(NUMPAD_RIGHT) - WXK_(NUMPAD_DOWN) - WXK_(NUMPAD_PAGEUP) - WXK_(NUMPAD_PAGEDOWN) - WXK_(NUMPAD_END) - WXK_(NUMPAD_BEGIN) - WXK_(NUMPAD_INSERT) - WXK_(NUMPAD_DELETE) - WXK_(NUMPAD_EQUAL) - WXK_(NUMPAD_MULTIPLY) - WXK_(NUMPAD_ADD) - WXK_(NUMPAD_SEPARATOR) - WXK_(NUMPAD_SUBTRACT) - WXK_(NUMPAD_DECIMAL) - WXK_(NUMPAD_DIVIDE) - - WXK_(WINDOWS_LEFT) - WXK_(WINDOWS_RIGHT) -#ifdef __WXOSX__ - WXK_(RAW_CONTROL) -#endif -#undef WXK_ - - default: - return NULL; - } -} - - -// helper function that returns textual description of key in the event -wxString GetKeyName( const wxKeyEvent &aEvent ) -{ - int keycode = aEvent.GetKeyCode(); - const char* virt = GetVirtualKeyCodeName( keycode ); - - if( virt ) - return virt; - - if( keycode > 0 && keycode < 32 ) - return wxString::Format( "Ctrl-%c", (unsigned char)('A' + keycode - 1) ); - - if( keycode >= 32 && keycode < 128 ) - return wxString::Format( "'%c'", (unsigned char)keycode ); - -#if wxUSE_UNICODE - int uc = aEvent.GetUnicodeKey(); - - if( uc != WXK_NONE ) - return wxString::Format( "'%c'", uc ); -#endif - - return "unknown"; -} - - -wxString dump( const wxKeyEvent& aEvent ) -{ - wxString msg; - wxString eventType = "unknown"; - - if( aEvent.GetEventType() == wxEVT_KEY_DOWN ) - eventType = "KeyDown"; - else if( aEvent.GetEventType() == wxEVT_KEY_UP ) - eventType = "KeyUp"; - else if( aEvent.GetEventType() == wxEVT_CHAR ) - eventType = "Char"; - else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK ) - eventType = "Hook"; - - // event key_name KeyCode modifiers Unicode raw_code raw_flags pos - msg.Printf( "%7s %15s %5d %c%c%c%c" -#if wxUSE_UNICODE - "%5d (U+%04x)" -#else - " none " -#endif -#ifdef wxHAS_RAW_KEY_CODES - " %7lu 0x%08lx" -#else - " not-set not-set" -#endif - " (%5d,%5d)" - "\n", - eventType, - GetKeyName( aEvent ), - aEvent.GetKeyCode(), - aEvent.ControlDown() ? 'C' : '-', - aEvent.AltDown() ? 'A' : '-', - aEvent.ShiftDown() ? 'S' : '-', - aEvent.MetaDown() ? 'M' : '-' -#if wxUSE_UNICODE - , aEvent.GetUnicodeKey() - , aEvent.GetUnicodeKey() -#endif -#ifdef wxHAS_RAW_KEY_CODES - , (unsigned long) aEvent.GetRawKeyCode() - , (unsigned long) aEvent.GetRawKeyFlags() -#endif - , aEvent.GetX() - , aEvent.GetY() - ); - - return msg; -} +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 Wayne Stambaugh + * Copyright (C) 2018 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 Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file trace_helpers.cpp + * @brief wxLogTrace helper implementation. + */ + +#include +#include +#include +#include + +#include + + +const wxChar* const traceFindReplace = wxT( "KICAD_FIND_REPLACE" ); +const wxChar* const kicadTraceCoords = wxT( "KICAD_COORDS" ); +const wxChar* const kicadTraceKeyEvent = wxT( "KICAD_KEY_EVENTS" ); +const wxChar* const traceSchLibMem = wxT( "KICAD_SCH_LIB_MEM" ); +const wxChar* const traceFindItem = wxT( "KICAD_FIND_ITEM" ); +const wxChar* const traceSchLegacyPlugin = wxT( "KICAD_SCH_LEGACY_PLUGIN" ); +const wxChar* const traceGedaPcbPlugin = wxT( "KICAD_GEDA_PLUGIN" ); +const wxChar* const traceKicadPcbPlugin = wxT( "KICAD_PCB_PLUGIN" ); +const wxChar* const tracePrinting = wxT( "KICAD_PRINT" ); +const wxChar* const traceAutoSave = wxT( "KICAD_AUTOSAVE" ); + + +wxString dump( const wxArrayString& aArray ) +{ + wxString tmp; + + for( unsigned i = 0; i < aArray.GetCount(); i++ ) + { + if( aArray[i].IsEmpty() ) + tmp << wxT( "\"\" " ); + else + tmp << aArray[i] << wxT( " " ); + } + + return tmp; +} + + +// The following code was shamelessly copied from the wxWidgets keyboard sample +// at https://github.com/wxWidgets/wxWidgets/blob/master/samples/keyboard/keyboard.cpp. + +///////////////////////////////////////////////////////////////////////////// +// Author: Vadim Zeitlin +// Modified by: Marcin Wojdyr +// Created: 07.04.02 +// Copyright: (c) 2002 Vadim Zeitlin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// helper function that returns textual description of wx virtual keycode +const char* GetVirtualKeyCodeName(int keycode) +{ + switch ( keycode ) + { +#define WXK_(x) \ + case WXK_##x: return #x; + + WXK_(BACK) + WXK_(TAB) + WXK_(RETURN) + WXK_(ESCAPE) + WXK_(SPACE) + WXK_(DELETE) + WXK_(START) + WXK_(LBUTTON) + WXK_(RBUTTON) + WXK_(CANCEL) + WXK_(MBUTTON) + WXK_(CLEAR) + WXK_(SHIFT) + WXK_(ALT) + WXK_(CONTROL) + WXK_(MENU) + WXK_(PAUSE) + WXK_(CAPITAL) + WXK_(END) + WXK_(HOME) + WXK_(LEFT) + WXK_(UP) + WXK_(RIGHT) + WXK_(DOWN) + WXK_(SELECT) + WXK_(PRINT) + WXK_(EXECUTE) + WXK_(SNAPSHOT) + WXK_(INSERT) + WXK_(HELP) + WXK_(NUMPAD0) + WXK_(NUMPAD1) + WXK_(NUMPAD2) + WXK_(NUMPAD3) + WXK_(NUMPAD4) + WXK_(NUMPAD5) + WXK_(NUMPAD6) + WXK_(NUMPAD7) + WXK_(NUMPAD8) + WXK_(NUMPAD9) + WXK_(MULTIPLY) + WXK_(ADD) + WXK_(SEPARATOR) + WXK_(SUBTRACT) + WXK_(DECIMAL) + WXK_(DIVIDE) + WXK_(F1) + WXK_(F2) + WXK_(F3) + WXK_(F4) + WXK_(F5) + WXK_(F6) + WXK_(F7) + WXK_(F8) + WXK_(F9) + WXK_(F10) + WXK_(F11) + WXK_(F12) + WXK_(F13) + WXK_(F14) + WXK_(F15) + WXK_(F16) + WXK_(F17) + WXK_(F18) + WXK_(F19) + WXK_(F20) + WXK_(F21) + WXK_(F22) + WXK_(F23) + WXK_(F24) + WXK_(NUMLOCK) + WXK_(SCROLL) + WXK_(PAGEUP) + WXK_(PAGEDOWN) + WXK_(NUMPAD_SPACE) + WXK_(NUMPAD_TAB) + WXK_(NUMPAD_ENTER) + WXK_(NUMPAD_F1) + WXK_(NUMPAD_F2) + WXK_(NUMPAD_F3) + WXK_(NUMPAD_F4) + WXK_(NUMPAD_HOME) + WXK_(NUMPAD_LEFT) + WXK_(NUMPAD_UP) + WXK_(NUMPAD_RIGHT) + WXK_(NUMPAD_DOWN) + WXK_(NUMPAD_PAGEUP) + WXK_(NUMPAD_PAGEDOWN) + WXK_(NUMPAD_END) + WXK_(NUMPAD_BEGIN) + WXK_(NUMPAD_INSERT) + WXK_(NUMPAD_DELETE) + WXK_(NUMPAD_EQUAL) + WXK_(NUMPAD_MULTIPLY) + WXK_(NUMPAD_ADD) + WXK_(NUMPAD_SEPARATOR) + WXK_(NUMPAD_SUBTRACT) + WXK_(NUMPAD_DECIMAL) + WXK_(NUMPAD_DIVIDE) + + WXK_(WINDOWS_LEFT) + WXK_(WINDOWS_RIGHT) +#ifdef __WXOSX__ + WXK_(RAW_CONTROL) +#endif +#undef WXK_ + + default: + return NULL; + } +} + + +// helper function that returns textual description of key in the event +wxString GetKeyName( const wxKeyEvent &aEvent ) +{ + int keycode = aEvent.GetKeyCode(); + const char* virt = GetVirtualKeyCodeName( keycode ); + + if( virt ) + return virt; + + if( keycode > 0 && keycode < 32 ) + return wxString::Format( "Ctrl-%c", (unsigned char)('A' + keycode - 1) ); + + if( keycode >= 32 && keycode < 128 ) + return wxString::Format( "'%c'", (unsigned char)keycode ); + +#if wxUSE_UNICODE + int uc = aEvent.GetUnicodeKey(); + + if( uc != WXK_NONE ) + return wxString::Format( "'%c'", uc ); +#endif + + return "unknown"; +} + + +wxString dump( const wxKeyEvent& aEvent ) +{ + wxString msg; + wxString eventType = "unknown"; + + if( aEvent.GetEventType() == wxEVT_KEY_DOWN ) + eventType = "KeyDown"; + else if( aEvent.GetEventType() == wxEVT_KEY_UP ) + eventType = "KeyUp"; + else if( aEvent.GetEventType() == wxEVT_CHAR ) + eventType = "Char"; + else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK ) + eventType = "Hook"; + + // event key_name KeyCode modifiers Unicode raw_code raw_flags pos + msg.Printf( "%7s %15s %5d %c%c%c%c" +#if wxUSE_UNICODE + "%5d (U+%04x)" +#else + " none " +#endif +#ifdef wxHAS_RAW_KEY_CODES + " %7lu 0x%08lx" +#else + " not-set not-set" +#endif + " (%5d,%5d)" + "\n", + eventType, + GetKeyName( aEvent ), + aEvent.GetKeyCode(), + aEvent.ControlDown() ? 'C' : '-', + aEvent.AltDown() ? 'A' : '-', + aEvent.ShiftDown() ? 'S' : '-', + aEvent.MetaDown() ? 'M' : '-' +#if wxUSE_UNICODE + , aEvent.GetUnicodeKey() + , aEvent.GetUnicodeKey() +#endif +#ifdef wxHAS_RAW_KEY_CODES + , (unsigned long) aEvent.GetRawKeyCode() + , (unsigned long) aEvent.GetRawKeyFlags() +#endif + , aEvent.GetX() + , aEvent.GetY() + ); + + return msg; +} diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 994aea4c2b..ccf1eba98f 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -47,6 +47,7 @@ #include #include #include +#include static const int pin_orientation_codes[] = diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 04f75e00ce..ab0ea1b6b2 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -57,6 +57,8 @@ #include // for MAX_UNIT_COUNT_PER_PACKAGE definition +#include + #define NULL_STRING "_NONAME_" /** diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 15609b1b72..eb58c531a6 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -50,6 +50,7 @@ #include #include #include +#include SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_COMPONENT* aParent, const wxString& aName ) : diff --git a/eeschema/sch_item_struct.h b/eeschema/sch_item_struct.h index 4052328f97..09be6eb66d 100644 --- a/eeschema/sch_item_struct.h +++ b/eeschema/sch_item_struct.h @@ -44,16 +44,6 @@ class NETLIST_OBJECT; class NETLIST_OBJECT_LIST; -/** - * @ingroup trace_env_vars - * - * Flag to enable finding schematic item debug output. - * - * @warning This generates a log of debug output. - */ -extern const wxString traceFindItem; - - enum DANGLING_END_T { UNKNOWN = 0, WIRE_START_END, diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index b52b59d1b3..74b9f76d37 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -41,6 +41,7 @@ #include #include #include +#include SCH_SHEET::SCH_SHEET( const wxPoint& pos ) : diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index 780e56fbc4..2fa1787540 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -40,6 +40,7 @@ #include #include #include +#include SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxString& text ) : diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 782b885f12..f440085a3e 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -43,6 +43,7 @@ #include #include #include +#include extern void IncrementLabelMember( wxString& name, int aIncrement ); diff --git a/include/trace_helpers.h b/include/trace_helpers.h index 996fae39a9..ab8b043ab1 100644 --- a/include/trace_helpers.h +++ b/include/trace_helpers.h @@ -1,110 +1,115 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2018 Wayne Stambaugh - * Copyright (C) 2018 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 Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file trace_helpers.h - * @brief wxLogTrace helper definitions. - */ - -#ifndef _TRACE_HELPERS_H_ -#define _TRACE_HELPERS_H_ - -/** - * @defgroup trace_env_vars Trace Environment Variables - * - * wxWidgets provides trace control of debug messages using the WXTRACE environment variable. - * This section defines the strings passed to WXTRACE to for debug output control of various - * sections of the KiCad code. See the wxWidgets wxLogTrace - * documentation for more information. - */ - -///@{ -/// \ingroup trace_env_vars - -/** - * Flag to enable find and replace debug tracing. - */ -extern wxChar* traceFindReplace; - -/** - * Flag to enable draw panel coordinate debug tracing. - */ -extern wxChar* kicadTraceCoords; - - -/** - * Flag to enable wxKeyEvent debug tracing. - */ -extern wxChar* kicadTraceKeyEvent; - -/** - * Flag to enable auto save feature debug tracing. - */ -extern wxChar* traceAutoSave; - -/** - * Flag to enable schematic library memory deletion debug output. - */ -extern wxChar* traceSchLibMem; - -/** - * Flag to enable legacy schematic plugin debug output. - */ -extern wxChar* traceSchLegacyPlugin; - -/** - * Flag to enable GEDA PCB plugin debug output. - */ -extern wxChar* traceKicadPcbPlugin; - -/** - * Flag to enable GEDA PCB plugin debug output. - */ -extern wxChar* traceGedaPcbPlugin; - -/** - * Flag to enable print controller debug output. - */ -extern wxChar* tracePrinting; - -///@} - -/** - * Debug helper for printing wxKeyEvent information. - * - * @param aEvent is the wxKeyEvent to generate the print string from. - * @return the wxKeyEvent information. - */ -extern wxString dump( const wxKeyEvent& aEvent ); - -/** - * Debug helper for printing wxArrayString contents. - * - * @param aArray is the string array to output. - * @return the wxArrayString contents in a formatted string for debugging output. - */ -extern wxString dump( const wxArrayString& aArray ); - -#endif // _TRACE_HELPERS_H_ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 Wayne Stambaugh + * Copyright (C) 2018 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 Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file trace_helpers.h + * @brief wxLogTrace helper definitions. + */ + +#ifndef _TRACE_HELPERS_H_ +#define _TRACE_HELPERS_H_ + +/** + * @defgroup trace_env_vars Trace Environment Variables + * + * wxWidgets provides trace control of debug messages using the WXTRACE environment variable. + * This section defines the strings passed to WXTRACE to for debug output control of various + * sections of the KiCad code. See the wxWidgets wxLogTrace + * documentation for more information. + */ + +///@{ +/// \ingroup trace_env_vars + +/** + * Flag to enable find debug tracing. + */ +extern const wxChar* const traceFindItem; + +/** + * Flag to enable find and replace debug tracing. + */ +extern const wxChar* const traceFindReplace; + +/** + * Flag to enable draw panel coordinate debug tracing. + */ +extern const wxChar* const kicadTraceCoords; + + +/** + * Flag to enable wxKeyEvent debug tracing. + */ +extern const wxChar* const kicadTraceKeyEvent; + +/** + * Flag to enable auto save feature debug tracing. + */ +extern const wxChar* const traceAutoSave; + +/** + * Flag to enable schematic library memory deletion debug output. + */ +extern const wxChar* const traceSchLibMem; + +/** + * Flag to enable legacy schematic plugin debug output. + */ +extern const wxChar* const traceSchLegacyPlugin; + +/** + * Flag to enable GEDA PCB plugin debug output. + */ +extern const wxChar* const traceKicadPcbPlugin; + +/** + * Flag to enable GEDA PCB plugin debug output. + */ +extern const wxChar* const traceGedaPcbPlugin; + +/** + * Flag to enable print controller debug output. + */ +extern const wxChar* const tracePrinting; + +///@} + +/** + * Debug helper for printing wxKeyEvent information. + * + * @param aEvent is the wxKeyEvent to generate the print string from. + * @return the wxKeyEvent information. + */ +extern wxString dump( const wxKeyEvent& aEvent ); + +/** + * Debug helper for printing wxArrayString contents. + * + * @param aArray is the string array to output. + * @return the wxArrayString contents in a formatted string for debugging output. + */ +extern wxString dump( const wxArrayString& aArray ); + +#endif // _TRACE_HELPERS_H_