Mercurial > emacs
comparison src/macfns.c @ 51197:c1bf3085654d
Make (several) trivial substitutions for renamed and
new macros in dispextern.h, frame.h and window.h.
(x_real_positions): Set f->x_pixels_diff and f->y_pixels_diff to 0.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sat, 24 May 2003 21:59:47 +0000 |
parents | 2bdbce68ec9a |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
51196:3fec44aca3cc | 51197:c1bf3085654d |
---|---|
607 f->output_data.mac->mWP->portRect.top); | 607 f->output_data.mac->mWP->portRect.top); |
608 #endif /* not TARGET_API_MAC_CARBON */ | 608 #endif /* not TARGET_API_MAC_CARBON */ |
609 GetPort (&oldport); | 609 GetPort (&oldport); |
610 LocalToGlobal (&pt); | 610 LocalToGlobal (&pt); |
611 SetPort (oldport); | 611 SetPort (oldport); |
612 | |
613 /* MAC has no frame pixel diff. */ | |
614 f->x_pixels_diff = 0; | |
615 f->y_pixels_diff = 0; | |
612 | 616 |
613 *xptr = pt.h; | 617 *xptr = pt.h; |
614 *yptr = pt.v; | 618 *yptr = pt.v; |
615 } | 619 } |
616 | 620 |
1894 struct frame *f; | 1898 struct frame *f; |
1895 int pix; | 1899 int pix; |
1896 { | 1900 { |
1897 f->output_data.mac->border_pixel = pix; | 1901 f->output_data.mac->border_pixel = pix; |
1898 | 1902 |
1899 if (FRAME_MAC_WINDOW (f) != 0 && f->output_data.mac->border_width > 0) | 1903 if (FRAME_MAC_WINDOW (f) != 0 && f->border_width > 0) |
1900 { | 1904 { |
1901 if (FRAME_VISIBLE_P (f)) | 1905 if (FRAME_VISIBLE_P (f)) |
1902 redraw_frame (f); | 1906 redraw_frame (f); |
1903 } | 1907 } |
1904 } | 1908 } |
2047 FRAME_EXTERNAL_MENU_BAR (f) = 0; | 2051 FRAME_EXTERNAL_MENU_BAR (f) = 0; |
2048 | 2052 |
2049 /* Adjust the frame size so that the client (text) dimensions | 2053 /* Adjust the frame size so that the client (text) dimensions |
2050 remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being | 2054 remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being |
2051 set correctly. */ | 2055 set correctly. */ |
2052 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); | 2056 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
2053 do_pending_window_change (0); | 2057 do_pending_window_change (0); |
2054 } | 2058 } |
2055 adjust_glyphs (f); | 2059 adjust_glyphs (f); |
2056 } | 2060 } |
2057 | 2061 |
2085 | 2089 |
2086 delta = nlines - FRAME_TOOL_BAR_LINES (f); | 2090 delta = nlines - FRAME_TOOL_BAR_LINES (f); |
2087 | 2091 |
2088 /* Don't resize the tool-bar to more than we have room for. */ | 2092 /* Don't resize the tool-bar to more than we have room for. */ |
2089 root_window = FRAME_ROOT_WINDOW (f); | 2093 root_window = FRAME_ROOT_WINDOW (f); |
2090 root_height = XINT (XWINDOW (root_window)->height); | 2094 root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window)); |
2091 if (root_height - delta < 1) | 2095 if (root_height - delta < 1) |
2092 { | 2096 { |
2093 delta = root_height - 1; | 2097 delta = root_height - 1; |
2094 nlines = FRAME_TOOL_BAR_LINES (f) + delta; | 2098 nlines = FRAME_TOOL_BAR_LINES (f) + delta; |
2095 } | 2099 } |
2116 has to be cleared. It was formerly part of the display | 2120 has to be cleared. It was formerly part of the display |
2117 of the larger tool bar, and updating windows won't clear it. */ | 2121 of the larger tool bar, and updating windows won't clear it. */ |
2118 if (delta < 0) | 2122 if (delta < 0) |
2119 { | 2123 { |
2120 int height = FRAME_INTERNAL_BORDER_WIDTH (f); | 2124 int height = FRAME_INTERNAL_BORDER_WIDTH (f); |
2121 int width = PIXEL_WIDTH (f); | 2125 int width = FRAME_PIXEL_WIDTH (f); |
2122 int y = nlines * CANON_Y_UNIT (f); | 2126 int y = nlines * FRAME_LINE_HEIGHT (f); |
2123 | 2127 |
2124 BLOCK_INPUT; | 2128 BLOCK_INPUT; |
2125 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), | 2129 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), |
2126 0, y, width, height, 0); | 2130 0, y, width, height, 0); |
2127 UNBLOCK_INPUT; | 2131 UNBLOCK_INPUT; |
2290 x_set_scroll_bar_default_width (f) | 2294 x_set_scroll_bar_default_width (f) |
2291 struct frame *f; | 2295 struct frame *f; |
2292 { | 2296 { |
2293 /* Imitate X without X Toolkit */ | 2297 /* Imitate X without X Toolkit */ |
2294 | 2298 |
2295 int wid = FONT_WIDTH (f->output_data.mac->font); | 2299 int wid = FRAME_COLUMN_WIDTH (f); |
2296 | 2300 |
2297 #ifdef MAC_OSX | 2301 #ifdef MAC_OSX |
2298 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 16; /* Aqua scroll bars. */ | 2302 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16; /* Aqua scroll bars. */ |
2299 FRAME_SCROLL_BAR_COLS (f) = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) + | 2303 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + |
2300 wid - 1) / wid; | 2304 wid - 1) / wid; |
2301 #else /* not MAC_OSX */ | 2305 #else /* not MAC_OSX */ |
2302 /* Make the actual width at least 14 pixels and a multiple of a | 2306 /* Make the actual width at least 14 pixels and a multiple of a |
2303 character width. */ | 2307 character width. */ |
2304 FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; | 2308 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; |
2305 | 2309 |
2306 /* Use all of that space (aside from required margins) for the | 2310 /* Use all of that space (aside from required margins) for the |
2307 scroll bar. */ | 2311 scroll bar. */ |
2308 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0; | 2312 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0; |
2309 #endif /* not MAC_OSX */ | 2313 #endif /* not MAC_OSX */ |
2310 } | 2314 } |
2311 | 2315 |
2312 | 2316 |
2313 /* Subroutines of creating a frame. */ | 2317 /* Subroutines of creating a frame. */ |
2505 char *str = (char *) SDATA (Vx_resource_name); | 2509 char *str = (char *) SDATA (Vx_resource_name); |
2506 f->namebuf = (char *) xmalloc (strlen (str) + 1); | 2510 f->namebuf = (char *) xmalloc (strlen (str) + 1); |
2507 strcpy (f->namebuf, str); | 2511 strcpy (f->namebuf, str); |
2508 } | 2512 } |
2509 | 2513 |
2510 SetRect (&r, f->output_data.mac->left_pos, f->output_data.mac->top_pos, | 2514 SetRect (&r, f->left_pos, f->top_pos, |
2511 f->output_data.mac->left_pos + PIXEL_WIDTH (f), | 2515 f->left_pos + FRAME_PIXEL_WIDTH (f), |
2512 f->output_data.mac->top_pos + PIXEL_HEIGHT (f)); | 2516 f->top_pos + FRAME_PIXEL_HEIGHT (f)); |
2513 FRAME_MAC_WINDOW (f) | 2517 FRAME_MAC_WINDOW (f) |
2514 = NewCWindow (NULL, &r, "\p", 1, zoomDocProc, (WindowPtr) -1, 1, (long) f->output_data.mac); | 2518 = NewCWindow (NULL, &r, "\p", 1, zoomDocProc, (WindowPtr) -1, 1, (long) f->output_data.mac); |
2515 | 2519 |
2516 validate_x_resource_name (); | 2520 validate_x_resource_name (); |
2517 | 2521 |
2595 | 2599 |
2596 /* Create the GC's of this frame. | 2600 /* Create the GC's of this frame. |
2597 Note that many default values are used. */ | 2601 Note that many default values are used. */ |
2598 | 2602 |
2599 /* Normal video */ | 2603 /* Normal video */ |
2600 gc_values.font = f->output_data.mac->font; | 2604 gc_values.font = FRAME_FONT (f); |
2601 gc_values.foreground = FRAME_FOREGROUND_PIXEL (f); | 2605 gc_values.foreground = FRAME_FOREGROUND_PIXEL (f); |
2602 gc_values.background = FRAME_BACKGROUND_PIXEL (f); | 2606 gc_values.background = FRAME_BACKGROUND_PIXEL (f); |
2603 f->output_data.mac->normal_gc = XCreateGC (FRAME_MAC_DISPLAY (f), | 2607 f->output_data.mac->normal_gc = XCreateGC (FRAME_MAC_DISPLAY (f), |
2604 FRAME_MAC_WINDOW (f), | 2608 FRAME_MAC_WINDOW (f), |
2605 GCFont | GCForeground | GCBackground, | 2609 GCFont | GCForeground | GCBackground, |
2879 height so that the user gets a text display area of the size he | 2883 height so that the user gets a text display area of the size he |
2880 specified with -g or via the registry. Later changes of the | 2884 specified with -g or via the registry. Later changes of the |
2881 tool-bar height don't change the frame size. This is done so that | 2885 tool-bar height don't change the frame size. This is done so that |
2882 users can create tall Emacs frames without having to guess how | 2886 users can create tall Emacs frames without having to guess how |
2883 tall the tool-bar will get. */ | 2887 tall the tool-bar will get. */ |
2884 f->height += FRAME_TOOL_BAR_LINES (f); | 2888 FRAME_LINES (f) += FRAME_TOOL_BAR_LINES (f); |
2885 | 2889 |
2886 /* mac_window (f, window_prompting, minibuffer_only); */ | 2890 /* mac_window (f, window_prompting, minibuffer_only); */ |
2887 make_mac_frame (f); | 2891 make_mac_frame (f); |
2888 | 2892 |
2889 x_icon (f, parms); | 2893 x_icon (f, parms); |
2906 x_default_parameter (f, parms, Qcursor_type, Qbox, | 2910 x_default_parameter (f, parms, Qcursor_type, Qbox, |
2907 "cursorType", "CursorType", RES_TYPE_SYMBOL); | 2911 "cursorType", "CursorType", RES_TYPE_SYMBOL); |
2908 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, | 2912 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, |
2909 "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); | 2913 "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); |
2910 | 2914 |
2911 /* Dimensions, especially f->height, must be done via change_frame_size. | 2915 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. |
2912 Change will not be effected unless different from the current | 2916 Change will not be effected unless different from the current |
2913 f->height. */ | 2917 FRAME_LINES (f). */ |
2914 width = f->width; | 2918 width = FRAME_COLS (f); |
2915 height = f->height; | 2919 height = FRAME_LINES (f); |
2916 | 2920 |
2917 f->height = 0; | 2921 FRAME_LINES (f) = 0; |
2918 SET_FRAME_WIDTH (f, 0); | 2922 SET_FRAME_COLS (f, 0); |
2919 change_frame_size (f, height, width, 1, 0, 0); | 2923 change_frame_size (f, height, width, 1, 0, 0); |
2920 | 2924 |
2921 /* Set up faces after all frame parameters are known. */ | 2925 /* Set up faces after all frame parameters are known. */ |
2922 call1 (Qface_set_after_frame_default, frame); | 2926 call1 (Qface_set_after_frame_default, frame); |
2923 | 2927 |
3263 | 3267 |
3264 int | 3268 int |
3265 x_pixel_width (f) | 3269 x_pixel_width (f) |
3266 register struct frame *f; | 3270 register struct frame *f; |
3267 { | 3271 { |
3268 return PIXEL_WIDTH (f); | 3272 return FRAME_PIXEL_WIDTH (f); |
3269 } | 3273 } |
3270 | 3274 |
3271 int | 3275 int |
3272 x_pixel_height (f) | 3276 x_pixel_height (f) |
3273 register struct frame *f; | 3277 register struct frame *f; |
3274 { | 3278 { |
3275 return PIXEL_HEIGHT (f); | 3279 return FRAME_PIXEL_HEIGHT (f); |
3276 } | 3280 } |
3277 | 3281 |
3278 int | 3282 int |
3279 x_char_width (f) | 3283 x_char_width (f) |
3280 register struct frame *f; | 3284 register struct frame *f; |
3281 { | 3285 { |
3282 return FONT_WIDTH (f->output_data.mac->font); | 3286 return FRAME_COLUMN_WIDTH (f); |
3283 } | 3287 } |
3284 | 3288 |
3285 int | 3289 int |
3286 x_char_height (f) | 3290 x_char_height (f) |
3287 register struct frame *f; | 3291 register struct frame *f; |
3288 { | 3292 { |
3289 return f->output_data.mac->line_height; | 3293 return FRAME_LINE_HEIGHT (f); |
3290 } | 3294 } |
3291 | 3295 |
3292 int | 3296 int |
3293 x_screen_planes (f) | 3297 x_screen_planes (f) |
3294 register struct frame *f; | 3298 register struct frame *f; |
8148 (struct w32_output *) xmalloc (sizeof (struct w32_output)); | 8152 (struct w32_output *) xmalloc (sizeof (struct w32_output)); |
8149 bzero (f->output_data.w32, sizeof (struct w32_output)); | 8153 bzero (f->output_data.w32, sizeof (struct w32_output)); |
8150 #if 0 | 8154 #if 0 |
8151 f->output_data.w32->icon_bitmap = -1; | 8155 f->output_data.w32->icon_bitmap = -1; |
8152 #endif | 8156 #endif |
8153 f->output_data.w32->fontset = -1; | 8157 FRAME_FONTSET (f) = -1; |
8154 f->icon_name = Qnil; | 8158 f->icon_name = Qnil; |
8155 | 8159 |
8156 #ifdef MULTI_KBOARD | 8160 #ifdef MULTI_KBOARD |
8157 FRAME_KBOARD (f) = kb; | 8161 FRAME_KBOARD (f) = kb; |
8158 #endif | 8162 #endif |
8293 x_default_parameter (f, parms, Qauto_lower, Qnil, | 8297 x_default_parameter (f, parms, Qauto_lower, Qnil, |
8294 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); | 8298 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
8295 x_default_parameter (f, parms, Qcursor_type, Qbox, | 8299 x_default_parameter (f, parms, Qcursor_type, Qbox, |
8296 "cursorType", "CursorType", RES_TYPE_SYMBOL); | 8300 "cursorType", "CursorType", RES_TYPE_SYMBOL); |
8297 | 8301 |
8298 /* Dimensions, especially f->height, must be done via change_frame_size. | 8302 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. |
8299 Change will not be effected unless different from the current | 8303 Change will not be effected unless different from the current |
8300 f->height. */ | 8304 FRAME_LINES (f). */ |
8301 width = f->width; | 8305 width = FRAME_COLS (f); |
8302 height = f->height; | 8306 height = FRAME_LINES (f); |
8303 f->height = 0; | 8307 FRAME_LINES (f) = 0; |
8304 SET_FRAME_WIDTH (f, 0); | 8308 SET_FRAME_COLS (f, 0); |
8305 change_frame_size (f, height, width, 1, 0, 0); | 8309 change_frame_size (f, height, width, 1, 0, 0); |
8306 | 8310 |
8307 /* Add `tooltip' frame parameter's default value. */ | 8311 /* Add `tooltip' frame parameter's default value. */ |
8308 if (NILP (Fframe_parameter (frame, intern ("tooltip")))) | 8312 if (NILP (Fframe_parameter (frame, intern ("tooltip")))) |
8309 Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), | 8313 Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), |
8409 | 8413 |
8410 #if 0 /* MAC_TODO : Mac specifics */ | 8414 #if 0 /* MAC_TODO : Mac specifics */ |
8411 BLOCK_INPUT; | 8415 BLOCK_INPUT; |
8412 compute_tip_xy (f, parms, dx, dy, &root_x, &root_y); | 8416 compute_tip_xy (f, parms, dx, dy, &root_x, &root_y); |
8413 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8417 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
8414 root_x, root_y - PIXEL_HEIGHT (f)); | 8418 root_x, root_y - FRAME_PIXEL_HEIGHT (f)); |
8415 UNBLOCK_INPUT; | 8419 UNBLOCK_INPUT; |
8416 #endif /* MAC_TODO */ | 8420 #endif /* MAC_TODO */ |
8417 goto start_timer; | 8421 goto start_timer; |
8418 } | 8422 } |
8419 } | 8423 } |
8445 | 8449 |
8446 /* Set up the frame's root window. Currently we use a size of 80 | 8450 /* Set up the frame's root window. Currently we use a size of 80 |
8447 columns x 40 lines. If someone wants to show a larger tip, he | 8451 columns x 40 lines. If someone wants to show a larger tip, he |
8448 will loose. I don't think this is a realistic case. */ | 8452 will loose. I don't think this is a realistic case. */ |
8449 w = XWINDOW (FRAME_ROOT_WINDOW (f)); | 8453 w = XWINDOW (FRAME_ROOT_WINDOW (f)); |
8450 w->left = w->top = make_number (0); | 8454 w->left_col = w->top_line = make_number (0); |
8451 w->width = make_number (80); | 8455 w->total_cols = make_number (80); |
8452 w->height = make_number (40); | 8456 w->total_lines = make_number (40); |
8453 adjust_glyphs (f); | 8457 adjust_glyphs (f); |
8454 w->pseudo_window_p = 1; | 8458 w->pseudo_window_p = 1; |
8455 | 8459 |
8456 /* Display the tooltip text in a temporary buffer. */ | 8460 /* Display the tooltip text in a temporary buffer. */ |
8457 buffer = Fget_buffer_create (build_string (" *tip*")); | 8461 buffer = Fget_buffer_create (build_string (" *tip*")); |
8458 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); | 8462 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); |
8459 old_buffer = current_buffer; | 8463 old_buffer = current_buffer; |
8460 set_buffer_internal_1 (XBUFFER (buffer)); | 8464 set_buffer_internal_1 (XBUFFER (buffer)); |
8461 Ferase_buffer (); | 8465 Ferase_buffer (); |
8462 Finsert (1, &string); | 8466 Finsert (1, &string); |
8463 clear_glyph_matrix (w->desired_matrix); | 8467 clear_glyph_matrix (w->desired_matrix); |