Author: mlytwyn
Date: Wed Jul  1 21:32:05 2015
New Revision: 38730

URL: http://svn.gna.org/viewcvs/gnustep?rev=38730&view=rev
Log:
Merge Source/NSImageView.m Source/NSInputManager.m Source/NSLayoutManager.m

Modified:
    libs/gui/branches/gnustep_testplant_branch/Source/NSImageView.m
    libs/gui/branches/gnustep_testplant_branch/Source/NSInputManager.m
    libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSImageView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSImageView.m?rev=38730&r1=38729&r2=38730&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSImageView.m     
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSImageView.m     Wed Jul 
 1 21:32:05 2015
@@ -81,6 +81,7 @@
   [self setImageFrameStyle: NSImageFrameNone];
   [self setImageScaling: NSScaleProportionally];
   [self setEditable: NO];
+  [self setAllowsCutCopyPaste: YES];
 
   return self;
 }
@@ -307,11 +308,13 @@
 
 - (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 @@
   if (!self)
     return self;
 
+  [self setAllowsCutCopyPaste: YES];
   if ([aDecoder allowsKeyedCoding])
     {
       //NSArray *dragType = [aDecoder decodeObjectForKey: @"NSDragTypes"];

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSInputManager.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSInputManager.m?rev=38730&r1=38729&r2=38730&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSInputManager.m  
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSInputManager.m  Wed Jul 
 1 21:32:05 2015
@@ -45,6 +45,8 @@
   NSString *name;
   unichar character;
 } 
+
+// Testplant-MAL-2015-06-30: Removed main branch constant definition...
 character_table[] =
 {
   /* Function keys.  */
@@ -131,6 +133,8 @@
   { @"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 @@
         case NSEnterCharacter:
         case NSFormFeedCharacter:
         case NSCarriageReturnCharacter:
+          // Testplant-MAL-2015-06-30: Included from testplant branch...
           if (flags & NSAlternateKeyMask)
             {
               [self doCommandBySelector: @selector 
(insertNewlineIgnoringFieldEditor:)];

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m?rev=38730&r1=38729&r2=38730&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m 
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m Wed Jul 
 1 21:32:05 2015
@@ -884,28 +884,28 @@
       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 @@
   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 @@
 
   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 @@
       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 @@
              if (!gbuf_len)
                {
                  gbuf[0] = glyph->g;
+                 advancementbuf[0] = [f advancementForGlyph: glyph->g];
                  gbuf_point = p;
                  gbuf_len = 1;
                }


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to