aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-09-18 18:18:12 +0000
committerChong Yidong2008-09-18 18:18:12 +0000
commitb89c78a5b76d28afdcd04cd6850fbcf731d7a86f (patch)
tree2f31d3709c2221f41120daddcde5315a71441d94
parenta53400f35062ba30fcfbe9ef62957dfe0b43fb5d (diff)
downloademacs-b89c78a5b76d28afdcd04cd6850fbcf731d7a86f.tar.gz
emacs-b89c78a5b76d28afdcd04cd6850fbcf731d7a86f.zip
(x_display_pixel_height, x_display_pixel_width): New functions.
(w32_read_socket, x_calc_absolute_position): Use them. (w32_initialize_display_info, w32_term_init): Omit removed members of w32_display_info.
-rw-r--r--src/w32term.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/w32term.c b/src/w32term.c
index c07d5b63524..c81945e3e04 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -459,6 +459,20 @@ x_set_frame_alpha (f)
459 pfnSetLayeredWindowAttributes (window, 0, opac, LWA_ALPHA); 459 pfnSetLayeredWindowAttributes (window, 0, opac, LWA_ALPHA);
460} 460}
461 461
462int
463x_display_pixel_height (dpyinfo)
464 struct w32_display_info *dpyinfo;
465{
466 return GetDeviceCaps (GetDC (GetDesktopWindow ()), VERTRES);
467}
468
469int
470x_display_pixel_width (dpyinfo)
471 struct w32_display_info *dpyinfo;
472{
473 return GetDeviceCaps (GetDC (GetDesktopWindow ()), HORZRES);
474}
475
462 476
463/*********************************************************************** 477/***********************************************************************
464 Starting and ending an update 478 Starting and ending an update
@@ -4686,11 +4700,10 @@ w32_read_socket (sd, expected, hold_quit)
4686 4700
4687 if (f) 4701 if (f)
4688 { 4702 {
4689 dpyinfo->width = (short) LOWORD (msg.msg.lParam);
4690 dpyinfo->height = (short) HIWORD (msg.msg.lParam);
4691 dpyinfo->n_cbits = msg.msg.wParam; 4703 dpyinfo->n_cbits = msg.msg.wParam;
4692 DebPrint (("display change: %d %d\n", dpyinfo->width, 4704 DebPrint (("display change: %d %d\n",
4693 dpyinfo->height)); 4705 (short) LOWORD (msg.msg.lParam),
4706 (short) HIWORD (msg.msg.lParam)));
4694 } 4707 }
4695 4708
4696 check_visibility = 1; 4709 check_visibility = 1;
@@ -5313,13 +5326,13 @@ x_calc_absolute_position (f)
5313 /* Treat negative positions as relative to the rightmost bottommost 5326 /* Treat negative positions as relative to the rightmost bottommost
5314 position that fits on the screen. */ 5327 position that fits on the screen. */
5315 if (flags & XNegative) 5328 if (flags & XNegative)
5316 f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width 5329 f->left_pos = (x_display_pixel_width (FRAME_W32_DISPLAY_INFO (f))
5317 - FRAME_PIXEL_WIDTH (f) 5330 - FRAME_PIXEL_WIDTH (f)
5318 + f->left_pos 5331 + f->left_pos
5319 - (left_right_borders_width - 1)); 5332 - (left_right_borders_width - 1));
5320 5333
5321 if (flags & YNegative) 5334 if (flags & YNegative)
5322 f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height 5335 f->top_pos = (x_display_pixel_height (FRAME_W32_DISPLAY_INFO (f))
5323 - FRAME_PIXEL_HEIGHT (f) 5336 - FRAME_PIXEL_HEIGHT (f)
5324 + f->top_pos 5337 + f->top_pos
5325 - (top_bottom_borders_height - 1)); 5338 - (top_bottom_borders_height - 1));
@@ -5952,8 +5965,6 @@ w32_initialize_display_info (display_name)
5952 with values obtained from system metrics. */ 5965 with values obtained from system metrics. */
5953 dpyinfo->resx = 1; 5966 dpyinfo->resx = 1;
5954 dpyinfo->resy = 1; 5967 dpyinfo->resy = 1;
5955 dpyinfo->height_in = 1;
5956 dpyinfo->width_in = 1;
5957 dpyinfo->n_planes = 1; 5968 dpyinfo->n_planes = 1;
5958 dpyinfo->n_cbits = 4; 5969 dpyinfo->n_cbits = 4;
5959 dpyinfo->n_fonts = 0; 5970 dpyinfo->n_fonts = 0;
@@ -6180,8 +6191,6 @@ w32_term_init (display_name, xrm_option, resource_name)
6180 6191
6181 hdc = GetDC (GetDesktopWindow ()); 6192 hdc = GetDC (GetDesktopWindow ());
6182 6193
6183 dpyinfo->height = GetDeviceCaps (hdc, VERTRES);
6184 dpyinfo->width = GetDeviceCaps (hdc, HORZRES);
6185 dpyinfo->root_window = GetDesktopWindow (); 6194 dpyinfo->root_window = GetDesktopWindow ();
6186 dpyinfo->n_planes = GetDeviceCaps (hdc, PLANES); 6195 dpyinfo->n_planes = GetDeviceCaps (hdc, PLANES);
6187 dpyinfo->n_cbits = GetDeviceCaps (hdc, BITSPIXEL); 6196 dpyinfo->n_cbits = GetDeviceCaps (hdc, BITSPIXEL);
@@ -6189,8 +6198,6 @@ w32_term_init (display_name, xrm_option, resource_name)
6189 dpyinfo->resy = GetDeviceCaps (hdc, LOGPIXELSY); 6198 dpyinfo->resy = GetDeviceCaps (hdc, LOGPIXELSY);
6190 dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE; 6199 dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE;
6191 dpyinfo->terminal->image_cache = make_image_cache (); 6200 dpyinfo->terminal->image_cache = make_image_cache ();
6192 dpyinfo->height_in = dpyinfo->height / dpyinfo->resx;
6193 dpyinfo->width_in = dpyinfo->width / dpyinfo->resy;
6194 ReleaseDC (GetDesktopWindow (), hdc); 6201 ReleaseDC (GetDesktopWindow (), hdc);
6195 6202
6196 /* initialise palette with white and black */ 6203 /* initialise palette with white and black */