summaryrefslogtreecommitdiff
path: root/src/c_fl_file_chooser.cpp
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2024-12-10 20:47:53 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2024-12-10 22:31:22 +1300
commit24781de8bedb3bf4d12d7ec1d0307842e59a3f94 (patch)
tree26e4ab0fad00728adead6cb6626fe40fa7a31704 /src/c_fl_file_chooser.cpp
parent70d75e1f45bcee89b363677a161f022ecbffd1db (diff)
Binding for filename.H added
Diffstat (limited to 'src/c_fl_file_chooser.cpp')
-rw-r--r--src/c_fl_file_chooser.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/c_fl_file_chooser.cpp b/src/c_fl_file_chooser.cpp
index 4cf3e8e..3ca16e2 100644
--- a/src/c_fl_file_chooser.cpp
+++ b/src/c_fl_file_chooser.cpp
@@ -11,6 +11,26 @@
+// Exports from Ada
+
+extern "C" int file_chooser_sort_hook(const char * a, const char * b);
+
+
+
+
+// Some extra setup
+
+int file_chooser_sort_prehook(struct dirent ** a, struct dirent ** b) {
+ return file_chooser_sort_hook((*a)->d_name, (*b)->d_name);
+}
+
+void file_chooser_setup_sort_hook() {
+ Fl_File_Chooser::sort = &file_chooser_sort_prehook;
+}
+
+
+
+
// Flattened C API begins here
FILECHOOSER new_fl_file_chooser(const char * n, const char * p, int k, const char * t) {