emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/frame.c


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/frame.c
Date: Sat, 24 May 2003 17:57:45 -0400

Index: emacs/src/frame.c
diff -c emacs/src/frame.c:1.297 emacs/src/frame.c:1.298
*** emacs/src/frame.c:1.297     Mon May 19 10:38:44 2003
--- emacs/src/frame.c   Sat May 24 17:57:45 2003
***************
*** 126,138 ****
    struct window *w = XWINDOW (window);
  
    XSETFASTINT (w->last_modified, 0);
!   XSETFASTINT (w->top, XFASTINT (w->top) + n);
!   XSETFASTINT (w->height, XFASTINT (w->height) - n);
  
!   if (INTEGERP (w->orig_top))
!     XSETFASTINT (w->orig_top, XFASTINT (w->orig_top) + n);
!   if (INTEGERP (w->orig_height))
!     XSETFASTINT (w->orig_height, XFASTINT (w->orig_height) - n);
  
    /* Handle just the top child in a vertical split.  */
    if (!NILP (w->vchild))
--- 126,138 ----
    struct window *w = XWINDOW (window);
  
    XSETFASTINT (w->last_modified, 0);
!   XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n);
!   XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n);
  
!   if (INTEGERP (w->orig_top_line))
!     XSETFASTINT (w->orig_top_line, XFASTINT (w->orig_top_line) + n);
!   if (INTEGERP (w->orig_total_lines))
!     XSETFASTINT (w->orig_total_lines, XFASTINT (w->orig_total_lines) - n);
  
    /* Handle just the top child in a vertical split.  */
    if (!NILP (w->vchild))
***************
*** 285,290 ****
--- 285,301 ----
    f->tool_bar_items = Qnil;
    f->desired_tool_bar_string = f->current_tool_bar_string = Qnil;
    f->n_tool_bar_items = 0;
+   f->left_fringe_width = f->right_fringe_width = 0;
+   f->fringe_cols = 0;
+   f->scroll_bar_actual_width = 0;
+   f->border_width = 0;
+   f->internal_border_width = 0;
+   f->column_width = 1;  /* !FRAME_WINDOW_P value */
+   f->line_height = 1;  /* !FRAME_WINDOW_P value */
+   f->x_pixels_diff = f->y_pixels_diff = 0;
+   f->want_fullscreen = FULLSCREEN_NONE;
+   f->size_hint_flags = 0;
+   f->win_gravity = 0;
  
    root_window = make_window ();
    if (mini_p)
***************
*** 309,325 ****
       just so that there is "something there."
       Correct size will be set up later with change_frame_size.  */
  
!   SET_FRAME_WIDTH (f, 10);
!   f->height = 10;
  
!   XSETFASTINT (XWINDOW (root_window)->width, 10);
!   XSETFASTINT (XWINDOW (root_window)->height, (mini_p ? 9 : 10));
  
    if (mini_p)
      {
!       XSETFASTINT (XWINDOW (mini_window)->width, 10);
!       XSETFASTINT (XWINDOW (mini_window)->top, 9);
!       XSETFASTINT (XWINDOW (mini_window)->height, 1);
      }
  
    /* Choose a buffer for the frame's root window.  */
--- 320,336 ----
       just so that there is "something there."
       Correct size will be set up later with change_frame_size.  */
  
!   SET_FRAME_COLS (f, 10);
!   FRAME_LINES (f) = 10;
  
!   XSETFASTINT (XWINDOW (root_window)->total_cols, 10);
!   XSETFASTINT (XWINDOW (root_window)->total_lines, (mini_p ? 9 : 10));
  
    if (mini_p)
      {
!       XSETFASTINT (XWINDOW (mini_window)->total_cols, 10);
!       XSETFASTINT (XWINDOW (mini_window)->top_line, 9);
!       XSETFASTINT (XWINDOW (mini_window)->total_lines, 1);
      }
  
    /* Choose a buffer for the frame's root window.  */
***************
*** 339,345 ****
         don't have the right size, glyph matrices aren't initialized
         etc.  Running Lisp functions at this point surely ends in a
         SEGV.  */
!     set_window_buffer (root_window, buf, 0);
      f->buffer_list = Fcons (buf, Qnil);
    }
  
--- 350,356 ----
         don't have the right size, glyph matrices aren't initialized
         etc.  Running Lisp functions at this point surely ends in a
         SEGV.  */
!     set_window_buffer (root_window, buf, 0, 0);
      f->buffer_list = Fcons (buf, Qnil);
    }
  
***************
*** 350,356 ****
                         (NILP (Vminibuffer_list)
                          ? get_minibuffer (0)
                          : Fcar (Vminibuffer_list)),
!                        0);
      }
  
    f->root_window = root_window;
--- 361,367 ----
                         (NILP (Vminibuffer_list)
                          ? get_minibuffer (0)
                          : Fcar (Vminibuffer_list)),
!                        0, 0);
      }
  
    f->root_window = root_window;
***************
*** 415,421 ****
      Fset_window_buffer (mini_window,
                        (NILP (Vminibuffer_list)
                         ? get_minibuffer (0)
!                        : Fcar (Vminibuffer_list)));
    return f;
  }
  
