using System;
using System.Runtime.InteropServices;

namespace InterpreterLibrary.Processing
{
    static class NativeFunctions
    {
        [DllImport("gdi32.dll", EntryPoint = "CreateCompatibleDC", SetLastError = true)]
        public static extern IntPtr CreateCompatibleDC([In] IntPtr hdc);

        [DllImport("gdi32.dll", EntryPoint = "SelectObject")]
        public static extern IntPtr SelectObject([In] IntPtr hdc, [In] IntPtr hgdiobj);

        [DllImport("gdi32.dll", EntryPoint = "DeleteDC")]
        public static extern bool DeleteDC([In] IntPtr hdc);

        [DllImport("gdi32.dll", EntryPoint = "BitBlt", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool BitBlt([In] IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, [In] IntPtr hdcSrc, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);

        [DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool DeleteObject([In] IntPtr hObject);

        public enum TernaryRasterOperations : uint
        {
            
            SRCCOPY = 0x00CC0020,
            
            SRCPAINT = 0x00EE0086,
            
            SRCAND = 0x008800C6,
            
            SRCINVERT = 0x00660046,
            
            SRCERASE = 0x00440328,
            
            NOTSRCCOPY = 0x00330008,
            
            NOTSRCERASE = 0x001100A6,
            
            MERGECOPY = 0x00C000CA,
            
            MERGEPAINT = 0x00BB0226,
            
            PATCOPY = 0x00F00021,
            
            PATPAINT = 0x00FB0A09,
            
            PATINVERT = 0x005A0049,
            
            DSTINVERT = 0x00550009,
            
            BLACKNESS = 0x00000042,
            
            WHITENESS = 0x00FF0062,
            
            
            
            
            CAPTUREBLT = 0x40000000
        }
    }

}

