summaryrefslogtreecommitdiff
path: root/gtk/gtkaccelmap.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2004-12-12 21:09:13 +0000
committerTor Lillqvist <tml@src.gnome.org>2004-12-12 21:09:13 +0000
commitf3da17053918abe78db5f75e7d008e4c84c09570 (patch)
tree8ec4255ddb86a9d13de0e6012246a64f4cc671e3 /gtk/gtkaccelmap.c
parentf821217218c60a96cda40844fbef300b4b3d143b (diff)
downloadgtk+-f3da17053918abe78db5f75e7d008e4c84c09570.tar.gz
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.
Diffstat (limited to 'gtk/gtkaccelmap.c')
-rw-r--r--gtk/gtkaccelmap.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/gtk/gtkaccelmap.c b/gtk/gtkaccelmap.c
index 647aa70d45..c4cd681dd3 100644
--- a/gtk/gtkaccelmap.c
+++ b/gtk/gtkaccelmap.c
@@ -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