Team Fortress 2 Source Code as on 22/4/2020
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.

120 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef VCDBROWSER_H
  7. #define VCDBROWSER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "mxtk/mxListView.h"
  12. #include "commctrl.h"
  13. #include "utldict.h"
  14. #include "faceposertoolwindow.h"
  15. #include "filesystem.h"
  16. #include "tier1/UtlSortVector.h"
  17. class CVCDList;
  18. class CUtlSymbolTree;
  19. class CVCDOptionsWindow;
  20. // class CChoreoEvent;
  21. struct _IMAGELIST;
  22. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  23. enum
  24. {
  25. /// IMAGE_WORKSPACE = 0,
  26. // IMAGE_WORKSPACE_CHECKEDOUT,
  27. // IMAGE_PROJECT,
  28. // IMAGE_PROJECT_CHECKEDOUT,
  29. // IMAGE_SCENE,
  30. // IMAGE_SCENE_CHECKEDOUT,
  31. // IMAGE_VCD,
  32. // IMAGE_VCD_CHECKEDOUT,
  33. // IMAGE_WAV,
  34. // IMAGE_WAV_CHECKEDOUT,
  35. // IMAGE_SPEAK,
  36. // IMAGE_SPEAK_CHECKEDOUT,
  37. VCD_NUM_IMAGES,
  38. };
  39. class CVCDBrowser : public mxWindow, public IFacePoserToolWindow
  40. {
  41. typedef mxWindow BaseClass;
  42. public:
  43. CVCDBrowser( mxWindow *parent );
  44. virtual int handleEvent( mxEvent *event );
  45. virtual void OnDelete();
  46. void RepopulateTree();
  47. void BuildSelectionList( CUtlVector< FileNameHandle_t >& selected );
  48. void OnOpen();
  49. void JumpToItem( const FileNameHandle_t& vcd );
  50. int GetVCDCount() const;
  51. FileNameHandle_t GetVCD( int index );
  52. void OnSearch();
  53. void OnCancelSearch();
  54. HIMAGELIST CreateImageList();
  55. void SetCurrent( char const *fn );
  56. private:
  57. class CNameLessFunc
  58. {
  59. public:
  60. bool Less( const FileNameHandle_t &name1, const FileNameHandle_t &name2, void *pContext );
  61. };
  62. void OpenVCD( const FileNameHandle_t& handle );
  63. char const *GetSearchString();
  64. bool LoadVCDsFilesInDirectory( CUtlSortVector< FileNameHandle_t, CNameLessFunc >& soundlist, char const* pDirectoryName, int nDirectoryNameLen );
  65. bool InitDirectoryRecursive( CUtlSortVector< FileNameHandle_t, CNameLessFunc >& soundlist, char const* pDirectoryName );
  66. void PopulateTree( char const *subdirectory );
  67. void ShowContextMenu( void );
  68. void LoadAllSounds();
  69. void RemoveAllSounds();
  70. CVCDList *m_pListView;
  71. enum
  72. {
  73. NUM_BITMAPS = 6,
  74. };
  75. CUtlSortVector< FileNameHandle_t, CNameLessFunc > m_AllVCDs;
  76. CUtlSymbolTable m_ScriptTable;
  77. CUtlVector< CUtlSymbol > m_Scripts;
  78. CVCDOptionsWindow *m_pOptions;
  79. CUtlSymbolTree *m_pFileTree;
  80. CUtlVector< FileNameHandle_t > m_CurrentSelection;
  81. int m_nPrevProcessed;
  82. bool m_bTextSearch;
  83. };
  84. extern CVCDBrowser *g_pVCDBrowser;
  85. #endif // VCDBROWSER_H