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