comparison src/frame-msw.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 7d59cb494b73
children 2f8bb876ab1d
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
68 #define ADJR_MENUFLAG FALSE 68 #define ADJR_MENUFLAG FALSE
69 #endif 69 #endif
70 70
71 /* Default properties to use when creating frames. */ 71 /* Default properties to use when creating frames. */
72 Lisp_Object Vdefault_mswindows_frame_plist; 72 Lisp_Object Vdefault_mswindows_frame_plist;
73 Lisp_Object Vdefault_msprinter_frame_plist;
73 Lisp_Object Vmswindows_use_system_frame_size_defaults; 74 Lisp_Object Vmswindows_use_system_frame_size_defaults;
74 75
75 /* This does not need to be GC protected, as it holds a 76 /* This does not need to be GC protected, as it holds a
76 frame Lisp_Object already protected by Fmake_frame */ 77 frame Lisp_Object already protected by Fmake_frame */
77 Lisp_Object Vmswindows_frame_being_created; 78 Lisp_Object Vmswindows_frame_being_created;
79
80 /*---------------------------------------------------------------------*/
81 /*----- DISPLAY FRAME -----*/
82 /*---------------------------------------------------------------------*/
78 83
79 static void 84 static void
80 mswindows_init_frame_1 (struct frame *f, Lisp_Object props) 85 mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
81 { 86 {
82 Lisp_Object initially_unmapped; 87 Lisp_Object initially_unmapped;
180 185
181 hwnd = CreateWindowEx (exstyle, 186 hwnd = CreateWindowEx (exstyle,
182 XEMACS_CLASS, 187 XEMACS_CLASS,
183 STRINGP(f->name) ? XSTRING_DATA(f->name) : 188 STRINGP(f->name) ? XSTRING_DATA(f->name) :
184 (STRINGP(name) ? 189 (STRINGP(name) ?
185 (CONST Extbyte*)XSTRING_DATA(name) : 190 (const Extbyte*)XSTRING_DATA(name) :
186 (CONST Extbyte*)XEMACS_CLASS), 191 (const Extbyte*)XEMACS_CLASS),
187 style, 192 style,
188 rect_default.left, rect_default.top, 193 rect_default.left, rect_default.top,
189 rect_default.width, rect_default.height, 194 rect_default.width, rect_default.height,
190 hwnd_parent, NULL, NULL, NULL); 195 hwnd_parent, NULL, NULL, NULL);
191 196
246 if (first_on_console) 251 if (first_on_console)
247 redisplay (); 252 redisplay ();
248 } 253 }
249 254
250 static void 255 static void
251 mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object)) 256 mswindows_mark_frame (struct frame *f)
252 { 257 {
253 markobj (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); 258 mark_object (FRAME_MSWINDOWS_MENU_HASH_TABLE (f));
254 #ifdef HAVE_TOOLBARS 259 #ifdef HAVE_TOOLBARS
255 markobj (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f)); 260 mark_object (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f));
256 #endif 261 #endif
257 markobj (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f)); 262 mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f));
258 } 263 }
259 264
260 static void 265 static void
261 mswindows_focus_on_frame (struct frame *f) 266 mswindows_focus_on_frame (struct frame *f)
262 { 267 {
306 } 311 }
307 312
308 static void 313 static void
309 mswindows_make_frame_visible (struct frame *f) 314 mswindows_make_frame_visible (struct frame *f)
310 { 315 {
311 if (f->iconified) 316 if (!FRAME_VISIBLE_P(f))
312 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE); 317 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
313 else 318 else
314 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOW); 319 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOW);
315 f->visible = 1; 320 f->visible = 1;
316 f->iconified = 0; 321 f->iconified = 0;
317 } 322 }
318 323
319 static void 324 static void
320 mswindows_make_frame_invisible (struct frame *f) 325 mswindows_make_frame_invisible (struct frame *f)
321 { 326 {
327 if (!FRAME_VISIBLE_P(f))
328 return;
329
322 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_HIDE); 330 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_HIDE);
323 f->visible = -1; 331 f->visible = 0;
324 } 332 }
325 333
326 static int 334 static int
327 mswindows_frame_totally_visible_p (struct frame *f) 335 mswindows_frame_totally_visible_p (struct frame *f)
328 { 336 {
589 is initialised in the frame (toolbars for instance). enabling 597 is initialised in the frame (toolbars for instance). enabling
590 this always makes no visible difference and fixes a whole host of 598 this always makes no visible difference and fixes a whole host of
591 bugs (and is more consistent with X) so I am going to reenable it. 599 bugs (and is more consistent with X) so I am going to reenable it.
592 --andyp */ 600 --andyp */
593 if ( FRAME_PIXWIDTH (f) && FRAME_PIXHEIGHT (f) 601 if ( FRAME_PIXWIDTH (f) && FRAME_PIXHEIGHT (f)
594 && (width_specified_p || height_specified_p || x_specified_p || y_specified_p)) 602 && (width_specified_p || height_specified_p
603 || x_specified_p || y_specified_p))
595 { 604 {
596 XEMACS_RECT_WH dest = { x, y, width, height }; 605 XEMACS_RECT_WH dest = { x, y, width, height };
597 606
598 mswindows_size_frame_internal (f, &dest); 607 mswindows_size_frame_internal (f, &dest);
599 } 608 }
694 { 703 {
695 /* Frame size cannot change if the frame is maximized */ 704 /* Frame size cannot change if the frame is maximized */
696 return IsZoomed (FRAME_MSWINDOWS_HANDLE (f)); 705 return IsZoomed (FRAME_MSWINDOWS_HANDLE (f));
697 } 706 }
698 707
708 /*---------------------------------------------------------------------*/
709 /*----- PRINTER FRAME -----*/
710 /*---------------------------------------------------------------------*/
711
712 void
713 msprinter_start_page (struct frame *f)
714 {
715 if (!FRAME_MSPRINTER_PAGE_STARTED (f))
716 {
717 FRAME_MSPRINTER_PAGE_STARTED (f) = 1;
718 StartPage (DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))));
719 }
720 }
721
722 static void
723 error_frame_unsizable (struct frame *f)
724 {
725 Lisp_Object frame;
726 XSETFRAME (frame, f);
727 signal_simple_error ("Cannot resize frame (margins)"
728 " after print job has started.", frame);
729 }
730
731 static void
732 maybe_error_if_job_active (struct frame *f)
733 {
734 if (FRAME_MSPRINTER_JOB_STARTED (f))
735 error_frame_unsizable (f);
736 }
737
738 static void
739 msprinter_init_frame_1 (struct frame *f, Lisp_Object props)
740 {
741 /* Make sure this is the only frame on device. Windows printer can
742 handle only one job at a time. */
743 if (!NILP (DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)))))
744 error ("Only one frame (print job) at a time is allowed on "
745 "this printer device.");
746
747 f->frame_data = xnew_and_zero (struct msprinter_frame);
748
749 /* Default margin size is 1" = 1440 twips */
750 FRAME_MSPRINTER_TOP_MARGIN(f) = 1440;
751 FRAME_MSPRINTER_BOTTOM_MARGIN(f) = 1440;
752 FRAME_MSPRINTER_LEFT_MARGIN(f) = 1440;
753 FRAME_MSPRINTER_RIGHT_MARGIN(f) = 1440;
754
755 /* Negative for "uinspecified" */
756 FRAME_MSPRINTER_CHARWIDTH(f) = -1;
757 FRAME_MSPRINTER_CHARHEIGHT(f) = -1;
758
759 /* nil is for "system default" for these properties. */
760 FRAME_MSPRINTER_ORIENTATION(f) = Qnil;
761 FRAME_MSPRINTER_DUPLEX(f) = Qnil;
762 }
763
764 static void
765 msprinter_init_frame_3 (struct frame *f)
766 {
767 DOCINFO di;
768 struct device *device = XDEVICE (FRAME_DEVICE (f));
769 HDC hdc = DEVICE_MSPRINTER_HDC (device);
770 int frame_left, frame_top, frame_width, frame_height;
771
772 /* Change printer parameters */
773 {
774 DEVMODE* devmode = msprinter_get_devmode_copy (device);
775 devmode->dmFields = 0;
776
777 if (!NILP (FRAME_MSPRINTER_ORIENTATION(f)))
778 {
779 devmode->dmFields = DM_ORIENTATION;
780 if (EQ (FRAME_MSPRINTER_ORIENTATION(f), Qportrait))
781 devmode->dmOrientation = DMORIENT_PORTRAIT;
782 else if (EQ (FRAME_MSPRINTER_ORIENTATION(f), Qlandscape))
783 devmode->dmOrientation = DMORIENT_LANDSCAPE;
784 else
785 abort();
786 }
787
788 if (!NILP (FRAME_MSPRINTER_DUPLEX(f)))
789 {
790 devmode->dmFields = DM_DUPLEX;
791 if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qnone))
792 devmode->dmDuplex = DMDUP_SIMPLEX;
793 if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qvertical))
794 devmode->dmDuplex = DMDUP_VERTICAL;
795 if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qhorizontal))
796 devmode->dmDuplex = DMDUP_HORIZONTAL;
797 else
798 abort();
799 }
800
801 msprinter_apply_devmode (device, devmode);
802 }
803
804 /* Compute geometry properties */
805 frame_left = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSX),
806 FRAME_MSPRINTER_LEFT_MARGIN(f), 1440)
807 - GetDeviceCaps (hdc, PHYSICALOFFSETX));
808
809 if (FRAME_MSPRINTER_CHARWIDTH(f) > 0)
810 {
811 char_to_real_pixel_size (f, FRAME_MSPRINTER_CHARWIDTH(f), 0,
812 &frame_width, NULL);
813 FRAME_MSPRINTER_RIGHT_MARGIN(f) =
814 MulDiv (GetDeviceCaps (hdc, PHYSICALWIDTH)
815 - (frame_left + frame_width), 1440,
816 GetDeviceCaps (hdc, LOGPIXELSX));
817 }
818 else
819 frame_width = (GetDeviceCaps (hdc, PHYSICALWIDTH)
820 - frame_left
821 - MulDiv (GetDeviceCaps (hdc, LOGPIXELSX),
822 FRAME_MSPRINTER_RIGHT_MARGIN(f), 1440));
823
824 frame_top = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSY),
825 FRAME_MSPRINTER_TOP_MARGIN(f), 1440)
826 - GetDeviceCaps (hdc, PHYSICALOFFSETY));
827
828 if (FRAME_MSPRINTER_CHARHEIGHT(f) > 0)
829 {
830 char_to_real_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT(f),
831 NULL, &frame_height);
832
833 FRAME_MSPRINTER_BOTTOM_MARGIN(f) =
834 MulDiv (GetDeviceCaps (hdc, PHYSICALHEIGHT)
835 - (frame_top + frame_height), 1440,
836 GetDeviceCaps (hdc, LOGPIXELSY));
837 }
838 else
839 frame_height = (GetDeviceCaps (hdc, PHYSICALHEIGHT)
840 - frame_top
841 - MulDiv (GetDeviceCaps (hdc, LOGPIXELSY),
842 FRAME_MSPRINTER_BOTTOM_MARGIN(f), 1440));
843
844 /* Geometry sanity checks */
845 if (!frame_pixsize_valid_p (f, frame_width, frame_height))
846 error ("Area inside print margins has shrunk to naught.");
847
848 if (frame_left < 0
849 || frame_top < 0
850 || frame_left + frame_width > GetDeviceCaps (hdc, HORZRES)
851 || frame_top + frame_height > GetDeviceCaps (hdc, VERTRES))
852 error ("Print area is ouside of the printer's hardware printable area.");
853
854 /* Apply XEmacs frame geometry and layout windows */
855 {
856 int rows, columns;
857 FRAME_PIXWIDTH(f) = frame_width;
858 FRAME_PIXHEIGHT(f) = frame_height;
859 pixel_to_char_size (f, frame_width, frame_height, &columns, &rows);
860 change_frame_size (f, rows, columns, 0);
861 }
862
863 /* Apply DC geometry */
864 SetTextAlign (hdc, TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
865 SetViewportOrgEx (hdc, frame_left, frame_top, NULL);
866 SetWindowOrgEx (hdc, 0, 0, NULL);
867
868 /* Start print job */
869 di.cbSize = sizeof (di);
870 di.lpszDocName = (STRINGP(f->name)
871 ? (char*) XSTRING_DATA(f->name)
872 : "XEmacs print document");
873 di.lpszOutput = NULL;
874 di.lpszDatatype = NULL;
875 di.fwType = 0;
876
877 if (StartDoc (hdc, &di) <= 0)
878 error ("Cannot start print job");
879
880 /* Finish frame setup */
881 FRAME_MSPRINTER_CDC(f) = CreateCompatibleDC (hdc);
882 FRAME_MSPRINTER_JOB_STARTED (f) = 1;
883 FRAME_VISIBLE_P(f) = 0;
884 }
885
886 static void
887 msprinter_mark_frame (struct frame *f)
888 {
889 /* NOTE: These need not be marked as long as we allow only c-defined
890 symbols for their values. Although, marking these is safer than
891 expensive. [I know a proof to the theorem postulating that a
892 gator is longer than greener. Ask me. -- kkm] */
893 mark_object (FRAME_MSPRINTER_ORIENTATION (f));
894 mark_object (FRAME_MSPRINTER_DUPLEX (f));
895 }
896
897 static void
898 msprinter_delete_frame (struct frame *f)
899 {
900 if (f->frame_data)
901 {
902 HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f)));
903 if (FRAME_MSPRINTER_PAGE_STARTED (f))
904 EndPage (hdc);
905 if (FRAME_MSPRINTER_JOB_STARTED (f))
906 EndDoc (hdc);
907 if (FRAME_MSPRINTER_CDC(f))
908 DeleteDC (FRAME_MSPRINTER_CDC(f));
909 xfree (f->frame_data);
910 }
911
912 f->frame_data = 0;
913 }
914
915 static Lisp_Object
916 msprinter_frame_property (struct frame *f, Lisp_Object property)
917 {
918 if (EQ (Qleft_margin, property))
919 return make_int (FRAME_MSPRINTER_LEFT_MARGIN(f));
920 else if (EQ (Qtop_margin, property))
921 return make_int (FRAME_MSPRINTER_TOP_MARGIN(f));
922 if (EQ (Qright_margin, property))
923 return make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f));
924 else if (EQ (Qbottom_margin, property))
925 return make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f));
926 else if (EQ (Qorientation, property))
927 return FRAME_MSPRINTER_ORIENTATION(f);
928 else if (EQ (Qduplex, property))
929 return FRAME_MSPRINTER_DUPLEX(f);
930 else
931 return Qunbound;
932 }
933
934 static int
935 msprinter_internal_frame_property_p (struct frame *f, Lisp_Object property)
936 {
937 return (EQ (Qleft_margin, property) || EQ (Qtop_margin, property) ||
938 EQ (Qright_margin, property) || EQ (Qbottom_margin, property) ||
939 EQ (Qorientation, property) || EQ (Qduplex, property));
940 }
941
942 static Lisp_Object
943 msprinter_frame_properties (struct frame *f)
944 {
945 Lisp_Object props = Qnil;
946 props = cons3 (Qorientation, FRAME_MSPRINTER_ORIENTATION(f), props);
947 props = cons3 (Qduplex, FRAME_MSPRINTER_DUPLEX(f), props);
948 props = cons3 (Qbottom_margin,
949 make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f)), props);
950 props = cons3 (Qright_margin,
951 make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f)), props);
952 props = cons3 (Qtop_margin,
953 make_int (FRAME_MSPRINTER_TOP_MARGIN(f)), props);
954 props = cons3 (Qleft_margin,
955 make_int (FRAME_MSPRINTER_LEFT_MARGIN(f)), props);
956 return props;
957 }
958
959 static void
960 msprinter_set_frame_properties (struct frame *f, Lisp_Object plist)
961 {
962 Lisp_Object tail;
963
964 /* Extract the properties from plist */
965 for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
966 {
967 Lisp_Object prop = Fcar (tail);
968 Lisp_Object val = Fcar (Fcdr (tail));
969
970 if (SYMBOLP (prop))
971 {
972 if (EQ (prop, Qwidth))
973 {
974 maybe_error_if_job_active (f);
975 if (!NILP (val))
976 {
977 CHECK_NATNUM (val);
978 FRAME_MSPRINTER_CHARWIDTH(f) = XINT (val);
979 }
980 }
981 if (EQ (prop, Qheight))
982 {
983 maybe_error_if_job_active (f);
984 if (!NILP (val))
985 {
986 CHECK_NATNUM (val);
987 FRAME_MSPRINTER_CHARHEIGHT(f) = XINT (val);
988 }
989 }
990 else if (EQ (prop, Qleft_margin))
991 {
992 maybe_error_if_job_active (f);
993 CHECK_NATNUM (val);
994 FRAME_MSPRINTER_LEFT_MARGIN(f) = XINT (val);
995 }
996 else if (EQ (prop, Qtop_margin))
997 {
998 maybe_error_if_job_active (f);
999 CHECK_NATNUM (val);
1000 FRAME_MSPRINTER_TOP_MARGIN(f) = XINT (val);
1001 }
1002 else if (EQ (prop, Qright_margin))
1003 {
1004 maybe_error_if_job_active (f);
1005 CHECK_NATNUM (val);
1006 FRAME_MSPRINTER_RIGHT_MARGIN(f) = XINT (val);
1007 }
1008 else if (EQ (prop, Qbottom_margin))
1009 {
1010 maybe_error_if_job_active (f);
1011 CHECK_NATNUM (val);
1012 FRAME_MSPRINTER_BOTTOM_MARGIN(f) = XINT (val);
1013 }
1014 else if (EQ (prop, Qorientation))
1015 {
1016 maybe_error_if_job_active (f);
1017 CHECK_SYMBOL (val);
1018 if (!NILP(val) &&
1019 !EQ (val, Qportrait) &&
1020 !EQ (val, Qlandscape))
1021 signal_simple_error ("Page orientation can only be "
1022 "'portrait or 'landscape", val);
1023 FRAME_MSPRINTER_ORIENTATION(f) = val;
1024 }
1025 else if (EQ (prop, Qduplex))
1026 {
1027 maybe_error_if_job_active (f);
1028 CHECK_SYMBOL (val);
1029 if (!NILP(val) &&
1030 !EQ (val, Qnone) &&
1031 !EQ (val, Qvertical) &&
1032 !EQ (val, Qhorizontal))
1033 signal_simple_error ("Duplex can only be 'none, "
1034 "'vertical or 'horizontal", val);
1035 FRAME_MSPRINTER_DUPLEX(f) = val;
1036 }
1037 }
1038 }
1039 }
1040
1041 static void
1042 msprinter_set_frame_size (struct frame *f, int width, int height)
1043 {
1044 /* We're absolutely unsizeable */
1045 error_frame_unsizable (f);
1046 }
1047
1048 static void
1049 msprinter_eject_page (struct frame *f)
1050 {
1051 /* #### Should we eject empty pages? */
1052 if (FRAME_MSPRINTER_PAGE_STARTED (f))
1053 {
1054 FRAME_MSPRINTER_PAGE_STARTED (f) = 0;
1055 EndPage (DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))));
1056 }
1057 }
1058
1059
699 void 1060 void
700 console_type_create_frame_mswindows (void) 1061 console_type_create_frame_mswindows (void)
701 { 1062 {
702 /* frame methods */ 1063 /* Display frames */
703 CONSOLE_HAS_METHOD (mswindows, init_frame_1); 1064 CONSOLE_HAS_METHOD (mswindows, init_frame_1);
704 CONSOLE_HAS_METHOD (mswindows, init_frame_2); 1065 CONSOLE_HAS_METHOD (mswindows, init_frame_2);
705 CONSOLE_HAS_METHOD (mswindows, init_frame_3); 1066 CONSOLE_HAS_METHOD (mswindows, init_frame_3);
706 CONSOLE_HAS_METHOD (mswindows, after_init_frame); 1067 CONSOLE_HAS_METHOD (mswindows, after_init_frame);
707 CONSOLE_HAS_METHOD (mswindows, mark_frame); 1068 CONSOLE_HAS_METHOD (mswindows, mark_frame);
728 CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); 1089 CONSOLE_HAS_METHOD (mswindows, set_frame_pointer);
729 CONSOLE_HAS_METHOD (mswindows, set_frame_icon); 1090 CONSOLE_HAS_METHOD (mswindows, set_frame_icon);
730 CONSOLE_HAS_METHOD (mswindows, get_frame_parent); 1091 CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
731 CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits); 1092 CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
732 CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p); 1093 CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p);
1094
1095 /* Printer frames, aka print jobs */
1096 CONSOLE_HAS_METHOD (msprinter, init_frame_1);
1097 CONSOLE_HAS_METHOD (msprinter, init_frame_3);
1098 CONSOLE_HAS_METHOD (msprinter, mark_frame);
1099 CONSOLE_HAS_METHOD (msprinter, delete_frame);
1100 CONSOLE_HAS_METHOD (msprinter, frame_property);
1101 CONSOLE_HAS_METHOD (msprinter, internal_frame_property_p);
1102 CONSOLE_HAS_METHOD (msprinter, frame_properties);
1103 CONSOLE_HAS_METHOD (msprinter, set_frame_properties);
1104 CONSOLE_HAS_METHOD (msprinter, set_frame_size);
1105 CONSOLE_HAS_METHOD (msprinter, eject_page);
733 } 1106 }
734 1107
735 void 1108 void
736 syms_of_frame_mswindows (void) 1109 syms_of_frame_mswindows (void)
737 { 1110 {
738 } 1111 }
739 1112
740 void 1113 void
741 vars_of_frame_mswindows (void) 1114 reinit_vars_of_frame_mswindows (void)
742 { 1115 {
743 /* Needn't staticpro -- see comment above. */ 1116 /* Needn't staticpro -- see comment above. */
744 Vmswindows_frame_being_created = Qnil; 1117 Vmswindows_frame_being_created = Qnil;
1118 }
1119
1120 void
1121 vars_of_frame_mswindows (void)
1122 {
1123 reinit_vars_of_frame_mswindows ();
745 1124
746 DEFVAR_LISP ("mswindows-use-system-frame-size-defaults", &Vmswindows_use_system_frame_size_defaults /* 1125 DEFVAR_LISP ("mswindows-use-system-frame-size-defaults", &Vmswindows_use_system_frame_size_defaults /*
747 Controls whether to use system or XEmacs defaults for frame size. 1126 Controls whether to use system or XEmacs defaults for frame size.
748 If nil then reasonable defaults are used for intial frame sizes. If t 1127 If nil then reasonable defaults are used for intial frame sizes. If t
749 then the system will choose default sizes for the frame. 1128 then the system will choose default sizes for the frame.
788 */ ); 1167 */ );
789 Vdefault_mswindows_frame_plist = Qnil; 1168 Vdefault_mswindows_frame_plist = Qnil;
790 1169
791 mswindows_console_methods->device_specific_frame_props = 1170 mswindows_console_methods->device_specific_frame_props =
792 &Vdefault_mswindows_frame_plist; 1171 &Vdefault_mswindows_frame_plist;
793 } 1172
1173 DEFVAR_LISP ("default-msprinter-frame-plist", &Vdefault_msprinter_frame_plist /*
1174 Plist of default frame-creation properties for msprinter print job frames.
1175 These override what is specified in `default-frame-plist', but are
1176 overridden by the arguments to the particular call to `make-frame'.
1177
1178 Note: In many cases, properties of a frame are available as specifiers
1179 instead of through the frame-properties mechanism.
1180
1181 Here is a list of recognized frame properties, other than those
1182 documented in `set-frame-properties' (they can be queried and
1183 set at any time, except as otherwise noted):
1184
1185 left-margin Margin of the page, in twips. Twip is a
1186 top-margin typographical unit of measurement,
1187 right-margin equal to 1/1440 of an inch, or 1/20 of a
1188 bottom-margin point, and roughly equal to 7/400 of a
1189 millimeter. If not specifified, each margin
1190 defaults to one inch (25.4 mm).
1191
1192 MARGINS NOTE. right-margin and bottom-margin are overridden by
1193 the height and width properties. If you want to specify size
1194 of the printable area in character, as with the rest of XEmacs,
1195 use these properties. If height and/or width are nil, then
1196 corresponding margin setting is taken into account. If you
1197 specify height and/or width in `default-frame-plist', but still
1198 want to specify right/bottom margins, set height/width in this
1199 plist to nil, as in this example:
1200
1201 (setq default-frame-plist '(height 55 'width 80)
1202 default-msprinter-frame-plist '(height nil 'width nil))
1203
1204
1205 orientation Printer page orientation. Can be 'nil,
1206 indicating system default, 'portrait
1207 or 'landscape.
1208
1209 duplex Duplex printing mode, subject to printer
1210 support. Can be 'nil for the device default,
1211 'none for simplex printing, 'vertical or
1212 'horizontal for duplex page bound along
1213 the corresponding page direction.
1214
1215 See also `default-frame-plist', which specifies properties which apply
1216 to all frames, not just mswindows frames.
1217 */ );
1218 Vdefault_msprinter_frame_plist = Qnil;
1219
1220 msprinter_console_methods->device_specific_frame_props =
1221 &Vdefault_msprinter_frame_plist;
1222 }