ScriptEditor.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _ScriptEditor_h_
  2. #define _ScriptEditor_h_
  3. /* ScriptEditor.h
  4. *
  5. * Copyright (C) 1997-2011,2012,2015,2016 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 "Script.h"
  21. #include "TextEditor.h"
  22. #include "Interpreter.h"
  23. Thing_define (ScriptEditor, TextEditor) {
  24. autostring32 environmentName;
  25. ClassInfo editorClass;
  26. autoInterpreter interpreter;
  27. autoUiForm argsDialog;
  28. void v_destroy () noexcept
  29. override;
  30. void v_nameChanged ()
  31. override;
  32. void v_goAway ()
  33. override;
  34. bool v_scriptable ()
  35. override { return false; }
  36. void v_createMenus ()
  37. override;
  38. void v_createHelpMenuItems (EditorMenu menu)
  39. override;
  40. };
  41. void ScriptEditor_init (ScriptEditor me,
  42. Editor editor,
  43. conststring32 initialText
  44. );
  45. autoScriptEditor ScriptEditor_createFromText (
  46. Editor editor, // the scripting environment; if null, the scripting environment consists of the global windows
  47. conststring32 initialText // may be null
  48. );
  49. autoScriptEditor ScriptEditor_createFromScript_canBeNull (
  50. Editor editor,
  51. Script script
  52. );
  53. bool ScriptEditors_dirty (); // are there any modified and unsaved scripts? Ask before quitting the program.
  54. void ScriptEditor_debug_printAllOpenScriptEditors ();
  55. /* End of file ScriptEditor.h */
  56. #endif