DisplayManagerOSX.h 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // DisplayManagerOSX.h
  3. // konvergo
  4. //
  5. // Created by Lionel CHAZALLON on 28/09/2014.
  6. //
  7. //
  8. #ifndef _DISPLAYMANAGEROSX_H_
  9. #define _DISPLAYMANAGEROSX_H_
  10. #include "ApplicationServices/ApplicationServices.h"
  11. #include <CoreFoundation/CoreFoundation.h>
  12. #include <CoreFoundation/CFDictionary.h>
  13. #include "display/DisplayManager.h"
  14. #define MAX_DISPLAYS 32
  15. typedef std::map<int, CFArrayRef> OSXDisplayModeMap;
  16. class DisplayManagerOSX : public DisplayManager
  17. {
  18. Q_OBJECT
  19. private:
  20. // OSX Display/ VideoMode handling structs
  21. uint32_t m_osxnumDisplays;
  22. CGDirectDisplayID m_osxDisplays[MAX_DISPLAYS];
  23. OSXDisplayModeMap m_osxDisplayModes;
  24. public:
  25. explicit DisplayManagerOSX(QObject* parent) : DisplayManager(parent) {};
  26. ~DisplayManagerOSX() override;
  27. bool initialize() override;
  28. bool setDisplayMode(int display, int mode) override;
  29. int getCurrentDisplayMode(int display) override;
  30. int getMainDisplay() override;
  31. int getDisplayFromPoint(int x, int y) override;
  32. };
  33. #endif /* _DISPLAYMANAGEROSX_H_ */