From: <de...@us...> - 2009-09-23 01:29:47
|
Revision: 1829 http://iterm.svn.sourceforge.net/iterm/?rev=1829&view=rev Author: delx Date: 2009-09-23 01:29:40 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Merged newsparkle with trunk Modified Paths: -------------- branches/newsparkle/Changelog branches/newsparkle/PTYSession.m branches/newsparkle/PTYTextView.m Property Changed: ---------------- branches/newsparkle/ branches/newsparkle/Korean.lproj/AddressBook.strings branches/newsparkle/Korean.lproj/FindPanel.strings branches/newsparkle/Korean.lproj/MainMenu.strings branches/newsparkle/Korean.lproj/PreferencePanel.strings branches/newsparkle/Korean.lproj/PseudoTerminal.strings branches/newsparkle/PSMTabBarControl/images/overflowImage.tiff branches/newsparkle/PSMTabBarControl/images/overflowImagePressed.tif branches/newsparkle/PSMTabBarControl/source/NSBezierPath_AMShading.h branches/newsparkle/PSMTabBarControl/source/NSBezierPath_AMShading.m Property changes on: branches/newsparkle ___________________________________________________________________ Added: svn:mergeinfo + /trunk:1810-1828 Modified: branches/newsparkle/Changelog =================================================================== --- branches/newsparkle/Changelog 2009-09-23 01:18:49 UTC (rev 1828) +++ branches/newsparkle/Changelog 2009-09-23 01:29:40 UTC (rev 1829) @@ -1,3 +1,15 @@ +2009-09-22 delx + * Draw bold text the old fashioned way, much faster + * Separate bold & highlight attributes for text + * New behaviour gives four distinct modes -- plain, bold, highlight, bold+highlight + Use the disable bold option to collapse the last 3 into one + +2009-09-20 delx + * Fixed blinking text + * Fixed drawing corruption when new text is placed into a full buffer is not scrolled to the bottom + * Fixed a careless redraw error + * Fixed refreshing of non-active tabs (#2862256) + 2009-09-17 delx * Save cursor position separately for alternate screens (#2833765) * Show correct window titles (#2765347) Property changes on: branches/newsparkle/Korean.lproj/AddressBook.strings ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/Korean.lproj/FindPanel.strings ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/Korean.lproj/MainMenu.strings ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/Korean.lproj/PreferencePanel.strings ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/Korean.lproj/PseudoTerminal.strings ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/PSMTabBarControl/images/overflowImage.tiff ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/PSMTabBarControl/images/overflowImagePressed.tif ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/PSMTabBarControl/source/NSBezierPath_AMShading.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: branches/newsparkle/PSMTabBarControl/source/NSBezierPath_AMShading.m ___________________________________________________________________ Deleted: svn:executable - * Modified: branches/newsparkle/PTYSession.m =================================================================== --- branches/newsparkle/PTYSession.m 2009-09-23 01:18:49 UTC (rev 1828) +++ branches/newsparkle/PTYSession.m 2009-09-23 01:29:40 UTC (rev 1829) @@ -1742,18 +1742,15 @@ gettimeofday(&now, NULL); if(now.tv_sec*10+now.tv_usec/100000 >= lastBlink.tv_sec*10+lastBlink.tv_usec/100000+7) { - [TEXTVIEW refresh]; if([parent tempTitle]) { [parent setWindowTitle]; [parent resetTempTitle]; } lastBlink = now; } - else { - [TEXTVIEW refresh]; - } } + [TEXTVIEW refresh]; [self scheduleUpdateSoon:NO]; } Modified: branches/newsparkle/PTYTextView.m =================================================================== --- branches/newsparkle/PTYTextView.m 2009-09-23 01:18:49 UTC (rev 1828) +++ branches/newsparkle/PTYTextView.m 2009-09-23 01:29:40 UTC (rev 1829) @@ -377,7 +377,7 @@ } } else { - if((index & BOLD_MASK) && (index % 256 < 8)) { + if([self disableBold] && (index & BOLD_MASK) && (index % 256 < 8)) { index = index - BOLD_MASK + 8; } color = colorTable[index & 0xff]; @@ -605,10 +605,11 @@ if(now.tv_sec*10+now.tv_usec/100000 >= lastBlink.tv_sec*10+lastBlink.tv_usec/100000+7) { blinkShow = !blinkShow; lastBlink = now; + [self setNeedsDisplay:YES]; } - // Grow to allow space for drawing the new lines if(height != frame.size.height) { + // Grow to allow space for drawing the new lines // XXX - EPIC HACK below // NSClipView has setCopiesOnScroll:YES by default. According to Apple // this means it will do a quick copy of all the unchanged portion of @@ -643,10 +644,11 @@ [self setNeedsDisplayInRect:dirty]; } } - // Handle scrollback overflows else if(scrollbackOverflow > 0) { NSScrollView* scrollView = [self enclosingScrollView]; + NSClipView* clipView = [scrollView contentView]; float amount = [scrollView verticalLineScroll] * scrollbackOverflow; + BOOL userScroll = [(PTYScroller*)([scrollView verticalScroller]) userScroll]; // Keep correct selection highlighted startY -= scrollbackOverflow; @@ -656,21 +658,23 @@ if(oldStartY < 0) oldStartX = -1; oldEndY -= scrollbackOverflow; - // Keep the users' current scroll position - if([(PTYScroller*)([scrollView verticalScroller]) userScroll]) { + // Keep the users' current scroll position, nothing to redraw + if(userScroll) { NSRect scrollRect = [self visibleRect]; scrollRect.origin.y -= amount; if(scrollRect.origin.y < 0) scrollRect.origin.y = 0; + [clipView setCopiesOnScroll:NO]; [self scrollRectToVisible:scrollRect]; + [clipView setCopiesOnScroll:YES]; + return; } // Shift the old content upwards - if(scrollbackOverflow < [dataSource height]) { + if(scrollbackOverflow < [dataSource height] && !userScroll) { [self scrollRect:[self visibleRect] by:NSMakeSize(0, -amount)]; } } - // Mark dirty chars for redraw [self updateDirtyRects]; } @@ -2468,60 +2472,21 @@ - (void) _drawCharacter:(unichar)code fgColor:(int)fg AtX:(float)X Y:(float)Y doubleWidth:(BOOL) dw { - if (!code) { - return; - } + if (!code) return; - //NSLog(@"%s: %c(%d)",__PRETTY_FUNCTION__, code,code); - // - NSColor* color; - NSString* crap; - NSDictionary* attrib; - NSFont* theFont; - float sw; - BOOL renderBold; - NSFontManager* fontManager = [NSFontManager sharedFontManager]; + NSFont* theFont = dw?nafont:font; + BOOL renderBold = (fg&BOLD_MASK) && ![self disableBold]; + NSColor* color = [self colorForCode: fg]; - theFont = dw?nafont:font; - renderBold = (fg&BOLD_MASK) && ![self disableBold]; - color = [self colorForCode: fg]; - - if(renderBold) { - theFont = [fontManager convertFont: theFont toHaveTrait: NSBoldFontMask]; - - // Check if there is native bold support - // if conversion was successful, else use our own methods to convert to bold - if ([fontManager traitsOfFont:theFont] & NSBoldFontMask) { - sw = antiAlias ? strokeWidth:0; - renderBold = NO; - } - else { - sw = antiAlias? boldStrokeWidth : 0; - } - } - else { - sw = antiAlias ? strokeWidth:0; - } + NSDictionary* attrib=[NSDictionary dictionaryWithObjectsAndKeys: + theFont, NSFontAttributeName, color, NSForegroundColorAttributeName, + nil]; - if (OSX_TIGERORLATER && sw) { - attrib=[NSDictionary dictionaryWithObjectsAndKeys: - theFont, NSFontAttributeName, - color, NSForegroundColorAttributeName, - [NSNumber numberWithFloat: sw], @"NSStrokeWidth", - nil]; - } - else { - attrib=[NSDictionary dictionaryWithObjectsAndKeys: - theFont, NSFontAttributeName, - color, NSForegroundColorAttributeName, - nil]; - } - - crap = [NSString stringWithCharacters:&code length:1]; + NSString* crap = [NSString stringWithCharacters:&code length:1]; [crap drawWithRect:NSMakeRect(X,Y+[theFont ascender], 0, 0) options:0 attributes:attrib]; - // on older systems, for bold, redraw the character offset by 1 pixel - if (renderBold && (!OSX_TIGERORLATER || !antiAlias)) { + // redraw the character offset by 1 pixel, this is faster than real bold + if (renderBold) { [crap drawWithRect:NSMakeRect(X+1,Y+[theFont ascender], 0, 0) options:0 attributes:attrib]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |