// Copyright (c) 2018-2021 Jean-Philippe Bruyère // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using System.IO; namespace Drawing2D { public abstract class CrowBackend: IDisposable { /// /// GLFW Native window pointer /// public IntPtr hWin { get; protected set; } public bool ownGlfwWinHandle { get; private set; } public CrowBackend (int width, int height, IntPtr nativeWindow = default) { ownGlfwWinHandle = (nativeWindow == IntPtr.Zero); hWin = nativeWindow; } /// /// Main rendering surface, usualy an accelerated window surface /// public abstract ISurface MainSurface { get; } /// /// Create a new surface /// /// width of the new surface /// height of the new surface /// the new surface instance public abstract ISurface CreateSurface (int width, int height); /// /// Create a new surface backed by the byte array provided as argument /// /// a byte array to hold the pixels of the new surface /// width of the new surface /// height of the new surface /// the new surface instance public abstract ISurface CreateSurface (byte[] data, int width, int height); //ISurface CreateMainSurface (IntPtr glfwWinHandle, int width, int height); public abstract IRegion CreateRegion (); public abstract IContext CreateContext (ISurface surf); //IPattern CreatePattern (PatternType patternType); public abstract IGradient CreateGradient (GradientType gradientType, Rectangle bounds); public abstract byte[] LoadBitmap (Stream stream, out Size dimensions); public abstract ISvgHandle LoadSvg (Stream stream); public abstract ISvgHandle LoadSvg (string svgFragment); public abstract IContext PrepareUIFrame (IContext existingContext, IRegion clipping); public abstract void FlushUIFrame (IContext ctx); public abstract void ResizeMainSurface (int width, int height); protected bool isDisposed; public abstract void Dispose(); /*IRegion CreateRegion (); ISurface CreateSurface (int width, int height); ISurface CreateSurface (byte[] data, int width, int height); ISurface CreateSurface (IntPtr glfwWinHandle, int width, int height); IContext CreateContext (ISurface surf); //IPattern CreatePattern (PatternType patternType); IGradient CreateGradient (GradientType gradientType, Rectangle bounds); byte[] LoadBitmap (Stream stream, out Size dimensions); ISvgHandle LoadSvg (Stream stream); ISvgHandle LoadSvg (string svgFragment);*/ } }