diff options
| author | YAMAMOTO Mitsuharu | 2008-03-29 00:45:58 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2008-03-29 00:45:58 +0000 |
| commit | b0f9edf7d3120f0b30dee8ad7001c51bbbb18c84 (patch) | |
| tree | dca2ae4f6a3a8a54f529613215002c455404a148 /src | |
| parent | d15a962285c371182faf16b10978e637fb2a01df (diff) | |
| download | emacs-b0f9edf7d3120f0b30dee8ad7001c51bbbb18c84.tar.gz emacs-b0f9edf7d3120f0b30dee8ad7001c51bbbb18c84.zip | |
* macfns.c (mac_window): Replace WindowPtr with WindowRef.
(mac_get_window_bounds): Move extern to macterm.h.
(compute_tip_xy) [TARGET_API_MAC_CARBON]: Use GetGlobalMouse.
(mac_window) [USE_MAC_TOOLBAR]: Set toolbar_win_gravity.
(x_set_tool_bar_lines) [USE_MAC_TOOLBAR]: Set FRAME_EXTERNAL_TOOL_BAR.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macfns.c | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/src/macfns.c b/src/macfns.c index 19947cadae4..23c2fca7cb0 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -218,9 +218,6 @@ void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); | |||
| 218 | void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 218 | void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 219 | void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 219 | void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 220 | void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 220 | void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 221 | |||
| 222 | extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); | ||
| 223 | |||
| 224 | 221 | ||
| 225 | 222 | ||
| 226 | /* Store the screen positions of frame F into XPTR and YPTR. | 223 | /* Store the screen positions of frame F into XPTR and YPTR. |
| @@ -1685,6 +1682,25 @@ x_set_tool_bar_lines (f, value, oldval) | |||
| 1685 | /* Make sure we redisplay all windows in this frame. */ | 1682 | /* Make sure we redisplay all windows in this frame. */ |
| 1686 | ++windows_or_buffers_changed; | 1683 | ++windows_or_buffers_changed; |
| 1687 | 1684 | ||
| 1685 | #if USE_MAC_TOOLBAR | ||
| 1686 | FRAME_TOOL_BAR_LINES (f) = 0; | ||
| 1687 | if (nlines) | ||
| 1688 | { | ||
| 1689 | FRAME_EXTERNAL_TOOL_BAR (f) = 1; | ||
| 1690 | if (FRAME_MAC_P (f) && !IsWindowToolbarVisible (FRAME_MAC_WINDOW (f))) | ||
| 1691 | /* Make sure next redisplay shows the tool bar. */ | ||
| 1692 | XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt; | ||
| 1693 | } | ||
| 1694 | else | ||
| 1695 | { | ||
| 1696 | if (FRAME_EXTERNAL_TOOL_BAR (f)) | ||
| 1697 | free_frame_tool_bar (f); | ||
| 1698 | FRAME_EXTERNAL_TOOL_BAR (f) = 0; | ||
| 1699 | } | ||
| 1700 | |||
| 1701 | return; | ||
| 1702 | #endif | ||
| 1703 | |||
| 1688 | delta = nlines - FRAME_TOOL_BAR_LINES (f); | 1704 | delta = nlines - FRAME_TOOL_BAR_LINES (f); |
| 1689 | 1705 | ||
| 1690 | /* Don't resize the tool-bar to more than we have room for. */ | 1706 | /* Don't resize the tool-bar to more than we have room for. */ |
| @@ -2255,11 +2271,11 @@ mac_window (f) | |||
| 2255 | FRAME_MAC_WINDOW (f) = NULL; | 2271 | FRAME_MAC_WINDOW (f) = NULL; |
| 2256 | } | 2272 | } |
| 2257 | } | 2273 | } |
| 2258 | #else | 2274 | #else /* !TARGET_API_MAC_CARBON */ |
| 2259 | FRAME_MAC_WINDOW (f) | 2275 | FRAME_MAC_WINDOW (f) |
| 2260 | = NewCWindow (NULL, &r, "\p", false, zoomDocProc, | 2276 | = NewCWindow (NULL, &r, "\p", false, zoomDocProc, |
| 2261 | (WindowPtr) -1, 1, (long) f->output_data.mac); | 2277 | (WindowRef) -1, 1, (long) f->output_data.mac); |
| 2262 | #endif | 2278 | #endif /* !TARGET_API_MAC_CARBON */ |
| 2263 | /* so that update events can find this mac_output struct */ | 2279 | /* so that update events can find this mac_output struct */ |
| 2264 | f->output_data.mac->mFP = f; /* point back to emacs frame */ | 2280 | f->output_data.mac->mFP = f; /* point back to emacs frame */ |
| 2265 | 2281 | ||
| @@ -2279,6 +2295,16 @@ mac_window (f) | |||
| 2279 | XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f), | 2295 | XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f), |
| 2280 | FRAME_BACKGROUND_PIXEL (f)); | 2296 | FRAME_BACKGROUND_PIXEL (f)); |
| 2281 | 2297 | ||
| 2298 | #if USE_MAC_TOOLBAR | ||
| 2299 | /* At the moment, the size of the tool bar is not yet known. We | ||
| 2300 | record the gravity value of the newly created window and use it | ||
| 2301 | to adjust the position of the window (especially for a negative | ||
| 2302 | specification of its vertical position) when the tool bar is | ||
| 2303 | first redisplayed. */ | ||
| 2304 | if (FRAME_EXTERNAL_TOOL_BAR (f)) | ||
| 2305 | f->output_data.mac->toolbar_win_gravity = f->win_gravity; | ||
| 2306 | #endif | ||
| 2307 | |||
| 2282 | validate_x_resource_name (); | 2308 | validate_x_resource_name (); |
| 2283 | 2309 | ||
| 2284 | /* x_set_name normally ignores requests to set the name if the | 2310 | /* x_set_name normally ignores requests to set the name if the |
| @@ -3112,7 +3138,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3112 | UNBLOCK_INPUT; | 3138 | UNBLOCK_INPUT; |
| 3113 | } | 3139 | } |
| 3114 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | 3140 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| 3115 | else | 3141 | else /* CGDisplayScreenSize == NULL */ |
| 3116 | #endif | 3142 | #endif |
| 3117 | #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ | 3143 | #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ |
| 3118 | #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | 3144 | #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| @@ -3149,7 +3175,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3149 | UNBLOCK_INPUT; | 3175 | UNBLOCK_INPUT; |
| 3150 | } | 3176 | } |
| 3151 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | 3177 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| 3152 | else | 3178 | else /* CGDisplayScreenSize == NULL */ |
| 3153 | #endif | 3179 | #endif |
| 3154 | #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ | 3180 | #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ |
| 3155 | #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | 3181 | #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| @@ -4068,8 +4094,12 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 4068 | Point mouse_pos; | 4094 | Point mouse_pos; |
| 4069 | 4095 | ||
| 4070 | BLOCK_INPUT; | 4096 | BLOCK_INPUT; |
| 4097 | #if TARGET_API_MAC_CARBON | ||
| 4098 | GetGlobalMouse (&mouse_pos); | ||
| 4099 | #else | ||
| 4071 | GetMouse (&mouse_pos); | 4100 | GetMouse (&mouse_pos); |
| 4072 | LocalToGlobal (&mouse_pos); | 4101 | LocalToGlobal (&mouse_pos); |
| 4102 | #endif | ||
| 4073 | *root_x = mouse_pos.h; | 4103 | *root_x = mouse_pos.h; |
| 4074 | *root_y = mouse_pos.v; | 4104 | *root_y = mouse_pos.v; |
| 4075 | UNBLOCK_INPUT; | 4105 | UNBLOCK_INPUT; |