Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1ef4848

Browse files
committed
commit
1 parent 9705db6 commit 1ef4848

File tree

81 files changed

+9769
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+9769
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
Copyright (c) 2014-present, Facebook, Inc.
3+
All rights reserved.
4+
5+
This source code is licensed under the BSD-style license found in the
6+
LICENSE file in the root directory of this source tree. An additional grant
7+
of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#ifndef POP_POP_H
11+
#define POP_POP_H
12+
13+
#import "POPAnimatableProperty.h"
14+
#import "POPAnimation.h"
15+
#import "POPAnimationEvent.h"
16+
#import "POPAnimationExtras.h"
17+
#import "POPAnimationTracer.h"
18+
#import "POPAnimator.h"
19+
#import "POPBasicAnimation.h"
20+
#import "POPCustomAnimation.h"
21+
#import "POPDecayAnimation.h"
22+
#import "POPDefines.h"
23+
#import "POPGeometry.h"
24+
#import "POPPropertyAnimation.h"
25+
#import "POPSpringAnimation.h"
26+
27+
28+
#endif /* POP_POP_H */
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
Copyright (c) 2014-present, Facebook, Inc.
3+
All rights reserved.
4+
5+
This source code is licensed under the BSD-style license found in the
6+
LICENSE file in the root directory of this source tree. An additional grant
7+
of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#ifndef POPACTION_H
11+
#define POPACTION_H
12+
13+
#import <QuartzCore/CATransaction.h>
14+
#import "POPDefines.h"
15+
16+
17+
#ifdef __cplusplus
18+
19+
namespace POP {
20+
21+
/**
22+
@abstract Disables Core Animation actions using RAII.
23+
@discussion The disablement of actions is scoped to the current transaction.
24+
*/
25+
class ActionDisabler
26+
{
27+
BOOL state;
28+
29+
public:
30+
ActionDisabler() POP_NOTHROW
31+
{
32+
state = [CATransaction disableActions];
33+
[CATransaction setDisableActions:YES];
34+
}
35+
36+
~ActionDisabler()
37+
{
38+
[CATransaction setDisableActions:state];
39+
}
40+
};
41+
42+
/**
43+
@abstract Enables Core Animation actions using RAII.
44+
@discussion The enablement of actions is scoped to the current transaction.
45+
*/
46+
class ActionEnabler
47+
{
48+
BOOL state;
49+
50+
public:
51+
ActionEnabler() POP_NOTHROW
52+
{
53+
state = [CATransaction disableActions];
54+
[CATransaction setDisableActions:NO];
55+
}
56+
57+
~ActionEnabler()
58+
{
59+
[CATransaction setDisableActions:state];
60+
}
61+
};
62+
63+
}
64+
65+
#endif /* __cplusplus */
66+
67+
#endif /* POPACTION_H */
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/**
2+
Copyright (c) 2014-present, Facebook, Inc.
3+
All rights reserved.
4+
5+
This source code is licensed under the BSD-style license found in the
6+
LICENSE file in the root directory of this source tree. An additional grant
7+
of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#import <CoreGraphics/CoreGraphics.h>
11+
#import <Foundation/NSObject.h>
12+
13+
@class POPMutableAnimatableProperty;
14+
15+
/**
16+
@abstract Describes an animatable property.
17+
*/
18+
@interface POPAnimatableProperty : NSObject <NSCopying, NSMutableCopying>
19+
20+
/**
21+
@abstract Property accessor.
22+
@param name The name of the property.
23+
@return The animatable property with that name or nil if it does not exist.
24+
@discussion Common animatable properties are included by default. Use the provided constants to reference.
25+
*/
26+
+ (id)propertyWithName:(NSString *)name;
27+
28+
/**
29+
@abstract The designated initializer.
30+
@param name The name of the property.
31+
@param block The block used to configure the property on creation.
32+
@return The animatable property with name if it exists, otherwise a newly created instance configured by block.
33+
@discussion Custom properties should use reverse-DNS naming. A newly created instance is only mutable in the scope of block. Once constructed, a property becomes immutable.
34+
*/
35+
+ (id)propertyWithName:(NSString *)name initializer:(void (^)(POPMutableAnimatableProperty *prop))block;
36+
37+
/**
38+
@abstract The name of the property.
39+
@discussion Used to uniquely identify an animatable property.
40+
*/
41+
@property (readonly, nonatomic, copy) NSString *name;
42+
43+
/**
44+
@abstract Block used to read values from a property into an array of floats.
45+
*/
46+
@property (readonly, nonatomic, copy) void (^readBlock)(id obj, CGFloat values[]);
47+
48+
/**
49+
@abstract Block used to write values from an array of floats into a property.
50+
*/
51+
@property (readonly, nonatomic, copy) void (^writeBlock)(id obj, const CGFloat values[]);
52+
53+
/**
54+
@abstract The threshold value used when determining completion of dynamics simulations.
55+
*/
56+
@property (readonly, nonatomic, assign) CGFloat threshold;
57+
58+
@end
59+
60+
/**
61+
@abstract A mutable animatable property intended for configuration.
62+
*/
63+
@interface POPMutableAnimatableProperty : POPAnimatableProperty
64+
65+
/**
66+
@abstract A read-write version of POPAnimatableProperty name property.
67+
*/
68+
@property (readwrite, nonatomic, copy) NSString *name;
69+
70+
/**
71+
@abstract A read-write version of POPAnimatableProperty readBlock property.
72+
*/
73+
@property (readwrite, nonatomic, copy) void (^readBlock)(id obj, CGFloat values[]);
74+
75+
/**
76+
@abstract A read-write version of POPAnimatableProperty writeBlock property.
77+
*/
78+
@property (readwrite, nonatomic, copy) void (^writeBlock)(id obj, const CGFloat values[]);
79+
80+
/**
81+
@abstract A read-write version of POPAnimatableProperty threshold property.
82+
*/
83+
@property (readwrite, nonatomic, assign) CGFloat threshold;
84+
85+
@end
86+
87+
/**
88+
Common CALayer property names.
89+
*/
90+
extern NSString * const kPOPLayerBackgroundColor;
91+
extern NSString * const kPOPLayerBounds;
92+
extern NSString * const kPOPLayerOpacity;
93+
extern NSString * const kPOPLayerPosition;
94+
extern NSString * const kPOPLayerPositionX;
95+
extern NSString * const kPOPLayerPositionY;
96+
extern NSString * const kPOPLayerRotation;
97+
extern NSString * const kPOPLayerRotationX;
98+
extern NSString * const kPOPLayerRotationY;
99+
extern NSString * const kPOPLayerScaleX;
100+
extern NSString * const kPOPLayerScaleXY;
101+
extern NSString * const kPOPLayerScaleY;
102+
extern NSString * const kPOPLayerSize;
103+
extern NSString * const kPOPLayerSubscaleXY;
104+
extern NSString * const kPOPLayerSubtranslationX;
105+
extern NSString * const kPOPLayerSubtranslationXY;
106+
extern NSString * const kPOPLayerSubtranslationY;
107+
extern NSString * const kPOPLayerSubtranslationZ;
108+
extern NSString * const kPOPLayerTranslationX;
109+
extern NSString * const kPOPLayerTranslationXY;
110+
extern NSString * const kPOPLayerTranslationY;
111+
extern NSString * const kPOPLayerTranslationZ;
112+
extern NSString * const kPOPLayerZPosition;
113+
114+
115+
/**
116+
Common NSLayoutConstraint property names.
117+
*/
118+
extern NSString * const kPOPLayoutConstraintConstant;
119+
120+
121+
#if TARGET_OS_IPHONE
122+
123+
/**
124+
Common UIView property names.
125+
*/
126+
extern NSString * const kPOPViewAlpha;
127+
extern NSString * const kPOPViewBackgroundColor;
128+
extern NSString * const kPOPViewBounds;
129+
extern NSString * const kPOPViewCenter;
130+
extern NSString * const kPOPViewFrame;
131+
extern NSString * const kPOPViewScaleX;
132+
extern NSString * const kPOPViewScaleXY;
133+
extern NSString * const kPOPViewScaleY;
134+
extern NSString * const kPOPViewSize;
135+
136+
137+
/**
138+
Common UITableView property names.
139+
*/
140+
extern NSString * const kPOPTableViewContentOffset;
141+
extern NSString * const kPOPTableViewContentSize;
142+
143+
144+
#endif

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /