Merge Source/NSImageView.m Source/NSInputManager.m Source/NSLayoutManager.m

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38730 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-07-01 19:32:05 +00:00
parent d867a44374
commit 2a41972a78
3 changed files with 21 additions and 11 deletions

View file

@ -81,6 +81,7 @@ static Class imageCellClass;
[self setImageFrameStyle: NSImageFrameNone];
[self setImageScaling: NSScaleProportionally];
[self setEditable: NO];
[self setAllowsCutCopyPaste: YES];
return self;
}
@ -307,11 +308,13 @@ static Class imageCellClass;
- (void) mouseDown: (NSEvent*)theEvent
{
// Testplant-MAL-2015-06-30: merge: left this in from testplant branch...
if (![self isEditable])
{
[[self nextResponder] mouseDown:theEvent];
return;
}
if ([self initiatesDrag])
{
NSPasteboard *pboard;
@ -402,6 +405,7 @@ static Class imageCellClass;
if (!self)
return self;
[self setAllowsCutCopyPaste: YES];
if ([aDecoder allowsKeyedCoding])
{
//NSArray *dragType = [aDecoder decodeObjectForKey: @"NSDragTypes"];

View file

@ -45,6 +45,8 @@ static struct
NSString *name;
unichar character;
}
// Testplant-MAL-2015-06-30: Removed main branch constant definition...
character_table[] =
{
/* Function keys. */
@ -131,6 +133,8 @@ character_table[] =
{ @"CarriageReturn", NSCarriageReturnCharacter },
{ @"Escape", 0x1b }
};
// Testplant-MAL-2015-06-30: This replaces main branch constant definition...
static int CHARACTER_TABLE_SIZE = (sizeof(character_table) / sizeof(character_table[0]));
static NSInputManager *currentInputManager = nil;
@ -675,6 +679,7 @@ static NSInputManager *currentInputManager = nil;
case NSEnterCharacter:
case NSFormFeedCharacter:
case NSCarriageReturnCharacter:
// Testplant-MAL-2015-06-30: Included from testplant branch...
if (flags & NSAlternateKeyMask)
{
[self doCommandBySelector: @selector (insertNewlineIgnoringFieldEditor:)];

View file

@ -884,28 +884,28 @@ has the same y origin and height as the line frag rect it is in.
if (glyph_index == (unsigned int)-1)
{ /* No information is available. Get default font height. */
NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName];
NSParagraphStyle *paragraph = [_typingAttributes objectForKey: NSParagraphStyleAttributeName];
NSTextAlignment alignment = [paragraph alignment];
/* will be -1 if there are no text containers */
*textContainer = num_textcontainers - 1;
r = NSMakeRect(0, 0, 1, [f boundingRectForFont].size.height);
if (num_textcontainers > 0)
{
NSParagraphStyle *paragraph = [_typingAttributes objectForKey: NSParagraphStyleAttributeName];
NSTextAlignment alignment = [paragraph alignment];
tc = textcontainers + num_textcontainers - 1;
r.origin.x += [tc->textContainer lineFragmentPadding];
}
// Apply left/right/center justification...
if (alignment == NSRightTextAlignment)
{
r.origin.x += [[self firstTextView] frame].size.width;
r.origin.x += [tc->textContainer containerSize].width;
}
else if (alignment == NSCenterTextAlignment)
{
r.origin.x += [[self firstTextView] frame].size.width / 2;
r.origin.x += [tc->textContainer containerSize].width / 2;
}
}
return r;
}
fraction_through = 1.0;
@ -1389,7 +1389,8 @@ container
int i, j;
NSRect *rects;
NSUInteger count;
NSColor *color, *last_color;
NSColor *color = nil;
NSColor *last_color = nil;
NSGraphicsContext *ctxt = GSCurrentContext();
@ -1419,14 +1420,15 @@ container
glyph_run = run_for_glyph_index(range.location, glyphs, &glyph_pos, &char_pos);
i = range.location - glyph_pos;
last_color = nil;
first_char_pos = char_pos;
while (1)
while ((glyph_run != NULL) && (i + glyph_pos < range.location + range.length))
{
NSRange r = NSMakeRange(glyph_pos + i, glyph_run->head.glyph_length - i);
if (NSMaxRange(r) > NSMaxRange(range))
{
r.length = NSMaxRange(range) - r.location;
}
color = [_textStorage attribute: NSBackgroundColorAttributeName
atIndex: char_pos
@ -1459,8 +1461,6 @@ container
char_pos += glyph_run->head.char_length;
i = 0;
glyph_run = (glyph_run_t *)glyph_run->head.next;
if (i + glyph_pos >= range.location + range.length)
break;
}
if (!_selected_range.length || _selected_range.location == NSNotFound)
@ -1864,6 +1864,7 @@ attachmentSize(linefrag_t *lf, NSUInteger glyphIndex)
if (!gbuf_len)
{
gbuf[0] = glyph->g;
advancementbuf[0] = [f advancementForGlyph: glyph->g];
gbuf_point = p;
gbuf_len = 1;
}