Skip to content

Commit

Permalink
Add new APIs from Windows SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Boddlnagg committed Sep 10, 2018
1 parent c670403 commit 716084c
Show file tree
Hide file tree
Showing 18 changed files with 17,927 additions and 6,603 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "winrt"
version = "0.5.0"
version = "0.5.1"
authors = ["Patrick Reisert", "Max Strini"]
description = "Automatically generated, (mostly) safe bindings for the Windows Runtime APIs"
repository = "https://github.com/contextfree/winrt-rust"
Expand All @@ -18,6 +18,7 @@ winapi = { version = "0.3", features = ["winnt", "combaseapi", "oleauto", "roapi
[features]
nightly = []
lang-compat = []
windows-ai = []
windows-applicationmodel = []
windows-data = []
windows-devices = []
Expand All @@ -35,7 +36,7 @@ windows-system = []
windows-ui = []
windows-ui-xaml = ["windows-ui"]
windows-web = []
all = ["windows-applicationmodel", "windows-data", "windows-devices", "windows-gaming",
all = ["windows-ai", "windows-applicationmodel", "windows-data", "windows-devices", "windows-gaming",
"windows-globalization", "windows-graphics", "windows-management", "windows-media",
"windows-networking", "windows-perception", "windows-security", "windows-services",
"windows-storage", "windows-system", "windows-ui", "windows-ui-xaml", "windows-web"]
Expand Down
363 changes: 363 additions & 0 deletions src/rt/gen/windows/ai.rs

Large diffs are not rendered by default.

6,660 changes: 3,685 additions & 2,975 deletions src/rt/gen/windows/applicationmodel.rs

Large diffs are not rendered by default.

8,339 changes: 4,749 additions & 3,590 deletions src/rt/gen/windows/devices.rs

Large diffs are not rendered by default.

184 changes: 184 additions & 0 deletions src/rt/gen/windows/foundation.rs

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions src/rt/gen/windows/globalization.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use ::prelude::*;
RT_CLASS!{static class ApplicationLanguages}
impl RtActivatable<IApplicationLanguagesStatics> for ApplicationLanguages {}
impl RtActivatable<IApplicationLanguagesStatics2> for ApplicationLanguages {}
impl ApplicationLanguages {
#[inline] pub fn get_primary_language_override() -> Result<HString> {
<Self as RtActivatable<IApplicationLanguagesStatics>>::get_activation_factory().get_primary_language_override()
Expand All @@ -14,6 +15,9 @@ impl ApplicationLanguages {
#[inline] pub fn get_manifest_languages() -> Result<Option<ComPtr<foundation::collections::IVectorView<HString>>>> {
<Self as RtActivatable<IApplicationLanguagesStatics>>::get_activation_factory().get_manifest_languages()
}
#[cfg(feature="windows-system")] #[inline] pub fn get_languages_for_user(user: &super::system::User) -> Result<Option<ComPtr<foundation::collections::IVectorView<HString>>>> {
<Self as RtActivatable<IApplicationLanguagesStatics2>>::get_activation_factory().get_languages_for_user(user)
}
}
DEFINE_CLSID!(ApplicationLanguages(&[87,105,110,100,111,119,115,46,71,108,111,98,97,108,105,122,97,116,105,111,110,46,65,112,112,108,105,99,97,116,105,111,110,76,97,110,103,117,97,103,101,115,0]) [CLSID_ApplicationLanguages]);
DEFINE_IID!(IID_IApplicationLanguagesStatics, 1974732871, 2636, 19090, 149, 101, 253, 99, 201, 95, 122, 237);
Expand Down Expand Up @@ -44,6 +48,17 @@ impl IApplicationLanguagesStatics {
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
}}
}
DEFINE_IID!(IID_IApplicationLanguagesStatics2, 502324815, 1835, 19835, 143, 6, 203, 45, 180, 15, 43, 181);
RT_INTERFACE!{static interface IApplicationLanguagesStatics2(IApplicationLanguagesStatics2Vtbl): IInspectable(IInspectableVtbl) [IID_IApplicationLanguagesStatics2] {
#[cfg(feature="windows-system")] fn GetLanguagesForUser(&self, user: *mut super::system::User, out: *mut *mut foundation::collections::IVectorView<HString>) -> HRESULT
}}
impl IApplicationLanguagesStatics2 {
#[cfg(feature="windows-system")] #[inline] pub fn get_languages_for_user(&self, user: &super::system::User) -> Result<Option<ComPtr<foundation::collections::IVectorView<HString>>>> { unsafe {
let mut out = null_mut();
let hr = ((*self.lpVtbl).GetLanguagesForUser)(self as *const _ as *mut _, user as *const _ as *mut _, &mut out);
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
}}
}
DEFINE_IID!(IID_ICalendar, 3392152093, 34521, 16635, 162, 107, 212, 78, 183, 207, 8, 234);
RT_INTERFACE!{interface ICalendar(ICalendarVtbl): IInspectable(IInspectableVtbl) [IID_ICalendar] {
fn Clone(&self, out: *mut *mut Calendar) -> HRESULT,
Expand Down Expand Up @@ -2462,6 +2477,17 @@ impl Language {
}
}
DEFINE_CLSID!(Language(&[87,105,110,100,111,119,115,46,71,108,111,98,97,108,105,122,97,116,105,111,110,46,76,97,110,103,117,97,103,101,0]) [CLSID_Language]);
DEFINE_IID!(IID_ILanguage2, 1783096757, 55629, 18566, 164, 4, 165, 165, 185, 213, 180, 148);
RT_INTERFACE!{interface ILanguage2(ILanguage2Vtbl): IInspectable(IInspectableVtbl) [IID_ILanguage2] {
fn get_LayoutDirection(&self, out: *mut LanguageLayoutDirection) -> HRESULT
}}
impl ILanguage2 {
#[inline] pub fn get_layout_direction(&self) -> Result<LanguageLayoutDirection> { unsafe {
let mut out = zeroed();
let hr = ((*self.lpVtbl).get_LayoutDirection)(self as *const _ as *mut _, &mut out);
if hr == S_OK { Ok(out) } else { err(hr) }
}}
}
DEFINE_IID!(IID_ILanguageExtensionSubtags, 2105388869, 13965, 17252, 133, 43, 222, 201, 39, 3, 123, 133);
RT_INTERFACE!{interface ILanguageExtensionSubtags(ILanguageExtensionSubtagsVtbl): IInspectable(IInspectableVtbl) [IID_ILanguageExtensionSubtags] {
fn GetExtensionSubtags(&self, singleton: HSTRING, out: *mut *mut foundation::collections::IVectorView<HString>) -> HRESULT
Expand All @@ -2484,6 +2510,9 @@ impl ILanguageFactory {
if hr == S_OK { Ok(ComPtr::wrap(out)) } else { err(hr) }
}}
}
RT_ENUM! { enum LanguageLayoutDirection: i32 {
Ltr (LanguageLayoutDirection_Ltr) = 0, Rtl (LanguageLayoutDirection_Rtl) = 1, TtbLtr (LanguageLayoutDirection_TtbLtr) = 2, TtbRtl (LanguageLayoutDirection_TtbRtl) = 3,
}}
DEFINE_IID!(IID_ILanguageStatics, 2990331223, 2149, 18132, 137, 184, 213, 155, 232, 153, 15, 13);
RT_INTERFACE!{static interface ILanguageStatics(ILanguageStaticsVtbl): IInspectable(IInspectableVtbl) [IID_ILanguageStatics] {
fn IsWellFormed(&self, languageTag: HSTRING, out: *mut bool) -> HRESULT,
Expand Down
Loading

0 comments on commit 716084c

Please sign in to comment.