View Issue Details

IDProjectCategoryView StatusLast Update
0031767FPCPackagespublic2017-07-23 12:41
ReporterHeikoAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindows 10OSWindowsOS Version10
Product Version3.0.2Product Build 
Target Version3.2.0Fixed in Version3.0.2 
Summary0031767: gtk_file_chooser_get_filename vs. gtk_file_chooser_get_filename_utf8
DescriptionThe current gtk2.24 has new library entries and defines old names for DLL ABI backward compatibility. This is not included in /gtk+/gtk/gtkfilechooser.inc.

-------------

From ~/Freepascal/3.0.2/fpcbuild-3.0.2/fpcsrc/packages/gtk2/src/gtk+/gtk/gtkfilechooser.inc:

    { Filename manipulation }
function gtk_file_chooser_get_filename(chooser:PGtkFileChooser):Pgchar;cdecl;external gtklib name 'gtk_file_chooser_get_filename';
function gtk_file_chooser_set_filename(chooser:PGtkFileChooser; filename:Pchar):gboolean;cdecl;external gtklib name 'gtk_file_chooser_set_filename';

function gtk_file_chooser_select_filename(chooser:PGtkFileChooser; filename:Pchar):gboolean;cdecl;external gtklib name 'gtk_file_chooser_select_filename';
procedure gtk_file_chooser_unselect_filename(chooser:PGtkFileChooser; filename:Pchar);cdecl;external gtklib name 'gtk_file_chooser_unselect_filename';

procedure gtk_file_chooser_select_all(chooser:PGtkFileChooser);cdecl;external gtklib name 'gtk_file_chooser_select_all';
procedure gtk_file_chooser_unselect_all(chooser:PGtkFileChooser);cdecl;external gtklib name 'gtk_file_chooser_unselect_all';

function gtk_file_chooser_get_filenames(chooser:PGtkFileChooser):PGSList;cdecl;external gtklib name 'gtk_file_chooser_get_filenames';

function gtk_file_chooser_set_current_folder(chooser:PGtkFileChooser; filename:Pgchar):gboolean;cdecl;external gtklib name 'gtk_file_chooser_set_current_folder';
function gtk_file_chooser_get_current_folder(chooser:PGtkFileChooser):Pgchar;cdecl;external gtklib name 'gtk_file_chooser_get_current_folder';

{ URI manipulation }
function gtk_file_chooser_get_uri(chooser:PGtkFileChooser):Pgchar;cdecl;external gtklib name 'gtk_file_chooser_get_uri';
function gtk_file_chooser_set_uri(chooser:PGtkFileChooser; uri:Pchar):gboolean;cdecl;external gtklib name 'gtk_file_chooser_set_uri';

function gtk_file_chooser_select_uri(chooser:PGtkFileChooser; uri:Pchar):gboolean;cdecl;external gtklib name 'gtk_file_chooser_select_uri';
procedure gtk_file_chooser_unselect_uri(chooser:PGtkFileChooser; uri:Pchar);cdecl;external gtklib name 'gtk_file_chooser_unselect_uri';

function gtk_file_chooser_get_uris(chooser:PGtkFileChooser):PGSList;cdecl;external gtklib name 'gtk_file_chooser_get_uris';

function gtk_file_chooser_set_current_folder_uri(chooser:PGtkFileChooser; uri:Pgchar):gboolean;cdecl;external gtklib name 'gtk_file_chooser_set_current_folder_uri';
function gtk_file_chooser_get_current_folder_uri(chooser:PGtkFileChooser):Pgchar;cdecl;external gtklib name 'gtk_file_chooser_get_current_folder_uri';

-----------------------

From https://github.com/GNOME/gtk/blob/gtk-2-24/gtk/gtkfilechooser.h:

/* Filename manipulation
 */
#ifdef G_OS_WIN32
/* Reserve old names for DLL ABI backward compatibility */
#define gtk_file_chooser_get_filename gtk_file_chooser_get_filename_utf8
#define gtk_file_chooser_set_filename gtk_file_chooser_set_filename_utf8
#define gtk_file_chooser_select_filename gtk_file_chooser_select_filename_utf8
#define gtk_file_chooser_unselect_filename gtk_file_chooser_unselect_filename_utf8
#define gtk_file_chooser_get_filenames gtk_file_chooser_get_filenames_utf8
#define gtk_file_chooser_set_current_folder gtk_file_chooser_set_current_folder_utf8
#define gtk_file_chooser_get_current_folder gtk_file_chooser_get_current_folder_utf8
#define gtk_file_chooser_get_preview_filename gtk_file_chooser_get_preview_filename_utf8
#define gtk_file_chooser_add_shortcut_folder gtk_file_chooser_add_shortcut_folder_utf8
#define gtk_file_chooser_remove_shortcut_folder gtk_file_chooser_remove_shortcut_folder_utf8
#define gtk_file_chooser_list_shortcut_folders gtk_file_chooser_list_shortcut_folders_utf8
#endif
TagsNo tags attached.
Fixed in Revision36772
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2017-07-23 12:41

administrator   ~0101869

I have added the missing declarations.

However:
The headers will also be used with other (older) versions of the library and will fail if the utf8 versions are not there, so I have added them under a USEUTF8 define

Issue History

Date Modified Username Field Change
2017-05-08 13:58 Heiko New Issue
2017-07-23 10:02 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-07-23 10:02 Michael Van Canneyt Status new => assigned
2017-07-23 12:41 Michael Van Canneyt Fixed in Revision => 36772
2017-07-23 12:41 Michael Van Canneyt Note Added: 0101869
2017-07-23 12:41 Michael Van Canneyt Status assigned => resolved
2017-07-23 12:41 Michael Van Canneyt Fixed in Version => 3.0.2
2017-07-23 12:41 Michael Van Canneyt Resolution open => fixed
2017-07-23 12:41 Michael Van Canneyt Target Version => 3.2.0