19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#import "OFColor.h"
#import "OFConcreteColor.h"
#import "OFOnce.h"
#import "OFString.h"
#import "OFTaggedPointerColor.h"
@interface OFColorSingleton: OFConcreteColor
@end
@interface OFPlaceholderColor: OFColor
@end
static struct {
Class isa;
} placeholder;
#ifdef OF_OBJFW_RUNTIME
|
|
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#import "OFColor.h"
#import "OFConcreteColor.h"
#import "OFOnce.h"
#import "OFString.h"
#import "OFTaggedPointerColor.h"
@interface OFPlaceholderColor: OFColor
@end
@interface OFConcreteColorSingleton: OFConcreteColor
@end
static struct {
Class isa;
} placeholder;
#ifdef OF_OBJFW_RUNTIME
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
blue: blue
alpha: alpha];
}
OF_SINGLETON_METHODS
@end
@implementation OFColorSingleton
OF_SINGLETON_METHODS
@end
@implementation OFColor
+ (void)initialize
{
if (self == [OFColor class])
|
|
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
blue: blue
alpha: alpha];
}
OF_SINGLETON_METHODS
@end
@implementation OFConcreteColorSingleton
OF_SINGLETON_METHODS
@end
@implementation OFColor
+ (void)initialize
{
if (self == [OFColor class])
|
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#define PREDEFINED_COLOR(name, redValue, greenValue, blueValue) \
static OFColor *name##Color = nil; \
\
static void \
initPredefinedColor_##name(void) \
{ \
name##Color = [[OFColorSingleton alloc] \
initWithRed: redValue \
green: greenValue \
blue: blueValue \
alpha: 1]; \
} \
\
+ (OFColor *)name \
|
|
|
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#define PREDEFINED_COLOR(name, redValue, greenValue, blueValue) \
static OFColor *name##Color = nil; \
\
static void \
initPredefinedColor_##name(void) \
{ \
name##Color = [[OFConcreteColorSingleton alloc] \
initWithRed: redValue \
green: greenValue \
blue: blueValue \
alpha: 1]; \
} \
\
+ (OFColor *)name \
|