/[emacs]/emacs/src/widget.c
ViewVC logotype

Diff of /emacs/src/widget.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.68 by kfstorm, Wed Mar 12 12:12:25 2003 UTC revision 1.69 by kfstorm, Sat May 24 22:07:03 2003 UTC
# Line 183  get_default_char_pixel_size (ew, pixel_w Line 183  get_default_char_pixel_size (ew, pixel_w
183       int* pixel_height;       int* pixel_height;
184  {  {
185    struct frame* f = ew->emacs_frame.frame;    struct frame* f = ew->emacs_frame.frame;
186    *pixel_width = FONT_WIDTH (f->output_data.x->font);    *pixel_width = FRAME_COLUMN_WIDTH (f);
187    *pixel_height = f->output_data.x->line_height;    *pixel_height = FRAME_LINE_HEIGHT (f);
188  }  }
189    
190  static void  static void
# Line 196  pixel_to_char_size (ew, pixel_width, pix Line 196  pixel_to_char_size (ew, pixel_width, pix
196       int* char_height;       int* char_height;
197  {  {
198    struct frame* f = ew->emacs_frame.frame;    struct frame* f = ew->emacs_frame.frame;
199    *char_width = PIXEL_TO_CHAR_WIDTH (f, (int) pixel_width);    *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
200    *char_height = PIXEL_TO_CHAR_HEIGHT (f, (int) pixel_height);    *char_height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_height);
201  }  }
202    
203  static void  static void
# Line 209  char_to_pixel_size (ew, char_width, char Line 209  char_to_pixel_size (ew, char_width, char
209       Dimension* pixel_height;       Dimension* pixel_height;
210  {  {
211    struct frame* f = ew->emacs_frame.frame;    struct frame* f = ew->emacs_frame.frame;
212    *pixel_width = CHAR_TO_PIXEL_WIDTH (f, char_width);    *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width);
213    *pixel_height = CHAR_TO_PIXEL_HEIGHT (f, char_height);    *pixel_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, char_height);
214  }  }
215    
216  static void  static void
# Line 305  set_frame_size (ew) Line 305  set_frame_size (ew)
305     */     */
306    
307    /* Hairily merged geometry */    /* Hairily merged geometry */
308    unsigned int w = ew->emacs_frame.frame->width;    unsigned int w = FRAME_COLS (ew->emacs_frame.frame);
309    unsigned int h = ew->emacs_frame.frame->height;    unsigned int h = FRAME_LINES (ew->emacs_frame.frame);
310    
311    Widget wmshell = get_wm_shell ((Widget) ew);    Widget wmshell = get_wm_shell ((Widget) ew);
312    /* Each Emacs shell is now independent and top-level.  */    /* Each Emacs shell is now independent and top-level.  */
# Line 420  set_frame_size (ew) Line 420  set_frame_size (ew)
420      }      }
421  #endif /* 0 */  #endif /* 0 */
422    {    {
423      struct frame* frame = ew->emacs_frame.frame;      struct frame *f = ew->emacs_frame.frame;
424      Dimension pixel_width, pixel_height;      Dimension pixel_width, pixel_height;
425    
426      /* Take into account the size of the scrollbar.  Always use the      /* Take into account the size of the scrollbar.  Always use the
# Line 428  set_frame_size (ew) Line 428  set_frame_size (ew)
428         might end up with a frame width that is not a multiple of the         might end up with a frame width that is not a multiple of the
429         frame's character width which is bad for vertically split         frame's character width which is bad for vertically split
430         windows.  */         windows.  */
431      frame->output_data.x->vertical_scroll_bar_extra      f->scroll_bar_actual_width
432        = (!FRAME_HAS_VERTICAL_SCROLL_BARS (frame)        = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
          ? 0  
          : (FRAME_SCROLL_BAR_COLS (frame)  
             * FONT_WIDTH (frame->output_data.x->font)));  
433    
434      compute_fringe_widths (frame, 0);      compute_fringe_widths (f, 0);
435    
436  #if 0 /* This can run Lisp code, and it is dangerous to give  #if 0 /* This can run Lisp code, and it is dangerous to give
437           out the frame to Lisp code before it officially exists.           out the frame to Lisp code before it officially exists.
438           This is handled in Fx_create_frame so not needed here.  */           This is handled in Fx_create_frame so not needed here.  */
439      change_frame_size (frame, h, w, 1, 0, 0);      change_frame_size (f, h, w, 1, 0, 0);
440  #endif  #endif
441      char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height);      char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height);
442      ew->core.width = pixel_width;      ew->core.width = pixel_width;
# Line 645  static void Line 642  static void
642  update_various_frame_slots (ew)  update_various_frame_slots (ew)
643       EmacsFrame ew;       EmacsFrame ew;
644  {  {
645    struct x_output *x = ew->emacs_frame.frame->output_data.x;    struct frame *f = ew->emacs_frame.frame;
646    x->pixel_height = ew->core.height + x->menubar_height;    struct x_output *x = f->output_data.x;
647    x->pixel_width = ew->core.width;    FRAME_PIXEL_HEIGHT (f) = ew->core.height + x->menubar_height;
648    x->internal_border_width = ew->emacs_frame.internal_border_width;    FRAME_PIXEL_WIDTH (f) = ew->core.width;
649      f->internal_border_width = ew->emacs_frame.internal_border_width;
650    
651  }  }
652    
# Line 656  static void Line 654  static void
654  update_from_various_frame_slots (ew)  update_from_various_frame_slots (ew)
655       EmacsFrame ew;       EmacsFrame ew;
656  {  {
657    struct x_output *x = ew->emacs_frame.frame->output_data.x;    struct frame *f = ew->emacs_frame.frame;
658    ew->core.height = x->pixel_height - x->menubar_height;    struct x_output *x = f->output_data.x;
659    ew->core.width = x->pixel_width;    ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height;
660      ew->core.width = FRAME_PIXEL_WIDTH (f);
661    ew->core.background_pixel = x->background_pixel;    ew->core.background_pixel = x->background_pixel;
662    ew->emacs_frame.internal_border_width = x->internal_border_width;    ew->emacs_frame.internal_border_width = f->internal_border_width;
663    ew->emacs_frame.font = x->font;    ew->emacs_frame.font = x->font;
664    ew->emacs_frame.foreground_pixel = x->foreground_pixel;    ew->emacs_frame.foreground_pixel = x->foreground_pixel;
665    ew->emacs_frame.cursor_color = x->cursor_pixel;    ew->emacs_frame.cursor_color = x->cursor_pixel;
# Line 717  EmacsFrameInitialize (request, new, dum1 Line 716  EmacsFrameInitialize (request, new, dum1
716    }    }
717    
718  /* Update the font field in frame */  /* Update the font field in frame */
719    ew->emacs_frame.frame->output_data.x->font = ew->emacs_frame.font;    FRAME_FONT (ew->emacs_frame.frame) = ew->emacs_frame.font;
720  #endif  #endif
721    
722    update_from_various_frame_slots (ew);    update_from_various_frame_slots (ew);
# Line 910  EmacsFrameSetCharSize (widget, columns, Line 909  EmacsFrameSetCharSize (widget, columns,
909    if (columns < 3) columns = 3;  /* no way buddy */    if (columns < 3) columns = 3;  /* no way buddy */
910    
911    check_frame_size (f, &rows, &columns);    check_frame_size (f, &rows, &columns);
912    f->output_data.x->vertical_scroll_bar_extra    f->scroll_bar_actual_width
913      = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)      = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
        ? 0  
        : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font)));  
