DXGUIManager.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:3k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1998-1999 DXGuide.  All Rights Reserved.
  2. // File: DXGUIManager.h
  3. #ifndef _DXGUIMANAGER__H
  4. #define _DXGUIMANAGER__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #ifdef GetCurrentTime
  9. #undef GetCurrentTime
  10. #endif // GetCurrentTime
  11. class CDDCursor;
  12. class CPackFileManager;
  13. class CDIMouseState;
  14. class CDIKeyState;
  15. class CDSBuffer;
  16. class CDDDevice;
  17. class CDIMouse;
  18. class CDIKeyboard;
  19. class CDDSurface;
  20. class CDXDialog;
  21. class CDirectSound;
  22. class CIMDManager;
  23. class CDXIMDBar;
  24. class CDDFrameRate;
  25. class CDDTextSurface;
  26. class CDXGUIManager
  27. {
  28. friend class CDirectXApp;
  29. friend class CDDFrameRate;
  30. friend class CDXNormalDialog; // for m_lpcszCloseBMPName
  31. public:
  32. // Flags for DDInit
  33. enum GUIManagerInitFlag
  34. {
  35. GMIF_FRAMERATE = 0x00000001L, // show frame counter
  36. GMIF_IMD = 0x00000002L, // load IMD file
  37. };
  38. protected:
  39. CDXGUIManager(void);
  40. ~CDXGUIManager();
  41. protected:
  42. bool Create(CDDDevice*  pDDDevice,
  43. DWORD  dwGUIManagerInitFlags,
  44. CDIMouse*  pMouse, CDIKeyboard*  pKeyboard,
  45. CDirectSound*  pSound,
  46. LPCTSTR  lpszPackFileName = NULL);
  47. public:
  48. bool Update(void);
  49. void SetCursor(int  nCursorIndex);
  50. bool SetTop(CDXDialog*  pDialog);
  51. bool RemoveTop(CDXDialog*  pDialog);
  52. CDIMouseState* GetMouseState(void) const;
  53. CDIKeyState* GetKeyState(void) const;
  54. CPackFileManager* GetPackFileManager(void) const;
  55. CDSBuffer* GetFocusedSound(int  nIndex) const;
  56. CDSBuffer* GetPressDownSound(int  nIndex) const;
  57. __int64 GetCurrentTime(void) const;
  58. DWORD GetTimeSpanOfms(__int64  i64TimeLast) const;
  59. __int64 GetTimeSpan(__int64  i64TimeLast) const;
  60. protected:
  61. CDIMouseState* m_pMouseState;
  62. CDIKeyState* m_pKeyState;
  63. CPackFileManager* m_pPackFileManager;
  64. CDXDialog* m_pCurrDialog;
  65. int m_nCurCursorIndex;
  66. CDirectSound* m_pSound;
  67. DWORD m_dwGUIManagerInitFlags;
  68. protected:
  69. int m_nButtonSoundsNum;
  70. CDSBuffer** m_ppButtonSoundFocused;
  71. CDSBuffer** m_ppButtonSoundPressDown;
  72. int m_nCursorNum;
  73. CDDCursor** m_ppCursor;
  74. CIMDManager* m_pIMDManager;
  75. CDDFrameRate* m_pFrameRate;
  76. CDDTextSurface* m_pDisplayModeInfo;
  77. public:
  78. CIMDManager* GetIMDManager(void) const;
  79. CDDSurface* GetRenderSurface(void) const;
  80. protected:
  81. static const LPCTSTR m_lpcszDescriptionName;
  82. static const LPCTSTR m_lpcszCloseBMPName;
  83. static const LPCTSTR m_lpcszAllSectionName;
  84. static const LPCTSTR m_lpcszButtonSoundsPairNumEntryName;
  85. static const LPCTSTR m_lpcszButtonSoundSectionFmt;
  86. static const LPCTSTR m_lpcszFocusedEntryName;
  87. static const LPCTSTR m_lpcszPressDownEntryName;
  88. static const LPCTSTR m_lpcszEditFontSectionName;
  89. static const LPCTSTR m_lpcszNameEntryName;
  90. static const LPCTSTR m_lpcszSizeEntryName;
  91. static const LPCTSTR m_lpcszCursorSectionName;
  92. static const LPCTSTR m_lpcszCursorNumEntryName;
  93. static const LPCTSTR m_lpcszCursorNameEntryFmt;
  94. static const LPCTSTR m_lpcszFrameRateSectionName;
  95. static const LPCTSTR m_lpcszColorEntryName;
  96. static const LPCTSTR m_lpcszLeftEntryName;
  97. static const LPCTSTR m_lpcszTopEntryName;
  98. public:
  99. CFont m_fontCaption;
  100. CFont m_fontMessage;
  101. CFont m_fontEdit;
  102. protected:
  103. UINT m_nInsertCaretWidth;
  104. UINT m_nOvertypeCaretWidth;
  105. UINT m_nEditXMetrics;
  106. UINT m_nEditYMetrics;
  107. UINT m_uiCaretBlinkTime;
  108. CDDSurface* m_pRenderSurface;
  109. protected:
  110. __int64 m_i64TimeNow;
  111. };
  112. #include "DXGUIManager.inl"
  113. #endif // _DXGUIMANAGER__H