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.

WMNotifier.h 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. // -=- WMNotifier.h
  19. //
  20. // The WMNotifier is used to get callbacks indicating changes in the state
  21. // of the system, for instance in the size/format/palette of the display.
  22. // The WMNotifier contains a Win32 window, which receives notifications of
  23. // system events and stores them. Whenever processEvent is called, any
  24. // incoming events are processed and the appropriate notifier called.
  25. #ifndef __RFB_WIN32_NOTIFIER_H__
  26. #define __RFB_WIN32_NOTIFIER_H__
  27. #include <rfb/SDesktop.h>
  28. #include <rfb_win32/MsgWindow.h>
  29. #include <rfb_win32/DeviceFrameBuffer.h>
  30. #include <rfb_win32/SInput.h>
  31. namespace rfb {
  32. namespace win32 {
  33. // -=- Window Message Monitor implementation
  34. class WMMonitor : MsgWindow {
  35. public:
  36. class Notifier {
  37. public:
  38. typedef enum {DisplaySizeChanged,
  39. DisplayPixelFormatChanged} DisplayEventType;
  40. virtual void notifyDisplayEvent(DisplayEventType evt) = 0;
  41. };
  42. WMMonitor();
  43. virtual ~WMMonitor();
  44. void setNotifier(Notifier* wmn) {notifier=wmn;}
  45. protected:
  46. // - Internal MsgWindow callback
  47. virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam);
  48. Notifier* notifier;
  49. };
  50. };
  51. };
  52. #endif // __RFB_WIN32_WMNOTIFIER_H__