comparison src/window.c @ 36432:28af746067b2

(make_window, make_dummy_parent): Use allocate_window. (Fcurrent_window_configuration): Use allocate_other_vector.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 28 Feb 2001 13:28:11 +0000
parents 9fa7c8e6a6d5
children f2fc8b180aaa
comparison
equal deleted inserted replaced
36431:c10e67afd7ec 36432:28af746067b2
245 Lisp_Object 245 Lisp_Object
246 make_window () 246 make_window ()
247 { 247 {
248 Lisp_Object val; 248 Lisp_Object val;
249 register struct window *p; 249 register struct window *p;
250 register struct Lisp_Vector *vec; 250
251 int i; 251 p = allocate_window ();
252
253 vec = allocate_vectorlike ((EMACS_INT) VECSIZE (struct window));
254 for (i = 0; i < VECSIZE (struct window); i++)
255 vec->contents[i] = Qnil;
256 vec->size = VECSIZE (struct window);
257 p = (struct window *) vec;
258 XSETFASTINT (p->sequence_number, ++sequence_number); 252 XSETFASTINT (p->sequence_number, ++sequence_number);
259 XSETFASTINT (p->left, 0); 253 XSETFASTINT (p->left, 0);
260 XSETFASTINT (p->top, 0); 254 XSETFASTINT (p->top, 0);
261 XSETFASTINT (p->height, 0); 255 XSETFASTINT (p->height, 0);
262 XSETFASTINT (p->width, 0); 256 XSETFASTINT (p->width, 0);
3153 make_dummy_parent (window) 3147 make_dummy_parent (window)
3154 Lisp_Object window; 3148 Lisp_Object window;
3155 { 3149 {
3156 Lisp_Object new; 3150 Lisp_Object new;
3157 register struct window *o, *p; 3151 register struct window *o, *p;
3158 register struct Lisp_Vector *vec;
3159 int i; 3152 int i;
3160 3153
3161 o = XWINDOW (window); 3154 o = XWINDOW (window);
3162 vec = allocate_vectorlike ((EMACS_INT)VECSIZE (struct window)); 3155 p = allocate_window ();
3163 for (i = 0; i < VECSIZE (struct window); ++i) 3156 for (i = 0; i < VECSIZE (struct window); ++i)
3164 vec->contents[i] = ((struct Lisp_Vector *)o)->contents[i]; 3157 ((struct Lisp_Vector *) p)->contents[i]
3165 vec->size = VECSIZE (struct window); 3158 = ((struct Lisp_Vector *)o)->contents[i];
3166 p = (struct window *)vec;
3167 XSETWINDOW (new, p); 3159 XSETWINDOW (new, p);
3168 3160
3169 XSETFASTINT (p->sequence_number, ++sequence_number); 3161 XSETFASTINT (p->sequence_number, ++sequence_number);
3170 3162
3171 /* Put new into window structure in place of window */ 3163 /* Put new into window structure in place of window */
5245 frame = selected_frame; 5237 frame = selected_frame;
5246 CHECK_LIVE_FRAME (frame, 0); 5238 CHECK_LIVE_FRAME (frame, 0);
5247 f = XFRAME (frame); 5239 f = XFRAME (frame);
5248 5240
5249 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); 5241 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
5250 vec = allocate_vectorlike (VECSIZE (struct save_window_data)); 5242 vec = allocate_other_vector (VECSIZE (struct save_window_data));
5251 for (i = 0; i < VECSIZE (struct save_window_data); i++)
5252 vec->contents[i] = Qnil;
5253 vec->size = VECSIZE (struct save_window_data);
5254 data = (struct save_window_data *)vec; 5243 data = (struct save_window_data *)vec;
5255 5244
5256 XSETFASTINT (data->frame_width, FRAME_WIDTH (f)); 5245 XSETFASTINT (data->frame_width, FRAME_WIDTH (f));
5257 XSETFASTINT (data->frame_height, FRAME_HEIGHT (f)); 5246 XSETFASTINT (data->frame_height, FRAME_HEIGHT (f));
5258 XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f)); 5247 XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f));