char *cp, *up;
GError *error = NULL;
- while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read,
- &bytes_written, &error))
+ while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
+ &bytes_written, &error))
&& error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
{
++nr_bad;
if (cp) g_free (cp);
up = utf8_str = xmalloc (strlen (str) + nr_bad * 4 + 1);
- p = str;
+ p = (unsigned char *)str;
- while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read,
+ while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
&bytes_written, &error))
&& error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
{
- strncpy (up, p, bytes_written);
+ strncpy (up, (char *)p, bytes_written);
sprintf (up + bytes_written, "\\%03o", p[bytes_written]);
up[bytes_written+4] = '\0';
up += bytes_written+4;
xg_uses_old_file_dialog ()
{
#ifdef HAVE_GTK_FILE_BOTH
- extern int x_use_old_gtk_file_dialog;
- return x_use_old_gtk_file_dialog;
+ extern int x_gtk_use_old_file_dialog;
+ return x_gtk_use_old_file_dialog;
#else /* ! HAVE_GTK_FILE_BOTH */
#ifdef HAVE_GTK_FILE_SELECTION_NEW
GTK_FILE_CHOOSER_ACTION_OPEN :
GTK_FILE_CHOOSER_ACTION_SAVE);
extern int x_gtk_show_hidden_files;
+ extern int x_gtk_file_dialog_help_text;
+
if (only_dir_p)
action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
g_signal_connect (G_OBJECT (filewin), "notify",
G_CALLBACK (xg_toggle_notify_cb), wtoggle);
- message[0] = '\0';
- if (action != GTK_FILE_CHOOSER_ACTION_SAVE)
- strcat (message, "\nType C-l to display a file name text entry box.\n");
- strcat (message, "\nIf you don't like this file selector, use the "
- "corresponding\nkey binding or customize "
- "use-file-dialog to turn it off.");
+ if (x_gtk_file_dialog_help_text)
+ {
+ message[0] = '\0';
+ /* Gtk+ 2.10 has the file name text entry box integrated in the dialog.
+ Show the C-l help text only for versions < 2.10. */
+ if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE)
+ strcat (message, "\nType C-l to display a file name text entry box.\n");
+ strcat (message, "\nIf you don't like this file selector, use the "
+ "corresponding\nkey binding or customize "
+ "use-file-dialog to turn it off.");
- wmessage = gtk_label_new (message);
- gtk_widget_show (wmessage);
+ wmessage = gtk_label_new (message);
+ gtk_widget_show (wmessage);
+ }
+
gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0);
+ if (x_gtk_file_dialog_help_text)
+ gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (filewin), wbox);
if (default_filename)
GdkEventButton *event;
gpointer user_data;
{
- g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER,
- (gpointer) event->state);
+ /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */
+ gpointer ptr = (gpointer) (EMACS_INT) event->state;
+ g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, ptr);
return FALSE;
}
{
/* The EMACS_INT cast avoids a warning. */
int idx = (int) (EMACS_INT) client_data;
- int mod = (int) g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER);
+ int mod = (int) (EMACS_INT) g_object_get_data (G_OBJECT (w),
+ XG_TOOL_BAR_LAST_MODIFIER);
FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
Lisp_Object key, frame;
if (img->load_failed_p || img->pixmap == None)
{
- if (wicon) gtk_widget_hide (wicon);
+ if (wicon)
+ gtk_widget_hide (wicon);
+ else
+ gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget),
+ gtk_tool_button_new (NULL, ""),
+ i);
continue;
}