|
5 | 5 | #[cfg(feature = "v2_66")] |
6 | 6 | #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] |
7 | 7 | use crate::FileSetContentsFlags; |
| 8 | +#[cfg(windows)] |
| 9 | +#[cfg_attr(docsrs, doc(cfg(windows)))] |
| 10 | +use crate::Win32OSType; |
8 | 11 | use crate::{ |
9 | 12 | translate::*, Bytes, ChecksumType, Error, FileTest, FormatSizeFlags, Pid, Source, SpawnFlags, |
10 | 13 | UserDirectory, |
@@ -969,71 +972,49 @@ pub fn uuid_string_random() -> crate::GString { |
969 | 972 | unsafe { from_glib_full(ffi::g_uuid_string_random()) } |
970 | 973 | } |
971 | 974 |
|
972 | | -//#[doc(alias = "g_win32_check_windows_version")] |
973 | | -//pub fn win32_check_windows_version(major: i32, minor: i32, spver: i32, os_type: /*Ignored*/Win32OSType) -> bool { |
974 | | -// unsafe { TODO: call ffi:g_win32_check_windows_version() } |
975 | | -//} |
| 975 | +#[cfg(windows)] |
| 976 | +#[cfg_attr(docsrs, doc(cfg(windows)))] |
| 977 | +#[doc(alias = "g_win32_check_windows_version")] |
| 978 | +pub fn win32_check_windows_version( |
| 979 | + major: i32, |
| 980 | + minor: i32, |
| 981 | + spver: i32, |
| 982 | + os_type: Win32OSType, |
| 983 | +) -> bool { |
| 984 | + unsafe { |
| 985 | + from_glib(ffi::g_win32_check_windows_version( |
| 986 | + major, |
| 987 | + minor, |
| 988 | + spver, |
| 989 | + os_type.into_glib(), |
| 990 | + )) |
| 991 | + } |
| 992 | +} |
976 | 993 |
|
| 994 | +#[cfg(windows)] |
| 995 | +#[cfg_attr(docsrs, doc(cfg(windows)))] |
977 | 996 | #[doc(alias = "g_win32_error_message")] |
978 | 997 | pub fn win32_error_message(error: i32) -> crate::GString { |
979 | 998 | unsafe { from_glib_full(ffi::g_win32_error_message(error)) } |
980 | 999 | } |
981 | 1000 |
|
982 | | -#[doc(alias = "g_win32_ftruncate")] |
983 | | -pub fn win32_ftruncate(f: i32, size: u32) -> i32 { |
984 | | - unsafe { ffi::g_win32_ftruncate(f, size) } |
985 | | -} |
986 | | - |
| 1001 | +#[cfg(windows)] |
| 1002 | +#[cfg_attr(docsrs, doc(cfg(windows)))] |
987 | 1003 | #[doc(alias = "g_win32_get_command_line")] |
988 | 1004 | pub fn win32_get_command_line() -> Vec<crate::GString> { |
989 | 1005 | unsafe { FromGlibPtrContainer::from_glib_none(ffi::g_win32_get_command_line()) } |
990 | 1006 | } |
991 | 1007 |
|
992 | | -#[doc(alias = "g_win32_get_package_installation_directory")] |
993 | | -pub fn win32_get_package_installation_directory(package: &str, dll_name: &str) -> crate::GString { |
994 | | - unsafe { |
995 | | - from_glib_full(ffi::g_win32_get_package_installation_directory( |
996 | | - package.to_glib_none().0, |
997 | | - dll_name.to_glib_none().0, |
998 | | - )) |
999 | | - } |
1000 | | -} |
1001 | | - |
1002 | | -//#[doc(alias = "g_win32_get_package_installation_directory_of_module")] |
1003 | | -//pub fn win32_get_package_installation_directory_of_module(hmodule: /*Unimplemented*/Option<Basic: Pointer>) -> crate::GString { |
1004 | | -// unsafe { TODO: call ffi:g_win32_get_package_installation_directory_of_module() } |
1005 | | -//} |
1006 | | - |
1007 | | -#[doc(alias = "g_win32_get_package_installation_subdirectory")] |
1008 | | -pub fn win32_get_package_installation_subdirectory( |
1009 | | - package: &str, |
1010 | | - dll_name: &str, |
1011 | | - subdir: &str, |
1012 | | -) -> crate::GString { |
1013 | | - unsafe { |
1014 | | - from_glib_full(ffi::g_win32_get_package_installation_subdirectory( |
1015 | | - package.to_glib_none().0, |
1016 | | - dll_name.to_glib_none().0, |
1017 | | - subdir.to_glib_none().0, |
1018 | | - )) |
1019 | | - } |
1020 | | -} |
1021 | | - |
| 1008 | +#[cfg(windows)] |
| 1009 | +#[cfg_attr(docsrs, doc(cfg(windows)))] |
1022 | 1010 | #[doc(alias = "g_win32_get_windows_version")] |
1023 | 1011 | pub fn win32_get_windows_version() -> u32 { |
1024 | 1012 | unsafe { ffi::g_win32_get_windows_version() } |
1025 | 1013 | } |
1026 | 1014 |
|
| 1015 | +#[cfg(windows)] |
| 1016 | +#[cfg_attr(docsrs, doc(cfg(windows)))] |
1027 | 1017 | #[doc(alias = "g_win32_getlocale")] |
1028 | 1018 | pub fn win32_getlocale() -> crate::GString { |
1029 | 1019 | unsafe { from_glib_full(ffi::g_win32_getlocale()) } |
1030 | 1020 | } |
1031 | | - |
1032 | | -#[doc(alias = "g_win32_locale_filename_from_utf8")] |
1033 | | -pub fn win32_locale_filename_from_utf8(utf8filename: &str) -> crate::GString { |
1034 | | - unsafe { |
1035 | | - from_glib_full(ffi::g_win32_locale_filename_from_utf8( |
1036 | | - utf8filename.to_glib_none().0, |
1037 | | - )) |
1038 | | - } |
1039 | | -} |
0 commit comments