Leaked source code of windows server 2003
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.

175 lines
5.6 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. bltdisph.hxx
  7. Header file for DISPATCHER class.
  8. FILE HISTORY:
  9. terryk 20-Jun-91 move the source code from bltclwin.hxx
  10. terryk 01-Aug-91 change Dispatcher return type to ULONG
  11. beng 28-May-1992 Major shuffling between bltcc and bltdisph
  12. */
  13. #ifndef _BLTDISPH_HXX_
  14. #define _BLTDISPH_HXX_
  15. #include "bltevent.hxx"
  16. DLL_CLASS ASSOCHWNDDISP; // forward decl's
  17. DLL_CLASS DISPATCHER;
  18. /*************************************************************************
  19. NAME: ASSOCHWNDDISP
  20. SYNOPSIS: Associate a dispatcher with a window
  21. INTERFACE: HwndToPdispatch()
  22. PARENT: ASSOCHWNDTHIS
  23. HISTORY:
  24. beng 30-Sep-1991 Created
  25. **************************************************************************/
  26. DLL_CLASS ASSOCHWNDDISP: private ASSOCHWNDTHIS
  27. {
  28. NEWBASE(ASSOCHWNDTHIS)
  29. public:
  30. ASSOCHWNDDISP( HWND hwnd, const DISPATCHER * pdsp )
  31. : ASSOCHWNDTHIS( hwnd, pdsp ) { }
  32. static DISPATCHER * HwndToPdispatch( HWND hwnd )
  33. { return (DISPATCHER *)HwndToThis(hwnd); }
  34. };
  35. /**********************************************************************
  36. NAME: DISPATCHER
  37. SYNOPSIS: General window-message dispatcher class
  38. INTERFACE: DISPATCHER() - constructor
  39. ~DISPATCHER() - destructor
  40. CaptureMouse() - capture the mouse
  41. ReleaseMouse() - release the mouse
  42. DoChar() - force an OnChar function
  43. DoUserMessage() - force an OnUserMessage function
  44. USES:
  45. HISTORY:
  46. beng 01-Mar-91 Create client-window class
  47. terryk 20-Jun-91 move the source code from bltclwin.hxx
  48. terryk 01-Aug-91 change Dispatcher return type to ULONG
  49. beng 30-Sep-1991 Win32 conversion
  50. beng 05-Dec-1991 Implemented scroll-bar callbacks
  51. beng 13-Feb-1992 Removed Repaint member (parallel to clwin)
  52. beng 18-May-1992 Disabled scroll-bar callbacks
  53. beng 19-May-1992 OnNCHitTest superseded by CUSTOM_CONTROL::
  54. OnQHitTest
  55. beng 28-May-1992 Major reshuffle of bltcc and bltdisph
  56. **********************************************************************/
  57. DLL_CLASS DISPATCHER
  58. {
  59. private:
  60. WINDOW * _pwnd;
  61. // This object lets the window find its pwnd when it is entered
  62. // from Win (which doesn't set up This pointers, etc.)
  63. //
  64. ASSOCHWNDDISP _assocThis;
  65. protected:
  66. // constructor and destructor
  67. DISPATCHER( WINDOW * pwnd );
  68. ~DISPATCHER();
  69. // OnXXX Message
  70. virtual BOOL OnPaintReq();
  71. virtual BOOL OnActivation( const ACTIVATION_EVENT & );
  72. virtual BOOL OnDeactivation( const ACTIVATION_EVENT & );
  73. virtual BOOL OnFocus( const FOCUS_EVENT & );
  74. virtual BOOL OnDefocus( const FOCUS_EVENT & );
  75. virtual BOOL OnResize( const SIZE_EVENT & );
  76. virtual BOOL OnMove( const MOVE_EVENT & );
  77. virtual BOOL OnCloseReq();
  78. virtual BOOL OnDestroy();
  79. virtual BOOL OnKeyDown( const VKEY_EVENT & );
  80. virtual BOOL OnKeyUp( const VKEY_EVENT & );
  81. virtual BOOL OnChar( const CHAR_EVENT & );
  82. virtual BOOL OnMouseMove( const MOUSE_EVENT & );
  83. virtual BOOL OnLMouseButtonDown( const MOUSE_EVENT & );
  84. virtual BOOL OnLMouseButtonUp( const MOUSE_EVENT & );
  85. virtual BOOL OnLMouseButtonDblClick( const MOUSE_EVENT & );
  86. virtual BOOL OnQMouseCursor( const QMOUSEACT_EVENT & event );
  87. virtual ULONG OnQDlgCode();
  88. virtual ULONG OnQHitTest( const XYPOINT & xy );
  89. virtual ULONG OnQMouseActivate( const QMOUSEACT_EVENT & event );
  90. #if 0 // following member fcns elided to reduce vtable congestion
  91. virtual BOOL OnMMouseButtonDown( const MOUSE_EVENT & );
  92. virtual BOOL OnMMouseButtonUp( const MOUSE_EVENT & );
  93. virtual BOOL OnMMouseButtonDblClick( const MOUSE_EVENT & );
  94. virtual BOOL OnRMouseButtonDown( const MOUSE_EVENT & );
  95. virtual BOOL OnRMouseButtonUp( const MOUSE_EVENT & );
  96. virtual BOOL OnRMouseButtonDblClick( const MOUSE_EVENT & );
  97. #endif
  98. virtual BOOL OnTimer( const TIMER_EVENT & );
  99. virtual BOOL OnCommand( const CONTROL_EVENT & );
  100. #if 0 // Never really implemented (gedankenmembers?)
  101. virtual BOOL OnClick( const CONTROL_EVENT & );
  102. virtual BOOL OnDblClick( const CONTROL_EVENT & );
  103. virtual BOOL OnChange( const CONTROL_EVENT & );
  104. virtual BOOL OnSelect( const CONTROL_EVENT & );
  105. virtual BOOL OnEnter( const CONTROL_EVENT & );
  106. virtual BOOL OnDropDown( const CONTROL_EVENT & );
  107. #endif
  108. #if 0 // more elided members
  109. virtual BOOL OnScrollBar( const SCROLL_EVENT & );
  110. virtual BOOL OnScrollBarThumb( const SCROLL_THUMB_EVENT & );
  111. #endif
  112. virtual BOOL OnUserMessage( const EVENT & );
  113. static DISPATCHER * HwndToPwnd( HWND hwnd )
  114. { return ASSOCHWNDDISP::HwndToPdispatch(hwnd); }
  115. virtual BOOL Dispatch( const EVENT & e, ULONG * pnRes );
  116. public:
  117. // Spliced in from WINDOW
  118. HWND QueryHwnd() const;
  119. virtual HWND QueryRobustHwnd() const;
  120. VOID CaptureMouse();
  121. VOID ReleaseMouse();
  122. // Exported hooks for a couple of CCs
  123. BOOL DoChar( const CHAR_EVENT & event );
  124. BOOL DoUserMessage( const EVENT & event );
  125. };
  126. #endif // _BLTDISPH_HXX_