32#include <wx/tokenzr.h>
59const wxChar*
const traceGit = wxT(
"KICAD_GIT" );
64wxString
dump(
const wxArrayString& aArray )
68 for(
unsigned i = 0; i < aArray.GetCount(); i++ )
70 if( aArray[i].IsEmpty() )
71 tmp << wxT(
"\"\" " );
73 tmp << aArray[i] << wxT(
" " );
97 case WXK_##x: return #x;
186 WXK_(NUMPAD_PAGEDOWN)
192 WXK_(NUMPAD_MULTIPLY)
194 WXK_(NUMPAD_SEPARATOR)
195 WXK_(NUMPAD_SUBTRACT)
215 int keycode = aEvent.GetKeyCode();
221 if( keycode > 0 && keycode < 32 )
222 return wxString::Format(
"Ctrl-%c", (
unsigned char)(
'A' + keycode - 1) );
224 if( keycode >= 32 && keycode < 128 )
225 return wxString::Format(
"'%c'", (
unsigned char)keycode );
228 int uc = aEvent.GetUnicodeKey();
231 return wxString::Format(
"'%c'", uc );
238wxString
dump(
const wxKeyEvent& aEvent )
241 wxString eventType = wxS(
"unknown" );
243 if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
244 eventType = wxS(
"KeyDown" );
245 else if( aEvent.GetEventType() == wxEVT_KEY_UP )
246 eventType = wxS(
"KeyUp" );
247 else if( aEvent.GetEventType() == wxEVT_CHAR )
248 eventType = wxS(
"Char" );
249 else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
250 eventType = wxS(
"Hook" );
253 msg.Printf(
"%7s %15s %5d %c%c%c%c"
259#ifdef wxHAS_RAW_KEY_CODES
268 aEvent.ControlDown() ?
'C' :
'-',
269 aEvent.AltDown() ?
'A' :
'-',
270 aEvent.ShiftDown() ?
'S' :
'-',
271 aEvent.MetaDown() ?
'M' :
'-'
273 , aEvent.GetUnicodeKey()
274 , aEvent.GetUnicodeKey()
276#ifdef wxHAS_RAW_KEY_CODES
277 , (
unsigned long) aEvent.GetRawKeyCode()
278 , (
unsigned long) aEvent.GetRawKeyFlags()
323 str.PrintfV(
aFmt, vargs );
325#if defined( __UNIX__ ) || defined( _WIN32 )
326 fprintf( stderr,
" %-30s | %s", aWhat.c_str().AsChar(), str.c_str().AsChar() );
340 wxStringTokenizer tokenizer( traceVars, wxT(
"," ) );
342 while( tokenizer.HasMoreTokens() )
344 wxString token = tokenizer.GetNextToken();
347 if( token.Lower() == wxT(
"all" ) )
static TRACE_MANAGER & Instance()
traceV(aWhat, aFmt, argptr)
bool IsTraceEnabled(const wxString &aWhat)
bool m_globalTraceEnabled
std::map< wxString, bool > m_enabledTraces
const wxChar *const traceSymbolResolver
Flag to enable debug output of symbol library resolver results.
const wxChar *const traceLocale
Flag to enable locale debug output.
const wxChar *const traceKicadPcbPlugin
Flag to enable GEDA PCB plugin debug output.
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.
const wxChar *const traceUiProfile
Flag to enable user interface profile tracing.
const wxChar *const traceEnvVars
Flag to enable debug output of environment variable operations.
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
const wxChar *const traceFindItem
Flag to enable find debug tracing.
const wxChar *const kicadTraceCoroutineStack
Flag to enable tracing of the coroutine call stack.
const wxChar *const traceSchLibMem
Flag to enable schematic library memory deletion debug output.
const wxChar *const traceEagleIo
const wxChar *const tracePathsAndFiles
Flag to enable path and file name debug output.
const wxChar *const traceKiCad2Step
Flag to enable KiCad2Step debug tracing.
const wxChar *const traceSchPlugin
Flag to enable legacy schematic plugin debug output.
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
const wxChar *const traceSchLegacyPlugin
Flag to enable legacy schematic plugin debug output.
const wxChar *const tracePrinting
Flag to enable print controller debug output.
const wxChar *const kicadTraceCoords
Flag to enable draw panel coordinate debug tracing.
const wxChar *const traceZoomScroll
Flag to enable debug output of zoom-scrolling calculations in KIGFX::ZOOM_CONTROLLER and derivatives.
const wxChar *const traceGedaPcbPlugin
Flag to enable GEDA PCB plugin debug output.
const wxChar *const traceScreen
Flag to enable debug output of BASE_SCREEN and it's derivatives.
const wxChar *const traceDesignBlocks
const wxChar *const traceFonts
Flag to enable locale debug output.
const wxChar *const traceGit
Flag to enable Git debugging output.
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
const wxChar *const kicadTraceToolStack
Flag to enable tracing of the tool handling stack.
const wxChar *const traceGalProfile
Flag to enable debug output of GAL performance profiling.
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
wxString GetKeyName(const wxKeyEvent &aEvent)
const char * GetVirtualKeyCodeName(int keycode)
wxLogTrace helper definitions.