--- 426,432 ----
      Fset_window_buffer (mini_window,
                        (NILP (Vminibuffer_list)
                         ? get_minibuffer (0)
!                        : Fcar (Vminibuffer_list)), Qnil);
    return f;
  }
  
***************
*** 453,459 ****
    Fset_window_buffer (mini_window,
                      (NILP (Vminibuffer_list)
                       ? get_minibuffer (0)
!                      : Fcar (Vminibuffer_list)));
    return f;
  }
  #endif /* HAVE_WINDOW_SYSTEM */
--- 464,470 ----
    Fset_window_buffer (mini_window,
                      (NILP (Vminibuffer_list)
                       ? get_minibuffer (0)
!                      : Fcar (Vminibuffer_list)), Qnil);
    return f;
  }
  #endif /* HAVE_WINDOW_SYSTEM */
***************
*** 573,580 ****
  
    f = make_terminal_frame ();
  
!   change_frame_size (f, FRAME_HEIGHT (sf),
!                    FRAME_WIDTH (sf), 0, 0, 0);
    adjust_glyphs (f);
    calculate_costs (f);
    XSETFRAME (frame, f);
--- 584,591 ----
  
    f = make_terminal_frame ();
  
!   change_frame_size (f, FRAME_LINES (sf),
!                    FRAME_COLS (sf), 0, 0, 0);
    adjust_glyphs (f);
    calculate_costs (f);
    XSETFRAME (frame, f);
