diff --git a/Headers/AppKit/AppKitDefines.h b/Headers/AppKit/AppKitDefines.h index 6e8f00862..f04eb138a 100644 --- a/Headers/AppKit/AppKitDefines.h +++ b/Headers/AppKit/AppKitDefines.h @@ -53,4 +53,10 @@ #endif +#ifdef __clang__ +# define PACKAGE_SCOPE @package +#else +# define PACKAGE_SCOPE @public +#endif + #endif /* __AppKitDefines_INCLUDE */ diff --git a/Headers/AppKit/NSResponder.h b/Headers/AppKit/NSResponder.h index 6464f6612..0e8ca21ef 100644 --- a/Headers/AppKit/NSResponder.h +++ b/Headers/AppKit/NSResponder.h @@ -46,11 +46,13 @@ @interface NSResponder : NSObject { +PACKAGE_SCOPE #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) NSInterfaceStyle _interface_style; #else int _interface_style; #endif +@protected NSResponder *_next_responder; /* diff --git a/Headers/AppKit/NSView.h b/Headers/AppKit/NSView.h index 82d6f39e2..f985b8669 100644 --- a/Headers/AppKit/NSView.h +++ b/Headers/AppKit/NSView.h @@ -104,10 +104,14 @@ typedef enum _NSFocusRingType { id _matrixFromWindow; NSView* _super_view; +PACKAGE_SCOPE NSMutableArray *_sub_views; +@protected NSWindow *_window; +PACKAGE_SCOPE NSMutableArray *_tracking_rects; NSMutableArray *_cursor_rects; +@protected NSRect _invalidRect; NSRect _visibleRect; int _gstate; diff --git a/Headers/AppKit/NSWindow.h b/Headers/AppKit/NSWindow.h index b9edc6989..cace9372d 100644 --- a/Headers/AppKit/NSWindow.h +++ b/Headers/AppKit/NSWindow.h @@ -170,7 +170,9 @@ APPKIT_EXPORT NSSize NSTokenSize; id _firstResponder; id _futureFirstResponder; NSView *_initialFirstResponder; +PACKAGE_SCOPE id _delegate; +@protected id _fieldEditor; id _lastView; id _lastDragView; @@ -186,12 +188,16 @@ APPKIT_EXPORT NSSize NSTokenSize; NSString *_miniaturizedTitle; NSImage *_miniaturizedImage; NSString *_windowTitle; +PACKAGE_SCOPE NSPoint _lastPoint; +@protected NSBackingStoreType _backingType; unsigned _styleMask; int _windowLevel; +PACKAGE_SCOPE NSRect _rectNeedingFlush; NSMutableArray *_rectsBeingDrawn; +@protected unsigned _disableFlushWindow; NSWindowDepth _depthLimit; @@ -205,6 +211,7 @@ APPKIT_EXPORT NSSize NSTokenSize; NSPoint _cachedImageOrigin; NSWindow *_attachedSheet; +PACKAGE_SCOPE struct GSWindowFlagsType { unsigned accepts_drag:1; unsigned is_one_shot:1; @@ -246,7 +253,7 @@ APPKIT_EXPORT NSSize NSTokenSize; unsigned ignores_mouse_events: 1; unsigned preserves_content_during_live_resize: 1; } _f; - +@protected NSToolbar *_toolbar; void *_reserved_1; } diff --git a/Source/GSNibLoading.m b/Source/GSNibLoading.m index b38f9dbc1..d3db0e7f0 100644 --- a/Source/GSNibLoading.m +++ b/Source/GSNibLoading.m @@ -31,6 +31,8 @@ Boston, MA 02110-1301, USA. */ +#define EXPOSE_NSKeyedUnarchiver_IVARS + #import #import #import diff --git a/Source/GSToolTips.m b/Source/GSToolTips.m index 760b9b9b0..49aacad11 100644 --- a/Source/GSToolTips.m +++ b/Source/GSToolTips.m @@ -121,11 +121,13 @@ - (void) _endDisplay; - (void) _timedOut: (NSTimer *)timer; @end - +/* typedef struct NSView_struct { @defs(NSView) } *NSViewPtr; +*/ +typedef NSView* NSViewPtr; @implementation GSToolTips diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index 97ef60a39..abb1238d6 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -28,6 +28,8 @@ Boston, MA 02110-1301, USA. */ +#define EXPOSE_NSThread_IVARS + #import #import #import @@ -53,8 +55,6 @@ #import "GNUstepGUI/GSVersion.h" #import "GNUstepGUI/GSDisplayServer.h" -typedef struct { @defs(NSThread) } *TInfo; - /* The memory zone where all global objects are allocated from (Contexts are also allocated from this zone) */ static NSZone *_globalGSZone = NULL; @@ -97,7 +97,7 @@ NSGraphicsContext *GSCurrentContext(void) */ NSThread *th = GSCurrentThread(); - return (NSGraphicsContext*) ((TInfo)th)->_gcontext; + return (NSGraphicsContext*) th->_gcontext; #else NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; @@ -166,7 +166,7 @@ NSGraphicsContext *GSCurrentContext(void) */ NSThread *th = GSCurrentThread(); - ASSIGN(((TInfo)th)->_gcontext, context); + ASSIGN(th->_gcontext, context); #else NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; diff --git a/Source/NSInterfaceStyle.m b/Source/NSInterfaceStyle.m index 8dec00bfc..f2e3f3c33 100644 --- a/Source/NSInterfaceStyle.m +++ b/Source/NSInterfaceStyle.m @@ -61,9 +61,12 @@ styleFromString(NSString* str) +/* typedef struct { @defs(NSResponder) } *accessToResponder; +*/ +typedef NSResponder* accessToResponder; /**

