diff --git a/src/dorkbox/util/jna/windows/HBITMAPWrap.java b/src/dorkbox/util/jna/windows/HBITMAPWrap.java index d643e7c..06aaff7 100644 --- a/src/dorkbox/util/jna/windows/HBITMAPWrap.java +++ b/src/dorkbox/util/jna/windows/HBITMAPWrap.java @@ -17,6 +17,7 @@ package dorkbox.util.jna.windows; import static com.sun.jna.platform.win32.WinDef.HBITMAP; import static com.sun.jna.platform.win32.WinDef.HDC; +import static dorkbox.util.jna.windows.User32.User32; import java.awt.AlphaComposite; import java.awt.Graphics2D; @@ -34,7 +35,7 @@ public class HBITMAPWrap extends HBITMAP { HBITMAP createBitmap(BufferedImage image) { int w = image.getWidth(null); int h = image.getHeight(null); - HDC screenDC = User32.IMPL.GetDC(null); + HDC screenDC = User32.GetDC(null); HDC memDC = GDI32.CreateCompatibleDC(screenDC); HBITMAP hBitmap = null; @@ -72,7 +73,7 @@ public class HBITMAPWrap extends HBITMAP { pbits.write(0, bits, 0, bits.length); return hBitmap; } finally { - User32.IMPL.ReleaseDC(null, screenDC); + User32.ReleaseDC(null, screenDC); GDI32.DeleteDC(memDC); } } diff --git a/src/dorkbox/util/jna/windows/HICONWrap.java b/src/dorkbox/util/jna/windows/HICONWrap.java index 8e777d4..b52d02a 100644 --- a/src/dorkbox/util/jna/windows/HICONWrap.java +++ b/src/dorkbox/util/jna/windows/HICONWrap.java @@ -17,6 +17,7 @@ package dorkbox.util.jna.windows; import static com.sun.jna.platform.win32.WinDef.HBITMAP; import static com.sun.jna.platform.win32.WinDef.HICON; +import static dorkbox.util.jna.windows.User32.User32; import com.sun.jna.Pointer; @@ -33,7 +34,7 @@ public class HICONWrap extends HICON { info.MaskBitmap = bm; info.ColorBitmap = bm; - HICON hicon = User32.IMPL.CreateIconIndirect(info); + HICON hicon = User32.CreateIconIndirect(info); if (hicon == null) { throw new GetLastErrorException(); } diff --git a/src/dorkbox/util/jna/windows/User32.java b/src/dorkbox/util/jna/windows/User32.java index 3408cfc..ab23851 100644 --- a/src/dorkbox/util/jna/windows/User32.java +++ b/src/dorkbox/util/jna/windows/User32.java @@ -36,7 +36,7 @@ import dorkbox.util.jna.windows.structs.ICONINFO; @SuppressWarnings("WeakerAccess") public interface User32 { - User32 IMPL = OS.is64bit() ? new User32_64() : new User32_32(); + User32 User32 = OS.is64bit() ? new User32_64() : new User32_32(); int GWL_WNDPROC = -4; diff --git a/src/dorkbox/util/jna/windows/WindowsEventDispatch.java b/src/dorkbox/util/jna/windows/WindowsEventDispatch.java index 2f3d99d..78f613d 100644 --- a/src/dorkbox/util/jna/windows/WindowsEventDispatch.java +++ b/src/dorkbox/util/jna/windows/WindowsEventDispatch.java @@ -20,6 +20,7 @@ import static com.sun.jna.platform.win32.WinDef.LPARAM; import static com.sun.jna.platform.win32.WinDef.LRESULT; import static com.sun.jna.platform.win32.WinDef.WPARAM; import static com.sun.jna.platform.win32.WinUser.WM_QUIT; +import static dorkbox.util.jna.windows.User32.User32; import java.util.ArrayList; import java.util.HashMap; @@ -39,7 +40,7 @@ class WindowsEventDispatch implements Runnable { private static final String NAME = "WindowsEventDispatch"; - public static final int WM_TASKBARCREATED = User32.IMPL.RegisterWindowMessage(new WString("TaskbarCreated")); + public static final int WM_TASKBARCREATED = User32.RegisterWindowMessage(new WString("TaskbarCreated")); public static final int WM_COMMAND = 0x0111; public static final int WM_SHELLNOTIFY = WinUser.WM_USER + 1; public static final int WM_MEASUREITEM = 44; @@ -110,7 +111,7 @@ class WindowsEventDispatch implements Runnable { // always from inside lock! private void stop_() { - User32.IMPL.SendMessage(hWnd, WM_QUIT, new WPARAM(0), new LPARAM(0)); + User32.SendMessage(hWnd, WM_QUIT, new WPARAM(0), new LPARAM(0)); try { // wait for the dispatch thread to quit (but only if we are not on the dispatch thread) @@ -175,30 +176,30 @@ class WindowsEventDispatch implements Runnable { } } - return User32.IMPL.DefWindowProc(hWnd, msg, wParam, lParam); + return User32.DefWindowProc(hWnd, msg, wParam, lParam); } }; - hWnd = User32.IMPL.CreateWindowEx(0, "STATIC", NAME, 0, 0, 0, 0, 0, null, null, null, - null); + hWnd = User32.CreateWindowEx(0, "STATIC", NAME, 0, 0, 0, 0, 0, null, null, null, + null); if (hWnd == null) { throw new GetLastErrorException(); } - User32.IMPL.SetWindowLong(hWnd, User32.GWL_WNDPROC, WndProc); + User32.SetWindowLong(hWnd, User32.GWL_WNDPROC, WndProc); synchronized (lock) { lock.notifyAll(); } MSG msg = new MSG(); - while (User32.IMPL.GetMessage(msg, null, 0, 0)) { - User32.IMPL.TranslateMessage(msg); - User32.IMPL.DispatchMessage(msg); + while (User32.GetMessage(msg, null, 0, 0)) { + User32.TranslateMessage(msg); + User32.DispatchMessage(msg); } if (hWnd != null) { - if (!User32.IMPL.DestroyWindow(hWnd)) { + if (!User32.DestroyWindow(hWnd)) { throw new GetLastErrorException(); } hWnd = null;