Coder Social home page Coder Social logo

tinyfiledialogs-rs's Introduction

tinyfiledialogs-rs

This is a high-level Rust binding to the excellent tinyfiledialogs library by Guillaume Vareille. The source for the C library is included in the libtinyfiledialogs directory to facilitate an all-in-one package when using the Rust bindings via Cargo. It is updated sporadically from the original repository, which should be used as the primary source for all non-Rust users of the library.

To use this library, add this to the dependencies section in Cargo.toml:

tinyfiledialogs = "3.0"

Security Warning

tinyfiledialogs should only be used with trusted input. Using it with untrusted input, for example as dialog title or message, can in the worst case lead to execution of arbitrary commands.

tinyfiledialogs-rs's People

Contributors

byron avatar dati91 avatar ddefisher avatar eijebong avatar jdm avatar macpp avatar marcono1234 avatar nabijaczleweli avatar neyo8826 avatar paulrouget avatar sammorrowdrums avatar saschanaz avatar srinivasa314 avatar tschneidereit avatar uk992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tinyfiledialogs-rs's Issues

Request to publish version on crates.io with shell escape fix.

#19 was closed by 1a235d1 but an updated version has not been published to crates.io. Downloading the latest available version (3.3.10) of this crate reveals that it includes the broken 3.3.9 version of the C library. Therefore, this crate still breaks when passed a message that contains ' or ".

Please publish a new version to crates.io (presumably 3.8.3 to match the C version) with the shell escape fix.

Paste into password box on MacOS returns None

Using version [email protected] on Monterey 12.1:

Darwin sky.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64

When I paste into a password_box using a keyboard shortcut (Cmd+v) the data appears to be filled in as the asterisks appear as expected but when I click "Ok" the returned value is None.

failed to run custom build command

Im getting an error on an empty rust project

error: failed to run custom build command for tinyfiledialogs v3.9.1

Caused by: process didn't exit successfully:PROJECTFOLDER\target\debug\build\tinyfiledialogs-655245c68561c095\build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
running: "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-v" "-DUSE_WINDOWS_HIDPI" "-o" "PROJECTFOLDER\target\debug\build\tinyfiledialogs-801c54030882bb7d\out\libtinyfiledialogs/tinyfiledialogs.o" "-c" "libtinyfiledialogs/tinyfiledialogs.c"

