|
refactoredCPPNeuronMesher
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <sys/stat.h>#include <limits.h>#include <unistd.h>#include <dirent.h>#include <termios.h>#include <sys/utsname.h>#include <signal.h>#include "tinyfiledialogs.h"
Macros | |
| #define | TINYFD_SLASH "/" |
| #define | MAX_PATH_OR_CMD 1024 /* _MAX_PATH or MAX_PATH */ |
| #define | MAX_MULTIPLE_FILES 1024 |
| #define | LOW_MULTIPLE_FILES 32 |
Functions | |
| static int | getenvDISPLAY (void) |
| static char * | getCurDir (void) |
| static char * | getPathWithoutFinalSlash (char *aoDestination, char const *aSource) |
| static char * | getLastName (char *aoDestination, char const *aSource) |
| static void | ensureFinalSlash (char *aioString) |
| static void | Hex2RGB (char const aHexRGB[8], unsigned char aoResultRGB[3]) |
| static void | RGB2Hex (unsigned char const aRGB[3], char aoResultHexRGB[8]) |
| void | tfd_replaceSubStr (char const *aSource, char const *aOldSubStr, char const *aNewSubStr, char *aoDestination) |
| static int | filenameValid (char const *aFileNameWithoutPath) |
| static int | fileExists (char const *aFilePathAndName) |
| static void | wipefile (char const *aFilename) |
| int | tfd_quoteDetected (char const *aString) |
| char const * | tinyfd_getGlobalChar (char const *aCharVariableName) |
| int | tinyfd_getGlobalInt (char const *aIntVariableName) |
| int | tinyfd_setGlobalInt (char const *aIntVariableName, int aValue) |
| static char * | ensureFilesExist (char *aDestination, char const *aSourcePathsAndNames) |
| int | tfd_isDarwin (void) |
| static int | dirExists (char const *aDirPath) |
| static int | detectPresence (char const *aExecutable) |
| static char * | getVersion (char const *aExecutable) |
| static int * | getMajorMinorPatch (char const *aExecutable) |
| static int | tryCommand (char const *aCommand) |
| static int | isTerminalRunning (void) |
| static char * | dialogNameOnly (void) |
| int | isDialogVersionBetter09b (void) |
| static int | whiptailPresentOnly (void) |
| static char * | terminalName (void) |
| static char * | dialogName (void) |
| static int | whiptailPresent (void) |
| static int | graphicMode (void) |
| static int | ffplayPresent (void) |
| static int | pactlPresent (void) |
| static int | speakertestPresent (void) |
| static int | playPresent (void) |
| static int | beepexePresent (void) |
| static int | playsoundPresent (void) |
| static int | paplayPresent (void) |
| static int | xmessagePresent (void) |
| static int | gxmessagePresent (void) |
| static int | gmessagePresent (void) |
| static int | notifysendPresent (void) |
| static int | perlPresent (void) |
| static int | afplayPresent (void) |
| static int | xdialogPresent (void) |
| static int | gdialogPresent (void) |
| static int | osascriptPresent (void) |
| static int | dunstifyPresent (void) |
| static int | dunstPresent (void) |
| int | tfd_qarmaPresent (void) |
| int | tfd_matedialogPresent (void) |
| int | tfd_shellementaryPresent (void) |
| int | tfd_xpropPresent (void) |
| int | tfd_zenityPresent (void) |
| int | tfd_yadPresent (void) |
| int | tfd_zenity3Present (void) |
| int | tfd_kdialogPresent (void) |
| static int | osx9orBetter (void) |
| static int | python3Present (void) |
| static int | python2Present (void) |
| static int | tkinter3Present (void) |
| static int | tkinter2Present (void) |
| static int | pythonDbusPresent (void) |
| static void | sigHandler (int signum) |
| void | tinyfd_beep (void) |
| int | tinyfd_messageBox (char const *aTitle, char const *aMessage, char const *aDialogType, char const *aIconType, int aDefaultButton) |
| int | tinyfd_notifyPopup (char const *aTitle, char const *aMessage, char const *aIconType) |
| char * | tinyfd_inputBox (char const *aTitle, char const *aMessage, char const *aDefaultInput) |
| char * | tinyfd_saveFileDialog (char const *aTitle, char const *aDefaultPathAndOrFile, int aNumOfFilterPatterns, char const *const *aFilterPatterns, char const *aSingleFilterDescription) |
| char * | tinyfd_openFileDialog (char const *aTitle, char const *aDefaultPathAndOrFile, int aNumOfFilterPatterns, char const *const *aFilterPatterns, char const *aSingleFilterDescription, int aAllowMultipleSelects) |
| char * | tinyfd_selectFolderDialog (char const *aTitle, char const *aDefaultPath) |
| char * | tinyfd_colorChooser (char const *aTitle, char const *aDefaultHexRGB, unsigned char const aDefaultRGB[3], unsigned char aoResultRGB[3]) |
| void | tfd_messageBox (char const *aTitle, char const *aMessage, char const *aDialogType, char const *aIconType, int *aiDefaultButton) |
| void | tfd_inputBox (char const *aTitle, char const *aMessage, char **aiDefaultInput) |
| void | tfd_saveFileDialog (char const *aTitle, char **aiDefaultPathAndFile, int const *aNumOfFilterPatterns, char const *const *aFilterPatterns, char const *aSingleFilterDescription) |
| void | tfd_openFileDialog (char const *aTitle, char **aiDefaultPathAndFile, int const *aNumOfFilterPatterns, char const *const *aFilterPatterns, char const *aSingleFilterDescription, int const *aAllowMultipleSelects) |
| void | tfd_selectFolderDialog (char const *aTitle, char **aiDefaultPath) |
| void | tfd_colorChooser (char const *aTitle, char **aiDefaultHexRGB) |
Variables | |
| char | tinyfd_version [8] = "3.19.1" |
| int | tinyfd_verbose = 0 |
| int | tinyfd_silent = 1 |
| int | tinyfd_allowCursesDialogs = 0 |
| int | tinyfd_forceConsole = 0 |
| char | tinyfd_response [1024] |
| static int | gWarningDisplayed = 0 |
| static char | gTitle [] ="missing software! (we will try basic console input)" |
| char | tinyfd_needs [] |
| static char | gPython2Name [16] |
| static char | gPython3Name [16] |
| static char | gPythonName [16] |
| #define LOW_MULTIPLE_FILES 32 |
| #define MAX_MULTIPLE_FILES 1024 |
| #define MAX_PATH_OR_CMD 1024 /* _MAX_PATH or MAX_PATH */ |
| #define TINYFD_SLASH "/" |
|
static |


