KiCad PCB EDA Suite
trace_helpers.h File Reference

wxLogTrace helper definitions. More...

#include <wx/arrstr.h>
#include <wx/event.h>
#include <wx/string.h>

Go to the source code of this file.

Functions

wxString dump (const wxKeyEvent &aEvent)
 Debug helper for printing wxKeyEvent information. More...
 
wxString dump (const wxArrayString &aArray)
 Debug helper for printing wxArrayString contents. More...
 

Variables

const wxChar *const traceFindItem
 Flag to enable find debug tracing. More...
 
const wxChar *const traceFindReplace
 Flag to enable find and replace debug tracing. More...
 
const wxChar *const kicadTraceCoords
 Flag to enable draw panel coordinate debug tracing. More...
 
const wxChar *const kicadTraceKeyEvent
 Flag to enable wxKeyEvent debug tracing. More...
 
const wxChar *const kicadTraceToolStack
 Flag to enable tracing of the tool handling stack. More...
 
const wxChar *const kicadTraceCoroutineStack
 Flag to enable tracing of the coroutine call stack. More...
 
const wxChar *const traceAutoSave
 Flag to enable auto save feature debug tracing. More...
 
const wxChar *const traceSchLibMem
 Flag to enable schematic library memory deletion debug output. More...
 
const wxChar *const traceSchLegacyPlugin
 Flag to enable legacy schematic plugin debug output. More...
 
const wxChar *const traceKicadPcbPlugin
 Flag to enable GEDA PCB plugin debug output. More...
 
const wxChar *const traceGedaPcbPlugin
 Flag to enable GEDA PCB plugin debug output. More...
 
const wxChar *const tracePrinting
 Flag to enable print controller debug output. More...
 
const wxChar *const tracePathsAndFiles
 Flag to enable path and file name debug output. More...
 
const wxChar *const traceLocale
 Flag to enable locale debug output. More...
 
const wxChar *const traceScreen
 Flag to enable debug output of BASE_SCREEN and it's derivatives. More...
 
const wxChar *const traceDisplayLocation
 Flag to enable debug output of display positioning logic. More...
 
const wxChar *const traceZoomScroll
 Flag to enable debug output of zoom-scrolling calculations in KIGFX::ZOOM_CONTROLLER and derivatives. More...
 
const wxChar *const traceSymbolResolver
 Flag to enable debug output of symbol library resolver results. More...
 
const wxChar *const traceSchSheetPaths
 Flag to enable debug output of schematic symbol sheet path manipulation code. More...
 
const wxChar *const traceEnvVars
 Flag to enable debug output of environment variable operations. More...
 
const wxChar *const traceGalProfile
 Flag to enable debug output of GAL performance profiling. More...
 

Detailed Description

wxLogTrace helper definitions.

Definition in file trace_helpers.h.

Function Documentation

◆ dump() [1/2]

wxString dump ( const wxKeyEvent &  aEvent)

Debug helper for printing wxKeyEvent information.

Parameters
aEventis the wxKeyEvent to generate the print string from.
Returns
the wxKeyEvent information.

Definition at line 230 of file trace_helpers.cpp.

231 {
232  wxString msg;
233  wxString eventType = "unknown";
234 
235  if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
236  eventType = "KeyDown";
237  else if( aEvent.GetEventType() == wxEVT_KEY_UP )
238  eventType = "KeyUp";
239  else if( aEvent.GetEventType() == wxEVT_CHAR )
240  eventType = "Char";
241  else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
242  eventType = "Hook";
243 
244  // event key_name KeyCode modifiers Unicode raw_code raw_flags pos
245  msg.Printf( "%7s %15s %5d %c%c%c%c"
246 #if wxUSE_UNICODE
247  "%5d (U+%04x)"
248 #else
249  " none "
250 #endif
251 #ifdef wxHAS_RAW_KEY_CODES
252  " %7lu 0x%08lx"
253 #else
254  " not-set not-set"
255 #endif
256  " (%5d,%5d)",
257  eventType,
258  GetKeyName( aEvent ),
259  aEvent.GetKeyCode(),
260  aEvent.ControlDown() ? 'C' : '-',
261  aEvent.AltDown() ? 'A' : '-',
262  aEvent.ShiftDown() ? 'S' : '-',
263  aEvent.MetaDown() ? 'M' : '-'
264 #if wxUSE_UNICODE
265  , aEvent.GetUnicodeKey()
266  , aEvent.GetUnicodeKey()
267 #endif
268 #ifdef wxHAS_RAW_KEY_CODES
269  , (unsigned long) aEvent.GetRawKeyCode()
270  , (unsigned long) aEvent.GetRawKeyFlags()
271 #endif
272  , aEvent.GetX()
273  , aEvent.GetY()
274  );
275 
276  return msg;
277 }
wxString GetKeyName(const wxKeyEvent &aEvent)

References GetKeyName().

◆ dump() [2/2]

wxString dump ( const wxArrayString &  aArray)

Debug helper for printing wxArrayString contents.

Parameters
aArrayis the string array to output.
Returns
the wxArrayString contents in a formatted string for debugging output.

Definition at line 56 of file trace_helpers.cpp.

57 {
58  wxString tmp;
59 
60  for( unsigned i = 0; i < aArray.GetCount(); i++ )
61  {
62  if( aArray[i].IsEmpty() )
63  tmp << wxT( "\"\" " );
64  else
65  tmp << aArray[i] << wxT( " " );
66  }
67 
68  return tmp;
69 }

Referenced by TOOL_DISPATCHER::DispatchWxEvent(), LIBEVAL::COMPILER::generateUCode(), TOOL_DISPATCHER::GetToolEvent(), FOOTPRINTS_LISTBOX::OnChar(), LIBRARY_LISTBOX::OnChar(), COMPONENTS_LISTBOX::OnChar(), EDA_BASE_FRAME::OnCharHook(), and GPCB_FPL_CACHE::parseParameters().