32#include <wx/tokenzr.h>
59const wxChar*
const traceGit = wxT(
"KICAD_GIT" );
63wxString
dump(
const wxArrayString& aArray )
67 for(
unsigned i = 0; i < aArray.GetCount(); i++ )
69 if( aArray[i].IsEmpty() )
70 tmp << wxT(
"\"\" " );
72 tmp << aArray[i] << wxT(
" " );
96 case WXK_##x: return #x;
185 WXK_(NUMPAD_PAGEDOWN)
191 WXK_(NUMPAD_MULTIPLY)
193 WXK_(NUMPAD_SEPARATOR)
194 WXK_(NUMPAD_SUBTRACT)
214 int keycode = aEvent.GetKeyCode();
220 if( keycode > 0 && keycode < 32 )
221 return wxString::Format(
"Ctrl-%c", (
unsigned char)(
'A' + keycode - 1) );
223 if( keycode >= 32 && keycode < 128 )
224 return wxString::Format(
"'%c'", (
unsigned char)keycode );
227 int uc = aEvent.GetUnicodeKey();
230 return wxString::Format(
"'%c'", uc );
237wxString
dump(
const wxKeyEvent& aEvent )
240 wxString eventType = wxS(
"unknown" );
242 if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
243 eventType = wxS(
"KeyDown" );
244 else if( aEvent.GetEventType() == wxEVT_KEY_UP )
245 eventType = wxS(
"KeyUp" );
246 else if( aEvent.GetEventType() == wxEVT_CHAR )
247 eventType = wxS(
"Char" );
248 else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
249 eventType = wxS(
"Hook" );
252 msg.Printf(
"%7s %15s %5d %c%c%c%c"
258#ifdef wxHAS_RAW_KEY_CODES
267 aEvent.ControlDown() ?
'C' :
'-',
268 aEvent.AltDown() ?
'A' :
'-',
269 aEvent.ShiftDown() ?
'S' :
'-',
270 aEvent.MetaDown() ?
'M' :
'-'
272 , aEvent.GetUnicodeKey()
273 , aEvent.GetUnicodeKey()
275#ifdef wxHAS_RAW_KEY_CODES
276 , (
unsigned long) aEvent.GetRawKeyCode()
277 , (
unsigned long) aEvent.GetRawKeyFlags()
322 str.PrintfV(
aFmt, vargs );
324#if defined( __UNIX__ ) || defined( _WIN32 )
325 fprintf( stderr,
" %-30s | %s", aWhat.c_str().AsChar(), str.c_str().AsChar() );
339 wxStringTokenizer tokenizer( traceVars, wxT(
"," ) );
341 while( tokenizer.HasMoreTokens() )
343 wxString token = tokenizer.GetNextToken();
346 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 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.