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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Copyright (C) 2002-2003 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/Threading.h>
  29. #include <rfb_win32/MsgWindow.h>
  30. #include <rfb_win32/DeviceFrameBuffer.h>
  31. #include <rfb_win32/SInput.h>
  32. namespace rfb {
  33. namespace win32 {
  34. // -=- Window Message Monitor implementation
  35. class WMMonitor : MsgWindow {
  36. public:
  37. class Notifier {
  38. public:
  39. typedef enum {DisplaySizeChanged, DisplayColourMapChanged,
  40. DisplayPixelFormatChanged} DisplayEventType;
  41. virtual void notifyDisplayEvent(DisplayEventType evt) = 0;
  42. };
  43. WMMonitor();
  44. virtual ~WMMonitor();
  45. void setNotifier(Notifier* wmn) {notifier=wmn;}
  46. protected:
  47. // - Internal MsgWindow callback
  48. virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam);
  49. Notifier* notifier;
  50. };
  51. };
  52. };
  53. #endif // __RFB_WIN32_WMNOTIFIER_H__