Mercurial > emacs
comparison src/w32fns.c @ 41726:2dd41afd9b55
Merged fringe width related changes from xfns.c.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sat, 01 Dec 2001 01:33:30 +0000 |
parents | aadcf676d5de |
children | 0d9b74cd27cd |
comparison
equal
deleted
inserted
replaced
41725:07d263c6cf78 | 41726:2dd41afd9b55 |
---|---|
51 #include <commdlg.h> | 51 #include <commdlg.h> |
52 #include <shellapi.h> | 52 #include <shellapi.h> |
53 #include <ctype.h> | 53 #include <ctype.h> |
54 | 54 |
55 extern void free_frame_menubar (); | 55 extern void free_frame_menubar (); |
56 extern void x_compute_fringe_widths (struct frame *, int); | |
56 extern double atof (); | 57 extern double atof (); |
57 extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state); | 58 extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state); |
58 extern void w32_menu_display_help (HWND owner, HMENU menu, UINT menu_item, UINT flags); | 59 extern void w32_menu_display_help (HWND owner, HMENU menu, UINT menu_item, UINT flags); |
59 extern int quit_char; | 60 extern int quit_char; |
60 | 61 |
674 void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 675 void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
675 void x_set_cursor_type P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 676 void x_set_cursor_type P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
676 void x_set_icon_type P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 677 void x_set_icon_type P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
677 void x_set_icon_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 678 void x_set_icon_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
678 void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 679 void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
680 static void x_set_fringe_width P_ ((struct frame *, Lisp_Object, Lisp_Object)); | |
679 void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 681 void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
680 void x_set_internal_border_width P_ ((struct frame *, Lisp_Object, | 682 void x_set_internal_border_width P_ ((struct frame *, Lisp_Object, |
681 Lisp_Object)); | 683 Lisp_Object)); |
682 void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 684 void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
683 void x_set_autoraise P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 685 void x_set_autoraise P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
716 "unsplittable", x_set_unsplittable, | 718 "unsplittable", x_set_unsplittable, |
717 "vertical-scroll-bars", x_set_vertical_scroll_bars, | 719 "vertical-scroll-bars", x_set_vertical_scroll_bars, |
718 "visibility", x_set_visibility, | 720 "visibility", x_set_visibility, |
719 "tool-bar-lines", x_set_tool_bar_lines, | 721 "tool-bar-lines", x_set_tool_bar_lines, |
720 "screen-gamma", x_set_screen_gamma, | 722 "screen-gamma", x_set_screen_gamma, |
721 "line-spacing", x_set_line_spacing | 723 "line-spacing", x_set_line_spacing, |
724 "left-fringe", x_set_fringe_width, | |
725 "right-fringe", x_set_fringe_width | |
726 | |
722 }; | 727 }; |
723 | 728 |
724 /* Attach the `x-frame-parameter' properties to | 729 /* Attach the `x-frame-parameter' properties to |
725 the Lisp symbol names of parameters relevant to W32. */ | 730 the Lisp symbol names of parameters relevant to W32. */ |
726 | 731 |
808 height = FRAME_HEIGHT (f); | 813 height = FRAME_HEIGHT (f); |
809 | 814 |
810 /* Process foreground_color and background_color before anything else. | 815 /* Process foreground_color and background_color before anything else. |
811 They are independent of other properties, but other properties (e.g., | 816 They are independent of other properties, but other properties (e.g., |
812 cursor_color) are dependent upon them. */ | 817 cursor_color) are dependent upon them. */ |
818 /* Process default font as well, since fringe widths depends on it. */ | |
813 for (p = 0; p < i; p++) | 819 for (p = 0; p < i; p++) |
814 { | 820 { |
815 Lisp_Object prop, val; | 821 Lisp_Object prop, val; |
816 | 822 |
817 prop = parms[p]; | 823 prop = parms[p]; |
818 val = values[p]; | 824 val = values[p]; |
819 if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) | 825 if (EQ (prop, Qforeground_color) |
826 || EQ (prop, Qbackground_color) | |
827 || EQ (prop, Qfont)) | |
820 { | 828 { |
821 register Lisp_Object param_index, old_value; | 829 register Lisp_Object param_index, old_value; |
822 | 830 |
823 old_value = get_frame_param (f, prop); | 831 old_value = get_frame_param (f, prop); |
824 | 832 |
853 left = val; | 861 left = val; |
854 else if (EQ (prop, Qicon_top)) | 862 else if (EQ (prop, Qicon_top)) |
855 icon_top = val; | 863 icon_top = val; |
856 else if (EQ (prop, Qicon_left)) | 864 else if (EQ (prop, Qicon_left)) |
857 icon_left = val; | 865 icon_left = val; |
858 else if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) | 866 else if (EQ (prop, Qforeground_color) |
867 || EQ (prop, Qbackground_color) | |
868 || EQ (prop, Qfont)) | |
859 /* Processed above. */ | 869 /* Processed above. */ |
860 continue; | 870 continue; |
861 else | 871 else |
862 { | 872 { |
863 register Lisp_Object param_index, old_value; | 873 register Lisp_Object param_index, old_value; |
2436 XSETFRAME (frame, f); | 2446 XSETFRAME (frame, f); |
2437 call1 (Qface_set_after_frame_default, frame); | 2447 call1 (Qface_set_after_frame_default, frame); |
2438 } | 2448 } |
2439 } | 2449 } |
2440 | 2450 |
2451 static void | |
2452 x_set_fringe_width (f, new_value, old_value) | |
2453 struct frame *f; | |
2454 Lisp_Object new_value, old_value; | |
2455 { | |
2456 x_compute_fringe_widths (f, 1); | |
2457 } | |
2458 | |
2441 void | 2459 void |
2442 x_set_border_width (f, arg, oldval) | 2460 x_set_border_width (f, arg, oldval) |
2443 struct frame *f; | 2461 struct frame *f; |
2444 Lisp_Object arg, oldval; | 2462 Lisp_Object arg, oldval; |
2445 { | 2463 { |
3246 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) | 3264 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
3247 ? 0 | 3265 ? 0 |
3248 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 | 3266 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
3249 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) | 3267 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
3250 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font))); | 3268 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font))); |
3251 f->output_data.w32->fringes_extra | 3269 x_compute_fringe_widths (f, 0); |
3252 = FRAME_FRINGE_WIDTH (f); | |
3253 f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); | 3270 f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); |
3254 f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); | 3271 f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); |
3255 | 3272 |
3256 tem0 = w32_get_arg (parms, Qtop, 0, 0, RES_TYPE_NUMBER); | 3273 tem0 = w32_get_arg (parms, Qtop, 0, 0, RES_TYPE_NUMBER); |
3257 tem1 = w32_get_arg (parms, Qleft, 0, 0, RES_TYPE_NUMBER); | 3274 tem1 = w32_get_arg (parms, Qleft, 0, 0, RES_TYPE_NUMBER); |
5447 "borderColor", "BorderColor", RES_TYPE_STRING); | 5464 "borderColor", "BorderColor", RES_TYPE_STRING); |
5448 x_default_parameter (f, parms, Qscreen_gamma, Qnil, | 5465 x_default_parameter (f, parms, Qscreen_gamma, Qnil, |
5449 "screenGamma", "ScreenGamma", RES_TYPE_FLOAT); | 5466 "screenGamma", "ScreenGamma", RES_TYPE_FLOAT); |
5450 x_default_parameter (f, parms, Qline_spacing, Qnil, | 5467 x_default_parameter (f, parms, Qline_spacing, Qnil, |
5451 "lineSpacing", "LineSpacing", RES_TYPE_NUMBER); | 5468 "lineSpacing", "LineSpacing", RES_TYPE_NUMBER); |
5469 x_default_parameter (f, parms, Qleft_fringe, Qnil, | |
5470 "leftFringe", "LeftFringe", RES_TYPE_NUMBER); | |
5471 x_default_parameter (f, parms, Qright_fringe, Qnil, | |
5472 "rightFringe", "RightFringe", RES_TYPE_NUMBER); | |
5452 | 5473 |
5453 | 5474 |
5454 /* Init faces before x_default_parameter is called for scroll-bar | 5475 /* Init faces before x_default_parameter is called for scroll-bar |
5455 parameters because that function calls x_set_scroll_bar_width, | 5476 parameters because that function calls x_set_scroll_bar_width, |
5456 which calls change_frame_size, which calls Fset_window_buffer, | 5477 which calls change_frame_size, which calls Fset_window_buffer, |
13234 init_frame_faces (f); | 13255 init_frame_faces (f); |
13235 | 13256 |
13236 f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED; | 13257 f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED; |
13237 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; | 13258 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; |
13238 window_prompting = x_figure_window_size (f, parms); | 13259 window_prompting = x_figure_window_size (f, parms); |
13239 | |
13240 /* No fringes on tip frame. */ | |
13241 f->output_data.w32->fringes_extra = 0; | |
13242 | 13260 |
13243 if (window_prompting & XNegative) | 13261 if (window_prompting & XNegative) |
13244 { | 13262 { |
13245 if (window_prompting & YNegative) | 13263 if (window_prompting & YNegative) |
13246 f->output_data.w32->win_gravity = SouthEastGravity; | 13264 f->output_data.w32->win_gravity = SouthEastGravity; |