Counter Strike : Global Offensive Source Code
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.

108 lines
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef FACEPOSERTOOLWINDOW_H
  8. #define FACEPOSERTOOLWINDOW_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <mxtk/mx.h>
  13. #include "mxtk/mxWindow.h"
  14. class CChoreoWidgetDrawHelper;
  15. class IFacePoserToolWindow
  16. {
  17. public:
  18. IFacePoserToolWindow( char const *toolname, char const *displaynameroot );
  19. virtual ~IFacePoserToolWindow( void );
  20. virtual mxWindow *GetMxWindow( void );
  21. virtual void Shutdown() { }
  22. virtual void Think( float dt );
  23. virtual bool IsScrubbing( void ) const { return false; }
  24. virtual bool IsProcessing( void ) { return false; }
  25. bool IsActiveTool( void );
  26. virtual bool IsLocked( void );
  27. virtual bool HandleToolEvent( mxEvent *event );
  28. virtual void HandleToolRedraw( CChoreoWidgetDrawHelper& helper );
  29. virtual int GetCaptionHeight( void );
  30. void ToggleLockedState( void );
  31. void LoadPosition( void );
  32. void SavePosition( void );
  33. char const *GetToolName( void ) const;
  34. char const *GetWindowTitle( void ) const;
  35. char const *GetDisplayNameRoot( void ) const;
  36. void SetDisplayNameRoot( char const *name );
  37. void SetSuffix( char const *suffix );
  38. void SetPrefix( char const *prefix );
  39. void SetUseForMainWindowTitle( bool use );
  40. void SetAutoProcess( bool autoprocess );
  41. bool GetAutoProcess( void ) const;
  42. virtual void OnModelChanged();
  43. static int GetToolCount( void );
  44. static IFacePoserToolWindow *GetTool( int index );
  45. static IFacePoserToolWindow *GetActiveTool( void );
  46. static void SetActiveTool( IFacePoserToolWindow *tool );
  47. static IFacePoserToolWindow *s_pActiveTool;
  48. static void ToolThink( float dt );
  49. static void ModelChanged();
  50. static bool IsAnyToolScrubbing( void );
  51. static bool IsAnyToolProcessing( void );
  52. static bool ShouldAutoProcess( void );
  53. static void InitTools( void );
  54. static void ShutdownTools( void );
  55. static void EnableToolRedraw( bool enabled );
  56. static bool s_bToolsCanDraw;
  57. bool ToolCanDraw( void );
  58. private:
  59. void GetLockRect( RECT& rc );
  60. void GetCloseRect( RECT& rc );
  61. void ComputeNewTitle( void );
  62. void SetToolName( char const *name );
  63. enum
  64. {
  65. MAX_TOOL_NAME = 128,
  66. PREFIX_LENGTH = 32,
  67. SUFFIX_LENGTH = 128,
  68. };
  69. char m_szToolName[ MAX_TOOL_NAME ];
  70. char m_szDisplayRoot[ MAX_TOOL_NAME ];
  71. char m_szPrefix[ PREFIX_LENGTH ];
  72. char m_szSuffix[ SUFFIX_LENGTH ];
  73. char m_szWindowTitle[ MAX_TOOL_NAME + PREFIX_LENGTH + PREFIX_LENGTH ];
  74. bool m_bUseForMainWindowTitle;
  75. bool m_bAutoProcess;
  76. int m_nToolFrameCount;
  77. };
  78. #endif // FACEPOSERTOOLWINDOW_H