diff --git a/Source/NSPasteboard.m b/Source/NSPasteboard.m index 5dce56060..26c45f33e 100644 --- a/Source/NSPasteboard.m +++ b/Source/NSPasteboard.m @@ -1530,6 +1530,11 @@ static NSMapTable *mimeMap = NULL; return ok; } +- (BOOL)writeObjects: (NSArray*)objects +{ + +} + /** *

Serialises the data in the supplied property list and writes it to the * pasteboard server using the -setData:forType: method. diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 4b6ef823d..6341790e7 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -1553,15 +1553,10 @@ createRowsForColumn: (int)column column: (int)column; @end -struct NSSavePanel_struct -{ - @defs (NSSavePanel) -}; - static int compareFilenames (id elem1, id elem2, void *context) { /* TODO - use IMP optimization here. */ - struct NSSavePanel_struct *s = (struct NSSavePanel_struct *)context; + NSSavePanel *s = context; NSSavePanel *self = (NSSavePanel *)context; return (int)[s->_delegate panel: self diff --git a/Source/NSView.m b/Source/NSView.m index ada08cbf5..2d7c48862 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -99,11 +99,6 @@ */ NSView *viewIsPrinting = nil; -struct NSWindow_struct -{ - @defs(NSWindow) -}; - /** NSView @@ -2022,8 +2017,7 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, NSStringFromRect(_frame),_rFlags.flipped_view); if (viewIsPrinting == nil) { - struct NSWindow_struct *window_t = (struct NSWindow_struct *)_window; - [window_t->_rectsBeingDrawn addObject: [NSValue valueWithRect: wrect]]; + [_window->_rectsBeingDrawn addObject: [NSValue valueWithRect: wrect]]; } /* Make sure we don't modify superview's gstate */ @@ -2155,16 +2149,14 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, if (viewIsPrinting == nil) { NSRect rect; - struct NSWindow_struct *window_t; - window_t = (struct NSWindow_struct *)_window; if (flush && !_rFlags.ignores_backing) { - rect = [[window_t->_rectsBeingDrawn lastObject] rectValue]; - window_t->_rectNeedingFlush = - NSUnionRect(window_t->_rectNeedingFlush, rect); - window_t->_f.needs_flush = YES; + rect = [[_window->_rectsBeingDrawn lastObject] rectValue]; + _window->_rectNeedingFlush = + NSUnionRect(_window->_rectNeedingFlush, rect); + _window->_f.needs_flush = YES; } - [window_t->_rectsBeingDrawn removeLastObject]; + [_window->_rectsBeingDrawn removeLastObject]; } [ctxt unlockFocusView: self needsFlush: YES ]; [NSGraphicsContext restoreGraphicsState]; @@ -2606,10 +2598,8 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, { // FIXME static NSRect rect; - struct NSWindow_struct *window_t; - window_t = (struct NSWindow_struct *)_window; - rect = [[window_t->_rectsBeingDrawn lastObject] rectValue]; + rect = [[_window->_rectsBeingDrawn lastObject] rectValue]; rect = [self convertRect: rect fromView: nil]; if (rects != NULL) @@ -3123,7 +3113,7 @@ Returns YES iff any scrolling was done. [_cursor_rects getObjects: rects]; if (_rFlags.valid_rects != 0) { - NSPoint loc = ((struct NSWindow_struct *)_window)->_lastPoint; + NSPoint loc = _window->_lastPoint; unsigned i; for (i = 0; i < count; ++i) diff --git a/Source/NSWindow.m b/Source/NSWindow.m index cac72f8c7..12455af02 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -596,12 +596,6 @@ static NSSize scaledIconSizeForSize(NSSize imageSize) */ @implementation NSWindow -typedef struct NSView_struct -{ - @defs(NSView) -} *NSViewPtr; - - /* * Class variables */ @@ -2548,14 +2542,14 @@ discardCursorRectsForView(NSView *theView) { if (theView != nil) { - if (((NSViewPtr)theView)->_rFlags.has_currects) + if (theView->_rFlags.has_currects) { [theView discardCursorRects]; } - if (((NSViewPtr)theView)->_rFlags.has_subviews) + if (theView->_rFlags.has_subviews) { - NSArray *s = ((NSViewPtr)theView)->_sub_views; + NSArray *s = theView->_sub_views; unsigned count = [s count]; if (count) @@ -2585,7 +2579,7 @@ discardCursorRectsForView(NSView *theView) - (void) invalidateCursorRectsForView: (NSView*)aView { - if (((NSViewPtr)aView)->_rFlags.valid_rects) + if (aView->_rFlags.valid_rects) { [aView discardCursorRects]; @@ -2616,9 +2610,9 @@ resetCursorRectsForView(NSView *theView) { [theView resetCursorRects]; - if (((NSViewPtr)theView)->_rFlags.has_subviews) + if (theView->_rFlags.has_subviews) { - NSArray *s = ((NSViewPtr)theView)->_sub_views; + NSArray *s = theView->_sub_views; unsigned count = [s count]; if (count) @@ -3340,9 +3334,9 @@ resetCursorRectsForView(NSView *theView) - (void) _checkTrackingRectangles: (NSView*)theView forEvent: (NSEvent*)theEvent { - if (((NSViewPtr)theView)->_rFlags.has_trkrects) + if (theView->_rFlags.has_trkrects) { - NSArray *tr = ((NSViewPtr)theView)->_tracking_rects; + NSArray *tr = theView->_tracking_rects; unsigned count = [tr count]; /* @@ -3433,9 +3427,9 @@ resetCursorRectsForView(NSView *theView) /* * Check tracking rectangles for the subviews */ - if (((NSViewPtr)theView)->_rFlags.has_subviews) + if (theView->_rFlags.has_subviews) { - NSArray *sb = ((NSViewPtr)theView)->_sub_views; + NSArray *sb = theView->_sub_views; unsigned count = [sb count]; if (count > 0) @@ -3455,9 +3449,9 @@ resetCursorRectsForView(NSView *theView) - (void) _checkCursorRectangles: (NSView*)theView forEvent: (NSEvent*)theEvent { - if (((NSViewPtr)theView)->_rFlags.valid_rects) + if (theView->_rFlags.valid_rects) { - NSArray *tr = ((NSViewPtr)theView)->_cursor_rects; + NSArray *tr = theView->_cursor_rects; unsigned count = [tr count]; // Loop through cursor rectangles @@ -3523,9 +3517,9 @@ resetCursorRectsForView(NSView *theView) /* * Check cursor rectangles for the subviews */ - if (((NSViewPtr)theView)->_rFlags.has_subviews) + if (theView->_rFlags.has_subviews) { - NSArray *sb = ((NSViewPtr)theView)->_sub_views; + NSArray *sb = theView->_sub_views; unsigned count = [sb count]; if (count > 0) @@ -4064,7 +4058,7 @@ resetCursorRectsForView(NSView *theView) while (v != nil) { - if (((NSViewPtr)v)->_rFlags.has_draginfo != 0 + if (v->_rFlags.has_draginfo != 0 && GSViewAcceptsDrag(v, dragInfo)) break; v = [v superview];