BsLinuxPlatform.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "Platform/BsPlatform.h"
  5. #include <X11/X.h>
  6. #include <X11/Xlib.h>
  7. namespace bs
  8. {
  9. class LinuxWindow;
  10. /** @addtogroup Platform-Internal
  11. * @{
  12. */
  13. /**
  14. * Contains various Linux specific platform functionality;
  15. */
  16. class BS_CORE_EXPORT LinuxPlatform : public Platform
  17. {
  18. public:
  19. /** Returns the active X11 display. */
  20. static ::Display* getXDisplay();
  21. /** Returns the main X11 window. Caller must ensure the main window has been created. */
  22. static ::Window getMainXWindow();
  23. /** Retruns the absolute path to the user's home directory. */
  24. static Path getHomeDir();
  25. /** Locks access to the X11 system, not allowing any other thread to access it. Must be used for every X11 access. */
  26. static void lockX();
  27. /** Unlocks access to the X11 system. Must follow every call to lockX(). */
  28. static void unlockX();
  29. /** Notifies the system that a new window was created. */
  30. static void _registerWindow(::Window xWindow, LinuxWindow* window);
  31. /** Notifies the system that a window is about to be destroyed. */
  32. static void _unregisterWindow(::Window xWindow);
  33. /** Generates a X11 Pixmap from the provided pixel data. */
  34. static Pixmap createPixmap(const PixelData& data, UINT32 depth);
  35. };
  36. /** @} */
  37. }