diff src/frame-gtk.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents 229bd619740a
children d1247f3cc363
line wrap: on
line diff
--- a/src/frame-gtk.c	Sat Dec 26 00:20:27 2009 -0600
+++ b/src/frame-gtk.c	Sat Dec 26 21:18:49 2009 -0600
@@ -102,11 +102,17 @@
   { XD_END }
 };
 
+#ifdef NEW_GC
+DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("gtk-frame", gtk_frame,
+				      0, gtk_frame_data_description_1,
+				      Lisp_Gtk_Frame);
+#else /* not NEW_GC */
 extern const struct sized_memory_description gtk_frame_data_description;
 
 const struct sized_memory_description gtk_frame_data_description = {
   sizeof (struct gtk_frame), gtk_frame_data_description_1
 };
+#endif /* not NEW_GC */
 
 
 /************************************************************************/
@@ -265,7 +271,7 @@
 }
 
 static int
-gtk_internal_frame_property_p (struct frame *f, Lisp_Object property)
+gtk_internal_frame_property_p (struct frame *UNUSED(f), Lisp_Object property)
 {
   return EQ (property, Qleft)
     || EQ (property, Qtop)
@@ -966,7 +972,11 @@
   int i;
 
   /* zero out all slots. */
+#ifdef NEW_GC
+  f->frame_data = alloc_lrecord_type (struct gtk_frame, &lrecord_gtk_frame);
+#else /* not NEW_GC */
   f->frame_data = xnew_and_zero (struct gtk_frame);
+#endif /* not NEW_GC */
 
   /* yeah, except the lisp ones */
   FRAME_GTK_ICON_PIXMAP (f) = Qnil;
@@ -1342,7 +1352,9 @@
 
     if (FRAME_GTK_GEOM_FREE_ME_PLEASE (f))
 	xfree (FRAME_GTK_GEOM_FREE_ME_PLEASE (f), char *);
+#ifndef NEW_GC
     xfree (f->frame_data, void *);
+#endif /* not NEW_GC */
     f->frame_data = 0;
 }
 
@@ -1414,6 +1426,17 @@
    {
      Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii);
 
+     /* It may be that instantiating the font has deleted the frame (will
+	happen if the user has specified a charset registry for ASCII that
+	isn't available on the server, and our fallback of iso8859-1 isn't
+	available; something vanishingly rare.) In that case, return from
+	this function. */
+
+     if (!FRAME_LIVE_P(frm))
+       {
+	 return;
+       }
+
      if (!EQ (font, Vthe_null_font_instance))
      {
 	 /* #### BILL!!! The X code set the XtNfont property of the
@@ -1447,6 +1470,10 @@
 void
 syms_of_frame_gtk (void)
 {
+#ifdef NEW_GC
+  INIT_LISP_OBJECT (gtk_frame);
+#endif /* NEW_GC */
+
   DEFSYMBOL (Qtext_widget);
   DEFSYMBOL (Qcontainer_widget);
   DEFSYMBOL (Qshell_widget);