pcbjam/core/include/wx/confbase.h
Viktor Vaczi 92faf7c082 Add standalone core library with kimath and sexpr (Phase 2 Step 1)
Create standalone build system for KiCad's core computation libraries
that compiles without wxWidgets, targeting both native and WebAssembly.

Key additions:
- wx_shim.h: ~250 lines replacing wx utilities with standard C++
  - wxString class with Format() method
  - wxFFile for file I/O
  - wxASSERT, wxCHECK, wxFAIL_MSG macros
  - wxLog stubs
- Stub headers: wx/debug.h, wx/log.h, wx/string.h, wx/file.h, etc.
- config.h, advanced_config.h: Platform and triangulation config
- CMakeLists.txt: Builds kimath, sexpr, clipper2, rtree

Build results:
- Native: libkimath.a (1.4MB), libsexpr.a, test passes
- WASM: test_kimath.wasm (867KB), runs in Node.js

Test verifies:
- VECTOR2I, SEG, SHAPE_POLY_SET geometry operations
- S-expression parsing of .kicad_pcb format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 17:39:53 +01:00

27 lines
1.1 KiB
C++

// Stub wx/confbase.h - minimal config base for kicad-core
#ifndef _WX_CONFBASE_H_
#define _WX_CONFBASE_H_
#include "wx_shim.h"
// Minimal wxConfigBase stub
class wxConfigBase {
public:
virtual ~wxConfigBase() = default;
// Minimal interface - returns false/empty for everything
virtual bool Read(const wxString& key, wxString* str) const { return false; }
virtual bool Read(const wxString& key, long* val) const { return false; }
virtual bool Read(const wxString& key, double* val) const { return false; }
virtual bool Read(const wxString& key, bool* val) const { return false; }
virtual bool Write(const wxString& key, const wxString& value) { return false; }
virtual bool Write(const wxString& key, long value) { return false; }
virtual bool Write(const wxString& key, double value) { return false; }
virtual bool Write(const wxString& key, bool value) { return false; }
static wxConfigBase* Get(bool createOnDemand = true) { return nullptr; }
static wxConfigBase* Set(wxConfigBase* config) { return nullptr; }
};
#endif // _WX_CONFBASE_H_