diff src/frame-msw.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 e93da3cda3cb
children d1247f3cc363
line wrap: on
line diff
--- a/src/frame-msw.c	Sat Dec 26 00:20:27 2009 -0600
+++ b/src/frame-msw.c	Sat Dec 26 21:18:49 2009 -0600
@@ -92,11 +92,17 @@
   { XD_END }
 };
 
+#ifdef NEW_GC
+DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("mswindows-frame", mswindows_frame,
+				      0, mswindows_frame_data_description_1,
+				      Lisp_Mswindows_Frame);
+#else /* not NEW_GC */
 extern const struct sized_memory_description mswindows_frame_data_description;
 
 const struct sized_memory_description mswindows_frame_data_description = {
   sizeof (struct mswindows_frame), mswindows_frame_data_description_1
 };
+#endif /* not NEW_GC */
 
 /*---------------------------------------------------------------------*/
 /*-----                    DISPLAY FRAME                          -----*/
@@ -165,7 +171,12 @@
   if (!NILP (height))
     CHECK_INT (height);
 
+#ifdef NEW_GC
+  f->frame_data = alloc_lrecord_type (struct mswindows_frame,
+				      &lrecord_mswindows_frame);
+#else /* not NEW_GC */
   f->frame_data = xnew_and_zero (struct mswindows_frame);
+#endif /* not NEW_GC */
   FRAME_MSWINDOWS_TARGET_RECT (f) = xnew_and_zero (XEMACS_RECT_WH);
 
   FRAME_MSWINDOWS_TARGET_RECT (f)->left = NILP (left) ? -1 : abs (XINT (left));
@@ -291,10 +302,20 @@
 static void
 mswindows_init_frame_3 (struct frame *f)
 {
-  /* Don't do this earlier or we get a WM_PAINT before the frame is ready */
-  ShowWindow (FRAME_MSWINDOWS_HANDLE (f), SW_SHOWNORMAL);
-  SetForegroundWindow (FRAME_MSWINDOWS_HANDLE (f));
-  DragAcceptFiles (FRAME_MSWINDOWS_HANDLE (f), TRUE);
+  /* Don't do this earlier or we get a WM_PAINT before the frame is ready. */
+  ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
+#ifdef CYGWIN
+  /* The SW_x parameter in the first call that an app makes to ShowWindow is
+   * ignored, and the parameter specified in the caller's STARTUPINFO is
+   * substituted instead. That parameter is SW_HIDE if we were started by
+   * runemacs, so call this twice. #### runemacs is evil.  To see why this
+   * second call was restored, see the threads referenced by
+   * 20a807210611011157j57ea2b22ue892f4dfcb6aade8@mail.gmail.com and
+   * 20a807210708181345m7ac94ff2m43337be71e853d95@mail.gmail.com . */
+  ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
+#endif
+  SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
+  DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
 }
 
 static void
@@ -340,7 +361,9 @@
 #endif
       ReleaseDC (FRAME_MSWINDOWS_HANDLE (f), FRAME_MSWINDOWS_DC (f));
       DestroyWindow (FRAME_MSWINDOWS_HANDLE (f));
+#ifndef NEW_GC
       xfree (f->frame_data, void *);
+#endif /* not NEW_GC */
     }
   f->frame_data = 0;
 }
@@ -1185,6 +1208,9 @@
 void
 syms_of_frame_mswindows (void)
 {
+#ifdef NEW_GC
+  INIT_LISP_OBJECT (mswindows_frame);
+#endif /* NEW_GC */
 }
 
 void