diff options
| author | Miles Bader | 2007-07-15 02:05:20 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-07-15 02:05:20 +0000 |
| commit | 7eb1e4534e88a32fe5e549e630fdabf3e062be2b (patch) | |
| tree | 34fc72789f1cfbfeb067cf507f8871c322df300a /src/macterm.c | |
| parent | 76d11d2cf9623e9f4c38e8239c4444ffc1fae485 (diff) | |
| parent | 6f8a87c027ebd6f9cfdac5c0df97d651227bec62 (diff) | |
| download | emacs-7eb1e4534e88a32fe5e549e630fdabf3e062be2b.tar.gz emacs-7eb1e4534e88a32fe5e549e630fdabf3e062be2b.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 803-813)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 51-58)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 233-236)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-25
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 88 |
1 files changed, 59 insertions, 29 deletions
diff --git a/src/macterm.c b/src/macterm.c index 9ea51f87cfb..fa0682feca0 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -2196,11 +2196,12 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 2196 | Display *display = FRAME_MAC_DISPLAY (f); | 2196 | Display *display = FRAME_MAC_DISPLAY (f); |
| 2197 | struct face *face = p->face; | 2197 | struct face *face = p->face; |
| 2198 | int rowY; | 2198 | int rowY; |
| 2199 | int overlay_p = p->overlay_p; | ||
| 2199 | 2200 | ||
| 2200 | #ifdef MAC_OSX | 2201 | #ifdef MAC_OSX |
| 2201 | if (p->bx >= 0 && !p->overlay_p) | 2202 | if (!overlay_p) |
| 2202 | { | 2203 | { |
| 2203 | int bx = p->bx, nx = p->nx; | 2204 | int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny; |
| 2204 | 2205 | ||
| 2205 | #if 0 /* MAC_TODO: stipple */ | 2206 | #if 0 /* MAC_TODO: stipple */ |
| 2206 | /* In case the same realized face is used for fringes and | 2207 | /* In case the same realized face is used for fringes and |
| @@ -2229,17 +2230,40 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 2229 | int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) | 2230 | int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) |
| 2230 | * FRAME_COLUMN_WIDTH (f)); | 2231 | * FRAME_COLUMN_WIDTH (f)); |
| 2231 | 2232 | ||
| 2232 | if (left + width == bx) | 2233 | if (bx < 0 |
| 2234 | && (left + width == p->x | ||
| 2235 | || p->x + p->wd == left)) | ||
| 2233 | { | 2236 | { |
| 2234 | bx = left + sb_width; | 2237 | /* Bitmap fills the fringe and we need background |
| 2235 | nx += width - sb_width; | 2238 | extension. */ |
| 2239 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | ||
| 2240 | |||
| 2241 | bx = p->x; | ||
| 2242 | nx = p->wd; | ||
| 2243 | by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 2244 | row->y)); | ||
| 2245 | ny = row->visible_height; | ||
| 2246 | } | ||
| 2247 | |||
| 2248 | if (bx >= 0) | ||
| 2249 | { | ||
| 2250 | if (left + width == bx) | ||
| 2251 | { | ||
| 2252 | bx = left + sb_width; | ||
| 2253 | nx += width - sb_width; | ||
| 2254 | } | ||
| 2255 | else if (bx + nx == left) | ||
| 2256 | nx += width - sb_width; | ||
| 2236 | } | 2257 | } |
| 2237 | else if (bx + nx == left) | ||
| 2238 | nx += width - sb_width; | ||
| 2239 | } | 2258 | } |
| 2240 | } | 2259 | } |
| 2241 | 2260 | ||
| 2242 | mac_erase_rectangle (f, face->gc, bx, p->by, nx, p->ny); | 2261 | if (bx >= 0) |
| 2262 | { | ||
| 2263 | mac_erase_rectangle (f, face->gc, bx, by, nx, ny); | ||
| 2264 | /* The fringe background has already been filled. */ | ||
| 2265 | overlay_p = 1; | ||
| 2266 | } | ||
| 2243 | 2267 | ||
| 2244 | #if 0 /* MAC_TODO: stipple */ | 2268 | #if 0 /* MAC_TODO: stipple */ |
| 2245 | if (!face->stipple) | 2269 | if (!face->stipple) |
| @@ -2304,10 +2328,10 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 2304 | : face->foreground)); | 2328 | : face->foreground)); |
| 2305 | #if USE_CG_DRAWING | 2329 | #if USE_CG_DRAWING |
| 2306 | mac_draw_cg_image (fringe_bmp[p->which], f, face->gc, 0, p->dh, | 2330 | mac_draw_cg_image (fringe_bmp[p->which], f, face->gc, 0, p->dh, |
| 2307 | p->wd, p->h, p->x, p->y, p->overlay_p); | 2331 | p->wd, p->h, p->x, p->y, overlay_p); |
| 2308 | #else | 2332 | #else |
| 2309 | mac_draw_bitmap (f, face->gc, p->x, p->y, | 2333 | mac_draw_bitmap (f, face->gc, p->x, p->y, |
| 2310 | p->wd, p->h, p->bits + p->dh, p->overlay_p); | 2334 | p->wd, p->h, p->bits + p->dh, overlay_p); |
| 2311 | #endif | 2335 | #endif |
| 2312 | XSetForeground (display, face->gc, gcv.foreground); | 2336 | XSetForeground (display, face->gc, gcv.foreground); |
| 2313 | } | 2337 | } |
| @@ -11135,7 +11159,7 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11135 | EventRef event; | 11159 | EventRef event; |
| 11136 | void *data; | 11160 | void *data; |
| 11137 | { | 11161 | { |
| 11138 | OSStatus result, err = noErr; | 11162 | OSStatus err, result; |
| 11139 | Lisp_Object id_key = Qnil; | 11163 | Lisp_Object id_key = Qnil; |
| 11140 | int num_params; | 11164 | int num_params; |
| 11141 | const EventParamName *names; | 11165 | const EventParamName *names; |
| @@ -11196,6 +11220,7 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11196 | SetEventParameter (event, EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER, | 11220 | SetEventParameter (event, EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER, |
| 11197 | typeUInt32, sizeof (UInt32), &seqno_uaia); | 11221 | typeUInt32, sizeof (UInt32), &seqno_uaia); |
| 11198 | seqno_uaia++; | 11222 | seqno_uaia++; |
| 11223 | result = noErr; | ||
| 11199 | break; | 11224 | break; |
| 11200 | 11225 | ||
| 11201 | case kEventTextInputUnicodeForKeyEvent: | 11226 | case kEventTextInputUnicodeForKeyEvent: |
| @@ -11213,7 +11238,7 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11213 | if (err == noErr && mac_mapped_modifiers (modifiers)) | 11238 | if (err == noErr && mac_mapped_modifiers (modifiers)) |
| 11214 | /* There're mapped modifier keys. Process it in | 11239 | /* There're mapped modifier keys. Process it in |
| 11215 | do_keystroke. */ | 11240 | do_keystroke. */ |
| 11216 | return eventNotHandledErr; | 11241 | break; |
| 11217 | if (err == noErr) | 11242 | if (err == noErr) |
| 11218 | err = GetEventParameter (kbd_event, kEventParamKeyUnicodes, | 11243 | err = GetEventParameter (kbd_event, kEventParamKeyUnicodes, |
| 11219 | typeUnicodeText, NULL, 0, &actual_size, | 11244 | typeUnicodeText, NULL, 0, &actual_size, |
| @@ -11252,16 +11277,20 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11252 | XSETFRAME (read_socket_inev->frame_or_window, f); | 11277 | XSETFRAME (read_socket_inev->frame_or_window, f); |
| 11253 | } | 11278 | } |
| 11254 | } | 11279 | } |
| 11255 | return eventNotHandledErr; | 11280 | break; |
| 11256 | } | 11281 | } |
| 11257 | } | 11282 | } |
| 11283 | if (err == noErr) | ||
| 11284 | { | ||
| 11285 | /* Non-ASCII keystrokes without mapped modifiers are | ||
| 11286 | processed at the Lisp level. */ | ||
| 11287 | id_key = Qunicode_for_key_event; | ||
| 11288 | num_params = sizeof (names_ufke) / sizeof (names_ufke[0]); | ||
| 11289 | names = names_ufke; | ||
| 11290 | types = types_ufke; | ||
| 11291 | result = noErr; | ||
| 11292 | } | ||
| 11258 | } | 11293 | } |
| 11259 | /* Non-ASCII keystrokes without mapped modifiers are processed | ||
| 11260 | at the Lisp level. */ | ||
| 11261 | id_key = Qunicode_for_key_event; | ||
| 11262 | num_params = sizeof (names_ufke) / sizeof (names_ufke[0]); | ||
| 11263 | names = names_ufke; | ||
| 11264 | types = types_ufke; | ||
| 11265 | break; | 11294 | break; |
| 11266 | 11295 | ||
| 11267 | case kEventTextInputOffsetToPos: | 11296 | case kEventTextInputOffsetToPos: |
| @@ -11271,22 +11300,24 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11271 | Point p; | 11300 | Point p; |
| 11272 | 11301 | ||
| 11273 | if (!OVERLAYP (Vmac_ts_active_input_overlay)) | 11302 | if (!OVERLAYP (Vmac_ts_active_input_overlay)) |
| 11274 | return eventNotHandledErr; | 11303 | break; |
| 11275 | 11304 | ||
| 11276 | /* Strictly speaking, this is not always correct because | 11305 | /* Strictly speaking, this is not always correct because |
| 11277 | previous events may change some states about display. */ | 11306 | previous events may change some states about display. */ |
| 11278 | if (NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string))) | 11307 | if (!NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string))) |
| 11308 | { | ||
| 11309 | /* Active input area is displayed around the current point. */ | ||
| 11310 | f = SELECTED_FRAME (); | ||
| 11311 | w = XWINDOW (f->selected_window); | ||
| 11312 | } | ||
| 11313 | else if (WINDOWP (echo_area_window)) | ||
| 11279 | { | 11314 | { |
| 11280 | /* Active input area is displayed in the echo area. */ | 11315 | /* Active input area is displayed in the echo area. */ |
| 11281 | w = XWINDOW (echo_area_window); | 11316 | w = XWINDOW (echo_area_window); |
| 11282 | f = WINDOW_XFRAME (w); | 11317 | f = WINDOW_XFRAME (w); |
| 11283 | } | 11318 | } |
| 11284 | else | 11319 | else |
| 11285 | { | 11320 | break; |
| 11286 | /* Active input area is displayed around the current point. */ | ||
| 11287 | f = SELECTED_FRAME (); | ||
| 11288 | w = XWINDOW (f->selected_window); | ||
| 11289 | } | ||
| 11290 | 11321 | ||
| 11291 | p.h = (WINDOW_TO_FRAME_PIXEL_X (w, w->cursor.x) | 11322 | p.h = (WINDOW_TO_FRAME_PIXEL_X (w, w->cursor.x) |
| 11292 | + WINDOW_LEFT_FRINGE_WIDTH (w) | 11323 | + WINDOW_LEFT_FRINGE_WIDTH (w) |
| @@ -11296,6 +11327,8 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11296 | + f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f)); | 11327 | + f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f)); |
| 11297 | err = SetEventParameter (event, kEventParamTextInputReplyPoint, | 11328 | err = SetEventParameter (event, kEventParamTextInputReplyPoint, |
| 11298 | typeQDPoint, sizeof (typeQDPoint), &p); | 11329 | typeQDPoint, sizeof (typeQDPoint), &p); |
| 11330 | if (err == noErr) | ||
| 11331 | result = noErr; | ||
| 11299 | } | 11332 | } |
| 11300 | break; | 11333 | break; |
| 11301 | 11334 | ||
| @@ -11307,9 +11340,6 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 11307 | err = mac_store_event_ref_as_apple_event (0, 0, Qtext_input, id_key, | 11340 | err = mac_store_event_ref_as_apple_event (0, 0, Qtext_input, id_key, |
| 11308 | event, num_params, | 11341 | event, num_params, |
| 11309 | names, types); | 11342 | names, types); |
| 11310 | if (err == noErr) | ||
| 11311 | result = noErr; | ||
| 11312 | |||
| 11313 | return result; | 11343 | return result; |
| 11314 | } | 11344 | } |
| 11315 | #endif | 11345 | #endif |