ScreenManagerParent.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_ScreenManagerParent_h
  6. #define mozilla_dom_ScreenManagerParent_h
  7. #include "mozilla/dom/PScreenManagerParent.h"
  8. #include "nsIScreenManager.h"
  9. namespace mozilla {
  10. namespace dom {
  11. class ScreenManagerParent : public PScreenManagerParent
  12. {
  13. public:
  14. ScreenManagerParent(uint32_t* aNumberOfScreens,
  15. float* aSystemDefaultScale,
  16. bool* aSuccess);
  17. ~ScreenManagerParent() {};
  18. virtual bool RecvRefresh(uint32_t* aNumberOfScreens,
  19. float* aSystemDefaultScale,
  20. bool* aSuccess) override;
  21. virtual bool RecvScreenRefresh(const uint32_t& aId,
  22. ScreenDetails* aRetVal,
  23. bool* aSuccess) override;
  24. virtual void ActorDestroy(ActorDestroyReason aWhy) override;
  25. virtual bool RecvGetPrimaryScreen(ScreenDetails* aRetVal,
  26. bool* aSuccess) override;
  27. virtual bool RecvScreenForRect(const int32_t& aLeft,
  28. const int32_t& aTop,
  29. const int32_t& aWidth,
  30. const int32_t& aHeight,
  31. ScreenDetails* aRetVal,
  32. bool* aSuccess) override;
  33. virtual bool RecvScreenForBrowser(const TabId& aTabId,
  34. ScreenDetails* aRetVal,
  35. bool* aSuccess) override;
  36. private:
  37. bool ExtractScreenDetails(nsIScreen* aScreen, ScreenDetails &aDetails);
  38. nsCOMPtr<nsIScreenManager> mScreenMgr;
  39. };
  40. } // namespace dom
  41. } // namespace mozilla
  42. #endif // mozilla_dom_ScreenManagerParent_h