From bafb101b7a83728c20feefde936ed8210e24d9b1 Mon Sep 17 00:00:00 2001 From: Benjamin Pollack Date: Sat, 7 Jan 2017 20:52:01 -0500 Subject: [PATCH] windows; add functions to determine DPI scaling --- basis/windows/shcore/authors.txt | 1 + basis/windows/shcore/platforms.txt | 1 + basis/windows/shcore/shcore.factor | 14 ++++++++++++++ basis/windows/shcore/tags.txt | 1 + basis/windows/user32/user32.factor | 2 +- basis/windows/windows.factor | 1 + factor.exe.manifest | 12 ++++++++++++ 7 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 basis/windows/shcore/authors.txt create mode 100644 basis/windows/shcore/platforms.txt create mode 100644 basis/windows/shcore/shcore.factor create mode 100644 basis/windows/shcore/tags.txt create mode 100644 factor.exe.manifest diff --git a/basis/windows/shcore/authors.txt b/basis/windows/shcore/authors.txt new file mode 100644 index 0000000000..156fc8269d --- /dev/null +++ b/basis/windows/shcore/authors.txt @@ -0,0 +1 @@ +Benjamin Pollack diff --git a/basis/windows/shcore/platforms.txt b/basis/windows/shcore/platforms.txt new file mode 100644 index 0000000000..8e1a55995e --- /dev/null +++ b/basis/windows/shcore/platforms.txt @@ -0,0 +1 @@ +windows diff --git a/basis/windows/shcore/shcore.factor b/basis/windows/shcore/shcore.factor new file mode 100644 index 0000000000..63f58ae5f1 --- /dev/null +++ b/basis/windows/shcore/shcore.factor @@ -0,0 +1,14 @@ +! Copyright (C) 2017 Benjamin Pollack. +! See http://factorcode.org/license.txt for BSD license. +USING: alien.syntax windows.types ; +IN: windows.shcore + +LIBRARY: shcore + +ENUM: MONITOR_DPI_TYPE + MDT_EFFECTIVE_DPI + MDT_ANGULAR_DPI + MDT_RAW_DPI + { MDT_DEFAULT 0 } ; + +FUNCTION: HRESULT GetDpiForMonitor ( HMONITOR hMonitor, MONITOR_DPI_TYPE dpiType, UINT* dpiX, UINT *dpiY ) diff --git a/basis/windows/shcore/tags.txt b/basis/windows/shcore/tags.txt new file mode 100644 index 0000000000..bb863cf9a0 --- /dev/null +++ b/basis/windows/shcore/tags.txt @@ -0,0 +1 @@ +bindings diff --git a/basis/windows/user32/user32.factor b/basis/windows/user32/user32.factor index e57d9a566c..1b8a133687 100644 --- a/basis/windows/user32/user32.factor +++ b/basis/windows/user32/user32.factor @@ -1898,7 +1898,7 @@ ALIAS: MessageBoxEx MessageBoxExW ! FUNCTION: ModifyMenuA ! FUNCTION: ModifyMenuW -! FUNCTION: MonitorFromPoint +FUNCTION: HMONITOR MonitorFromPoint ( POINT pt, DWORD dwFlags ) ! FUNCTION: MonitorFromRect FUNCTION: HMONITOR MonitorFromWindow ( HWND hWnd, DWORD dwFlags ) ! FUNCTION: mouse_event diff --git a/basis/windows/windows.factor b/basis/windows/windows.factor index 47123f60a4..938ceae370 100644 --- a/basis/windows/windows.factor +++ b/basis/windows/windows.factor @@ -20,6 +20,7 @@ CONSTANT: MAX_UNICODE_PATH 32768 { "gl" "opengl32.dll" stdcall } { "glu" "glu32.dll" stdcall } { "ole32" "ole32.dll" stdcall } + { "shcore" "shcore.dll" stdcall } { "usp10" "usp10.dll" stdcall } { "psapi" "psapi.dll" stdcall } { "winmm" "winmm.dll" stdcall } diff --git a/factor.exe.manifest b/factor.exe.manifest new file mode 100644 index 0000000000..42ade3e48d --- /dev/null +++ b/factor.exe.manifest @@ -0,0 +1,12 @@ + + + + + + True/PM + + + -- 2.34.1