DebuggerSystemInterface.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma once
  2. #include "../../Include/RmlUi/Core/SystemInterface.h"
  3. namespace Rml {
  4. namespace Debugger {
  5. class ElementLog;
  6. /**
  7. The log interface the debugger installs into RmlUi. This is a pass-through interface, so it holds onto the
  8. application's system interface and passes all the calls through.
  9. */
  10. class DebuggerSystemInterface : public Rml::SystemInterface {
  11. public:
  12. /// Instances a new debugging log interface.
  13. /// @param[in] log The logging element to send messages to.
  14. DebuggerSystemInterface(Rml::SystemInterface* application_interface, ElementLog* log);
  15. virtual ~DebuggerSystemInterface();
  16. /// Get the number of seconds elapsed since the start of the application.
  17. /// @return Elapsed time, in seconds.
  18. double GetElapsedTime() override;
  19. /// Translate the input string into the translated string.
  20. /// @param[out] translated Translated string ready for display.
  21. /// @param[in] input String as received from XML.
  22. /// @return Number of translations that occured.
  23. int TranslateString(String& translated, const String& input) override;
  24. /// Joins the path of an RML or RCSS file with the path of a resource specified within the file.
  25. /// @param[out] translated_path The joined path.
  26. /// @param[in] document_path The path of the source document (including the file name).
  27. /// @param[in] path The path of the resource specified in the document.
  28. void JoinPath(String& translated_path, const String& document_path, const String& path) override;
  29. /// Log the specified message.
  30. /// @param[in] type Type of log message, ERROR, WARNING, etc.
  31. /// @param[in] message Message to log.
  32. /// @return True to continue execution, false to break into the debugger.
  33. bool LogMessage(Log::Type type, const String& message) override;
  34. /// Set mouse cursor.
  35. /// @param[in] cursor_name Cursor name to activate.
  36. void SetMouseCursor(const String& cursor_name) override;
  37. /// Set clipboard text.
  38. /// @param[in] text Text to apply to clipboard.
  39. void SetClipboardText(const String& text) override;
  40. /// Get clipboard text.
  41. /// @param[out] text Retrieved text from clipboard.
  42. void GetClipboardText(String& text) override;
  43. /// Activate keyboard (for touchscreen devices).
  44. void ActivateKeyboard(Rml::Vector2f caret_position, float line_height) override;
  45. /// Deactivate keyboard (for touchscreen devices).
  46. void DeactivateKeyboard() override;
  47. private:
  48. Rml::SystemInterface* application_interface;
  49. ElementLog* log;
  50. };
  51. } // namespace Debugger
  52. } // namespace Rml