Compare commits

...

7 Commits

Author SHA1 Message Date
Doug Coleman 40ef5594cb windows.screens: Add word to get dpi on Windows. 2018-03-14 13:02:42 -05:00
Doug Coleman ef0f56e4b7 cpu-x86: Properly ignore unused parameters. 2018-03-14 13:01:21 -05:00
Doug Coleman 32795ecf03 Nmakefile: Use the manifest file.
Use the :: feature because there is a race condition if ``link`` and
``mt`` are used in a single rule (on my machine).

This unfortunately causes ``mt`` to run if ``nmake`` is invoked twice in
a row, but I don't see a way around it right now.
2018-03-14 11:36:14 -05:00
Doug Coleman 0f796b922b windows.shcore: Stub all the functions in shcore.dll 2018-03-13 21:48:08 -05:00
Doug Coleman 81ff054785 fjsc: line endings. 2018-03-13 14:50:23 -05:00
Doug Coleman 4785479ea0 Merge branch 'master' of factorcode.org:/git/factor 2018-03-13 14:49:26 -05:00
Benjamin Pollack 56a1ecc0cb windows; add functions to determine DPI scaling 2018-03-13 12:11:56 -05:00
16 changed files with 1187 additions and 1044 deletions

View File

@ -132,11 +132,19 @@ libfactor-ffi-test.dll: vm/ffi_test.obj
factor.dll.lib: $(DLL_OBJS)
link $(LINK_FLAGS) /implib:factor.dll.lib /out:factor.dll /dll $(DLL_OBJS)
factor.com: $(EXE_OBJS) $(DLL_OBJS)
# If we ``link`` factor.com and then ``mt`` it in the same rule (for retina support)
# then factor.com is still open and ``mt`` fails
# sleep hack fixes it...
factor.com :: $(EXE_OBJS) $(DLL_OBJS)
link $(LINK_FLAGS) /out:factor.com /SUBSYSTEM:$(SUBSYSTEM_COM_FLAGS) $(EXE_OBJS) $(DLL_OBJS)
factor.com ::
mt -manifest factor.exe.manifest -outputresource:factor.com;#1
factor.exe: $(EXE_OBJS) $(DLL_OBJS)
factor.exe :: $(EXE_OBJS) $(DLL_OBJS)
link $(LINK_FLAGS) /out:factor.exe /SUBSYSTEM:$(SUBSYSTEM_EXE_FLAGS) $(EXE_OBJS) $(DLL_OBJS)
factor.exe ::
mt -manifest factor.exe.manifest -outputresource:factor.exe;#1
all: factor.com factor.exe factor.dll.lib libfactor-ffi-test.dll

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1 @@
windows

View File

@ -0,0 +1,11 @@
! Copyright (C) 2018 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types alien.data arrays classes.struct kernel
windows.errors windows.shcore windows.types windows.user32 ;
IN: windows.screens
: get-dpi ( -- dpi )
0 0 POINT <struct-boa> 0 MonitorFromPoint
MDT_EFFECTIVE_DPI
0 uint <ref> 0 uint <ref> [ GetDpiForMonitor win32-error=0/f ] 2keep
[ uint deref ] bi@ 2array ;

View File

@ -0,0 +1 @@
Benjamin Pollack

View File

@ -0,0 +1 @@
windows

View File

@ -0,0 +1,103 @@
! Copyright (C) 2017 Benjamin Pollack, Doug Coleman.
! 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 } ;
! CommandLineToArgvW
! CreateRandomAccessStreamOnFile
! CreateRandomAccessStreamOverStream
! CreateStreamOverRandomAccessStream
! DllCanUnloadNow
! DllGetActivationFactory
! DllGetClassObject
! GetCurrentProcessExplicitAppUserModelID
FUNCTION: HRESULT GetDpiForMonitor ( HMONITOR hMonitor, MONITOR_DPI_TYPE dpiType, UINT* dpiX, UINT *dpiY )
! GetDpiForShellUIComponent
! GetFeatureEnabledState
! GetFeatureVariant
! GetProcessDpiAwareness
! GetProcessReference
! GetScaleFactorForDevice
! GetScaleFactorForMonitor
! IsOS
! IsProcessInIsolatedContainer
! IStream_Copy
! IStream_Read
! IStream_ReadStr
! IStream_Reset
! IStream_Size
! IStream_Write
! IStream_WriteStr
! IUnknown_AtomicRelease
! IUnknown_GetSite
! IUnknown_QueryService
! IUnknown_Set
! IUnknown_SetSite
! RecordFeatureError
! RecordFeatureUsage
! RegisterScaleChangeEvent
! RegisterScaleChangeNotifications
! RevokeScaleChangeNotifications
! SetCurrentProcessExplicitAppUserModelID
! SetProcessDpiAwareness
! SetProcessReference
! SHAnsiToAnsi
! SHAnsiToUnicode
! SHCopyKeyA
! SHCopyKeyW
! SHCreateMemStream
! SHCreateStreamOnFileA
! SHCreateStreamOnFileEx
! SHCreateStreamOnFileW
! SHCreateThread
! SHCreateThreadRef
! SHCreateThreadWithHandle
! SHDeleteEmptyKeyA
! SHDeleteEmptyKeyW
! SHDeleteKeyA
! SHDeleteKeyW
! SHDeleteValueA
! SHDeleteValueW
! SHEnumKeyExA
! SHEnumKeyExW
! SHEnumValueA
! SHEnumValueW
! SHGetThreadRef
! SHGetValueA
! SHGetValueW
! SHOpenRegStream2A
! SHOpenRegStream2W
! SHOpenRegStreamA
! SHOpenRegStreamW
! SHQueryInfoKeyA
! SHQueryInfoKeyW
! SHQueryValueExA
! SHQueryValueExW
! SHRegDuplicateHKey
! SHRegGetIntW
! SHRegGetPathA
! SHRegGetPathW
! SHRegGetValueA
! SHRegGetValueFromHKCUHKLM
! SHRegGetValueW
! SHRegSetPathA
! SHRegSetPathW
! SHReleaseThreadRef
! SHSetThreadRef
! SHSetValueA
! SHSetValueW
! SHStrDupA
! SHStrDupW
! SHUnicodeToAnsi
! SHUnicodeToUnicode
! SubscribeFeatureStateChangeNotification
! UnregisterScaleChangeEvent
! UnsubscribeFeatureStateChangeNotification

View File

@ -0,0 +1 @@
bindings

View File

@ -1788,7 +1788,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

View File

@ -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 }

12
factor.exe.manifest Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32"
name="factor"
version="0.9.8.0"
/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
</windowsSettings>
</application>
</assembly>

View File

@ -3,7 +3,10 @@ namespace factor {
#define CALLSTACK_BOTTOM(ctx) \
(ctx->callstack_seg->end - sizeof(cell) * 5)
inline static void flush_icache(cell start, cell len) {}
inline static void flush_icache(cell start, cell len) {
(void)start;
(void)len;
}
// In the instruction sequence: