Mercurial > hg > xemacs-beta
comparison src/ui-gtk.c @ 4846:a98ca4640147
clean up object print methods
casetab.c, console.c, data.c, database.c, device-msw.c, device.c, eval.c, file-coding.c, frame.c, glyphs.c, gui.c, keymap.c, lisp.h, mule-charset.c, objects.c, print.c, process.c, tooltalk.c, ui-gtk.c, window.c:
New function printing_unreadable_lcrecord(). Automatically
prints the type name and pointer value of the object. Use it
instead of printing_unreadable_object(); make that latter
function local to print.c.
window.c: During creation, window may have Qt as its buffer. Don't
crash if trying to print such a window.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 13 Jan 2010 05:49:13 -0600 |
parents | db7068430402 |
children | b3ce27ca7647 19a72041c5ed |
comparison
equal
deleted
inserted
replaced
4845:a3c673c0720b | 4846:a98ca4640147 |
---|---|
324 static void | 324 static void |
325 ffi_object_printer (Lisp_Object obj, Lisp_Object printcharfun, | 325 ffi_object_printer (Lisp_Object obj, Lisp_Object printcharfun, |
326 int UNUSED (escapeflag)) | 326 int UNUSED (escapeflag)) |
327 { | 327 { |
328 if (print_readably) | 328 if (print_readably) |
329 printing_unreadable_object ("#<ffi %p>", XFFI (obj)->function_ptr); | 329 printing_unreadable_lcrecord (obj, 0); |
330 | 330 |
331 write_fmt_string_lisp (printcharfun, "#<ffi %S", 1, XFFI (obj)->function_name); | 331 write_fmt_string_lisp (printcharfun, "#<ffi %S", 1, XFFI (obj)->function_name); |
332 if (XFFI (obj)->n_args) | 332 if (XFFI (obj)->n_args) |
333 write_fmt_string (printcharfun, " %d arguments", XFFI (obj)->n_args); | 333 write_fmt_string (printcharfun, " %d arguments", XFFI (obj)->n_args); |
334 write_fmt_string (printcharfun, " %p>", (void *)XFFI (obj)->function_ptr); | 334 write_fmt_string (printcharfun, " %p>", (void *)XFFI (obj)->function_ptr); |
794 static void | 794 static void |
795 emacs_gtk_object_printer (Lisp_Object obj, Lisp_Object printcharfun, | 795 emacs_gtk_object_printer (Lisp_Object obj, Lisp_Object printcharfun, |
796 int UNUSED (escapeflag)) | 796 int UNUSED (escapeflag)) |
797 { | 797 { |
798 if (print_readably) | 798 if (print_readably) |
799 printing_unreadable_object ("#<GtkObject %p>", XGTK_OBJECT (obj)->object); | 799 printing_unreadable_lcrecord (obj, 0); |
800 | 800 |
801 write_c_string (printcharfun, "#<GtkObject ("); | 801 write_c_string (printcharfun, "#<GtkObject ("); |
802 if (XGTK_OBJECT (obj)->alive_p) | 802 if (XGTK_OBJECT (obj)->alive_p) |
803 write_c_string (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object))); | 803 write_c_string (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object))); |
804 else | 804 else |
1113 static void | 1113 static void |
1114 emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, | 1114 emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, |
1115 int UNUSED (escapeflag)) | 1115 int UNUSED (escapeflag)) |
1116 { | 1116 { |
1117 if (print_readably) | 1117 if (print_readably) |
1118 printing_unreadable_object ("#<GtkBoxed %p>", XGTK_BOXED (obj)->object); | 1118 printing_unreadable_lcrecord (obj, 0); |
1119 | 1119 |
1120 write_c_string (printcharfun, "#<GtkBoxed ("); | 1120 write_c_string (printcharfun, "#<GtkBoxed ("); |
1121 write_c_string (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type)); | 1121 write_c_string (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type)); |
1122 write_fmt_string (printcharfun, ") %p>", (void *) XGTK_BOXED (obj)->object); | 1122 write_fmt_string (printcharfun, ") %p>", (void *) XGTK_BOXED (obj)->object); |
1123 } | 1123 } |