***************
*** 1228,1234 ****
    if (EQ (f->minibuffer_window, minibuf_window))
      {
        Fset_window_buffer (sf->minibuffer_window,
!                         XWINDOW (minibuf_window)->buffer);
        minibuf_window = sf->minibuffer_window;
  
        /* If the dying minibuffer window was selected,
--- 1239,1245 ----
    if (EQ (f->minibuffer_window, minibuf_window))
      {
        Fset_window_buffer (sf->minibuffer_window,
!                         XWINDOW (minibuf_window)->buffer, Qnil);
        minibuf_window = sf->minibuffer_window;
  
        /* If the dying minibuffer window was selected,
***************
*** 1603,1609 ****
      {
        struct frame *sf = XFRAME (selected_frame);
        Fset_window_buffer (sf->minibuffer_window,
!                         XWINDOW (minibuf_window)->buffer);
        minibuf_window = sf->minibuffer_window;
      }
  
--- 1614,1620 ----
      {
        struct frame *sf = XFRAME (selected_frame);
        Fset_window_buffer (sf->minibuffer_window,
!                         XWINDOW (minibuf_window)->buffer, Qnil);
        minibuf_window = sf->minibuffer_window;
      }
  
***************
*** 1642,1648 ****
      {
        struct frame *sf = XFRAME (selected_frame);
        Fset_window_buffer (sf->minibuffer_window,
!                         XWINDOW (minibuf_window)->buffer);
        minibuf_window = sf->minibuffer_window;
      }
  
--- 1653,1659 ----
      {
        struct frame *sf = XFRAME (selected_frame);
        Fset_window_buffer (sf->minibuffer_window,
!                         XWINDOW (minibuf_window)->buffer, Qnil);
        minibuf_window = sf->minibuffer_window;
      }
  
***************
*** 2080,2088 ****
                                    :"tty"));
      }
    store_in_alist (&alist, Qname, f->name);
!   height = (FRAME_NEW_HEIGHT (f) ? FRAME_NEW_HEIGHT (f) : FRAME_HEIGHT (f));
    store_in_alist (&alist, Qheight, make_number (height));
!   width = (FRAME_NEW_WIDTH (f) ? FRAME_NEW_WIDTH (f) : FRAME_WIDTH (f));
    store_in_alist (&alist, Qwidth, make_number (width));
    store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : 
Qnil));
    store_in_alist (&alist, Qminibuffer,
--- 2091,2099 ----
                                    :"tty"));
      }
    store_in_alist (&alist, Qname, f->name);
!   height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f));
    store_in_alist (&alist, Qheight, make_number (height));
!   width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f));
    store_in_alist (&alist, Qwidth, make_number (width));
    store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : 
Qnil));
    store_in_alist (&alist, Qminibuffer,
***************
*** 2336,2342 ****
      return make_number (x_pixel_height (f));
    else
  #endif
!     return make_number (FRAME_HEIGHT (f));
  }
  
  DEFUN ("frame-pixel-width", Fframe_pixel_width,
--- 2347,2353 ----
      return make_number (x_pixel_height (f));
    else
  #endif
!     return make_number (FRAME_LINES (f));
  }
  
  DEFUN ("frame-pixel-width", Fframe_pixel_width,
***************
*** 2359,2365 ****
      return make_number (x_pixel_width (f));
    else
  #endif
!     return make_number (FRAME_WIDTH (f));
  }
  
  DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
--- 2370,2376 ----
      return make_number (x_pixel_width (f));
    else
  #endif
!     return make_number (FRAME_COLS (f));
  }
  
  DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
***************
*** 2381,2388 ****
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
      {
!       if (XINT (lines) != f->height)
!       x_set_window_size (f, 1, f->width, XINT (lines));
        do_pending_window_change (0);
      }
    else
--- 2392,2399 ----
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
      {
!       if (XINT (lines) != FRAME_LINES (f))
!       x_set_window_size (f, 1, FRAME_COLS (f), XINT (lines));
        do_pending_window_change (0);
      }
    else
***************
*** 2409,2416 ****
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
      {
!       if (XINT (cols) != f->width)
!       x_set_window_size (f, 1, XINT (cols), f->height);
        do_pending_window_change (0);
      }
    else
--- 2420,2427 ----
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
      {
!       if (XINT (cols) != FRAME_COLS (f))
!       x_set_window_size (f, 1, XINT (cols), FRAME_LINES (f));
        do_pending_window_change (0);
      }
    else
***************
*** 2435,2442 ****
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
      {
!       if (XINT (rows) != f->height || XINT (cols) != f->width
!         || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
        x_set_window_size (f, 1, XINT (cols), XINT (rows));
        do_pending_window_change (0);
      }
--- 2446,2454 ----
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
      {
!       if (XINT (rows) != FRAME_LINES (f)
!         || XINT (cols) != FRAME_COLS (f)
!         || f->new_text_lines || f->new_text_cols)
        x_set_window_size (f, 1, XINT (cols), XINT (rows));
        do_pending_window_change (0);
      }
***************
*** 2541,2572 ****
       int *top_pos;
       int *left_pos;
  {
!   int newwidth = f->width, newheight = f->height;
  
!   *top_pos = FRAME_X_OUTPUT (f)->top_pos;
!   *left_pos = FRAME_X_OUTPUT (f)->left_pos;
  
!   if (FRAME_X_OUTPUT (f)->want_fullscreen & FULLSCREEN_HEIGHT)
      {
        int ph;
  
        ph = FRAME_X_DISPLAY_INFO (f)->height;
!       newheight = PIXEL_TO_CHAR_HEIGHT (f, ph);
!       ph = CHAR_TO_PIXEL_HEIGHT (f, newheight)
!         - FRAME_X_OUTPUT (f)->y_pixels_diff;
!       newheight = PIXEL_TO_CHAR_HEIGHT (f, ph);
        *top_pos = 0;
      }
  
!   if (FRAME_X_OUTPUT (f)->want_fullscreen & FULLSCREEN_WIDTH)
      {
        int pw;
  
        pw = FRAME_X_DISPLAY_INFO (f)->width;
!       newwidth = PIXEL_TO_CHAR_WIDTH (f, pw);
!       pw = CHAR_TO_PIXEL_WIDTH (f, newwidth)
!         - FRAME_X_OUTPUT (f)->x_pixels_diff;
!       newwidth = PIXEL_TO_CHAR_WIDTH (f, pw);
        *left_pos = 0;
      }
  
--- 2553,2583 ----
       int *top_pos;
       int *left_pos;
  {
!   int newwidth = FRAME_COLS (f);
!   int newheight = FRAME_LINES (f);
  
!   *top_pos = f->top_pos;
!   *left_pos = f->left_pos;
  
!   if (f->want_fullscreen & FULLSCREEN_HEIGHT)
      {
        int ph;
  
        ph = FRAME_X_DISPLAY_INFO (f)->height;
!       newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
!       ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, newheight) - f->y_pixels_diff;
!       newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
        *top_pos = 0;
      }
  
!   if (f->want_fullscreen & FULLSCREEN_WIDTH)
      {
        int pw;
  
        pw = FRAME_X_DISPLAY_INFO (f)->width;
!       newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
!       pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, newwidth) - f->x_pixels_diff;
!       newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
        *left_pos = 0;
      }
  
***************
*** 2586,2593 ****
       int new_top;
       int new_left;
  {
!   if (new_top != FRAME_X_OUTPUT (f)->top_pos
!       || new_left != FRAME_X_OUTPUT (f)->left_pos)
      {
        int move_x = new_left;
        int move_y = new_top;
--- 2597,2603 ----
       int new_top;
       int new_left;
  {
!   if (new_top != f->top_pos || new_left != f->left_pos)
      {
        int move_x = new_left;
        int move_y = new_top;
***************
*** 2597,2603 ****
        move_y += FRAME_X_OUTPUT (f)->y_pixels_outer_diff;
  #endif
  
!       FRAME_X_OUTPUT (f)->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
        x_set_offset (f, move_x, move_y, 1);
      }
  }
--- 2607,2613 ----
        move_y += FRAME_X_OUTPUT (f)->y_pixels_outer_diff;
  #endif
  
!       f->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
        x_set_offset (f, move_x, move_y, 1);
      }
  }
***************
*** 2668,2682 ****
    icon_left = icon_top = Qunbound;
  
    /* Provide default values for HEIGHT and WIDTH.  */
!   if (FRAME_NEW_WIDTH (f))
!     width = FRAME_NEW_WIDTH (f);
!   else
!     width = FRAME_WIDTH (f);
! 
!   if (FRAME_NEW_HEIGHT (f))
!     height = FRAME_NEW_HEIGHT (f);
!   else
!     height = FRAME_HEIGHT (f);
  
    /* Process foreground_color and background_color before anything else.
       They are independent of other properties, but other properties (e.g.,
--- 2678,2685 ----
    icon_left = icon_top = Qunbound;
  
    /* Provide default values for HEIGHT and WIDTH.  */
!   width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f));
!   height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f));
  
    /* Process foreground_color and background_color before anything else.
       They are independent of other properties, but other properties (e.g.,
***************
*** 2760,2777 ****
    if (EQ (left, Qunbound))
      {
        left_no_change = 1;
!       if (FRAME_X_OUTPUT (f)->left_pos < 0)
!       left = Fcons (Qplus, Fcons (make_number (FRAME_X_OUTPUT (f)->left_pos), 
Qnil));
        else
!       XSETINT (left, FRAME_X_OUTPUT (f)->left_pos);
      }
    if (EQ (top, Qunbound))
      {
        top_no_change = 1;
!       if (FRAME_X_OUTPUT (f)->top_pos < 0)
!       top = Fcons (Qplus, Fcons (make_number (FRAME_X_OUTPUT (f)->top_pos), 
Qnil));
        else
!       XSETINT (top, FRAME_X_OUTPUT (f)->top_pos);
      }
  
    /* If one of the icon positions was not set, preserve or default it.  */
