ChunkDataView.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : ChunkView *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/ChunkView/ChunkDataView.h $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 9/28/99 9:48a $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if !defined(AFX_CHUNKDATAVIEW_H__FD83E2D7_72AE_11D3_BB4D_00902742EA14__INCLUDED_)
  36. #define AFX_CHUNKDATAVIEW_H__FD83E2D7_72AE_11D3_BB4D_00902742EA14__INCLUDED_
  37. #if _MSC_VER > 1000
  38. #pragma once
  39. #endif // _MSC_VER > 1000
  40. // ChunkDataView.h : header file
  41. //
  42. #include "bittype.h"
  43. class ChunkImageClass;
  44. class HexToStringClass;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CChunkDataView view
  47. class CChunkDataView : public CListView
  48. {
  49. protected:
  50. CChunkDataView(); // protected constructor used by dynamic creation
  51. DECLARE_DYNCREATE(CChunkDataView)
  52. // Attributes
  53. public:
  54. enum WordSizeType
  55. {
  56. WORD_SIZE_BYTE = 0,
  57. WORD_SIZE_SHORT = 1,
  58. WORD_SIZE_LONG = 2
  59. };
  60. enum DisplayModeType
  61. {
  62. DISPLAY_MODE_HEX = 0,
  63. DISPLAY_MODE_MICROCHUNKS,
  64. };
  65. void Set_Word_Size(WordSizeType wordsize) { WordSize = wordsize; OnUpdate(NULL,0,NULL); }
  66. WordSizeType Get_Word_Size(void) { return WordSize; }
  67. void Set_Display_Mode(DisplayModeType displaymode) { DisplayMode = displaymode; OnUpdate(NULL,0,NULL); }
  68. DisplayModeType Get_Display_Mode(void) { return DisplayMode; }
  69. // Operations
  70. public:
  71. // Overrides
  72. // ClassWizard generated virtual function overrides
  73. //{{AFX_VIRTUAL(CChunkDataView)
  74. public:
  75. virtual void OnInitialUpdate();
  76. protected:
  77. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  78. virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  79. //}}AFX_VIRTUAL
  80. // Implementation
  81. protected:
  82. virtual ~CChunkDataView();
  83. #ifdef _DEBUG
  84. virtual void AssertValid() const;
  85. virtual void Dump(CDumpContext& dc) const;
  86. #endif
  87. void Display_Chunk(const ChunkImageClass * chunk);
  88. void Display_Chunk_Sub_Chunks(const ChunkImageClass * chunk);
  89. void Display_Chunk_Hex(const ChunkImageClass * chunk);
  90. void Display_Chunk_Micro_Chunks(const ChunkImageClass * chunk);
  91. void Reset_Columns(void);
  92. HexToStringClass * Create_Hex_Converter(const uint8 * data,const uint32 size);
  93. void Destroy_Hex_Converter(HexToStringClass * hexconv);
  94. DisplayModeType DisplayMode;
  95. WordSizeType WordSize;
  96. // Generated message map functions
  97. protected:
  98. //{{AFX_MSG(CChunkDataView)
  99. // NOTE - the ClassWizard will add and remove member functions here.
  100. //}}AFX_MSG
  101. DECLARE_MESSAGE_MAP()
  102. };
  103. /////////////////////////////////////////////////////////////////////////////
  104. //{{AFX_INSERT_LOCATION}}
  105. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  106. #endif // !defined(AFX_CHUNKDATAVIEW_H__FD83E2D7_72AE_11D3_BB4D_00902742EA14__INCLUDED_)