Mercurial > hg > xemacs-beta
comparison src/frame-msw.c @ 506:39ccc7dd8077
[xemacs-hg @ 2001-05-05 08:39:59 by ben]
Add Page Setup for Windows, take out Pretty Print.
Implement Page Setup. Handle errors properly.
Change top/bottom margin defaults to 0.5 inches.
author | ben |
---|---|
date | Sat, 05 May 2001 08:40:06 +0000 |
parents | 5aa1854ad537 |
children | 8f3fb4fd879b |
comparison
equal
deleted
inserted
replaced
505:6495d35ba9df | 506:39ccc7dd8077 |
---|---|
640 | 640 |
641 mswindows_size_frame_internal (f, &dest); | 641 mswindows_size_frame_internal (f, &dest); |
642 } | 642 } |
643 } | 643 } |
644 | 644 |
645 void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest) | 645 void |
646 mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest) | |
646 { | 647 { |
647 RECT rect, ws_rect; | 648 RECT rect, ws_rect; |
648 int pixel_width, pixel_height; | 649 int pixel_width, pixel_height; |
649 int size_p = (dest->width >=0 || dest->height >=0); | 650 int size_p = (dest->width >=0 || dest->height >=0); |
650 int move_p = (dest->top >=0 || dest->left >=0); | 651 int move_p = (dest->top >=0 || dest->left >=0); |
651 char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, &pixel_height); | 652 char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, |
653 &pixel_height); | |
652 | 654 |
653 if (dest->width < 0) | 655 if (dest->width < 0) |
654 pixel_width = FRAME_PIXWIDTH (f); | 656 pixel_width = FRAME_PIXWIDTH (f); |
655 if (dest->height < 0) | 657 if (dest->height < 0) |
656 pixel_height = FRAME_PIXHEIGHT (f); | 658 pixel_height = FRAME_PIXHEIGHT (f); |
804 invalid_operation ("Only one frame (print job) at a time is allowed on " | 806 invalid_operation ("Only one frame (print job) at a time is allowed on " |
805 "this printer device", FRAME_DEVICE (f)); | 807 "this printer device", FRAME_DEVICE (f)); |
806 | 808 |
807 f->frame_data = xnew_and_zero (struct msprinter_frame); | 809 f->frame_data = xnew_and_zero (struct msprinter_frame); |
808 | 810 |
809 /* Default margin size is 1" = 1440 twips */ | 811 FRAME_MSPRINTER_TOP_MARGIN (f) = |
810 FRAME_MSPRINTER_TOP_MARGIN(f) = 1440; | 812 mswindows_get_default_margin (Qtop_margin); |
811 FRAME_MSPRINTER_BOTTOM_MARGIN(f) = 1440; | 813 FRAME_MSPRINTER_BOTTOM_MARGIN (f) = |
812 FRAME_MSPRINTER_LEFT_MARGIN(f) = 1440; | 814 mswindows_get_default_margin (Qbottom_margin); |
813 FRAME_MSPRINTER_RIGHT_MARGIN(f) = 1440; | 815 FRAME_MSPRINTER_LEFT_MARGIN (f) = |
816 mswindows_get_default_margin (Qleft_margin); | |
817 FRAME_MSPRINTER_RIGHT_MARGIN (f) = | |
818 mswindows_get_default_margin (Qright_margin); | |
814 | 819 |
815 /* Negative for "uinspecified" */ | 820 /* Negative for "uinspecified" */ |
816 FRAME_MSPRINTER_CHARWIDTH(f) = -1; | 821 FRAME_MSPRINTER_CHARWIDTH (f) = -1; |
817 FRAME_MSPRINTER_CHARHEIGHT(f) = -1; | 822 FRAME_MSPRINTER_CHARHEIGHT (f) = -1; |
818 } | 823 } |
819 | 824 |
820 static void | 825 static void |
821 msprinter_init_frame_3 (struct frame *f) | 826 msprinter_init_frame_3 (struct frame *f) |
822 { | 827 { |
1180 | 1185 |
1181 left-margin Margin of the page, in twips. Twip is a | 1186 left-margin Margin of the page, in twips. Twip is a |
1182 top-margin typographical unit of measurement, | 1187 top-margin typographical unit of measurement, |
1183 right-margin equal to 1/1440 of an inch, or 1/20 of a | 1188 right-margin equal to 1/1440 of an inch, or 1/20 of a |
1184 bottom-margin point, and roughly equal to 7/400 of a | 1189 bottom-margin point, and roughly equal to 7/400 of a |
1185 millimeter. If not specified, each margin | 1190 millimeter. If not specified, the left |
1186 defaults to one inch (25.4 mm). | 1191 and right margins default to 1 inch |
1192 (25.4 mm) and the top and bottom margins | |
1193 to 0.5 inch (12.7 mm). | |
1187 | 1194 |
1188 MARGINS NOTE. right-margin and bottom-margin are overridden by | 1195 MARGINS NOTE. right-margin and bottom-margin are overridden by |
1189 the height and width properties. If you want to specify size | 1196 the height and width properties. If you want to specify size |
1190 of the printable area in character, as with the rest of XEmacs, | 1197 of the printable area in character, as with the rest of XEmacs, |
1191 use these properties. If height and/or width are nil, then | 1198 use these properties. If height and/or width are nil, then |
1192 corresponding margin setting is taken into account. If you | 1199 corresponding margin setting is taken into account. If you |
1193 specify height and/or width in `default-frame-plist', but still | 1200 specify height and/or width in `default-frame-plist', but still |
1194 want to specify right/bottom margins, set height/width in this | 1201 want to specify right/bottom margins, set height/width in this |
1195 plist to nil, as in this example: | 1202 plist to nil, as in this example: |
1196 | 1203 |
1197 (setq default-frame-plist '(height 55 'width 80) | 1204 (setq default-frame-plist '(height 55 width 80) |
1198 default-msprinter-frame-plist '(height nil 'width nil)) | 1205 default-msprinter-frame-plist '(height nil width nil)) |
1199 | 1206 |
1200 See also `default-frame-plist', which specifies properties which apply | 1207 See also `default-frame-plist', which specifies properties which apply |
1201 to all frames, not just mswindows frames. | 1208 to all frames, not just mswindows frames. |
1202 */ ); | 1209 */ ); |
1203 Vdefault_msprinter_frame_plist = Qnil; | 1210 Vdefault_msprinter_frame_plist = Qnil; |