--- 2763,2780 ----
    if (EQ (left, Qunbound))
      {
        left_no_change = 1;
!       if (f->left_pos < 0)
!       left = Fcons (Qplus, Fcons (make_number (f->left_pos), Qnil));
        else
!       XSETINT (left, f->left_pos);
      }
    if (EQ (top, Qunbound))
      {
        top_no_change = 1;
!       if (f->top_pos < 0)
!       top = Fcons (Qplus, Fcons (make_number (f->top_pos), Qnil));
        else
!       XSETINT (top, f->top_pos);
      }
  
    /* If one of the icon positions was not set, preserve or default it.  */
***************
*** 2823,2857 ****
  
      XSETFRAME (frame, f);
  
!     if (width != FRAME_WIDTH (f)
!       || height != FRAME_HEIGHT (f)
!       || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
        Fset_frame_size (frame, make_number (width), make_number (height));
  
      if ((!NILP (left) || !NILP (top))
        && ! (left_no_change && top_no_change)
!       && ! (NUMBERP (left) && XINT (left) == FRAME_X_OUTPUT (f)->left_pos
!             && NUMBERP (top) && XINT (top) == FRAME_X_OUTPUT (f)->top_pos))
        {
        int leftpos = 0;
        int toppos = 0;
  
        /* Record the signs.  */
!       FRAME_X_OUTPUT (f)->size_hint_flags &= ~ (XNegative | YNegative);
        if (EQ (left, Qminus))
!         FRAME_X_OUTPUT (f)->size_hint_flags |= XNegative;
        else if (INTEGERP (left))
          {
            leftpos = XINT (left);
            if (leftpos < 0)
!             FRAME_X_OUTPUT (f)->size_hint_flags |= XNegative;
          }
        else if (CONSP (left) && EQ (XCAR (left), Qminus)
                 && CONSP (XCDR (left))
                 && INTEGERP (XCAR (XCDR (left))))
          {
            leftpos = - XINT (XCAR (XCDR (left)));
!           FRAME_X_OUTPUT (f)->size_hint_flags |= XNegative;
          }
        else if (CONSP (left) && EQ (XCAR (left), Qplus)
                 && CONSP (XCDR (left))
--- 2826,2860 ----
  
      XSETFRAME (frame, f);
  
!     if (width != FRAME_COLS (f)
!       || height != FRAME_LINES (f)
!       || f->new_text_lines || f->new_text_cols)
        Fset_frame_size (frame, make_number (width), make_number (height));
  
      if ((!NILP (left) || !NILP (top))
        && ! (left_no_change && top_no_change)
!       && ! (NUMBERP (left) && XINT (left) == f->left_pos
!             && NUMBERP (top) && XINT (top) == f->top_pos))
        {
        int leftpos = 0;
        int toppos = 0;
  
        /* Record the signs.  */
!       f->size_hint_flags &= ~ (XNegative | YNegative);
        if (EQ (left, Qminus))
!         f->size_hint_flags |= XNegative;
        else if (INTEGERP (left))
          {
            leftpos = XINT (left);
            if (leftpos < 0)
!             f->size_hint_flags |= XNegative;
          }
        else if (CONSP (left) && EQ (XCAR (left), Qminus)
                 && CONSP (XCDR (left))
                 && INTEGERP (XCAR (XCDR (left))))
          {
            leftpos = - XINT (XCAR (XCDR (left)));
!           f->size_hint_flags |= XNegative;
          }
        else if (CONSP (left) && EQ (XCAR (left), Qplus)
                 && CONSP (XCDR (left))
***************
*** 2861,2879 ****
          }
  
        if (EQ (top, Qminus))
!         FRAME_X_OUTPUT (f)->size_hint_flags |= YNegative;
        else if (INTEGERP (top))
          {
            toppos = XINT (top);
            if (toppos < 0)
!             FRAME_X_OUTPUT (f)->size_hint_flags |= YNegative;
          }
        else if (CONSP (top) && EQ (XCAR (top), Qminus)
                 && CONSP (XCDR (top))
                 && INTEGERP (XCAR (XCDR (top))))
          {
            toppos = - XINT (XCAR (XCDR (top)));
!           FRAME_X_OUTPUT (f)->size_hint_flags |= YNegative;
          }
        else if (CONSP (top) && EQ (XCAR (top), Qplus)
                 && CONSP (XCDR (top))
--- 2864,2882 ----
          }
  
        if (EQ (top, Qminus))
!         f->size_hint_flags |= YNegative;
        else if (INTEGERP (top))
          {
            toppos = XINT (top);
            if (toppos < 0)
!             f->size_hint_flags |= YNegative;
          }
        else if (CONSP (top) && EQ (XCAR (top), Qminus)
                 && CONSP (XCDR (top))
                 && INTEGERP (XCAR (XCDR (top))))
          {
            toppos = - XINT (XCAR (XCDR (top)));
!           f->size_hint_flags |= YNegative;
          }
        else if (CONSP (top) && EQ (XCAR (top), Qplus)
                 && CONSP (XCDR (top))
***************
*** 2884,2893 ****
  
  
        /* Store the numeric value of the position.  */
!       FRAME_X_OUTPUT (f)->top_pos = toppos;
!       FRAME_X_OUTPUT (f)->left_pos = leftpos;
  
!       FRAME_X_OUTPUT (f)->win_gravity = NorthWestGravity;
  
        /* Actually set that position, and convert to absolute.  */
        x_set_offset (f, leftpos, toppos, -1);
--- 2887,2896 ----
  
  
        /* Store the numeric value of the position.  */
!       f->top_pos = toppos;
!       f->left_pos = leftpos;
  
!       f->win_gravity = NorthWestGravity;
  
        /* Actually set that position, and convert to absolute.  */
        x_set_offset (f, leftpos, toppos, -1);
***************
*** 2918,2948 ****
  
    /* Represent negative positions (off the top or left screen edge)
       in a way that Fmodify_frame_parameters will understand correctly.  */
!   XSETINT (tem, FRAME_X_OUTPUT (f)->left_pos);
!   if (FRAME_X_OUTPUT (f)->left_pos >= 0)
      store_in_alist (alistptr, Qleft, tem);
    else
      store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil)));
  
!   XSETINT (tem, FRAME_X_OUTPUT (f)->top_pos);
!   if (FRAME_X_OUTPUT (f)->top_pos >= 0)
      store_in_alist (alistptr, Qtop, tem);
    else
      store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil)));
  
    store_in_alist (alistptr, Qborder_width,
!                 make_number (FRAME_X_OUTPUT (f)->border_width));
    store_in_alist (alistptr, Qinternal_border_width,
!                 make_number (FRAME_X_OUTPUT (f)->internal_border_width));
    store_in_alist (alistptr, Qleft_fringe,
!                 make_number (FRAME_X_OUTPUT (f)->left_fringe_width));
    store_in_alist (alistptr, Qright_fringe,
!                 make_number (FRAME_X_OUTPUT (f)->right_fringe_width));
    store_in_alist (alistptr, Qscroll_bar_width,
                  (! FRAME_HAS_VERTICAL_SCROLL_BARS (f)
                   ? make_number (0)
!                  : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
!                  ? make_number (FRAME_SCROLL_BAR_PIXEL_WIDTH (f))
                   /* nil means "use default width"
                      for non-toolkit scroll bar.
                      ruler-mode.el depends on this.  */
--- 2921,2951 ----
  
    /* Represent negative positions (off the top or left screen edge)
       in a way that Fmodify_frame_parameters will understand correctly.  */
!   XSETINT (tem, f->left_pos);
!   if (f->left_pos >= 0)
      store_in_alist (alistptr, Qleft, tem);
    else
      store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil)));
  
