comparison src/window.c @ 5117:3742ea8250b5 ben-lisp-object ben-lisp-object-final-ws-year-2005

Checking in final CVS version of workspace 'ben-lisp-object'
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 00:20:27 -0600
parents 135bb6aa3ee2
children e0db3c197671
comparison
equal deleted inserted replaced
5116:e56f73345619 5117:3742ea8250b5
322 make_saved_buffer_point_cache (void) 322 make_saved_buffer_point_cache (void)
323 { 323 {
324 return make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQ); 324 return make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQ);
325 } 325 }
326 326
327 DEFINE_LRECORD_IMPLEMENTATION ("window", window, 327 DEFINE_NONDUMPABLE_LISP_OBJECT ("window", window,
328 0, /*dumpable-flag*/ 328 mark_window, print_window, finalize_window,
329 mark_window, print_window, finalize_window, 329 0, 0, window_description, struct window);
330 0, 0, window_description, struct window);
331 330
332 #define INIT_DISP_VARIABLE(field, initialization) \ 331 #define INIT_DISP_VARIABLE(field, initialization) \
333 p->field[CURRENT_DISP] = initialization; \ 332 p->field[CURRENT_DISP] = initialization; \
334 p->field[DESIRED_DISP] = initialization; \ 333 p->field[DESIRED_DISP] = initialization; \
335 p->field[CMOTION_DISP] = initialization; 334 p->field[CMOTION_DISP] = initialization;
344 here because the window must have its frame pointer set or 343 here because the window must have its frame pointer set or
345 reset_face_cachels will fail. */ 344 reset_face_cachels will fail. */
346 Lisp_Object 345 Lisp_Object
347 allocate_window (void) 346 allocate_window (void)
348 { 347 {
349 struct window *p = ALLOC_LCRECORD_TYPE (struct window, &lrecord_window); 348 Lisp_Object obj = ALLOC_LISP_OBJECT (window);
350 Lisp_Object val = wrap_window (p); 349 struct window *p = XWINDOW (obj);
351 350
352 #define WINDOW_SLOT(slot) p->slot = Qnil; 351 #define WINDOW_SLOT(slot) p->slot = Qnil;
353 #include "winslots.h" 352 #include "winslots.h"
354 353
355 INIT_DISP_VARIABLE (start, Fmake_marker ()); 354 INIT_DISP_VARIABLE (start, Fmake_marker ());
370 p->line_cache_last_updated = Qzero; 369 p->line_cache_last_updated = Qzero;
371 370
372 p->windows_changed = 1; 371 p->windows_changed = 1;
373 p->shadow_thickness_changed = 1; 372 p->shadow_thickness_changed = 1;
374 373
375 return val; 374 return obj;
376 } 375 }
377 #undef INIT_DISP_VARIABLE 376 #undef INIT_DISP_VARIABLE
378 377
379 /************************************************************************/ 378 /************************************************************************/
380 /* Window mirror structure */ 379 /* Window mirror structure */
469 return wrap_window_mirror (mir->next); 468 return wrap_window_mirror (mir->next);
470 else 469 else
471 return Qnil; 470 return Qnil;
472 } 471 }
473 472
474 DEFINE_LRECORD_IMPLEMENTATION ("window-mirror", window_mirror, 473 DEFINE_NONDUMPABLE_LISP_OBJECT ("window-mirror", window_mirror,
475 0, /*dumpable-flag*/ 474 mark_window_mirror, 0,
476 mark_window_mirror, internal_object_printer, 475 0, 0, 0, window_mirror_description,
477 0, 0, 0, window_mirror_description, 476 struct window_mirror);
478 struct window_mirror);
479 477
480 /* Create a new window mirror structure and associated redisplay 478 /* Create a new window mirror structure and associated redisplay
481 structs. */ 479 structs. */
482 static struct window_mirror * 480 static struct window_mirror *
483 new_window_mirror (struct frame *f) 481 new_window_mirror (struct frame *f)
484 { 482 {
485 struct window_mirror *t = 483 Lisp_Object obj = ALLOC_LISP_OBJECT (window_mirror);
486 ALLOC_LCRECORD_TYPE (struct window_mirror, &lrecord_window_mirror); 484 struct window_mirror *t = XWINDOW_MIRROR (obj);
487 485
488 t->frame = f; 486 t->frame = f;
489 t->current_display_lines = Dynarr_new (display_line); 487 t->current_display_lines = Dynarr_new (display_line);
490 t->desired_display_lines = Dynarr_new (display_line); 488 t->desired_display_lines = Dynarr_new (display_line);
491 489
3798 } 3796 }
3799 3797
3800 static void 3798 static void
3801 make_dummy_parent (Lisp_Object window) 3799 make_dummy_parent (Lisp_Object window)
3802 { 3800 {
3803 Lisp_Object new_;
3804 struct window *o = XWINDOW (window); 3801 struct window *o = XWINDOW (window);
3805 struct window *p = ALLOC_LCRECORD_TYPE (struct window, &lrecord_window); 3802 Lisp_Object obj = ALLOC_LISP_OBJECT (window);
3806 3803 struct window *p = XWINDOW (obj);
3807 new_ = wrap_window (p); 3804
3808 COPY_LCRECORD (p, o); 3805 COPY_LCRECORD (p, o);
3809 3806
3810 /* Don't copy the pointers to the line start cache or the face 3807 /* Don't copy the pointers to the line start cache or the face
3811 instances. */ 3808 instances. */
3812 p->line_start_cache = Dynarr_new (line_start_cache); 3809 p->line_start_cache = Dynarr_new (line_start_cache);
3814 p->glyph_cachels = Dynarr_new (glyph_cachel); 3811 p->glyph_cachels = Dynarr_new (glyph_cachel);
3815 p->subwindow_instance_cache = 3812 p->subwindow_instance_cache =
3816 make_image_instance_cache_hash_table (); 3813 make_image_instance_cache_hash_table ();
3817 3814
3818 /* Put new into window structure in place of window */ 3815 /* Put new into window structure in place of window */
3819 replace_window (window, new_); 3816 replace_window (window, obj);
3820 3817
3821 o->next = Qnil; 3818 o->next = Qnil;
3822 o->prev = Qnil; 3819 o->prev = Qnil;
3823 o->vchild = Qnil; 3820 o->vchild = Qnil;
3824 o->hchild = Qnil; 3821 o->hchild = Qnil;
3825 o->parent = new_; 3822 o->parent = obj;
3826 3823
3827 p->start[CURRENT_DISP] = Qnil; 3824 p->start[CURRENT_DISP] = Qnil;
3828 p->start[DESIRED_DISP] = Qnil; 3825 p->start[DESIRED_DISP] = Qnil;
3829 p->start[CMOTION_DISP] = Qnil; 3826 p->start[CMOTION_DISP] = Qnil;
3830 p->pointm[CURRENT_DISP] = Qnil; 3827 p->pointm[CURRENT_DISP] = Qnil;
5380 /************************************************************************/ 5377 /************************************************************************/
5381 5378
5382 void 5379 void
5383 syms_of_window (void) 5380 syms_of_window (void)
5384 { 5381 {
5385 INIT_LRECORD_IMPLEMENTATION (window); 5382 INIT_LISP_OBJECT (window);
5386 INIT_LRECORD_IMPLEMENTATION (window_mirror); 5383 INIT_LISP_OBJECT (window_mirror);
5387 5384
5388 DEFSYMBOL (Qwindowp); 5385 DEFSYMBOL (Qwindowp);
5389 DEFSYMBOL (Qwindow_live_p); 5386 DEFSYMBOL (Qwindow_live_p);
5390 DEFSYMBOL (Qdisplay_buffer); 5387 DEFSYMBOL (Qdisplay_buffer);
5391 5388