You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
950 B

  1. #ifndef __PYTHON_SCRIPTING_H
  2. #define __PYTHON_SCRIPTING_H
  3. // undefs explained here: https://bugzilla.redhat.com/show_bug.cgi?id=427617
  4. #ifdef _POSIX_C_SOURCE
  5. #undef _POSIX_C_SOURCE
  6. #endif
  7. #ifdef _XOPEN_SOURCE
  8. #undef _XOPEN_SOURCE
  9. #endif
  10. #include <Python.h>
  11. #ifndef NO_WXPYTHON_EXTENSION_HEADERS
  12. #ifdef KICAD_SCRIPTING_WXPYTHON
  13. #include <wx/wxPython/wxPython.h>
  14. #endif
  15. #endif
  16. /* Function pcbnewInitPythonScripting
  17. * Initializes the Python engine inside pcbnew
  18. */
  19. bool pcbnewInitPythonScripting();
  20. void pcbnewFinishPythonScripting();
  21. #ifdef KICAD_SCRIPTING_WXPYTHON
  22. void RedirectStdio();
  23. wxWindow* CreatePythonShellWindow(wxWindow* parent);
  24. #define PY_BLOCK_THREADS(name) wxPyBlock_t name = wxPyBeginBlockThreads()
  25. #define PY_UNBLOCK_THREADS(name) wxPyEndBlockThreads(name)
  26. #else
  27. #define PY_BLOCK_THREADS(name)
  28. #define PY_UNBLOCK_THREADS(name)
  29. #endif
  30. #endif