summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog13
-rw-r--r--src/nsfns.m16
-rw-r--r--src/nsfont.m4
-rw-r--r--src/nsterm.h6
-rw-r--r--src/nsterm.m33
5 files changed, 54 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1001872d48f..a9cb2d45225 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
+2008-08-20 Adrian Robert <Adrian.B.Robert@gmail.com>
+
+ * nsfns.m (ns-read-file-name): Add casts to avoid warning.
+ (ns-convert-utf8-nfd-to-nfc): Warn if cannot execute correctly.
+ * nsfont.m (nsfont_draw): Compare indexed colors to 0, not nil.
+ * nsterm.h (EmacsView-unlockFocusNeedsFlush:): Add declaration.
+ (EmacsApp-cursor_blink_handler): Remove declaration.
+ * nsterm.m (ns_draw_glyph_string): Update first conditional body to
+ match 01 Feb 2008 changes in xterm.c.
+ (ns_read_socket): Add cast to avoid warning.
+ (EmacsApp-application:openFiles:): Don't call replyToOpenOrPrint: on
+ GNUstep.
+
2008-08-20 Chong Yidong <cyd@stupidchicken.com>
* xselect.c (x_get_foreign_selection): Return nil if desired
diff --git a/src/nsfns.m b/src/nsfns.m
index d9909330b2e..bd705b53868 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1440,7 +1440,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */)
dirS = [dirS stringByExpandingTildeInPath];
panel = NILP (isLoad) ?
- [EmacsSavePanel savePanel] : [EmacsOpenPanel openPanel];
+ (id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel];
[panel setTitle: promptS];
@@ -1988,11 +1988,21 @@ DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc,
(str)
Lisp_Object str;
{
+/* TODO: If GNUstep ever implements precomposedStringWithCanonicalMapping,
+ remove this. */
NSString *utfStr;
CHECK_STRING (str);
- utfStr = [[NSString stringWithUTF8String: SDATA (str)]
- precomposedStringWithCanonicalMapping];
+ utfStr = [NSString stringWithUTF8String: SDATA (str)];
+ if (![utfStr respondsToSelector:
+ @selector (precomposedStringWithCanonicalMapping)])
+ {
+ message1
+ ("Warning: ns-convert-utf8-nfd-to-nfc unsupported under GNUstep.\n");
+ return Qnil;
+ }
+ else
+ utfStr = [utfStr precomposedStringWithCanonicalMapping];
return build_string ([utfStr UTF8String]);
}
diff --git a/src/nsfont.m b/src/nsfont.m
index 0fb98d77180..f49cd0ffbda 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -1016,13 +1016,13 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
/* do underline */
if (face->underline_p)
{
- if (face->underline_color != nil)
+ if (face->underline_color != 0)
[ns_lookup_indexed_color (face->underline_color, s->f) set];
else
[col set];
DPSmoveto (context, r.origin.x, r.origin.y + font->underpos);
DPSlineto (context, r.origin.x+r.size.width, r.origin.y+font->underpos);
- if (face->underline_color != nil)
+ if (face->underline_color != 0)
[col set];
}
else
diff --git a/src/nsterm.h b/src/nsterm.h
index 224d15fd527..97db10ce338 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -41,7 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- (void)showPreferencesWindow: (id)sender;
- (BOOL) openFile: (NSString *)fileName;
- (void)fd_handler: (NSTimer *) fdEntry;
-- (void)cursor_blink_handler: (NSTimer *)cursorEntry;
- (void)timeout_handler: (NSTimer *)timedEntry;
- (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
@end
@@ -83,6 +82,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- (void) setWindowClosing: (BOOL)closing;
- (EmacsToolbar *) toolbar;
- (void) deleteWorkingText;
+
+#ifdef NS_IMPL_GNUSTEP
+/* Not declared, but useful. */
+- (void) unlockFocusNeedsFlush: (BOOL)needs;
+#endif
@end
diff --git a/src/nsterm.m b/src/nsterm.m
index 561a9b62883..c077c1aedda 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2273,7 +2273,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
struct frame *f = WINDOW_XFRAME (w);
struct glyph *phys_cursor_glyph;
int overspill;
- unsigned char drawGlyph = 0, cursorType, oldCursorType;
+ char drawGlyph = 0, cursorType, oldCursorType;
int new_cursor_type;
int new_cursor_width;
int active_cursor;
@@ -2928,13 +2928,21 @@ ns_draw_glyph_string (struct glyph_string *s)
NSTRACE (ns_draw_glyph_string);
- if (s->next && s->right_overhang && !s->for_overlaps && s->hl != DRAW_CURSOR)
+ if (s->next && s->right_overhang && !s->for_overlaps/* && s->hl != DRAW_CURSOR*/)
{
- xassert (s->next->img == NULL);
- n = ns_get_glyph_string_clip_rect (s->next, r);
- ns_focus (s->f, r, n);
- ns_maybe_dumpglyphs_background (s->next, 1);
- ns_unfocus (s->f);
+ int width;
+ struct glyph_string *next;
+
+ for (width = 0, next = s->next; next;
+ width += next->width, next = next->next)
+ if (next->first_glyph->type != IMAGE_GLYPH)
+ {
+ n = ns_get_glyph_string_clip_rect (s->next, r);
+ ns_focus (s->f, r, n);
+ ns_maybe_dumpglyphs_background (s->next, 1);
+ ns_unfocus (s->f);
+ next->num_clips = 0;
+ }
}
if (!s->for_overlaps && s->face->box != FACE_NO_BOX
@@ -3044,6 +3052,7 @@ ns_draw_glyph_string (struct glyph_string *s)
ns_unfocus (s->f);
}
+ s->num_clips = 0;
}
@@ -3149,7 +3158,7 @@ ns_read_socket (struct terminal *terminal, int expected,
/* If have pending open-file requests, attend to the next one of those. */
if (ns_pending_files && [ns_pending_files count] != 0
- && [NSApp openFile: [ns_pending_files objectAtIndex: 0]])
+ && [(EmacsApp *)NSApp openFile: [ns_pending_files objectAtIndex: 0]])
{
[ns_pending_files removeObjectAtIndex: 0];
}
@@ -4194,11 +4203,11 @@ fprintf (stderr, "res = %d\n", EQ (res, Qt)); /* FIXME */
while ((file = [files nextObject]) != nil)
[ns_pending_files addObject: file];
-#ifdef NS_IMPL_GNUSTEP
- [self replyToOpenOrPrint: 0];
-#else
+/* TODO: when GNUstep implements this (and we require that version of
+ GNUstep), remove. */
+#ifndef NS_IMPL_GNUSTEP
[self replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
-#endif /* NS_IMPL_GNUSTEP */
+#endif /* !NS_IMPL_GNUSTEP */
}