!   XSETINT (tem, f->top_pos);
!   if (f->top_pos >= 0)
      store_in_alist (alistptr, Qtop, tem);
    else
      store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil)));
  
    store_in_alist (alistptr, Qborder_width,
!                 make_number (f->border_width));
    store_in_alist (alistptr, Qinternal_border_width,
!                 make_number (FRAME_INTERNAL_BORDER_WIDTH (f)));
    store_in_alist (alistptr, Qleft_fringe,
!                 make_number (FRAME_LEFT_FRINGE_WIDTH (f)));
    store_in_alist (alistptr, Qright_fringe,
!                 make_number (FRAME_RIGHT_FRINGE_WIDTH (f)));
    store_in_alist (alistptr, Qscroll_bar_width,
                  (! FRAME_HAS_VERTICAL_SCROLL_BARS (f)
                   ? make_number (0)
!                  : FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0
!                  ? make_number (FRAME_CONFIG_SCROLL_BAR_WIDTH (f))
                   /* nil means "use default width"
                      for non-toolkit scroll bar.
                      ruler-mode.el depends on this.  */
***************
*** 2988,3000 ****
  {
  #ifndef HAVE_CARBON
    if (NILP (new_value))
!     FRAME_X_OUTPUT (f)->want_fullscreen = FULLSCREEN_NONE;
    else if (EQ (new_value, Qfullboth))
!     FRAME_X_OUTPUT (f)->want_fullscreen = FULLSCREEN_BOTH;
    else if (EQ (new_value, Qfullwidth))
!     FRAME_X_OUTPUT (f)->want_fullscreen = FULLSCREEN_WIDTH;
    else if (EQ (new_value, Qfullheight))
!     FRAME_X_OUTPUT (f)->want_fullscreen = FULLSCREEN_HEIGHT;
  #endif
  }
  
--- 2991,3003 ----
  {
  #ifndef HAVE_CARBON
    if (NILP (new_value))
!     f->want_fullscreen = FULLSCREEN_NONE;
    else if (EQ (new_value, Qfullboth))
!     f->want_fullscreen = FULLSCREEN_BOTH;
    else if (EQ (new_value, Qfullwidth))
!     f->want_fullscreen = FULLSCREEN_WIDTH;
    else if (EQ (new_value, Qfullheight))
!     f->want_fullscreen = FULLSCREEN_HEIGHT;
  #endif
  }
  
***************
*** 3112,3118 ****
  {
    CHECK_NUMBER (arg);
  
!   if (XINT (arg) == FRAME_X_OUTPUT (f)->border_width)
      return;
  
  #ifndef HAVE_CARBON
--- 3115,3121 ----
  {
    CHECK_NUMBER (arg);
  
!   if (XINT (arg) == f->border_width)
      return;
  
  #ifndef HAVE_CARBON
***************
*** 3120,3126 ****
      error ("Cannot change the border width of a window");
  #endif /* MAC_TODO */
  
!   FRAME_X_OUTPUT (f)->border_width = XINT (arg);
  }
  
  void
--- 3123,3129 ----
      error ("Cannot change the border width of a window");
  #endif /* MAC_TODO */
  
!   f->border_width = XINT (arg);
  }
  
  void
***************
*** 3128,3151 ****
       struct frame *f;
       Lisp_Object arg, oldval;
  {
!   int old = FRAME_X_OUTPUT (f)->internal_border_width;
  
    CHECK_NUMBER (arg);
!   FRAME_X_OUTPUT (f)->internal_border_width = XINT (arg);
!   if (FRAME_X_OUTPUT (f)->internal_border_width < 0)
!     FRAME_X_OUTPUT (f)->internal_border_width = 0;
  
  #ifdef USE_X_TOOLKIT
    if (FRAME_X_OUTPUT (f)->edit_widget)
      widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget);
  #endif
  
!   if (FRAME_X_OUTPUT (f)->internal_border_width == old)
      return;
  
    if (FRAME_X_WINDOW (f) != 0)
      {
!       x_set_window_size (f, 0, f->width, f->height);
        SET_FRAME_GARBAGED (f);
        do_pending_window_change (0);
      }
--- 3131,3154 ----
       struct frame *f;
       Lisp_Object arg, oldval;
  {
!   int old = FRAME_INTERNAL_BORDER_WIDTH (f);
  
    CHECK_NUMBER (arg);
!   FRAME_INTERNAL_BORDER_WIDTH (f) = XINT (arg);
!   if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0)
!     FRAME_INTERNAL_BORDER_WIDTH (f) = 0;
  
  #ifdef USE_X_TOOLKIT
    if (FRAME_X_OUTPUT (f)->edit_widget)
      widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget);
  #endif
  
!   if (FRAME_INTERNAL_BORDER_WIDTH (f) == old)
      return;
  
    if (FRAME_X_WINDOW (f) != 0)
      {
!       x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
        SET_FRAME_GARBAGED (f);
        do_pending_window_change (0);
      }
***************
*** 3223,3229 ****
         However, if the window hasn't been created yet, we shouldn't
         call x_set_window_size.  */
        if (FRAME_X_WINDOW (f))
!       x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
        do_pending_window_change (0);
      }
  }