`

CARGO
[dependencies]
tinyfiledialogs = "3.0"

Windows 11

Filtering does not work on Windows in an open_file_dialog function

I have a folder that has SVG files in it, I want to restrict the user to only be able to load files with an ".svg" extension. However, if I call tinyfiledialogs like this:

let dialog_result = open_file_dialog("Load SVG file", "", Some((&["svg"], "SVG file")));

... what I get (on Windows) is a dialog that doesn't let me select SVG files. It displays the "SVG file" correctly in the lower right corner, but it doesn't filter all SVG items. There is no documentation on how to use the filter correctly, since the example only uses None as the third parameter. I've also tried using ".svg" (with the extra dot), but that doesn't seem to do anything either.

Is there any way to get filtering to work or am I doing something stupid?

Link failure on windows-gnu toolchain

Linking to shcore fails when using the windows-gnu toolchain:

cargo run --example main
= note: c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshcore

Commenting out the shcore line in build.rs allow the example to compile and run.
stable-x86_64-pc-windows-gnu
rustc 1.48.0 (7eac88abb 2020-11-16)

color_chooser_dialog segfaults if no color is picked

fn main() {
    let result = color_chooser_dialog("test", [0, 0, 0]);
    println!("color: {}", result);
}

If you select "cancel", the exe will segfault - tinyfiledialogs returns a nullptr on failure, maybe that's the reason.

CI is broken

 = note: /home/travis/build/jdm/tinyfiledialogs-rs/target/debug/deps/libtinyfiledialogs-9aa6b150620560fe.rlib(tinyfiledialogs-9aa6b150620560fe.actd6e6jk3a7wzh.rcgu.o): In function `tinyfiledialogs::list_dialog::h7bfc0051d172a44e':

          /home/travis/build/jdm/tinyfiledialogs-rs/src/lib.rs:272: undefined reference to `tinyfd_arrayDialog'

          collect2: error: ld returned 1 exit status

Troubles on Windows 7

Application asks for "api-ms-win-shcore-scaling-l1-1-1.dll" and can't find required file in system32 folder (because Shcore part of windows 8.1, which used for GetDPIForMonitor in AppCore.dll)

Problem happen due to SetProcessDpiAwareness (PROCESS_PER_MONITOR_DPI_AWARE)

This issue happen in Ruffle emulator, we recently updated tinyfiledialogs-rs up to v3.9.0

Add security warning to README and lib.rs doc

Due to tinyfiledialogs trying to support many operating systems and environments, and due to how it is implemented (generating command line strings, generating Python code, ...) it seems to be inherently prone to command injection vulnerabilities, see for example #19.

What do you therefore think about adding a security warning to the README of this project to the documentation of the lib.rs file?

For example something like this:

...

Security Warning

tinyfiledialogs should only be used with trusted input. Using it with untrusted input for example as dialog title or message can in the worst case lead to execution of arbitrary commands.

My intention here is not fearmongering, but instead to indicate to users for which use cases tinyfiledialogs is suitable, and for which it might not.

(CC @vareille; is this information correct? Should there maybe also be a warning in the README of the upstream project?)

Custom build command fails: "error: call to undeclared function 'SetProcessDpiAwareness'"

When attempting to compile tinyfiledialogs, the custom build script fails with:

libtinyfiledialogs/tinyfiledialogs.c:1920:2:
error: call to undeclared function 'SetProcessDpiAwareness';
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1920 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
      |         ^

It appears this was introduced in #37.

System Specifications:

  • Windows 10
  • rustc v1.77.1
  • clang v17.0.6
  • MSVC 14.38.33130
  • Visual Studio 17 2022
[0/7] C:\WINDOWS\system32\cmd.exe /C "cd /D Z:\dev\foo\project\rust\cli && "C:\Program F...l --target-dir Z:/dev/foo/project/build/./cargo/build -- -Cdefault-linker-libraries=yes  
   Updating crates.io index
   Compiling tinyfiledialogs v3.9.1
The following warnings were emitted during compilation:

warning: [email protected]: clang version 17.0.6
warning: [email protected]: Target: x86_64-pc-windows-msvc
warning: [email protected]: Thread model: posix
warning: [email protected]: InstalledDir: C:\Program Files\LLVM\bin
warning: [email protected]:  (in-process)
warning: [email protected]:  "C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows-msvc19.38.33135 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name tinyfiledialogs.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -gno-column-info -gcodeview -debug-info-kind=constructor -v -ffunction-sections -fdata-sections "-fcoverage-compilation-dir=C:\\Users\\My Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\tinyfiledialogs-3.9.1" -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\17" -D USE_WINDOWS_HIDPI -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\17\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.38.33130\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.38.33130\\atlmfc\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt" 
-O0 -Wall -Wextra "-fdebug-compilation-dir=C:\\Users\\My Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\tinyfiledialogs-3.9.1" -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.38.33135 -fdelayed-template-parsing -faddrsig -o "Z:/dev/foo/project/build/./cargo/build\\x86_64-pc-windows-msvc\\debug\\build\\tinyfiledialogs-beefe8f25dd73cf6\\out\\bd7bb318ec84866d-tinyfiledialogs.o" -x c libtinyfiledialogs/tinyfiledialogs.c
warning: [email protected]: clang -cc1 version 17.0.6 based upon LLVM 17.0.6 default target x86_64-pc-windows-msvc
warning: [email protected]: #include "..." search starts here:
warning: [email protected]: #include <...> search starts here:
warning: [email protected]:  C:\Program Files\LLVM\lib\clang\17\include
warning: [email protected]:  C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include
warning: [email protected]:  C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\atlmfc\include
warning: [email protected]:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt
warning: [email protected]:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared
warning: [email protected]:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um
warning: [email protected]:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\winrt
warning: [email protected]:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\cppwinrt
warning: [email protected]: End of search list.
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1072:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1072 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1145:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1145 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1220:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1220 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1501:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1501 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1607:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1607 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1797:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1797 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1851:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1851 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1920:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1920 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:1969:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  1969 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:2011:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  2011 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:2067:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  2067 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:2142:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  2142 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:2210:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  2210 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: libtinyfiledialogs/tinyfiledialogs.c:2254:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: [email protected]:  2254 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
warning: [email protected]:       |         ^
warning: [email protected]: 14 errors generated.

error: failed to run custom build command for `tinyfiledialogs v3.9.1`

Caused by:
  process didn't exit successfully: `Z:/dev/foo/project/build/./cargo/build\debug\build\tinyfiledialogs-80268e556e839f44\build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = Some("C:/Program Files/LLVM/bin/clang.exe")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:warning=clang version 17.0.6
  cargo:warning=Target: x86_64-pc-windows-msvc
  cargo:warning=Thread model: posix
  cargo:warning=InstalledDir: C:\Program Files\LLVM\bin
  cargo:warning= (in-process)
  cargo:warning= "C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows-msvc19.38.33135 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name tinyfiledialogs.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -gno-column-info -gcodeview -debug-info-kind=constructor -v -ffunction-sections -fdata-sections "-fcoverage-compilation-dir=C:\\Users\\My Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\tinyfiledialogs-3.9.1" -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\17" -D USE_WINDOWS_HIDPI -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\17\\include" -internal-isystem "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.38.33130\\include" -internal-isystem 
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.38.33130\\atlmfc\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt" -O0 -Wall -Wextra "-fdebug-compilation-dir=C:\\Users\\My Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\tinyfiledialogs-3.9.1" -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.38.33135 -fdelayed-template-parsing -faddrsig -o "Z:/dev/foo/project/build/./cargo/build\\x86_64-pc-windows-msvc\\debug\\build\\tinyfiledialogs-beefe8f25dd73cf6\\out\\bd7bb318ec84866d-tinyfiledialogs.o" -x c libtinyfiledialogs/tinyfiledialogs.c
  cargo:warning=clang -cc1 version 17.0.6 based upon LLVM 17.0.6 default target x86_64-pc-windows-msvc
  cargo:warning=#include "..." search starts here:
  cargo:warning=#include <...> search starts here:
  cargo:warning= C:\Program Files\LLVM\lib\clang\17\include
  cargo:warning= C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include
  cargo:warning= C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\atlmfc\include
  cargo:warning= C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt
  cargo:warning= C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared
  cargo:warning= C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um
  cargo:warning= C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\winrt
  cargo:warning= C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\cppwinrt
  cargo:warning=End of search list.
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1072:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1072 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1145:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1145 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1220:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1220 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1501:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1501 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1607:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1607 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1797:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1797 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1851:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1851 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1920:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1920 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:1969:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 1969 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:2011:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 2011 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:2067:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 2067 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:2142:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 2142 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:2210:2: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 2210 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=libtinyfiledialogs/tinyfiledialogs.c:2254:9: error: call to undeclared function 'SetProcessDpiAwareness'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  cargo:warning= 2254 |         SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
  cargo:warning=      |         ^
  cargo:warning=14 errors generated.

  --- stderr


  error occurred: Command "C:/Program Files/LLVM/bin/clang.exe" "-O0" "--target=x86_64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "--target=x86_64-pc-windows-msvc" "-Wall" "-Wextra" "-v" "-DUSE_WINDOWS_HIDPI" "-o" "Z:/dev/foo/project/build/./cargo/build\\x86_64-pc-windows-msvc\\debug\\build\\tinyfiledialogs-beefe8f25dd73cf6\\out\\bd7bb318ec84866d-tinyfiledialogs.o" "-c" "libtinyfiledialogs/tinyfiledialogs.c" with args clang.exe did not execute successfully (status code exit code: 1).



