32#include <wx/tokenzr.h>
61wxString
dump(
const wxArrayString& aArray )
65 for(
unsigned i = 0; i < aArray.GetCount(); i++ )
67 if( aArray[i].IsEmpty() )
68 tmp << wxT(
"\"\" " );
70 tmp << aArray[i] << wxT(
" " );
94 case WXK_##x: return #x;
183 WXK_(NUMPAD_PAGEDOWN)
189 WXK_(NUMPAD_MULTIPLY)
191 WXK_(NUMPAD_SEPARATOR)
192 WXK_(NUMPAD_SUBTRACT)
212 int keycode = aEvent.GetKeyCode();
218 if( keycode > 0 && keycode < 32 )
219 return wxString::Format(
"Ctrl-%c", (
unsigned char)(
'A' + keycode - 1) );
221 if( keycode >= 32 && keycode < 128 )
222 return wxString::Format(
"'%c'", (
unsigned char)keycode );
225 int uc = aEvent.GetUnicodeKey();
228 return wxString::Format(
"'%c'", uc );
235wxString
dump(
const wxKeyEvent& aEvent )
238 wxString eventType = wxS(
"unknown" );
240 if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
241 eventType = wxS(
"KeyDown" );
242 else if( aEvent.GetEventType() == wxEVT_KEY_UP )
243 eventType = wxS(
"KeyUp" );
244 else if( aEvent.GetEventType() == wxEVT_CHAR )
245 eventType = wxS(
"Char" );
246 else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
247 eventType = wxS(
"Hook" );
250 msg.Printf(
"%7s %15s %5d %c%c%c%c"
256#ifdef wxHAS_RAW_KEY_CODES
265 aEvent.ControlDown() ?
'C' :
'-',
266 aEvent.AltDown() ?
'A' :
'-',
267 aEvent.ShiftDown() ?
'S' :
'-',
268 aEvent.MetaDown() ?
'M' :
'-'
270 , aEvent.GetUnicodeKey()
271 , aEvent.GetUnicodeKey()
273#ifdef wxHAS_RAW_KEY_CODES
274 , (
unsigned long) aEvent.GetRawKeyCode()
275 , (
unsigned long) aEvent.GetRawKeyFlags()
320 str.PrintfV(
aFmt, vargs );
322#if defined( __UNIX__ ) || defined( _WIN32 )
323 fprintf( stderr,
" %-30s | %s", aWhat.c_str().AsChar(), str.c_str().AsChar() );
337 wxStringTokenizer tokenizer( traceVars, wxT(
"," ) );
339 while( tokenizer.HasMoreTokens() )
341 wxString token = tokenizer.GetNextToken();
344 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 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 traceFonts
Flag to enable locale debug 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.