Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor renamings of some APIs #278

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Headers/AppKit/NSPasteboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ APPKIT_EXPORT NSString *const NSPasteboardTypeMultipleTextSelection;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
APPKIT_EXPORT NSString *const NSPasteboardTypeTextFinderOptions;
#endif

#if OS_API_VERSION(MAC_OS_X_VERSION_10_13, GS_API_LATEST)
typedef NSString *NSPasteboardType;
#endif
#endif


Expand Down
6 changes: 5 additions & 1 deletion Headers/AppKit/NSProgressIndicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ typedef enum _NSProgressIndicatorThickness
typedef enum _NSProgressIndicatorStyle
{
NSProgressIndicatorBarStyle = 0,
NSProgressIndicatorSpinningStyle = 1
NSProgressIndicatorSpinningStyle = 1,
#if OS_API_VERSION(MAC_OS_X_VERSION_10_13, GS_API_LATEST)
NSProgressIndicatorStyleBar = 0,
NSProgressIndicatorStyleSpinning = 1
#endif
} NSProgressIndicatorStyle;

APPKIT_EXPORT_CLASS
Expand Down
7 changes: 6 additions & 1 deletion Headers/AppKit/NSViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ APPKIT_EXPORT_CLASS
- (void) viewDidAppear: (BOOL)animated;
- (void) viewWillDisappear: (BOOL)animated;
- (void) viewDidDisappear: (BOOL)animated;

#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
- (void) viewWillAppear;
- (void) viewDidAppear;
- (void) viewWillDisappear;
- (void) viewDidDisappear;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
- (void) dismissViewController: (NSViewController *)viewController;
- (void) dismissController: (id)sender;
Expand Down
20 changes: 20 additions & 0 deletions Source/NSViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ - (void)viewDidLoad

- (void) viewWillAppear: (BOOL)animated
{
[self viewWillAppear];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the call order should be the other way around. That is in viewWillAppear we should call viewWillAppear: with NO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple's docs indicate that developers are supposed to override viewWillAppear. viewWillAppear: seems to be a GNUstep extension; it never appears in NSViewController.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if in viewWillAppear we call viewWithAppear:NO people will subclass NSViewController and implement viewWillAppear, but any calls to viewWillAppear:NO in gnustep-gui will bypass their implementation. But if in viewWillAppear: we call viewWithAppear, we will use people's implementations in their subclasses whenever gnustep-gui calls viewWithAppear:NO.

}

- (void) viewIsAppearing: (BOOL)animated
Expand All @@ -91,13 +92,32 @@ - (void) viewIsAppearing: (BOOL)animated

- (void) viewDidAppear: (BOOL)animated
{
[self viewDidAppear];
}

- (void) viewWillDisappear: (BOOL)animated
{
[self viewWillDisappear];
}

- (void) viewDidDisappear: (BOOL)animated
{
[self viewDidDisappear];
}

- (void) viewWillAppear
{
}

- (void) viewWillDisappear
{
}

- (void) viewDidAppear
{
}

- (void) viewDidDisappear
{
}

Expand Down
Loading