mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-26 02:11:01 +00:00
Small code cleanups.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28976 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ec316b13b2
commit
04ee108b47
6 changed files with 128 additions and 104 deletions
|
@ -1,3 +1,12 @@
|
|||
2009-11-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSActionCell.m,
|
||||
* Source/NSAffineTransform.m
|
||||
White space changes and cleanup.
|
||||
* Headers/AppKit/NSAnimation.h: Change to new MacOSX type definitions.
|
||||
* Source/NSAnimation.m: Remove externs and white space changes.
|
||||
* Source/externs.m: Move externs from NSAnimation to here.
|
||||
|
||||
2009-11-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSApplication.m (-finishLaunching): Only activate the
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
|
||||
#include <Foundation/NSObject.h>
|
||||
#include <AppKit/AppKitDefines.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <AppKit/AppKitDefines.h>
|
||||
#include <GNUstepGUI/GSAnimator.h>
|
||||
|
||||
@class NSString;
|
||||
|
@ -45,22 +45,24 @@
|
|||
|
||||
/** These constants describe the curve of an animation,
|
||||
that is, the relative speed of an animation from start to finish. */
|
||||
typedef enum _NSAnimationCurve
|
||||
enum _NSAnimationCurve
|
||||
{
|
||||
NSAnimationEaseInOut = 0, // default
|
||||
NSAnimationEaseIn,
|
||||
NSAnimationEaseOut,
|
||||
NSAnimationLinear,
|
||||
NSAnimationSpeedInOut // GNUstep only
|
||||
} NSAnimationCurve;
|
||||
};
|
||||
typedef NSUInteger NSAnimationCurve;
|
||||
|
||||
/** These constants indicate the blocking mode of an NSAnimation object when it is running. */
|
||||
typedef enum _NSAnimationBlockingMode
|
||||
enum _NSAnimationBlockingMode
|
||||
{
|
||||
NSAnimationBlocking,
|
||||
NSAnimationNonblocking,
|
||||
NSAnimationNonblockingThreaded
|
||||
} NSAnimationBlockingMode;
|
||||
};
|
||||
typedef NSUInteger NSAnimationBlockingMode;
|
||||
|
||||
typedef float NSAnimationProgress;
|
||||
|
||||
|
@ -97,6 +99,9 @@ APPKIT_EXPORT NSString *NSAnimationProgressMarkNotification;
|
|||
/** Key used in the [NSNotification-userInfo] disctionary to access the current progress mark. */
|
||||
APPKIT_EXPORT NSString *NSAnimationProgressMark;
|
||||
|
||||
APPKIT_EXPORT NSString *NSAnimationTriggerOrderIn;
|
||||
APPKIT_EXPORT NSString *NSAnimationTriggerOrderOut;
|
||||
|
||||
/**
|
||||
* Objects of the NSAnimation class manage the timing and progress of
|
||||
* animations in the user interface. The class also lets you link together
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include "AppKit/NSActionCell.h"
|
||||
#include "AppKit/NSControl.h"
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import "AppKit/NSActionCell.h"
|
||||
#import "AppKit/NSControl.h"
|
||||
|
||||
@implementation NSActionCell
|
||||
|
||||
|
@ -341,6 +341,8 @@ static Class controlClass;
|
|||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
self = [super initWithCoder: aDecoder];
|
||||
if (!self)
|
||||
return nil;
|
||||
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
#include "config.h"
|
||||
#include <math.h>
|
||||
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#include "AppKit/NSAffineTransform.h"
|
||||
#include "AppKit/NSBezierPath.h"
|
||||
#include "AppKit/PSOperators.h"
|
||||
#import "AppKit/NSAffineTransform.h"
|
||||
#import "AppKit/NSBezierPath.h"
|
||||
#import "AppKit/PSOperators.h"
|
||||
|
||||
/* Private definitions */
|
||||
#define A matrix.m11
|
||||
|
|
|
@ -26,41 +26,32 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <AppKit/NSAnimation.h>
|
||||
#import <Foundation/NSDate.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSLock.h>
|
||||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSRunLoop.h>
|
||||
#import <Foundation/NSThread.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#include <GNUstepBase/GSLock.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSDate.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
|
||||
#import <AppKit/NSAnimation.h>
|
||||
#import <AppKit/NSApplication.h>
|
||||
// needed by NSViewAnimation
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSWindow.h>
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <math.h>
|
||||
|
||||
NSString* NSAnimationBlockingRunLoopMode = @"NSAnimationBlockingRunLoopMode";
|
||||
|
||||
/*===================*
|
||||
* NSAnimation class *
|
||||
*===================*/
|
||||
|
||||
NSString* NSAnimationProgressMarkNotification
|
||||
= @"NSAnimationProgressMarkNotification";
|
||||
|
||||
NSString *NSAnimationProgressMark
|
||||
= @"NSAnimationProgressMark";
|
||||
|
||||
NSString* NSAnimationBlockingRunLoopMode
|
||||
= @"NSAnimationBlockingRunLoopMode";
|
||||
|
||||
#define GSI_ARRAY_NO_RETAIN
|
||||
#define GSI_ARRAY_NO_RELEASE
|
||||
#define GSIArrayItem NSAnimationProgress
|
||||
|
||||
#include <math.h>
|
||||
#include <GNUstepBase/GSIArray.h>
|
||||
|
||||
// 'reasonable value' ?
|
||||
|
@ -98,6 +89,7 @@ static inline void
|
|||
_GSRationalBezierComputeBezierDesc(_GSRationalBezierDesc *rb)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
rb->n.p[i] = (rb->d.p[i] = rb->w[i]) * rb->p[i];
|
||||
_GSBezierComputeCoefficients(&rb->n);
|
||||
|
@ -216,6 +208,7 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
|||
+ (void) initialize
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 5; i++) // compute Bezier curve parameters...
|
||||
_gs_animationValueForCurve(&_gs_animationCurveDesc[i], 0.0, 0.0);
|
||||
_NSAnimationDefaultRunLoopModes
|
||||
|
@ -233,7 +226,6 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
|||
if (progress < 0.0) progress = 0.0;
|
||||
if (progress > 1.0) progress = 1.0;
|
||||
|
||||
|
||||
_NSANIMATION_LOCK;
|
||||
if (GSIArrayCount(_progressMarks) == 0)
|
||||
{ // First mark
|
||||
|
@ -1208,14 +1200,6 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
|||
* NSViewAnimation class *
|
||||
*=======================*/
|
||||
|
||||
NSString *NSViewAnimationTargetKey = @"NSViewAnimationTargetKey";
|
||||
NSString *NSViewAnimationStartFrameKey = @"NSViewAnimationStartFrameKey";
|
||||
NSString *NSViewAnimationEndFrameKey = @"NSViewAnimationEndFrameKey";
|
||||
NSString *NSViewAnimationEffectKey = @"NSViewAnimationEffectKey";
|
||||
|
||||
NSString *NSViewAnimationFadeInEffect = @"NSViewAnimationFadeInEffect";
|
||||
NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
||||
|
||||
@interface _GSViewAnimationBaseDesc : NSObject
|
||||
{
|
||||
id _target;
|
||||
|
@ -1251,6 +1235,7 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
|||
{
|
||||
NSZone* zone;
|
||||
id target;
|
||||
|
||||
zone = [self zone];
|
||||
RELEASE (self);
|
||||
target = [properties objectForKey: NSViewAnimationTargetKey];
|
||||
|
@ -1301,6 +1286,7 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
|||
if (progress < 1.0f)
|
||||
{
|
||||
NSRect r;
|
||||
|
||||
r.origin.x = _startFrame.origin.x
|
||||
+ progress*( _endFrame.origin.x - _startFrame.origin.x );
|
||||
r.origin.y = _startFrame.origin.y
|
||||
|
@ -1323,8 +1309,10 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
|||
}
|
||||
}
|
||||
|
||||
- (void) setTargetFrame: (NSRect) frame;
|
||||
{ [self subclassResponsibility: _cmd]; }
|
||||
- (void) setTargetFrame: (NSRect)frame
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
@end // implementation _GSViewAnimationDesc
|
||||
|
||||
|
@ -1359,8 +1347,10 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
|||
}
|
||||
}
|
||||
|
||||
- (void) setTargetFrame: (NSRect) frame;
|
||||
{ [_target setFrame:frame]; }
|
||||
- (void) setTargetFrame: (NSRect)frame
|
||||
{
|
||||
[_target setFrame: frame];
|
||||
}
|
||||
|
||||
@end // implementation _GSViewAnimationDesc
|
||||
|
||||
|
@ -1392,8 +1382,10 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
|||
}
|
||||
}
|
||||
|
||||
- (void) setTargetFrame: (NSRect) frame;
|
||||
{ [_target setFrame:frame display:YES]; }
|
||||
- (void) setTargetFrame: (NSRect) frame
|
||||
{
|
||||
[_target setFrame: frame display: YES];
|
||||
}
|
||||
|
||||
@end // implementation _GSWindowAnimationDesc
|
||||
|
||||
|
|
|
@ -76,6 +76,13 @@ NSString *NSWordTablesWriteException = @"WordTablesWrite";
|
|||
|
||||
NSString *GSWindowServerInternalException = @"WindowServerInternal";
|
||||
|
||||
// NSAnimation
|
||||
NSString* NSAnimationProgressMarkNotification
|
||||
= @"NSAnimationProgressMarkNotification";
|
||||
NSString *NSAnimationProgressMark = @"NSAnimationProgressMark";
|
||||
NSString *NSAnimationTriggerOrderIn = @"NSAnimationTriggerOrderIn";
|
||||
NSString *NSAnimationTriggerOrderOut = @"NSAnimationTriggerOrderOut";
|
||||
|
||||
// Application notifications
|
||||
NSString *NSApplicationDidBecomeActiveNotification
|
||||
= @"ApplicationDidBecomeActive";
|
||||
|
@ -384,6 +391,15 @@ NSString *NSViewBoundsDidChangeNotification
|
|||
NSString *NSViewGlobalFrameDidChangeNotification
|
||||
= @"NSViewGlobalFrameDidChangeNotification";
|
||||
|
||||
// NSViewAnimation
|
||||
NSString *NSViewAnimationTargetKey = @"NSViewAnimationTargetKey";
|
||||
NSString *NSViewAnimationStartFrameKey = @"NSViewAnimationStartFrameKey";
|
||||
NSString *NSViewAnimationEndFrameKey = @"NSViewAnimationEndFrameKey";
|
||||
NSString *NSViewAnimationEffectKey = @"NSViewAnimationEffectKey";
|
||||
NSString *NSViewAnimationFadeInEffect = @"NSViewAnimationFadeInEffect";
|
||||
NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
|
||||
|
||||
|
||||
// NSMenu notifications
|
||||
NSString* const NSMenuDidSendActionNotification = @"MenuDidSendAction";
|
||||
NSString* const NSMenuWillSendActionNotification = @"MenuWillSendAction";
|
||||
|
|
Loading…
Reference in a new issue