Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
100 3 }, | 100 3 }, |
101 { XD_LISP_OBJECT, offsetof (struct gtk_frame, menubar_data) }, | 101 { XD_LISP_OBJECT, offsetof (struct gtk_frame, menubar_data) }, |
102 { XD_END } | 102 { XD_END } |
103 }; | 103 }; |
104 | 104 |
105 #ifdef NEW_GC | |
106 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("gtk-frame", gtk_frame, | |
107 0, gtk_frame_data_description_1, | |
108 Lisp_Gtk_Frame); | |
109 #else /* not NEW_GC */ | |
105 extern const struct sized_memory_description gtk_frame_data_description; | 110 extern const struct sized_memory_description gtk_frame_data_description; |
106 | 111 |
107 const struct sized_memory_description gtk_frame_data_description = { | 112 const struct sized_memory_description gtk_frame_data_description = { |
108 sizeof (struct gtk_frame), gtk_frame_data_description_1 | 113 sizeof (struct gtk_frame), gtk_frame_data_description_1 |
109 }; | 114 }; |
115 #endif /* not NEW_GC */ | |
110 | 116 |
111 | 117 |
112 /************************************************************************/ | 118 /************************************************************************/ |
113 /* helper functions */ | 119 /* helper functions */ |
114 /************************************************************************/ | 120 /************************************************************************/ |
263 | 269 |
264 return Qunbound; | 270 return Qunbound; |
265 } | 271 } |
266 | 272 |
267 static int | 273 static int |
268 gtk_internal_frame_property_p (struct frame *f, Lisp_Object property) | 274 gtk_internal_frame_property_p (struct frame *UNUSED(f), Lisp_Object property) |
269 { | 275 { |
270 return EQ (property, Qleft) | 276 return EQ (property, Qleft) |
271 || EQ (property, Qtop) | 277 || EQ (property, Qtop) |
272 || EQ (Qshell_widget, property) | 278 || EQ (Qshell_widget, property) |
273 || EQ (Qcontainer_widget, property) | 279 || EQ (Qcontainer_widget, property) |
964 allocate_gtk_frame_struct (struct frame *f) | 970 allocate_gtk_frame_struct (struct frame *f) |
965 { | 971 { |
966 int i; | 972 int i; |
967 | 973 |
968 /* zero out all slots. */ | 974 /* zero out all slots. */ |
975 #ifdef NEW_GC | |
976 f->frame_data = alloc_lrecord_type (struct gtk_frame, &lrecord_gtk_frame); | |
977 #else /* not NEW_GC */ | |
969 f->frame_data = xnew_and_zero (struct gtk_frame); | 978 f->frame_data = xnew_and_zero (struct gtk_frame); |
979 #endif /* not NEW_GC */ | |
970 | 980 |
971 /* yeah, except the lisp ones */ | 981 /* yeah, except the lisp ones */ |
972 FRAME_GTK_ICON_PIXMAP (f) = Qnil; | 982 FRAME_GTK_ICON_PIXMAP (f) = Qnil; |
973 FRAME_GTK_ICON_PIXMAP_MASK (f) = Qnil; | 983 FRAME_GTK_ICON_PIXMAP_MASK (f) = Qnil; |
974 FRAME_GTK_MENUBAR_DATA (f) = Qnil; | 984 FRAME_GTK_MENUBAR_DATA (f) = Qnil; |
1340 | 1350 |
1341 gtk_widget_destroy (w); | 1351 gtk_widget_destroy (w); |
1342 | 1352 |
1343 if (FRAME_GTK_GEOM_FREE_ME_PLEASE (f)) | 1353 if (FRAME_GTK_GEOM_FREE_ME_PLEASE (f)) |
1344 xfree (FRAME_GTK_GEOM_FREE_ME_PLEASE (f), char *); | 1354 xfree (FRAME_GTK_GEOM_FREE_ME_PLEASE (f), char *); |
1355 #ifndef NEW_GC | |
1345 xfree (f->frame_data, void *); | 1356 xfree (f->frame_data, void *); |
1357 #endif /* not NEW_GC */ | |
1346 f->frame_data = 0; | 1358 f->frame_data = 0; |
1347 } | 1359 } |
1348 | 1360 |
1349 static void | 1361 static void |
1350 gtk_recompute_cell_sizes (struct frame *frm) | 1362 gtk_recompute_cell_sizes (struct frame *frm) |
1412 } | 1424 } |
1413 else if (EQ (name, Qfont)) | 1425 else if (EQ (name, Qfont)) |
1414 { | 1426 { |
1415 Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii); | 1427 Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii); |
1416 | 1428 |
1429 /* It may be that instantiating the font has deleted the frame (will | |
1430 happen if the user has specified a charset registry for ASCII that | |
1431 isn't available on the server, and our fallback of iso8859-1 isn't | |
1432 available; something vanishingly rare.) In that case, return from | |
1433 this function. */ | |
1434 | |
1435 if (!FRAME_LIVE_P(frm)) | |
1436 { | |
1437 return; | |
1438 } | |
1439 | |
1417 if (!EQ (font, Vthe_null_font_instance)) | 1440 if (!EQ (font, Vthe_null_font_instance)) |
1418 { | 1441 { |
1419 /* #### BILL!!! The X code set the XtNfont property of the | 1442 /* #### BILL!!! The X code set the XtNfont property of the |
1420 text widget here. Why did they bother? All that type of | 1443 text widget here. Why did they bother? All that type of |
1421 thing is done down in the guts of the redisplay code, not | 1444 thing is done down in the guts of the redisplay code, not |
1445 /************************************************************************/ | 1468 /************************************************************************/ |
1446 | 1469 |
1447 void | 1470 void |
1448 syms_of_frame_gtk (void) | 1471 syms_of_frame_gtk (void) |
1449 { | 1472 { |
1473 #ifdef NEW_GC | |
1474 INIT_LISP_OBJECT (gtk_frame); | |
1475 #endif /* NEW_GC */ | |
1476 | |
1450 DEFSYMBOL (Qtext_widget); | 1477 DEFSYMBOL (Qtext_widget); |
1451 DEFSYMBOL (Qcontainer_widget); | 1478 DEFSYMBOL (Qcontainer_widget); |
1452 DEFSYMBOL (Qshell_widget); | 1479 DEFSYMBOL (Qshell_widget); |
1453 DEFSYMBOL (Qdetachable_menubar); | 1480 DEFSYMBOL (Qdetachable_menubar); |
1454 | 1481 |