diff options
Diffstat (limited to 'src/xfns.c')
| -rw-r--r-- | src/xfns.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/xfns.c b/src/xfns.c index 3f95f7b79fb..aad9680c4df 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Functions for the X window system. | 1 | /* Functions for the X window system. |
| 2 | 2 | ||
| 3 | Copyright (C) 1989, 1992-2015 Free Software Foundation, Inc. | 3 | Copyright (C) 1989, 1992-2016 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -6564,31 +6564,27 @@ present and mapped to the usual X keysyms. */) | |||
| 6564 | DEFUN ("x-export-frames", Fx_export_frames, Sx_export_frames, 0, 2, 0, | 6564 | DEFUN ("x-export-frames", Fx_export_frames, Sx_export_frames, 0, 2, 0, |
| 6565 | doc: /* Return image data of FRAMES in TYPE format. | 6565 | doc: /* Return image data of FRAMES in TYPE format. |
| 6566 | FRAMES should be nil (the selected frame), a frame, or a list of | 6566 | FRAMES should be nil (the selected frame), a frame, or a list of |
| 6567 | frames (each of which corresponds to one page). Optional arg TYPE | 6567 | frames (each of which corresponds to one page). Each frame should be |
| 6568 | should be either `pdf' (default), `png', `postscript', or `svg'. | 6568 | visible. Optional arg TYPE should be either `pdf' (default), `png', |
| 6569 | Supported types are determined by the compile-time configuration of | 6569 | `postscript', or `svg'. Supported types are determined by the |
| 6570 | cairo. */) | 6570 | compile-time configuration of cairo. */) |
| 6571 | (Lisp_Object frames, Lisp_Object type) | 6571 | (Lisp_Object frames, Lisp_Object type) |
| 6572 | { | 6572 | { |
| 6573 | Lisp_Object result, rest, tmp; | 6573 | Lisp_Object rest, tmp; |
| 6574 | cairo_surface_type_t surface_type; | 6574 | cairo_surface_type_t surface_type; |
| 6575 | 6575 | ||
| 6576 | if (NILP (frames)) | ||
| 6577 | frames = selected_frame; | ||
| 6578 | if (!CONSP (frames)) | 6576 | if (!CONSP (frames)) |
| 6579 | frames = list1 (frames); | 6577 | frames = list1 (frames); |
| 6580 | 6578 | ||
| 6581 | tmp = Qnil; | 6579 | tmp = Qnil; |
| 6582 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) | 6580 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) |
| 6583 | { | 6581 | { |
| 6584 | struct frame *f = XFRAME (XCAR (rest)); | 6582 | struct frame *f = decode_window_system_frame (XCAR (rest)); |
| 6585 | |||
| 6586 | if (! FRAME_LIVE_P (f) || ! FRAME_X_P (f) || ! FRAME_LIVE_P (f)) | ||
| 6587 | error ("Invalid frame"); | ||
| 6588 | |||
| 6589 | Lisp_Object frame; | 6583 | Lisp_Object frame; |
| 6590 | 6584 | ||
| 6591 | XSETFRAME (frame, f); | 6585 | XSETFRAME (frame, f); |
| 6586 | if (!FRAME_VISIBLE_P (f)) | ||
| 6587 | error ("Frames to be exported must be visible."); | ||
| 6592 | tmp = Fcons (frame, tmp); | 6588 | tmp = Fcons (frame, tmp); |
| 6593 | } | 6589 | } |
| 6594 | frames = Fnreverse (tmp); | 6590 | frames = Fnreverse (tmp); |
| @@ -6624,9 +6620,7 @@ cairo. */) | |||
| 6624 | #endif | 6620 | #endif |
| 6625 | error ("Unsupported export type"); | 6621 | error ("Unsupported export type"); |
| 6626 | 6622 | ||
| 6627 | result = x_cr_export_frames (frames, surface_type); | 6623 | return x_cr_export_frames (frames, surface_type); |
| 6628 | |||
| 6629 | return result; | ||
| 6630 | } | 6624 | } |
| 6631 | 6625 | ||
| 6632 | #ifdef USE_GTK | 6626 | #ifdef USE_GTK |
| @@ -6654,8 +6648,12 @@ The return value is an alist containing the following keys: | |||
| 6654 | on, in points. | 6648 | on, in points. |
| 6655 | 6649 | ||
| 6656 | The paper width can be obtained as the sum of width, left-margin, and | 6650 | The paper width can be obtained as the sum of width, left-margin, and |
| 6657 | right-margin values. Likewise, the paper height is the sum of height, | 6651 | right-margin values if the page orientation is `portrait' or |
| 6658 | top-margin, and bottom-margin values. */) | 6652 | `reverse-portrait'. Otherwise, it is the sum of width, top-margin, |
| 6653 | and bottom-margin values. Likewise, the paper height is the sum of | ||
| 6654 | height, top-margin, and bottom-margin values if the page orientation | ||
| 6655 | is `portrait' or `reverse-portrait'. Otherwise, it is the sum of | ||
| 6656 | height, left-margin, and right-margin values. */) | ||
| 6659 | (void) | 6657 | (void) |
| 6660 | { | 6658 | { |
| 6661 | Lisp_Object result; | 6659 | Lisp_Object result; |
| @@ -6675,29 +6673,29 @@ visible. */) | |||
| 6675 | (Lisp_Object frames) | 6673 | (Lisp_Object frames) |
| 6676 | { | 6674 | { |
| 6677 | Lisp_Object rest, tmp; | 6675 | Lisp_Object rest, tmp; |
| 6676 | int count; | ||
| 6678 | 6677 | ||
| 6679 | if (NILP (frames)) | ||
| 6680 | frames = selected_frame; | ||
| 6681 | if (!CONSP (frames)) | 6678 | if (!CONSP (frames)) |
| 6682 | frames = list1 (frames); | 6679 | frames = list1 (frames); |
| 6683 | 6680 | ||
| 6684 | tmp = Qnil; | 6681 | tmp = Qnil; |
| 6685 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) | 6682 | for (rest = frames; CONSP (rest); rest = XCDR (rest)) |
| 6686 | { | 6683 | { |
| 6687 | struct frame *f = XFRAME (XCAR (rest)); | 6684 | struct frame *f = decode_window_system_frame (XCAR (rest)); |
| 6688 | if (! FRAME_LIVE_P (f) || ! FRAME_X_P (f) || ! FRAME_LIVE_P (f)) | ||
| 6689 | error ("Invalid frame"); | ||
| 6690 | Lisp_Object frame; | 6685 | Lisp_Object frame; |
| 6691 | 6686 | ||
| 6692 | XSETFRAME (frame, f); | 6687 | XSETFRAME (frame, f); |
| 6693 | if (!EQ (Fframe_visible_p (frame), Qt)) | 6688 | if (!FRAME_VISIBLE_P (f)) |
| 6694 | error ("Frames to be printed must be visible."); | 6689 | error ("Frames to be printed must be visible."); |
| 6695 | tmp = Fcons (frame, tmp); | 6690 | tmp = Fcons (frame, tmp); |
| 6696 | } | 6691 | } |
| 6697 | frames = Fnreverse (tmp); | 6692 | frames = Fnreverse (tmp); |
| 6698 | 6693 | ||
| 6699 | /* Make sure the current matrices are up-to-date. */ | 6694 | /* Make sure the current matrices are up-to-date. */ |
| 6700 | Fredisplay (Qt); | 6695 | count = SPECPDL_INDEX (); |
| 6696 | specbind (Qredisplay_dont_pause, Qt); | ||
| 6697 | redisplay_preserve_echo_area (32); | ||
| 6698 | unbind_to (count, Qnil); | ||
| 6701 | 6699 | ||
| 6702 | block_input (); | 6700 | block_input (); |
| 6703 | xg_print_frames_dialog (frames); | 6701 | xg_print_frames_dialog (frames); |