public void Initialize(X11PlatformOptions options) { XInitThreads(); Display = XOpenDisplay(IntPtr.Zero); DeferredDisplay = XOpenDisplay(IntPtr.Zero); if (Display == IntPtr.Zero) { throw new Exception("XOpenDisplay failed"); } XError.Init(); Info = new X11Info(Display, DeferredDisplay); AvaloniaLocator.CurrentMutable.BindToSelf(this) .Bind <IWindowingPlatform>().ToConstant(this) .Bind <IPlatformThreadingInterface>().ToConstant(new X11PlatformThreading(this)) .Bind <IRenderTimer>().ToConstant(new DefaultRenderTimer(60)) .Bind <IRenderLoop>().ToConstant(new RenderLoop()) .Bind <PlatformHotkeyConfiguration>().ToConstant(new PlatformHotkeyConfiguration(InputModifiers.Control)) .Bind <IKeyboardDevice>().ToFunc(() => KeyboardDevice) .Bind <IStandardCursorFactory>().ToConstant(new X11CursorFactory(Display)) .Bind <IClipboard>().ToConstant(new X11Clipboard(this)) .Bind <IPlatformSettings>().ToConstant(new PlatformSettingsStub()) .Bind <IPlatformIconLoader>().ToConstant(new X11IconLoader(Info)) .Bind <ISystemDialogImpl>().ToConstant(new GtkSystemDialog()); X11Screens = Avalonia.X11.X11Screens.Init(this); Screens = new X11Screens(X11Screens); if (Info.XInputVersion != null) { var xi2 = new XI2Manager(); if (xi2.Init(this)) { XI2 = xi2; } } if (options.UseGpu) { if (options.UseEGL) { EglGlPlatformFeature.TryInitialize(); } else { GlxGlPlatformFeature.TryInitialize(Info); } } }
public Screens(IScreenImpl iScreenImpl) { _iScreenImpl = iScreenImpl; }