Interop.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using FluentAvalonia.Interop;
  2. using System;
  3. using System.Runtime.InteropServices;
  4. namespace Ryujinx.Ava.Ui.Backend
  5. {
  6. public static class Interop
  7. {
  8. [StructLayout(LayoutKind.Sequential)]
  9. public struct XWindowAttributes
  10. {
  11. public int x;
  12. public int y;
  13. public int width;
  14. public int height;
  15. public int border_width;
  16. public int depth;
  17. public IntPtr visual;
  18. public IntPtr root;
  19. public int c_class;
  20. public int bit_gravity;
  21. public int win_gravity;
  22. public int backing_store;
  23. public IntPtr backing_planes;
  24. public IntPtr backing_pixel;
  25. public int save_under;
  26. public IntPtr colormap;
  27. public int map_installed;
  28. public int map_state;
  29. public IntPtr all_event_masks;
  30. public IntPtr your_event_mask;
  31. public IntPtr do_not_propagate_mask;
  32. public int override_direct;
  33. public IntPtr screen;
  34. }
  35. [DllImport("user32.dll")]
  36. public static extern bool GetClientRect(IntPtr hwnd, out RECT lpRect);
  37. [DllImport("libX11.so.6")]
  38. public static extern int XCloseDisplay(IntPtr display);
  39. [DllImport("libX11.so.6")]
  40. public static extern int XGetWindowAttributes(IntPtr display, IntPtr window, ref XWindowAttributes attributes);
  41. [DllImport("libX11.so.6")]
  42. public static extern IntPtr XOpenDisplay(IntPtr display);
  43. }
  44. }