aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2005-12-23 11:34:13 +0000
committerJan Djärv2005-12-23 11:34:13 +0000
commit90f2e16b151bc42305f352ab3bfcb25429125179 (patch)
treeb1310cf51254370bcfdc183b7b9c77c6467af7b3 /src
parent5a4aad035fb7c3652913864e69fa095e6cb361ad (diff)
downloademacs-90f2e16b151bc42305f352ab3bfcb25429125179.tar.gz
emacs-90f2e16b151bc42305f352ab3bfcb25429125179.zip
* xfns.c (Fx_uses_old_gtk_dialog): New function.
* gtkutil.c (xg_uses_old_file_dialog): New function. (xg_get_file_name): Use xg_uses_old_file_dialog. * gtkutil.h: Declare xg_uses_old_file_dialog.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/gtkutil.c24
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/xfns.c22
4 files changed, 54 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 39af44aeae0..5e5fa3d62c4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12005-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * xfns.c (Fx_uses_old_gtk_dialog): New function.
4
5 * gtkutil.c (xg_uses_old_file_dialog): New function.
6 (xg_get_file_name): Use xg_uses_old_file_dialog.
7
8 * gtkutil.h: Declare xg_uses_old_file_dialog.
9
12005-12-22 Richard M. Stallman <rms@gnu.org> 102005-12-22 Richard M. Stallman <rms@gnu.org>
2 11
3 * xmenu.c (xmenu_show): Call inhibit_garbage_collection. 12 * xmenu.c (xmenu_show): Call inhibit_garbage_collection.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 54cb43b8398..9da3c5bf457 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1155,6 +1155,27 @@ create_dialog (wv, select_cb, deactivate_cb)
1155/*********************************************************************** 1155/***********************************************************************
1156 File dialog functions 1156 File dialog functions
1157 ***********************************************************************/ 1157 ***********************************************************************/
1158/* Return non-zero if the old file selection dialog is being used.
1159 Return zero if not. */
1160
1161int
1162xg_uses_old_file_dialog ()
1163{
1164#ifdef HAVE_GTK_FILE_BOTH
1165 extern int x_use_old_gtk_file_dialog;
1166 return x_use_old_gtk_file_dialog;
1167#else /* ! HAVE_GTK_FILE_BOTH */
1168
1169#ifdef HAVE_GTK_FILE_SELECTION_NEW
1170 return 1;
1171#else
1172 return 0;
1173#endif
1174
1175#endif /* ! HAVE_GTK_FILE_BOTH */
1176}
1177
1178
1158/* Function that is called when the file dialog pops down. 1179/* Function that is called when the file dialog pops down.
1159 W is the dialog widget, RESPONSE is the response code. 1180 W is the dialog widget, RESPONSE is the response code.
1160 USER_DATA is what we passed in to g_signal_connect (pointer to int). */ 1181 USER_DATA is what we passed in to g_signal_connect (pointer to int). */
@@ -1343,7 +1364,6 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
1343 char *fn = 0; 1364 char *fn = 0;
1344 int filesel_done = 0; 1365 int filesel_done = 0;
1345 xg_get_file_func func; 1366 xg_get_file_func func;
1346 extern int x_use_old_gtk_file_dialog;
1347 1367
1348#if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) 1368#if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN)
1349 /* I really don't know why this is needed, but without this the GLIBC add on 1369 /* I really don't know why this is needed, but without this the GLIBC add on
@@ -1354,7 +1374,7 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
1354 1374
1355#ifdef HAVE_GTK_FILE_BOTH 1375#ifdef HAVE_GTK_FILE_BOTH
1356 1376
1357 if (x_use_old_gtk_file_dialog) 1377 if (xg_uses_old_file_dialog ())
1358 w = xg_get_file_with_selection (f, prompt, default_filename, 1378 w = xg_get_file_with_selection (f, prompt, default_filename,
1359 mustmatch_p, only_dir_p, &func); 1379 mustmatch_p, only_dir_p, &func);
1360 else 1380 else
diff --git a/src/gtkutil.h b/src/gtkutil.h
index aea4ee9e7cf..6b9fd179ec5 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -132,6 +132,8 @@ extern int use_old_gtk_file_dialog;
132extern widget_value *malloc_widget_value P_ ((void)); 132extern widget_value *malloc_widget_value P_ ((void));
133extern void free_widget_value P_ ((widget_value *)); 133extern void free_widget_value P_ ((widget_value *));
134 134
135extern int xg_uses_old_file_dialog P_ ((void));
136
135extern char *xg_get_file_name P_ ((FRAME_PTR f, 137extern char *xg_get_file_name P_ ((FRAME_PTR f,
136 char *prompt, 138 char *prompt,
137 char *default_filename, 139 char *default_filename,
diff --git a/src/xfns.c b/src/xfns.c
index 52cb99d9ad3..8cea134c1ff 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5236,8 +5236,27 @@ Value is t if tooltip was open, nil otherwise. */)
5236 File selection dialog 5236 File selection dialog
5237 ***********************************************************************/ 5237 ***********************************************************************/
5238 5238
5239#ifdef USE_MOTIF 5239DEFUN ("x-uses-old-gtk-dialog", Fx_uses_old_gtk_dialog,
5240 Sx_uses_old_gtk_dialog,
5241 0, 0, 0,
5242 doc: /* Return t if the old Gtk+ file selection dialog is used. */)
5243 ()
5244{
5245#ifdef USE_GTK
5246 extern int use_dialog_box;
5247 extern int use_file_dialog;
5240 5248
5249 if (use_dialog_box
5250 && use_file_dialog
5251 && have_menus_p ()
5252 && xg_uses_old_file_dialog ())
5253 return Qt;
5254#endif
5255 return Qnil;
5256}
5257
5258
5259#ifdef USE_MOTIF
5241/* Callback for "OK" and "Cancel" on file selection dialog. */ 5260/* Callback for "OK" and "Cancel" on file selection dialog. */
5242 5261
5243static void 5262static void
@@ -5857,6 +5876,7 @@ variable `use-file-dialog'. */);
5857 last_show_tip_args = Qnil; 5876 last_show_tip_args = Qnil;
5858 staticpro (&last_show_tip_args); 5877 staticpro (&last_show_tip_args);
5859 5878
5879 defsubr (&Sx_uses_old_gtk_dialog);
5860#if defined (USE_MOTIF) || defined (USE_GTK) 5880#if defined (USE_MOTIF) || defined (USE_GTK)
5861 defsubr (&Sx_file_dialog); 5881 defsubr (&Sx_file_dialog);
5862#endif 5882#endif