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.

94 lines
3.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. // CWMPHost.h : Declaration of the CWMPHost
  3. //
  4. #include "resource.h" // main symbols
  5. #include <oledlg.h>
  6. // if this file isn't found, set your path to include the wmp sdk include directory
  7. // download the sdk from http://www.microsoft.com/windows/windowsmedia/mp10/sdk.aspx
  8. #include "wmp.h"
  9. #include "CWMPEventDispatch.h"
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CWMPHost
  12. class CWMPHost : public CWindowImpl< CWMPHost, CWindow, CWinTraits< WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE > >
  13. {
  14. public:
  15. DECLARE_WND_CLASS_EX(NULL, 0, 0)
  16. BEGIN_MSG_MAP(CWMPHost)
  17. MESSAGE_HANDLER(WM_CREATE, OnCreate)
  18. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  19. MESSAGE_HANDLER(WM_CLOSE, OnClose)
  20. MESSAGE_HANDLER(WM_SIZE, OnSize)
  21. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu)
  22. MESSAGE_HANDLER(WM_LBUTTONDOWN, OnClick)
  23. MESSAGE_HANDLER(WM_MBUTTONDOWN, OnClick)
  24. MESSAGE_HANDLER(WM_RBUTTONDOWN, OnClick)
  25. MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLeftDoubleClick)
  26. MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
  27. MESSAGE_HANDLER(WM_SYSKEYDOWN, OnSysKeyDown)
  28. MESSAGE_HANDLER(WM_ERASEBKGND, OnErase)
  29. MESSAGE_HANDLER(WM_NCACTIVATE, OnNCActivate)
  30. COMMAND_ID_HANDLER(ID_HALF_SIZE, OnVideoScale)
  31. COMMAND_ID_HANDLER(ID_FULL_SIZE, OnVideoScale)
  32. COMMAND_ID_HANDLER(ID_DOUBLE_SIZE, OnVideoScale)
  33. COMMAND_ID_HANDLER(ID_STRETCH_TO_FIT, OnVideoScale)
  34. END_MSG_MAP()
  35. LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  36. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  37. LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  38. LRESULT OnErase(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& bHandled);
  39. LRESULT OnSize(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /* lResult */);
  40. LRESULT OnContextMenu(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /* lResult */);
  41. LRESULT OnClick(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /* lResult */);
  42. LRESULT OnLeftDoubleClick(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /* lResult */);
  43. LRESULT OnSysKeyDown(UINT /* uMsg */, WPARAM wParam, LPARAM /* lParam */, BOOL& /* lResult */);
  44. LRESULT OnKeyDown(UINT /* uMsg */, WPARAM wParam, LPARAM /* lParam */, BOOL& /* lResult */);
  45. LRESULT OnNCActivate(UINT /* uMsg */, WPARAM wParam, LPARAM /* lParam */, BOOL& /* lResult */);
  46. LRESULT OnVideoScale(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  47. CAxWindow m_wndView;
  48. CComPtr<IConnectionPoint> m_spConnectionPoint;
  49. DWORD m_dwAdviseCookie;
  50. HMENU m_hPopupMenu;
  51. };
  52. /////////////////////////////////////////////////////////////////////////////
  53. // event logging - this should really be in its own smp.h or something...
  54. enum EventType_t
  55. {
  56. ET_APPLAUNCH,
  57. ET_APPEXIT,
  58. ET_CLOSE,
  59. ET_FADEOUT,
  60. ET_MEDIABEGIN,
  61. ET_MEDIAEND,
  62. ET_JUMPHOME,
  63. ET_JUMPEND,
  64. ET_PLAY,
  65. ET_PAUSE,
  66. ET_STOP,
  67. ET_SCRUBFROM,
  68. ET_SCRUBTO,
  69. ET_STEPFWD,
  70. ET_STEPBCK,
  71. ET_JUMPFWD,
  72. ET_JUMPBCK,
  73. ET_REPEAT,
  74. ET_MAXIMIZE,
  75. ET_MINIMIZE,
  76. ET_RESTORE,
  77. };