--- 3226,3232 ----
         However, if the window hasn't been created yet, we shouldn't
         call x_set_window_size.  */
        if (FRAME_X_WINDOW (f))
!       x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
        do_pending_window_change (0);
      }
  }
***************
*** 3233,3262 ****
       struct frame *f;
       Lisp_Object arg, oldval;
  {
!   int wid = FONT_WIDTH (FRAME_FONT (f));
  
    if (NILP (arg))
      {
        x_set_scroll_bar_default_width (f);
  
        if (FRAME_X_WINDOW (f))
!         x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
        do_pending_window_change (0);
      }
    else if (INTEGERP (arg) && XINT (arg) > 0
!          && XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f))
      {
        if (XFASTINT (arg) <= 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM)
        XSETINT (arg, 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM + 1);
  
!       FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = XFASTINT (arg);
!       FRAME_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
        if (FRAME_X_WINDOW (f))
!       x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
        do_pending_window_change (0);
      }
  
!   change_frame_size (f, 0, FRAME_WIDTH (f), 0, 0, 0);
    XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0;
    XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0;
  }
--- 3236,3265 ----
       struct frame *f;
       Lisp_Object arg, oldval;
  {
!   int wid = FRAME_COLUMN_WIDTH (f);
  
    if (NILP (arg))
      {
        x_set_scroll_bar_default_width (f);
  
        if (FRAME_X_WINDOW (f))
!         x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
        do_pending_window_change (0);
      }
    else if (INTEGERP (arg) && XINT (arg) > 0
!          && XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_WIDTH (f))
      {
        if (XFASTINT (arg) <= 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM)
        XSETINT (arg, 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM + 1);
  
!       FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFASTINT (arg);
!       FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
        if (FRAME_X_WINDOW (f))
!       x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
        do_pending_window_change (0);
      }
  
!   change_frame_size (f, 0, FRAME_COLS (f), 0, 0, 0);
    XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0;
    XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0;
  }
***************
*** 3706,3723 ****
    /* Default values if we fall through.
       Actually, if that happens we should get
       window manager prompting.  */
