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