package com.danitheskunk.skunkworks.os.windows;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.win32.W32APIOptions;

@SuppressWarnings("UnusedReturnValue")
public interface Dwm extends Library {
	WinDef.DWORD DWMWA_ALLOW_NCPAINT = new WinDef.DWORD(4);
	WinDef.DWORD DWMWA_CAPTION_BUTTON_BOUNDS = new WinDef.DWORD(5);
	WinDef.DWORD DWMWA_CLOAK = new WinDef.DWORD(13);
	WinDef.DWORD DWMWA_CLOAKED = new WinDef.DWORD(14);
	WinDef.DWORD DWMWA_DISALLOW_PEEK = new WinDef.DWORD(11);
	WinDef.DWORD DWMWA_EXCLUDED_FROM_PEEK = new WinDef.DWORD(12);
	WinDef.DWORD DWMWA_EXTENDED_FRAME_BOUNDS = new WinDef.DWORD(9);
	WinDef.DWORD DWMWA_FLIP3D_POLICY = new WinDef.DWORD(8);
	WinDef.DWORD DWMWA_FORCE_ICONIC_REPRESENTATION = new WinDef.DWORD(7);
	WinDef.DWORD DWMWA_FREEZE_REPRESENTATION = new WinDef.DWORD(15);
	WinDef.DWORD DWMWA_HAS_ICONIC_BITMAP = new WinDef.DWORD(10);
	WinDef.DWORD DWMWA_LAST = new WinDef.DWORD(16);
	WinDef.DWORD DWMWA_NCRENDERING_ENABLED = new WinDef.DWORD(1);
	WinDef.DWORD DWMWA_NCRENDERING_POLICY = new WinDef.DWORD(2);
	WinDef.DWORD DWMWA_NONCLIENT_RTL_LAYOUT = new WinDef.DWORD(6);
	WinDef.DWORD DWMWA_TRANSITIONS_FORCEDISABLED = new WinDef.DWORD(3);
	WinDef.DWORD DWMWA_WINDOW_CORNER_PREFERENCE = new WinDef.DWORD(33);
	WinDef.DWORD DWMWCP_DEFAULT = new WinDef.DWORD(0);
	//todo: fix/complete DWMWA list
	WinDef.DWORD DWMWCP_DONOTROUND = new WinDef.DWORD(1);
	WinDef.DWORD DWMWCP_ROUND = new WinDef.DWORD(2);
	WinDef.DWORD DWMWCP_ROUNDSMALL = new WinDef.DWORD(3);
	Dwm INSTANCE = Native.load("dwmapi",
		Dwm.class,
		W32APIOptions.DEFAULT_OPTIONS
	);

	WinNT.HRESULT DwmExtendFrameIntoClientArea(
		WinDef.HWND hwnd, MARGINS pMarInset
	);

	WinNT.HRESULT DwmGetWindowAttribute(
		WinDef.HWND hwnd, WinDef.DWORD dwAttribute, Pointer pvAttribute,
		WinDef.DWORD cbAttribute
	);

	WinNT.HRESULT DwmSetWindowAttribute(
		WinDef.HWND hwnd, WinDef.DWORD dwAttribute, Pointer pvAttribute,
		WinDef.DWORD cbAttribute
	);
}
