ui_stub.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #define HL_NAME(n) ui_##n
  2. #include <hl.h>
  3. #ifndef HL_WIN
  4. #include <unistd.h>
  5. #endif
  6. #define wref void
  7. #define vsentinel void
  8. HL_PRIM void HL_NAME(ui_init)() {
  9. }
  10. HL_PRIM int HL_NAME(ui_dialog)( const uchar *title, const uchar *message, int flags ) {
  11. return 0;
  12. }
  13. HL_PRIM wref *HL_NAME(ui_winlog_new)( const uchar *title, int width, int height ) {
  14. return NULL;
  15. }
  16. HL_PRIM wref *HL_NAME(ui_button_new)( wref *w, const uchar *txt, vclosure *callb ) {
  17. return NULL;
  18. }
  19. HL_PRIM void HL_NAME(ui_winlog_set_text)( wref *w, const uchar *txt, bool autoScroll ) {
  20. }
  21. HL_PRIM void HL_NAME(ui_win_set_text)( wref *w, const uchar *txt ) {
  22. }
  23. HL_PRIM void HL_NAME(ui_win_set_enable)( wref *w, bool enable ) {
  24. }
  25. HL_PRIM void HL_NAME(ui_win_destroy)( wref *w ) {
  26. }
  27. HL_PRIM int HL_NAME(ui_loop)( bool blocking ) {
  28. return 1;
  29. }
  30. HL_PRIM void HL_NAME(ui_stop_loop)() {
  31. // TODO ?
  32. }
  33. HL_PRIM vsentinel *HL_NAME(ui_start_sentinel)( double timeout, vclosure *c ) {
  34. return NULL;
  35. }
  36. HL_PRIM void HL_NAME(ui_sentinel_tick)( vsentinel *s ) {
  37. }
  38. HL_PRIM void HL_NAME(ui_sentinel_pause)( vsentinel *s, bool pause ) {
  39. }
  40. HL_PRIM bool HL_NAME(ui_sentinel_is_paused)( vsentinel *s ) {
  41. return false;
  42. }
  43. HL_PRIM void HL_NAME(ui_close_console)() {
  44. }
  45. HL_PRIM vbyte *HL_NAME(ui_choose_file)( bool forSave, vdynamic *options ) {
  46. return NULL;
  47. }
  48. #define _WIN _ABSTRACT(ui_window)
  49. #define _SENTINEL _ABSTRACT(ui_sentinel)
  50. DEFINE_PRIM(_VOID, ui_init, _NO_ARG);
  51. DEFINE_PRIM(_I32, ui_dialog, _BYTES _BYTES _I32);
  52. DEFINE_PRIM(_WIN, ui_winlog_new, _BYTES _I32 _I32);
  53. DEFINE_PRIM(_WIN, ui_button_new, _WIN _BYTES _FUN(_VOID,_NO_ARG));
  54. DEFINE_PRIM(_VOID, ui_winlog_set_text, _WIN _BYTES _BOOL);
  55. DEFINE_PRIM(_VOID, ui_win_set_text, _WIN _BYTES);
  56. DEFINE_PRIM(_VOID, ui_win_set_enable, _WIN _BOOL);
  57. DEFINE_PRIM(_VOID, ui_win_destroy, _WIN);
  58. DEFINE_PRIM(_I32, ui_loop, _BOOL);
  59. DEFINE_PRIM(_VOID, ui_stop_loop, _NO_ARG);
  60. DEFINE_PRIM(_VOID, ui_close_console, _NO_ARG);
  61. DEFINE_PRIM(_SENTINEL, ui_start_sentinel, _F64 _FUN(_VOID,_NO_ARG));
  62. DEFINE_PRIM(_VOID, ui_sentinel_tick, _SENTINEL);
  63. DEFINE_PRIM(_VOID, ui_sentinel_pause, _SENTINEL _BOOL);
  64. DEFINE_PRIM(_BOOL, ui_sentinel_is_paused, _SENTINEL);
  65. DEFINE_PRIM(_BYTES, ui_choose_file, _BOOL _DYN);