Nebula
Loading...
Searching...
No Matches
ImGuiFileDialog.h
Go to the documentation of this file.
1/*
2 _____ _____ _ ______ _ _ _____ _ _
3 |_ _| / ____| (_)| ____|(_)| | | __ \ (_) | |
4 | | _ __ ___ | | __ _ _ _ | |__ _ | | ___ | | | | _ __ _ | | ___ __ _
5 | | | '_ ` _ \ | | |_ || | | || || __| | || | / _ \| | | || | / _` || | / _ \ / _` |
6 _| |_ | | | | | || |__| || |_| || || | | || || __/| |__| || || (_| || || (_) || (_| |
7 |_____||_| |_| |_| \_____| \__,_||_||_| |_||_| \___||_____/ |_| \__,_||_| \___/ \__, |
8 __/ |
9 |___/
10 ___ __ ___
11 / _ \ / / / _ \
12 __ __| | | | / /_ | (_) |
13 \ \ / /| | | | | '_ \ \__, |
14 \ V / | |_| |_| (_) |_ / /
15 \_/ \___/(_)\___/(_)/_/
16
17
18GITHUB REPOT : https://github.com/aiekick/ImGuiFileDialog
19DOCUMENTATION : see the attached Documentation.md
20
21generated with "Text to ASCII Art Generator (TAAG)"
22https://patorjk.com/software/taag/#p=display&h=1&v=0&f=Big&t=ImGuiFileDialog%0Av0.6.9
23
24MIT License
25
26Copyright (c) 2018-2025 Stephane Cuillerdier (aka aiekick)
27
28Permission is hereby granted, free of charge, to any person obtaining a copy
29of this software and associated documentation files (the "Software"), to deal
30in the Software without restriction, including without limitation the rights
31to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32copies of the Software, and to permit persons to whom the Software is
33furnished to do so, subject to the following conditions:
34
35The above copyright notice and this permission notice shall be included in all
36copies or substantial portions of the Software.
37
38THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44SOFTWARE.
45*/
46
47#pragma once
48
49#define IGFD_VERSION "v0.6.9 WIP"
50#define IGFD_IMGUI_SUPPORTED_VERSION "1.92.3"
51
52// Config file
53#ifndef CUSTOM_IMGUIFILEDIALOG_CONFIG
55#else // CUSTOM_IMGUIFILEDIALOG_CONFIG
56#include CUSTOM_IMGUIFILEDIALOG_CONFIG
57#endif // CUSTOM_IMGUIFILEDIALOG_CONFIG
58
59// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
60// Using ImGuiFileDialog via a shared library is not recommended, because we don't guarantee
61// backward nor forward ABI compatibility and also function call overhead. If you
62// do use ImGuiFileDialog as a DLL, be sure to call ImGui::SetImGuiContext (see ImGui doc Miscellanous section).
63
64#ifndef IGFD_API
65#define IGFD_API
66#endif // IGFD_API
67
71
72// file style enum for file display (color, icon, font)
73typedef int IGFD_FileStyleFlags; // -> enum IGFD_FileStyleFlags_
74enum IGFD_FileStyleFlags_ // by evaluation / priority order
75{
76 IGFD_FileStyle_None = 0, // define none style
77 IGFD_FileStyleByTypeFile = (1 << 0), // define style for all files
78 IGFD_FileStyleByTypeDir = (1 << 1), // define style for all dir
79 IGFD_FileStyleByTypeLink = (1 << 2), // define style for all link
80 IGFD_FileStyleByExtention = (1 << 3), // define style by extention, for files or links
81 IGFD_FileStyleByFullName = (1 << 4), // define style for particular file/dir/link full name (filename + extention)
82 IGFD_FileStyleByContainedInFullName = (1 << 5), // define style for file/dir/link when criteria is contained in full name
83};
84
85typedef int ImGuiFileDialogFlags; // -> enum ImGuiFileDialogFlags_
87 ImGuiFileDialogFlags_None = 0, // define none default flag
88 ImGuiFileDialogFlags_ConfirmOverwrite = (1 << 0), // show confirm to overwrite dialog
89 ImGuiFileDialogFlags_DontShowHiddenFiles = (1 << 1), // dont show hidden file (file starting with a .)
90 ImGuiFileDialogFlags_DisableCreateDirectoryButton = (1 << 2), // disable the create directory button
91 ImGuiFileDialogFlags_HideColumnType = (1 << 3), // hide column file type
92 ImGuiFileDialogFlags_HideColumnSize = (1 << 4), // hide column file size
93 ImGuiFileDialogFlags_HideColumnDate = (1 << 5), // hide column file date
94 ImGuiFileDialogFlags_NoDialog = (1 << 6), // let the dialog embedded in your own imgui begin / end scope
95 ImGuiFileDialogFlags_ReadOnlyFileNameField = (1 << 7), // don't let user type in filename field for file open style dialogs
96 ImGuiFileDialogFlags_CaseInsensitiveExtentionFiltering = (1 << 8), // the file extentions filtering will not take into account the case
97 ImGuiFileDialogFlags_Modal = (1 << 9), // modal
98 ImGuiFileDialogFlags_DisableThumbnailMode = (1 << 10), // disable the thumbnail mode
99 ImGuiFileDialogFlags_DisablePlaceMode = (1 << 11), // disable the place mode
100 ImGuiFileDialogFlags_DisableQuickPathSelection = (1 << 12), // disable the quick path selection
101 ImGuiFileDialogFlags_ShowDevicesButton = (1 << 13), // show the devices selection button
102 ImGuiFileDialogFlags_NaturalSorting = (1 << 14), // enable the antural sorting for filenames and extentions, slower than standard sorting
103 ImGuiFileDialogFlags_OptionalFileName = (1 << 15), // the input filename is optional, so the dialog can be validated even if the filebname input is empty
104
105 // default behavior when no flags is defined. seems to be the more common cases
109};
110
111// flags used for GetFilePathName(flag) or GetSelection(flag)
112typedef int IGFD_ResultMode; // -> enum IGFD_ResultMode_
114 // IGFD_ResultMode_AddIfNoFileExt
115 // add the file ext only if there is no file ext
116 // filter {.cpp,.h} with file :
117 // toto.h => toto.h
118 // toto.a.h => toto.a.h
119 // toto.a. => toto.a.cpp
120 // toto. => toto.cpp
121 // toto => toto.cpp
122 // filter {.z,.a.b} with file :
123 // toto.a.h => toto.a.h
124 // toto. => toto.z
125 // toto => toto.z
126 // filter {.g.z,.a} with file :
127 // toto.a.h => toto.a.h
128 // toto. => toto.g.z
129 // toto => toto.g.z
131
132 // IGFD_ResultMode_OverwriteFileExt
133 // Overwrite the file extention by the current filter :
134 // filter {.cpp,.h} with file :
135 // toto.h => toto.cpp
136 // toto.a.h => toto.a.cpp
137 // toto.a. => toto.a.cpp
138 // toto.a.h.t => toto.a.h.cpp
139 // toto. => toto.cpp
140 // toto => toto.cpp
141 // filter {.z,.a.b} with file :
142 // toto.a.h => toto.z
143 // toto.a.h.t => toto.a.z
144 // toto. => toto.z
145 // toto => toto.z
146 // filter {.g.z,.a} with file :
147 // toto.a.h => toto.g.z
148 // toto.a.h.y => toto.a.g.z
149 // toto.a. => toto.g.z
150 // toto. => toto.g.z
151 // toto => toto.g.z
152 IGFD_ResultMode_OverwriteFileExt = 1, // behavior pre IGFD v0.6.6
153
154 // IGFD_ResultMode_KeepInputFile
155 // keep the input file => no modification :
156 // filter {.cpp,.h} with file :
157 // toto.h => toto.h
158 // toto. => toto.
159 // toto => toto
160 // filter {.z,.a.b} with file :
161 // toto.a.h => toto.a.h
162 // toto. => toto.
163 // toto => toto
164 // filter {.g.z,.a} with file :
165 // toto.a.h => toto.a.h
166 // toto. => toto.
167 // toto => toto
169};
170
174
175#ifdef USE_THUMBNAILS
176struct IGFD_Thumbnail_Info {
177 int isReadyToDisplay = 0; // ready to be rendered, so texture created
178 int isReadyToUpload = 0; // ready to upload to gpu
179 int isLoadingOrLoaded = 0; // was sent to laoding or loaded
180 int textureWidth = 0; // width of the texture to upload
181 int textureHeight = 0; // height of the texture to upload
182 int textureChannels = 0; // count channels of the texture to upload
183 unsigned char* textureFileDatas = 0; // file texture datas, will be rested to null after gpu upload
184 void* textureID = 0; // 2d texture id (void* is like ImtextureID type) (GL, DX, VK, Etc..)
185 void* userDatas = 0; // user datas
186};
187#endif // USE_THUMBNAILS
188
189// stdint is used for cpp and c apĂ® (cstdint is only for cpp)
190#include <stdint.h>
191
192#ifdef __cplusplus
193
194#ifndef IMGUI_DEFINE_MATH_OPERATORS
195#define IMGUI_DEFINE_MATH_OPERATORS
196#endif // IMGUI_DEFINE_MATH_OPERATORS
197
198#ifdef IMGUI_INCLUDE
199#include IMGUI_INCLUDE
200#else // IMGUI_INCLUDE
201#include <imgui.h>
202#endif // IMGUI_INCLUDE
203
204#include <set>
205#include <map>
206#include <list>
207#include <regex>
208#include <array>
209#include <mutex>
210#include <condition_variable>
211#include <thread>
212#include <cfloat>
213#include <memory>
214#include <string>
215#include <vector>
216#include <utility>
217#include <fstream>
218#include <functional>
219#include <unordered_map>
220
221#ifndef defaultSortField
222#define defaultSortField FIELD_FILENAME
223#endif // defaultSortField
224
225#ifndef defaultSortOrderFilename
226#define defaultSortOrderFilename true
227#endif // defaultSortOrderFilename
228#ifndef defaultSortOrderType
229#define defaultSortOrderType true
230#endif // defaultSortOrderType
231#ifndef defaultSortOrderSize
232#define defaultSortOrderSize true
233#endif // defaultSortOrderSize
234#ifndef defaultSortOrderDate
235#define defaultSortOrderDate true
236#endif // defaultSortOrderDate
237#ifndef defaultSortOrderThumbnails
238#define defaultSortOrderThumbnails true
239#endif // defaultSortOrderThumbnails
240
241#ifndef MAX_FILE_DIALOG_NAME_BUFFER
242#define MAX_FILE_DIALOG_NAME_BUFFER 1024
243#endif // MAX_FILE_DIALOG_NAME_BUFFER
244
245#ifndef MAX_PATH_BUFFER_SIZE
246#define MAX_PATH_BUFFER_SIZE 1024
247#endif // MAX_PATH_BUFFER_SIZE
248
249#ifndef EXT_MAX_LEVEL
250#define EXT_MAX_LEVEL 10U
251#endif // EXT_MAX_LEVEL
252
253namespace IGFD {
254
255template <typename T>
256class SearchableVector {
257private:
258 std::unordered_map<T, size_t> m_Dico;
259 std::vector<T> m_Array;
260
261public:
262 void clear() {
263 m_Dico.clear();
264 m_Array.clear();
265 }
266 bool empty() const {
267 return m_Array.empty();
268 }
269 size_t size() const {
270 return m_Array.size();
271 }
272 T& operator[](const size_t& vIdx) {
273 return m_Array[vIdx];
274 }
275 T& at(const size_t& vIdx) {
276 return m_Array.at(vIdx);
277 }
278 typename std::vector<T>::iterator begin() {
279 return m_Array.begin();
280 }
281 typename std::vector<T>::const_iterator begin() const {
282 return m_Array.begin();
283 }
284 typename std::vector<T>::iterator end() {
285 return m_Array.end();
286 }
287 typename std::vector<T>::const_iterator end() const {
288 return m_Array.end();
289 }
290
291 bool try_add(T vKey) {
292 if (!exist(vKey)) {
293 m_Dico[vKey] = m_Array.size();
294 m_Array.push_back(vKey);
295 return true;
296 }
297 return false;
298 }
299
300 bool try_set_existing(T vKey) {
301 if (exist(vKey)) {
302 auto row = m_Dico.at(vKey);
303 m_Array[row] = vKey;
304 return true;
305 }
306 return false;
307 }
308
309 bool exist(const std::string& vKey) const {
310 return (m_Dico.find(vKey) != m_Dico.end());
311 }
312};
313
314class IGFD_API FileInfos;
315class IGFD_API FileDialogInternal;
316
317class IGFD_API Utils {
318 friend class TestUtils;
319
320public:
321 struct PathStruct {
322 std::string path;
323 std::string name;
324 std::string ext;
325 bool isOk = false;
326 };
327
328public:
329 static bool ImSplitter(bool split_vertically, float thickness, float* size1, float* size2, float min_size1, float min_size2, float splitter_long_axis_size = -1.0f);
330 static bool ReplaceString(std::string& str, const std::string& oldStr, const std::string& newStr, const size_t& vMaxRecursion = 10U);
331 static void AppendToBuffer(char* vBuffer, size_t vBufferLen, const std::string& vStr);
332 static void ResetBuffer(char* vBuffer);
333 static void SetBuffer(char* vBuffer, size_t vBufferLen, const std::string& vStr);
334 static std::string UTF8Encode(const std::wstring& wstr);
335 static std::wstring UTF8Decode(const std::string& str);
336 static std::vector<std::string> SplitStringToVector(const std::string& vText, const std::string& vDelimiterPattern, const bool vPushEmpty);
337 static std::vector<std::string> SplitStringToVector(const std::string& vText, const char& vDelimiter, const bool vPushEmpty);
338 static std::string LowerCaseString(const std::string& vString); // turn all text in lower case for search facilitie
339 static size_t GetCharCountInString(const std::string& vString, const char& vChar);
340 static size_t GetLastCharPosWithMinCharCount(const std::string& vString, const char& vChar, const size_t& vMinCharCount);
341 static std::string GetPathSeparator(); // return the slash for any OS ( \\ win, / unix)
342 static std::string RoundNumber(double vvalue, int n); // custom rounding number
343 static std::pair<std::string, std::string> FormatFileSize(size_t vByteSize); // format file size field. return pair(number, unit)
344 static bool NaturalCompare(const std::string& vA, const std::string& vB, bool vInsensitiveCase, bool vDescending); // natural sorting
345
346private:
347 static bool M_IsAValidCharExt(const char& c);
348 static bool M_IsAValidCharSuffix(const char& c);
349 static bool M_ExtractNumFromStringAtPos(const std::string& str, size_t& pos, double& vOutNum);
350};
351
352class IGFD_API FileStyle {
353public:
354 typedef std::function<bool(const FileInfos&, FileStyle&)> FileStyleFunctor;
355
356public:
357 ImVec4 color = ImVec4(0, 0, 0, 0);
358 std::string icon;
359 ImFont* font = nullptr;
360 IGFD_FileStyleFlags flags = 0;
361
362public:
363 FileStyle();
364 FileStyle(const FileStyle& vStyle);
365 FileStyle(const ImVec4& vColor, const std::string& vIcon = "", ImFont* vFont = nullptr);
366};
367
368class IGFD_API SearchManager {
369public:
370 std::string searchTag;
371 char searchBuffer[MAX_FILE_DIALOG_NAME_BUFFER] = "";
372 bool searchInputIsActive = false;
373
374public:
375 void Clear(); // clear datas
376 void DrawSearchBar(FileDialogInternal& vFileDialogInternal); // draw the search bar
377};
378
379class IGFD_API FilterInfos {
380private:
381 // just for return a default const std::string& in getFirstFilter.
382 // cannot be const, because FilterInfos must be affected to an another FilterInfos
383 // must stay empty all time
384 std::string empty_string;
385
386public:
387 std::string title; // displayed filter.can be different than rela filter
388 SearchableVector<std::string> filters; // filters
389 SearchableVector<std::string> filters_optimized; // optimized filters for case insensitive search
390 std::vector<std::regex> filters_regex; // collection of regex filter type
391 size_t count_dots = 0U; // the max count dot the max per filter of all filters
392
393public:
394 void clear(); // clear the datas
395 bool empty() const; // is filter empty
396 const std::string& getFirstFilter() const; // get the first filter
397 bool regexExist(const std::string& vFilter) const; // is regex filter exist
398 bool exist(const FileInfos& vFileInfos, bool vIsCaseInsensitive) const; // is filter exist
399 void setCollectionTitle(const std::string& vTitle); // set the collection title
400 void addFilter(const std::string& vFilter, const bool vIsRegex); // add a filter
401 void addCollectionFilter(const std::string& vFilter, const bool vIsRegex); // add a filter in collection
402 static std::string transformAsteriskBasedFilterToRegex(const std::string& vFilter); // will transform a filter who contain * to a regex
403};
404
405class IGFD_API FilterManager {
406 friend class TestFilterManager;
407private:
408 std::vector<FilterInfos> m_ParsedFilters;
409 std::unordered_map<IGFD_FileStyleFlags, std::unordered_map<std::string, std::shared_ptr<FileStyle> > > m_FilesStyle; // file infos for file
410 // extention only
411 std::vector<FileStyle::FileStyleFunctor> m_FilesStyleFunctors; // file style via lambda function
412 FilterInfos m_SelectedFilter;
413
414public:
415 std::string dLGFilters;
416 std::string dLGdefaultExt;
417
418public:
419 const FilterInfos& GetSelectedFilter() const;
420 void ParseFilters(const char* vFilters); // Parse filter syntax, detect and parse filter collection
421 void SetSelectedFilterWithExt(const std::string& vFilter); // Select filter
422 bool FillFileStyle(std::shared_ptr<FileInfos> vFileInfos) const; // fill with the good style
423 void SetFileStyle(const IGFD_FileStyleFlags& vFlags, const char* vCriteria, const FileStyle& vInfos); // Set FileStyle
424 void SetFileStyle(const IGFD_FileStyleFlags& vFlags, const char* vCriteria, const ImVec4& vColor, const std::string& vIcon,
425 ImFont* vFont); // link file style to Color and Icon and Font
426 void SetFileStyle(FileStyle::FileStyleFunctor vFunctor); // lambda functor for set file style.
427 bool GetFileStyle(const IGFD_FileStyleFlags& vFlags, const std::string& vCriteria, ImVec4* vOutColor, std::string* vOutIcon,
428 ImFont** vOutFont); // Get Color and Icon for Filter
429 void ClearFilesStyle(); // clear m_FileStyle
430 bool IsCoveredByFilters(const FileInfos& vFileInfos,
431 bool vIsCaseInsensitive) const; // check if current file extention (vExt) is covered by current filter, or by regex (vNameExt)
432 float GetFilterComboBoxWidth() const; // will return the current combo box widget width
433 bool DrawFilterComboBox(FileDialogInternal& vFileDialogInternal); // draw the filter combobox // get the current selected filter
434 std::string ReplaceExtentionWithCurrentFilterIfNeeded(const std::string& vFileName,
435 IGFD_ResultMode vFlag) const; // replace the extention of the current file by the selected filter
436 void SetDefaultFilterIfNotDefined(); // define the first filter if no filter is selected
437};
438
439class IGFD_API FileType {
440public:
441 enum class ContentType {
442 // The ordering will be used during sort.
443 Invalid = -1,
444 Directory = 0,
445 File = 1,
446 LinkToUnknown = 2, // link to something that is not a regular file or directory.
447 };
448
449private:
450 ContentType m_Content = ContentType::Invalid;
451 bool m_Symlink = false;
452
453public:
454 FileType();
455 FileType(const ContentType& vContentType, const bool vIsSymlink);
456
457 void SetContent(const ContentType& vContentType);
458 void SetSymLink(const bool vIsSymlink);
459
460 bool isValid() const;
461 bool isDir() const;
462 bool isFile() const;
463 bool isLinkToUnknown() const;
464 bool isSymLink() const;
465
466 // Comparisons only care about the content type, ignoring whether it's a symlink or not.
467 bool operator==(const FileType& rhs) const;
468 bool operator!=(const FileType& rhs) const;
469 bool operator<(const FileType& rhs) const;
470 bool operator>(const FileType& rhs) const;
471};
472
473class IGFD_API FileInfos {
474public:
475 static std::shared_ptr<FileInfos> create();
476
477public:
478 // extention of the file, the array is the levels of ext, by ex : .a.b.c, will be save in {.a.b.c, .b.c, .c}
479 // 10 level max are sufficient i guess. the others levels will be checked if countExtDot > 1
480 std::array<std::string, EXT_MAX_LEVEL> fileExtLevels;
481 std::array<std::string, EXT_MAX_LEVEL> fileExtLevels_optimized; // optimized for search => insensitivecase
482 // same for file name, can be sued in userFileAttributesFun
483 std::array<std::string, EXT_MAX_LEVEL> fileNameLevels;
484 std::array<std::string, EXT_MAX_LEVEL> fileNameLevels_optimized; // optimized for search => insensitivecase
485 size_t countExtDot = 0U; // count dots in file extention. this count will give the levels in fileExtLevels
486 FileType fileType; // fileType
487 std::string filePath; // path of the file
488 std::string fileName; // file name only
489 std::string fileNameExt; // filename of the file (file name + extention) (but no path)
490 std::string fileNameExt_optimized; // optimized for search => insensitivecase
491 std::string deviceInfos; // quick infos to display after name for devices
492 std::string tooltipMessage; // message to display on the tooltip, is not empty
493 int32_t tooltipColumn = -1; // the tooltip will appears only when the mouse is over the tooltipColumn if > -1
494 size_t fileSize = 0U; // for sorting operations
495 std::pair<std::string, std::string> formatedFileSize; // file size formated (10 o, 10 ko, 10 mo, 10 go)
496 std::string fileModifDate; // file user defined format of the date (data + time by default)
497 std::shared_ptr<FileStyle> fileStyle = nullptr; // style of the file
498#ifdef USE_THUMBNAILS
499 IGFD_Thumbnail_Info thumbnailInfo; // structre for the display for image file tetxure
500#endif // USE_THUMBNAILS
501
502public:
503 bool SearchForTag(const std::string& vTag) const; // will search a tag in fileNameExt and fileNameExt_optimized
504 bool SearchForExt(const std::string& vExt, const bool vIsCaseInsensitive,
505 const size_t& vMaxLevel = EXT_MAX_LEVEL) const; // will check the fileExtLevels levels for vExt, until vMaxLevel
506 bool SearchForExts(const std::string& vComaSepExts, const bool vIsCaseInsensitive,
507 const size_t& vMaxLevel = EXT_MAX_LEVEL) const; // will check the fileExtLevels levels for vExts (ext are coma separated), until vMaxLevel
508 bool FinalizeFileTypeParsing(const size_t& vMaxDotToExtract); // finalize the parsing the file (only a file or link to file. no dir)
509};
510
511typedef std::pair<std::string, std::string> PathDisplayedName;
512
513class IFileSystem {
514public:
515 virtual ~IFileSystem() = default;
516 // say if a directory can be openened or for any reason locked
517 virtual bool IsDirectoryCanBeOpened(const std::string& vName) = 0;
518 // say if a directory exist
519 virtual bool IsDirectoryExist(const std::string& vName) = 0;
520 // say if a file exist
521 virtual bool IsFileExist(const std::string& vName) = 0;
522 // say if a directory was created, return false if vName is invalid or alreayd exist
523 virtual bool CreateDirectoryIfNotExist(const std::string& vName) = 0;
524 // extract the component of a file path name, like path, name, ext
525 virtual IGFD::Utils::PathStruct ParsePathFileName(const std::string& vPathFileName) = 0;
526 // will return a list of files inside a path
527 virtual std::vector<IGFD::FileInfos> ScanDirectory(const std::string& vPath) = 0;
528 // say if the path is well a directory
529 virtual bool IsDirectory(const std::string& vFilePathName) = 0;
530 // return a device list (<path, device name>) on windows, but can be used on other platforms for give to the user a list of devices paths.
531 virtual std::vector<IGFD::PathDisplayedName> GetDevicesList() = 0;
532 // return via argument the date and the size of a file (for solve issue regarding apis and widechars)
533 virtual void GetFileDateAndSize(const std::string& vFilePathName, const IGFD::FileType& vFileType, std::string& voDate, size_t& voSize) = 0;
534};
535
536class IGFD_API FileManager {
537 friend class TestFileManager;
538public: // types
539 enum class SortingFieldEnum { // sorting for filetering of the file lsit
540 FIELD_NONE = 0, // no sorting reference, result indetermined haha..
541 FIELD_FILENAME, // sorted by filename
542 FIELD_TYPE, // sorted by filetype
543 FIELD_SIZE, // sorted by filesize (formated file size)
544 FIELD_DATE, // sorted by filedate
545 FIELD_THUMBNAILS, // sorted by thumbnails (comparaison by width then by height)
546 };
547
548private:
549 std::string m_CurrentPath; // current path (to be decomposed in m_CurrentPathDecomposition
550 std::vector<std::string> m_CurrentPathDecomposition; // part words
551 std::vector<std::shared_ptr<FileInfos> > m_FileList; // base container
552 std::vector<std::shared_ptr<FileInfos> > m_FilteredFileList; // filtered container (search, sorting, etc..)
553 std::vector<std::shared_ptr<FileInfos> > m_PathList; // base container for path selection
554 std::vector<std::shared_ptr<FileInfos> > m_FilteredPathList; // filtered container for path selection (search, sorting, etc..)
555 std::vector<std::string>::iterator m_PopupComposedPath; // iterator on m_CurrentPathDecomposition for Current Path popup
556 std::string m_LastSelectedFileName; // for shift multi selection
557 std::set<std::string> m_SelectedFileNames; // the user selection of FilePathNames
558 bool m_CreateDirectoryMode = false; // for create directory widget
559 std::string m_FileSystemName;
560 std::unique_ptr<IFileSystem> m_FileSystemPtr = nullptr;
561
562public:
563 bool inputPathActivated = false; // show input for path edition
564 bool devicesClicked = false; // event when a drive button is clicked
565 bool pathClicked = false; // event when a path button was clicked
566 char inputPathBuffer[MAX_PATH_BUFFER_SIZE] = ""; // input path buffer for imgui widget input text (displayed in palce of composer)
567 char variadicBuffer[MAX_FILE_DIALOG_NAME_BUFFER] = ""; // called by m_SelectableItem
568 char fileNameBuffer[MAX_FILE_DIALOG_NAME_BUFFER] = ""; // file name buffer in footer for imgui widget input text
569 char directoryNameBuffer[MAX_FILE_DIALOG_NAME_BUFFER] = ""; // directory name buffer (when in directory mode)
570 std::string headerFileName; // detail view name of column file
571 std::string headerFileType; // detail view name of column type
572 std::string headerFileSize; // detail view name of column size
573 std::string headerFileDate; // detail view name of column date + time
574#ifdef USE_THUMBNAILS
575 std::string headerFileThumbnails; // detail view name of column thumbnails
576 bool sortingDirection[5] = { // true => Ascending, false => Descending
577 defaultSortOrderFilename, defaultSortOrderType, defaultSortOrderSize, defaultSortOrderDate, defaultSortOrderThumbnails};
578#else
579 bool sortingDirection[4] = { // true => Ascending, false => Descending
580 defaultSortOrderFilename, defaultSortOrderType, defaultSortOrderSize, defaultSortOrderDate};
581#endif
582 SortingFieldEnum sortingField = SortingFieldEnum::FIELD_FILENAME; // detail view sorting column
583 bool showDevices = false; // devices are shown (only on os windows)
584
585 std::string dLGpath; // base path set by user when OpenDialog was called
586 std::string dLGDefaultFileName; // base default file path name set by user when OpenDialog was called
587 size_t dLGcountSelectionMax = 1U; // 0 for infinite // base max selection count set by user when OpenDialog was called
588 bool dLGDirectoryMode = false; // is directory mode (defiend like : dLGDirectoryMode = (filters.empty()))
589
590 std::string fsRoot;
591
592private:
593 void m_CompleteFileInfos(const std::shared_ptr<FileInfos>& vInfos); // set time and date infos of a file (detail view mode)
594 void m_RemoveFileNameInSelection(const std::string& vFileName); // selection : remove a file name
595 void m_AddFileNameInSelection(const std::string& vFileName, bool vSetLastSelectionFileName); // selection : add a file name
596 void m_AddFile(const FileDialogInternal& vFileDialogInternal, const std::string& vPath, const std::string& vFileName,
597 const FileType& vFileType); // add file called by scandir
598 void m_AddPath(const FileDialogInternal& vFileDialogInternal, const std::string& vPath, const std::string& vFileName,
599 const FileType& vFileType); // add file called by scandir
600 void m_ScanDirForPathSelection(const FileDialogInternal& vFileDialogInternal,
601 const std::string& vPath); // scan the directory for retrieve the path list
602 void m_OpenPathPopup(const FileDialogInternal& vFileDialogInternal,
603 std::vector<std::string>::iterator vPathIter); // open the popup list of paths
604 void m_SetCurrentPath(std::vector<std::string>::iterator vPathIter); // set the current path, update the path bar
605 void m_ApplyFilteringOnFileList(const FileDialogInternal& vFileDialogInternal, std::vector<std::shared_ptr<FileInfos> >& vFileInfosList, std::vector<std::shared_ptr<FileInfos> >& vFileInfosFilteredList);
606 static bool M_SortStrings(const FileDialogInternal& vFileDialogInternal, //
607 const bool vInsensitiveCase, const bool vDescendingOrder, //
608 const std::string& vA, const std::string& vB);
609 void m_SortFields(const FileDialogInternal& vFileDialogInternal, std::vector<std::shared_ptr<FileInfos> >& vFileInfosList,
610 std::vector<std::shared_ptr<FileInfos> >& vFileInfosFilteredList); // will sort a column
611 bool m_CompleteFileInfosWithUserFileAttirbutes(const FileDialogInternal& vFileDialogInternal, const std::shared_ptr<FileInfos>& vInfos);
612
613public:
614 FileManager();
615 bool IsComposerEmpty() const;
616 size_t GetComposerSize() const;
617 bool IsFileListEmpty() const;
618 bool IsPathListEmpty() const;
619 bool IsFilteredListEmpty() const;
620 bool IsPathFilteredListEmpty() const;
621 size_t GetFullFileListSize() const;
622 std::shared_ptr<FileInfos> GetFullFileAt(size_t vIdx);
623 size_t GetFilteredListSize() const;
624 size_t GetPathFilteredListSize() const;
625 std::shared_ptr<FileInfos> GetFilteredFileAt(size_t vIdx);
626 std::shared_ptr<FileInfos> GetFilteredPathAt(size_t vIdx);
627 std::vector<std::string>::iterator GetCurrentPopupComposedPath() const;
628 bool IsFileNameSelected(const std::string& vFileName);
629 std::string GetBack();
630 void ClearComposer();
631 void ClearFileLists(); // clear file list, will destroy thumbnail textures
632 void ClearPathLists(); // clear path list, will destroy thumbnail textures
633 void ClearAll();
634 void ApplyFilteringOnFileList(const FileDialogInternal& vFileDialogInternal);
635 void SortFields(const FileDialogInternal& vFileDialogInternal); // will sort a column
636 void OpenCurrentPath(const FileDialogInternal& vFileDialogInternal); // set the path of the dialog, will launch the scandir for populate the file listview
637 bool GetDevices(); // list devices
638 bool CreateDir(const std::string& vPath); // create a directory on the file system
639 std::string ComposeNewPath(std::vector<std::string>::iterator vIter); // compose a path from the compose path widget
640 bool SetPathOnParentDirectoryIfAny(); // compose paht on parent directory
641 std::string GetCurrentPath(); // get the current path
642 void SetCurrentPath(const std::string& vCurrentPath); // set the current path
643 void SetDefaultFileName(const std::string& vFileName);
644 bool SelectDirectory(const std::shared_ptr<FileInfos>& vInfos); // enter directory
645 void SelectAllFileNames();
646 void SelectFileName(const std::shared_ptr<FileInfos>& vInfos); // add a filename in selection
647 void SelectOrDeselectFileName(const FileDialogInternal& vFileDialogInternal, const std::shared_ptr<FileInfos>& vInfos); // add/remove a filename in selection
648 void SetCurrentDir(const std::string& vPath); // define current directory for scan
649 void ScanDir(const FileDialogInternal& vFileDialogInternal,
650 const std::string& vPath); // scan the directory for retrieve the file list
651 std::string GetResultingPath();
652 std::string GetResultingFileName(FileDialogInternal& vFileDialogInternal, IGFD_ResultMode vFlag);
653 std::string GetResultingFilePathName(FileDialogInternal& vFileDialogInternal, IGFD_ResultMode vFlag);
654 std::map<std::string, std::string> GetResultingSelection(FileDialogInternal& vFileDialogInternal, IGFD_ResultMode vFlag);
655
656 void DrawDirectoryCreation(const FileDialogInternal& vFileDialogInternal); // draw directory creation widget
657 void DrawPathComposer(const FileDialogInternal& vFileDialogInternal);
658
659 IFileSystem* GetFileSystemInstance() const {
660 return m_FileSystemPtr.get();
661 }
662 const std::string& GetFileSystemName() const {
663 return m_FileSystemName;
664 }
665};
666
667typedef void* UserDatas;
668typedef std::function<void(const char*, UserDatas, bool*)> PaneFun; // side pane function binding
669typedef std::function<bool(FileInfos*, UserDatas)> UserFileAttributesFun; // custom file Attributes call back, reject file if false
670
671struct IGFD_API FileDialogConfig {
672 std::string path; // path
673 std::string fileName; // defaut file name
674 std::string filePathName; // if not empty, the filename and the path will be obtained from filePathName
675 int32_t countSelectionMax = 1; // count selection max, 0 for infinite
676 UserDatas userDatas = nullptr; // user datas (can be retrieved in pane)
677 ImGuiFileDialogFlags flags = ImGuiFileDialogFlags_None; // ImGuiFileDialogFlags
678 PaneFun sidePane; // side pane callback
679 float sidePaneWidth = 250.0f; // side pane width
680 UserFileAttributesFun userFileAttributes; // user file Attibutes callback
681};
682
683class IGFD_API FileDialogInternal {
684public:
685 FileManager fileManager; // the file manager
686 FilterManager filterManager; // the filter manager
687 SearchManager searchManager; // the search manager
688
689public:
690 std::string name; // the internal dialog name (title + ##word)
691 bool showDialog = false; // the dialog is shown
692 ImVec2 dialogCenterPos = ImVec2(0, 0); // center pos for display the confirm overwrite dialog
693 int lastImGuiFrameCount = 0; // to be sure than only one dialog displayed per frame
694 float footerHeight = 0.0f; // footer height
695 bool canWeContinue = true; // events
696 bool okResultToConfirm = false; // to confim if ok for OverWrite
697 bool isOk = false; // is dialog ok button click
698 bool fileInputIsActive = false; // when input text for file or directory is active
699 bool fileListViewIsActive = false; // when list view is active
700 std::string dLGkey; // the dialog key
701 std::string dLGtitle; // the dialog title
702 bool needToExitDialog = false; // we need to exit the dialog
703 bool puUseCustomLocale = false; // custom user locale
704 int localeCategory = LC_ALL; // locale category to use
705 std::string localeBegin; // the locale who will be applied at start of the display dialog
706 std::string localeEnd; // the locale who will be applaied at end of the display dialog
707
708private:
709 FileDialogConfig m_DialogConfig;
710
711public:
712 void NewFrame(); // new frame, so maybe neded to do somethings, like reset events
713 void EndFrame(); // end frame, so maybe neded to do somethings fater all
714 void ResetForNewDialog(); // reset what is needed to reset for the openging of a new dialog
715
716 void configureDialog( // open simple dialog
717 const std::string& vKey, // key dialog
718 const std::string& vTitle, // title
719 const char* vFilters, // filters, if null, will display only directories
720 const FileDialogConfig& vConfig); // FileDialogConfig
721 const FileDialogConfig& getDialogConfig() const;
722 FileDialogConfig& getDialogConfigRef();
723};
724
725class IGFD_API ThumbnailFeature {
726protected:
727 ThumbnailFeature();
728 ~ThumbnailFeature();
729
730 void m_NewThumbnailFrame(FileDialogInternal& vFileDialogInternal);
731 void m_EndThumbnailFrame(FileDialogInternal& vFileDialogInternal);
732 void m_QuitThumbnailFrame(FileDialogInternal& vFileDialogInternal);
733
734#ifdef USE_THUMBNAILS
735public:
736 typedef std::function<void(IGFD_Thumbnail_Info*)> CreateThumbnailFun; // texture 2d creation function binding
737 typedef std::function<void(IGFD_Thumbnail_Info*)> DestroyThumbnailFun; // texture 2d destroy function binding
738
739protected:
740 enum class DisplayModeEnum { FILE_LIST = 0, THUMBNAILS_LIST, THUMBNAILS_GRID };
741
742private:
743 uint32_t m_CountFiles = 0U;
744 bool m_IsWorking = false;
745 std::shared_ptr<std::thread> m_ThumbnailGenerationThread = nullptr;
746 std::list<std::shared_ptr<FileInfos> > m_ThumbnailFileDatasToGet; // base container
747 std::mutex m_ThumbnailFileDatasToGetMutex;
748 std::condition_variable m_ThumbnailFileDatasToGetCv;
749 std::list<std::shared_ptr<FileInfos> > m_ThumbnailToCreate; // base container
750 std::mutex m_ThumbnailToCreateMutex;
751 std::list<IGFD_Thumbnail_Info> m_ThumbnailToDestroy; // base container
752 std::mutex m_ThumbnailToDestroyMutex;
753
754 CreateThumbnailFun m_CreateThumbnailFun = nullptr;
755 DestroyThumbnailFun m_DestroyThumbnailFun = nullptr;
756
757protected:
758 DisplayModeEnum m_DisplayMode = DisplayModeEnum::FILE_LIST;
759
760private:
761 void m_VariadicProgressBar(float fraction, const ImVec2& size_arg, const char* fmt, ...);
762
763protected:
764 // will be call in cpu zone (imgui computations, will call a texture file retrieval thread)
765 void m_StartThumbnailFileDatasExtraction(); // start the thread who will get byte buffer from image files
766 bool m_StopThumbnailFileDatasExtraction(); // stop the thread who will get byte buffer from image files
767 void m_ThreadThumbnailFileDatasExtractionFunc(); // the thread who will get byte buffer from image files
768 void m_DrawThumbnailGenerationProgress(); // a little progressbar who will display the texture gen status
769 void m_AddThumbnailToLoad(const std::shared_ptr<FileInfos>& vFileInfos); // add texture to load in the thread
770 void m_AddThumbnailToCreate(const std::shared_ptr<FileInfos>& vFileInfos);
771 void m_AddThumbnailToDestroy(const IGFD_Thumbnail_Info& vIGFD_Thumbnail_Info);
772 void m_DrawDisplayModeToolBar(); // draw display mode toolbar (file list, thumbnails list, small thumbnails grid, big thumbnails grid)
773 void m_ClearThumbnails(FileDialogInternal& vFileDialogInternal);
774
775public:
776 void SetCreateThumbnailCallback(const CreateThumbnailFun& vCreateThumbnailFun);
777 void SetDestroyThumbnailCallback(const DestroyThumbnailFun& vCreateThumbnailFun);
778
779 // must be call in gpu zone (rendering, possibly one rendering thread)
780 void ManageGPUThumbnails(); // in gpu rendering zone, whill create or destroy texture
781#endif
782};
783
784class IGFD_API PlacesFeature {
785protected:
786 PlacesFeature();
787
788#ifdef USE_PLACES_FEATURE
789private:
790 struct PlaceStruct {
791 std::string name; // name of the place
792 // todo: the path could be relative, better if the app is moved but place path can be outside of the app
793 std::string path; // absolute path of the place
794 bool canBeSaved = true; // defined by code, can be used for prevent serialization / deserialization
795 FileStyle style;
796 float thickness = 0.0f; // when more than 0.0f, is a separator
797 };
798
799 struct GroupStruct {
800 bool canBeSaved = false; // defined by code, can be used for prevent serialization / deserialization
801 size_t displayOrder = 0U; // the display order will be usedf first, then alphanumeric
802 bool defaultOpened = false; // the group is opened by default
803 bool canBeEdited = false; // will show +/- button for add/remove place in the group
804 char editBuffer[MAX_FILE_DIALOG_NAME_BUFFER] = ""; // temp buffer for name edition
805 int32_t selectedPlaceForEdition = -1;
806 ImGuiTreeNodeFlags collapsingHeaderFlag = ImGuiTreeNodeFlags_None;
807 ImGuiListClipper clipper; // the list clipper of the grou
808 std::string name; // the group name, will be displayed
809 std::vector<PlaceStruct> places; // the places (name + path)
810 bool AddPlace( // add a place by code
811 const std::string& vPlaceName, // place name
812 const std::string& vPlacePath, // place path
813 const bool vCanBeSaved, // prevent serialization
814 const FileStyle& vStyle = {}); // style
815 void AddPlaceSeparator(const float& vThickness = 1.0f);
816 bool RemovePlace( // remove a place by code, return true if succeed
817 const std::string& vPlaceName); // place name to remove
818 };
819
820private:
821 std::unordered_map<std::string, std::shared_ptr<GroupStruct> > m_Groups;
822 std::map<size_t, std::weak_ptr<GroupStruct> > m_OrderedGroups;
823
824protected:
825 float m_PlacesPaneWidth = 200.0f;
826 bool m_PlacesPaneShown = false;
827
828protected:
829 void m_InitPlaces(FileDialogInternal& vFileDialogInternal);
830 void m_DrawPlacesButton(); // draw place button
831 bool m_DrawPlacesPane(FileDialogInternal& vFileDialogInternal, const ImVec2& vSize); // draw place Pane
832
833public:
834 std::string SerializePlaces( // serialize place : return place buffer to save in a file
835 const bool vForceSerialisationForAll = true); // for avoid serialization of places with flag 'canBeSaved to false'
836 void DeserializePlaces( // deserialize place : load place buffer to load in the dialog (saved from
837 const std::string& vPlaces); // previous use with SerializePlaces()) place buffer to load
838 bool AddPlacesGroup( // add a group
839 const std::string& vGroupName, // the group name
840 const size_t& vDisplayOrder, // the display roder of the group
841 const bool vCanBeEdited = false, // let the user add/remove place in the group
842 const bool vOpenedByDefault = true); // hte group is opened by default
843 bool RemovePlacesGroup(const std::string& vGroupName); // remove the group
844 GroupStruct* GetPlacesGroupPtr(const std::string& vGroupName); // get the group, if not existed, will be created
845#endif // USE_PLACES_FEATURE
846};
847
848// file localization by input chat // widget flashing
849class IGFD_API KeyExplorerFeature {
850protected:
851 KeyExplorerFeature();
852
853#ifdef USE_EXPLORATION_BY_KEYS
854private:
855 bool m_LocateFileByInputChar_lastFound = false;
856 ImWchar m_LocateFileByInputChar_lastChar = 0;
857 float m_FlashAlpha = 0.0f; // flash when select by char
858 float m_FlashAlphaAttenInSecs = 1.0f; // fps display dependant
859 int m_LocateFileByInputChar_InputQueueCharactersSize = 0;
860 size_t m_FlashedItem = 0; // flash when select by char
861 size_t m_LocateFileByInputChar_lastFileIdx = 0;
862
863protected:
864 void m_LocateByInputKey(FileDialogInternal& vFileDialogInternal); // select a file line in listview according to char key
865 bool m_LocateItem_Loop(FileDialogInternal& vFileDialogInternal,
866 ImWchar vC); // restrat for start of list view if not found a corresponding file
867 void m_ExploreWithkeys(FileDialogInternal& vFileDialogInternal,
868 ImGuiID vListViewID); // select file/directory line in listview accroding to up/down enter/backspace keys
869 void m_StartFlashItem(size_t vIdx); // define than an item must be flashed
870 bool m_BeginFlashItem(size_t vIdx); // start the flashing of a line in lsit view
871 static void m_EndFlashItem(); // end the fleshing accrdoin to var m_FlashAlphaAttenInSecs
872 static bool m_FlashableSelectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, bool vFlashing = false,
873 const ImVec2& size = ImVec2(0, 0)); // custom flashing selectable widgets, for flash the selected line in a short time
874
875public:
876 void SetFlashingAttenuationInSeconds( // set the flashing time of the line in file list when use exploration keys
877 float vAttenValue); // set the attenuation (from flashed to not flashed) in seconds
878#endif // USE_EXPLORATION_BY_KEYS
879};
880
881class IGFD_API FileDialog : public PlacesFeature, public KeyExplorerFeature, public ThumbnailFeature {
882protected:
883 FileDialogInternal m_FileDialogInternal;
884 ImGuiListClipper m_FileListClipper;
885 ImGuiListClipper m_PathListClipper;
886 float prOkCancelButtonWidth = 0.0f;
887 ImGuiWindowFlags m_CurrentDisplayedFlags;
888
889public:
890#ifndef NEW_SINGLETON
891 // Singleton for easier accces form anywhere but only one dialog at a time
892 // vCopy or vForce can be used for share a memory pointer in a new memory space like a dll module
893 static FileDialog* Instance(FileDialog* vCopy = nullptr, bool vForce = false) {
894 static FileDialog _instance;
895 static FileDialog* _instance_copy = nullptr;
896 if (vCopy || vForce) {
897 _instance_copy = vCopy;
898 }
899 if (_instance_copy) {
900 return _instance_copy;
901 }
902 return &_instance;
903 }
904#else // NEW_SINGLETON
905 static std::unique_ptr<FileDialog>& initSingleton(FileDialog* vCopy = nullptr, bool vForce = false) {
906 static auto mp_instance = std::unique_ptr<FileDialog>(new FileDialog());
907 static std::unique_ptr<FileDialog> mp_instance_copy;
908 if (vCopy != nullptr || vForce) {
909 if (vCopy != nullptr) {
910 mp_instance_copy = std::unique_ptr<FileDialog>(vCopy);
911 } else {
912 mp_instance_copy.release(); // frees the internal borrowed pointer without deletion
913 }
914 }
915 if (mp_instance_copy != nullptr) {
916 return mp_instance_copy;
917 }
918 return mp_instance;
919 }
920 static FileDialog& ref() { return *initSingleton().get(); }
921 static void unitSingleton() {
922 initSingleton(nullptr, true); // frees the borrowed pointer in case
923 initSingleton().reset(); // else the reset with destroy the borrowed pointer
924 }
925#endif // NEW_SINGLETON
926
927public:
928 FileDialog(); // ImGuiFileDialog Constructor. can be used for have many dialog at same time (not possible with singleton)
929 virtual ~FileDialog(); // ImGuiFileDialog Destructor
930
931 // standard dialog
932 virtual void OpenDialog( // open simple dialog
933 const std::string& vKey, // key dialog
934 const std::string& vTitle, // title
935 const char* vFilters, // filters, if null, will display only directories
936 const FileDialogConfig& vConfig = {}); // FileDialogConfig
937
938 // Display / Close dialog form
939 bool Display( // Display the dialog. return true if a result was obtained (Ok or not)
940 const std::string& vKey, // key dialog to display (if not the same key as defined by OpenDialog => no opening)
941 ImGuiWindowFlags vFlags = ImGuiWindowFlags_NoCollapse, // ImGuiWindowFlags
942 ImVec2 vMinSize = ImVec2(0, 0), // mininmal size contraint for the ImGuiWindow
943 ImVec2 vMaxSize = ImVec2(FLT_MAX, FLT_MAX)); // maximal size contraint for the ImGuiWindow
944
945 void Close(); // close dialog
946
947 // queries
948 bool WasOpenedThisFrame(const std::string& vKey) const; // say if the dialog key was already opened this frame
949 bool WasOpenedThisFrame() const; // say if the dialog was already opened this frame
950 bool IsOpened(const std::string& vKey) const; // say if the key is opened
951 bool IsOpened() const; // say if the dialog is opened somewhere
952 std::string GetOpenedKey() const; // return the dialog key who is opened, return nothing if not opened
953
954 // get result
955 bool IsOk() const; // true => Dialog Closed with Ok result / false : Dialog closed with cancel result
956 std::map<std::string, std::string> GetSelection(IGFD_ResultMode vFlag = IGFD_ResultMode_KeepInputFile); // Open File behavior : will return selection via a
957 // map<FileName, FilePathName>
958 std::string GetFilePathName(IGFD_ResultMode vFlag = IGFD_ResultMode_AddIfNoFileExt); // Save File behavior : will return the current file path name
959 std::string GetCurrentFileName(IGFD_ResultMode vFlag = IGFD_ResultMode_AddIfNoFileExt); // Save File behavior : will return the content file name
960 std::string GetCurrentPath(); // will return current file path
961 std::string GetCurrentFilter(); // will return current filter
962 UserDatas GetUserDatas() const; // will return user datas send with Open Dialog
963
964 // file style by extentions
965 void SetFileStyle( // SetExtention datas for have custom display of particular file type
966 const IGFD_FileStyleFlags& vFlags, // file style
967 const char* vCriteria, // extention filter to tune
968 const FileStyle& vInfos); // Filter Extention Struct who contain Color and Icon/Text for the display of the
969 // file with extention filter
970 void SetFileStyle( // SetExtention datas for have custom display of particular file type
971 const IGFD_FileStyleFlags& vFlags, // file style
972 const char* vCriteria, // extention filter to tune
973 const ImVec4& vColor, // wanted color for the display of the file with extention filter
974 const std::string& vIcon = "", // wanted text or icon of the file with extention filter
975 ImFont* vFont = nullptr); // wanted font
976 void SetFileStyle(FileStyle::FileStyleFunctor vFunctor); // set file style via lambda function
977 bool GetFileStyle( // GetExtention datas. return true is extention exist
978 const IGFD_FileStyleFlags& vFlags, // file style
979 const std::string& vCriteria, // extention filter (same as used in SetExtentionInfos)
980 ImVec4* vOutColor, // color to retrieve
981 std::string* vOutIcon = nullptr, // icon or text to retrieve
982 ImFont** vOutFont = nullptr); // font to retreive
983 void ClearFilesStyle(); // clear extentions setttings
984
985 void SetLocales( // set locales to use before and after the dialog display
986 const int& vLocaleCategory, // set local category
987 const std::string& vLocaleBegin, // locale to use at begining of the dialog display
988 const std::string& vLocaleEnd); // locale to use at the end of the dialog display
989
990protected:
991 void m_NewFrame(); // new frame just at begining of display
992 void m_EndFrame(); // end frame just at end of display
993 void m_QuitFrame(); // quit frame when qui quit the dialog
994
995 // others
996 bool m_Confirm_Or_OpenOverWriteFileDialog_IfNeeded(bool vLastAction, ImGuiWindowFlags vFlags); // treatment of the result, start the confirm to overwrite dialog
997 // if needed (if defined with flag)
998
999 // dialog parts
1000 virtual void m_DrawHeader(); // draw header part of the dialog (place btn, dir creation, path composer, search bar)
1001 virtual void m_DrawContent(); // draw content part of the dialog (place pane, file list, side pane)
1002 virtual bool m_DrawFooter(); // draw footer part of the dialog (file field, fitler combobox, ok/cancel btn's)
1003
1004 // widgets components
1005 virtual void m_DisplayPathPopup(ImVec2 vSize); // draw path popup when click on a \ or /
1006 virtual bool m_DrawValidationButtons(); // draw validations btns, ok, cancel buttons
1007 virtual bool m_DrawOkButton(); // draw ok button
1008 virtual bool m_DrawCancelButton(); // draw cancel button
1009 virtual void m_DrawSidePane(float vHeight); // draw side pane
1010 virtual bool m_Selectable(int vRowIdx, const char* vLabel, bool vSelected, ImGuiSelectableFlags vFlags, const ImVec2& vSizeArg);
1011 virtual void m_SelectableItem(int vRowIdx, std::shared_ptr<FileInfos> vInfos, bool vSelected, const char* vFmt, ...); // draw a custom selectable behavior item
1012 virtual void m_drawColumnText(int vColIdx, const char* vFmt, const char* vLabel, bool vSelected, bool vHovered);
1013 virtual void m_rightAlignText(const char* text, const char* maxWidthText); // align a text on right
1014 virtual void m_DrawFileListView(ImVec2 vSize); // draw file list view (default mode)
1015
1016#ifdef USE_THUMBNAILS
1017 virtual void m_DrawThumbnailsListView(ImVec2 vSize); // draw file list view with small thumbnails on the same line
1018 virtual void m_DrawThumbnailsGridView(ImVec2 vSize); // draw a grid of small thumbnails
1019#endif
1020
1021 // to be called only by these function and theirs overrides
1022 // - m_DrawFileListView
1023 // - m_DrawThumbnailsListView
1024 // - m_DrawThumbnailsGridView
1025 void m_BeginFileColorIconStyle(std::shared_ptr<FileInfos> vFileInfos, bool& vOutShowColor, std::string& vOutStr,
1026 ImFont** vOutFont); // begin style apply of filter with color an icon if any
1027 void m_EndFileColorIconStyle(const bool vShowColor, ImFont* vFont); // end style apply of filter
1028
1029 void m_DisplayFileInfosTooltip(const int32_t& vRowIdx, const int32_t& vColumnIdx, std::shared_ptr<FileInfos> vFileInfos);
1030};
1031
1032} // namespace IGFD
1033
1034#endif // __cplusplus
1035
1039
1040#ifdef __cplusplus
1041#define IGFD_C_API extern "C" IGFD_API
1042typedef IGFD::UserDatas IGFDUserDatas;
1043typedef IGFD::PaneFun IGFDPaneFun;
1044typedef IGFD::FileDialog ImGuiFileDialog;
1045#else // __cplusplus
1046#define IGFD_C_API
1050#endif // __cplusplus
1051
1052typedef void (*IGFD_PaneFun)(const char*, void*, bool*); // callback fucntion for display the pane
1053
1055 const char* path; // path
1056 const char* fileName; // defaut file name
1057 const char* filePathName; // if not empty, the filename and the path will be obtained from filePathName
1058 int32_t countSelectionMax; // count selection max
1059 void* userDatas; // user datas (can be retrieved in pane)
1060 IGFD_PaneFun sidePane; // side pane callback
1061 float sidePaneWidth; // side pane width};
1062 ImGuiFileDialogFlags flags; // ImGuiFileDialogFlags
1063};
1064IGFD_C_API struct IGFD_FileDialog_Config IGFD_FileDialog_Config_Get(); // return an initialized IGFD_FileDialog_Config
1065
1070
1071IGFD_C_API IGFD_Selection_Pair IGFD_Selection_Pair_Get(); // return an initialized IGFD_Selection_Pair
1072IGFD_C_API void IGFD_Selection_Pair_DestroyContent(IGFD_Selection_Pair* vSelection_Pair); // destroy the content of a IGFD_Selection_Pair
1073
1076 size_t count; // 0U
1077};
1078
1079IGFD_C_API IGFD_Selection IGFD_Selection_Get(); // return an initialized IGFD_Selection
1080IGFD_C_API void IGFD_Selection_DestroyContent(IGFD_Selection* vSelection); // destroy the content of a IGFD_Selection
1081
1082// constructor / destructor
1083IGFD_C_API ImGuiFileDialog* IGFD_Create(void); // create the filedialog context
1084IGFD_C_API void IGFD_Destroy(ImGuiFileDialog* vContextPtr); // destroy the filedialog context
1085
1086#ifdef USE_THUMBNAILS
1087typedef void (*IGFD_CreateThumbnailFun)(IGFD_Thumbnail_Info*); // callback function for create thumbnail texture
1088typedef void (*IGFD_DestroyThumbnailFun)(IGFD_Thumbnail_Info*); // callback fucntion for destroy thumbnail texture
1089#endif // USE_THUMBNAILS
1090
1091IGFD_C_API void IGFD_OpenDialog( // open a standard dialog
1092 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1093 const char* vKey, // key dialog
1094 const char* vTitle, // title
1095 const char* vFilters, // filters/filter collections. set it to null for directory mode
1096 const struct IGFD_FileDialog_Config vConfig); // config
1097
1098IGFD_C_API bool IGFD_DisplayDialog( // Display the dialog
1099 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1100 const char* vKey, // key dialog to display (if not the same key as defined by OpenDialog => no opening)
1101 ImGuiWindowFlags vFlags, // ImGuiWindowFlags
1102 ImVec2 vMinSize, // mininmal size contraint for the ImGuiWindow
1103 ImVec2 vMaxSize); // maximal size contraint for the ImGuiWindow
1104
1105IGFD_C_API void IGFD_CloseDialog( // Close the dialog
1106 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1107
1108IGFD_C_API bool IGFD_IsOk( // true => Dialog Closed with Ok result / false : Dialog closed with cancel result
1109 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1110
1111IGFD_C_API bool IGFD_WasKeyOpenedThisFrame( // say if the dialog key was already opened this frame
1112 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1113 const char* vKey);
1114
1115IGFD_C_API bool IGFD_WasOpenedThisFrame( // say if the dialog was already opened this frame
1116 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1117
1118IGFD_C_API bool IGFD_IsKeyOpened( // say if the dialog key is opened
1119 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1120 const char* vCurrentOpenedKey); // the dialog key
1121
1122IGFD_C_API bool IGFD_IsOpened( // say if the dialog is opened somewhere
1123 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1124
1125IGFD_C_API IGFD_Selection IGFD_GetSelection( // Open File behavior : will return selection via a map<FileName, FilePathName>
1126 ImGuiFileDialog* vContextPtr, // user datas (can be retrieved in pane)
1127 IGFD_ResultMode vMode); // Result Mode
1128
1129IGFD_C_API char* IGFD_GetFilePathName( // Save File behavior : will always return the content of the field with current
1130 // filter extention and current path, WARNINGS you are responsible to free it
1131 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1132 IGFD_ResultMode vMode); // Result Mode
1133
1134IGFD_C_API char* IGFD_GetCurrentFileName( // Save File behavior : will always return the content of the field with
1135 // current filter extention, WARNINGS you are responsible to free it
1136 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1137 IGFD_ResultMode vMode); // Result Mode
1138
1139IGFD_C_API char* IGFD_GetCurrentPath( // will return current path, WARNINGS you are responsible to free it
1140 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1141
1142IGFD_C_API char* IGFD_GetCurrentFilter( // will return selected filter, WARNINGS you are responsible to free it
1143 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1144
1145IGFD_C_API void* IGFD_GetUserDatas( // will return user datas send with Open Dialog
1146 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1147
1148IGFD_C_API void IGFD_SetFileStyle( // SetExtention datas for have custom display of particular file type
1149 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1150 IGFD_FileStyleFlags vFileStyleFlags, // file style type
1151 const char* vFilter, // extention filter to tune
1152 ImVec4 vColor, // wanted color for the display of the file with extention filter
1153 const char* vIconText, // wanted text or icon of the file with extention filter (can be sued with font icon)
1154 ImFont* vFont); // wanted font pointer
1155
1156IGFD_C_API void IGFD_SetFileStyle2( // SetExtention datas for have custom display of particular file type
1157 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1158 IGFD_FileStyleFlags vFileStyleFlags, // file style type
1159 const char* vFilter, // extention filter to tune
1160 float vR, float vG, float vB,
1161 float vA, // wanted color channels RGBA for the display of the file with extention filter
1162 const char* vIconText, // wanted text or icon of the file with extention filter (can be sued with font icon)
1163 ImFont* vFont); // wanted font pointer
1164
1165IGFD_C_API bool IGFD_GetFileStyle(ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1166 IGFD_FileStyleFlags vFileStyleFlags, // file style type
1167 const char* vFilter, // extention filter (same as used in SetExtentionInfos)
1168 ImVec4* vOutColor, // color to retrieve
1169 char** vOutIconText, // icon or text to retrieve, WARNINGS you are responsible to free it
1170 ImFont** vOutFont); // font pointer to retrived
1171
1172IGFD_C_API void IGFD_ClearFilesStyle( // clear extentions setttings
1173 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1174
1175IGFD_C_API void SetLocales( // set locales to use before and after display
1176 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1177 const int vCategory, // set local category
1178 const char* vBeginLocale, // locale to use at begining of the dialog display
1179 const char* vEndLocale); // locale to set at end of the dialog display
1180
1181#ifdef USE_EXPLORATION_BY_KEYS
1182IGFD_C_API void IGFD_SetFlashingAttenuationInSeconds( // set the flashing time of the line in file list when use
1183 // exploration keys
1184 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1185 float vAttenValue); // set the attenuation (from flashed to not flashed) in seconds
1186#endif
1187
1188#ifdef USE_PLACES_FEATURE
1189IGFD_C_API char* IGFD_SerializePlaces( // serialize place : return place buffer to save in a file, WARNINGS
1190 // you are responsible to free it
1191 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1192 bool vDontSerializeCodeBasedPlaces); // for avoid serialization of place added by code
1193
1194IGFD_C_API void IGFD_DeserializePlaces( // deserialize place : load bookmar buffer to load in the dialog (saved
1195 // from previous use with SerializePlaces())
1196 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1197 const char* vPlaces); // place buffer to load
1198
1199IGFD_C_API bool IGFD_AddPlacesGroup( // add a places group by code
1200 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1201 const char* vGroupName, // the group name
1202 size_t vDisplayOrder, // the display roder of the group
1203 bool vCanBeEdited); // let the user add/remove place in the group
1204
1205IGFD_C_API bool IGFD_RemovePlacesGroup( // remove a place group by code, return true if succeed
1206 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1207 const char* vGroupName); // place name to remove
1208
1209IGFD_C_API bool IGFD_AddPlace( // add a place by code
1210 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1211 const char* vGroupName, // the group name
1212 const char* vPlaceName, // place name
1213 const char* vPlacePath, // place path
1214 bool vCanBeSaved, // place can be saved
1215 const char* vIconText); // wanted text or icon of the file with extention filter (can be used with font icon)
1216
1217IGFD_C_API bool IGFD_RemovePlace( // remove a place by code, return true if succeed
1218 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1219 const char* vGroupName, // the group name
1220 const char* vPlaceName); // place name to remove
1221
1222#endif
1223
1224#ifdef USE_THUMBNAILS
1225IGFD_C_API void SetCreateThumbnailCallback( // define the callback for create the thumbnails texture
1226 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1227 IGFD_CreateThumbnailFun vCreateThumbnailFun); // the callback for create the thumbnails texture
1228
1229IGFD_C_API void SetDestroyThumbnailCallback( // define the callback for destroy the thumbnails texture
1230 ImGuiFileDialog* vContextPtr, // ImGuiFileDialog context
1231 IGFD_DestroyThumbnailFun vDestroyThumbnailFun); // the callback for destroy the thumbnails texture
1232
1233IGFD_C_API void ManageGPUThumbnails( // must be call in gpu zone, possibly a thread, will call the callback for create
1234 // / destroy the textures
1235 ImGuiFileDialog* vContextPtr); // ImGuiFileDialog context
1236#endif // USE_THUMBNAILS
IGFD_C_API IGFD_FileDialog_Config IGFD_FileDialog_Config_Get()
Definition ImGuiFileDialog.cpp:4881
IGFD_C_API void SetLocales(ImGuiFileDialog *vContextPtr, const int vCategory, const char *vBeginLocale, const char *vEndLocale)
Definition ImGuiFileDialog.cpp:5194
int ImGuiFileDialogFlags
Definition ImGuiFileDialog.h:85
IGFD_C_API void IGFD_Selection_Pair_DestroyContent(IGFD_Selection_Pair *vSelection_Pair)
Definition ImGuiFileDialog.cpp:4903
IGFD_C_API IGFD_Selection IGFD_GetSelection(ImGuiFileDialog *vContextPtr, IGFD_ResultMode vMode)
Definition ImGuiFileDialog.cpp:5012
IGFD_C_API void * IGFD_GetUserDatas(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:5144
IGFD_C_API void IGFD_SetFileStyle2(ImGuiFileDialog *vContextPtr, IGFD_FileStyleFlags vFileStyleFlags, const char *vFilter, float vR, float vG, float vB, float vA, const char *vIconText, ImFont *vFont)
Definition ImGuiFileDialog.cpp:5160
IGFD_C_API char * IGFD_GetFilePathName(ImGuiFileDialog *vContextPtr, IGFD_ResultMode vMode)
Definition ImGuiFileDialog.cpp:5056
IGFD_FileStyleFlags_
Definition ImGuiFileDialog.h:75
@ IGFD_FileStyleByTypeLink
Definition ImGuiFileDialog.h:79
@ IGFD_FileStyleByTypeFile
Definition ImGuiFileDialog.h:77
@ IGFD_FileStyleByTypeDir
Definition ImGuiFileDialog.h:78
@ IGFD_FileStyleByExtention
Definition ImGuiFileDialog.h:80
@ IGFD_FileStyleByContainedInFullName
Definition ImGuiFileDialog.h:82
@ IGFD_FileStyleByFullName
Definition ImGuiFileDialog.h:81
@ IGFD_FileStyle_None
Definition ImGuiFileDialog.h:76
struct ImGuiFileDialog ImGuiFileDialog
Definition ImGuiFileDialog.h:1047
IGFD_C_API bool IGFD_IsOk(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:4974
IGFD_C_API ImGuiFileDialog * IGFD_Create(void)
Definition ImGuiFileDialog.cpp:4929
#define IGFD_API
Definition ImGuiFileDialog.h:65
IGFD_C_API IGFD_Selection IGFD_Selection_Get()
Definition ImGuiFileDialog.cpp:4911
IGFD_C_API void IGFD_ClearFilesStyle(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:5188
IGFD_C_API bool IGFD_IsKeyOpened(ImGuiFileDialog *vContextPtr, const char *vCurrentOpenedKey)
Definition ImGuiFileDialog.cpp:4996
IGFD_ResultMode_
Definition ImGuiFileDialog.h:113
@ IGFD_ResultMode_AddIfNoFileExt
Definition ImGuiFileDialog.h:130
@ IGFD_ResultMode_OverwriteFileExt
Definition ImGuiFileDialog.h:152
@ IGFD_ResultMode_KeepInputFile
Definition ImGuiFileDialog.h:168
IGFD_C_API void IGFD_Destroy(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:4934
IGFD_C_API char * IGFD_GetCurrentPath(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:5100
IGFD_C_API void SetLocales(ImGuiFileDialog *vContextPtr, const int vCategory, const char *vBeginLocale, const char *vEndLocale)
Definition ImGuiFileDialog.cpp:5194
IGFD_C_API bool IGFD_GetFileStyle(ImGuiFileDialog *vContextPtr, IGFD_FileStyleFlags vFileStyleFlags, const char *vFilter, ImVec4 *vOutColor, char **vOutIconText, ImFont **vOutFont)
Definition ImGuiFileDialog.cpp:5166
#define IGFD_C_API
Definition ImGuiFileDialog.h:1046
IGFD_C_API char * IGFD_GetCurrentFileName(ImGuiFileDialog *vContextPtr, IGFD_ResultMode vMode)
Definition ImGuiFileDialog.cpp:5078
int IGFD_FileStyleFlags
Definition ImGuiFileDialog.h:73
IGFD_C_API void IGFD_CloseDialog(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:4968
ImGuiFileDialogFlags_
Definition ImGuiFileDialog.h:86
@ ImGuiFileDialogFlags_OptionalFileName
Definition ImGuiFileDialog.h:103
@ ImGuiFileDialogFlags_DisableCreateDirectoryButton
Definition ImGuiFileDialog.h:90
@ ImGuiFileDialogFlags_ConfirmOverwrite
Definition ImGuiFileDialog.h:88
@ ImGuiFileDialogFlags_Modal
Definition ImGuiFileDialog.h:97
@ ImGuiFileDialogFlags_ReadOnlyFileNameField
Definition ImGuiFileDialog.h:95
@ ImGuiFileDialogFlags_CaseInsensitiveExtentionFiltering
Definition ImGuiFileDialog.h:96
@ ImGuiFileDialogFlags_DisableThumbnailMode
Definition ImGuiFileDialog.h:98
@ ImGuiFileDialogFlags_HideColumnSize
Definition ImGuiFileDialog.h:92
@ ImGuiFileDialogFlags_ShowDevicesButton
Definition ImGuiFileDialog.h:101
@ ImGuiFileDialogFlags_Default
Definition ImGuiFileDialog.h:106
@ ImGuiFileDialogFlags_None
Definition ImGuiFileDialog.h:87
@ ImGuiFileDialogFlags_HideColumnType
Definition ImGuiFileDialog.h:91
@ ImGuiFileDialogFlags_NoDialog
Definition ImGuiFileDialog.h:94
@ ImGuiFileDialogFlags_DisableQuickPathSelection
Definition ImGuiFileDialog.h:100
@ ImGuiFileDialogFlags_HideColumnDate
Definition ImGuiFileDialog.h:93
@ ImGuiFileDialogFlags_DisablePlaceMode
Definition ImGuiFileDialog.h:99
@ ImGuiFileDialogFlags_DontShowHiddenFiles
Definition ImGuiFileDialog.h:89
@ ImGuiFileDialogFlags_NaturalSorting
Definition ImGuiFileDialog.h:102
int IGFD_ResultMode
Definition ImGuiFileDialog.h:112
IGFD_C_API void IGFD_OpenDialog(ImGuiFileDialog *vContextPtr, const char *vKey, const char *vTitle, const char *vFilters, const struct IGFD_FileDialog_Config vConfig)
Definition ImGuiFileDialog.cpp:4941
IGFD_C_API bool IGFD_IsOpened(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:5004
IGFD_C_API char * IGFD_GetCurrentFilter(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:5122
IGFD_C_API void IGFD_SetFileStyle(ImGuiFileDialog *vContextPtr, IGFD_FileStyleFlags vFileStyleFlags, const char *vFilter, ImVec4 vColor, const char *vIconText, ImFont *vFont)
Definition ImGuiFileDialog.cpp:5152
void(* IGFD_PaneFun)(const char *, void *, bool *)
Definition ImGuiFileDialog.h:1052
IGFD_C_API IGFD_Selection_Pair IGFD_Selection_Pair_Get()
Definition ImGuiFileDialog.cpp:4895
IGFD_C_API bool IGFD_WasOpenedThisFrame(ImGuiFileDialog *vContextPtr)
Definition ImGuiFileDialog.cpp:4988
IGFD_C_API bool IGFD_DisplayDialog(ImGuiFileDialog *vContextPtr, const char *vKey, ImGuiWindowFlags vFlags, ImVec2 vMinSize, ImVec2 vMaxSize)
Definition ImGuiFileDialog.cpp:4961
IGFD_C_API void IGFD_Selection_DestroyContent(IGFD_Selection *vSelection)
Definition ImGuiFileDialog.cpp:4916
IGFD_C_API bool IGFD_WasKeyOpenedThisFrame(ImGuiFileDialog *vContextPtr, const char *vKey)
Definition ImGuiFileDialog.cpp:4981
@ Invalid
Definition vertexlayout.h:50
Math::vec3 color
Definition volumetricfogcontext.cc:42
IM3D_API void NewFrame()
Definition im3d.h:812
IM3D_API void EndFrame()
Definition im3d.h:813
void Clear(void *ptr, size_t numBytes)
Overwrite a chunk of memory with 0's.
Definition osxmemory.cc:229
Math::float2 size
Definition histogramcontext.cc:43
Definition ImGuiFileDialog.h:1054
void * userDatas
Definition ImGuiFileDialog.h:1059
ImGuiFileDialogFlags flags
Definition ImGuiFileDialog.h:1062
float sidePaneWidth
Definition ImGuiFileDialog.h:1061
const char * fileName
Definition ImGuiFileDialog.h:1056
const char * path
Definition ImGuiFileDialog.h:1055
int32_t countSelectionMax
Definition ImGuiFileDialog.h:1058
IGFD_PaneFun sidePane
Definition ImGuiFileDialog.h:1060
const char * filePathName
Definition ImGuiFileDialog.h:1057
Definition ImGuiFileDialog.h:1066
char * filePathName
Definition ImGuiFileDialog.h:1068
char * fileName
Definition ImGuiFileDialog.h:1067
Definition ImGuiFileDialog.h:1074
size_t count
Definition ImGuiFileDialog.h:1076
IGFD_Selection_Pair * table
Definition ImGuiFileDialog.h:1075
bool operator>(const TiXmlString &a, const TiXmlString &b)
Definition tinystr.h:283
bool operator<(const TiXmlString &a, const TiXmlString &b)
Definition tinystr.h:277
bool operator==(const TiXmlString &a, const TiXmlString &b)
Definition tinystr.h:272
bool operator!=(const TiXmlString &a, const TiXmlString &b)
Definition tinystr.h:282