|
static |


|
static |

|
static |


|
static |


|
static |

|
static |


|
static |


|
static |


|
static |

|
static |


|
static |

|
static |

|
static |


|
static |

|
static |

|
static |

|
static |


|
static |

|
static |

|
static |


|
static |


|
static |


|
static |

| int isDialogVersionBetter09b | ( | void | ) |


|
static |

|
static |


|
static |


|
static |

|
static |


|
static |


|
static |


|
static |


|
static |


|
static |


|
static |


|
static |


|
static |

|
static |

|
static |


|
static |


| void tfd_colorChooser | ( | char const * | aTitle, |
| char ** | aiDefaultHexRGB | ||
| ) |

| void tfd_inputBox | ( | char const * | aTitle, |
| char const * | aMessage, | ||
| char ** | aiDefaultInput | ||
| ) |

| int tfd_isDarwin | ( | void | ) |

| int tfd_kdialogPresent | ( | void | ) |


| int tfd_matedialogPresent | ( | void | ) |


| void tfd_messageBox | ( | char const * | aTitle, |
| char const * | aMessage, | ||
| char const * | aDialogType, | ||
| char const * | aIconType, | ||
| int * | aiDefaultButton | ||
| ) |

| void tfd_openFileDialog | ( | char const * | aTitle, |
| char ** | aiDefaultPathAndFile, | ||
| int const * | aNumOfFilterPatterns, | ||
| char const *const * | aFilterPatterns, | ||
| char const * | aSingleFilterDescription, | ||
| int const * | aAllowMultipleSelects | ||
| ) |

