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.

SDisplayCorePolling.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // -=- SDisplayCorePolling.h
  19. //
  20. // SDisplayCore implementation that simply polls the screen, in sections,
  21. // in order to detect changes. This Core will signal the SDisplay's
  22. // updateEvent regularly, causing it to call the Core back to propagate
  23. // changes to the VNC Server.
  24. #ifndef __RFB_SDISPLAY_CORE_POLLING_H__
  25. #define __RFB_SDISPLAY_CORE_POLLING_H__
  26. #include <rfb_win32/SDisplay.h>
  27. #include <rfb_win32/IntervalTimer.h>
  28. #include <rfb_win32/WMWindowCopyRect.h>
  29. namespace rfb {
  30. namespace win32 {
  31. class SDisplayCorePolling : public SDisplayCore, protected MsgWindow {
  32. public:
  33. SDisplayCorePolling(SDisplay* display, UpdateTracker* ut, int pollIntervalMs=50);
  34. ~SDisplayCorePolling();
  35. // - Called by SDisplay to inform Core of the screen size
  36. virtual void setScreenRect(const Rect& screenRect_);
  37. // - Called by SDisplay to flush updates to the specified tracker
  38. virtual void flushUpdates();
  39. virtual const char* methodName() const { return "Polling"; }
  40. protected:
  41. // - MsgWindow overrides
  42. // processMessage is used to service the cursor & polling timers
  43. virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam);
  44. // - Hooking subcomponents used to track the desktop state
  45. WMCopyRect copyrect;
  46. // - Background full screen polling fields
  47. IntervalTimer pollTimer;
  48. static const unsigned int pollTimerId;
  49. Rect screenRect;
  50. int pollInterval;
  51. int pollNextY;
  52. int pollIncrementY;
  53. bool pollNextStrip;
  54. // - Handle back to the owning SDisplay, and to the UpdateTracker to flush to
  55. SDisplay* display;
  56. UpdateTracker* updateTracker;
  57. };
  58. };
  59. };
  60. #endif