DemoEditor.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _DemoEditor_h_
  2. #define _DemoEditor_h_
  3. /* DemoEditor.h
  4. *
  5. * Copyright (C) 2009-2011,2012,2015,2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "Editor.h"
  21. Thing_define (DemoEditor, Editor) {
  22. GuiDrawingArea drawingArea;
  23. autoGraphics graphics;
  24. void *praatPicture;
  25. bool clicked, keyPressed, shiftKeyPressed, commandKeyPressed, optionKeyPressed, extraControlKeyPressed;
  26. integer x, y;
  27. char32 key;
  28. bool waitingForInput, userWantsToClose, fullScreen;
  29. void v_destroy () noexcept
  30. override;
  31. void v_info ()
  32. override;
  33. void v_goAway ()
  34. override;
  35. bool v_hasMenuBar ()
  36. override { return false; }
  37. bool v_canFullScreen ()
  38. override { return true; }
  39. bool v_scriptable ()
  40. override { return false; }
  41. void v_createChildren ()
  42. override;
  43. void v_createMenus ()
  44. override;
  45. };
  46. void DemoEditor_init (DemoEditor me);
  47. autoDemoEditor DemoEditor_create ();
  48. void Demo_open ();
  49. void Demo_close ();
  50. struct autoDemoOpen {
  51. autoDemoOpen () { Demo_open (); }
  52. ~autoDemoOpen () { Demo_close (); }
  53. };
  54. int Demo_windowTitle (conststring32 title);
  55. int Demo_show ();
  56. void Demo_waitForInput (Interpreter interpreter);
  57. void Demo_peekInput (Interpreter interpreter);
  58. bool Demo_clicked ();
  59. double Demo_x ();
  60. double Demo_y ();
  61. bool Demo_keyPressed ();
  62. char32 Demo_key ();
  63. bool Demo_shiftKeyPressed ();
  64. bool Demo_commandKeyPressed ();
  65. bool Demo_optionKeyPressed ();
  66. bool Demo_extraControlKeyPressed ();
  67. /* Shortcuts: */
  68. bool Demo_input (conststring32 keys);
  69. bool Demo_clickedIn (double left, double right, double bottom, double top);
  70. void Demo_timer (double duration);
  71. /* End of file DemoEditor.h */
  72. #endif