comparison src/frame-msw.c @ 5126:2a462149bd6a ben-lisp-object

merge
author Ben Wing <ben@xemacs.org>
date Wed, 24 Feb 2010 19:04:27 -0600
parents b5df3737028a d0c14ea98592
children a9c41067dd88
comparison
equal deleted inserted replaced
5125:b5df3737028a 5126:2a462149bd6a
1 /* Functions for the mswindows window system. 1 /* Functions for the mswindows window system.
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. 3 Copyright (C) 1995, 1996, 2001, 2002, 2010 Ben Wing.
4 4
5 This file is part of XEmacs. 5 This file is part of XEmacs.
6 6
7 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
233 and down from its parent, and give it size of 30x10 characters. 233 and down from its parent, and give it size of 30x10 characters.
234 These dimensions look adequate on both high and low res monitors */ 234 These dimensions look adequate on both high and low res monitors */
235 GetWindowRect (hwnd_parent, &rect); 235 GetWindowRect (hwnd_parent, &rect);
236 rect_default.left = rect.left + POPUP_OFFSET; 236 rect_default.left = rect.left + POPUP_OFFSET;
237 rect_default.top = rect.top + POPUP_OFFSET; 237 rect_default.top = rect.top + POPUP_OFFSET;
238 char_to_real_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT, 238 char_to_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT,
239 &rect_default.width, &rect_default.height); 239 &rect_default.width, &rect_default.height);
240 FRAME_MSWINDOWS_POPUP (f) = 1; 240 FRAME_MSWINDOWS_POPUP (f) = 1;
241 } 241 }
242 242
243 AdjustWindowRectEx (&rect, style, ADJR_MENUFLAG, exstyle); 243 AdjustWindowRectEx (&rect, style, ADJR_MENUFLAG, exstyle);
370 370
371 static void 371 static void
372 mswindows_set_frame_size (struct frame *f, int width, int height) 372 mswindows_set_frame_size (struct frame *f, int width, int height)
373 { 373 {
374 RECT rect; 374 RECT rect;
375 int columns, rows; 375 int pwidth, pheight;
376
377 change_frame_size (f, width, height, 0);
378 frame_unit_to_pixel_size (f, width, height, &pwidth, &pheight);
376 379
377 rect.left = rect.top = 0; 380 rect.left = rect.top = 0;
378 rect.right = width; 381 rect.right = pwidth;
379 rect.bottom = height; 382 rect.bottom = pheight;
380
381 pixel_to_char_size (f, rect.right, rect.bottom, &columns, &rows);
382 change_frame_size (f, rows, columns, 0);
383 383
384 /* This can call Lisp, because it runs the window procedure, which can 384 /* This can call Lisp, because it runs the window procedure, which can
385 call redisplay() */ 385 call redisplay() */
386 AdjustWindowRectEx (&rect, 386 AdjustWindowRectEx (&rect,
387 qxeGetWindowLong (FRAME_MSWINDOWS_HANDLE (f), GWL_STYLE), 387 qxeGetWindowLong (FRAME_MSWINDOWS_HANDLE (f), GWL_STYLE),
736 { 736 {
737 RECT rect, ws_rect; 737 RECT rect, ws_rect;
738 int pixel_width, pixel_height; 738 int pixel_width, pixel_height;
739 int size_p = (dest->width >=0 || dest->height >=0); 739 int size_p = (dest->width >=0 || dest->height >=0);
740 int move_p = (dest->top >=0 || dest->left >=0); 740 int move_p = (dest->top >=0 || dest->left >=0);
741 char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, 741 char_to_pixel_size (f, dest->width, dest->height, &pixel_width,
742 &pixel_height); 742 &pixel_height);
743 743
744 if (dest->width < 0) 744 if (dest->width < 0)
745 pixel_width = FRAME_PIXWIDTH (f); 745 pixel_width = FRAME_PIXWIDTH (f);
746 if (dest->height < 0) 746 if (dest->height < 0)
935 frame_left = MulDiv (logpixelsx, FRAME_MSPRINTER_LEFT_MARGIN(f), 1440) 935 frame_left = MulDiv (logpixelsx, FRAME_MSPRINTER_LEFT_MARGIN(f), 1440)
936 - physicaloffsetx; 936 - physicaloffsetx;
937 937
938 if (FRAME_MSPRINTER_CHARWIDTH (f) > 0) 938 if (FRAME_MSPRINTER_CHARWIDTH (f) > 0)
939 { 939 {
940 char_to_real_pixel_size (f, FRAME_MSPRINTER_CHARWIDTH (f), 0, 940 char_to_pixel_size (f, FRAME_MSPRINTER_CHARWIDTH (f), 0,
941 &frame_width, NULL); 941 &frame_width, NULL);
942 FRAME_MSPRINTER_RIGHT_MARGIN(f) = 942 FRAME_MSPRINTER_RIGHT_MARGIN(f) =
943 MulDiv (physicalwidth - (frame_left + frame_width), 1440, 943 MulDiv (physicalwidth - (frame_left + frame_width), 1440,
944 logpixelsx); 944 logpixelsx);
945 } 945 }
951 frame_top = MulDiv (logpixelsy, FRAME_MSPRINTER_TOP_MARGIN(f), 1440) 951 frame_top = MulDiv (logpixelsy, FRAME_MSPRINTER_TOP_MARGIN(f), 1440)
952 - physicaloffsety; 952 - physicaloffsety;
953 953
954 if (FRAME_MSPRINTER_CHARHEIGHT (f) > 0) 954 if (FRAME_MSPRINTER_CHARHEIGHT (f) > 0)
955 { 955 {
956 char_to_real_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT (f), 956 char_to_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT (f),
957 NULL, &frame_height); 957 NULL, &frame_height);
958 958
959 FRAME_MSPRINTER_BOTTOM_MARGIN(f) = 959 FRAME_MSPRINTER_BOTTOM_MARGIN(f) =
960 MulDiv (physicalheight - (frame_top + frame_height), 1440, 960 MulDiv (physicalheight - (frame_top + frame_height), 1440,
961 logpixelsy); 961 logpixelsy);
981 /* Apply XEmacs frame geometry and layout windows */ 981 /* Apply XEmacs frame geometry and layout windows */
982 { 982 {
983 int rows, columns; 983 int rows, columns;
984 FRAME_PIXWIDTH (f) = frame_width; 984 FRAME_PIXWIDTH (f) = frame_width;
985 FRAME_PIXHEIGHT (f) = frame_height; 985 FRAME_PIXHEIGHT (f) = frame_height;
986 pixel_to_char_size (f, frame_width, frame_height, &columns, &rows); 986 pixel_to_frame_unit_size (f, frame_width, frame_height, &columns, &rows);
987 change_frame_size (f, rows, columns, 0); 987 change_frame_size (f, columns, rows, 0);
988 } 988 }
989 989
990 FRAME_MSPRINTER_PIXLEFT(f) = frame_left; 990 FRAME_MSPRINTER_PIXLEFT(f) = frame_left;
991 FRAME_MSPRINTER_PIXTOP(f) = frame_top; 991 FRAME_MSPRINTER_PIXTOP(f) = frame_top;
992 992