Hi,

This patch adds the NSLayoutManagerDelegate protocol to
NSLayoutManager.

The "delegate" property and its accessors are implemented in its parent
class, GSLayoutManager, which also already defines the
"layoutManager:didCompleteLayoutForTextContainer:atEnd:" delegate
method.

Sergio.
Index: Source/NSLayoutManager.m
===================================================================
--- Source/NSLayoutManager.m	(revision 39603)
+++ Source/NSLayoutManager.m	(working copy)
@@ -2495,6 +2495,12 @@
 
       [[textcontainers[i].textContainer textView] _layoutManagerDidInvalidateLayout];
     }
+
+  if ([_delegate respondsToSelector:
+    @selector(layoutManagerDidInvalidateLayout:)])
+    {
+      [_delegate layoutManagerDidInvalidateLayout: self];
+    }
 }
 
 
Index: Headers/AppKit/NSLayoutManager.h
===================================================================
--- Headers/AppKit/NSLayoutManager.h	(revision 39603)
+++ Headers/AppKit/NSLayoutManager.h	(working copy)
@@ -245,5 +245,24 @@
                                                inRange: (NSRange)range;
 #endif
 @end
+
+/*
+Methods implemented by the Delegate.
+
+GSLayoutManager Delegate protocol defines
+layoutManager:didCompleteLayoutForTextContainer:atEnd:
+*/
+
+#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
+@protocol NSLayoutManagerDelegate <NSObject>
+#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) && GS_PROTOCOLS_HAVE_OPTIONAL
+@optional
+#else
+@end
+@interface NSObject (NSLayoutManagerDelegate)
 #endif
+- (void)layoutManagerDidInvalidateLayout: (NSLayoutManager *)sender;
+@end
+#endif
+#endif
 
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to