Browse Source

Merge pull request #781 from AvaloniaUI/fixes/gtk-rendererfactory

Register an IRendererFactory on GTK.
pull/782/head
Wiesław Šoltés 10 years ago
committed by GitHub
parent
commit
29a9cea8cb
  1. 8
      src/Gtk/Avalonia.Gtk/GtkPlatform.cs

8
src/Gtk/Avalonia.Gtk/GtkPlatform.cs

@ -28,7 +28,7 @@ namespace Avalonia.Gtk
using Rendering; using Rendering;
using Gtk = global::Gtk; using Gtk = global::Gtk;
public class GtkPlatform : IPlatformThreadingInterface, IPlatformSettings, IWindowingPlatform, IPlatformIconLoader public class GtkPlatform : IPlatformThreadingInterface, IPlatformSettings, IWindowingPlatform, IPlatformIconLoader, IRendererFactory
{ {
private static readonly GtkPlatform s_instance = new GtkPlatform(); private static readonly GtkPlatform s_instance = new GtkPlatform();
private static Thread _uiThread; private static Thread _uiThread;
@ -54,6 +54,7 @@ namespace Avalonia.Gtk
.Bind<IMouseDevice>().ToConstant(GtkMouseDevice.Instance) .Bind<IMouseDevice>().ToConstant(GtkMouseDevice.Instance)
.Bind<IPlatformSettings>().ToConstant(s_instance) .Bind<IPlatformSettings>().ToConstant(s_instance)
.Bind<IPlatformThreadingInterface>().ToConstant(s_instance) .Bind<IPlatformThreadingInterface>().ToConstant(s_instance)
.Bind<IRendererFactory>().ToConstant(s_instance)
.Bind<IRenderLoop>().ToConstant(new DefaultRenderLoop(60)) .Bind<IRenderLoop>().ToConstant(new DefaultRenderLoop(60))
.Bind<ISystemDialogImpl>().ToSingleton<SystemDialogImpl>() .Bind<ISystemDialogImpl>().ToSingleton<SystemDialogImpl>()
.Bind<IPlatformIconLoader>().ToConstant(s_instance); .Bind<IPlatformIconLoader>().ToConstant(s_instance);
@ -112,6 +113,11 @@ namespace Avalonia.Gtk
return new PopupImpl(); return new PopupImpl();
} }
public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop)
{
return new Renderer(root, renderLoop);
}
public IWindowIconImpl LoadIcon(string fileName) public IWindowIconImpl LoadIcon(string fileName)
{ {
return new IconImpl(new Gdk.Pixbuf(fileName)); return new IconImpl(new Gdk.Pixbuf(fileName));

Loading…
Cancel
Save