script_editor_debugger.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*************************************************************************/
  2. /* script_editor_debugger.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* http://www.godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  9. /* */
  10. /* Permission is hereby granted, free of charge, to any person obtaining */
  11. /* a copy of this software and associated documentation files (the */
  12. /* "Software"), to deal in the Software without restriction, including */
  13. /* without limitation the rights to use, copy, modify, merge, publish, */
  14. /* distribute, sublicense, and/or sell copies of the Software, and to */
  15. /* permit persons to whom the Software is furnished to do so, subject to */
  16. /* the following conditions: */
  17. /* */
  18. /* The above copyright notice and this permission notice shall be */
  19. /* included in all copies or substantial portions of the Software. */
  20. /* */
  21. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  22. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  23. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  24. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  25. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  26. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  27. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  28. /*************************************************************************/
  29. #ifndef SCRIPT_EDITOR_DEBUGGER_H
  30. #define SCRIPT_EDITOR_DEBUGGER_H
  31. #include "scene/gui/box_container.h"
  32. #include "scene/gui/button.h"
  33. #include "core/io/tcp_server.h"
  34. #include "core/io/packet_peer.h"
  35. class Tree;
  36. class PropertyEditor;
  37. class EditorNode;
  38. class ScriptEditorDebuggerVariables;
  39. class LineEdit;
  40. class TabContainer;
  41. class RichTextLabel;
  42. class TextureButton;
  43. class AcceptDialog;
  44. class TreeItem;
  45. class HSplitContainer;
  46. class ScriptEditorDebugger : public Control {
  47. OBJ_TYPE( ScriptEditorDebugger, Control );
  48. AcceptDialog *msgdialog;
  49. LineEdit *clicked_ctrl;
  50. LineEdit *clicked_ctrl_type;
  51. Tree *scene_tree;
  52. HSplitContainer *info;
  53. Button *scene_tree_refresh;
  54. TextureButton *tb;
  55. TabContainer *tabs;
  56. Label *reason;
  57. bool log_forced_visible;
  58. ScriptEditorDebuggerVariables *variables;
  59. Button *step;
  60. Button *next;
  61. Button *back;
  62. Button *forward;
  63. Button *dobreak;
  64. Button *docontinue;
  65. List<Vector<float> > perf_history;
  66. Vector<float> perf_max;
  67. Vector<TreeItem*> perf_items;
  68. Tree *perf_monitors;
  69. Control *perf_draw;
  70. Tree *stack_dump;
  71. PropertyEditor *inspector;
  72. Ref<TCP_Server> server;
  73. Ref<StreamPeerTCP> connection;
  74. Ref<PacketPeerStream> ppeer;
  75. String message_type;
  76. Array message;
  77. int pending_in_queue;
  78. EditorNode *editor;
  79. bool breaked;
  80. void _performance_draw();
  81. void _performance_select(Object *, int, bool);
  82. void _stack_dump_frame_selected();
  83. void _output_clear();
  84. void _hide_request();
  85. void _scene_tree_request();
  86. void _parse_message(const String& p_msg,const Array& p_data);
  87. protected:
  88. void _notification(int p_what);
  89. static void _bind_methods();
  90. public:
  91. void start();
  92. void pause();
  93. void unpause();
  94. void stop();
  95. void debug_next();
  96. void debug_step();
  97. void debug_break();
  98. void debug_continue();
  99. String get_var_value(const String& p_var) const;
  100. virtual Size2 get_minimum_size() const;
  101. ScriptEditorDebugger(EditorNode *p_editor=NULL);
  102. ~ScriptEditorDebugger();
  103. };
  104. #endif // SCRIPT_EDITOR_DEBUGGER_H