comparison src/dialog-msw.c @ 5495:1f0b15040456

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 01 May 2011 18:44:03 +0100
parents 308d34e9f07d
children 56144c8593a8
comparison
equal deleted inserted replaced
5494:861f2601a38b 5495:1f0b15040456
2 Copyright (C) 1998 Kirill M. Katsnelson <kkm@kis.ru> 2 Copyright (C) 1998 Kirill M. Katsnelson <kkm@kis.ru>
3 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2010 Ben Wing. 3 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2010 Ben Wing.
4 4
5 This file is part of XEmacs. 5 This file is part of XEmacs.
6 6
7 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any 9 Free Software Foundation, either version 3 of the License, or (at your
10 later version. 10 option) any later version.
11 11
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT 12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details. 15 for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with XEmacs; see the file COPYING. If not, write to 18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21 19
22 /* Synched up with: Not in FSF. */ 20 /* Synched up with: Not in FSF. */
23 21
24 /* This file essentially Mule-ized (except perhaps some Unicode splitting). 22 /* This file essentially Mule-ized (except perhaps some Unicode splitting).
25 5-2000. */ 23 5-2000. */
181 struct mswindows_dialog_id *data = XMSWINDOWS_DIALOG_ID (obj); 179 struct mswindows_dialog_id *data = XMSWINDOWS_DIALOG_ID (obj);
182 mark_object (data->frame); 180 mark_object (data->frame);
183 return data->callbacks; 181 return data->callbacks;
184 } 182 }
185 183
186 DEFINE_LRECORD_IMPLEMENTATION ("mswindows-dialog-id", mswindows_dialog_id, 184 DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("mswindows-dialog-id",
187 0, /* dump-able flag */ 185 mswindows_dialog_id,
188 mark_mswindows_dialog_id, 186 mark_mswindows_dialog_id,
189 internal_object_printer, 0, 0, 0, 187 mswindows_dialog_id_description,
190 mswindows_dialog_id_description, 188 struct mswindows_dialog_id);
191 struct mswindows_dialog_id);
192 189
193 /* Dialog procedure */ 190 /* Dialog procedure */
194 static BOOL CALLBACK 191 static BOOL CALLBACK
195 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) 192 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param)
196 { 193 {
440 } 437 }
441 else if (pd.unknown_fname != 0) 438 else if (pd.unknown_fname != 0)
442 { 439 {
443 ret = tstr_to_local_file_format (pd.unknown_fname); 440 ret = tstr_to_local_file_format (pd.unknown_fname);
444 xfree (pd.unknown_fname); 441 xfree (pd.unknown_fname);
442 pd.unknown_fname = 0;
445 } 443 }
446 else while (1) 444 else while (1)
447 signal_quit (); 445 signal_quit ();
448 } 446 }
449 else 447 else
746 data structure for the new dialog, which will contain callbacks 744 data structure for the new dialog, which will contain callbacks
747 and the frame for these callbacks. This structure has to be 745 and the frame for these callbacks. This structure has to be
748 GC-protected and thus it is put into a statically protected 746 GC-protected and thus it is put into a statically protected
749 list. */ 747 list. */
750 { 748 {
751 Lisp_Object dialog_data;
752 int i; 749 int i;
753 struct mswindows_dialog_id *did = 750 Lisp_Object obj = ALLOC_NORMAL_LISP_OBJECT (mswindows_dialog_id);
754 ALLOC_LCRECORD_TYPE (struct mswindows_dialog_id, 751 struct mswindows_dialog_id *did = XMSWINDOWS_DIALOG_ID (obj);
755 &lrecord_mswindows_dialog_id);
756
757 dialog_data = wrap_mswindows_dialog_id (did);
758 752
759 did->frame = wrap_frame (f); 753 did->frame = wrap_frame (f);
760 did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound); 754 did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound);
761 for (i = 0; i < Dynarr_length (dialog_items); i++) 755 for (i = 0; i < Dynarr_length (dialog_items); i++)
762 XVECTOR_DATA (did->callbacks) [i] = 756 XVECTOR_DATA (did->callbacks) [i] =
765 /* Woof! Everything is ready. Pop pop pop in now! */ 759 /* Woof! Everything is ready. Pop pop pop in now! */
766 did->hwnd = 760 did->hwnd =
767 qxeCreateDialogIndirectParam (NULL, 761 qxeCreateDialogIndirectParam (NULL,
768 (LPDLGTEMPLATE) Dynarr_begin (template_), 762 (LPDLGTEMPLATE) Dynarr_begin (template_),
769 FRAME_MSWINDOWS_HANDLE (f), dialog_proc, 763 FRAME_MSWINDOWS_HANDLE (f), dialog_proc,
770 (LPARAM) STORE_LISP_IN_VOID (dialog_data)); 764 (LPARAM) STORE_LISP_IN_VOID (obj));
771 if (!did->hwnd) 765 if (!did->hwnd)
772 /* Something went wrong creating the dialog */ 766 /* Something went wrong creating the dialog */
773 signal_error (Qdialog_box_error, "Creating dialog", keys); 767 signal_error (Qdialog_box_error, "Creating dialog", keys);
774 768
775 Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list); 769 Vdialog_data_list = Fcons (obj, Vdialog_data_list);
776 770
777 /* Cease protection and free dynarrays */ 771 /* Cease protection and free dynarrays */
778 unbind_to (unbind_count); 772 unbind_to (unbind_count);
779 return dialog_data; 773 return obj;
780 } 774 }
781 } 775 }
782 776
783 static Lisp_Object 777 static Lisp_Object
784 mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type, 778 mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type,
812 } 806 }
813 807
814 void 808 void
815 syms_of_dialog_mswindows (void) 809 syms_of_dialog_mswindows (void)
816 { 810 {
817 INIT_LRECORD_IMPLEMENTATION (mswindows_dialog_id); 811 INIT_LISP_OBJECT (mswindows_dialog_id);
818 812
819 DEFKEYWORD (Q_initial_directory); 813 DEFKEYWORD (Q_initial_directory);
820 DEFKEYWORD (Q_initial_filename); 814 DEFKEYWORD (Q_initial_filename);
821 DEFKEYWORD (Q_filter_list); 815 DEFKEYWORD (Q_filter_list);
822 DEFKEYWORD (Q_title); 816 DEFKEYWORD (Q_title);