Commit f3da1705 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

gtk/gtkaccelmap.[ch] gtk/gtkfilechooser.[ch] gtk/gtkfilesel.c

2004-12-12  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkaccelmap.[ch]
	* gtk/gtkfilechooser.[ch]
	* gtk/gtkfilesel.c
	* gtk/gtkfilesystemwin32.c
	* gtk/gtkiconfactory.[ch]
	* gtk/gtkicontheme.[ch]
	* gtk/gtkimage.[ch]
	* gtk/gtkimmodule.c
	* gtk/gtkmodules.c
	* gtk/gtkrc.[ch]
	* gtk/gtkuimanager.[ch]
	* gtk/gtkwindow.[ch]
	* gtk/updateiconcache.c
	* gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert
	environment variables referring to pathnames from locale encoding
	to UTF-8. As in GLib, in order to preserve Windows DLL ABI
	stability, add binary compatibility versions of functions that
	take file names as arguments, or return file names. Add a _utf8
	suffix to the "real" such functions on Windows. The ABI
	compatibility versions keep the old name.

	* gtk/Makefile.am: Strip PRIVATE symbols from the GNU import
	library.

	* gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement
	file mapping on Win32.

	* gtk/updateiconcache.c: Don't crash if invoked without
	argument. Use binary mode when opening file.

	* modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install
	gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.