| int tfd_qarmaPresent | ( | void | ) |


| int tfd_quoteDetected | ( | char const * | aString | ) |

| void tfd_replaceSubStr | ( | char const * | aSource, |
| char const * | aOldSubStr, | ||
| char const * | aNewSubStr, | ||
| char * | aoDestination | ||
| ) |

| void tfd_saveFileDialog | ( | char const * | aTitle, |
| char ** | aiDefaultPathAndFile, | ||
| int const * | aNumOfFilterPatterns, | ||
| char const *const * | aFilterPatterns, | ||
| char const * | aSingleFilterDescription | ||
| ) |

| void tfd_selectFolderDialog | ( | char const * | aTitle, |
| char ** | aiDefaultPath | ||
| ) |

| int tfd_shellementaryPresent | ( | void | ) |


| int tfd_xpropPresent | ( | void | ) |


| int tfd_yadPresent | ( | void | ) |


| int tfd_zenity3Present | ( | void | ) |


| int tfd_zenityPresent | ( | void | ) |


| void tinyfd_beep | ( | void | ) |

| char* tinyfd_colorChooser | ( | char const * | aTitle, |
| char const * | aDefaultHexRGB, | ||
| unsigned char const | aDefaultRGB[3], | ||
| unsigned char | aoResultRGB[3] | ||
| ) |


| char const* tinyfd_getGlobalChar | ( | char const * | aCharVariableName | ) |
| int tinyfd_getGlobalInt | ( | char const * | aIntVariableName | ) |
| char* tinyfd_inputBox | ( | char const * | aTitle, |
| char const * | aMessage, | ||
| char const * | aDefaultInput | ||
| ) |


| int tinyfd_messageBox | ( | char const * | aTitle, |
| char const * | aMessage, | ||
| char const * | aDialogType, | ||
| char const * | aIconType, | ||
| int | aDefaultButton | ||
| ) |


| int tinyfd_notifyPopup | ( | char const * | aTitle, |
| char const * | aMessage, | ||
| char const * | aIconType | ||
| ) |

| char* tinyfd_openFileDialog | ( | char const * | aTitle, |
| char const * | aDefaultPathAndOrFile, | ||
| int | aNumOfFilterPatterns, | ||
| char const *const * | aFilterPatterns, | ||
| char const * | aSingleFilterDescription, | ||
| int | aAllowMultipleSelects | ||
| ) |


| char* tinyfd_saveFileDialog | ( | char const * | aTitle, |
| char const * | aDefaultPathAndOrFile, | ||
| int | aNumOfFilterPatterns, | ||
| char const *const * | aFilterPatterns, | ||
| char const * | aSingleFilterDescription | ||
| ) |


| char* tinyfd_selectFolderDialog | ( | char const * | aTitle, |
| char const * | aDefaultPath | ||
| ) |


| int tinyfd_setGlobalInt | ( | char const * | aIntVariableName, |
| int | aValue | ||
| ) |
|
static |


|
static |


|
static |

|
static |


|
static |


|
static |

|
static |


|
static |


|
static |
|
static |
|
static |
|
static |
|
static |
| int tinyfd_allowCursesDialogs = 0 |
Curses dialogs are difficult to use and counter-intuitive. On windows they are only ascii and still uses the unix backslash !
| int tinyfd_forceConsole = 0 |
| char tinyfd_needs[] |
| char tinyfd_response[1024] |
| int tinyfd_silent = 1 |
| int tinyfd_verbose = 0 |
| char tinyfd_version[8] = "3.19.1" |