FAILED: CMakeFiles/_cargo-build_cli Z:/dev/foo/project/build/CMakeFiles/_cargo-build_cli
C:\WINDOWS\system32\cmd.exe /C "cd /D Z:\dev\foo\project\rust\cli && "C:\Program Files\CMake\bin\cmake.exe" -E env "CC_x86_64-pc-windows-msvc=C:/Program Files/LLVM/bin/clang.exe" "CXX_x86_64-pc-windows-msvc=C:/Program Files/LLVM/bin/clang++.exe" CORROSION_BUILD_DIR=Z:/dev/foo/project/build "CARGO_BUILD_RUSTC=C:/Users/My Name/.rustup/toolchains/stable-x86_64-pc-windows-msvc/bin/rustc.exe" "C:/Users/My Name/.rustup/toolchains/stable-x86_64-pc-windows-msvc/bin/cargo.exe" rustc --lib --target=x86_64-pc-windows-msvc --package cli --manifest-path Z:/dev/foo/project/rust/cli/Cargo.toml --target-dir Z:/dev/foo/project/build/./cargo/build -- -Cdefault-linker-libraries=yes"
ninja: build stopped: subcommand failed.

Unicode path encoding error in open_file_dialog

If I select a file in the file dialog and the file contains unicode characters, these character get replaces by U+FFFD, meaning that the resulting file path is useless:

let dialog_result = open_file_dialog("Open file", 
println!("{:?}", dialog_result);

prints:

Some("C:\\Users\\Felix Sch�tt\\Development\\azul\\assets\\svg\\test.svg")

Because of the ü, the file path returned from open_file_dialog is useless - I simply can't open any file. However, this might have to be reported to the original tinyfiledialogs developers OR it is the fault of this library using to_string_lossy - it would be better to escape the unicode characters.

So if I try to open a file using fs::read_to_string(), of course it can't find the file because of the � character.

Cannot save file within russian name folder

IntPtr pointer = tinyfd_saveFileDialog(sDialogTitle, sInitialPathAndFile, filterPatterns.Length, filterPatterns, sPatternDesc);

The pointer is always null when i am trying to save correpsonded file in folder which name is in russian or in any language which is not english. I was able to save file only in english named folder.

I am .Net developer and i was able to call this method through DllImport attribute

[DllImport("tinyfiledialogs", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr tinyfd_saveFileDialog(string aTitle, string aDefaultPathAndFile, int aNumOfFilterPatterns, string[] aFilterPatterns, string aSingleFilterDescription);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.