From 39c41ad4211ebf2ce76fc49d9621adace0439399 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 30 Apr 2006 15:35:54 +0000 Subject: (Fforward_comment): Don't forget to break out of the loop when we skipped backward over a generic comment. --- src/ChangeLog | 5 +++++ src/syntax.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a4d458bee0f..99e1b6a90f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-30 Martin Rudalics (tiny change) + + * syntax.c (Fforward_comment): Don't forget to break out of the loop + when we skipped backward over a generic comment. + 2006-04-27 Nick Roberts * .gdbinit (pp1, pv1): Only print value as expression is now diff --git a/src/syntax.c b/src/syntax.c index 3f668eac946..f56bc1181c7 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2140,6 +2140,9 @@ between them, return t; otherwise return nil. */) from_byte = ini_byte; goto leave; } + else + /* We have skipped one comment. */ + break; } else if (code == Sendcomment) { -- cgit v1.2.1 From 9abc5f4519ebcaf74a937581784fe4e73c2e8a06 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 30 Apr 2006 22:15:21 +0000 Subject: (Fdefine_key): Improve error message when KEY begins with a non-prefix key. --- src/ChangeLog | 5 +++++ src/keymap.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 99e1b6a90f1..1f96b0aaaa4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-30 Richard Stallman + + * keymap.c (Fdefine_key): Improve error message + when KEY begins with a non-prefix key. + 2006-04-30 Martin Rudalics (tiny change) * syntax.c (Fforward_comment): Don't forget to break out of the loop diff --git a/src/keymap.c b/src/keymap.c index 66f17178d5b..4f8343bf5cf 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1193,8 +1193,11 @@ binding KEY to DEF is added at the front of KEYMAP. */) if (!CONSP (keymap)) /* We must use Fkey_description rather than just passing key to error; key might be a vector, not a string. */ - error ("Key sequence %s uses invalid prefix characters", - SDATA (Fkey_description (key, Qnil))); + error ("Key sequence %s starts with non-prefix key %s", + SDATA (Fkey_description (key, Qnil)), + SDATA (Fkey_description (Fsubstring (key, make_number (0), + make_number (idx)), + Qnil))); } } -- cgit v1.2.1 From a59871e76d23e765c7bb36c4a6a06a4147a0bbff Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:11:01 +0000 Subject: (update_window): Don't set changed_p when mode/header line is updated. --- src/dispnew.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/dispnew.c b/src/dispnew.c index c0acc738c78..da5e9c6e398 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4156,7 +4156,6 @@ update_window (w, force_p) update_window_line (w, MATRIX_ROW_VPOS (mode_line_row, desired_matrix), &mouse_face_overwritten_p); - changed_p = 1; } /* Find first enabled row. Optimizations in redisplay_internal @@ -4226,7 +4225,6 @@ update_window (w, force_p) { header_line_row->y = 0; update_window_line (w, 0, &mouse_face_overwritten_p); - changed_p = 1; } /* Fix the appearance of overlapping/overlapped rows. */ -- cgit v1.2.1 From d3601bf266b918b090170efa11e32fe8ba137151 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:11:28 +0000 Subject: (mac_coerce_file_name_ptr): Try typeFSRef if coercion through typeFileURL failed. --- src/mac.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mac.c b/src/mac.c index 7172301b6b0..444320322c3 100644 --- a/src/mac.c +++ b/src/mac.c @@ -448,6 +448,22 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, } else err = memFullErr; + + if (err != noErr) + { + /* Just to be paranoid ... */ + FSRef fref; + char *buf; + + buf = xmalloc (data_size + 1); + memcpy (buf, data_ptr, data_size); + buf[data_size] = '\0'; + err = FSPathMakeRef (buf, &fref, NULL); + xfree (buf); + if (err == noErr) + err = AECoercePtr (typeFSRef, &fref, sizeof (FSRef), + to_type, result); + } #else FSSpec fs; char *buf; @@ -510,6 +526,34 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, CFDataGetLength (data), result); CFRelease (data); } + + if (err != noErr) + { + /* Coercion from typeAlias to typeFileURL fails on Mac OS X + 10.2. In such cases, try typeFSRef as a target type. */ + char file_name[MAXPATHLEN]; + + if (type_code == typeFSRef && data_size == sizeof (FSRef)) + err = FSRefMakePath (data_ptr, file_name, sizeof (file_name)); + else + { + AEDesc desc; + FSRef fref; + + err = AECoercePtr (type_code, data_ptr, data_size, + typeFSRef, &desc); + if (err == noErr) + { + err = AEGetDescData (&desc, &fref, sizeof (FSRef)); + AEDisposeDesc (&desc); + } + if (err == noErr) + err = FSRefMakePath (&fref, file_name, sizeof (file_name)); + } + if (err == noErr) + err = AECreateDesc (TYPE_FILE_NAME, file_name, + strlen (file_name), result); + } #else char file_name[MAXPATHLEN]; @@ -529,11 +573,11 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, #else fs = *(FSSpec *)(*(desc.dataHandle)); #endif - if (err == noErr) - err = fsspec_to_posix_pathname (&fs, file_name, - sizeof (file_name) - 1); AEDisposeDesc (&desc); } + if (err == noErr) + err = fsspec_to_posix_pathname (&fs, file_name, + sizeof (file_name) - 1); } if (err == noErr) err = AECreateDesc (TYPE_FILE_NAME, file_name, -- cgit v1.2.1 From caec817144f49a22d92f77ffb1ed6091ce654b21 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:11:56 +0000 Subject: (mac_update_title_bar): New function. [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. --- src/macfns.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index f9a5f051eb4..dd74808d1cf 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1919,6 +1919,99 @@ mac_set_scroll_bar_width (f, arg, oldval) x_set_scroll_bar_width (f, arg, oldval); } +#if TARGET_API_MAC_CARBON +static void +mac_update_proxy_icon (f) + struct frame *f; +{ + Lisp_Object file_name = + XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename; + Window w = FRAME_MAC_WINDOW (f); + + if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name)) + return; + if (FRAME_FILE_NAME (f) && STRINGP (file_name) + && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0) + return; + + if (FRAME_FILE_NAME (f)) + { + xfree (FRAME_FILE_NAME (f)); + FRAME_FILE_NAME (f) = NULL; + } + + BLOCK_INPUT; + + if (STRINGP (file_name)) + { + OSStatus err; + AEDesc desc; + Lisp_Object encoded_file_name = ENCODE_FILE (file_name); + +#ifdef MAC_OS8 + SetPortWindowPort (w); +#endif + err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), + SBYTES (encoded_file_name), typeAlias, &desc); + if (err == noErr) + { + Size size = AEGetDescDataSize (&desc); + AliasHandle alias = (AliasHandle) NewHandle (size); + + if (alias == NULL) + err = memFullErr; + else + { + HLock ((Handle) alias); + err = AEGetDescData (&desc, *alias, size); + HUnlock ((Handle) alias); + if (err == noErr) + err = SetWindowProxyAlias (w, alias); + DisposeHandle ((Handle) alias); + } + AEDisposeDesc (&desc); + } + if (err == noErr) + { + FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1); + strcpy (FRAME_FILE_NAME (f), SDATA (file_name)); + } + } + + if (FRAME_FILE_NAME (f) == NULL) + RemoveWindowProxy (w); + + UNBLOCK_INPUT; +} +#endif + +void mac_update_title_bar (f, save_match_data) + struct frame *f; + int save_match_data; +{ +#if TARGET_API_MAC_CARBON + struct window *w; + int modified_p; + + if (!FRAME_MAC_P (f)) + return; + + w = XWINDOW (FRAME_SELECTED_WINDOW (f)); + modified_p = (BUF_SAVE_MODIFF (XBUFFER (w->buffer)) + < BUF_MODIFF (XBUFFER (w->buffer))); + if (windows_or_buffers_changed + /* Minibuffer modification status shown in the close button is + confusing. */ + || (!MINI_WINDOW_P (w) + && (modified_p != !NILP (w->last_had_star)))) + SetWindowModified (FRAME_MAC_WINDOW (f), + !MINI_WINDOW_P (w) && modified_p); + + if (windows_or_buffers_changed) + mac_update_proxy_icon (f); +#endif +} + /* Subroutines of creating a frame. */ @@ -3470,6 +3563,9 @@ show_hourglass (timer) if (FRAME_LIVE_P (f) && FRAME_MAC_P (f) && FRAME_MAC_WINDOW (f) != tip_window) { +#if USE_CG_DRAWING + mac_prepare_for_quickdraw (f); +#endif if (!f->output_data.mac->hourglass_control) { Window w = FRAME_MAC_WINDOW (f); @@ -3514,7 +3610,12 @@ hide_hourglass () if (FRAME_MAC_P (f) /* Watch out for newly created frames. */ && f->output_data.mac->hourglass_control) - HideControl (f->output_data.mac->hourglass_control); + { +#if USE_CG_DRAWING + mac_prepare_for_quickdraw (f); +#endif + HideControl (f->output_data.mac->hourglass_control); + } } hourglass_shown_p = 0; -- cgit v1.2.1 From b0635670ea3058a5ec55729c02d26ada77012304 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:12:23 +0000 Subject: (USE_ATSUI): Set default to 1 if MAC_OSX is defined. (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. (enum pcm_status): New enum. (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID) (XCharStructRow): Remove. Now validity is represented by non-negativeness of sum of ascent and descent. (struct MacFontStruct): Change type of member `rows'. (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. --- src/macgui.h | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/macgui.h b/src/macgui.h index 7eb6c9942ab..579ae2b7663 100644 --- a/src/macgui.h +++ b/src/macgui.h @@ -79,14 +79,26 @@ typedef unsigned long Time; #include #endif /* not HAVE_CARBON */ +/* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for + text drawing. */ +#ifndef USE_ATSUI +#ifdef MAC_OSX +#define USE_ATSUI 1 +#endif +#endif + +/* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing + in preference to ATSUI for ASCII and Latin-1 characters. */ #ifndef USE_CG_TEXT_DRAWING #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 #define USE_CG_TEXT_DRAWING 1 #endif #endif +/* Whether to use Quartz 2D routines for drawing operations other than + texts. */ #ifndef USE_CG_DRAWING -#if USE_ATSUI && defined (MAC_OSX) +#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 #define USE_CG_DRAWING 1 #endif #endif @@ -105,6 +117,8 @@ typedef GWorldPtr Pixmap; /* Emulate XCharStruct. */ +/* If the sum of ascent and descent is negative, that means some + special status specified by enum pcm_status. */ typedef struct _XCharStruct { short lbearing; /* origin to left edge of raster */ @@ -117,6 +131,12 @@ typedef struct _XCharStruct #endif } XCharStruct; +enum pcm_status + { + PCM_VALID = 0, /* pcm data is valid */ + PCM_INVALID = -1, /* pcm data is invalid */ + }; + #define STORE_XCHARSTRUCT(xcs, w, bds) \ ((xcs).width = (w), \ (xcs).lbearing = (bds).left, \ @@ -124,18 +144,6 @@ typedef struct _XCharStruct (xcs).ascent = -(bds).top, \ (xcs).descent = (bds).bottom) -typedef struct -{ - char valid_bits[0x100 / 8]; - XCharStruct per_char[0x100]; -} XCharStructRow; - -#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \ - ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8)) - -#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \ - ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8)) - struct MacFontStruct { char *full_name; @@ -175,7 +183,7 @@ struct MacFontStruct { XCharStruct max_bounds; /* maximum bounds over all existing char */ union { XCharStruct *per_char; /* first_char to last_char information */ - XCharStructRow **rows; /* first row to last row information */ + XCharStruct **rows; /* first row to last row information */ } bounds; int ascent; /* logical extent above baseline for spacing */ int descent; /* logical decent below baseline for spacing */ @@ -229,7 +237,7 @@ typedef struct _XGC /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */ RgnHandle clip_region; -#if defined (MAC_OSX) && USE_ATSUI +#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING) /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate is in QuickDraw's. */ CGRect clip_rects[MAX_CLIP_RECTS]; -- cgit v1.2.1 From 458dbb8c7a5f3d3950529e05728b9327e50d7025 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:13:06 +0000 Subject: (mac_draw_line, mac_draw_line_to_pixmap): Adjust endpoints of strictly horizontal/vertical lines. (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. (pcm_init, pcm_get_status): New functions. (x_per_char_metric, XLoadQueryFont): Use them instead of XCharStructRow and related macros. (x_draw_relief_rect): Don't adjust arguments of mac_draw_line. (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME. (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag and window path pop-up menu on title bar. (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1. --- src/macterm.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 98 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/macterm.c b/src/macterm.c index cbef67c3bee..60b5545d510 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -389,16 +389,37 @@ mac_draw_line (f, gc, x1, y1, x2, y2) { #if USE_CG_DRAWING CGContextRef context; + float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2; + + if (y1 != y2) + gx1 += 0.5f, gx2 += 0.5f; + if (x1 != x2) + gy1 += 0.5f, gy2 += 0.5f; context = mac_begin_cg_clip (f, gc); CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); CGContextBeginPath (context); - CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f); - CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f); + CGContextMoveToPoint (context, gx1, gy1); + CGContextAddLineToPoint (context, gx2, gy2); CGContextClosePath (context); CGContextStrokePath (context); mac_end_cg_clip (f); #else + if (x1 == x2) + { + if (y1 > y2) + y1--; + else if (y2 > y1) + y2--; + } + else if (y1 == y2) + { + if (x1 > x2) + x1--; + else + x2--; + } + SetPortWindowPort (FRAME_MAC_WINDOW (f)); RGBForeColor (GC_FORE_COLOR (gc)); @@ -420,6 +441,21 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) CGrafPtr old_port; GDHandle old_gdh; + if (x1 == x2) + { + if (y1 > y2) + y1--; + else if (y2 > y1) + y2--; + } + else if (y1 == y2) + { + if (x1 > x2) + x1--; + else + x2--; + } + GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); @@ -1625,7 +1661,7 @@ mac_set_clip_rectangles (display, gc, rectangles, n) DisposeRgn (region); } } -#if defined (MAC_OSX) && USE_ATSUI +#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING) for (i = 0; i < n; i++) { Rect *rect = rectangles + i; @@ -2136,6 +2172,29 @@ static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *)); +static void +pcm_init (pcm, count) + XCharStruct *pcm; + int count; +{ + bzero (pcm, sizeof (XCharStruct) * count); + while (--count >= 0) + { + pcm->descent = PCM_INVALID; + pcm++; + } +} + +static enum pcm_status +pcm_get_status (pcm) + XCharStruct *pcm; +{ + int height = pcm->ascent + pcm->descent; + + /* Negative height means some special status. */ + return height >= 0 ? PCM_VALID : height; +} + /* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B is not contained in the font. */ @@ -2152,22 +2211,21 @@ x_per_char_metric (font, char2b) #if USE_ATSUI if (font->mac_style) { - XCharStructRow **row = font->bounds.rows + char2b->byte1; + XCharStruct **row = font->bounds.rows + char2b->byte1; if (*row == NULL) { - *row = xmalloc (sizeof (XCharStructRow)); - bzero (*row, sizeof (XCharStructRow)); + *row = xmalloc (sizeof (XCharStruct) * 0x100); + pcm_init (*row, 0x100); } - pcm = (*row)->per_char + char2b->byte2; - if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2)) + pcm = *row + char2b->byte2; + if (pcm_get_status (pcm) != PCM_VALID) { BLOCK_INPUT; mac_query_char_extents (font->mac_style, (char2b->byte1 << 8) + char2b->byte2, NULL, NULL, pcm, NULL); UNBLOCK_INPUT; - XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2); } } else @@ -3122,13 +3180,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, for (i = 0; i < width; ++i) mac_draw_line (f, gc, left_x + i * left_p, top_y + i, - right_x - i * right_p, top_y + i); + right_x + 1 - i * right_p, top_y + i); /* Left. */ if (left_p) for (i = 0; i < width; ++i) mac_draw_line (f, gc, - left_x + i, top_y + i, left_x + i, bottom_y - i); + left_x + i, top_y + i, left_x + i, bottom_y - i + 1); mac_reset_clip_rectangles (dpy, gc); if (raised_p) @@ -3142,13 +3200,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, for (i = 0; i < width; ++i) mac_draw_line (f, gc, left_x + i * left_p, bottom_y - i, - right_x - i * right_p, bottom_y - i); + right_x + 1 - i * right_p, bottom_y - i); /* Right. */ if (right_p) for (i = 0; i < width; ++i) mac_draw_line (f, gc, - right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1); + right_x - i, top_y + i + 1, right_x - i, bottom_y - i); mac_reset_clip_rectangles (dpy, gc); } @@ -6300,6 +6358,11 @@ x_free_frame_resources (f) if (FRAME_SIZE_HINTS (f)) xfree (FRAME_SIZE_HINTS (f)); +#if TARGET_API_MAC_CARBON + if (FRAME_FILE_NAME (f)) + xfree (FRAME_FILE_NAME (f)); +#endif + xfree (f->output_data.mac); f->output_data.mac = NULL; @@ -7746,10 +7809,10 @@ XLoadQueryFont (Display *dpy, char *fontname) font->min_char_or_byte2 = 0; font->max_char_or_byte2 = 0xff; - font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100); - bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100); - font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow)); - bzero (font->bounds.rows[0], sizeof (XCharStructRow)); + font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100); + bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100); + font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100); + pcm_init (font->bounds.rows[0], 0x100); #if USE_CG_TEXT_DRAWING { @@ -7775,7 +7838,7 @@ XLoadQueryFont (Display *dpy, char *fontname) bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100); } #endif - space_bounds = font->bounds.rows[0]->per_char + 0x20; + space_bounds = font->bounds.rows[0] + 0x20; err = mac_query_char_extents (font->mac_style, 0x20, &font->ascent, &font->descent, space_bounds, @@ -7791,9 +7854,8 @@ XLoadQueryFont (Display *dpy, char *fontname) mac_unload_font (&one_mac_display_info, font); return NULL; } - XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], 0x20); - pcm = font->bounds.rows[0]->per_char; + pcm = font->bounds.rows[0]; for (c = 0x21; c <= 0xff; c++) { if (c == 0xad) @@ -7813,7 +7875,6 @@ XLoadQueryFont (Display *dpy, char *fontname) NULL #endif ); - XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], c); #if USE_CG_TEXT_DRAWING if (font->cg_glyphs && font->cg_glyphs[c] == 0) @@ -9997,8 +10058,20 @@ XTread_socket (sd, expected, hold_quit) } break; +#if TARGET_API_MAC_CARBON + case inProxyIcon: + if (TrackWindowProxyDrag (window_ptr, er.where) + != errUserWantsToDragWindow) + break; + /* fall through */ +#endif case inDrag: #if TARGET_API_MAC_CARBON + if (IsWindowPathSelectClick (window_ptr, &er)) + { + WindowPathSelect (window_ptr, NULL, NULL); + break; + } DragWindow (window_ptr, er.where, NULL); #else /* not TARGET_API_MAC_CARBON */ DragWindow (window_ptr, er.where, &qd.screenBits.bounds); @@ -11049,7 +11122,11 @@ button will be mouse-3. */); doc: /* *If non-nil, allow anti-aliasing. The text will be rendered using Core Graphics text rendering which may anti-alias the text. */); +#if USE_CG_DRAWING + mac_use_core_graphics = 1; +#else mac_use_core_graphics = 0; +#endif /* Register an entry for `mac-roman' so that it can be used when creating the terminal frame on Mac OS 9 before loading -- cgit v1.2.1 From a019c41a5cd58fcc8b518edcdfc46e04471fbff9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:13:29 +0000 Subject: (mac_update_title_bar): Add extern. (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'. (FRAME_FILE_NAME): New macro. --- src/macterm.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/macterm.h b/src/macterm.h index e35f04a6ba6..f23554f01c6 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -335,6 +335,11 @@ struct mac_output { /* Hints for the size and the position of a window. */ XSizeHints *size_hints; +#if TARGET_API_MAC_CARBON + /* File name for the proxy icon of this frame. Might be NULL. */ + char *file_name; +#endif + #if USE_CG_DRAWING /* Quartz 2D graphics context. */ CGContextRef cg_context; @@ -360,6 +365,8 @@ typedef struct mac_output mac_output; #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) +#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name) + /* This gives the mac_display_info structure for the display F is on. */ #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) @@ -606,6 +613,7 @@ extern int x_char_width P_ ((struct frame *)); extern int x_char_height P_ ((struct frame *)); extern void x_sync P_ ((struct frame *)); extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); +extern void mac_update_title_bar P_ ((struct frame *, int)); /* Defined in macmenu.c */ -- cgit v1.2.1 From 6dc5c8a75b8ad0aea911c0236e4fdb35e1e0839f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:13:42 +0000 Subject: (unexec): Error if trying unexec from dumped executable. --- src/unexmacosx.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 4ca0be829a2..f65fd9cbc22 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -1021,6 +1021,9 @@ void unexec (char *outfile, char *infile, void *start_data, void *start_bss, void *entry_address) { + if (in_dumped_exec) + unexec_error ("Unexec from a dumped executable is not supported."); + infd = open (infile, O_RDONLY, 0); if (infd < 0) { -- cgit v1.2.1 From 15ba779363ab1069b0ddba682de844246e78a72b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:14:09 +0000 Subject: (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. (get_glyph_face_and_encoding, get_char_face_and_encoding): Don't distinguish known faces from others. --- src/xdisp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 65b16da76c3..ecc097343f2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8954,6 +8954,9 @@ prepare_menu_bars () update_menu_bar (f, 0); #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (f, 0); +#ifdef MAC_OS + mac_update_title_bar (f, 0); +#endif #endif UNGCPRO; } @@ -8966,6 +8969,9 @@ prepare_menu_bars () update_menu_bar (sf, 1); #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (sf, 1); +#ifdef MAC_OS + mac_update_title_bar (sf, 1); +#endif #endif } @@ -18520,8 +18526,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p) sure to use a face suitable for unibyte. */ STORE_XCHAR2B (char2b, 0, glyph->u.ch); } - else if (glyph->u.ch < 128 - && glyph->face_id < BASIC_FACE_ID_SENTINEL) + else if (glyph->u.ch < 128) { /* Case of ASCII in a face known to fit ASCII. */ STORE_XCHAR2B (char2b, 0, glyph->u.ch); @@ -18923,7 +18928,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) face_id = FACE_FOR_CHAR (f, face, c); face = FACE_FROM_ID (f, face_id); } - else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL) + else if (c < 128) { /* Case of ASCII in a face known to fit ASCII. */ STORE_XCHAR2B (char2b, 0, c); -- cgit v1.2.1 From c1eb34c22c52e237a588059d93781a1bd757c8ca Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:14:30 +0000 Subject: *** empty log message *** --- src/ChangeLog | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1f96b0aaaa4..8b5ca9e8435 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,47 @@ +2006-05-01 YAMAMOTO Mitsuharu + + * dispnew.c (update_window): Don't set changed_p when mode/header + line is updated. + + * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. + (get_glyph_face_and_encoding, get_char_face_and_encoding): Don't + distinguish known faces from others. + + * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion + through typeFileURL failed. + + * macfns.c (mac_update_title_bar): New function. + [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. + (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: Call + mac_prepare_for_quickdraw. + + * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined. + (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. + (enum pcm_status): New enum. + (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID) + (XCharStructRow): Remove. Now validity is represented by + non-negativeness of sum of ascent and descent. + (struct MacFontStruct): Change type of member `rows'. + (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. + + * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): Adjust + endpoints of strictly horizontal/vertical lines. + (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. + (pcm_init, pcm_get_status): New functions. + (x_per_char_metric, XLoadQueryFont): Use them instead of + XCharStructRow and related macros. + (x_draw_relief_rect): Don't adjust arguments of mac_draw_line. + (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME. + (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag + and window path pop-up menu on title bar. + (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1. + + * macterm.h (mac_update_title_bar): Add extern. + (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'. + (FRAME_FILE_NAME): New macro. + + * unexmacosx.c (unexec): Error if trying unexec from dumped executable. + 2006-04-30 Richard Stallman * keymap.c (Fdefine_key): Improve error message -- cgit v1.2.1 From d5085af01f3c3f4ff83ca94b029959784fe29253 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 02:51:38 +0000 Subject: (mac_update_title_bar): Minor format change. --- src/macfns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index dd74808d1cf..408600c56bb 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1985,7 +1985,8 @@ mac_update_proxy_icon (f) } #endif -void mac_update_title_bar (f, save_match_data) +void +mac_update_title_bar (f, save_match_data) struct frame *f; int save_match_data; { -- cgit v1.2.1 From 5fed8c15b8c8a74c5e0d0e76baa7f66be96267b6 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 1 May 2006 09:38:57 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8b5ca9e8435..b8495387311 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -47,7 +47,7 @@ * keymap.c (Fdefine_key): Improve error message when KEY begins with a non-prefix key. -2006-04-30 Martin Rudalics (tiny change) +2006-04-30 Martin Rudalics * syntax.c (Fforward_comment): Don't forget to break out of the loop when we skipped backward over a generic comment. @@ -85,7 +85,7 @@ * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief. (produce_stretch_glyph): Assume that face box height and width is - already included in in stretch glyph size so caller doesn't have to + already included in stretch glyph size so caller doesn't have to consider the extra space otherwise added (fixes problem in ses.el). * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame @@ -1732,7 +1732,7 @@ * image.c [MAC_OS] (find_image_fsspec): Likewise. -2005-12-23 Martin Rudalics (tiny change) +2005-12-23 Martin Rudalics * insdel.c (insert, insert_and_inherit, insert_before_markers) (insert_before_markers_and_inherit): Make sure FROM is correct -- cgit v1.2.1 From fcdd45857005869fe14081dc783fe4ba6ac66d01 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 1 May 2006 13:09:24 +0000 Subject: (Fforward_comment): Detect generic comment at beginning of buffer when moving backwards. --- src/ChangeLog | 17 +++++++++++------ src/syntax.c | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b8495387311..3c6efb16308 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,19 +1,24 @@ +2006-05-01 Martin Rudalics + + * syntax.c (Fforward_comment): Detect generic comment at beginning of + buffer when moving backwards. + 2006-05-01 YAMAMOTO Mitsuharu * dispnew.c (update_window): Don't set changed_p when mode/header line is updated. * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. - (get_glyph_face_and_encoding, get_char_face_and_encoding): Don't - distinguish known faces from others. + (get_glyph_face_and_encoding, get_char_face_and_encoding): + Don't distinguish known faces from others. * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion through typeFileURL failed. * macfns.c (mac_update_title_bar): New function. [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. - (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: Call - mac_prepare_for_quickdraw. + (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: + Call mac_prepare_for_quickdraw. * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined. (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. @@ -24,8 +29,8 @@ (struct MacFontStruct): Change type of member `rows'. (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. - * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): Adjust - endpoints of strictly horizontal/vertical lines. + * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): + Adjust endpoints of strictly horizontal/vertical lines. (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. (pcm_init, pcm_get_status): New functions. (x_per_char_metric, XLoadQueryFont): Use them instead of diff --git a/src/syntax.c b/src/syntax.c index f56bc1181c7..1c8d0debbf3 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2123,8 +2123,6 @@ between them, return t; otherwise return nil. */) while (1) { DEC_BOTH (from, from_byte); - if (from == stop) - break; UPDATE_SYNTAX_TABLE_BACKWARD (from); c = FETCH_CHAR (from_byte); if (SYNTAX (c) == Scomment_fence @@ -2133,6 +2131,8 @@ between them, return t; otherwise return nil. */) found = 1; break; } + else if (from == stop) + break; } if (found == 0) { -- cgit v1.2.1 From 64ec8b2f3d60ede58b85373beb828d8db544505d Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 1 May 2006 22:58:47 +0000 Subject: (restore_menu_items): Return a value. --- src/ChangeLog | 4 ++++ src/xmenu.c | 1 + 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 3c6efb16308..bf52364ee66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-05-02 Andreas Schwab + + * xmenu.c (restore_menu_items): Return a value. + 2006-05-01 Martin Rudalics * syntax.c (Fforward_comment): Detect generic comment at beginning of diff --git a/src/xmenu.c b/src/xmenu.c index bb8cb19cbdf..c740062a82f 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -327,6 +327,7 @@ restore_menu_items (saved) menu_items_n_panes = XINT (XCAR (saved)); saved = XCDR (saved); menu_items_submenu_depth = XINT (XCAR (saved)); + return Qnil; } /* Push the whole state of menu_items processing onto the specpdl. -- cgit v1.2.1