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

Diff of /emacs/src/macfns.c

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

revision 1.23 by akochoi, Tue Apr 1 01:09:13 2003 UTC revision 1.24 by kfstorm, Sat May 24 21:59:47 2003 UTC
# Line 610  x_real_positions (f, xptr, yptr) Line 610  x_real_positions (f, xptr, yptr)
610    LocalToGlobal (&pt);    LocalToGlobal (&pt);
611    SetPort (oldport);    SetPort (oldport);
612    
613      /* MAC has no frame pixel diff.  */
614      f->x_pixels_diff = 0;
615      f->y_pixels_diff = 0;
616    
617    *xptr = pt.h;    *xptr = pt.h;
618    *yptr = pt.v;    *yptr = pt.v;
619  }  }
# Line 1896  x_set_border_pixel (f, pix) Line 1900  x_set_border_pixel (f, pix)
1900  {  {
1901    f->output_data.mac->border_pixel = pix;    f->output_data.mac->border_pixel = pix;
1902    
1903    if (FRAME_MAC_WINDOW (f) != 0 && f->output_data.mac->border_width > 0)    if (FRAME_MAC_WINDOW (f) != 0 && f->border_width > 0)
1904      {      {
1905        if (FRAME_VISIBLE_P (f))        if (FRAME_VISIBLE_P (f))
1906          redraw_frame (f);          redraw_frame (f);
# Line 2049  x_set_menu_bar_lines (f, value, oldval) Line 2053  x_set_menu_bar_lines (f, value, oldval)
2053        /* Adjust the frame size so that the client (text) dimensions        /* Adjust the frame size so that the client (text) dimensions
2054           remain the same.  This depends on FRAME_EXTERNAL_MENU_BAR being           remain the same.  This depends on FRAME_EXTERNAL_MENU_BAR being
2055           set correctly.  */           set correctly.  */
2056        x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));        x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
2057        do_pending_window_change (0);        do_pending_window_change (0);
2058      }      }
2059    adjust_glyphs (f);    adjust_glyphs (f);
# Line 2087  x_set_tool_bar_lines (f, value, oldval) Line 2091  x_set_tool_bar_lines (f, value, oldval)
2091    
2092    /* Don't resize the tool-bar to more than we have room for.  */    /* Don't resize the tool-bar to more than we have room for.  */
2093    root_window = FRAME_ROOT_WINDOW (f);    root_window = FRAME_ROOT_WINDOW (f);
2094    root_height = XINT (XWINDOW (root_window)->height);    root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
2095    if (root_height - delta < 1)    if (root_height - delta < 1)
2096      {      {
2097        delta = root_height - 1;        delta = root_height - 1;
# Line 2118  x_set_tool_bar_lines (f, value, oldval) Line 2122  x_set_tool_bar_lines (f, value, oldval)
2122    if (delta < 0)    if (delta < 0)
2123      {      {
2124        int height = FRAME_INTERNAL_BORDER_WIDTH (f);        int height = FRAME_INTERNAL_BORDER_WIDTH (f);
2125        int width = PIXEL_WIDTH (f);        int width = FRAME_PIXEL_WIDTH (f);
2126        int y = nlines * CANON_Y_UNIT (f);        int y = nlines * FRAME_LINE_HEIGHT (f);
2127    
2128        BLOCK_INPUT;        BLOCK_INPUT;
2129        XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),        XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
# Line 2292  x_set_scroll_bar_default_width (f) Line 2296  x_set_scroll_bar_default_width (f)
2296  {  {
2297    /* Imitate X without X Toolkit */    /* Imitate X without X Toolkit */
2298    
2299    int wid = FONT_WIDTH (f->output_data.mac->font);    int wid = FRAME_COLUMN_WIDTH (f);
2300    
2301  #ifdef MAC_OSX  #ifdef MAC_OSX
2302    FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 16;  /* Aqua scroll bars.  */    FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16;  /* Aqua scroll bars.  */
2303    FRAME_SCROLL_BAR_COLS (f) = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) +    FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
2304                                 wid - 1) / wid;                                        wid - 1) / wid;
2305  #else /* not MAC_OSX */  #else /* not MAC_OSX */
2306    /* Make the actual width at least 14 pixels and a multiple of a    /* Make the actual width at least 14 pixels and a multiple of a
2307       character width.  */       character width.  */
2308    FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;    FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
2309    
2310    /* Use all of that space (aside from required margins) for the    /* Use all of that space (aside from required margins) for the
2311       scroll bar.  */       scroll bar.  */
2312    FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0;    FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0;
2313  #endif /* not MAC_OSX */  #endif /* not MAC_OSX */
2314  }  }
2315    
# Line 2507  mac_window (f, window_prompting, minibuf Line 2511  mac_window (f, window_prompting, minibuf
2511      strcpy (f->namebuf, str);      strcpy (f->namebuf, str);
2512    }    }
2513    
2514    SetRect (&r, f->output_data.mac->left_pos, f->output_data.mac->top_pos,    SetRect (&r, f->left_pos, f->top_pos,
2515             f->output_data.mac->left_pos + PIXEL_WIDTH (f),             f->left_pos + FRAME_PIXEL_WIDTH (f),
2516             f->output_data.mac->top_pos + PIXEL_HEIGHT (f));             f->top_pos + FRAME_PIXEL_HEIGHT (f));
2517    FRAME_MAC_WINDOW (f)    FRAME_MAC_WINDOW (f)
2518      = NewCWindow (NULL, &r, "\p", 1, zoomDocProc, (WindowPtr) -1, 1, (long) f->output_data.mac);      = NewCWindow (NULL, &r, "\p", 1, zoomDocProc, (WindowPtr) -1, 1, (long) f->output_data.mac);
2519    
# Line 2597  x_make_gc (f) Line 2601  x_make_gc (f)
2601       Note that many default values are used.  */       Note that many default values are used.  */
2602    
2603    /* Normal video */    /* Normal video */
2604    gc_values.font = f->output_data.mac->font;    gc_values.font = FRAME_FONT (f);
2605    gc_values.foreground = FRAME_FOREGROUND_PIXEL (f);    gc_values.foreground = FRAME_FOREGROUND_PIXEL (f);
2606    gc_values.background = FRAME_BACKGROUND_PIXEL (f);    gc_values.background = FRAME_BACKGROUND_PIXEL (f);
2607    f->output_data.mac->normal_gc = XCreateGC (FRAME_MAC_DISPLAY (f),    f->output_data.mac->normal_gc = XCreateGC (FRAME_MAC_DISPLAY (f),
# Line 2881  This function is an internal primitive-- Line 2885  This function is an internal primitive--
2885       tool-bar height don't change the frame size. This is done so that       tool-bar height don't change the frame size. This is done so that
2886       users can create tall Emacs frames without having to guess how       users can create tall Emacs frames without having to guess how
2887       tall the tool-bar will get. */       tall the tool-bar will get. */
2888    f->height += FRAME_TOOL_BAR_LINES (f);    FRAME_LINES (f) += FRAME_TOOL_BAR_LINES (f);
2889    
2890    /* mac_window (f, window_prompting, minibuffer_only); */    /* mac_window (f, window_prompting, minibuffer_only); */
2891    make_mac_frame (f);    make_mac_frame (f);
# Line 2908  This function is an internal primitive-- Line 2912  This function is an internal primitive--
2912    x_default_parameter (f, parms, Qscroll_bar_width, Qnil,    x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
2913                         "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);                         "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
2914    
2915    /* Dimensions, especially f->height, must be done via change_frame_size.    /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
2916       Change will not be effected unless different from the current       Change will not be effected unless different from the current
2917       f->height.  */       FRAME_LINES (f).  */
2918    width = f->width;    width = FRAME_COLS (f);
2919    height = f->height;    height = FRAME_LINES (f);
2920    
2921    f->height = 0;    FRAME_LINES (f) = 0;
2922    SET_FRAME_WIDTH (f, 0);    SET_FRAME_COLS (f, 0);
2923    change_frame_size (f, height, width, 1, 0, 0);    change_frame_size (f, height, width, 1, 0, 0);
2924    
2925    /* Set up faces after all frame parameters are known.  */    /* Set up faces after all frame parameters are known.  */
# Line 3265  int Line 3269  int
3269  x_pixel_width (f)  x_pixel_width (f)
3270       register struct frame *f;       register struct frame *f;
3271  {  {
3272    return PIXEL_WIDTH (f);    return FRAME_PIXEL_WIDTH (f);
3273  }  }
3274    
3275  int  int
3276  x_pixel_height (f)  x_pixel_height (f)
3277       register struct frame *f;       register struct frame *f;
3278  {  {
3279    return PIXEL_HEIGHT (f);    return FRAME_PIXEL_HEIGHT (f);
3280  }  }
3281    
3282  int  int
3283  x_char_width (f)  x_char_width (f)
3284       register struct frame *f;       register struct frame *f;
3285  {  {
3286    return FONT_WIDTH (f->output_data.mac->font);    return FRAME_COLUMN_WIDTH (f);
3287  }  }
3288    
3289  int  int
3290  x_char_height (f)  x_char_height (f)
3291       register struct frame *f;       register struct frame *f;
3292  {  {
3293    return f->output_data.mac->line_height;    return FRAME_LINE_HEIGHT (f);
3294  }  }
3295    
3296  int  int
# Line 8150  x_create_tip_frame (dpyinfo, parms) Line 8154  x_create_tip_frame (dpyinfo, parms)
8154  #if 0  #if 0
8155    f->output_data.w32->icon_bitmap = -1;    f->output_data.w32->icon_bitmap = -1;
8156  #endif  #endif
8157    f->output_data.w32->fontset = -1;    FRAME_FONTSET (f) = -1;
8158    f->icon_name = Qnil;    f->icon_name = Qnil;
8159    
8160  #ifdef MULTI_KBOARD  #ifdef MULTI_KBOARD
# Line 8295  x_create_tip_frame (dpyinfo, parms) Line 8299  x_create_tip_frame (dpyinfo, parms)
8299    x_default_parameter (f, parms, Qcursor_type, Qbox,    x_default_parameter (f, parms, Qcursor_type, Qbox,
8300                         "cursorType", "CursorType", RES_TYPE_SYMBOL);                         "cursorType", "CursorType", RES_TYPE_SYMBOL);
8301    
8302    /* Dimensions, especially f->height, must be done via change_frame_size.    /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
8303       Change will not be effected unless different from the current       Change will not be effected unless different from the current
8304       f->height.  */       FRAME_LINES (f).  */
8305    width = f->width;    width = FRAME_COLS (f);
8306    height = f->height;    height = FRAME_LINES (f);
8307    f->height = 0;    FRAME_LINES (f) = 0;
8308    SET_FRAME_WIDTH (f, 0);    SET_FRAME_COLS (f, 0);
8309    change_frame_size (f, height, width, 1, 0, 0);    change_frame_size (f, height, width, 1, 0, 0);
8310    
8311    /* Add `tooltip' frame parameter's default value. */    /* Add `tooltip' frame parameter's default value. */
# Line 8411  DY added (default is 10).  */) Line 8415  DY added (default is 10).  */)
8415            BLOCK_INPUT;            BLOCK_INPUT;
8416            compute_tip_xy (f, parms, dx, dy, &root_x, &root_y);            compute_tip_xy (f, parms, dx, dy, &root_x, &root_y);
8417            XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),            XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
8418                         root_x, root_y - PIXEL_HEIGHT (f));                         root_x, root_y - FRAME_PIXEL_HEIGHT (f));
8419            UNBLOCK_INPUT;            UNBLOCK_INPUT;
8420  #endif /* MAC_TODO */  #endif /* MAC_TODO */
8421            goto start_timer;            goto start_timer;
# Line 8447  DY added (default is 10).  */) Line 8451  DY added (default is 10).  */)
8451       columns x 40 lines.  If someone wants to show a larger tip, he       columns x 40 lines.  If someone wants to show a larger tip, he
8452       will loose.  I don't think this is a realistic case.  */       will loose.  I don't think this is a realistic case.  */
8453    w = XWINDOW (FRAME_ROOT_WINDOW (f));    w = XWINDOW (FRAME_ROOT_WINDOW (f));
8454    w->left = w->top = make_number (0);    w->left_col = w->top_line = make_number (0);
8455    w->width = make_number (80);    w->total_cols = make_number (80);
8456    w->height = make_number (40);    w->total_lines = make_number (40);
8457    adjust_glyphs (f);    adjust_glyphs (f);
8458    w->pseudo_window_p = 1;    w->pseudo_window_p = 1;
8459    
8460    /* Display the tooltip text in a temporary buffer.  */    /* Display the tooltip text in a temporary buffer.  */
8461    buffer = Fget_buffer_create (build_string (" *tip*"));    buffer = Fget_buffer_create (build_string (" *tip*"));
8462    Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer);    Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
8463    old_buffer = current_buffer;    old_buffer = current_buffer;
8464    set_buffer_internal_1 (XBUFFER (buffer));    set_buffer_internal_1 (XBUFFER (buffer));
8465    Ferase_buffer ();    Ferase_buffer ();

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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