1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Basic Windows Type Definitions
7 use ctypes::c_void;
8 use shared::minwindef::{DWORD, HFILE, WORD};
9 use um::winnt::{LONG, SHORT};
10 DECLARE_HANDLE!{HWND, HWND__}
11 DECLARE_HANDLE!{HHOOK, HHOOK__}
12 pub type HGDIOBJ = *mut c_void;
13 DECLARE_HANDLE!{HACCEL, HACCEL__}
14 DECLARE_HANDLE!{HBITMAP, HBITMAP__}
15 DECLARE_HANDLE!{HBRUSH, HBRUSH__}
16 DECLARE_HANDLE!{HCOLORSPACE, HCOLORSPACE__}
17 DECLARE_HANDLE!{HDC, HDC__}
18 DECLARE_HANDLE!{HGLRC, HGLRC__}
19 DECLARE_HANDLE!{HDESK, HDESK__}
20 DECLARE_HANDLE!{HENHMETAFILE, HENHMETAFILE__}
21 DECLARE_HANDLE!{HFONT, HFONT__}
22 DECLARE_HANDLE!{HICON, HICON__}
23 DECLARE_HANDLE!{HMENU, HMENU__}
24 DECLARE_HANDLE!{HPALETTE, HPALETTE__}
25 DECLARE_HANDLE!{HPEN, HPEN__}
26 DECLARE_HANDLE!{HWINEVENTHOOK, HWINEVENTHOOK__}
27 DECLARE_HANDLE!{HMONITOR, HMONITOR__}
28 DECLARE_HANDLE!{HUMPD, HUMPD__}
29 pub type HCURSOR = HICON;
30 pub type COLORREF = DWORD;
31 pub type LPCOLORREF = *mut DWORD;
32 pub const HFILE_ERROR: HFILE = -1;
33 STRUCT!{#[debug] struct RECT {
34     left: LONG,
35     top: LONG,
36     right: LONG,
37     bottom: LONG,
38 }}
39 pub type PRECT = *mut RECT;
40 pub type NPRECT = *mut RECT;
41 pub type LPRECT = *mut RECT;
42 pub type LPCRECT = *const RECT;
43 STRUCT!{#[debug] struct RECTL {
44     left: LONG,
45     top: LONG,
46     right: LONG,
47     bottom: LONG,
48 }}
49 pub type PRECTL = *mut RECTL;
50 pub type LPRECTL = *mut RECTL;
51 pub type LPCRECTL = *const RECTL;
52 STRUCT!{struct POINT {
53     x: LONG,
54     y: LONG,
55 }}
56 pub type PPOINT = *mut POINT;
57 pub type NPPOINT = *mut POINT;
58 pub type LPPOINT = *mut POINT;
59 STRUCT!{struct POINTL {
60     x: LONG,
61     y: LONG,
62 }}
63 pub type PPOINTL = *mut POINTL;
64 STRUCT!{struct SIZE {
65     cx: LONG,
66     cy: LONG,
67 }}
68 pub type PSIZE = *mut SIZE;
69 pub type LPSIZE = *mut SIZE;
70 pub type SIZEL = SIZE;
71 pub type PSIZEL = *mut SIZE;
72 pub type LPSIZEL = *mut SIZE;
73 STRUCT!{struct POINTS {
74     x: SHORT,
75     y: SHORT,
76 }}
77 pub type PPOINTS = *mut POINTS;
78 pub type LPPOINTS = *mut POINTS;
79 pub const DM_UPDATE: WORD = 1;
80 pub const DM_COPY: WORD = 2;
81 pub const DM_PROMPT: WORD = 4;
82 pub const DM_MODIFY: WORD = 8;
83 pub const DM_IN_BUFFER: WORD = DM_MODIFY;
84 pub const DM_IN_PROMPT: WORD = DM_PROMPT;
85 pub const DM_OUT_BUFFER: WORD = DM_COPY;
86 pub const DM_OUT_DEFAULT: WORD = DM_UPDATE;
87 pub const DC_FIELDS: DWORD = 1;
88 pub const DC_PAPERS: DWORD = 2;
89 pub const DC_PAPERSIZE: DWORD = 3;
90 pub const DC_MINEXTENT: DWORD = 4;
91 pub const DC_MAXEXTENT: DWORD = 5;
92 pub const DC_BINS: DWORD = 6;
93 pub const DC_DUPLEX: DWORD = 7;
94 pub const DC_SIZE: DWORD = 8;
95 pub const DC_EXTRA: DWORD = 9;
96 pub const DC_VERSION: DWORD = 10;
97 pub const DC_DRIVER: DWORD = 11;
98 pub const DC_BINNAMES: DWORD = 12;
99 pub const DC_ENUMRESOLUTIONS: DWORD = 13;
100 pub const DC_FILEDEPENDENCIES: DWORD = 14;
101 pub const DC_TRUETYPE: DWORD = 15;
102 pub const DC_PAPERNAMES: DWORD = 16;
103 pub const DC_ORIENTATION: DWORD = 17;
104 pub const DC_COPIES: DWORD = 18;
105 DECLARE_HANDLE!{DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT__}
106 ENUM!{enum DPI_AWARENESS {
107     DPI_AWARENESS_INVALID = -1i32 as u32,
108     DPI_AWARENESS_UNAWARE = 0,
109     DPI_AWARENESS_SYSTEM_AWARE = 1,
110     DPI_AWARENESS_PER_MONITOR_AWARE = 2,
111 }}
112 pub const DPI_AWARENESS_CONTEXT_UNAWARE: DPI_AWARENESS_CONTEXT = -1isize as DPI_AWARENESS_CONTEXT;
113 pub const DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: DPI_AWARENESS_CONTEXT
114     = -2isize as DPI_AWARENESS_CONTEXT;
115 pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: DPI_AWARENESS_CONTEXT
116     = -3isize as DPI_AWARENESS_CONTEXT;
117 pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2: DPI_AWARENESS_CONTEXT
118     = -4isize as DPI_AWARENESS_CONTEXT;
119 pub const DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED: DPI_AWARENESS_CONTEXT
120     = -5isize as DPI_AWARENESS_CONTEXT;
121 ENUM!{enum DPI_HOSTING_BEHAVIOR {
122     DPI_HOSTING_BEHAVIOR_INVALID = -1i32 as u32,
123     DPI_HOSTING_BEHAVIOR_DEFAULT = 0,
124     DPI_HOSTING_BEHAVIOR_MIXED = 1,
125 }}
126