using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;
using PixiEditor.UI.Common.Rendering;

namespace PixiEditor.UI.Common.Fonts;

//TODO: Make autogenerated from PixiPerfectIcons.axaml
public static class PixiPerfectIcons
{
    private static readonly FontFamily pixiPerfectFontFamily = new("avares://PixiEditor.UI.Common/Fonts/pixiperfect.ttf#pixiperfect");

    public const string AddReference = "\ue900";
    public const string AddToMask = "\ue901";
    public const string AlphaLock = "\ue902";
    public const string AlphaUnlock = "\ue903";
    public const string ArrowDown = "\ue904";
    public const string ArrowLeft = "\ue905";
    public const string ArrowRight = "\ue906";
    public const string ArrowUp = "\ue907";
    public const string Book = "\ue908";
    public const string Bucket = "\ue909";
    public const string CanvasResize = "\ue90a";
    public const string Center = "\ue90b";
    public const string ChevronDown = "\ue90c";
    public const string ChevronLeft = "\ue90d";
    public const string ChevronRight = "\ue90e";
    public const string ChevronUp = "\ue90f";
    public const string Circle = "\ue910";
    public const string Clock = "\ue911";
    public const string ColorPalette = "\ue912";
    public const string ColorPicker = "\ue913";
    public const string ColorSliders = "\ue914";
    public const string ColorsSwap = "\ue915";
    public const string Compass = "\ue916";
    public const string Copy = "\ue917";
    public const string CornerUpLeft = "\ue918";
    public const string CornerUpRight = "\ue919";
    public const string CreateMask = "\ue91a";
    public const string CropToSelection = "\ue91b";
    public const string Crop = "\ue91c";
    public const string Database = "\ue91d";
    public const string Deselect = "\ue91e";
    public const string Droplet = "\ue91f";
    public const string DuplicateFile = "\ue920";
    public const string Duplicate = "\ue921";
    public const string Edit = "\ue922";
    public const string Exit = "\ue923";
    public const string EyeOff = "\ue924";
    public const string Eye = "\ue925";
    public const string RotateFileMinus90 = "\ue926";
    public const string FilePlus = "\ue927";
    public const string FileText = "\ue928";
    public const string File = "\ue929";
    public const string RotateFile90 = "\ue92a";
    public const string RotateFile180 = "\ue92b";

    public const string FolderPlus = "\ue92c";
    public const string Folder = "\ue92d";
    public const string Globe = "\ue92e";
    public const string Swatches = "\ue92f";
    public const string Grid = "\uE941";
    public const string Home = "\ue930";
    public const string RotateImageMinus90 = "\ue931";
    public const string Image = "\ue932";
    public const string RotateImage90 = "\ue933";
    public const string RotateImage180 = "\ue934";
    public const string Info = "\ue935";
    public const string Intersect = "\ue936";
    public const string Invert = "\ue937";
    public const string Lasso = "\ue938";
    public const string Layers = "\ue939";
    public const string Line = "\ue93a";
    public const string Lock = "\uE93B";
    public const string LogOut = "\uE93C";
    public const string MagicWand = "\uE93D";
    public const string Minimize = "\uE93E";
    public const string Merge = "\uE93F";
    public const string MousePointer = "\uE940";
    public const string MoveView = "\uE942";
    public const string NewMask = "\uE943";
    public const string Paste = "\uE944";
    public const string VectorPen = "\uE945";
    public const string Picker = "\uE946";
    public const string PlusSquare = "\uE947";
    public const string RectangleSelection = "\uE948";
    public const string Redo = "\uE949";
    public const string ReferenceLayer = "\uE94A";
    public const string Resize = "\uE94B";
    public const string RotateView = "\uE94C";
    public const string Eraser = "\uE94D";
    public const string Save = "\uE94E";
    public const string Scissors = "\uE94F";
    public const string SelectAll = "\uE950";
    public const string Settings = "\uE951";
    public const string Sliders = "\uE952";
    public const string Square = "\uE953";
    public const string Subtract = "\uE954";
    public const string Sun = "\uE955";
    public const string Swap = "\uE956";
    public const string Tool = "\uE957";
    public const string Trash = "\uE958";
    public const string Undo = "\uE959";
    public const string Unlock = "\uE95A";
    public const string XFlip = "\uE95B";
    public const string XSelectedFlip = "\uE95C";
    public const string XSymmetry = "\uE95D";
    public const string YFlip = "\uE95E";
    public const string YSelectedFlip = "\uE95F";
    public const string YSymmetry = "\uE960";
    public const string ZoomIn = "\uE961";
    public const string ZoomOut = "\uE962";
    public const string PasteReferenceLayer = "\ue977";
    public const string PasteAsNewLayer = "\ue978";
    public const string CopyAdd = "\ue921";
    public const string Message = "\uE96F";
    public const string Download = "\uE969";
    public const string YouTube = "\uE975";
    public const string Write = "\uE968";
    public const string Misc = "\uE970";
    
    public const string Reset = "R"; // TODO: Create a reset icon
    public const string ToggleLayerVisible = "\u25a1;"; // TODO: Create a toggle layer visible icon
    public const string ToggleMask = "\u25a1;"; // TODO: Create a toggle mask icon
    public static string Pen => "\uE971";

    public static IImage ToIcon(string unicode, double size = 18)
    {
        if(string.IsNullOrEmpty(unicode)) return null;

        return new IconImage(unicode, pixiPerfectFontFamily, size, Colors.White);
    }
    
    public static IImage ToIcon(string unicode, double size, double rotation)
    {
        if(string.IsNullOrEmpty(unicode)) return null;

        return new IconImage(unicode, pixiPerfectFontFamily, size, Colors.White, rotation);
    }
}
