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 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...
 

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 228 of file trace_helpers.cpp.

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

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

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