Mercurial > hg > xemacs-beta
comparison src/dialog-msw.c @ 5133:444a448b2f53
Merge branch ben-lisp-object into default branch
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sun, 07 Mar 2010 06:47:37 -0600 |
parents | a9c41067dd88 |
children | 6c6d78781d59 |
comparison
equal
deleted
inserted
replaced
5113:b2dcf6a6d8ab | 5133:444a448b2f53 |
---|---|
181 struct mswindows_dialog_id *data = XMSWINDOWS_DIALOG_ID (obj); | 181 struct mswindows_dialog_id *data = XMSWINDOWS_DIALOG_ID (obj); |
182 mark_object (data->frame); | 182 mark_object (data->frame); |
183 return data->callbacks; | 183 return data->callbacks; |
184 } | 184 } |
185 | 185 |
186 DEFINE_LRECORD_IMPLEMENTATION ("mswindows-dialog-id", mswindows_dialog_id, | 186 DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("mswindows-dialog-id", |
187 0, /* dump-able flag */ | 187 mswindows_dialog_id, |
188 mark_mswindows_dialog_id, | 188 mark_mswindows_dialog_id, |
189 internal_object_printer, 0, 0, 0, | 189 mswindows_dialog_id_description, |
190 mswindows_dialog_id_description, | 190 struct mswindows_dialog_id); |
191 struct mswindows_dialog_id); | |
192 | 191 |
193 /* Dialog procedure */ | 192 /* Dialog procedure */ |
194 static BOOL CALLBACK | 193 static BOOL CALLBACK |
195 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) | 194 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) |
196 { | 195 { |
746 data structure for the new dialog, which will contain callbacks | 745 data structure for the new dialog, which will contain callbacks |
747 and the frame for these callbacks. This structure has to be | 746 and the frame for these callbacks. This structure has to be |
748 GC-protected and thus it is put into a statically protected | 747 GC-protected and thus it is put into a statically protected |
749 list. */ | 748 list. */ |
750 { | 749 { |
751 Lisp_Object dialog_data; | |
752 int i; | 750 int i; |
753 struct mswindows_dialog_id *did = | 751 Lisp_Object obj = ALLOC_NORMAL_LISP_OBJECT (mswindows_dialog_id); |
754 ALLOC_LCRECORD_TYPE (struct mswindows_dialog_id, | 752 struct mswindows_dialog_id *did = XMSWINDOWS_DIALOG_ID (obj); |
755 &lrecord_mswindows_dialog_id); | |
756 | |
757 dialog_data = wrap_mswindows_dialog_id (did); | |
758 | 753 |
759 did->frame = wrap_frame (f); | 754 did->frame = wrap_frame (f); |
760 did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound); | 755 did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound); |
761 for (i = 0; i < Dynarr_length (dialog_items); i++) | 756 for (i = 0; i < Dynarr_length (dialog_items); i++) |
762 XVECTOR_DATA (did->callbacks) [i] = | 757 XVECTOR_DATA (did->callbacks) [i] = |
765 /* Woof! Everything is ready. Pop pop pop in now! */ | 760 /* Woof! Everything is ready. Pop pop pop in now! */ |
766 did->hwnd = | 761 did->hwnd = |
767 qxeCreateDialogIndirectParam (NULL, | 762 qxeCreateDialogIndirectParam (NULL, |
768 (LPDLGTEMPLATE) Dynarr_begin (template_), | 763 (LPDLGTEMPLATE) Dynarr_begin (template_), |
769 FRAME_MSWINDOWS_HANDLE (f), dialog_proc, | 764 FRAME_MSWINDOWS_HANDLE (f), dialog_proc, |
770 (LPARAM) STORE_LISP_IN_VOID (dialog_data)); | 765 (LPARAM) STORE_LISP_IN_VOID (obj)); |
771 if (!did->hwnd) | 766 if (!did->hwnd) |
772 /* Something went wrong creating the dialog */ | 767 /* Something went wrong creating the dialog */ |
773 signal_error (Qdialog_box_error, "Creating dialog", keys); | 768 signal_error (Qdialog_box_error, "Creating dialog", keys); |
774 | 769 |
775 Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list); | 770 Vdialog_data_list = Fcons (obj, Vdialog_data_list); |
776 | 771 |
777 /* Cease protection and free dynarrays */ | 772 /* Cease protection and free dynarrays */ |
778 unbind_to (unbind_count); | 773 unbind_to (unbind_count); |
779 return dialog_data; | 774 return obj; |
780 } | 775 } |
781 } | 776 } |
782 | 777 |
783 static Lisp_Object | 778 static Lisp_Object |
784 mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type, | 779 mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type, |
812 } | 807 } |
813 | 808 |
814 void | 809 void |
815 syms_of_dialog_mswindows (void) | 810 syms_of_dialog_mswindows (void) |
816 { | 811 { |
817 INIT_LRECORD_IMPLEMENTATION (mswindows_dialog_id); | 812 INIT_LISP_OBJECT (mswindows_dialog_id); |
818 | 813 |
819 DEFKEYWORD (Q_initial_directory); | 814 DEFKEYWORD (Q_initial_directory); |
820 DEFKEYWORD (Q_initial_filename); | 815 DEFKEYWORD (Q_initial_filename); |
821 DEFKEYWORD (Q_filter_list); | 816 DEFKEYWORD (Q_filter_list); |
822 DEFKEYWORD (Q_title); | 817 DEFKEYWORD (Q_title); |