diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2024-12-10 20:47:53 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2024-12-10 22:31:22 +1300 |
commit | 24781de8bedb3bf4d12d7ec1d0307842e59a3f94 (patch) | |
tree | 26e4ab0fad00728adead6cb6626fe40fa7a31704 /src/fltk-file_choosers.adb | |
parent | 70d75e1f45bcee89b363677a161f022ecbffd1db (diff) |
Binding for filename.H added
Diffstat (limited to 'src/fltk-file_choosers.adb')
-rw-r--r-- | src/fltk-file_choosers.adb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/fltk-file_choosers.adb b/src/fltk-file_choosers.adb index 5363c51..db9768c 100644 --- a/src/fltk-file_choosers.adb +++ b/src/fltk-file_choosers.adb @@ -47,6 +47,13 @@ package body FLTK.File_Choosers is + procedure file_chooser_setup_sort_hook; + pragma Import (C, file_chooser_setup_sort_hook, "file_chooser_setup_sort_hook"); + pragma Inline (file_chooser_setup_sort_hook); + + + + function new_fl_file_chooser (N, P : in Interfaces.C.char_array; K : in Interfaces.C.int; @@ -459,6 +466,26 @@ package body FLTK.File_Choosers is + ---------------------- + -- Callback Hooks -- + ---------------------- + + function File_Chooser_Sort_Hook + (A, B : in Interfaces.C.Strings.chars_ptr) + return Interfaces.C.int; + + pragma Export (C, File_Chooser_Sort_Hook, "file_chooser_sort_hook"); + + function File_Chooser_Sort_Hook + (A, B : in Interfaces.C.Strings.chars_ptr) + return Interfaces.C.int is + begin + return Filenames.Comparison'Pos (Sort_Method + (Interfaces.C.Strings.Value (A), + Interfaces.C.Strings.Value (B))) - 1; + end File_Chooser_Sort_Hook; + + procedure File_Chooser_Callback_Hook (C_Addr, User_Data : in Storage.Integer_Address); @@ -1205,6 +1232,10 @@ package body FLTK.File_Choosers is end Is_Visible; +begin + + file_chooser_setup_sort_hook; + end FLTK.File_Choosers; |