parent f8212172
2004-12-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkaccelmap.[ch]
* gtk/gtkfilechooser.[ch]
* gtk/gtkfilesel.c
* gtk/gtkfilesystemwin32.c
* gtk/gtkiconfactory.[ch]
* gtk/gtkicontheme.[ch]
* gtk/gtkimage.[ch]
* gtk/gtkimmodule.c
* gtk/gtkmodules.c
* gtk/gtkrc.[ch]
* gtk/gtkuimanager.[ch]
* gtk/gtkwindow.[ch]
* gtk/updateiconcache.c
* gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert
environment variables referring to pathnames from locale encoding
to UTF-8. As in GLib, in order to preserve Windows DLL ABI
stability, add binary compatibility versions of functions that
take file names as arguments, or return file names. Add a _utf8
suffix to the "real" such functions on Windows. The ABI
compatibility versions keep the old name.
* gtk/Makefile.am: Strip PRIVATE symbols from the GNU import
library.
* gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement
file mapping on Win32.
* gtk/updateiconcache.c: Don't crash if invoked without
argument. Use binary mode when opening file.
* modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install
gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.
2004-12-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtklabel.c (gtk_label_setup_mnemonic): Fix a
......
2004-12-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkaccelmap.[ch]
* gtk/gtkfilechooser.[ch]
* gtk/gtkfilesel.c
* gtk/gtkfilesystemwin32.c
* gtk/gtkiconfactory.[ch]
* gtk/gtkicontheme.[ch]
* gtk/gtkimage.[ch]
* gtk/gtkimmodule.c
* gtk/gtkmodules.c
* gtk/gtkrc.[ch]
* gtk/gtkuimanager.[ch]
* gtk/gtkwindow.[ch]
* gtk/updateiconcache.c
* gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert
environment variables referring to pathnames from locale encoding
to UTF-8. As in GLib, in order to preserve Windows DLL ABI
stability, add binary compatibility versions of functions that
take file names as arguments, or return file names. Add a _utf8
suffix to the "real" such functions on Windows. The ABI
compatibility versions keep the old name.
* gtk/Makefile.am: Strip PRIVATE symbols from the GNU import
library.
* gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement
file mapping on Win32.
* gtk/updateiconcache.c: Don't crash if invoked without
argument. Use binary mode when opening file.
* modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install
gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.
2004-12-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtklabel.c (gtk_label_setup_mnemonic): Fix a
......
2004-12-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkaccelmap.[ch]
* gtk/gtkfilechooser.[ch]
* gtk/gtkfilesel.c
* gtk/gtkfilesystemwin32.c
* gtk/gtkiconfactory.[ch]
* gtk/gtkicontheme.[ch]
* gtk/gtkimage.[ch]
* gtk/gtkimmodule.c
* gtk/gtkmodules.c
* gtk/gtkrc.[ch]
* gtk/gtkuimanager.[ch]
* gtk/gtkwindow.[ch]
* gtk/updateiconcache.c
* gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert
environment variables referring to pathnames from locale encoding
to UTF-8. As in GLib, in order to preserve Windows DLL ABI
stability, add binary compatibility versions of functions that
take file names as arguments, or return file names. Add a _utf8
suffix to the "real" such functions on Windows. The ABI
compatibility versions keep the old name.
* gtk/Makefile.am: Strip PRIVATE symbols from the GNU import
library.
* gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement
file mapping on Win32.
* gtk/updateiconcache.c: Don't crash if invoked without
argument. Use binary mode when opening file.
* modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install
gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.
2004-12-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtklabel.c (gtk_label_setup_mnemonic): Fix a
......
2004-12-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkaccelmap.[ch]
* gtk/gtkfilechooser.[ch]
* gtk/gtkfilesel.c
* gtk/gtkfilesystemwin32.c
* gtk/gtkiconfactory.[ch]
* gtk/gtkicontheme.[ch]
* gtk/gtkimage.[ch]
* gtk/gtkimmodule.c
* gtk/gtkmodules.c
* gtk/gtkrc.[ch]
* gtk/gtkuimanager.[ch]
* gtk/gtkwindow.[ch]
* gtk/updateiconcache.c
* gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert
environment variables referring to pathnames from locale encoding
to UTF-8. As in GLib, in order to preserve Windows DLL ABI
stability, add binary compatibility versions of functions that
take file names as arguments, or return file names. Add a _utf8
suffix to the "real" such functions on Windows. The ABI
compatibility versions keep the old name.
* gtk/Makefile.am: Strip PRIVATE symbols from the GNU import
library.
* gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement
file mapping on Win32.
* gtk/updateiconcache.c: Don't crash if invoked without
argument. Use binary mode when opening file.
* modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install
gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.
2004-12-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtklabel.c (gtk_label_setup_mnemonic): Fix a
......
......@@ -46,6 +46,10 @@ gtk-win32res.lo : gtk-win32.rc
$(top_srcdir)/build/win32/lt-compile-resource gtk-win32.rc gtk-win32res.lo
install-libtool-import-lib:
for entry in `grep PRIVATE gtk.def | sed -e 's/PRIVATE//'`; do \
file=`nm -A .libs/libgtk-win32-$(GTK_API_VERSION).dll.a | tr -d '\r' | grep -m 1 -E $$entry'$$' | cut -d: -f2`; \
ar d .libs/libgtk-win32-$(GTK_API_VERSION).dll.a $$file; \
done
$(INSTALL) .libs/libgtk-win32-$(GTK_API_VERSION).dll.a $(DESTDIR)$(libdir)
uninstall-libtool-import-lib:
-rm $(DESTDIR)$(libdir)/libtk-win32-$(GTK_API_VERSION).dll.a
......
......@@ -72,12 +72,18 @@ gtk_accel_map_foreach
gtk_accel_map_foreach_unfiltered
gtk_accel_map_get
gtk_accel_map_get_type G_GNUC_CONST
gtk_accel_map_load
gtk_accel_map_load PRIVATE
#ifdef G_OS_WIN32
gtk_accel_map_load_utf8
#endif
gtk_accel_map_load_fd
gtk_accel_map_load_scanner
gtk_accel_map_lock_path
gtk_accel_map_lookup_entry
gtk_accel_map_save
gtk_accel_map_save PRIVATE
#ifdef G_OS_WIN32
gtk_accel_map_save_utf8
#endif
gtk_accel_map_save_fd
gtk_accel_map_unlock_path
gtk_accessible_connect_widget_destroyed
......@@ -772,7 +778,10 @@ gtk_expander_style_get_type G_GNUC_CONST
gtk_false G_GNUC_CONST
gtk_file_chooser_action_get_type G_GNUC_CONST
gtk_file_chooser_add_filter
gtk_file_chooser_add_shortcut_folder
gtk_file_chooser_add_shortcut_folder PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_add_shortcut_folder_utf8
#endif
gtk_file_chooser_add_shortcut_folder_uri
gtk_file_chooser_button_get_title
gtk_file_chooser_button_get_type G_GNUC_CONST
......@@ -788,14 +797,26 @@ gtk_file_chooser_dialog_new_with_backend
gtk_file_chooser_error_get_type
gtk_file_chooser_error_quark
gtk_file_chooser_get_action
gtk_file_chooser_get_current_folder
gtk_file_chooser_get_current_folder PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_get_current_folder_utf8
#endif
gtk_file_chooser_get_current_folder_uri
gtk_file_chooser_get_extra_widget
gtk_file_chooser_get_filename
gtk_file_chooser_get_filenames
gtk_file_chooser_get_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_get_filename_utf8
#endif
gtk_file_chooser_get_filenames PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_get_filenames_utf8
#endif
gtk_file_chooser_get_filter
gtk_file_chooser_get_local_only
gtk_file_chooser_get_preview_filename
gtk_file_chooser_get_preview_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_get_preview_filename_utf8
#endif
gtk_file_chooser_get_preview_uri
gtk_file_chooser_get_preview_widget
gtk_file_chooser_get_preview_widget_active
......@@ -806,20 +827,35 @@ gtk_file_chooser_get_uri
gtk_file_chooser_get_uris
gtk_file_chooser_get_use_preview_label
gtk_file_chooser_list_filters
gtk_file_chooser_list_shortcut_folders
gtk_file_chooser_list_shortcut_folders PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_list_shortcut_folders_utf8
#endif
gtk_file_chooser_list_shortcut_folder_uris
gtk_file_chooser_remove_filter
gtk_file_chooser_remove_shortcut_folder
gtk_file_chooser_remove_shortcut_folder PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_remove_shortcut_folder_utf8
#endif
gtk_file_chooser_remove_shortcut_folder_uri
gtk_file_chooser_select_all
gtk_file_chooser_select_filename
gtk_file_chooser_select_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_select_filename_utf8
#endif
gtk_file_chooser_select_uri
gtk_file_chooser_set_action
gtk_file_chooser_set_current_folder
gtk_file_chooser_set_current_folder PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_set_current_folder_utf8
#endif
gtk_file_chooser_set_current_folder_uri
gtk_file_chooser_set_current_name
gtk_file_chooser_set_extra_widget
gtk_file_chooser_set_filename
gtk_file_chooser_set_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_set_filename_utf8
#endif
gtk_file_chooser_set_filter
gtk_file_chooser_set_local_only
gtk_file_chooser_set_preview_widget
......@@ -829,7 +865,10 @@ gtk_file_chooser_set_show_hidden
gtk_file_chooser_set_uri
gtk_file_chooser_set_use_preview_label
gtk_file_chooser_unselect_all
gtk_file_chooser_unselect_filename
gtk_file_chooser_unselect_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_chooser_unselect_filename_utf8
#endif
gtk_file_chooser_unselect_uri
gtk_file_chooser_widget_get_type G_GNUC_CONST
gtk_file_chooser_widget_new
......@@ -871,13 +910,22 @@ gtk_file_paths_copy
gtk_file_paths_free
gtk_file_paths_sort
gtk_file_selection_complete
gtk_file_selection_get_filename
gtk_file_selection_get_selections
gtk_file_selection_get_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_selection_get_filename_utf8
#endif
gtk_file_selection_get_selections PRIVATE
#ifdef G_OS_WIN32
gtk_file_selection_get_selections_utf8
#endif
gtk_file_selection_get_select_multiple
gtk_file_selection_get_type G_GNUC_CONST
gtk_file_selection_hide_fileop_buttons
gtk_file_selection_new
gtk_file_selection_set_filename
gtk_file_selection_set_filename PRIVATE
#ifdef G_OS_WIN32
gtk_file_selection_set_filename_utf8
#endif
gtk_file_selection_set_select_multiple
gtk_file_selection_show_fileop_buttons
gtk_file_system_create_folder
......@@ -1019,7 +1067,10 @@ gtk_icon_info_get_base_size
gtk_icon_info_get_builtin_pixbuf
gtk_icon_info_get_display_name
gtk_icon_info_get_embedded_rect
gtk_icon_info_get_filename
gtk_icon_info_get_filename PRIVATE
#ifdef G_OS_WIN32
gtk_icon_info_get_filename_utf8
#endif
gtk_icon_info_get_type G_GNUC_CONST
gtk_icon_info_load_icon
gtk_icon_info_set_raw_coordinates
......@@ -1044,7 +1095,10 @@ gtk_icon_source_copy
gtk_icon_source_free
gtk_icon_source_get_direction
gtk_icon_source_get_direction_wildcarded
gtk_icon_source_get_filename
gtk_icon_source_get_filename PRIVATE
#ifdef G_OS_WIN32
gtk_icon_source_get_filename_utf8
#endif
gtk_icon_source_get_icon_name
gtk_icon_source_get_pixbuf
gtk_icon_source_get_size
......@@ -1055,7 +1109,10 @@ gtk_icon_source_get_type G_GNUC_CONST
gtk_icon_source_new
gtk_icon_source_set_direction
gtk_icon_source_set_direction_wildcarded
gtk_icon_source_set_filename
gtk_icon_source_set_filename PRIVATE
#ifdef G_OS_WIN32
gtk_icon_source_set_filename_utf8
#endif
gtk_icon_source_set_icon_name
gtk_icon_source_set_pixbuf
gtk_icon_source_set_size
......@@ -1063,25 +1120,37 @@ gtk_icon_source_set_size_wildcarded
gtk_icon_source_set_state
gtk_icon_source_set_state_wildcarded
gtk_icon_theme_add_builtin_icon
gtk_icon_theme_append_search_path
gtk_icon_theme_append_search_path PRIVATE
#ifdef G_OS_WIN32
gtk_icon_theme_append_search_path_utf8
#endif
gtk_icon_theme_error_get_type
gtk_icon_theme_error_quark
gtk_icon_theme_get_default
gtk_icon_theme_get_example_icon_name
gtk_icon_theme_get_for_screen
gtk_icon_theme_get_icon_sizes
gtk_icon_theme_get_search_path
gtk_icon_theme_get_search_path PRIVATE
#ifdef G_OS_WIN32
gtk_icon_theme_get_search_path_utf8
#endif
gtk_icon_theme_get_type G_GNUC_CONST
gtk_icon_theme_has_icon
gtk_icon_theme_list_icons
gtk_icon_theme_load_icon
gtk_icon_theme_lookup_icon
gtk_icon_theme_new
gtk_icon_theme_prepend_search_path
gtk_icon_theme_prepend_search_path PRIVATE
#ifdef G_OS_WIN32
gtk_icon_theme_prepend_search_path_utf8
#endif
gtk_icon_theme_rescan_if_needed
gtk_icon_theme_set_custom_theme
gtk_icon_theme_set_screen
gtk_icon_theme_set_search_path
gtk_icon_theme_set_search_path PRIVATE
#ifdef G_OS_WIN32
gtk_icon_theme_set_search_path_utf8
#endif
gtk_icon_view_get_markup_column
gtk_icon_view_get_model
gtk_icon_view_get_orientation
......@@ -1132,7 +1201,10 @@ gtk_image_menu_item_new_with_mnemonic
gtk_image_menu_item_set_image
gtk_image_new
gtk_image_new_from_animation
gtk_image_new_from_file
gtk_image_new_from_file PRIVATE
#ifdef G_OS_WIN32
gtk_image_new_from_file_utf8
#endif
gtk_image_new_from_icon_name
gtk_image_new_from_icon_set
gtk_image_new_from_image
......@@ -1141,7 +1213,10 @@ gtk_image_new_from_pixmap
gtk_image_new_from_stock
gtk_image_set
gtk_image_set_from_animation
gtk_image_set_from_file
gtk_image_set_from_file PRIVATE
#ifdef G_OS_WIN32
gtk_image_set_from_file_utf8
#endif
gtk_image_set_from_icon_name
gtk_image_set_from_icon_set
gtk_image_set_from_image
......@@ -1666,7 +1741,10 @@ gtk_range_set_range
gtk_range_set_update_policy
gtk_range_set_value
gtk_rc_add_class_style
gtk_rc_add_default_file
gtk_rc_add_default_file PRIVATE
#ifdef G_OS_WIN32
gtk_rc_add_default_file_utf8
#endif
gtk_rc_add_widget_class_style
gtk_rc_add_widget_name_style
gtk_rc_find_module_in_path
......@@ -1679,7 +1757,10 @@ gtk_rc_get_module_dir
gtk_rc_get_style
gtk_rc_get_style_by_paths
gtk_rc_get_theme_dir
gtk_rc_parse
gtk_rc_parse PRIVATE
#ifdef G_OS_WIN32
gtk_rc_parse_utf8
#endif
gtk_rc_parse_color
gtk_rc_parse_priority
gtk_rc_parse_state
......@@ -1693,7 +1774,10 @@ gtk_rc_reparse_all
gtk_rc_reparse_all_for_settings
gtk_rc_reset_styles
gtk_rc_scanner_new
gtk_rc_set_default_files
gtk_rc_set_default_files PRIVATE
#ifdef G_OS_WIN32
gtk_rc_set_default_files_utf8
#endif
gtk_rc_style_copy
gtk_rc_style_get_type G_GNUC_CONST
gtk_rc_style_new
......@@ -2627,7 +2711,10 @@ gtk_type_init
gtk_type_new
gtk_type_unique
gtk_ui_manager_add_ui
gtk_ui_manager_add_ui_from_file
gtk_ui_manager_add_ui_from_file PRIVATE
#ifdef G_OS_WIN32
gtk_ui_manager_add_ui_from_file_utf8
#endif
gtk_ui_manager_add_ui_from_string
gtk_ui_manager_ensure_update
gtk_ui_manager_get_accel_group
......@@ -2868,7 +2955,10 @@ gtk_window_set_auto_startup_notification
gtk_window_set_decorated
gtk_window_set_default
gtk_window_set_default_icon
gtk_window_set_default_icon_from_file
gtk_window_set_default_icon_from_file PRIVATE
#ifdef G_OS_WIN32
gtk_window_set_default_icon_from_file_utf8
#endif
gtk_window_set_default_icon_list
gtk_window_set_default_icon_name
gtk_window_set_default_size
......@@ -2880,7 +2970,10 @@ gtk_window_set_geometry_hints
gtk_window_set_gravity
gtk_window_set_has_frame
gtk_window_set_icon
gtk_window_set_icon_from_file
gtk_window_set_icon_from_file PRIVATE
#ifdef G_OS_WIN32
gtk_window_set_icon_from_file_utf8
#endif
gtk_window_set_icon_list
gtk_window_set_icon_name
gtk_window_set_keep_above
......
......@@ -25,6 +25,8 @@
#include "gtkmarshalers.h"
#include "gtkwindow.h" /* in lack of GtkAcceleratable */
#include <glib/gstdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
......@@ -603,7 +605,8 @@ gtk_accel_map_load_fd (gint fd)
/**
* gtk_accel_map_load:
* @file_name: a file containing accelerator specifications
* @file_name: a file containing accelerator specifications,
* in the GLib file name encoding
*
* Parses a file previously saved with gtk_accel_map_save() for
* accelerator specifications, and propagates them accordingly.
......@@ -618,7 +621,7 @@ gtk_accel_map_load (const gchar *file_name)
if (!g_file_test (file_name, G_FILE_TEST_IS_REGULAR))
return;
fd = open (file_name, O_RDONLY);
fd = g_open (file_name, O_RDONLY, 0);
if (fd < 0)
return;
......@@ -713,7 +716,8 @@ gtk_accel_map_save_fd (gint fd)
/**
* gtk_accel_map_save:
* @file_name: the file to contain accelerator specifications
* @file_name: the name of the file to contain accelerator specifications,
* in the GLib file name encoding
*
* Saves current accelerator specifications (accelerator path, key
* and modifiers) to @file_name.
......@@ -727,7 +731,7 @@ gtk_accel_map_save (const gchar *file_name)
g_return_if_fail (file_name != NULL);
fd = open (file_name, O_CREAT | O_TRUNC | O_WRONLY, 0644);
fd = g_open (file_name, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd < 0)
return;
......@@ -996,3 +1000,31 @@ do_accel_map_changed (AccelEntry *entry)
entry->accel_key,
entry->accel_mods);
}
#ifdef G_OS_WIN32
#undef gtk_accel_map_load
void
gtk_accel_map_load (const gchar *file_name)
{
gchar *utf8_file_name = g_locale_to_utf8 (file_name, -1, NULL, NULL, NULL);
gtk_accel_map_load_utf8 (utf8_file_name);
g_free (utf8_file_name);
}
#undef gtk_accel_map_save
void
gtk_accel_map_save (const gchar *file_name)
{
gchar *utf8_file_name = g_locale_to_utf8 (file_name, -1, NULL, NULL, NULL);
gtk_accel_map_save_utf8 (utf8_file_name);
g_free (utf8_file_name);
}
#endif
......@@ -44,6 +44,13 @@ typedef void (*GtkAccelMapForeach) (gpointer data,
/* --- public API --- */
#ifdef G_OS_WIN32
/* Reserve old names for DLL ABI backward compatibility */
#define gtk_accel_map_load gtk_accel_map_load_utf8
#define gtk_accel_map_save gtk_accel_map_save_utf8
#endif
void gtk_accel_map_add_entry (const gchar *accel_path,
guint accel_key,
GdkModifierType accel_mods);
......
......@@ -1827,3 +1827,172 @@ gtk_file_chooser_get_show_hidden (GtkFileChooser *chooser)
return show_hidden;
}
#ifdef G_OS_WIN32
/* DLL ABI stability backward compatibility versions */
#undef gtk_file_chooser_get_filename
gchar *
gtk_file_chooser_get_filename (GtkFileChooser *chooser)
{
gchar *utf8_filename = gtk_file_chooser_get_filename_utf8 (chooser);
gchar *retval = g_locale_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
g_free (utf8_filename);
return retval;
}
#undef gtk_file_chooser_set_filename
gboolean
gtk_file_chooser_set_filename (GtkFileChooser *chooser,
const gchar *filename)
{
gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL);
gboolean retval = gtk_file_chooser_set_filename_utf8 (chooser, utf8_filename);
g_free (utf8_filename);
return retval;
}
#undef gtk_file_chooser_select_filename
gboolean
gtk_file_chooser_select_filename (GtkFileChooser *chooser,
const gchar *filename)
{
gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL);
gboolean retval = gtk_file_chooser_select_filename_utf8 (chooser, utf8_filename);
g_free (utf8_filename);
return retval;
}
#undef gtk_file_chooser_unselect_filename
void
gtk_file_chooser_unselect_filename (GtkFileChooser *chooser,
const char *filename)
{
gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL);
gtk_file_chooser_unselect_filename_utf8 (chooser, utf8_filename);
g_free (utf8_filename);
}
#undef gtk_file_chooser_get_filenames
GSList *
gtk_file_chooser_get_filenames (GtkFileChooser *chooser)
{
GSList *list = gtk_file_chooser_get_filenames_utf8 (chooser);
GSList *rover = list;
while (rover)
{
gchar *tem = (gchar *) rover->data;
rover->data = g_locale_from_utf8 ((gchar *) rover->data, -1, NULL, NULL, NULL);
g_free (tem);
rover = rover->next;
}
return list;
}
#undef gtk_file_chooser_set_current_folder
gboolean
gtk_file_chooser_set_current_folder (GtkFileChooser *chooser,
const gchar *filename)
{
gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL);
gboolean retval = gtk_file_chooser_set_current_folder_utf8 (chooser, utf8_filename);
g_free (utf8_filename);
return retval;
}
#undef gtk_file_chooser_get_current_folder
gchar *
gtk_file_chooser_get_current_folder (GtkFileChooser *chooser)
{
gchar *utf8_folder = gtk_file_chooser_get_current_folder_utf8 (chooser);
gchar *retval = g_locale_from_utf8 (utf8_folder, -1, NULL, NULL, NULL);
g_free (utf8_folder);
return retval;
}
#undef gtk_file_chooser_get_preview_filename
char *
gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser)
{
char *utf8_filename = gtk_file_chooser_get_preview_filename_utf8 (chooser);
char *retval = g_locale_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
g_free (utf8_filename);
return retval;
}
#undef gtk_file_chooser_add_shortcut_folder
gboolean
gtk_file_chooser_add_shortcut_folder (GtkFileChooser *chooser,
const char *folder,
GError **error)
{
char *utf8_folder = g_locale_to_utf8 (folder, -1, NULL, NULL, NULL);
gboolean retval =
gtk_file_chooser_add_shortcut_folder_utf8 (chooser, utf8_folder, error);
g_free (utf8_folder);
return retval;
}
#undef gtk_file_chooser_remove_shortcut_folder
gboolean
gtk_file_chooser_remove_shortcut_folder (GtkFileChooser *chooser,
const char *folder,
GError **error)
{
char *utf8_folder = g_locale_to_utf8 (folder, -1, NULL, NULL, NULL);
gboolean retval =
gtk_file_chooser_remove_shortcut_folder_utf8 (chooser, utf8_folder, error);
g_free (utf8_folder);
return retval;
}
#undef gtk_file_chooser_list_shortcut_folders
GSList *
gtk_file_chooser_list_shortcut_folders (GtkFileChooser *chooser)
{
GSList *list = gtk_file_chooser_list_shortcut_folders_utf8 (chooser);
GSList *rover = list;
while (rover)
{
gchar *tem = (gchar *) rover->data;
rover->data = g_locale_from_utf8 ((gchar *) rover->data, -1, NULL, NULL, NULL);
g_free (tem);
rover = rover->next;
}
return list;
}
#endif
......@@ -75,6 +75,21 @@ void gtk_file_chooser_set_current_name (GtkFileChooser *chooser,
/* 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