1 /* NetHack 3.7	win10.h	$NHDT-Date: 1596498319 2020/08/03 23:45:19 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.8 $ */
2 /* Copyright (C) 2018 by Bart House 	 */
3 /* NetHack may be freely redistributed.  See license for details. */
4 
5 #ifndef WIN10_H
6 #define WIN10_H
7 
8 #include "win32api.h"
9 
10 #ifdef __MINGW32__
11 #ifndef DECLARE_HANDLE
12 #define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name
13 #endif
14 DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
15 
16 /* DPI awareness */
17 typedef enum DPI_AWARENESS
18 {
19     DPI_AWARENESS_INVALID = -1,
20     DPI_AWARENESS_UNAWARE = 0,
21     DPI_AWARENESS_SYSTEM_AWARE,
22     DPI_AWARENESS_PER_MONITOR_AWARE
23 } DPI_AWARENESS;
24 
25 #define DPI_AWARENESS_CONTEXT_UNAWARE              ((DPI_AWARENESS_CONTEXT)-1)
26 #define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE         ((DPI_AWARENESS_CONTEXT)-2)
27 #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE    ((DPI_AWARENESS_CONTEXT)-3)
28 #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
29 #define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    ((DPI_AWARENESS_CONTEXT)-5)
30 #endif
31 
32 typedef struct {
33     double  scale;  // dpi of monitor / 96
34     int     width;  // in pixels
35     int     height; // in pixels
36     int     top; // in desktop coordinate pixel space
37     int     left; // in desktop coordinate pixel space
38 } MonitorInfo;
39 
40 void win10_init();
41 int win10_monitor_dpi(HWND hWnd);
42 double win10_monitor_scale(HWND hWnd);
43 void win10_monitor_info(HWND hWnd, MonitorInfo * monitorInfo);
44 BOOL win10_is_desktop_bridge_application(void);
45 
46 #endif // WIN10_H
47