Mercurial > emacs
comparison src/xfns.c @ 16254:3e8b16badf3d
(Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Add the symbol `right'; this symbol is used to indicate
that a right-side scroll bar is wanted.
(x_set_vertical_scroll_bars): Check for left<->right<->none
scroll bar changes, and modify the vertical scroll bar type as appropriate.
(x_figure_window_size): Use new SET_FRAME_WIDTH macro.
(Fx_create_frame): Likewise.
(Fx_horizontal_line): Use new macro WINDOW_LEFT_MARGIN.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 21 Sep 1996 01:14:57 +0000 |
parents | d435199e529d |
children | 025b3dc7a6ba |
comparison
equal
deleted
inserted
replaced
16253:3ea02d461499 | 16254:3e8b16badf3d |
---|---|
177 Lisp_Object Qicon_top; | 177 Lisp_Object Qicon_top; |
178 Lisp_Object Qicon_type; | 178 Lisp_Object Qicon_type; |
179 Lisp_Object Qicon_name; | 179 Lisp_Object Qicon_name; |
180 Lisp_Object Qinternal_border_width; | 180 Lisp_Object Qinternal_border_width; |
181 Lisp_Object Qleft; | 181 Lisp_Object Qleft; |
182 Lisp_Object Qright; | |
182 Lisp_Object Qmouse_color; | 183 Lisp_Object Qmouse_color; |
183 Lisp_Object Qnone; | 184 Lisp_Object Qnone; |
184 Lisp_Object Qparent_id; | 185 Lisp_Object Qparent_id; |
185 Lisp_Object Qscroll_bar_width; | 186 Lisp_Object Qscroll_bar_width; |
186 Lisp_Object Qsuppress_icon; | 187 Lisp_Object Qsuppress_icon; |
1937 void | 1938 void |
1938 x_set_vertical_scroll_bars (f, arg, oldval) | 1939 x_set_vertical_scroll_bars (f, arg, oldval) |
1939 struct frame *f; | 1940 struct frame *f; |
1940 Lisp_Object arg, oldval; | 1941 Lisp_Object arg, oldval; |
1941 { | 1942 { |
1942 if (NILP (arg) != ! FRAME_HAS_VERTICAL_SCROLL_BARS (f)) | 1943 if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) |
1943 { | 1944 || (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) |
1944 FRAME_HAS_VERTICAL_SCROLL_BARS (f) = ! NILP (arg); | 1945 || (NILP (arg) && FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
1946 || (!NILP (arg) && ! FRAME_HAS_VERTICAL_SCROLL_BARS (f))) | |
1947 { | |
1948 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) | |
1949 = (NILP (arg) | |
1950 ? vertical_scroll_bar_none | |
1951 : EQ (Qright, arg) | |
1952 ? vertical_scroll_bar_right | |
1953 : vertical_scroll_bar_left); | |
1945 | 1954 |
1946 /* We set this parameter before creating the X window for the | 1955 /* We set this parameter before creating the X window for the |
1947 frame, so we can get the geometry right from the start. | 1956 frame, so we can get the geometry right from the start. |
1948 However, if the window hasn't been created yet, we shouldn't | 1957 However, if the window hasn't been created yet, we shouldn't |
1949 call x_set_window_size. */ | 1958 call x_set_window_size. */ |
2352 long window_prompting = 0; | 2361 long window_prompting = 0; |
2353 | 2362 |
2354 /* Default values if we fall through. | 2363 /* Default values if we fall through. |
2355 Actually, if that happens we should get | 2364 Actually, if that happens we should get |
2356 window manager prompting. */ | 2365 window manager prompting. */ |
2357 f->width = DEFAULT_COLS; | 2366 SET_FRAME_WIDTH (f, DEFAULT_COLS); |
2358 f->height = DEFAULT_ROWS; | 2367 f->height = DEFAULT_ROWS; |
2359 /* Window managers expect that if program-specified | 2368 /* Window managers expect that if program-specified |
2360 positions are not (0,0), they're intentional, not defaults. */ | 2369 positions are not (0,0), they're intentional, not defaults. */ |
2361 f->output_data.x->top_pos = 0; | 2370 f->output_data.x->top_pos = 0; |
2362 f->output_data.x->left_pos = 0; | 2371 f->output_data.x->left_pos = 0; |
2372 f->height = XINT (tem0); | 2381 f->height = XINT (tem0); |
2373 } | 2382 } |
2374 if (!EQ (tem1, Qunbound)) | 2383 if (!EQ (tem1, Qunbound)) |
2375 { | 2384 { |
2376 CHECK_NUMBER (tem1, 0); | 2385 CHECK_NUMBER (tem1, 0); |
2377 f->width = XINT (tem1); | 2386 SET_FRAME_WIDTH (f, XINT (tem1)); |
2378 } | 2387 } |
2379 if (!NILP (tem2) && !EQ (tem2, Qunbound)) | 2388 if (!NILP (tem2) && !EQ (tem2, Qunbound)) |
2380 window_prompting |= USSize; | 2389 window_prompting |= USSize; |
2381 else | 2390 else |
2382 window_prompting |= PSize; | 2391 window_prompting |= PSize; |
3193 parms = Fcons (Fcons (Qinternal_border_width, value), | 3202 parms = Fcons (Fcons (Qinternal_border_width, value), |
3194 parms); | 3203 parms); |
3195 } | 3204 } |
3196 x_default_parameter (f, parms, Qinternal_border_width, make_number (2), | 3205 x_default_parameter (f, parms, Qinternal_border_width, make_number (2), |
3197 "internalBorderWidth", "BorderWidth", number); | 3206 "internalBorderWidth", "BorderWidth", number); |
3198 x_default_parameter (f, parms, Qvertical_scroll_bars, Qt, | 3207 x_default_parameter (f, parms, Qvertical_scroll_bars, Qleft, |
3199 "verticalScrollBars", "ScrollBars", boolean); | 3208 "verticalScrollBars", "ScrollBars", boolean); |
3200 | 3209 |
3201 /* Also do the stuff which must be set before the window exists. */ | 3210 /* Also do the stuff which must be set before the window exists. */ |
3202 x_default_parameter (f, parms, Qforeground_color, build_string ("black"), | 3211 x_default_parameter (f, parms, Qforeground_color, build_string ("black"), |
3203 "foreground", "Foreground", string); | 3212 "foreground", "Foreground", string); |
3263 /* Dimensions, especially f->height, must be done via change_frame_size. | 3272 /* Dimensions, especially f->height, must be done via change_frame_size. |
3264 Change will not be effected unless different from the current | 3273 Change will not be effected unless different from the current |
3265 f->height. */ | 3274 f->height. */ |
3266 width = f->width; | 3275 width = f->width; |
3267 height = f->height; | 3276 height = f->height; |
3268 f->height = f->width = 0; | 3277 f->height = 0; |
3278 SET_FRAME_WIDTH (f, 0); | |
3269 change_frame_size (f, height, width, 1, 0); | 3279 change_frame_size (f, height, width, 1, 0); |
3270 | 3280 |
3271 /* Tell the server what size and position, etc, we want, | 3281 /* Tell the server what size and position, etc, we want, |
3272 and how badly we want them. */ | 3282 and how badly we want them. */ |
3273 BLOCK_INPUT; | 3283 BLOCK_INPUT; |
4372 #endif | 4382 #endif |
4373 register int previous_y; | 4383 register int previous_y; |
4374 register int line = (x_mouse_y + 1) * f->output_data.x->line_height | 4384 register int line = (x_mouse_y + 1) * f->output_data.x->line_height |
4375 + f->output_data.x->internal_border_width; | 4385 + f->output_data.x->internal_border_width; |
4376 register int left = f->output_data.x->internal_border_width | 4386 register int left = f->output_data.x->internal_border_width |
4377 + (w->left | 4387 + (WINDOW_LEFT_MARGIN (w) |
4378 * FONT_WIDTH (f->output_data.x->font)); | 4388 * FONT_WIDTH (f->output_data.x->font)); |
4379 register int right = left + (w->width | 4389 register int right = left + (w->width |
4380 * FONT_WIDTH (f->output_data.x->font)) | 4390 * FONT_WIDTH (f->output_data.x->font)) |
4381 - f->output_data.x->internal_border_width; | 4391 - f->output_data.x->internal_border_width; |
4382 | 4392 |
5072 staticpro (&Qicon_name); | 5082 staticpro (&Qicon_name); |
5073 Qinternal_border_width = intern ("internal-border-width"); | 5083 Qinternal_border_width = intern ("internal-border-width"); |
5074 staticpro (&Qinternal_border_width); | 5084 staticpro (&Qinternal_border_width); |
5075 Qleft = intern ("left"); | 5085 Qleft = intern ("left"); |
5076 staticpro (&Qleft); | 5086 staticpro (&Qleft); |
5087 Qright = intern ("right"); | |
5088 staticpro (&Qright); | |
5077 Qmouse_color = intern ("mouse-color"); | 5089 Qmouse_color = intern ("mouse-color"); |
5078 staticpro (&Qmouse_color); | 5090 staticpro (&Qmouse_color); |
5079 Qnone = intern ("none"); | 5091 Qnone = intern ("none"); |
5080 staticpro (&Qnone); | 5092 staticpro (&Qnone); |
5081 Qparent_id = intern ("parent-id"); | 5093 Qparent_id = intern ("parent-id"); |