Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for dwmapi and ANIMATIONINFO #329

Merged
merged 5 commits into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/dwmapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ extern "system" {
// pub fn DwmGetGraphicsStreamClient();
// pub fn DwmGetGraphicsStreamTransformHint();
// pub fn DwmGetTransportAttributes();
// pub fn DwmGetWindowAttribute();
pub fn DwmGetWindowAttribute(hWnd: HWND, dwAttribute: DWORD, pvAttribute: LPVOID,
cbAttribute: DWORD) -> HRESULT;
// pub fn DwmInvalidateIconicBitmaps();
// pub fn DwmIsCompositionEnabled();
// pub fn DwmModifyPreviousDxFrameDuration();
Expand Down
4 changes: 2 additions & 2 deletions lib/shcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
extern crate winapi;
use winapi::*;
extern "system" {
pub fn GetDpiForMonitor(hmonitor: HMONITOR, dpiType: MONITOR_DPI_TYPE, dpiX: *UINT, dpiY: *UINT) -> HRESULT
pub fn GetDpiForMonitor(hmonitor: HMONITOR, dpiType: MONITOR_DPI_TYPE, dpiX: *mut UINT, dpiY: *mut UINT) -> HRESULT;
pub fn GetDpiForShellUiComponent(component: SHELL_UI_COMPONENT) -> UINT;
pub fn GetProcessDPIAwareness(hProcess: HANDLE, value: *PROCESS_DPI_AWARENESS) -> HRESULT;
pub fn GetProcessDPIAwareness(hProcess: HANDLE, value: *mut PROCESS_DPI_AWARENESS) -> HRESULT;
pub fn SetProcessDPIAwareness(value: PROCESS_DPI_AWARENESS) -> HRESULT;
pub fn LogicalToPhysicalPointForPerMonitorDPI(hwnd: HWND, lpPoint: LPPOINT) -> BOOL;
pub fn PhysicalToLogicalPointForPerMonitorDPI(hwnd: HWND, lpPoint: LPPOINT) -> BOOL;
Expand Down
17 changes: 17 additions & 0 deletions src/um/dwmapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,20 @@ STRUCT!{struct DWM_BLURBEHIND {
hRgnBlur: HRGN,
fTransitionOnMaximized: BOOL,
}}

pub const DWMWA_NCRENDERING_ENABLED: DWORD = 1;
pub const DWMWA_NCRENDERING_POLICY: DWORD = 2;
pub const DWMWA_TRANSITIONS_FORCEDISABLED: DWORD = 2;
pub const DWMWA_ALLOW_NCPAINT: DWORD = 4;
pub const DWMWA_CAPTION_BUTTON_BOUNDS: DWORD = 5;
pub const DWMWA_NONCLIENT_RTL_LAYOUT: DWORD = 6;
pub const DWMWA_FORCE_ICONIC_REPRESENTATION: DWORD = 7;
pub const DWMWA_FLIP3D_POLICY: DWORD = 8;
pub const DWMWA_EXTENDED_FRAME_BOUNDS: DWORD = 9;
pub const DWMWA_HAS_ICONIC_BITMAP: DWORD = 10;
pub const DWMWA_DISALLOW_PEEK: DWORD = 11;
pub const DWMWA_EXCLUDED_FROM_PEEK: DWORD = 12;
pub const DWMWA_CLOAK: DWORD = 13;
pub const DWMWA_CLOAKED: DWORD = 14;
pub const DWMWA_FREEZE_REPRESENTATION: DWORD = 15;
pub const DWMWA_LAST: DWORD = 16;
5 changes: 5 additions & 0 deletions src/um/wingdi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,3 +1249,8 @@ pub const META_CREATEPENINDIRECT: WORD = 0x02FA;
pub const META_CREATEFONTINDIRECT: WORD = 0x02FB;
pub const META_CREATEBRUSHINDIRECT: WORD = 0x02FC;
pub const META_CREATEREGION: WORD = 0x06FF;
pub const ERROR: c_int = 0;
pub const NULLREGION: c_int = 1;
pub const SIMPLEREGION: c_int = 2;
pub const COMPLEXREGION: c_int = 3;
pub const RGN_ERROR: c_int = ERROR;
10 changes: 10 additions & 0 deletions src/um/winuser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2444,3 +2444,13 @@ pub const TPM_VERNEGANIMATION: UINT = 0x2000;
pub const TPM_NOANIMATION: UINT = 0x4000;
pub const TPM_LAYOUTRTL: UINT = 0x8000;
pub const TPM_WORKAREA: UINT = 0x10000;

// ANIMATIONINFO and related fields
STRUCT!{struct ANIMATIONINFO {
cbSize: UINT,
iMinAnimate: c_int,
}}
pub type LPANIMATIONINFO = *mut ANIMATIONINFO;
pub const SPIF_UPDATEINIFILE: UINT = 0x0001;
pub const SPIF_SENDWININICHANGE: UINT = 0x0002;
pub const SPIF_SENDCHANGE: UINT = SPIF_SENDWININICHANGE;