comparison src/frame.c @ 863:42375619fa45

[xemacs-hg @ 2002-06-04 06:03:59 by andyp] merge 21.4 windows changes, minimally tested
author andyp
date Tue, 04 Jun 2002 06:05:53 +0000
parents 2b6fa2618f76
children 804517e16990
comparison
equal deleted inserted replaced
862:278c743f1578 863:42375619fa45
116 other way of getting it if it isn't the selected frame. */ 116 other way of getting it if it isn't the selected frame. */
117 Lisp_Object Vframe_being_created; 117 Lisp_Object Vframe_being_created;
118 Lisp_Object Qframe_being_created; 118 Lisp_Object Qframe_being_created;
119 119
120 static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val); 120 static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val);
121 static void frame_conversion_internal (struct frame *f, int pixel_to_char,
122 int *pixel_width, int *pixel_height,
123 int *char_width, int *char_height,
124 int real_face);
121 static struct display_line title_string_display_line; 125 static struct display_line title_string_display_line;
122 /* Used by generate_title_string. Global because they get used so much that 126 /* Used by generate_title_string. Global because they get used so much that
123 the dynamic allocation time adds up. */ 127 the dynamic allocation time adds up. */
124 static Emchar_dynarr *title_string_emchar_dynarr; 128 static Emchar_dynarr *title_string_emchar_dynarr;
125 129
2690 2694
2691 internal_set_frame_size (f, width, height, !NILP (pretend)); 2695 internal_set_frame_size (f, width, height, !NILP (pretend));
2692 return frame; 2696 return frame;
2693 } 2697 }
2694 2698
2699 DEFUN ("set-frame-pixel-height", Fset_frame_pixel_height, 2, 3, 0, /*
2700 Specify that the frame FRAME is HEIGHT pixels tall.
2701 Optional third arg non-nil means that redisplay should be HEIGHT pixels tall
2702 but that the idea of the actual height of the frame should not be changed.
2703 */
2704 (frame, height, pretend))
2705 {
2706 struct frame *f = decode_frame (frame);
2707 int pheight, width;
2708 frame = wrap_frame (f);
2709 CHECK_INT (height);
2710
2711 if (!window_system_pixelated_geometry (frame))
2712 {
2713 int h = XINT (height);
2714 width = FRAME_WIDTH (f);
2715 /* Simply using pixel_to_real_char_size here is not good
2716 enough since we end up with a total frame size of HEIGHT
2717 rather than a displayable height of HEIGHT. */
2718 frame_conversion_internal (f, 2, 0, &h, 0, &pheight, 0);
2719 }
2720 else
2721 {
2722 width = FRAME_PIXWIDTH (f);
2723 pheight = XINT (height);
2724 }
2725
2726 internal_set_frame_size (f, width, pheight, !NILP (pretend));
2727 return frame;
2728 }
2729
2695 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /* 2730 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /*
2696 Specify that the frame FRAME has COLS columns. 2731 Specify that the frame FRAME has COLS columns.
2697 Optional third arg non-nil means that redisplay should use COLS columns 2732 Optional third arg non-nil means that redisplay should use COLS columns
2698 but that the idea of the actual width of the frame should not be changed. 2733 but that the idea of the actual width of the frame should not be changed.
2699 */ 2734 */
2714 width = XINT (cols); 2749 width = XINT (cols);
2715 height = FRAME_HEIGHT (f); 2750 height = FRAME_HEIGHT (f);
2716 } 2751 }
2717 2752
2718 internal_set_frame_size (f, width, height, !NILP (pretend)); 2753 internal_set_frame_size (f, width, height, !NILP (pretend));
2754 return frame;
2755 }
2756
2757 DEFUN ("set-frame-pixel-width", Fset_frame_pixel_width, 2, 3, 0, /*
2758 Specify that the frame FRAME is WIDTH pixels wide.
2759 Optional third arg non-nil means that redisplay should be WIDTH wide
2760 but that the idea of the actual height of the frame should not be changed.
2761 */
2762 (frame, width, pretend))
2763 {
2764 struct frame *f = decode_frame (frame);
2765 int height, pwidth;
2766 frame = wrap_frame (f);
2767 CHECK_INT (width);
2768
2769 if (!window_system_pixelated_geometry (frame))
2770 {
2771 int w = XINT (width);
2772 height = FRAME_HEIGHT (f);
2773 /* Simply using pixel_to_real_char_size here is not good
2774 enough since we end up with a total frame size of WIDTH
2775 rather than a displayable height of WIDTH. */
2776 frame_conversion_internal (f, 2, &w, 0, &pwidth, 0, 0);
2777 }
2778 else
2779 {
2780 height = FRAME_PIXHEIGHT (f);
2781 pwidth = XINT (width);
2782 }
2783
2784 internal_set_frame_size (f, pwidth, height, !NILP (pretend));
2719 return frame; 2785 return frame;
2720 } 2786 }
2721 2787
2722 DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /* 2788 DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /*
2723 Set the size of FRAME to COLS by ROWS, measured in characters. 2789 Set the size of FRAME to COLS by ROWS, measured in characters.
2739 height = XINT (rows); 2805 height = XINT (rows);
2740 width = XINT (cols); 2806 width = XINT (cols);
2741 } 2807 }
2742 2808
2743 internal_set_frame_size (f, width, height, !NILP (pretend)); 2809 internal_set_frame_size (f, width, height, !NILP (pretend));
2810 return frame;
2811 }
2812
2813 DEFUN ("set-frame-pixel-size", Fset_frame_pixel_size, 3, 4, 0, /*
2814 Set the size of FRAME to WIDTH by HEIGHT, measured in pixels.
2815 Optional fourth arg non-nil means that redisplay should use WIDTH by HEIGHT
2816 but that the idea of the actual size of the frame should not be changed.
2817 */
2818 (frame, width, height, pretend))
2819 {
2820 struct frame *f = decode_frame (frame);
2821 int pheight, pwidth;
2822 frame = wrap_frame (f);
2823 CHECK_INT (width);
2824 CHECK_INT (height);
2825
2826 if (!window_system_pixelated_geometry (frame))
2827 {
2828 int w = XINT (width);
2829 int h = XINT (height);
2830 /* Simply using pixel_to_real_char_size here is not good enough
2831 since we end up with a total frame size of WIDTH x HEIGHT
2832 rather than a displayable height of WIDTH x HEIGHT. */
2833 frame_conversion_internal (f, 2, &w, &h, &pwidth, &pheight, 0);
2834 }
2835 else
2836 {
2837 pheight = XINT (height);
2838 pwidth = XINT (width);
2839 }
2840
2841 internal_set_frame_size (f, pwidth, pheight, !NILP (pretend));
2744 return frame; 2842 return frame;
2745 } 2843 }
2746 2844
2747 DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /* 2845 DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /*
2748 Set position of FRAME in pixels to XOFFSET by YOFFSET. 2846 Set position of FRAME in pixels to XOFFSET by YOFFSET.
2798 obh = FRAME_SCROLLBAR_HEIGHT (f) + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) + 2896 obh = FRAME_SCROLLBAR_HEIGHT (f) + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) +
2799 FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) + 2897 FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) +
2800 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) + 2898 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) +
2801 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); 2899 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
2802 2900
2803 if (pixel_to_char) 2901 /* Convert to chars so that the displayable area is pixel_width x
2902 pixel_height.
2903
2904 #### Consider rounding up to 0.5 characters to avoid adding too
2905 much space. */
2906 if (pixel_to_char > 1)
2907 {
2908 if (char_width)
2909 *char_width = ROUND_UP (*pixel_width, cpw) / cpw;
2910 if (char_height)
2911 *char_height = ROUND_UP (*pixel_height, cph) / cph;
2912 }
2913 /* Convert to chars so that the total frame size is pixel_width x
2914 pixel_height. */
2915 else if (pixel_to_char)
2804 { 2916 {
2805 if (char_width) 2917 if (char_width)
2806 *char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw; 2918 *char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw;
2807 if (char_height) 2919 if (char_height)
2808 *char_height = (*pixel_height - bdr - obh) / cph; 2920 *char_height = (*pixel_height - bdr - obh) / cph;
3360 DEFSUBR (Fframe_name); 3472 DEFSUBR (Fframe_name);
3361 DEFSUBR (Fframe_modified_tick); 3473 DEFSUBR (Fframe_modified_tick);
3362 DEFSUBR (Fset_frame_height); 3474 DEFSUBR (Fset_frame_height);
3363 DEFSUBR (Fset_frame_width); 3475 DEFSUBR (Fset_frame_width);
3364 DEFSUBR (Fset_frame_size); 3476 DEFSUBR (Fset_frame_size);
3477 DEFSUBR (Fset_frame_pixel_height);
3478 DEFSUBR (Fset_frame_pixel_width);
3479 DEFSUBR (Fset_frame_pixel_size);
3365 DEFSUBR (Fset_frame_position); 3480 DEFSUBR (Fset_frame_position);
3366 DEFSUBR (Fset_frame_pointer); 3481 DEFSUBR (Fset_frame_pointer);
3367 DEFSUBR (Fprint_job_page_number); 3482 DEFSUBR (Fprint_job_page_number);
3368 DEFSUBR (Fprint_job_eject_page); 3483 DEFSUBR (Fprint_job_eject_page);
3369 } 3484 }