!   SET_FRAME_WIDTH (f, DEFAULT_COLS);
!   f->height = DEFAULT_ROWS;
    /* Window managers expect that if program-specified
       positions are not (0,0), they're intentional, not defaults.  */
!   FRAME_X_OUTPUT (f)->top_pos = 0;
!   FRAME_X_OUTPUT (f)->left_pos = 0;
  
!   /* Ensure that old new_width and new_height will not override the
       values set here.  */
    /* ++KFS: This was specific to W32, but seems ok for all platforms */
!   FRAME_NEW_WIDTH (f) = 0;
!   FRAME_NEW_HEIGHT (f) = 0;
  
    tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
    tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
--- 3709,3725 ----
    /* Default values if we fall through.
       Actually, if that happens we should get
       window manager prompting.  */
!   SET_FRAME_COLS (f, DEFAULT_COLS);
!   FRAME_LINES (f) = DEFAULT_ROWS;
    /* Window managers expect that if program-specified
       positions are not (0,0), they're intentional, not defaults.  */
!   f->top_pos = 0;
!   f->left_pos = 0;
  
!   /* Ensure that old new_text_cols and new_text_lines will not override the
       values set here.  */
    /* ++KFS: This was specific to W32, but seems ok for all platforms */
!   f->new_text_cols = f->new_text_lines = 0;
  
    tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
    tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
***************
*** 3727,3738 ****
        if (!EQ (tem0, Qunbound))
        {
          CHECK_NUMBER (tem0);
!         f->height = XINT (tem0);
        }
        if (!EQ (tem1, Qunbound))
        {
          CHECK_NUMBER (tem1);
!         SET_FRAME_WIDTH (f, XINT (tem1));
        }
        if (!NILP (tem2) && !EQ (tem2, Qunbound))
        window_prompting |= USSize;
--- 3729,3740 ----
        if (!EQ (tem0, Qunbound))
        {
          CHECK_NUMBER (tem0);
!         FRAME_LINES (f) = XINT (tem0);
        }
        if (!EQ (tem1, Qunbound))
        {
          CHECK_NUMBER (tem1);
!         SET_FRAME_COLS (f, XINT (tem1));
        }
        if (!NILP (tem2) && !EQ (tem2, Qunbound))
        window_prompting |= USSize;
***************
*** 3740,3754 ****
        window_prompting |= PSize;
      }
  