914    
915    compute_fringe_widths (f, 0);    compute_fringe_widths (f, 0);
916    
# Line 923  EmacsFrameSetCharSize (widget, columns, Line 920  EmacsFrameSetCharSize (widget, columns,
920    /* Something is really strange here wrt to the border width:    /* Something is really strange here wrt to the border width:
921       Apparently, XtNwidth and XtNheight include the border, so we have       Apparently, XtNwidth and XtNheight include the border, so we have
922       to add it here.  But the XtNborderWidth set for the widgets has       to add it here.  But the XtNborderWidth set for the widgets has
923       no similarity to what f->output_data.x->border_width is set to.  */       no similarity to what f->border_width is set to.  */
924    XtVaGetValues (widget, XtNborderWidth, &border_width, NULL);    XtVaGetValues (widget, XtNborderWidth, &border_width, NULL);
925    pixel_height += 2 * border_width;    pixel_height += 2 * border_width;
926    pixel_width += 2 * border_width;    pixel_width += 2 * border_width;
# Line 1017  widget_store_internal_border (widget) Line 1014  widget_store_internal_border (widget)
1014    EmacsFrame ew = (EmacsFrame) widget;    EmacsFrame ew = (EmacsFrame) widget;
1015    FRAME_PTR f = ew->emacs_frame.frame;    FRAME_PTR f = ew->emacs_frame.frame;
1016    
1017    ew->emacs_frame.internal_border_width    ew->emacs_frame.internal_border_width = f->internal_border_width;
     = f->output_data.x->internal_border_width;  
1018  }  }

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26