Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

Commit 55bd614

Browse files
authored
Merge pull request #100 from natmark/natmark/access_control
access control
2 parents ca05230 + 4d0d1f1 commit 55bd614

11 files changed

Lines changed: 135 additions & 135 deletions

File tree

ProcessingKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ProcessingKit"
3-
s.version = "1.1.0"
3+
s.version = "1.1.1"
44
s.summary = "Visual Designing library for iOS."
55
s.description = <<-DESC
66
ProcessingKit is a Visual Designing library for iOS.

ProcessingKit/Core/Color/Color.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ public protocol ColorComponentsContract {
2020
var strokeWeight: CGFloat { get set }
2121
}
2222

23-
class ColorComponents: ColorComponentsContract {
24-
var fill: UIColor = UIColor.white
25-
var stroke: UIColor = UIColor.clear
26-
var strokeWeight: CGFloat = 1.0
27-
}
28-
2923
public protocol ColorModelContract {
3024
func background(_ color: UIColor)
3125
func background(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat)
@@ -39,56 +33,62 @@ public protocol ColorModelContract {
3933
mutating func noStroke()
4034
}
4135

42-
struct ColorModel: ColorModelContract {
36+
public class ColorComponents: ColorComponentsContract {
37+
public var fill: UIColor = UIColor.white
38+
public var stroke: UIColor = UIColor.clear
39+
public var strokeWeight: CGFloat = 1.0
40+
}
41+
42+
public struct ColorModel: ColorModelContract {
4343
private var contextComponents: ContextComponenetsContract
4444
private var colorComponents: ColorComponentsContract
4545
private var frameComponents: FrameComponentsContract
4646

47-
init(contextComponents: ContextComponenetsContract, colorComponents: ColorComponentsContract, frameComponents: FrameComponentsContract) {
47+
public init(contextComponents: ContextComponenetsContract, colorComponents: ColorComponentsContract, frameComponents: FrameComponentsContract) {
4848
self.contextComponents = contextComponents
4949
self.colorComponents = colorComponents
5050
self.frameComponents = frameComponents
5151
}
5252

53-
func background(_ color: UIColor) {
53+
public func background(_ color: UIColor) {
5454
let g = self.contextComponents.context()
5555
g?.clear(self.frameComponents.bounds)
5656
}
5757

58-
func background(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat) {
58+
public func background(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat) {
5959
self.background(UIColor(red: r / 255.0, green: g / 255.0, blue: b / 255.0, alpha: a / 255.0))
6060
}
6161

62-
func clear() {
62+
public func clear() {
6363
let g = self.contextComponents.context()
6464
g?.clear(self.frameComponents.bounds)
6565
}
6666

67-
mutating func fill(_ color: UIColor) {
67+
public mutating func fill(_ color: UIColor) {
6868
self.colorComponents.fill = color
6969
}
7070

71-
mutating func fill(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat) {
71+
public mutating func fill(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat) {
7272
self.fill(UIColor(red: r / 255.0, green: g / 255.0, blue: b / 255.0, alpha: a / 255.0))
7373
}
7474

75-
mutating func stroke(_ color: UIColor) {
75+
public mutating func stroke(_ color: UIColor) {
7676
self.colorComponents.stroke = color
7777
}
7878

79-
mutating func stroke(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat) {
79+
public mutating func stroke(_ r: CGFloat, _ g: CGFloat, _ b: CGFloat, _ a: CGFloat) {
8080
self.stroke(UIColor(red: r / 255.0, green: g / 255.0, blue: b / 255.0, alpha: a / 255.0))
8181
}
8282

83-
mutating func strokeWeight(_ weight: CGFloat) {
83+
public mutating func strokeWeight(_ weight: CGFloat) {
8484
self.colorComponents.strokeWeight = weight
8585
}
8686

87-
mutating func noFill() {
87+
public mutating func noFill() {
8888
self.colorComponents.fill = UIColor.clear
8989
}
9090

91-
mutating func noStroke() {
91+
public mutating func noStroke() {
9292
self.colorComponents.stroke = UIColor.clear
9393
}
9494
}

ProcessingKit/Core/Context/Context.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public protocol ContextComponenetsContract {
2727
func context() -> CGContext?
2828
}
2929

30-
class ContextComponents: ContextComponenetsContract {
31-
func context() -> CGContext? {
30+
public class ContextComponents: ContextComponenetsContract {
31+
public func context() -> CGContext? {
3232
#if os(iOS)
3333
return UIGraphicsGetCurrentContext()
3434
#elseif os(OSX)

ProcessingKit/Core/Environment/Frame.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,42 @@ public protocol FrameComponentsContract {
2121
var frameCount: UInt64 { get set }
2222
}
2323

24-
class FrameComponents: FrameComponentsContract {
25-
var bounds: CGRect = CGRect.zero
26-
var frame: CGRect = CGRect.zero
27-
var frameRate: CGFloat = 60.0
28-
var frameCount: UInt64 = 0
29-
}
30-
3124
public protocol FrameModelContract {
3225
var width: CGFloat { get }
3326
var height: CGFloat { get }
3427
var frameRate: CGFloat { get }
3528
mutating func frameRate(_ fps: CGFloat)
3629
}
3730

38-
struct FrameModel: FrameModelContract {
31+
public class FrameComponents: FrameComponentsContract {
32+
public var bounds: CGRect = CGRect.zero
33+
public var frame: CGRect = CGRect.zero
34+
public var frameRate: CGFloat = 60.0
35+
public var frameCount: UInt64 = 0
36+
}
37+
38+
public struct FrameModel: FrameModelContract {
3939
private var frameComponents: FrameComponentsContract
4040
private var timer: Timer?
4141

42-
init(frameComponents: FrameComponentsContract, timer: Timer?) {
42+
public init(frameComponents: FrameComponentsContract, timer: Timer?) {
4343
self.frameComponents = frameComponents
4444
self.timer = timer
4545
}
4646

47-
var width: CGFloat {
47+
public var width: CGFloat {
4848
return self.frameComponents.bounds.size.width
4949
}
5050

51-
var height: CGFloat {
51+
public var height: CGFloat {
5252
return self.frameComponents.bounds.size.height
5353
}
5454

55-
var frameRate: CGFloat {
55+
public var frameRate: CGFloat {
5656
return self.frameComponents.frameRate
5757
}
5858

59-
mutating func frameRate(_ fps: CGFloat) {
59+
public mutating func frameRate(_ fps: CGFloat) {
6060
self.frameComponents.frameRate = fps
6161
}
6262
}

ProcessingKit/Core/Image/Image.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ public protocol ImageModelContract {
2222
#endif
2323
}
2424

25-
struct ImageModel: ImageModelContract {
25+
public struct ImageModel: ImageModelContract {
2626
private var contextComponents: ContextComponenetsContract
2727

28-
init(contextComponents: ContextComponenetsContract) {
28+
public init(contextComponents: ContextComponenetsContract) {
2929
self.contextComponents = contextComponents
3030
}
3131

3232
#if os(iOS)
33-
func image(_ img: UIImage, _ x: CGFloat, _ y: CGFloat) {
33+
public func image(_ img: UIImage, _ x: CGFloat, _ y: CGFloat) {
3434
let g = self.contextComponents.context()
3535
g?.saveGState()
3636
g?.translateBy(x: 0.0, y: img.size.height)
@@ -41,7 +41,7 @@ struct ImageModel: ImageModelContract {
4141
g?.restoreGState()
4242
}
4343

44-
func image(_ img: UIImage, _ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) {
44+
public func image(_ img: UIImage, _ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) {
4545
let g = self.contextComponents.context()
4646
g?.saveGState()
4747
g?.translateBy(x: 0.0, y: height)
@@ -52,7 +52,7 @@ struct ImageModel: ImageModelContract {
5252
g?.restoreGState()
5353
}
5454
#elseif os(OSX)
55-
func drawImage(_ img: NSImage, _ x: CGFloat, _ y: CGFloat) {
55+
public func drawImage(_ img: NSImage, _ x: CGFloat, _ y: CGFloat) {
5656
let g = self.contextComponents.context()
5757
g?.saveGState()
5858
g?.translateBy(x: 0.0, y: img.size.height)
@@ -63,7 +63,7 @@ struct ImageModel: ImageModelContract {
6363
g?.restoreGState()
6464
}
6565

66-
func drawImage(_ img: NSImage, _ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) {
66+
public func drawImage(_ img: NSImage, _ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) {
6767
let g = self.contextComponents.context()
6868
g?.saveGState()
6969
g?.translateBy(x: 0.0, y: height)

ProcessingKit/Core/Input/Date.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@ public protocol DateModelContract {
1818
func year() -> Int
1919
}
2020

21-
struct DateModel: DateModelContract {
22-
var currentDate: Date?
21+
public struct DateModel: DateModelContract {
22+
private var currentDate: Date?
2323
// for test
24-
init(currentDate: Date) {
24+
public init(currentDate: Date) {
2525
self.currentDate = currentDate
2626
}
2727

2828
init() {
2929
}
3030

31-
func millis() -> Int {
31+
public func millis() -> Int {
3232
return self.getMillis()
3333
}
3434

35-
func second() -> Int {
35+
public func second() -> Int {
3636
return self.getComponents().second ?? 0
3737
}
3838

39-
func minute() -> Int {
39+
public func minute() -> Int {
4040
return self.getComponents().minute ?? 0
4141
}
4242

43-
func hour() -> Int {
43+
public func hour() -> Int {
4444
return self.getComponents().hour ?? 0
4545
}
4646

47-
func day() -> Int {
47+
public func day() -> Int {
4848
return self.getComponents().day ?? 0
4949
}
5050

51-
func month() -> Int {
51+
public func month() -> Int {
5252
return self.getComponents().month ?? 0
5353
}
5454

55-
func year() -> Int {
55+
public func year() -> Int {
5656
return self.getComponents().year ?? 0
5757
}
5858

0 commit comments

Comments
 (0)