!   FRAME_X_OUTPUT (f)->vertical_scroll_bar_extra
!     = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
!        ? 0
! #ifndef HAVE_X_WINDOWS
!        /* +KFS: This was specific for W32 and MAC.. why?  */
!        : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
!        ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
! #endif
!        : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (FRAME_X_OUTPUT (f)->font)));
  
    /* This used to be done _before_ calling x_figure_window_size, but
       since the height is reset here, this was really a no-op.  I
--- 3742,3749 ----
        window_prompting |= PSize;
      }
  
!   f->scroll_bar_actual_width
!     = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
  
    /* This used to be done _before_ calling x_figure_window_size, but
       since the height is reset here, this was really a no-op.  I
***************
*** 3780,3792 ****
        margin = 0;
  
        bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
!       f->height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f);
      }
  
    compute_fringe_widths (f, 0);
  
!   FRAME_X_OUTPUT (f)->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
!   FRAME_X_OUTPUT (f)->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
  
    tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
    tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
--- 3775,3787 ----
        margin = 0;
  
        bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
!       FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / 
FRAME_LINE_HEIGHT (f);
      }
  
    compute_fringe_widths (f, 0);
  
!   FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, FRAME_COLS (f));
!   FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES 
(f));
  
    tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
    tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
***************
*** 3795,3851 ****
      {
        if (EQ (tem0, Qminus))
        {
!         FRAME_X_OUTPUT (f)->top_pos = 0;
          window_prompting |= YNegative;
        }
        else if (CONSP (tem0) && EQ (XCAR (tem0), Qminus)
               && CONSP (XCDR (tem0))
               && INTEGERP (XCAR (XCDR (tem0))))
        {
!         FRAME_X_OUTPUT (f)->top_pos = - XINT (XCAR (XCDR (tem0)));
          window_prompting |= YNegative;
        }
        else if (CONSP (tem0) && EQ (XCAR (tem0), Qplus)
               && CONSP (XCDR (tem0))
               && INTEGERP (XCAR (XCDR (tem0))))
        {
!         FRAME_X_OUTPUT (f)->top_pos = XINT (XCAR (XCDR (tem0)));
        }
        else if (EQ (tem0, Qunbound))
!       FRAME_X_OUTPUT (f)->top_pos = 0;
        else
        {
          CHECK_NUMBER (tem0);
!         FRAME_X_OUTPUT (f)->top_pos = XINT (tem0);
!         if (FRAME_X_OUTPUT (f)->top_pos < 0)
            window_prompting |= YNegative;
        }
  
        if (EQ (tem1, Qminus))
        {
!         FRAME_X_OUTPUT (f)->left_pos = 0;
          window_prompting |= XNegative;
        }
        else if (CONSP (tem1) && EQ (XCAR (tem1), Qminus)
               && CONSP (XCDR (tem1))
               && INTEGERP (XCAR (XCDR (tem1))))
        {
!         FRAME_X_OUTPUT (f)->left_pos = - XINT (XCAR (XCDR (tem1)));
          window_prompting |= XNegative;
        }
        else if (CONSP (tem1) && EQ (XCAR (tem1), Qplus)
               && CONSP (XCDR (tem1))
               && INTEGERP (XCAR (XCDR (tem1))))
        {
!         FRAME_X_OUTPUT (f)->left_pos = XINT (XCAR (XCDR (tem1)));
        }
        else if (EQ (tem1, Qunbound))
!       FRAME_X_OUTPUT (f)->left_pos = 0;
        else
        {
          CHECK_NUMBER (tem1);
!         FRAME_X_OUTPUT (f)->left_pos = XINT (tem1);
!         if (FRAME_X_OUTPUT (f)->left_pos < 0)
            window_prompting |= XNegative;
        }
  
--- 3790,3846 ----
      {
        if (EQ (tem0, Qminus))
        {
!         f->top_pos = 0;
          window_prompting |= YNegative;
        }
        else if (CONSP (tem0) && EQ (XCAR (tem0), Qminus)
               && CONSP (XCDR (tem0))
               && INTEGERP (XCAR (XCDR (tem0))))
        {
!         f->top_pos = - XINT (XCAR (XCDR (tem0)));
          window_prompting |= YNegative;
        }
        else if (CONSP (tem0) && EQ (XCAR (tem0), Qplus)
               && CONSP (XCDR (tem0))
               && INTEGERP (XCAR (XCDR (tem0))))
        {
!         f->top_pos = XINT (XCAR (XCDR (tem0)));
        }
        else if (EQ (tem0, Qunbound))
!       f->top_pos = 0;
        else
        {
          CHECK_NUMBER (tem0);
!         f->top_pos = XINT (tem0);
!         if (f->top_pos < 0)
            window_prompting |= YNegative;
        }
  
        if (EQ (tem1, Qminus))
        {
!         f->left_pos = 0;
          window_prompting |= XNegative;
        }
        else if (CONSP (tem1) && EQ (XCAR (tem1), Qminus)
               && CONSP (XCDR (tem1))
               && INTEGERP (XCAR (XCDR (tem1))))
        {
!         f->left_pos = - XINT (XCAR (XCDR (tem1)));
          window_prompting |= XNegative;
        }
        else if (CONSP (tem1) && EQ (XCAR (tem1), Qplus)
               && CONSP (XCDR (tem1))
               && INTEGERP (XCAR (XCDR (tem1))))
        {
!         f->left_pos = XINT (XCAR (XCDR (tem1)));
        }
        else if (EQ (tem1, Qunbound))
!       f->left_pos = 0;
        else
        {
          CHECK_NUMBER (tem1);
!         f->left_pos = XINT (tem1);
!         if (f->left_pos < 0)
            window_prompting |= XNegative;
        }
  
***************
*** 3855,3861 ****
        window_prompting |= PPosition;
      }
  
!   if (FRAME_X_OUTPUT (f)->want_fullscreen != FULLSCREEN_NONE)
      {
        int left, top;
        int width, height;
--- 3850,3856 ----
        window_prompting |= PPosition;
      }
  
!   if (f->want_fullscreen != FULLSCREEN_NONE)
      {
        int left, top;
        int width, height;
***************
*** 3863,3892 ****
        /* It takes both for some WM:s to place it where we want */
        window_prompting = USPosition | PPosition;
        x_fullscreen_adjust (f, &width, &height, &top, &left);
!       f->width = width;
!       f->height = height;
!       FRAME_X_OUTPUT (f)->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
!       FRAME_X_OUTPUT (f)->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
!       FRAME_X_OUTPUT (f)->left_pos = left;
!       FRAME_X_OUTPUT (f)->top_pos = top;
      }
  
    if (window_prompting & XNegative)
      {
        if (window_prompting & YNegative)
!       FRAME_X_OUTPUT (f)->win_gravity = SouthEastGravity;
        else
!       FRAME_X_OUTPUT (f)->win_gravity = NorthEastGravity;
      }
    else
      {
        if (window_prompting & YNegative)
!       FRAME_X_OUTPUT (f)->win_gravity = SouthWestGravity;
        else
!       FRAME_X_OUTPUT (f)->win_gravity = NorthWestGravity;
      }
  
!   FRAME_X_OUTPUT (f)->size_hint_flags = window_prompting;
  
    return window_prompting;
  }
--- 3858,3887 ----
        /* It takes both for some WM:s to place it where we want */
        window_prompting = USPosition | PPosition;
        x_fullscreen_adjust (f, &width, &height, &top, &left);
!       FRAME_COLS (f) = width;
!       FRAME_LINES (f) = height;
!       FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
!       FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
!       f->left_pos = left;
!       f->top_pos = top;
      }
  
    if (window_prompting & XNegative)
      {
        if (window_prompting & YNegative)
!       f->win_gravity = SouthEastGravity;
        else
!       f->win_gravity = NorthEastGravity;
      }
    else
      {
        if (window_prompting & YNegative)
!       f->win_gravity = SouthWestGravity;
        else
!       f->win_gravity = NorthWestGravity;
      }
  
!   f->size_hint_flags = window_prompting;
  
    return window_prompting;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]