From f67e92f55b6223f2806c3d5ef1cbe2a638920562 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Fri, 15 Aug 2025 17:28:00 +0200 Subject: working on invoice form --- .../LUA_plugin.tinyfiledialogs.cpp | 287 +++++++++++++++++++++ .../PascalABC/tinyfd.pas | 56 ++++ .../fortran/tinyfd_main.f90 | 185 +++++++++++++ .../fortran/tinyfd_module.f90 | 101 ++++++++ .../freepascal/hello.pas | 91 +++++++ .../freepascal/tinyfd.pp | 138 ++++++++++ .../dll_cs_lua_R_fortran_pascal/tinyfiledialogs.r | 157 +++++++++++ .../tinyfiledialogs32.dll | Bin 0 -> 161476 bytes .../tinyfiledialogs32.lib | Bin 0 -> 33314 bytes .../tinyfiledialogs64.dll | Bin 0 -> 159666 bytes .../tinyfiledialogs64.lib | Bin 0 -> 33412 bytes .../tinyfiledialogsAppleSilicon.dylib | Bin 0 -> 141120 bytes .../tinyfiledialogsIntel.dylib | Bin 0 -> 119644 bytes .../tinyfiledialogsLinux64.so | Bin 0 -> 134184 bytes .../tinyfiledialogsLinux86.so | Bin 0 -> 123408 bytes .../tinyfiledialogsTest.cs | 153 +++++++++++ .../tinyfiledialogs_dll_mingw-32.bat | 29 +++ .../tinyfiledialogs_dll_mingw-w64-720.bat | 29 +++ .../tinyfiledialogs_dll_mingw-w64-810.bat | 29 +++ .../tinyfiledialogs_dylib.sh | 18 ++ .../tinyfiledialogs_so.sh | 20 ++ 21 files changed, 1293 insertions(+) create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/LUA_plugin.tinyfiledialogs.cpp create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/PascalABC/tinyfd.pas create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_main.f90 create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_module.f90 create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/hello.pas create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/tinyfd.pp create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs.r create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.dll create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.lib create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.dll create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.lib create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsAppleSilicon.dylib create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsIntel.dylib create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux64.so create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux86.so create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsTest.cs create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-32.bat create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-720.bat create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-810.bat create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dylib.sh create mode 100644 libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_so.sh (limited to 'libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal') diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/LUA_plugin.tinyfiledialogs.cpp b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/LUA_plugin.tinyfiledialogs.cpp new file mode 100644 index 0000000..036f0ca --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/LUA_plugin.tinyfiledialogs.cpp @@ -0,0 +1,287 @@ +/* SPDX-License-Identifier: ZLIB +Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com + _________ + / \ LUA_plugin.tinyfiledialogs.cpp v3.8.3 [Nov 1, 2020] + |tiny file| LUA bindings created [2016] Copyright (c) 2016 Steven Johnson + | dialogs | + \____ ___/ http://tinyfiledialogs.sourceforge.net + \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + ____________________________________________ + | | + | email: tinyfiledialogs at ysengrin.com | + |____________________________________________| + +If you like tinyfiledialogs, please upvote my stackoverflow answer +https://stackoverflow.com/a/47651444 + +- License - +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +----------- + +this file was contributed by Steven Johnson from the Corona SDK project +and is offered here under the same zlib license as tinyfiledialogs + +-#include "CoronaLua.h" will typically be something like +extern "C" { +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" +} + +in a normal(i.e.non - Corona) program. +- For that matter, CORONA_EXPORT just hides the library exporting code. +- The "_plugin_" stuff is part of a signature used by Corona to dynamically load the entry point function, but might be out +of place in a non - Corona program. +*/ + + +#include "CoronaLua.h" +#include "tinyfiledialogs.h" +#include + +#define STATIC_FILTER_COUNT 8 + +static int GetBool (lua_State * L, const char * key) +{ + lua_getfield(L, 1, key);// ..., bool + + int bval = lua_toboolean(L, -1); + + lua_pop(L, 1); // ... + + return bval; +} + +static const char * GetStrOrBlank (lua_State * L, const char * key, const char * blank = "") +{ + lua_getfield(L, 1, key);// ..., str? + + const char * str = blank; // might be NULL, thus not using luaL_optstring + + if (!lua_isnil(L, -1)) str = luaL_checkstring(L, -1); + + lua_pop(L, 1); + + return str; +} + +static int GetFilters (lua_State * L, const char *** filters) +{ + int nfilters = 0; + + lua_getfield(L, 1, "filter_patterns"); // ..., patts + + if (lua_istable(L, -1)) + { + int n = lua_objlen(L, -1); + + if (n > STATIC_FILTER_COUNT) *filters = (const char **)lua_newuserdata(L, sizeof(const char *) * n);// ..., patts, filters + + for (int i = 1; i <= n; ++i, lua_pop(L, 1)) + { + lua_rawgeti(L, -1, i); // ..., patts[, filters], patt + + (*filters)[nfilters++] = luaL_checkstring(L, -1); + } + } + + else if (!lua_isnil(L, -1)) (*filters)[nfilters++] = luaL_checkstring(L, -1); + + return nfilters; +} + +static int StringResponse (lua_State * L, const char * res) +{ + if (!res) lua_pushboolean(L, 0);// ..., false + + else lua_pushstring(L, res);// ..., res + + return 1; +} + +static luaL_Reg tfd_funcs[] = { + { + "notifyPopup", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + + const char * title = GetStrOrBlank(L, "title"); + const char * message = GetStrOrBlank(L, "message"); + const char * icon_types[] = { "info", "warning", "error" }; + + lua_getfield(L, 1, "icon_type"); // opts, icon_type + + const char * itype = icon_types[luaL_checkoption(L, -1, "info", icon_types)]; + + lua_pushboolean(L, tinyfd_notifyPopup(title, message, itype)); // opts, icon_type + + return 1; + } + }, { + "messageBox", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + + const char * title = GetStrOrBlank(L, "title"); + const char * message = GetStrOrBlank(L, "message"); + const char * dialog_types[] = { "ok", "okcancel", "yesno", "yesnocancel" }; + const char * icon_types[] = { "info", "warning", "error", "question" }; + + lua_getfield(L, 1, "dialog_type"); // opts, dialog_type + lua_getfield(L, 1, "icon_type");// opts, dialog_type, icon_type + + const char * dtype = dialog_types[luaL_checkoption(L, -2, "ok", dialog_types)]; + const char * itype = icon_types[luaL_checkoption(L, -1, "info", icon_types)]; + + lua_pushboolean(L, tinyfd_messageBox(title, message, dtype, itype, GetBool(L, "default_okyes"))); // opts, dialog_type, icon_type, ok / yes + + return 1; + } + }, { + "inputBox", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + + const char * title = GetStrOrBlank(L, "title"); + const char * message = GetStrOrBlank(L, "message"); + + // + lua_getfield(L, 1, "default_input");// opts, def_input + + const char * def_input; + + if (lua_type(L, -1) == LUA_TBOOLEAN && !lua_toboolean(L, -1)) def_input = NULL; + + else def_input = luaL_optstring(L, -1, ""); + + return StringResponse(L, tinyfd_inputBox(title, message, def_input)); // opts, def_input, input + } + }, { + "saveFileDialog", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + + const char * title = GetStrOrBlank(L, "title"); + const char * def_path_and_file = GetStrOrBlank(L, "default_path_and_file"); + const char * filter_description = GetStrOrBlank(L, "filter_description", NULL); + const char * filter_array[STATIC_FILTER_COUNT] = { 0 }, ** filters = filter_array; + int nfilters = GetFilters(L, &filters); // opts, patts[, filters] + + return StringResponse(L, tinyfd_saveFileDialog(title, def_path_and_file, nfilters, filters, filter_description)); // opts, patts[, filters], file + } + }, { + "openFileDialog", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + + // + const char * title = GetStrOrBlank(L, "title"); + const char * def_path_and_file = GetStrOrBlank(L, "default_path_and_file"); + const char * filter_description = GetStrOrBlank(L, "filter_description", NULL); + const char * filter_array[STATIC_FILTER_COUNT] = { 0 }, ** filters = filter_array; + int allow_multiple_selects = GetBool(L, "allow_multiple_selects"); + int nfilters = GetFilters(L, &filters); // opts, patts[, filters] + + // + const char * files = tinyfd_openFileDialog(title, def_path_and_file, nfilters, nfilters ? filters : NULL, filter_description, allow_multiple_selects); + + if (!allow_multiple_selects || !files) return StringResponse(L, files); // opts, patts[, filters], files? + + else + { + lua_newtable(L);// opts, patts[, filters], files + + char * from = (char *)files, * sep = from; // assign sep in order to pass first iteration + + for (int fi = 1; sep; ++fi) + { + sep = strchr(from, '|'); + + if (sep) + { + lua_pushlstring(L, from, sep - from); // opts, patts[, filters], files, file + + from = sep + 1; + } + + else lua_pushstring(L, from);// opts, patts[, filters], files, file + + lua_rawseti(L, -2, fi); // opts, patts[, filters], files = { ..., file } + } + } + + return 1; + } + }, { + "selectFolderDialog", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + + const char * title = GetStrOrBlank(L, "title"); + const char * def_path = GetStrOrBlank(L, "default_path"); + + return StringResponse(L, tinyfd_selectFolderDialog(title, def_path)); // opts, folder + } + }, { + "colorChooser", [](lua_State * L) + { + luaL_checktype(L, 1, LUA_TTABLE); + lua_settop(L, 1); // opts + lua_getfield(L, 1, "out_rgb"); // opts, out + + const char * title = GetStrOrBlank(L, "title"); + + // + unsigned char rgb[3]; + + lua_getfield(L, 1, "rgb"); // opts, out, rgb + + const char * def_hex_rgb = NULL; + + if (lua_istable(L, 3)) + { + lua_getfield(L, 3, "r");// opts, out, rgb, r + lua_getfield(L, 3, "g");// opts, out, rgb, r, g + lua_getfield(L, 3, "b");// opts, out, rgb, r, g, b + + for (int i = 1; i <= 3; ++i) rgb[i - 1] = (unsigned char)(luaL_checknumber(L, 3 + i) * 255.0); + } + + else def_hex_rgb = luaL_optstring(L, 3, "#000000"); + + const char * color = tinyfd_colorChooser(title, def_hex_rgb, rgb, rgb); + + if (color && lua_istable(L, 2)) + { + for (int i = 0; i < 3; ++i) lua_pushnumber(L, (double)rgb[i] / 255.0); // opts, out, rgb[, r, g, b], rout, gout, bout + + lua_setfield(L, 2, "b");// opts, out, rgb[, r, g, b], rout, gout + lua_setfield(L, 2, "g");// opts, out, rgb[, r, g, b], rout + lua_setfield(L, 2, "r");// opts, out, rgb[, r, g, b] + } + + return StringResponse(L, color);// opts, out, rgb[, r, g, b], color + } + }, + { NULL, NULL } +}; + +CORONA_EXPORT int luaopen_plugin_tinyfiledialogs(lua_State* L) +{ + lua_newtable(L);// t + luaL_register(L, NULL, tfd_funcs); + + return 1; +} diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/PascalABC/tinyfd.pas b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/PascalABC/tinyfd.pas new file mode 100644 index 0000000..3fdee61 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/PascalABC/tinyfd.pas @@ -0,0 +1,56 @@ +{ SPDX-License-Identifier: ZLIB +Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com + +found on this page: + https://github.com/pascalabcnet/pascalabcnet/discussions/2782 +} + +unit tinyfd; + +uses System; + +procedure tinyfd_beep(); external 'tinyfiledialogs64.dll'; + +function tinyfd_notifyPopup(aTitle: string; + aMessage: string; + aIconType: string): integer; + external 'tinyfiledialogs64.dll'; + +function tinyfd_messageBox(aTitle: string; + aMessage: string; + aDialogTyle: string; + aIconType: string; + aDefaultButton: integer): integer; + external 'tinyfiledialogs64.dll'; + +function tinyfd_inputBox(aTitle: string; + aMessage: string; + aDefaultInput: string): IntPtr; + external 'tinyfiledialogs64.dll'; + +function tinyfd_saveFileDialog(aTitle: string; + aDefaultPathAndFile: string; + aNumOfFilterPatterns: integer; + aFilterPatterns: array of string; + aSingleFilterDescription: string): IntPtr; + external 'tinyfiledialogs64.dll'; + +function tinyfd_openFileDialog(aTitle: string; + aDefaultPathAndFile: string; + aNumOfFilterPatterns: integer; + aFilterPatterns: array of string; + aSingleFilterDescription: string; + aAllowMultipleSelects: integer): IntPtr; + external 'tinyfiledialogs64.dll'; + +function tinyfd_selectFolderDialog(aTitle: string; + aDefaultPathAndFile: string): IntPtr; + external 'tinyfiledialogs64.dll'; + +function tinyfd_colorChooser(aTitle: string; + aDefaultHexRGB: string; + aDefaultRGB: array of byte; + aoResultRGB: array of byte): IntPtr; + external 'tinyfiledialogs64.dll'; + +end. diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_main.f90 b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_main.f90 new file mode 100644 index 0000000..a4845ef --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_main.f90 @@ -0,0 +1,185 @@ +! SPDX-License-Identifier: ZLIB +! Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com +! _________ +! / \ tinyfiledialogs v3.18.1 [May 26, 2024] +! |tiny file| +! | dialogs | +! \____ ___/ http://tinyfiledialogs.sourceforge.net +! \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + +! - License - +! This software is provided 'as-is', without any express or implied +! warranty. In no event will the authors be held liable for any damages +! arising from the use of this software. +! Permission is granted to anyone to use this software for any purpose, +! including commercial applications, and to alter it and redistribute it +! freely, subject to the following restrictions: +! 1. The origin of this software must not be misrepresented; you must not +! claim that you wrote the original software. If you use this software +! in a product, an acknowledgment in the product documentation would be +! appreciated but is not required. +! 2. Altered source versions must be plainly marked as such, and must not be +! misrepresented as being the original software. +! 3. This notice may not be removed or altered from any source distribution. +! ___________________________________________________________ +! | | +! | If you like this new FORTRAN module please upvote | +! | my stackoverflow answer on the FORTRAN post | +! | https://stackoverflow.com/a/59657117 | +! |___________________________________________________________| + +! See compilation instructions at the end of this file + + program main + use tinyfd + use iso_c_binding, only: c_ptr, c_null_char, c_f_pointer, c_loc, c_null_ptr, c_associated, c_int, c_char + implicit none + type(c_ptr) :: cpointer + character(512), pointer :: fpointer + character(128), target :: aDefaultInput + character(512) :: string, aMessage, aDefaultPath, aDefaultPathAndFile + character(128) :: aTitle, aDialogType, aIconType + character(128) :: aSingleFilterDescription + integer :: i, aInteger, aButtonPressed, aDefaultButton, aNumOfFilterPatterns, aAllowMultipleSelects + character(8) :: aDefaultHexRGB + character(3) :: aDefaultRGB, aoResultRGB + type (c_ptr), dimension(:), allocatable :: aFilterPatterns + character(len=16,kind=c_char), allocatable, target :: lExtensions(:) + + ! calling subroutine tinyfd_beep (it doesn't return anything: it's a subroutine') + write(*,'(A)') "Enter tinyfd_beep()" + call tinyfd_beep() + + ! calling function tinyfd_notifyPopup (it returns one value: it's a function') + write(*,'(A)') "Enter tinyfd_notifyPopup()" + aTitle = "a Title" // char(0) + aMessage = "a Message" // char(0) + aIconType = "info" // char(0) + aInteger = tinyfd_notifyPopup(aTitle, aMessage, aIconType ) + + ! calling function tinyfd_messageBox + write(*,'(A)') "Enter tinyfd_messageBox()" + aTitle = "a Title" // char(0) + aMessage = "a Message" // char(0) + aIconType = "info" // char(0) + aDialogType = "ok" // char(0) + aDefaultButton = 1 + aButtonPressed = tinyfd_messageBox(aTitle, aMessage, aDialogType, aIconType, aDefaultButton ) + write (*,*) aButtonPressed + + ! calling function tinyfd_inputbox + write(*,'(A)') "Enter tinyfd_inputbox()" + aTitle = "a Title" // char(0) + aMessage = "a Message" // char(0) + aDefaultInput = "an Input" // char(0) + cpointer = tinyfd_inputBox(aTitle, aMessage, c_loc(aDefaultInput) ) + ! or for a password box: cpointer = tinyfd_inputbox(atitle, amessage, c_null_ptr ) + if ( c_associated(cpointer) ) then + call c_f_pointer(cpointer, fpointer) ! Convert C Pointer to Fortran pointer + string = fpointer(1:index(fpointer,c_null_char)-1) ! Remove NULL character at the end + write (*,'(A)') string + endif + + ! calling function tinyfd_saveFileDialog + write(*,'(A)') "Enter tinyfd_saveFileDialog()" + aTitle = "a Title" // char(0) + aDefaultPathAndFile = "" // char(0) + aSingleFilterDescription = "" // char(0) ! or "Text Files" // char(0) + aNumOfFilterPatterns = 2 + allocate (lExtensions( aNumOfFilterPatterns )) + allocate (aFilterPatterns( aNumOfFilterPatterns )) + lExtensions(1) = "*.txt" // char(0) + lExtensions(2) = "*.doc" // char(0) + do i = 1, aNumOfFilterPatterns, 1 + aFilterPatterns(i) = c_loc(lExtensions(i)) + write (*,'(A)') lExtensions(i) + !write (*,*) aFilterPatterns(i) + end do + cpointer = tinyfd_saveFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription) + ! or cpointer = tinyfd_saveFileDialog(aTitle, aDefaultPathAndFile, 0, c_null_ptr, aSingleFilterDescription) + deallocate (aFilterPatterns) + deallocate (lExtensions) + if ( c_associated(cpointer) ) then + call c_f_pointer(cpointer, fpointer) ! Convert C Pointer to Fortran pointer + string = fpointer(1:index(fpointer,c_null_char)-1) ! Remove NULL character at the end + write (*,'(A)') string + endif + + ! calling function tinyfd_openFileDialog + write(*,'(A)') "Enter tinyfd_openFileDialog()" + aTitle = "a Title" // char(0) + aDefaultPathAndFile = "" // char(0) + aAllowMultipleSelects = 1 + aSingleFilterDescription = "" // char(0) ! or "Text Files" // char(0) + aNumOfFilterPatterns = 2 + allocate (lExtensions( aNumOfFilterPatterns )) + allocate (aFilterPatterns( aNumOfFilterPatterns )) + lExtensions(1) = "*.txt" // char(0) + lExtensions(2) = "*.doc" // char(0) + do i = 1, aNumOfFilterPatterns, 1 + aFilterPatterns(i) = c_loc(lExtensions(i)) + write (*,'(A)') lExtensions(i) + !write (*,*) aFilterPatterns(i) + end do + cpointer = tinyfd_openFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, & + aSingleFilterDescription, aAllowMultipleSelects) + ! or cpointer = tinyfd_openFileDialog(aTitle, aDefaultPathAndFile, 0, c_null_ptr, aSingleFilterDescription, aAllowMultipleSelects) + deallocate (aFilterPatterns) + deallocate (lExtensions) + if ( c_associated(cpointer) ) then + call c_f_pointer(cpointer, fpointer) ! Convert C Pointer to Fortran pointer + string = fpointer(1:index(fpointer,c_null_char)-1) ! Remove NULL character at the end + write (*,'(A)') string + endif + + ! calling function tinyfd_selectFolderDialog + write(*,'(A)') "Enter tinyfd_selectFolderDialog()" + aTitle = "a Title" // char(0) + aDefaultPath = "" // char(0) + cpointer = tinyfd_selectFolderDialog(aTitle, aDefaultPath ) + if ( c_associated(cpointer) ) then + call c_f_pointer(cpointer, fpointer) ! Convert C Pointer to Fortran pointer + string = fpointer(1:index(fpointer,c_null_char)-1) ! Remove NULL character at the end + write (*,'(A)') string + endif + + ! calling function tinyfd_colorChooser + write(*,'(A)') "Enter tinyfd_colorChooser()" + aTitle = "a Title" // char(0) + aDefaultHexRGB = "" // char(0) ! or "#FF0000" // char(0) + aDefaultRGB = char(0) // char(0) // char(255) + print *, "aDefaultRGB", IACHAR(aDefaultRGB(1:1)), IACHAR(aDefaultRGB(2:2)), IACHAR(aDefaultRGB(3:3)) + cpointer = tinyfd_colorChooser(aTitle, aDefaultHexRGB, aDefaultRGB, aoResultRGB ) + print *, "aoResultRGB", IACHAR(aoResultRGB(1:1)), IACHAR(aoResultRGB(2:2)), IACHAR(aoResultRGB(3:3)) + if ( c_associated(cpointer) ) then + call c_f_pointer(cpointer, fpointer) ! Convert C Pointer to Fortran pointer + string = fpointer(1:index(fpointer,c_null_char)-1) ! Remove NULL character at the end + write (*,'(A)') string(1:10) + write (*,*) string + endif + + end program main + +! gcc -c ../../tinyfiledialogs.c +! gfortran -c tinyfd_module.f90 tinyfd_main.f90 +! gfortran -o tinyfd_exe tinyfd_module.o tinyfiledialogs.o tinyfd_main.o + +! or in one line : gfortran -o tinyfd_exe tinyfd_module.f90 ../../tinyfiledialogs.c tinyfd_main.f90 + +! This works on VisualStudio with Intel Fortran (make sure the C project has very similar settings as your fortran project): + ________________________________________________________________________ +! 1) | Install The Windows SDK | +! | http://developer.microsoft.com/en-us/windows/downloads/windows-sdk | +! | The end user doesn't need to install anythings | +! |________________________________________________________________________| +! 2) Create a new empty C/C++ project, verify the configuration is for X64. +! 3) Add existing files: tinyfiledialogs.c and tinyfiledialogs.h +! 4) Build this project. It will fail because there is no main(), +! but it will create tinyfiledialogs.obj +! 5) Create a new empty Fortran project, verify the configuration is for X64. +! 6) Add existing file: tinyfiledialogs.obj - the one that was created on 4) +! 7) Add existing files: tinyfd_module.f90 and tinyfd_main.f90 +! 8) In the properties of this fortran project, in the linker input field, +! add: comdlg32.lib ole32.lib user32.lib shell32.lib +! or maybe add: %(AdditionalDependencies) +! 9) Build and Run. Voila ! diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_module.f90 b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_module.f90 new file mode 100644 index 0000000..102f921 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/fortran/tinyfd_module.f90 @@ -0,0 +1,101 @@ +! SPDX-License-Identifier: ZLIB +! Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com +! _________ +! / \ tinyfiledialogs v3.18.1 [Mar 26, 2024] +! |tiny file| +! | dialogs | +! \____ ___/ http://tinyfiledialogs.sourceforge.net +! \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + +! - License - +! This software is provided 'as-is', without any express or implied +! warranty. In no event will the authors be held liable for any damages +! arising from the use of this software. +! Permission is granted to anyone to use this software for any purpose, +! including commercial applications, and to alter it and redistribute it +! freely, subject to the following restrictions: +! 1. The origin of this software must not be misrepresented; you must not +! claim that you wrote the original software. If you use this software +! in a product, an acknowledgment in the product documentation would be +! appreciated but is not required. +! 2. Altered source versions must be plainly marked as such, and must not be +! misrepresented as being the original software. +! 3. This notice may not be removed or altered from any source distribution. +! ___________________________________________________________ +! | | +! | If you like this new FORTRAN module please upvote | +! | my stackoverflow answer on the FORTRAN post | +! | https://stackoverflow.com/a/59657117 | +! |___________________________________________________________| + +! See compilation instructions at the end of tinyfd_main.f90 + + module tinyfd + interface ! C interface + + ! it doesn't return anything -> it's a subroutine + subroutine tinyfd_beep() bind(C, name='tinyfd_beep') + implicit none + end subroutine tinyfd_beep + + ! it returns one value -> it's a function + integer function tinyfd_notifyPopup(aTitle, aMessage, aIconType) bind(c, NAME='tinyfd_notifyPopup') + use iso_c_binding, only: c_char + implicit none + character (kind=c_char, len=1) :: aTitle, aMessage, aIconType + end function tinyfd_notifyPopup + + ! it returns one value -> it's a function + integer function tinyfd_messageBox(aTitle, aMessage, aDialogType, aIconType, aDefaultButton) bind(c,NAME='tinyfd_messageBox') + use iso_c_binding, only: c_char, c_int + implicit none + character (kind=c_char, len=1) :: aTitle, aMessage, aDialogType, aIconType + integer(c_int), value :: aDefaultButton + end function tinyfd_messageBox + + ! it returns one value -> it's a function + type(c_ptr) function tinyfd_inputBox(aTitle, aMessage, aDefaultInput) bind(c,NAME='tinyfd_inputBox') + use iso_c_binding, only: c_ptr, c_char + implicit none + character (kind=c_char, len=1) :: aTitle, aMessage + ! aDefaultInput is a bit different because we need to be able + ! to pass c_null_ptr to obtain a password box instead of an input box + type(c_ptr), value :: aDefaultInput + end function tinyfd_inputBox + + ! it returns one value -> it's a function + type(c_ptr) function tinyfd_saveFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, & + aSingleFilterDescription) bind(c,NAME='tinyfd_saveFileDialog') + use iso_c_binding, only: c_ptr, c_char, c_int + implicit none + integer(c_int), value :: aNumOfFilterPatterns + character (kind=c_char, len=1) :: aTitle, aDefaultPathAndFile, aSingleFilterDescription + type (c_ptr), dimension(*) :: aFilterPatterns + end function tinyfd_saveFileDialog + + ! it returns one value -> it's a function + type(c_ptr) function tinyfd_openFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, & + aSingleFilterDescription, aAllowMultipleSelects) bind(c,NAME='tinyfd_openFileDialog') + use iso_c_binding, only: c_ptr, c_char, c_int + implicit none + integer(c_int), value :: aNumOfFilterPatterns, aAllowMultipleSelects + character (kind=c_char, len=1) :: aTitle, aDefaultPathAndFile, aSingleFilterDescription + type (c_ptr), dimension(*) :: aFilterPatterns + end function tinyfd_openFileDialog + + ! it returns one value -> it's a function + type(c_ptr) function tinyfd_selectFolderDialog(aTitle, aDefaultPath) bind(c,NAME='tinyfd_selectFolderDialog') + use iso_c_binding, only: c_ptr, c_char + implicit none + character (kind=c_char, len=1) :: aTitle, aDefaultPath + end function tinyfd_selectFolderDialog + + ! it returns one value -> it's a function + type(c_ptr) function tinyfd_colorChooser(aTitle, aDefaultHexRGB, aDefaultRGB, aoResultRGB) bind(c,NAME='tinyfd_colorChooser') + use iso_c_binding, only: c_ptr, c_char, c_int + implicit none + character (kind=c_char, len=1) :: aTitle, aDefaultHexRGB, aDefaultRGB, aoResultRGB + end function tinyfd_colorChooser + + end interface ! C interface + end module tinyfd diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/hello.pas b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/hello.pas new file mode 100644 index 0000000..a43c478 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/hello.pas @@ -0,0 +1,91 @@ +{ SPDX-License-Identifier: ZLIB +Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com + _________ + / \ tinyfiledialogs v3.13 [May 2, 2023] zlib licence + |tiny file| + | dialogs | + \____ ___/ http://tinyfiledialogs.sourceforge.net + \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + + - License - + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + ___________________________________________________________ + | | + | If you like this new PASCAL module please upvote | + | my stackoverflow answer on the PASCAL post | + | https://stackoverflow.com/a/59657117 | + |___________________________________________________________| + + See compilation instructions at the end of this file +} + +program Hello ; + +uses tinyfd ; + +var + lReturnedChar : Pchar; + lReturnedValue : Integer ; + lCReturnedString: String ; + lArrayOfChar: array[0..2] of byte = (0,0,255); + +begin + writeln ('Hello tinyfd'); + tinyfd_beep(); + + lReturnedChar := tinyfd_inputBox('tinyfd_query', '', ''); + writeln (tinyfd_response); + if lReturnedChar <> nil then + lReturnedValue := tinyfd_messageBox('Graphic Mode',tinyfd_response, 'okcancel', 'info', 1) + else + lReturnedValue := tinyfd_messageBox('Console Mode',tinyfd_response, 'okcancel', 'info', 1); + + if lReturnedValue = 0 then exit; + + lReturnedValue := tinyfd_messageBox('A tinyfd title','graphic dialogs [Yes] / console mode [No]', 'yesno', 'question', 1); + if lReturnedValue = 0 then tinyfd_forceConsole := 1 ; + + tinyfd_notifyPopup('A tinyfd title', 'This is a notification', 'warning'); + + lReturnedChar := tinyfd_inputBox('A tinyfd title','This is an input box', ''); + if lReturnedChar = nil then exit; { detect cancel was pressed - no input is allowed } + lCReturnedString := StrPas(lReturnedChar); + writeln (lCReturnedString); + + lCReturnedString := tinyfd_inputBox('A tinyfd title','This is a password box', nil); + writeln (lCReturnedString); + if Length(lCReturnedString) = 0 then exit; { detect no input } + + lCReturnedString := tinyfd_saveFileDialog('Choose a filename to save to','lala.txt', 0, nil,nil); + writeln (lCReturnedString); + if Length(lCReturnedString) = 0 then exit; + + lCReturnedString := tinyfd_openFileDialog('Choose a filename to read from','../lala.txt', 0, nil, nil, 0); + writeln (lCReturnedString); + if Length(lCReturnedString) = 0 then exit; + + lCReturnedString := tinyfd_selectFolderDialog('Select a folder','../..'); + writeln (lCReturnedString); + if Length(lCReturnedString) = 0 then exit; + + lCReturnedString := tinyfd_colorChooser('A tinyfd title','', lArrayOfChar, lArrayOfChar); + writeln (lCReturnedString); +end. + +{ +gcc -c ../../tinyfiledialogs.c +fpc tinyfd.pp +fpc hello.pas +} diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/tinyfd.pp b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/tinyfd.pp new file mode 100644 index 0000000..7826de0 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/freepascal/tinyfd.pp @@ -0,0 +1,138 @@ +{ SPDX-License-Identifier: ZLIB +Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com + _________ + / \ tinyfiledialogs v3.14 [Jan 26, 2025] zlib licence + |tiny file| + | dialogs | + \____ ___/ http://tinyfiledialogs.sourceforge.net + \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + + - License - + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + ___________________________________________________________ + | | + | If you like this new PASCAL module please upvote | + | my stackoverflow answer on the PASCAL post | + | https://stackoverflow.com/a/59657117 | + |___________________________________________________________| +} + +unit tinyfd; +interface + +{$linklib c} + +{ Adapted from + Automatically converted by H2Pas 1.0.0 from ../../tinyfiledialogs.h + The following command line parameters were used: + ../../tinyfiledialogs.h + -o + tinyfd.pp +} + + Type + Pchar = ^char; + +{$ifdef _WIN32} + Pwchar_t = ^wchar_t; +{$ENDIF} + + +{$IFDEF FPC} +{$PACKRECORDS C} +{$ENDIF} + +{$ifdef _WIN32} + var + tinyfd_winUtf8 : longint;cvar;external; + + function tinyfd_utf8toMbcs(aUtf8string:Pchar):Pchar;cdecl; + function tinyfd_utf16toMbcs(aUtf16string:Pwchar_t):Pchar;cdecl; + function tinyfd_mbcsTo16(aMbcsString:Pchar):Pwchar_t;cdecl; + function tinyfd_mbcsTo8(aMbcsString:Pchar):Pchar;cdecl; + function tinyfd_utf8to16(aUtf8string:Pchar):Pwchar_t;cdecl; + function tinyfd_utf16to8(aUtf16string:Pwchar_t):Pchar;cdecl; +{$endif} + + function tinyfd_getGlobalChar(aCharVariableName:Pchar):Pchar;cdecl; + function tinyfd_getGlobalInt(aIntVariableName:Pchar):longint;cdecl; + function tinyfd_setGlobalInt(aIntVariableName:Pchar; aValue:longint):longint;cdecl; + + var + tinyfd_version : array[0..7] of char;cvar;external; + tinyfd_needs : Pchar;cvar;external; + tinyfd_verbose : longint;cvar;external; + tinyfd_silent : longint;cvar;external; + tinyfd_allowCursesDialogs : longint;cvar;external; + tinyfd_forceConsole : longint;cvar;external; + {tinyfd_assumeGraphicDisplay : longint;cvar;external;} + tinyfd_response : array[0..1023] of char;cvar;external; + + procedure tinyfd_beep;cdecl; + function tinyfd_notifyPopup(aTitle:Pchar; aMessage:Pchar; aIconType:Pchar):longint;cdecl; + function tinyfd_messageBox(aTitle:Pchar; aMessage:Pchar; aDialogType:Pchar; aIconType:Pchar; aDefaultButton:longint):longint;cdecl; + function tinyfd_inputBox(aTitle:Pchar; aMessage:Pchar; aDefaultInput:Pchar):Pchar;cdecl; + function tinyfd_saveFileDialog(aTitle:Pchar; aDefaultPathAndFile:Pchar; aNumOfFilterPatterns:longint; aFilterPatterns:PPchar; aSingleFilterDescription:Pchar):Pchar;cdecl; + function tinyfd_openFileDialog(aTitle:Pchar; aDefaultPathAndFile:Pchar; aNumOfFilterPatterns:longint; aFilterPatterns:PPchar; aSingleFilterDescription:Pchar;aAllowMultipleSelects:longint):Pchar;cdecl; + function tinyfd_selectFolderDialog(aTitle:Pchar; aDefaultPath:Pchar):Pchar;cdecl; + function tinyfd_colorChooser(aTitle:Pchar; aDefaultHexRGB:Pchar; aDefaultRGB:array of byte; aoResultRGB:array of byte):Pchar;cdecl; + +{$ifdef _WIN32} + function tinyfd_notifyPopupW(aTitle:Pwchar_t; aMessage:Pwchar_t; aIconType:Pwchar_t):longint;cdecl; + function tinyfd_messageBoxW(aTitle:Pwchar_t; aMessage:Pwchar_t; aDialogType:Pwchar_t; aIconType:Pwchar_t; aDefaultButton:longint):longint;cdecl; + function tinyfd_inputBoxW(aTitle:Pwchar_t; aMessage:Pwchar_t; aDefaultInput:Pwchar_t):Pwchar_t;cdecl; + function tinyfd_saveFileDialogW(aTitle:Pwchar_t; aDefaultPathAndFile:Pwchar_t; aNumOfFilterPatterns:longint; aFilterPatterns:PPwchar_t; aSingleFilterDescription:Pwchar_t):Pwchar_t;cdecl; + function tinyfd_openFileDialogW(aTitle:Pwchar_t; aDefaultPathAndFile:Pwchar_t; aNumOfFilterPatterns:longint; aFilterPatterns:PPwchar_t; aSingleFilterDescription:Pwchar_t;aAllowMultipleSelects:longint):Pwchar_t;cdecl; + function tinyfd_selectFolderDialogW(aTitle:Pwchar_t; aDefaultPath:Pwchar_t):Pwchar_t;cdecl; + function tinyfd_colorChooserW(aTitle:Pwchar_t; aDefaultHexRGB:Pwchar_t; aDefaultRGB:array of byte; aoResultRGB:array of byte):Pwchar_t;cdecl; +{$endif} + +implementation + +{$Link 'tinyfiledialogs.o'} + +{$ifdef _WIN32} + function tinyfd_utf8toMbcs(aUtf8string:Pchar):Pchar;cdecl;external; + function tinyfd_utf16toMbcs(aUtf16string:Pwchar_t):Pchar;cdecl;external; + function tinyfd_mbcsTo16(aMbcsString:Pchar):Pwchar_t;cdecl;external; + function tinyfd_mbcsTo8(aMbcsString:Pchar):Pchar;cdecl;external; + function tinyfd_utf8to16(aUtf8string:Pchar):Pwchar_t;cdecl;external; + function tinyfd_utf16to8(aUtf16string:Pwchar_t):Pchar;cdecl;external; +{$endif} + + function tinyfd_getGlobalChar(aCharVariableName:Pchar):Pchar;cdecl;external; + function tinyfd_getGlobalInt(aIntVariableName:Pchar):longint;cdecl;external; + function tinyfd_setGlobalInt(aIntVariableName:Pchar; aValue:longint):longint;cdecl;external; + + procedure tinyfd_beep;cdecl;external; + function tinyfd_notifyPopup(aTitle:Pchar; aMessage:Pchar; aIconType:Pchar):longint;cdecl;external; + function tinyfd_messageBox(aTitle:Pchar; aMessage:Pchar; aDialogType:Pchar; aIconType:Pchar; aDefaultButton:longint):longint;cdecl;external; + function tinyfd_inputBox(aTitle:Pchar; aMessage:Pchar; aDefaultInput:Pchar):Pchar;cdecl;external; + function tinyfd_saveFileDialog(aTitle:Pchar; aDefaultPathAndFile:Pchar; aNumOfFilterPatterns:longint; aFilterPatterns:PPchar; aSingleFilterDescription:Pchar):Pchar;cdecl;external; + function tinyfd_openFileDialog(aTitle:Pchar; aDefaultPathAndFile:Pchar; aNumOfFilterPatterns:longint; aFilterPatterns:PPchar; aSingleFilterDescription:Pchar;aAllowMultipleSelects:longint):Pchar;cdecl;external; + function tinyfd_selectFolderDialog(aTitle:Pchar; aDefaultPath:Pchar):Pchar;cdecl;external; + function tinyfd_colorChooser(aTitle:Pchar; aDefaultHexRGB:Pchar; aDefaultRGB:array of byte; aoResultRGB:array of byte):Pchar;cdecl;external; + +{$ifdef _WIN32} + function tinyfd_notifyPopupW(aTitle:Pwchar_t; aMessage:Pwchar_t; aIconType:Pwchar_t):longint;cdecl;external; + function tinyfd_messageBoxW(aTitle:Pwchar_t; aMessage:Pwchar_t; aDialogType:Pwchar_t; aIconType:Pwchar_t; aDefaultButton:longint):longint;cdecl;external; + function tinyfd_inputBoxW(aTitle:Pwchar_t; aMessage:Pwchar_t; aDefaultInput:Pwchar_t):Pwchar_t;cdecl;external; + function tinyfd_saveFileDialogW(aTitle:Pwchar_t; aDefaultPathAndFile:Pwchar_t; aNumOfFilterPatterns:longint; aFilterPatterns:PPwchar_t; aSingleFilterDescription:Pwchar_t):Pwchar_t;cdecl;external; + function tinyfd_openFileDialogW(aTitle:Pwchar_t; aDefaultPathAndFile:Pwchar_t; aNumOfFilterPatterns:longint; aFilterPatterns:PPwchar_t; aSingleFilterDescription:Pwchar_t;aAllowMultipleSelects:longint):Pwchar_t;cdecl;external; + function tinyfd_selectFolderDialogW(aTitle:Pwchar_t; aDefaultPath:Pwchar_t):Pwchar_t;cdecl;external; + function tinyfd_colorChooserW(aTitle:Pwchar_t; aDefaultHexRGB:Pwchar_t; aDefaultRGB:array of byte; aoResultRGB:array of byte):Pwchar_t;cdecl;external; +{$endif} + +end. diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs.r b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs.r new file mode 100644 index 0000000..b2ae3f3 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs.r @@ -0,0 +1,157 @@ +# SPDX-License-Identifier: ZLIB +# Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com +# _________ +# / \ tinyfiledialogs v3.14.0 [Sep 12, 2023] +# |tiny file| +# | dialogs | +# \____ ___/ http://tinyfiledialogs.sourceforge.net +# \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + +# - License - +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. +# ___________________________________________________________ +# | | +# | If you like this new R interface please upvote | +# | my stackoverflow answer on the R post | +# | https://stackoverflow.com/a/77091332 | +# |___________________________________________________________| + + + + +# Load the appropriate tinyfd library + +# Macintosh +dyn.load("tinyfiledialogsAppleSilicon.dylib") +#dyn.load("tinyfiledialogsIntel.dylib") + +# Linux on Intel +#dyn.load("tinyfiledialogsLinux86.so") +#dyn.load("tinyfiledialogsLinux64.so") + +# Windows on Intel +#dyn.load("tinyfiledialogs32.dll") +#dyn.load("tinyfiledialogs64.dll") + + +# R interface to tinyfd C functions + +tinyfd_beep <- function() { + result <- .C("tinyfd_beep") + return(result) +} + + +tinyfd_notifyPopup <- function(aTitle, aMessage, aIconType) +{ + result <- .C("tinyfd_notifyPopup", + charToRaw(aTitle), + charToRaw(aMessage), + charToRaw(aIconType)) + + return(result) +} + + +tinyfd_messageBox <- function(aTitle , aMessage , aDialogType , aIconType , aDefaultButton) +{ + result <- .C("tfd_messageBox", + charToRaw(aTitle), + charToRaw(aMessage), + charToRaw(aDialogType), + charToRaw(aIconType), + lDefaultButton = as.integer(aDefaultButton) ) + + return(result$lDefaultButton) +} + + +tinyfd_inputBox <- function(aTitle , aMessage , aDefaultInput) # "NULL" for a password box +{ + result <- .C("tfd_inputBox", + charToRaw(aTitle), + charToRaw(aMessage), + lTextOutput = aDefaultInput ) + + if ( result$lTextOutput == "NULL" ) return() + else return(result$lTextOutput) +} + + +tinyfd_saveFileDialog <- function(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, + aFilterPatterns, aSingleFilterDescription ) +{ + result <- .C("tfd_saveFileDialog", + charToRaw(aTitle), + lSaveFile = aDefaultPathAndFile , + as.integer(aNumOfFilterPatterns) , + aFilterPatterns , + charToRaw(aSingleFilterDescription) ) + + if ( result$lSaveFile == "NULL" ) return() + else return(result$lSaveFile) +} + + +tinyfd_openFileDialog <- function(aTitle, aDefaultPathAndFile , aNumOfFilterPatterns, + aFilterPatterns, aSingleFilterDescription , aAllowMultipleSelects ) +{ + result <- .C("tfd_openFileDialog", + charToRaw(aTitle), + lOpenFile = aDefaultPathAndFile , + as.integer(aNumOfFilterPatterns) , + aFilterPatterns , + charToRaw(aSingleFilterDescription) , + as.integer(aAllowMultipleSelects) ) + + if ( result$lOpenFile == "NULL" ) return() + else return(result$lOpenFile) +} + + +tinyfd_selectFolderDialog <- function(aTitle, aDefaultPath) +{ + result <- .C("tfd_selectFolderDialog", + charToRaw(aTitle), + lSelectedFolder = aDefaultPath ) + + if ( result$lSelectedFolder == "NULL" ) return() + else return(result$lSelectedFolder) +} + + +tinyfd_colorChooser <- function(aTitle, aDefaultHexRGB) # "#FF0000" +{ + result <- .C("tfd_colorChooser", + charToRaw(aTitle), + lOutputHexRGB = aDefaultHexRGB ) + + if ( result$lOutputHexRGB == "NULL" ) return() + else return(result$lOutputHexRGB) +} + + +# example R calls to tinyfd functions + +tinyfd_beep() +tinyfd_notifyPopup( "a title" , "a message", "warning" ) +tinyfd_messageBox( "a title" , "a message" , "yesno" , "info" , 1 ) +tinyfd_inputBox( "a title" , "a message" , "NULL" ) # "NULL" for a password box +tinyfd_saveFileDialog( "a title" , "/Users/bardos/Documents/test.txt" , 0 , "" , "") +tinyfd_saveFileDialog( "a title" , "/Users/bardos/Documents/test.txt" , 1 , c ("*.txt","*.jpg") , "some files") +lFilename <- tinyfd_openFileDialog( "a title" , "/Users/bardos/Documents/" , 1 , c ("*.txt","*.jpg") , "some files" , 0 ) +lFilename +tinyfd_selectFolderDialog( "a title" , "/Users/bardos/Devs" ) +tinyfd_colorChooser( "a title" , "#FF0000" ) diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.dll b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.dll new file mode 100644 index 0000000..91f7019 Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.dll differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.lib b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.lib new file mode 100644 index 0000000..ea8a5ca Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs32.lib differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.dll b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.dll new file mode 100644 index 0000000..8aa3991 Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.dll differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.lib b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.lib new file mode 100644 index 0000000..3d74b2e Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs64.lib differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsAppleSilicon.dylib b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsAppleSilicon.dylib new file mode 100644 index 0000000..e76c77d Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsAppleSilicon.dylib differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsIntel.dylib b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsIntel.dylib new file mode 100644 index 0000000..40a51c8 Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsIntel.dylib differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux64.so b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux64.so new file mode 100644 index 0000000..f54319e Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux64.so differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux86.so b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux86.so new file mode 100644 index 0000000..099f4d7 Binary files /dev/null and b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsLinux86.so differ diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsTest.cs b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsTest.cs new file mode 100644 index 0000000..eaa293a --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogsTest.cs @@ -0,0 +1,153 @@ +©À/* SPDX-License-Identifier: ZLIB +Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com + _________ + / \ tinyfiledialogsTest.cs v3.15.1 [Nov 19, 2023] zlib licence + |tiny file| C# bindings created [2015] + | dialogs | + \____ ___/ http://tinyfiledialogs.sourceforge.net + \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd + ____________________________________________ + | | + | email: tinyfiledialogs at ysengrin.com | + |____________________________________________| + +If you like tinyfiledialogs, please upvote my stackoverflow answer +https://stackoverflow.com/a/47651444 + +- License - + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Runtime.InteropServices; + +class tinyfd +{ + public const string mDllLocation = "C:\\Users\\frogs\\yomspace2015\\yomlibs\\tinyfd\\dll_cs_lua_fortran_pascal\\tinyfiledialogs32.dll"; + + // cross platform UTF8 + [DllImport(mDllLocation, CallingConvention = CallingConvention.Cdecl)] + public static extern void tinyfd_beep(); + + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern int tinyfd_notifyPopup(string aTitle, string aMessage, string aIconType); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern int tinyfd_messageBox(string aTitle, string aMessage, string aDialogType, string aIconType, int aDefaultButton); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_inputBox(string aTitle, string aMessage, string aDefaultInput); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_saveFileDialog(string aTitle, string aDefaultPathAndFile, int aNumOfFilterPatterns, string[] aFilterPatterns, string aSingleFilterDescription); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_openFileDialog(string aTitle, string aDefaultPathAndFile, int aNumOfFilterPatterns, string[] aFilterPatterns, string aSingleFilterDescription, int aAllowMultipleSelects); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_selectFolderDialog(string aTitle, string aDefaultPathAndFile); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_colorChooser(string aTitle, string aDefaultHexRGB, byte[] aDefaultRGB, byte[] aoResultRGB); + + // windows only utf16 + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int tinyfd_notifyPopupW(string aTitle, string aMessage, string aIconType); + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int tinyfd_messageBoxW(string aTitle, string aMessage, string aDialogType, string aIconType, int aDefaultButton); + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_inputBoxW(string aTitle, string aMessage, string aDefaultInput); + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_saveFileDialogW(string aTitle, string aDefaultPathAndFile, int aNumOfFilterPatterns, string[] aFilterPatterns, string aSingleFilterDescription); + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_openFileDialogW(string aTitle, string aDefaultPathAndFile, int aNumOfFilterPatterns, string[] aFilterPatterns, string aSingleFilterDescription, int aAllowMultipleSelects); + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_selectFolderDialogW(string aTitle, string aDefaultPathAndFile); + [DllImport(mDllLocation, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_colorChooserW(string aTitle, string aDefaultHexRGB, byte[] aDefaultRGB, byte[] aoResultRGB); + + // cross platform + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr tinyfd_getGlobalChar(string aCharVariableName); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern int tinyfd_getGlobalInt(string aIntVariableName); + [DllImport(mDllLocation, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern int tinyfd_setGlobalInt(string aIntVariableName, int aValue); + + // ******** a complicated way to access tinyfd's global variables + // [DllImport("kernel32.dll", SetLastError = true)] internal static extern IntPtr GetProcAddress(IntPtr hModule, string procName); + // [DllImport("kernel32.dll", SetLastError = true)] internal static extern IntPtr LoadLibrary(string lpszLib); +} + +namespace ConsoleApplication1 +{ + class tinyfiledialogsTest + { + private static string stringFromAnsi(IntPtr ptr) // for UTF-8/char + { + return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ptr); + } + + private static string stringFromUni(IntPtr ptr) // for UTF-16/wchar_t + { + return System.Runtime.InteropServices.Marshal.PtrToStringUni(ptr); + } + + [STAThread] + static void Main(string[] args) + { + // ******** a simple way to access tinyfd's global variables + IntPtr lTheVersionText = tinyfd.tinyfd_getGlobalChar("tinyfd_version"); + string lTheVersionString = stringFromAnsi(lTheVersionText); + tinyfd.tinyfd_messageBox("tinyfd_version", lTheVersionString, "ok", "info", 1); + + // cross platform utf-8 + IntPtr lTheInputText = tinyfd.tinyfd_inputBox("input box", "gimme a string", "A text to input"); + string lTheInputString = stringFromAnsi(lTheInputText); + int lala = tinyfd.tinyfd_messageBox("a message box char", lTheInputString, "ok", "warning", 1); + + lTheInputText = tinyfd.tinyfd_selectFolderDialog("select a folder", ""); + lTheInputString = stringFromAnsi(lTheInputText); + lala = tinyfd.tinyfd_messageBox("the chosen folder", lTheInputString, "ok", "warning", 1); + + // windows only utf-16 + IntPtr lAnotherInputTextW = tinyfd.tinyfd_inputBoxW("input box", "gimme another string", "Another text to input"); + string lAnotherInputString = stringFromUni(lAnotherInputTextW); + int lili = tinyfd.tinyfd_messageBoxW("a message box wchar_t", lAnotherInputString, "ok", "info", 1); + + lAnotherInputTextW = tinyfd.tinyfd_selectFolderDialogW("select a folderW", ""); + lAnotherInputString = stringFromUni(lAnotherInputTextW); + lili = tinyfd.tinyfd_messageBoxW("a message box wchar_t", lAnotherInputString, "ok", "info", 1); + + tinyfd.tinyfd_notifyPopupW("just a dummy warning", lTheVersionString, "warning"); + + // cross platform + tinyfd.tinyfd_beep(); + + // ******** a complicated way to access tinyfd's global variables (uncomment the last 2 lines in the class tinyfd above) + // IntPtr tinyfd_DLL = tinyfd.LoadLibrary(tinyfd.mDllLocation); + // if (tinyfd_DLL != IntPtr.Zero) + // { + // IntPtr lVersionAddr = tinyfd.GetProcAddress(tinyfd_DLL, "tinyfd_version"); + // string lVersion = stringFromAnsi(lVersionAddr); + // IntPtr lForceConsoleAddr = tinyfd.GetProcAddress(tinyfd_DLL, "tinyfd_forceConsole"); + // if (lForceConsoleAddr != IntPtr.Zero) + // { + // int lForceConsoleValue = Marshal.ReadInt32(lForceConsoleAddr); + // tinyfd.tinyfd_notifyPopup(lVersion, lForceConsoleValue.ToString(), "info"); + // Marshal.WriteInt32(lForceConsoleAddr, 0); + // } + // } + } + } +} diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-32.bat b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-32.bat new file mode 100644 index 0000000..efea209 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-32.bat @@ -0,0 +1,29 @@ + +:: cd C:\Users\frogs\yomspace2015\yomlibs\tinyfd\dll_cs_lua_fortran_pascal + +\MinGW32-49\bin\gcc -ansi -std=gnu89 -pedantic -Wstrict-prototypes -Wall -c ../tinyfiledialogs.c +\MinGW32-49\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\MinGW32-49\bin\gcc -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -LC:/MinGW/lib -lcomdlg32 -lole32 +\MinGW32-49\bin\gcc -ansi -std=gnu89 -pedantic -Wstrict-prototypes -Wall -o hello32.exe ../hello.c tinyfiledialogs32.lib +\MinGW32-49\bin\gcc -ansi -std=gnu89 -pedantic -Wstrict-prototypes -Wall -o helloW32.exe ../hello_wchar_t.c tinyfiledialogs32.lib + +\MinGW32-49\bin\gcc -pedantic -Wstrict-prototypes -Wall -c ../tinyfiledialogs.c +\MinGW32-49\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\MinGW32-49\bin\gcc -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -LC:/MinGW/lib -lcomdlg32 -lole32 +\MinGW32-49\bin\gcc -pedantic -Wstrict-prototypes -Wall -o hello32.exe ../hello.c tinyfiledialogs32.lib +\MinGW32-49\bin\gcc -pedantic -Wstrict-prototypes -Wall -o helloW32.exe ../hello_wchar_t.c tinyfiledialogs32.lib + + +\MinGW32-63\bin\gcc -ansi -std=gnu89 -pedantic -Wstrict-prototypes -Wall -c ../tinyfiledialogs.c +\MinGW32-63\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\MinGW32-63\bin\gcc -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -LC:/MinGW63/lib -lcomdlg32 -lole32 +\MinGW32-63\bin\gcc -ansi -std=gnu89 -pedantic -Wstrict-prototypes -Wall -o hello32.exe ../hello.c tinyfiledialogs32.lib +\MinGW32-63\bin\gcc -ansi -std=gnu89 -pedantic -Wstrict-prototypes -Wall -o helloW32.exe ../hello_wchar_t.c tinyfiledialogs32.lib + +\MinGW32-63\bin\gcc -pedantic -Wstrict-prototypes -Wall -c ../tinyfiledialogs.c +\MinGW32-63\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\MinGW32-63\bin\gcc -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -LC:/MinGW63/lib -lcomdlg32 -lole32 +\MinGW32-63\bin\gcc -pedantic -Wstrict-prototypes -Wall -o hello32.exe ../hello.c tinyfiledialogs32.lib +\MinGW32-63\bin\gcc -pedantic -Wstrict-prototypes -Wall -o helloW32.exe ../hello_wchar_t.c tinyfiledialogs32.lib + +@REM -std=gnu89 -Ofast -std=c++11 diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-720.bat b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-720.bat new file mode 100644 index 0000000..e37e000 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-720.bat @@ -0,0 +1,29 @@ +:: cd C:\Users\frogs\yomspace2015\yomlibs\tinyfd\dll_cs_lua_fortran_pascal + +:: x86 +\mingw-w64-720\mingw32\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m32 -Wall -c ../tinyfiledialogs.c +\mingw-w64-720\mingw32\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\mingw-w64-720\mingw32\bin\gcc -m32 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -L\mingw-w64-720\mingw32\lib -lcomdlg32 -lole32 +\mingw-w64-720\mingw32\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m32 -Wall -o hello32.exe ../hello.c tinyfiledialogs32.lib +\mingw-w64-720\mingw32\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m32 -Wall -o helloW32.exe ../hello_wchar_t.c tinyfiledialogs32.lib + +\mingw-w64-720\mingw32\bin\gcc -pedantic -Wstrict-prototypes -m32 -Wall -c ../tinyfiledialogs.c +\mingw-w64-720\mingw32\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\mingw-w64-720\mingw32\bin\gcc -m32 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -L\mingw-w64-720\mingw32\lib -lcomdlg32 -lole32 +\mingw-w64-720\mingw32\bin\gcc -pedantic -Wstrict-prototypes -m32 -Wall -o hello32.exe ../hello.c tinyfiledialogs32.lib +\mingw-w64-720\mingw32\bin\gcc -pedantic -Wstrict-prototypes -m32 -Wall -o helloW32.exe ../hello_wchar_t.c tinyfiledialogs32.lib + +:: x64 +\mingw-w64-720\mingw64\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m64 -Wall -c ../tinyfiledialogs.c +\mingw-w64-720\mingw64\bin\dlltool --export-all-symbols -l tinyfiledialogs64.lib tinyfiledialogs.o --dllname tinyfiledialogs64.dll +\mingw-w64-720\mingw64\bin\gcc -m64 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs64.dll -L\mingw-w64-720\mingw64\lib -lcomdlg32 -lole32 +\mingw-w64-720\mingw64\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m64 -Wall -o hello64.exe ../hello.c tinyfiledialogs64.lib +\mingw-w64-720\mingw64\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m64 -Wall -o helloW64.exe ../hello_wchar_t.c tinyfiledialogs64.lib + +\mingw-w64-720\mingw64\bin\gcc -pedantic -Wstrict-prototypes -m64 -Wall -c ../tinyfiledialogs.c +\mingw-w64-720\mingw64\bin\dlltool --export-all-symbols -l tinyfiledialogs64.lib tinyfiledialogs.o --dllname tinyfiledialogs64.dll +\mingw-w64-720\mingw64\bin\gcc -m64 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs64.dll -L\mingw-w64-720\mingw64\lib -lcomdlg32 -lole32 +\mingw-w64-720\mingw64\bin\gcc -pedantic -Wstrict-prototypes -m64 -Wall -o hello64.exe ../hello.c tinyfiledialogs64.lib +\mingw-w64-720\mingw64\bin\gcc -pedantic -Wstrict-prototypes -m64 -Wall -o helloW64.exe ../hello_wchar_t.c tinyfiledialogs64.lib + +@REM \mingw-w64\mingw64\bin\gcc -std=c89 -o hello.exe tinyfiledialogs.c hello.c -LC:\mingw-w64\mingw64\lib -lcomdlg32 -lole32 diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-810.bat b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-810.bat new file mode 100644 index 0000000..a5e7ae7 --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dll_mingw-w64-810.bat @@ -0,0 +1,29 @@ +:: cd C:\Users\frogs\yomspace2015\yomlibs\tinyfd\dll_cs_lua_R_fortran_pascal + +:: x86 +\mingw-w64-13.2.0\mingw32\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m32 -Wall -c ..\tinyfiledialogs.c +\mingw-w64-13.2.0\mingw32\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\mingw-w64-13.2.0\mingw32\bin\gcc -m32 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -L\mingw-w64-13.2.0\mingw32\lib -lcomdlg32 -lole32 +\mingw-w64-13.2.0\mingw32\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m32 -Wall -o hello32.exe ..\hello.c tinyfiledialogs32.lib +\mingw-w64-13.2.0\mingw32\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m32 -Wall -o helloW32.exe ..\hello_wchar_t.c tinyfiledialogs32.lib + +\mingw-w64-13.2.0\mingw32\bin\gcc -pedantic -Wstrict-prototypes -m32 -Wall -c ..\tinyfiledialogs.c +\mingw-w64-13.2.0\mingw32\bin\dlltool --export-all-symbols -l tinyfiledialogs32.lib tinyfiledialogs.o --dllname tinyfiledialogs32.dll +\mingw-w64-13.2.0\mingw32\bin\gcc -m32 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs32.dll -L\mingw-w64-13.2.0\mingw32\lib -lcomdlg32 -lole32 +\mingw-w64-13.2.0\mingw32\bin\gcc -pedantic -Wstrict-prototypes -m32 -Wall -o hello32.exe ..\hello.c tinyfiledialogs32.lib +\mingw-w64-13.2.0\mingw32\bin\gcc -pedantic -Wstrict-prototypes -m32 -Wall -o helloW32.exe ..\hello_wchar_t.c tinyfiledialogs32.lib + +:: x64 +\mingw-w64-13.2.0\mingw64\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m64 -Wall -c ..\tinyfiledialogs.c +\mingw-w64-13.2.0\mingw64\bin\dlltool --export-all-symbols -l tinyfiledialogs64.lib tinyfiledialogs.o --dllname tinyfiledialogs64.dll +\mingw-w64-13.2.0\mingw64\bin\gcc -m64 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs64.dll -L\mingw-w64-13.2.0\mingw64\lib -lcomdlg32 -lole32 +\mingw-w64-13.2.0\mingw64\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m64 -Wall -o hello64.exe ..\hello.c tinyfiledialogs64.lib +\mingw-w64-13.2.0\mingw64\bin\gcc -ansi -std=c89 -pedantic -Wstrict-prototypes -m64 -Wall -o helloW64.exe ..\hello_wchar_t.c tinyfiledialogs64.lib + +\mingw-w64-13.2.0\mingw64\bin\gcc -pedantic -Wstrict-prototypes -m64 -Wall -c ..\tinyfiledialogs.c +\mingw-w64-13.2.0\mingw64\bin\dlltool --export-all-symbols -l tinyfiledialogs64.lib tinyfiledialogs.o --dllname tinyfiledialogs64.dll +\mingw-w64-13.2.0\mingw64\bin\gcc -m64 -shared -static-libgcc tinyfiledialogs.o -o tinyfiledialogs64.dll -L\mingw-w64-13.2.0\mingw64\lib -lcomdlg32 -lole32 +\mingw-w64-13.2.0\mingw64\bin\gcc -pedantic -Wstrict-prototypes -m64 -Wall -o hello64.exe ..\hello.c tinyfiledialogs64.lib +\mingw-w64-13.2.0\mingw64\bin\gcc -pedantic -Wstrict-prototypes -m64 -Wall -o helloW64.exe ..\hello_wchar_t.c tinyfiledialogs64.lib + +@REM \mingw-w64\mingw64\bin\gcc -std=c89 -o hello.exe tinyfiledialogs.c hello.c -LC:\mingw-w64\mingw64\lib -lcomdlg32 -lole32 diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dylib.sh b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dylib.sh new file mode 100644 index 0000000..dd7d81b --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_dylib.sh @@ -0,0 +1,18 @@ +#! /bin/sh + +# clang -c ../tinyfiledialogs.c +# clang -dynamiclib tinyfiledialogs.o -o tinyfiledialogsIntel.dylib +# clang -o hello.app ../hello.c ./tinyfiledialogsIntel.dylib + +clang -c ../tinyfiledialogs.c + +if [ `uname -s` = "Darwin" ]; then + echo Darwin + if [ `uname -m` = "x86_64" ]; then + echo x86_64 + clang -dynamiclib tinyfiledialogs.o -o tinyfiledialogsIntel.dylib + elif [ `uname -m` = "arm64" ]; then + echo arm64 + clang -dynamiclib tinyfiledialogs.o -o tinyfiledialogsAppleSilicon.dylib + fi +fi diff --git a/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_so.sh b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_so.sh new file mode 100644 index 0000000..2a40f9b --- /dev/null +++ b/libs/tinyfiledialogs/dll_cs_lua_R_fortran_pascal/tinyfiledialogs_so.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +if [ `uname -s` = "Linux" ]; then + echo Linux 32 + gcc -m32 -fPIC -shared -o tinyfiledialogsLinux86.so ../tinyfiledialogs.c + gcc -m32 -o hello ../hello.c ./tinyfiledialogsLinux86.so + + echo Linux 64 + gcc -m64 -fPIC -shared -o tinyfiledialogsLinux64.so ../tinyfiledialogs.c + gcc -m64 -o hello ../hello.c ./tinyfiledialogsLinux64.so +elif [ `uname -s` = "OpenBSD" ]; then + echo OpenBSD + clang -m32 -fPIC -shared -o tinyfiledialogsOpenBSDx86.so ../tinyfiledialogs.c + clang -m32 -o hello ../hello.c ./tinyfiledialogsOpenBSDx86.so + + clang -m64 -fPIC -shared -o tinyfiledialogsOpenBSDx64.so ../tinyfiledialogs.c + clang -m64 -o hello ../hello.c ./tinyfiledialogsOpenBSDx64.so +else + echo Other Unix +fi -- cgit v1.2.3-70-g09d2