You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

128 lines
3.6 KiB

  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2012, assimp team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the assimp team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the assimp team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. #if (!defined AV_LOG_WINDOW_H_INCLUDED)
  35. #define AV_LOG_WINDOW_H_INCLUDE
  36. //-------------------------------------------------------------------------------
  37. /** \brief Subclass of Assimp::LogStream used to add all log messages to the
  38. * log window.
  39. */
  40. //-------------------------------------------------------------------------------
  41. class CMyLogStream : public Assimp::LogStream
  42. {
  43. public:
  44. /** @brief Implementation of the abstract method */
  45. void write(const char* message);
  46. };
  47. //-------------------------------------------------------------------------------
  48. /** \brief Class to display log strings in a separate window
  49. */
  50. //-------------------------------------------------------------------------------
  51. class CLogWindow
  52. {
  53. private:
  54. friend class CMyLogStream;
  55. friend INT_PTR CALLBACK LogDialogProc(HWND hwndDlg,UINT uMsg,
  56. WPARAM wParam,LPARAM lParam);
  57. CLogWindow() : hwnd(NULL), bIsVisible(false), bUpdate(true) {}
  58. public:
  59. // Singleton accessors
  60. static CLogWindow s_cInstance;
  61. inline static CLogWindow& Instance ()
  62. {
  63. return s_cInstance;
  64. }
  65. // initializes the log window
  66. void Init ();
  67. // Shows the log window
  68. void Show();
  69. // Clears the log window
  70. void Clear();
  71. // Save the log window to an user-defined file
  72. void Save();
  73. // write a line to the log window
  74. void WriteLine(const char* message);
  75. // Set the bUpdate member
  76. inline void SetAutoUpdate(bool b)
  77. {
  78. this->bUpdate = b;
  79. }
  80. // updates the log file
  81. void Update();
  82. private:
  83. // Window handle
  84. HWND hwnd;
  85. // current text of the window (contains RTF tags)
  86. std::string szText;
  87. std::string szPlainText;
  88. // is the log window currently visible?
  89. bool bIsVisible;
  90. // Specified whether each new log message updates the log automatically
  91. bool bUpdate;
  92. public:
  93. // associated log stream
  94. CMyLogStream* pcStream;
  95. };
  96. #endif // AV_LOG_DISPLA