32 #include <wx/tokenzr.h> 57 wxString
dump(
const wxArrayString& aArray )
61 for(
unsigned i = 0; i < aArray.GetCount(); i++ )
63 if( aArray[i].IsEmpty() )
64 tmp << wxT(
"\"\" " );
66 tmp << aArray[i] << wxT(
" " );
90 case WXK_##x: return #x; 179 WXK_(NUMPAD_PAGEDOWN)
185 WXK_(NUMPAD_MULTIPLY)
187 WXK_(NUMPAD_SEPARATOR)
188 WXK_(NUMPAD_SUBTRACT)
208 int keycode = aEvent.GetKeyCode();
214 if( keycode > 0 && keycode < 32 )
217 if( keycode >= 32 && keycode < 128 )
221 int uc = aEvent.GetUnicodeKey();
227 return wxT(
"unknown" );
231 wxString
dump(
const wxKeyEvent& aEvent )
234 wxString eventType = wxT(
"unknown" );
236 if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
237 eventType = wxT(
"KeyDown" );
238 else if( aEvent.GetEventType() == wxEVT_KEY_UP )
239 eventType = wxT(
"KeyUp" );
240 else if( aEvent.GetEventType() == wxEVT_CHAR )
241 eventType = wxT(
"Char" );
242 else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
243 eventType = wxT(
"Hook" );
246 msg.Printf( wxT(
"%7s %15s %5d %c%c%c%c" )
248 wxT(
"%5d (U+%04x)" )
252 #ifdef wxHAS_RAW_KEY_CODES
253 wxT(
" %7lu 0x%08lx" )
255 wxT(
" not-set not-set" )
261 aEvent.ControlDown() ?
'C' :
'-',
262 aEvent.AltDown() ?
'A' :
'-',
263 aEvent.ShiftDown() ?
'S' :
'-',
264 aEvent.MetaDown() ?
'M' :
'-' 266 , aEvent.GetUnicodeKey()
267 , aEvent.GetUnicodeKey()
269 #ifdef wxHAS_RAW_KEY_CODES 270 , (
unsigned long) aEvent.GetRawKeyCode()
271 , (
unsigned long) aEvent.GetRawKeyFlags()
306 str.PrintfV(
aFmt, vargs );
309 fprintf( stderr,
" %-30s | %s", aWhat.c_str().AsChar(), str.c_str().AsChar() );
322 wxStringTokenizer tokenizer( traceVars, wxT(
"," ) );
324 while( tokenizer.HasMoreTokens() )
326 wxString token = tokenizer.GetNextToken();
329 if( token.Lower() == wxT(
"all" ) )
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
const wxChar *const traceZoomScroll
Flag to enable debug output of zoom-scrolling calculations in KIGFX::ZOOM_CONTROLLER and derivatives.
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
const wxChar *const traceSymbolResolver
Flag to enable debug output of symbol library resolver results.
bool m_globalTraceEnabled
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
const wxChar *const traceGedaPcbPlugin
Flag to enable GEDA PCB plugin debug output.
traceV(aWhat, aFmt, argptr)
wxString GetKeyName(const wxKeyEvent &aEvent)
const wxChar *const traceScreen
Flag to enable debug output of BASE_SCREEN and it's derivatives.
const char * GetVirtualKeyCodeName(int keycode)
const wxChar *const tracePrinting
Flag to enable print controller debug output.
const wxChar *const traceSchLegacyPlugin
Flag to enable legacy schematic plugin debug output.
const wxChar *const tracePathsAndFiles
Flag to enable path and file name debug output.
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
const wxChar *const traceGalProfile
Flag to enable debug output of GAL performance profiling.
std::map< wxString, bool > m_enabledTraces
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
const wxChar *const traceKicadPcbPlugin
Flag to enable GEDA PCB plugin debug output.
wxLogTrace helper definitions.
const wxChar *const traceLocale
Flag to enable locale debug output.
const wxChar *const traceEnvVars
Flag to enable debug output of environment variable operations.
const wxChar *const traceSchLibMem
Flag to enable schematic library memory deletion debug output.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
static TRACE_MANAGER & Instance()
const wxChar *const kicadTraceCoroutineStack
Flag to enable tracing of the coroutine call stack.
const wxChar *const traceFindItem
Flag to enable find debug tracing.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.
const wxChar *const kicadTraceToolStack
Flag to enable tracing of the tool handling stack.
const wxChar *const kicadTraceCoords
Flag to enable draw panel coordinate debug tracing.