Ticket #20486: emacs-cocoa.diff

File emacs-cocoa.diff, 2.3 KB (added by tobypeterson, 15 years ago)
  • src/nsfns.m

     
    17711771{
    17721772  check_ns ();
    17731773#ifdef NS_IMPL_COCOA
    1774   PSFlush ();
    17751774#endif
    17761775  /*ns_delete_terminal (dpyinfo->terminal); */
    17771776  [NSApp terminate: NSApp];
  • src/nsfont.m

     
    238238            return w;
    239239      }
    240240#endif
    241     w = [sfont widthOfString: cstr];
     241    w = [cstr sizeWithAttributes:[NSDictionary dictionaryWithObject:sfont forKey:NSFontAttributeName]].width;
    242242    return max (w, 2.0);
    243243}
    244244
     
    841841    /* set up metrics portion of font struct */
    842842    font->ascent = [sfont ascender];
    843843    font->descent = -[sfont descender];
    844     font->min_width = [sfont widthOfString: @"|"]; /* FIXME */
     844    font->min_width = [@"|" sizeWithAttributes:[NSDictionary dictionaryWithObject:sfont forKey:NSFontAttributeName]].width;
    845845    font->space_width = lrint (ns_char_width (sfont, ' '));
    846846    font->average_width = lrint (font_info->width);
    847847    font->max_width = lrint (font_info->max_bounds.width);
     
    14321432}
    14331433
    14341434/* NSGlyphStorage protocol */
    1435 - (unsigned int)layoutOptions
     1435- (NSUInteger)layoutOptions
    14361436{
    14371437  return 0;
    14381438}
     
    14421442  return attrStr;
    14431443}
    14441444
    1445 - (void)insertGlyphs: (const NSGlyph *)glyphs length: (unsigned int)length
    1446         forStartingGlyphAtIndex: (unsigned int)glyphIndex
    1447         characterIndex: (unsigned int)charIndex
     1445- (void)insertGlyphs: (const NSGlyph *)glyphs length: (NSUInteger)length
     1446        forStartingGlyphAtIndex: (NSUInteger)glyphIndex
     1447        characterIndex: (NSUInteger)charIndex
    14481448{
    14491449  len = glyphIndex+length;
    14501450  for (i =glyphIndex; i<len; i++)
     
    14531453    maxGlyph = len;
    14541454}
    14551455
    1456 - (void)setIntAttribute: (int)attributeTag value: (int)val
    1457         forGlyphAtIndex: (unsigned)glyphIndex
     1456- (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val
     1457        forGlyphAtIndex: (NSUInteger)glyphIndex
    14581458{
    14591459  return;
    14601460}
  • src/nsgui.h

     
    134134typedef struct _NSRect  { NSPoint origin; NSSize size; } NSRect;
    135135#endif
    136136
    137 #define NativeRectangle struct _NSRect
     137#define NativeRectangle NSRect
    138138
    139139#define CONVERT_TO_XRECT(xr, nr)                \
    140140  ((xr).x     = (nr).origin.x,                  \