|
|
|
|
|
|
using System; |
|
|
|
using Unity.UIWidgets.gestures; |
|
|
|
using Unity.UIWidgets.scheduler2; |
|
|
|
using Unity.UIWidgets.services; |
|
|
|
public class PaintingBinding : GestureBinding { |
|
|
|
public class PaintingBinding : ServicesBinding { |
|
|
|
protected override void initInstances() { |
|
|
|
base.initInstances(); |
|
|
|
instance = this; |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public new static PaintingBinding instance { |
|
|
|
get { return (PaintingBinding) GestureBinding.instance; } |
|
|
|
get { return (PaintingBinding) ServicesBinding.instance; } |
|
|
|
set { Window.instance._binding = value; } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
ImageCache _imageCache; |
|
|
|
readonly _SystemFontsNotifier _systemFonts = new _SystemFontsNotifier(); |
|
|
|
public _SystemFontsNotifier systemFonts { |
|
|
|
|
|
|
|
public Listenable systemFonts { |
|
|
|
|
|
|
|
readonly _SystemFontsNotifier _systemFonts = new _SystemFontsNotifier(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
public static partial class painting_ { |
|
|
|
public static ImageCache imageCache => PaintingBinding.instance.imageCache; |
|
|
|
Future<ui.Codec> instantiateImageCodec(byte[] bytes, |
|
|
|
int? cacheWidth, |
|
|
|
int? cacheHeight |
|
|
|
) { |
|
|
|
D.assert(cacheWidth == null || cacheWidth > 0); |
|
|
|
D.assert(cacheHeight == null || cacheHeight > 0); |
|
|
|
return ui_.instantiateImageCodec( |
|
|
|
bytes, |
|
|
|
targetWidth: cacheWidth, |
|
|
|
targetHeight: cacheHeight |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public class _SystemFontsNotifier : Listenable { |
|
|
|
HashSet<VoidCallback> _systemFontsCallbacks = new HashSet<VoidCallback>(); |
|
|
|
|
|
|
|
internal class _SystemFontsNotifier : Listenable { |
|
|
|
readonly HashSet<VoidCallback> _systemFontsCallbacks = new HashSet<VoidCallback>(); |
|
|
|
void notifyListeners () { |
|
|
|
void notifyListeners() { |
|
|
|
|
|
|
|
|
|
|
|
public void addListener(VoidCallback listener) { |
|
|
|
_systemFontsCallbacks.Add(listener); |
|
|
|
} |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static partial class painting_ { |
|
|
|
public static ImageCache imageCache => PaintingBinding.instance.imageCache; |
|
|
|
} |
|
|
|
} |